Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
fad343ed
Commit
fad343ed
authored
12 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Improve ticket assignment
parent
7f86bada
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/class.ticket.php
+32
-20
32 additions, 20 deletions
include/class.ticket.php
with
32 additions
and
20 deletions
include/class.ticket.php
+
32
−
20
View file @
fad343ed
...
@@ -680,16 +680,18 @@ class Ticket {
...
@@ -680,16 +680,18 @@ class Ticket {
}
}
//Set staff ID...assign/unassign/release (id can be 0)
//Set staff ID...assign/unassign/release (id can be 0)
function
setStaffId
(
$staffId
){
function
setStaffId
(
$staffId
)
{
if
(
!
is_numeric
(
$staffId
))
return
false
;
$sql
=
'UPDATE '
.
TICKET_TABLE
.
' SET updated=NOW(), staff_id='
.
db_input
(
$staffId
)
$sql
=
'UPDATE '
.
TICKET_TABLE
.
' SET updated=NOW(), staff_id='
.
db_input
(
$staffId
)
.
' WHERE ticket_id='
.
db_input
(
$this
->
getId
());
.
' WHERE ticket_id='
.
db_input
(
$this
->
getId
());
if
(
db_query
(
$sql
)
&&
db_affected_rows
())
{
if
(
!
db_query
(
$sql
)
||
!
db_affected_rows
())
$this
->
staff_id
=
$staffId
;
return
false
;
return
true
;
}
$this
->
staff_id
=
$staffId
;
return
fals
e
;
return
tru
e
;
}
}
function
setSLAId
(
$slaId
)
{
function
setSLAId
(
$slaId
)
{
...
@@ -730,12 +732,14 @@ class Ticket {
...
@@ -730,12 +732,14 @@ class Ticket {
}
}
//Set team ID...assign/unassign/release (id can be 0)
//Set team ID...assign/unassign/release (id can be 0)
function
setTeamId
(
$teamId
){
function
setTeamId
(
$teamId
)
{
$sql
=
'UPDATE '
.
TICKET_TABLE
.
' SET updated=NOW(), team_id='
.
db_input
(
$teamId
)
if
(
!
is_numeric
(
$teamId
))
return
false
;
.
' WHERE ticket_id='
.
db_input
(
$this
->
getId
());
$sql
=
'UPDATE '
.
TICKET_TABLE
.
' SET updated=NOW(), team_id='
.
db_input
(
$teamId
)
.
' WHERE ticket_id='
.
db_input
(
$this
->
getId
());
return
(
db_query
(
$sql
)
&&
db_affected_rows
());
return
(
db_query
(
$sql
)
&&
db_affected_rows
());
}
}
//Status helper.
//Status helper.
...
@@ -996,8 +1000,8 @@ class Ticket {
...
@@ -996,8 +1000,8 @@ class Ticket {
$this
->
reload
();
$this
->
reload
();
$
note
=
$note
?
$note
:
'Ticket assignment'
;
$
comments
=
$comments
?
$comments
:
'Ticket assignment'
;
$assigner
=
$thisstaff
?
$thisstaff
:
'SYSTEM (Auto Assignment)'
;
$assigner
=
$thisstaff
?
$thisstaff
:
'SYSTEM (Auto Assignment)'
;
//Log an internal note - no alerts on the internal note.
//Log an internal note - no alerts on the internal note.
$this
->
postNote
(
'Ticket Assigned to '
.
$assignee
->
getName
(),
$comments
,
$assigner
,
false
);
$this
->
postNote
(
'Ticket Assigned to '
.
$assignee
->
getName
(),
$comments
,
$assigner
,
false
);
...
@@ -1328,15 +1332,23 @@ class Ticket {
...
@@ -1328,15 +1332,23 @@ class Ticket {
if
(
!
$this
->
isAssigned
())
//We can't release what is not assigned buddy!
if
(
!
$this
->
isAssigned
())
//We can't release what is not assigned buddy!
return
true
;
return
true
;
//We're unassigning in the order of precedence.
//We can only unassigned OPEN tickets.
if
(
$this
->
getStaffId
())
if
(
$this
->
isClosed
())
return
$this
->
setStaffId
(
0
);
return
false
;
elseif
(
$this
->
getTeamId
())
return
$this
->
setTeamId
(
0
);
return
false
;
//Unassign staff (if any)
}
if
(
$this
->
getStaffId
()
&&
!
$this
->
setStaffId
(
0
))
return
false
;
//unassign team (if any)
if
(
$this
->
getTeamId
()
&&
!
$this
->
setTeamId
(
0
))
return
false
;
$this
->
reload
();
return
true
;
}
function
release
()
{
function
release
()
{
return
$this
->
unassign
();
return
$this
->
unassign
();
}
}
...
...
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