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
6965ca75
Commit
6965ca75
authored
9 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Mass claim/assignment
parent
6a7bcfa9
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/ajax.tickets.php
+51
-3
51 additions, 3 deletions
include/ajax.tickets.php
include/staff/templates/tickets-actions.tmpl.php
+1
-1
1 addition, 1 deletion
include/staff/templates/tickets-actions.tmpl.php
scp/ajax.php
+1
-2
1 addition, 2 deletions
scp/ajax.php
with
53 additions
and
6 deletions
include/ajax.tickets.php
+
51
−
3
View file @
6965ca75
...
...
@@ -496,7 +496,8 @@ class TicketsAjaxAPI extends AjaxController {
__
(
'This ticket'
),
$assigned
);
}
else
{
$info
[
'warn'
]
=
__
(
'Are you sure you want to claim this ticket?'
);
$info
[
'warn'
]
=
sprintf
(
__
(
'Are you sure you want to claim %s?'
),
__
(
'this ticket'
));
}
if
(
$_POST
&&
$form
->
isValid
())
{
...
...
@@ -521,7 +522,7 @@ class TicketsAjaxAPI extends AjaxController {
}
function
massProcess
(
$action
)
{
function
massProcess
(
$action
,
$w
=
null
)
{
global
$thisstaff
;
$actions
=
array
(
...
...
@@ -531,6 +532,9 @@ class TicketsAjaxAPI extends AjaxController {
'assign'
=>
array
(
'verbed'
=>
__
(
'assigned'
),
),
'claim'
=>
array
(
'verbed'
=>
__
(
'assigned'
),
),
'delete'
=>
array
(
'verbed'
=>
__
(
'deleted'
),
),
...
...
@@ -558,12 +562,56 @@ class TicketsAjaxAPI extends AjaxController {
$count
=
$_REQUEST
[
'count'
];
}
switch
(
$action
)
{
case
'claim'
:
$w
=
'me'
;
case
'assign'
:
$inc
=
'assign.tmpl.php'
;
$info
[
':action'
]
=
'#tickets/mass/assign'
;
$info
[
':title'
]
=
sprintf
(
'Assign %s'
,
_N
(
'selected ticket'
,
'selected tickets'
,
$count
));
$form
=
AssignmentForm
::
instantiate
(
$_POST
);
$assignCB
=
function
(
$t
,
$f
,
$e
)
{
return
$t
->
assign
(
$f
,
$e
);
};
$assignees
=
array
();
switch
(
$w
)
{
case
'agents'
:
$prompt
=
__
(
'Select an Agent'
);
foreach
(
Staff
::
getAvailableStaffMembers
()
as
$id
=>
$name
)
$assignees
[
's'
.
$id
]
=
$name
;
break
;
case
'teams'
:
$prompt
=
__
(
'Select a Team'
);
foreach
(
Team
::
getActiveTeams
()
as
$id
=>
$name
)
$assignees
[
't'
.
$id
]
=
$name
;
break
;
case
'me'
:
$info
[
':action'
]
=
'#tickets/mass/claim'
;
$info
[
':title'
]
=
sprintf
(
'Claim %s'
,
_N
(
'selected ticket'
,
'selected tickets'
,
$count
));
$info
[
'warn'
]
=
sprintf
(
__
(
'Are you sure you want to claim %s?'
),
_N
(
'selected ticket'
,
'selected tickets'
,
$count
));
$verb
=
sprintf
(
'%s, %s'
,
__
(
'Yes'
),
__
(
'Claim'
));
$id
=
sprintf
(
's%s'
,
$thisstaff
->
getId
());
$assignees
=
array
(
$id
=>
$thisstaff
->
getName
());
$vars
=
$_POST
?:
array
(
'assignee'
=>
array
(
$id
));
$form
=
ClaimForm
::
instantiate
(
$vars
);
$assignCB
=
function
(
$t
,
$f
,
$e
)
{
return
$t
->
claim
(
$f
,
$e
);
};
break
;
}
if
(
$assignees
)
$form
->
setAssignees
(
$assignees
);
if
(
$prompt
&&
(
$f
=
$form
->
getField
(
'assignee'
)))
$f
->
configure
(
'prompt'
,
$prompt
);
if
(
$_POST
&&
$form
->
isValid
())
{
foreach
(
$_POST
[
'tids'
]
as
$tid
)
{
if
((
$t
=
Ticket
::
lookup
(
$tid
))
...
...
@@ -571,7 +619,7 @@ class TicketsAjaxAPI extends AjaxController {
// access and assign the task.
&&
$t
->
checkStaffPerm
(
$thisstaff
,
Ticket
::
PERM_ASSIGN
)
// Do the assignment
&&
$
t
->
assign
(
$form
,
$e
)
&&
$assign
CB
(
$t
,
$form
,
$e
)
)
$i
++
;
}
...
...
This diff is collapsed.
Click to expand it.
include/staff/templates/tickets-actions.tmpl.php
+
1
−
1
View file @
6965ca75
...
...
@@ -19,7 +19,7 @@ if ($agent->hasPerm(Ticket::PERM_ASSIGN, false)) {?>
<div
id=
"action-dropdown-assign"
class=
"action-dropdown anchor-right"
>
<ul>
<li><a
class=
"no-pjax tickets-action"
href=
"#tickets/mass/
assign/
<?php
echo
$agent
->
getId
();
?>
"
><i
href=
"#tickets/mass/
claim
"
><i
class=
"icon-chevron-sign-down"
></i>
<?php
echo
__
(
'Claim'
);
?>
</a>
<li><a
class=
"no-pjax tickets-action"
href=
"#tickets/mass/assign/agents"
><i
...
...
This diff is collapsed.
Click to expand it.
scp/ajax.php
+
1
−
2
View file @
6965ca75
...
...
@@ -161,8 +161,7 @@ $dispatcher = patterns('',
url_get
(
'^(?P<tid>\d+)/tasks/(?P<id>\d+)/view$'
,
'task'
),
url_post
(
'^(?P<tid>\d+)/tasks/(?P<id>\d+)$'
,
'task'
),
url_get
(
'^lookup'
,
'lookup'
),
url_get
(
'^mass/(?P<action>[\w.]+)'
,
'massProcess'
),
url_post
(
'^mass/(?P<action>[\w.]+)'
,
'massProcess'
),
url
(
'^mass/(?P<action>\w+)(?:/(?P<what>\w+))?'
,
'massProcess'
),
url
(
'^(?P<tid>\d+)/transfer$'
,
'transfer'
),
url
(
'^(?P<tid>\d+)/assign(?:/(?P<to>\w+))?$'
,
'assign'
),
url
(
'^(?P<tid>\d+)/claim$'
,
'claim'
),
...
...
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