* adjust the task actions logic.
This commit is contained in:
@@ -156,7 +156,6 @@ class task extends control
|
||||
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
|
||||
}
|
||||
|
||||
|
||||
/* 导航信息。*/
|
||||
$this->view->header->title = $this->lang->task->logEfforts;
|
||||
$this->view->position[] = $this->lang->task->logEfforts;
|
||||
@@ -164,7 +163,6 @@ class task extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
/* 查看任务。*/
|
||||
public function view($taskID)
|
||||
{
|
||||
@@ -213,7 +211,7 @@ class task extends control
|
||||
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$action = !empty($changes) ? 'Started' : 'Commented';
|
||||
$actionID = $this->action->create('task', $taskID, $action, $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($taskID, $actionID);
|
||||
@@ -243,7 +241,7 @@ class task extends control
|
||||
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$action = !empty($changes) ? 'Finished' : 'Commented';
|
||||
$actionID = $this->action->create('task', $taskID, $action, $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($taskID, $actionID);
|
||||
@@ -273,7 +271,7 @@ class task extends control
|
||||
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$action = !empty($changes) ? 'Canceled' : 'Commented';
|
||||
$actionID = $this->action->create('task', $taskID, $action, $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
$this->sendmail($taskID, $actionID);
|
||||
|
||||
@@ -100,6 +100,7 @@ class taskModel extends model
|
||||
->setIF($this->post->consumed > 0 and $this->post->left > 0 and $this->post->status == 'wait', 'status', 'doing')
|
||||
->remove('comment')
|
||||
->get();
|
||||
$task->statusCustom = strpos(self::CUSTOM_STATUS_ORDER, $task->status) + 1;
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($task)
|
||||
->autoCheck()
|
||||
|
||||
@@ -29,12 +29,16 @@
|
||||
<caption><?php echo $task->name;?></caption>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->task->estimate;?></td>
|
||||
<td><?php echo $task->estimate;?></td>
|
||||
<td><?php echo html::input('estimate', $task->estimate, "class='text-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->consumed;?></th>
|
||||
<td><?php echo $task->consumed;?></td>
|
||||
<td><?php echo html::input('consumed', $task->consumed, "class='text-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->task->left;?></th>
|
||||
<td><?php echo html::input('left', $task->left, "class='text-3'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='rowhead'><?php echo $lang->comment;?></td>
|
||||
<td><?php echo html::textarea('comment', '', "rows='6' class='area-1'");?></td>
|
||||
@@ -42,8 +46,8 @@
|
||||
<tr>
|
||||
<td colspan='2' class='a-center'>
|
||||
<?php
|
||||
echo html::submitButton();
|
||||
echo html::hidden('status', 'cancel');
|
||||
echo html::submitButton();
|
||||
echo html::hidden('status', 'cancel');
|
||||
?>
|
||||
<input type='button' value='<?php echo $lang->task->buttonBackToList;?>' class='button-s'
|
||||
onclick='location.href="<?php echo $this->session->taskList;?>"' />
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
if(!$task->deleted)
|
||||
{
|
||||
if(!common::printLink('task', 'edit', "taskID=$task->id", $lang->task->buttonEdit)) echo $lang->task->buttonEdit . ' ';
|
||||
if(!($task->status == 'wait' and common::printLink('task', 'start', "taskID=$task->id", $lang->task->buttonStart))) echo $lang->task->buttonStart . ' ';
|
||||
if(!(($task->status == 'wait' or $task->status == 'doing') and common::printLink('task', 'complete', "taskID=$task->id", $lang->task->buttonDone))) echo $lang->task->buttonDone . ' ';
|
||||
if(!(($task->status == 'wait' or $task->status == 'doing') and common::printLink('task', 'cancel', "taskID=$task->id", $lang->task->buttonCancel))) echo $lang->task->buttonCancel . ' ';
|
||||
if(!(($task->status == 'wait' or $task->status == 'cancel') and common::printLink('task', 'start', "taskID=$task->id", $lang->task->buttonStart))) echo $lang->task->buttonStart . ' ';
|
||||
if(!(($task->status == 'wait' or $task->status == 'doing') and common::printLink('task', 'complete', "taskID=$task->id", $lang->task->buttonDone))) echo $lang->task->buttonDone . ' ';
|
||||
if(!(($task->status == 'wait' or $task->status == 'doing') and common::printLink('task', 'cancel', "taskID=$task->id", $lang->task->buttonCancel))) echo $lang->task->buttonCancel . ' ';
|
||||
if(!common::printLink('task', 'delete',"projectID=$task->project&taskID=$task->id", $lang->task->buttonDelete, 'hiddenwin')) echo $lang->task->buttonDelete . ' ';
|
||||
}
|
||||
echo html::a($browseLink, $lang->goback);
|
||||
|
||||
Reference in New Issue
Block a user