Hi,
is it possible, in the 1.9.12 version of osTicket, add a dropdown menu for changing the priority of a ticket without edit it? (something like the "Change status" dropdown in the tickets list)
If yes, what files I need to edit for reach this?
Thanks
@davideakc
Hey, with standard option this isn't possible.
With a bit of php/html and maybe sql knowledge you can adapt the "change status" and use the same way for "Change priority".
I'm not sure, but maybe this is a feature which will be added in 1.10 anytime, too.
CHEERS
Admin panel -> Mange -> Forms -> Ticket Details
Change to required.
@ntozier, I wanted a fast option for changing the priority level without entering in the ticket, without clicking on "Edit" for edit the ticket
I wanted a fast option for set another level of priority...
Oh my bad. My response is not about editing the ticket. My response is to allow the user opening the ticket the ability to select the Priority they want... I mistakenly thought that's what you were looking for. But now that I re-read this I see that this is not an issue report, its a feature request. You want a Change Priority either on the ticket list and quite possibly also the ticket view.
@greezybacon @protich can one of you mark this as Feature Request please.
So for now there isn't a code for doing it?
We call this mass actions. Here's an example of how to do it on the develop branch (v1.10-rc.3). Perhaps we should make this more pluggable. I do like the idea.
--- a/include/ajax.tickets.php
+++ b/include/ajax.tickets.php
@@ -556,6 +556,9 @@ class TicketsAjaxAPI extends AjaxController {
'close' => array(
'verbed' => __('closed'),
),
+ 'priority' => array(
+ 'verbed' => __('changed priority'),
+ ),
);
if (!isset($actions[$action]))
@@ -756,6 +759,50 @@ class TicketsAjaxAPI extends AjaxController {
}
}
break;
+
+ case 'priority':
+ $inc = 'delete.tmpl.php';
+ $info[':action'] = "#tickets/mass/priority/{$w}";
+ $verb = __('Update');
+ $info[':title'] = sprintf('Change Priority On %s',
+ _N('selected ticket', 'selected tickets', $count));
+
+ $info[':placeholder'] = sprintf(__(
+ 'Optional reason for changing priority on %s'),
+ _N('selected ticket', 'selected tickets', $count));
+
+ if (!($P = Priority::lookup($w)))
+ Http::response(422, 'No such priority');
+
+ // Generic permission check.
+ if (!$thisstaff->hasPerm(Ticket::PERM_EDIT, false))
+ $errors['err'] = sprintf(
+ __('You do not have permission %s'),
+ __('to edit tickets'));
+
+ if ($_POST && !$errors) {
+ foreach (Ticket::objects()
+ ->filter(['ticket_id__in' => $_POST['tids']])
+ as $ticket) {
+ if (!$thisstaff->getRole($ticket->dept_id)->hasPerm(Ticket::PERM_EDIT))
+ continue;
+
+ if ($_POST['comments'])
+ $ticket->logNote(null, $_POST['comments'],
+ $thisstaff);
+
+ $entries = DynamicFormEntry::forTicket($ticket->getId());
+ foreach ($entries as $E) {
+ if ($E->form->type !== 'T')
+ continue;
+ $E->setAnswer('priority', null, $P->priority_id);
+ if ($E->save())
+ $i++;
+ }
+ }
+ }
+ break;
+
default:
Http::response(404, __('Unknown action'));
}
diff --git a/include/staff/templates/tickets-actions.tmpl.php b/include/staff/templates/tickets-actions.tmpl.php
index 0535a5a..bede510 100644
--- a/include/staff/templates/tickets-actions.tmpl.php
+++ b/include/staff/templates/tickets-actions.tmpl.php
@@ -42,6 +42,27 @@ if ($agent->hasPerm(Ticket::PERM_TRANSFER, false)) {?>
<?php
}
+// Mass Priority Change
+if ($agent->hasPerm(Ticket::PERM_EDIT, false)) {?>
+<span
+ class="action-button" data-placement="bottom"
+ data-dropdown="#action-dropdown-change-priority" data-toggle="tooltip" title=" <?php
+ echo __('Change Priority'); ?>">
+ <i class="icon-caret-down pull-right"></i>
+ <a class="tickets-action" id="tickets-assign"
+ href="#tickets/mass/priority"><i class="icon-exclamation"></i></a>
+</span>
+<div id="action-dropdown-change-priority" class="action-dropdown anchor-right">
+ <ul>
+<?php foreach (Priority::getPriorities() as $Pid => $Pname) { ?>
+ <li><a class="no-pjax tickets-action"
+ href="#tickets/mass/priority/<?php echo $Pid; ?>"><i
+ class="icon-level-up"></i> <?php echo $Pname; ?></a>
+<?php } ?>
+ </ul>
+</div>
+<?php
+}
// Mass Delete
if ($agent->hasPerm(Ticket::PERM_DELETE, false)) {?>

Making it more pluggable it's definitely the right way - agree on this with you @greezybacon
And thanks for the screenshot! :+1:
@greezybacon thanks!
Can you adapt it for the 1.9.12 version?
Thanks again!
@davideakc new features are rarely (more like never) back ported to old versions.
@ntozier so I need to make the code for the 1.2.12...
Ok, thanks for the reply!
I put a pull request together for this.
I'm curious if something new is here about this feature?
I would like to have a dropdown menu for changing the priority of a ticket without edit it in exactly the same way as Ticket Status drop-down menu is done in Post Reply section of ticket.
I'm using osTicket 1.10.1.