Merge branch 'master' into zenops_44
This commit is contained in:
+20
-9
@@ -1182,10 +1182,10 @@ class task extends control
|
||||
$orderBy = 'date,id';
|
||||
if(!empty($task->team) and $task->mode == 'linear') $orderBy = 'order,date,id';
|
||||
|
||||
$this->view->task = $task;
|
||||
$this->view->estimates = $this->task->getTaskEstimate($taskID, '', '', $orderBy);
|
||||
$this->view->title = $this->lang->task->record;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
|
||||
$this->view->title = $this->lang->task->record;
|
||||
$this->view->task = $task;
|
||||
$this->view->efforts = $this->task->getTaskEstimate($taskID, '', '', $orderBy);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -1228,20 +1228,31 @@ class task extends control
|
||||
*/
|
||||
public function deleteEstimate($estimateID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
$estimate = $this->task->getEstimateById($estimateID);
|
||||
$taskID = $estimate->objectID;
|
||||
$task = $this->task->getById($taskID);
|
||||
if($confirm == 'no' and $task->consumed - $estimate->consumed != 0)
|
||||
{
|
||||
return print(js::confirm($this->lang->task->confirmDeleteEstimate, $this->createLink('task', 'deleteEstimate', "estimateID=$estimateID&confirm=yes")));
|
||||
}
|
||||
elseif($confirm == 'no' and $task->consumed - $estimate->consumed == 0)
|
||||
{
|
||||
return print(js::confirm($this->lang->task->confirmDeleteLastEstimate, $this->createLink('task', 'deleteEstimate', "estimateID=$estimateID&confirm=yes")));
|
||||
}
|
||||
else
|
||||
{
|
||||
$estimate = $this->task->getEstimateById($estimateID);
|
||||
$task = $this->task->getById($estimate->task);
|
||||
$changes = $this->task->deleteEstimate($estimateID);
|
||||
$changes = $this->task->deleteEstimate($estimateID);
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('task', $estimate->task, 'DeleteEstimate');
|
||||
$actionID = $this->loadModel('action')->create('task', $taskID, 'DeleteEstimate');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
if($task->consumed - $estimate->consumed == 0)
|
||||
{
|
||||
$this->action->create('task', $taskID, 'Adjusttasktowait');
|
||||
return print(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
return print(js::reload('parent'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user