Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
b8445a9f
Commit
b8445a9f
authored
6 years ago
by
Peter Rotich
Browse files
Options
Downloads
Plain Diff
Merge branch 'issue/default-role' into develop-next
parents
a452940a
280ec6f5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/class.staff.php
+4
-2
4 additions, 2 deletions
include/class.staff.php
include/staff/ticket-view.inc.php
+2
-1
2 additions, 1 deletion
include/staff/ticket-view.inc.php
scp/tickets.php
+16
-5
16 additions, 5 deletions
scp/tickets.php
with
22 additions
and
8 deletions
include/class.staff.php
+
4
−
2
View file @
b8445a9f
...
...
@@ -476,8 +476,10 @@ implements AuthenticatedUser, EmailContact, TemplateVariable, Searchable {
if
(
$assigned
&&
$this
->
usePrimaryRoleOnAssignment
())
return
$this
->
role
;
// View only access
return
new
Role
(
array
());
// Ticket Create & View only access
$perms
=
JSONDataEncoder
::
encode
(
array
(
Ticket
::
PERM_CREATE
=>
1
));
return
new
Role
(
array
(
'permissions'
=>
$perms
));
}
function
hasPerm
(
$perm
,
$global
=
true
)
{
...
...
This diff is collapsed.
Click to expand it.
include/staff/ticket-view.inc.php
+
2
−
1
View file @
b8445a9f
...
...
@@ -118,7 +118,8 @@ if($ticket->isOverdue())
||
$dept
->
isMember
(
$thisstaff
))
)
{
?>
<li><a
class=
"no-pjax ticket-action"
data-redirect=
"tickets.php"
data-redirect=
"tickets.php?id=
<?php
echo
$ticket
->
getId
();
?>
"
href=
"#tickets/
<?php
echo
$ticket
->
getId
();
?>
/claim"
><i
class=
"icon-chevron-sign-down"
></i>
<?php
echo
__
(
'Claim'
);
?>
</a>
<?php
...
...
This diff is collapsed.
Click to expand it.
scp/tickets.php
+
16
−
5
View file @
b8445a9f
...
...
@@ -30,7 +30,7 @@ $redirect = false;
if
(
$_REQUEST
[
'id'
]
||
$_REQUEST
[
'number'
])
{
if
(
$_REQUEST
[
'id'
]
&&
!
(
$ticket
=
Ticket
::
lookup
(
$_REQUEST
[
'id'
])))
$errors
[
'err'
]
=
sprintf
(
__
(
'%s: Unknown or invalid ID.'
),
__
(
'ticket'
));
elseif
(
$_REQUEST
[
'number'
]
&&
!
(
$ticket
=
Ticket
::
lookup
(
[
'number'
=>
$_REQUEST
[
'number'
]
]
)))
elseif
(
$_REQUEST
[
'number'
]
&&
!
(
$ticket
=
Ticket
::
lookup
(
array
(
'number'
=>
$_REQUEST
[
'number'
]
)
)))
$errors
[
'err'
]
=
sprintf
(
__
(
'%s: Unknown or invalid number.'
),
__
(
'ticket'
));
elseif
(
!
$ticket
->
checkStaffPerm
(
$thisstaff
))
{
$errors
[
'err'
]
=
__
(
'Access denied. Contact admin if you believe this is in error'
);
...
...
@@ -192,9 +192,12 @@ if($_POST && !$errors):
'ticket.response.'
.
$ticket
->
getId
(),
$thisstaff
->
getId
());
// Go back to the ticket listing page on reply
$ticket
=
null
;
if
(
$ticket
->
isClosed
())
$ticket
=
null
;
$redirect
=
'tickets.php'
;
if
(
$ticket
)
$redirect
=
'tickets.php?id='
.
$ticket
->
getId
();
}
elseif
(
!
$errors
[
'err'
])
{
$errors
[
'err'
]
=
sprintf
(
'%s %s'
,
...
...
@@ -225,7 +228,12 @@ if($_POST && !$errors):
$wasOpen
=
(
$ticket
->
isOpen
());
if
((
$note
=
$ticket
->
postNote
(
$vars
,
$errors
,
$thisstaff
)))
{
$msg
=
__
(
'Internal note posted successfully'
);
$msg
=
sprintf
(
__
(
'%s: %s posted successfully'
),
sprintf
(
__
(
'Ticket #%s'
),
sprintf
(
'<a href="tickets.php?id=%d"><b>%s</b></a>'
,
$ticket
->
getId
(),
$ticket
->
getNumber
())),
__
(
'Internal note'
)
);
// Clear attachment list
$note_form
->
setSource
(
array
());
$note_form
->
getField
(
'attachments'
)
->
reset
();
...
...
@@ -241,6 +249,9 @@ if($_POST && !$errors):
$thisstaff
->
getId
());
$redirect
=
'tickets.php'
;
if
(
$ticket
)
$redirect
=
'tickets.php?id='
.
$ticket
->
getId
();
}
else
{
if
(
!
$errors
[
'err'
])
...
...
@@ -414,7 +425,7 @@ if($_POST && !$errors):
// Drop files from the response attachments widget
$response_form
->
setSource
(
array
());
$response_form
->
getField
(
'attachments'
)
->
reset
();
unset
(
$_SESSION
[
':form-data'
]
)
;
$_SESSION
[
':form-data'
]
=
null
;
}
elseif
(
!
$errors
[
'err'
])
{
$errors
[
'err'
]
=
sprintf
(
'%s %s'
,
__
(
'Unable to create the ticket.'
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment