* Adjust the icon of task.

This commit is contained in:
chencongzhi520@gmail.com
2012-07-02 02:03:05 +00:00
parent 162ccc536b
commit ba8aecd0d1
5 changed files with 27 additions and 197 deletions
+4 -2
View File
@@ -308,11 +308,13 @@ class common extends control
echo html::a($backLink, ' ', '', "class='icon-goback' title={$lang->goback}");
if(isset($preAndNext->pre) and $preAndNext->pre)
{
echo html::a($this->inLink('view', "ID={$preAndNext->pre->id}"), '&nbsp', '', "id='pre' class='icon-pre' title='{$preAndNext->pre->id}{$lang->colon}{$preAndNext->pre->title}'");
$title = isset($preAndNext->pre->title) ? $preAndNext->pre->title : $preAndNext->pre->name;
echo html::a($this->inLink('view', "ID={$preAndNext->pre->id}"), '&nbsp', '', "id='pre' class='icon-pre' title='{$preAndNext->pre->id}{$lang->colon}{$title}'");
}
if(isset($preAndNext->next) and $preAndNext->next)
{
echo html::a($this->inLink('view', "ID={$preAndNext->next->id}"), ' ', '', "id='next' class='icon-next' title='{$preAndNext->next->id}{$lang->colon}{$preAndNext->next->title}'");
$title = isset($preAndNext->next->title) ? $preAndNext->next->title : $preAndNext->next->name;
echo html::a($this->inLink('view', "ID={$preAndNext->next->id}"), ' ', '', "id='next' class='icon-next' title='{$preAndNext->next->id}{$lang->colon}{$title}'");
}
}
+4 -33
View File
@@ -131,39 +131,10 @@ var browseType = '<?php echo $browseType;?>';
</td>
<td class='a-right'>
<?php
if(common::hasPriv('task', 'finish'))
{
if($task->status == 'wait' or $task->status == 'doing')
{
echo html::a($this->inLink('task', 'finish'), '&nbsp;', "taskID=$task->id", "class='icon-green-small-task-finish' title='{$lang->task->buttonDone}'", false);
}
else
{
echo "<span class='icon-gray-small-task-finish' title='{$lang->task->buttonDone}'>&nbsp;</span>";
}
}
if(common::hasPriv('task', 'close'))
{
if($task->status == 'done' or $task->status == 'cancel')
{
echo html::a($this->inLink('task', 'close', "taskID=$task->id"), '&nbsp;', '', "class='icon-green-small-task-close' title='{$lang->task->buttonClose}'", false);
}
else
{
echo "<span class='icon-gray-small-task-close' title='{$lang->task->buttonClose}'>&nbsp;</span>";
}
}
if(!common::printLink('task', 'edit', "taskID=$task->id", '&nbsp;', '', "class='icon-green-small-edit' title='{$lang->task->buttonEdit}'"))
{
echo "<span class='icon-gray-small-edit' title='{$lang->task->buttonEdit}'>&nbsp;</span>";
}
if($browseType == 'needconfirm')
{
common::printLink('task', 'confirmStoryChange', "taskid=$task->id", $lang->confirm, 'hiddenwin');
}
if($browseType == 'needconfirm') common::printLink('task', 'confirmStoryChange', "taskid=$task->id", $lang->confirm, 'hiddenwin');
if($this->task->isClickable($task, 'finish')) common::printIcon('task', 'finish', "taskID=$task->id", $task);
if($this->task->isClickable($task, 'close')) common::printIcon('task', 'close', "taskID=$task->id", $task);
if($this->task->isClickable($task, 'edit')) common::printIcon('task', 'edit', "taskID=$task->id");
?>
</td>
</tr>
+1 -1
View File
@@ -58,7 +58,7 @@
</fieldset>
<?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true'));?>
<?php include '../../common/view/action.html.php';?>
<div class='a-center actionlink'><?php echo $actionLinks;?></div>
<div class='a-center actionlink'><?php if(!$story->deleted) echo $actionLinks;?></div>
<div id='comment' class='hidden'>
<fieldset>
<legend><?php echo $lang->comment;?></legend>
+2
View File
@@ -1083,12 +1083,14 @@ class taskModel extends model
public function isClickable($task, $action)
{
$action = strtolower($action);
if($action == 'assignto') return $task->status != 'closed' and $task->status != 'cancel';
if($action == 'start') return $task->status != 'doing' and $task->status != 'closed' and $task->status != 'cancel';
if($action == 'finish') return $task->status != 'done' and $task->status != 'closed' and $task->status != 'cancel';
if($action == 'close') return $task->status == 'done' or $task->status == 'cancel';
if($action == 'activate') return $task->status == 'done' or $task->status == 'closed' or $task->status == 'cancel' ;
if($action == 'cancel') return $task->status != 'done ' and $task->status != 'closed' and $task->status != 'cancel';
return true;
}
}
+16 -161
View File
@@ -22,90 +22,26 @@
$browseLink = $app->session->taskList != false ? $app->session->taskList : $this->createLink('project', 'browse', "projectID=$task->project");
if(!$task->deleted)
{
ob_start();
//if(!($task->status != 'closed' and $task->status != 'cancel' and common::printLink('task', 'logEfforts', "taskID=$task->id", $lang->task->buttonLogEfforts))) echo $lang->task->buttonLogEfforts . ' ';
common::printLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $lang->task->assign);
if(common::hasPriv('task', 'start'))
{
if($task->status == 'wait')
{
echo html::a($this->inLink('start', "taskID=$task->id"), $lang->task->buttonStart);
}
else
{
echo $lang->task->buttonStart . ' ';
}
}
if($this->task->isClickable($task, 'start')) common::printLink('task', 'start', "taskID=$task->id", $lang->task->buttonStart);
if($this->task->isClickable($task, 'finish')) common::printLink('task', 'finish', "taskID=$task->id", $lang->task->buttonDone);
if($this->task->isClickable($task, 'close')) common::printLink('task', 'close', "taskID=$task->id", $lang->task->buttonClose);
if($this->task->isClickable($task, 'activate')) common::printLink('task', 'activate', "taskID=$task->id", $lang->task->buttonActivate);
if($this->task->isClickable($task, 'cancel')) common::printLink('task', 'cancel', "taskID=$task->id", $lang->task->buttonCancel);
if(common::hasPriv('task', 'finish'))
{
if($task->status == 'wait' or $task->status == 'doing')
{
echo html::a($this->inLink('finish', "taskID=$task->id"), $lang->task->buttonDone);
}
else
{
echo $lang->task->buttonDone . ' ';
}
}
if($this->task->isClickable($task, 'edit')) common::printSplitIcon();
common::printIcon('task', 'edit', "taskID=$task->id", '', 'big');
common::printCommentIcon('task');
common::printIcon('task', 'delete',"projectID=$task->project&taskID=$task->id", '', 'big', '', 'hiddenwin');
if(common::hasPriv('task', 'close'))
{
if($task->status == 'done' or $task->status == 'cancel')
{
echo html::a($this->inLink('close', "taskID=$task->id"), $lang->task->buttonClose);
}
else
{
echo $lang->task->buttonClose . ' ';
}
}
if($this->task->isClickable($task, 'goback')) common::printSplitIcon();
common::printRPN($browseLink, $preAndNext);
if(common::hasPriv('task', 'activate'))
{
if($task->status == 'closed' or $task->status == 'done' or $task->status == 'cancel')
{
echo html::a($this->inLink('activate', "taskID=$task->id"), $lang->task->buttonActivate);
}
else
{
echo $lang->task->buttonActivate . ' ';
}
}
if(common::hasPriv('task', 'cancel'))
{
if($task->status == 'wait' or $task->status == 'doing')
{
echo html::a($this->inLink('cancel', "taskID=$task->id"), $lang->task->buttonCancel);
}
else
{
echo $lang->task->buttonCancel . ' ';
}
}
if(common::hasPriv('task', 'assignTo') or common::hasPriv('task', 'start')
or common::hasPriv('task', 'finish') or common::hasPriv('task', 'close')
or common::hasPriv('task', 'activate') or common::hasPriv('task', 'cancel'))
{
echo "<span class='icon-green-big-splitLine'>&nbsp;</span>";
}
common::printLink('task', 'edit', "taskID=$task->id", '&nbsp;', '', "class='icon-green-big-edit' title='{$lang->task->edit}'");
if(common::hasPriv('task', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='icon-green-big-comment' onclick='setComment()' title='{$lang->comment}'");
common::printLink('task', 'delete',"projectID=$task->project&taskID=$task->id", '&nbsp;', 'hiddenwin', "class='icon-green-big-delete' title='{$lang->delete}'");
if(common::hasPriv('task', 'edit') or common::hasPriv('task', 'delete'))
{
echo "<span class='icon-green-big-splitLine'>&nbsp;</span>";
}
}
echo html::a($browseLink, '&nbsp', '', "class='icon-green-big-goback' title='{$lang->goback}'");
if($preAndNext->pre)
{
echo html::a($this->inLink('view', "taskID={$preAndNext->pre->id}"), '&nbsp;', '', "class='icon-green-big-pre' id='pre' title='{$preAndNext->pre->id}{$lang->colon}{$preAndNext->pre->name}'");
}
if($preAndNext->next)
{
echo html::a($this->inLink('view', "taskID={$preAndNext->next->id}"), '&nbsp;', '', "class='icon-green-big-next' id='next' title='{$preAndNext->next->id}{$lang->colon}{$preAndNext->next->name}'");
$actionLinks = ob_get_contents();
ob_clean();
echo $actionLinks;
}
?>
</div>
@@ -120,88 +56,7 @@
</fieldset>
<?php echo $this->fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true'));?>
<?php include '../../common/view/action.html.php';?>
<div class='a-center f-16px strong'>
<?php
if(!$task->deleted)
{
common::printLink('task', 'assignTo', "projectID=$task->project&taskID=$task->id", $lang->task->assign);
if(common::hasPriv('task', 'start'))
{
if($task->status == 'wait')
{
echo html::a($this->inLink('start', "taskID=$task->id"), $lang->task->buttonStart);
}
else
{
echo $lang->task->buttonStart . ' ';
}
}
if(common::hasPriv('task', 'finish'))
{
if($task->status == 'wait' or $task->status == 'doing')
{
echo html::a($this->inLink('finish', "taskID=$task->id"), $lang->task->buttonDone);
}
else
{
echo $lang->task->buttonDone . ' ';
}
}
if(common::hasPriv('task', 'close'))
{
if($task->status == 'done' or $task->status == 'cancel')
{
echo html::a($this->inLink('close', "taskID=$task->id"), $lang->task->buttonClose);
}
else
{
echo $lang->task->buttonClose . ' ';
}
}
if(common::hasPriv('task', 'activate'))
{
if($task->status == 'closed' or $task->status == 'done' or $task->status == 'cancel')
{
echo html::a($this->inLink('activate', "taskID=$task->id"), $lang->task->buttonActivate);
}
else
{
echo $lang->task->buttonActivate . ' ';
}
}
if(common::hasPriv('task', 'cancel'))
{
if($task->status == 'wait' or $task->status == 'doing')
{
echo html::a($this->inLink('cancel', "taskID=$task->id"), $lang->task->buttonCancel);
}
else
{
echo $lang->task->buttonCancel . ' ';
}
}
if(common::hasPriv('task', 'assignTo') or common::hasPriv('task', 'start')
or common::hasPriv('task', 'finish') or common::hasPriv('task', 'close')
or common::hasPriv('task', 'activate') or common::hasPriv('task', 'cancel'))
{
echo "<span class='icon-green-big-splitLine'>&nbsp;</span>";
}
common::printLink('task', 'edit', "taskID=$task->id", '&nbsp;', '', "class='icon-green-big-edit' title='{$lang->task->edit}'");
if(common::hasPriv('task', 'edit')) echo html::a('#comment', '&nbsp;', '', "class='icon-green-big-comment' onclick='setComment()' title='{$lang->comment}'");
common::printLink('task', 'delete',"projectID=$task->project&taskID=$task->id", '&nbsp;', 'hiddenwin', "class='icon-green-big-delete' title='{$lang->delete}'");
if(common::hasPriv('task', 'edit') or common::hasPriv('task', 'delete'))
{
echo "<span class='icon-green-big-splitLine'>&nbsp;</span>";
}
}
echo html::a($browseLink, '&nbsp', '', "class='icon-green-big-goback' title='{$lang->goback}'");
?>
</div>
<div class='a-center actionlink'> <?php if(!$task->deleted) echo $actionLinks;?></div>
<div id='comment' class='hidden'>
<fieldset>
<legend><?php echo $lang->comment;?></legend>