* code for task#2154.
This commit is contained in:
@@ -239,8 +239,7 @@ class task extends control
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n" ;
|
||||
$fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : '';
|
||||
$actionID = $this->action->create('task', $taskID, $action, $fileAction . $this->post->comment);
|
||||
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($taskID, $actionID);
|
||||
@@ -606,11 +605,13 @@ class task extends control
|
||||
$this->loadModel('action');
|
||||
$changes = $this->task->finish($taskID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$files = $this->loadModel('file')->saveUpload('task', $taskID);
|
||||
|
||||
$task = $this->task->getById($taskID);
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
{
|
||||
$actionID = $this->action->create('task', $taskID, 'Finished', $this->post->comment);
|
||||
$fileAction = !empty($files) ? $this->lang->addFiles . join(',', $files) . "\n" : '';
|
||||
$actionID = $this->action->create('task', $taskID, 'Finished', $fileAction . $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($taskID, $actionID);
|
||||
}
|
||||
|
||||
@@ -575,7 +575,8 @@ class taskModel extends model
|
||||
->setDefault('status', 'done')
|
||||
->setDefault('finishedBy, lastEditedBy', $this->app->user->account)
|
||||
->setDefault('finishedDate, lastEditedDate', $now)
|
||||
->remove('comment')->get();
|
||||
->remove('comment,files,labels')
|
||||
->get();
|
||||
|
||||
if(!is_numeric($task->consumed)) die(js::error($this->lang->task->error->consumedNumber));
|
||||
|
||||
@@ -586,7 +587,8 @@ class taskModel extends model
|
||||
->setDefault('task', $taskID)
|
||||
->setDefault('date', date(DT_DATE1))
|
||||
->setDefault('left', 0)
|
||||
->remove('finishedDate,comment,assignedTo')->get();
|
||||
->remove('finishedDate,comment,assignedTo,files,labels')
|
||||
->get();
|
||||
$estimate->consumed = $estimate->consumed - $oldTask->consumed;
|
||||
if($estimate->consumed) $this->addTaskEstimate($estimate);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<small class='text-success'> <?php echo $lang->task->finish;?> <?php echo html::icon($lang->icons['finish']);?></small>
|
||||
</div>
|
||||
</div>
|
||||
<form class='form-condensed' method='post' target='hiddenwin'>
|
||||
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->task->consumed;?></th>
|
||||
@@ -34,7 +34,10 @@
|
||||
<th><?php echo $lang->task->finishedDate;?></th>
|
||||
<td><div class='datepicker-wrapper'><?php echo html::input('finishedDate', helper::today(), "class='form-control form-date'");?></div></td><td></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><?php echo $lang->files;?></th>
|
||||
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->comment;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('comment', '', "rows='6' class='w-p98'");?></td>
|
||||
|
||||
Reference in New Issue
Block a user