From 2306be7eaf83caa174353d0a5dcf18ce499d34e7 Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Mon, 28 Mar 2016 16:05:03 +0800 Subject: [PATCH 1/4] * finish task #2558. * add manage contacts and refresh button for task and testtask module. --- module/bug/view/create.html.php | 2 +- module/company/js/browse.js | 4 ---- module/company/view/browse.html.php | 4 +--- module/story/view/create.html.php | 2 +- module/task/css/create.css | 2 ++ module/task/view/create.html.php | 11 ++++++++++- module/testtask/css/create.css | 1 + module/testtask/js/create.js | 6 ++++++ module/testtask/view/create.html.php | 11 ++++++++++- 9 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 module/testtask/css/create.css diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index ef90712a28..598c5345dc 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -171,7 +171,7 @@ js::set('refresh', $lang->refresh); if(empty($contactLists)) { echo ''; - echo ''; + echo ''; echo ''; echo ''; } diff --git a/module/company/js/browse.js b/module/company/js/browse.js index 26d385e9de..afdb55566e 100644 --- a/module/company/js/browse.js +++ b/module/company/js/browse.js @@ -2,10 +2,6 @@ function batchEdit() { $('#userListForm').attr('action', createLink('user', 'batchEdit', 'dept=' + deptID)); } -function manageContacts() -{ - $('#userListForm').attr('action', createLink('user', 'manageContacts')); -} $(function() { setTimeout(function(){fixedTfootAction('#userListForm')}, '100'); diff --git a/module/company/view/browse.html.php b/module/company/view/browse.html.php index cae7b55e80..e3c22f8f3d 100644 --- a/module/company/view/browse.html.php +++ b/module/company/view/browse.html.php @@ -54,8 +54,7 @@ js::set('confirmDelete', $lang->user->confirmDelete); @@ -99,7 +98,6 @@ js::set('confirmDelete', $lang->user->confirmDelete); edit, 'onclick=batchEdit()', 'btn btn-default'); - if($canManageContacts) echo html::submitButton($lang->user->contacts->manage, 'onclick=manageContacts()'); ?> show();?> diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index 0398785f29..a8b396e34b 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -127,8 +127,8 @@ if(empty($contactLists)) { echo ''; + echo ''; echo ''; - echo ''; echo ''; } ?> diff --git a/module/task/css/create.css b/module/task/css/create.css index 3784181619..c756136b77 100644 --- a/module/task/css/create.css +++ b/module/task/css/create.css @@ -1,6 +1,8 @@ .dropdown-pris > .btn {background-color: #fff;} #mailto + .chosen-container-multi .chosen-choices {border-top-left-radius: 0; border-bottom-left-radius: 0} +#mailtoGroup .input-group-btn > .btn {margin-left: -1px!important;} + .chosen-container {max-width: 980px} .minw-80px {min-width: 80px;} diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index e2734e6273..8e4b712f70 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -94,10 +94,19 @@ -
+
task->mailto;?> acl == 'private' ? $members : $users, str_replace(' ', '', $task->mailto), "multiple class='form-control'");?> + '; + echo ''; + echo ''; + echo ''; + } + ?>
diff --git a/module/testtask/css/create.css b/module/testtask/css/create.css new file mode 100644 index 0000000000..876d1ee127 --- /dev/null +++ b/module/testtask/css/create.css @@ -0,0 +1 @@ +#mailtoGroup .input-group-btn > .btn {margin-left: -1px!important;} diff --git a/module/testtask/js/create.js b/module/testtask/js/create.js index e422618ffd..f35f82e8f8 100755 --- a/module/testtask/js/create.js +++ b/module/testtask/js/create.js @@ -58,3 +58,9 @@ function suitEndDate() endDate = endDate.toString('yyyy-M-dd'); $('#end').val(endDate); } + +/* If the mouse hover over the manage contacts button, give tip. */ +$(function() +{ + $('[data-toggle=tooltip]').tooltip(); +}); diff --git a/module/testtask/view/create.html.php b/module/testtask/view/create.html.php index 56613844aa..c59dd8f5c9 100644 --- a/module/testtask/view/create.html.php +++ b/module/testtask/view/create.html.php @@ -73,9 +73,18 @@ testtask->mailto;?> -
+
+ '; + echo ''; + echo ''; + echo ''; + } + ?>
From 92f2cb6c5dcfe4db18e56c2c5f710ba318c39bca Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Mon, 28 Mar 2016 16:42:41 +0800 Subject: [PATCH 2/4] * finish task #2572. --- module/bug/view/batchedit.html.php | 16 ++++++++-------- module/product/view/batchedit.html.php | 2 +- module/productplan/view/batchedit.html.php | 2 +- module/project/view/batchedit.html.php | 6 +++--- module/story/view/batchedit.html.php | 18 +++++++++--------- module/task/view/batchedit.html.php | 22 +++++++++++----------- module/testcase/view/batchedit.html.php | 12 ++++++------ 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/module/bug/view/batchedit.html.php b/module/bug/view/batchedit.html.php index 7cb48e90b3..501a074552 100644 --- a/module/bug/view/batchedit.html.php +++ b/module/bug/view/batchedit.html.php @@ -46,18 +46,18 @@ ?> - type, 'class=form-control');?> - bug->severityList, $bugs[$bugID]->severity, 'class=form-control');?> - bug->priList, $bugs[$bugID]->pri, 'class=form-control');?> - title, 'class=form-control');?> - assignedTo, "class='form-control chosen'");?> - bug->statusList, $bugs[$bugID]->status, 'class=form-control');?> - resolvedBy, "class='form-control chosen'");?> + type, 'class=form-control');?> + bug->severityList, $bugs[$bugID]->severity, 'class=form-control');?> + bug->priList, $bugs[$bugID]->pri, 'class=form-control');?> + title, 'class=form-control');?> + assignedTo, "class='form-control chosen'");?> + bug->statusList, $bugs[$bugID]->status, 'class=form-control');?> + resolvedBy, "class='form-control chosen'");?> - + diff --git a/module/productplan/view/batchedit.html.php b/module/productplan/view/batchedit.html.php index 33d0fe9509..6d05a4c2b3 100644 --- a/module/productplan/view/batchedit.html.php +++ b/module/productplan/view/batchedit.html.php @@ -30,7 +30,7 @@ - + diff --git a/module/project/view/batchedit.html.php b/module/project/view/batchedit.html.php index 200a0932db..2ba82f2c27 100755 --- a/module/project/view/batchedit.html.php +++ b/module/project/view/batchedit.html.php @@ -22,7 +22,7 @@ - + @@ -35,9 +35,9 @@ - + - + diff --git a/module/story/view/batchedit.html.php b/module/story/view/batchedit.html.php index 50c28fe894..83b7b01b09 100644 --- a/module/story/view/batchedit.html.php +++ b/module/story/view/batchedit.html.php @@ -27,7 +27,7 @@ - + @@ -40,18 +40,18 @@ - - - - - - + + + + + + status != 'draft'):?> - + - + status == 'closed'):?> diff --git a/module/task/view/batchedit.html.php b/module/task/view/batchedit.html.php index 59eb130447..7fa584f55c 100755 --- a/module/task/view/batchedit.html.php +++ b/module/task/view/batchedit.html.php @@ -47,17 +47,17 @@ ?> - - - - - - - - - - - + + + + + + + + + + + diff --git a/module/testcase/view/batchedit.html.php b/module/testcase/view/batchedit.html.php index 054cf7da51..ac88f2efe0 100644 --- a/module/testcase/view/batchedit.html.php +++ b/module/testcase/view/batchedit.html.php @@ -35,12 +35,12 @@ tree->getOptionMenu($cases[$caseID]->product, $viewType = 'case', $startModuleID = 0); ?> - - - - - - + + + + + + From 79096a6fdd96224cde72309589133649a6c3951a Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Mon, 28 Mar 2016 16:49:37 +0800 Subject: [PATCH 3/4] * adjust the format of end date for product plan. --- module/productplan/js/create.js | 2 +- module/productplan/js/edit.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/productplan/js/create.js b/module/productplan/js/create.js index 0dd9d55ca3..3f144e12da 100644 --- a/module/productplan/js/create.js +++ b/module/productplan/js/create.js @@ -26,7 +26,7 @@ function computeEndDate(delta) if(!beginDate) return; endDate = convertStringToDate(beginDate).addDays(parseInt(delta)); - endDate = endDate.toString('yyyy-M-dd'); + endDate = endDate.toString('yyyy-MM-dd'); $('#end').val(endDate); } diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js index f6fb3e20cd..697053d93b 100644 --- a/module/productplan/js/edit.js +++ b/module/productplan/js/edit.js @@ -26,6 +26,6 @@ function computeEndDate(delta) if(!beginDate) return; endDate = convertStringToDate(beginDate).addDays(parseInt(delta)); - endDate = endDate.toString('yyyy-M-dd'); + endDate = endDate.toString('yyyy-MM-dd'); $('#end').val(endDate); } From 8cd6978375024801a41c6bae17c51b281eaaaccb Mon Sep 17 00:00:00 2001 From: chenfeiCF Date: Tue, 29 Mar 2016 10:34:34 +0800 Subject: [PATCH 4/4] * finish task #2567. --- module/block/view/projectblock.html.php | 4 ++++ module/my/view/project.html.php | 4 ++++ module/product/view/project.html.php | 4 ++++ module/project/lang/en.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/model.php | 14 ++++++++++++++ module/project/view/index.html.php | 4 ++++ module/project/view/view.html.php | 4 ++++ module/user/model.php | 14 +++++++++++++- module/user/view/project.html.php | 4 ++++ www/theme/default/style.css | 1 + 11 files changed, 54 insertions(+), 1 deletion(-) diff --git a/module/block/view/projectblock.html.php b/module/block/view/projectblock.html.php index ef71559826..ced4690ed6 100644 --- a/module/block/view/projectblock.html.php +++ b/module/block/view/projectblock.html.php @@ -29,7 +29,11 @@ > + delay)):?> + + + diff --git a/module/my/view/project.html.php b/module/my/view/project.html.php index bb4488efb8..9e1e9b2abd 100644 --- a/module/my/view/project.html.php +++ b/module/my/view/project.html.php @@ -41,7 +41,11 @@ + delay)):?> + + + diff --git a/module/product/view/project.html.php b/module/product/view/project.html.php index 5bec82595e..a62146d26d 100644 --- a/module/product/view/project.html.php +++ b/module/product/view/project.html.php @@ -33,7 +33,11 @@ + delay)):?> + + + diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 498614ff31..1b33de0949 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -48,6 +48,7 @@ $lang->project->typeDesc = 'No burndown and story in OPS'; $lang->project->mine = 'I charge : '; $lang->project->other = 'Other : '; $lang->project->deleted = 'Deleted'; +$lang->project->delayed = 'Delayed'; $lang->project->start = 'Start'; $lang->project->activate = 'Activate'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index 1114418fe5..bcd25b668f 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -48,6 +48,7 @@ $lang->project->typeDesc = "运维{$lang->projectCommon}禁用燃尽图和 $lang->project->mine = '我负责:'; $lang->project->other = '其他:'; $lang->project->deleted = '已删除'; +$lang->project->delayed = '已延期'; $lang->project->start = '开始'; $lang->project->activate = '激活'; diff --git a/module/project/model.php b/module/project/model.php index cda8159a5a..f0ff4dc2fe 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -713,6 +713,13 @@ class projectModel extends model // Process the end time. $project->end = date("Y-m-d", strtotime($project->end)); + /* Judge whether the project is delayed. */ + if($project->status != 'done') + { + $delay = helper::diffDate(helper::today(), $project->end); + if($delay > 0) $project->delay = $delay; + } + /* Process the burns. */ $project->burns = array(); $burnData = isset($burns[$project->id]) ? $burns[$project->id] : array(); @@ -818,6 +825,13 @@ class projectModel extends model $project = $this->dao->findById((int)$projectID)->from(TABLE_PROJECT)->fetch(); if(!$project) return false; + /* Judge whether the project is delayed. */ + if($project->status != 'done') + { + $delay = helper::diffDate(helper::today(), $project->end); + if($delay > 0) $project->delay = $delay; + } + $total = $this->dao->select(' SUM(estimate) AS totalEstimate, SUM(consumed) AS totalConsumed, diff --git a/module/project/view/index.html.php b/module/project/view/index.html.php index 0912053ba6..ded11b04fe 100644 --- a/module/project/view/index.html.php +++ b/module/project/view/index.html.php @@ -62,7 +62,11 @@ + delay)):?> + + + diff --git a/module/project/view/view.html.php b/module/project/view/view.html.php index 3ebd3a972a..b06c9bc263 100644 --- a/module/project/view/view.html.php +++ b/module/project/view/view.html.php @@ -89,7 +89,11 @@ + delay)):?> + + + diff --git a/module/user/model.php b/module/user/model.php index 0ce4a3f881..23e4026fc8 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -746,11 +746,23 @@ class userModel extends model */ public function getProjects($account) { - return $this->dao->select('t1.*,t2.*')->from(TABLE_TEAM)->alias('t1') + $projects = $this->dao->select('t1.*,t2.*')->from(TABLE_TEAM)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.account')->eq($account) ->andWhere('t2.deleted')->eq(0) ->fetchAll(); + + /* Judge whether the project is delayed. */ + foreach($projects as $project) + { + if($project->status != 'done') + { + $delay = helper::diffDate(helper::today(), $project->end); + if($delay > 0) $project->delay = $delay; + } + } + + return $projects; } /** diff --git a/module/user/view/project.html.php b/module/user/view/project.html.php index 4b0d305966..d7d3882904 100644 --- a/module/user/view/project.html.php +++ b/module/user/view/project.html.php @@ -36,7 +36,11 @@ + delay)):?> + + + diff --git a/www/theme/default/style.css b/www/theme/default/style.css index d56c8eac92..7db209aef9 100644 --- a/www/theme/default/style.css +++ b/www/theme/default/style.css @@ -211,6 +211,7 @@ td.status-active, td[class$="-active"] {color:#229f24;} td.wait, td[class$="-wait"] {color:#808080;} td.pause, td[class$="-pause"], td.suspended, td[class$="-suspended"] {color:#E48600;} +td.delay, td[class$="-delay"] {color:#e84e0f;} td.closed, td[class$="-closed"], td.cancel, td[class$="-cancel"] {color:#888;} td.doing, td[class$="-doing"],
- lang->bug->resolutionList, $bugs[$bugID]->resolution, "class=form-control onchange=setDuplicate(this.value,$bugID)");?> + lang->bug->resolutionList, $bugs[$bugID]->resolution, "class=form-control onchange=setDuplicate(this.value,$bugID)");?> ' resolution != 'duplicate') echo "style='display:none'";?>> bug->duplicateBug}'");?> diff --git a/module/product/view/batchedit.html.php b/module/product/view/batchedit.html.php index 80d69203b5..6ec0016966 100755 --- a/module/product/view/batchedit.html.php +++ b/module/product/view/batchedit.html.php @@ -33,7 +33,7 @@
name, "class='form-control'");?>name, "class='form-control'");?> code, "class='form-control'");?> PO, "class='form-control chosen'");?> QD, "class='form-control chosen'");?>
id . html::hidden("id[$plan->id]", $plan->id);?>id]", $plan->title, "class='form-control'")?>id]", $plan->title, "class='form-control'")?> id]", $plan->desc, "class='form-control' rows='1'")?> id]", $plan->begin, "class='form-control form-date'")?> id]", $plan->end, "class='form-control form-date'")?>
idAB;?> project->name;?> project->name;?> project->code;?> project->PM;?> project->status;?>
name, "class='form-control'");?>name, "class='form-control'");?> code, "class='form-control'");?>PM, "class='form-control chosen'");?>PM, "class='form-control chosen'");?> project->statusList, $projects[$projectID]->status, 'class=form-control');?> begin, "class='form-control form-date' onchange='computeWorkDays(this.id)'");?> end, "class='form-control form-date' onchange='computeWorkDays(this.id)'");?> idAB;?> story->module;?> story->planAB;?> story->title;?> story->title;?> story->estimateAB;?> priAB;?> story->source;?>
product], $stories[$storyID]->module, "class='form-control chosen'");?>product], $stories[$storyID]->plan, "class='form-control chosen'");?>title, 'class=form-control'); ?>estimate, "class='form-control' autocomplete='off'"); ?>story->priList, $stories[$storyID]->pri, 'class=form-control');?>story->sourceList, $stories[$storyID]->source, 'class=form-control');?> product], $stories[$storyID]->module, "class='form-control chosen'");?> product], $stories[$storyID]->plan, "class='form-control chosen'");?>title, 'class=form-control'); ?>estimate, "class='form-control' autocomplete='off'"); ?>story->priList, $stories[$storyID]->pri, 'class=form-control');?>story->sourceList, $stories[$storyID]->source, 'class=form-control');?> story->statusList[$stories[$storyID]->status];?> story->stageList, $stories[$storyID]->stage, 'class=form-control');?>story->stageList, $stories[$storyID]->stage, 'class=form-control');?> story->stageList, $stories[$storyID]->stage, 'class="form-control" disabled="disabled"');?>story->stageList, $stories[$storyID]->stage, 'class="form-control" disabled="disabled"');?>
name, 'class=form-control');?>module, "class='form-control chosen'")?>assignedTo, "class='form-control chosen'");?>task->typeList, $tasks[$taskID]->type, 'class=form-control');?>task->statusList, $tasks[$taskID]->status, 'class=form-control');?>task->priList, $tasks[$taskID]->pri, 'class=form-control');?>estimate, "class='form-control text-center' autocomplete='off'");?>left, "class='form-control text-center' autocomplete='off'");?>finishedBy, "class='form-control chosen'");?>closedBy, "class='form-control chosen'");?>name, 'class=form-control');?>module, "class='form-control chosen'")?>assignedTo, "class='form-control chosen'");?>task->typeList, $tasks[$taskID]->type, 'class=form-control');?>task->statusList, $tasks[$taskID]->status, 'class=form-control');?>task->priList, $tasks[$taskID]->pri, 'class=form-control');?>estimate, "class='form-control text-center' autocomplete='off'");?>left, "class='form-control text-center' autocomplete='off'");?>finishedBy, "class='form-control chosen'");?>closedBy, "class='form-control chosen'");?> task->reasonList, $tasks[$taskID]->closedReason, 'class=form-control');?>
testcase->priList, $cases[$caseID]->pri, 'class=form-control');?>testcase->statusList, $cases[$caseID]->status, 'class=form-control');?>module, "class='form-control chosen'");?>title, 'class=form-control'); echo "*";?>testcase->typeList, $cases[$caseID]->type, 'class=form-control');?>testcase->stageList, $cases[$caseID]->stage, "class='form-control chosen' multiple data-placeholder='{$lang->testcase->stage}'");?>testcase->priList, $cases[$caseID]->pri, 'class=form-control');?>testcase->statusList, $cases[$caseID]->status, 'class=form-control');?> module, "class='form-control chosen'");?>title, 'class=form-control'); echo "*";?>testcase->typeList, $cases[$caseID]->type, 'class=form-control');?> testcase->stageList, $cases[$caseID]->stage, "class='form-control chosen' multiple data-placeholder='{$lang->testcase->stage}'");?>
name;?> end;?>project->delayed;?> project->statusList[$project->status];?> hours->totalEstimate;?> hours->totalConsumed;?> hours->totalLeft;?>name);?> begin;?> end;?>project->delayed;?> project->statusList[$project->status];?> role;?> join;?> hours;?>createLink('project', 'task', 'project=' . $project->id), $project->name, '_parent');?> code;?> end;?>project->delayed;?> project->statusList[$project->status];?> hours->totalEstimate;?> hours->totalConsumed;?> hours->totalLeft;?>code;?> PM];?> end;?>project->delayed;?> project->statusList[$project->status];?> hours->totalEstimate;?> hours->totalConsumed;?> hours->totalLeft;?>
project->status;?>project->delayed;?> show($lang->project->statusList, $project->status);?>
project->PM;?>name);?> begin;?> end;?>project->delayed;?> project->statusList[$project->status];?> role;?> join;?> hours;?>