Skip to content
Snippets Groups Projects
Commit ac896f4b authored by Peter Rotich's avatar Peter Rotich Committed by Peter Rotich
Browse files

Task: Status change

Log an internal note to parent ticket on status change
Reopen parent ticket if a closed task is reopened
parent 1da9f8b0
Branches
Tags
No related merge requests found
......@@ -59,7 +59,6 @@ class TaskModel extends VerySimpleModel {
'ticket' => array(
'constraint' => array(
'object_type' => "'T'",
'object_id' => 'Ticket.ticket_id',
),
'null' => true,
......@@ -535,8 +534,17 @@ class Task extends TaskModel implements RestrictedAccess, Threadable {
$this->reopen();
$this->closed = null;
$ecb = function ($t) {
$ecb = function ($t) use($thisstaff) {
$t->logEvent('reopened', false, null, 'closed');
if ($t->ticket) {
$t->ticket->reopen();
$vars = array(
'title' => sprintf('Task %s Reopened',
$t->getNumber()),
'note' => __('Task reopened')
);
$t->ticket->logNote($vars['title'], $vars['note'], $thisstaff);
}
};
break;
case 'closed':
......@@ -553,8 +561,16 @@ class Task extends TaskModel implements RestrictedAccess, Threadable {
$this->close();
$this->closed = SqlFunction::NOW();
$ecb = function($t) {
$ecb = function($t) use($thisstaff) {
$t->logEvent('closed');
if ($t->ticket) {
$vars = array(
'title' => sprintf('Task %s Closed',
$t->getNumber()),
'note' => __('Task closed')
);
$t->ticket->logNote($vars['title'], $vars['note'], $thisstaff);
}
};
break;
default:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment