* adjust the task actions logic.

This commit is contained in:
wangchunsheng
2010-08-02 14:45:03 +00:00
parent 02525ca9a4
commit 30bfa72dc5
6 changed files with 34 additions and 13 deletions

View File

@@ -57,11 +57,15 @@ $lang->action->desc->commented = '$date, Commented by <strong>$actor</strong>.';
$lang->action->desc->activated = '$date, Activated by <strong>$actor</strong>.';
$lang->action->desc->moved = '$date, Moved by <strong>$actor</strong>, previouse is "$extra"';
$lang->action->desc->confirmed = '$date, Confirmed by <strong>$actor</strong>, version is<strong>#$extra</strong>';
$lang->action->desc->started = '$date, Started by <strong>$actor</strong>.';
$lang->action->desc->canceled = '$date, Canceled by <strong>$actor</strong>.';
$lang->action->desc->finished = '$date, Finished by <strong>$actor</strong>.';
$lang->action->desc->diff1 = 'Changed <strong><i>%s</i></strong>, old is "%s", new is "%s".<br />';
$lang->action->desc->diff2 = 'Changed <strong><i>%s</i></strong>, the diff is<blockquote>%s</blockquote>';
/* 用来显示动态信息.*/
$lang->action->label->opened = 'opened';
$lang->action->label->created = 'created';
$lang->action->label->changed = 'changed';
$lang->action->label->edited = 'edited';
$lang->action->label->closed = 'closed';
@@ -79,6 +83,9 @@ $lang->action->label->unlinkedfromplan = 'unlink from plan';
$lang->action->label->linked2project = 'link to project';
$lang->action->label->unlinkedfromproject = 'unlik from project';
$lang->action->label->marked = 'edited';
$lang->action->label->started = 'started';
$lang->action->label->canceled = 'ccanceled';
$lang->action->label->finished = 'finished';
$lang->action->label->login = 'login';
$lang->action->label->logout = "logout";
@@ -94,6 +101,8 @@ $lang->action->label->bug = 'bug|bug|view|bugID=%s';
$lang->action->label->case = 'case|testcase|view|caseID=%s';
$lang->action->label->testtask = 'test task|testtask|view|caseID=%s';
$lang->action->label->todo = 'todo|todo|view|todoID=%s';
$lang->action->label->doclib = 'doc library|doc|browse|libID=%s';
$lang->action->label->doc = 'doc|doc|view|docID=%s';
$lang->action->label->user = 'user';
$lang->action->label->space = ' ';
$lang->action->label->space = ' ';

View File

@@ -57,11 +57,15 @@ $lang->action->desc->commented = '$date, 由 <strong>$actor</strong> 发表评
$lang->action->desc->activated = '$date, 由 <strong>$actor</strong> 激活。';
$lang->action->desc->moved = '$date, 由 <strong>$actor</strong> 移动,之前为 "$extra"';
$lang->action->desc->confirmed = '$date, 由 <strong>$actor</strong> 确认需求变动,最新版本为<strong>#$extra</strong>';
$lang->action->desc->started = '$date, 由 <strong>$actor</strong> 启动。';
$lang->action->desc->canceled = '$date, 由 <strong>$actor</strong> 取消。';
$lang->action->desc->finished = '$date, 由 <strong>$actor</strong> 完成。';
$lang->action->desc->diff1 = '修改了 <strong><i>%s</i></strong>,旧值为 "%s",新值为 "%s"。<br />';
$lang->action->desc->diff2 = '修改了 <strong><i>%s</i></strong>,区别为:<blockquote>%s</blockquote>';
/* 用来显示动态信息。*/
$lang->action->label->opened = '创建了';
$lang->action->label->created = '创建了';
$lang->action->label->changed = '变更了';
$lang->action->label->edited = '编辑了';
$lang->action->label->closed = '关闭了';
@@ -79,6 +83,9 @@ $lang->action->label->unlinkedfromplan = '移除计划';
$lang->action->label->linked2project = '关联项目';
$lang->action->label->unlinkedfromproject = '移除项目';
$lang->action->label->marked = '编辑了';
$lang->action->label->started = '开始了';
$lang->action->label->canceled = '取消了';
$lang->action->label->finished = '完成了';
$lang->action->label->login = '登录系统';
$lang->action->label->logout = "退出登录";
@@ -94,6 +101,8 @@ $lang->action->label->bug = 'Bug|bug|view|bugID=%s';
$lang->action->label->case = '用例|testcase|view|caseID=%s';
$lang->action->label->testtask = '测试任务|testtask|view|caseID=%s';
$lang->action->label->todo = 'todo|todo|view|todoID=%s';
$lang->action->label->doclib = '文档库|doc|browse|libID=%s';
$lang->action->label->doc = '文档|doc|view|docID=%s';
$lang->action->label->user = '用户';
$lang->action->label->space = ' ';

View File

@@ -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);

View File

@@ -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()

View File

@@ -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;?>"' />

View File

@@ -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);