You are not logged in.
Pages: 1
Topic closed
Hello,
Found out that with "Block the solving/closing of a the ticket if task do to" option set to "Yes" you can't solve/close ticket, but you can post a solution (that will close ticket anyway).
I don't know if is it bug or is it feature by design, but if you what to block solution posting while that option is turned on I made a little fix:
Change condition in file /inc/ticket.class.php from
if ($config->getField('is_tickettasktodo')
&& (isset($ticket->input['status'])
&& in_array($ticket->input['status'], array_merge(Ticket::getSolvedStatusArray(),
Ticket::getclosedStatusArray())))) {
foreach($DB->request(['FROM' => 'glpi_tickettasks',
'WHERE' => ['tickets_id' => $ticket->getField('id')]]) as $task) {
if ($task['state'] == 1) {
Session::addMessageAfterRedirect(__("You cannot solve/close a ticket with task do to",
'behaviors'), true, ERROR);
unset($ticket->input['status']);
}
}
}
}
to
if ($config->getField('is_tickettasktodo')
&& (isset($ticket->input['status'])
&& in_array($ticket->input['status'], array_merge(Ticket::getSolvedStatusArray(),
Ticket::getclosedStatusArray()))) || (isset($ticket->input['solution']))) {
foreach($DB->request(['FROM' => 'glpi_tickettasks',
'WHERE' => ['tickets_id' => $ticket->getField('id')]]) as $task) {
if ($task['state'] == 1) {
Session::addMessageAfterRedirect(__("You cannot solve/close a ticket with task do to",
'behaviors'), true, ERROR);
unset($ticket->input['status']);
unset($ticket->input['solution']);
unset($ticket->input['solutiontypes_id']);
}
}
}
}
Last edited by ultraelephant (2017-12-14 06:54:46)
Offline
Thanks had this in past too
http://forum.glpi-project.org/viewtopic.php?id=159429
https://forge.glpi-project.org/projects … .class.php
You can mark this threat as [resolved] in subject of your threat. (This is only available edit of the first post.) It is good for users who help others to quickly see which post is still open.
##############################################
GLPI 9.3.3
Offline
New version published for this issue: https://forge.glpi-project.org/projects/behaviors/files
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
Pages: 1
Topic closed