From 392cc65ae14583dfa03a407e06d4de42a074c1f4 Mon Sep 17 00:00:00 2001 From: wumo Date: Tue, 3 Apr 2018 14:01:54 +0800 Subject: [PATCH 1/7] * Modify the prompt of start or restart in multi-user task. --- module/task/lang/zh-cn.php | 2 +- module/task/view/start.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index b033e141f8..abc4a8526c 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -108,7 +108,7 @@ $lang->task->parent = '父任务'; $lang->task->parentAB = '父'; $lang->task->lblPri = 'P'; $lang->task->lblHour = '(h)'; -$lang->task->deniedNotice = '当前任务只有【%s】才可以 %s'; +$lang->task->deniedNotice = '当前任务只有%s才可以%s'; $lang->task->ditto = '同上'; $lang->task->dittoNotice = "该任务与上一任务不属于同一项目!"; diff --git a/module/task/view/start.html.php b/module/task/view/start.html.php index 50ce8955c4..e2a1f44459 100644 --- a/module/task/view/start.html.php +++ b/module/task/view/start.html.php @@ -19,7 +19,7 @@
-

task->deniedNotice, $task->assignedTo, $lang->task->start);?>

+

task->deniedNotice, '' . $task->assignedToRealName . '', $lang->task->start);?>

From 6dcfb832f028271fb71fabd6964a76eadb931e79 Mon Sep 17 00:00:00 2001 From: JackWuLieHao Date: Tue, 3 Apr 2018 15:05:20 +0800 Subject: [PATCH 2/7] * my-todo Priority and name plus title; * user-edit Adjust the location of the entry date * user-profile If the entry date is empty, do not display. --- module/my/view/profile.html.php | 3 ++- module/my/view/todo.html.php | 4 ++-- module/user/view/edit.html.php | 8 +++----- module/user/view/profile.html.php | 6 ++++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/module/my/view/profile.html.php b/module/my/view/profile.html.php index 65d9a20ae0..016fef0557 100644 --- a/module/my/view/profile.html.php +++ b/module/my/view/profile.html.php @@ -62,7 +62,8 @@ user->email;?> email;?> - + join == '0000-00-00' ? "style='display:none'" : '';?> + > user->join;?> join;?> diff --git a/module/my/view/todo.html.php b/module/my/view/todo.html.php index 80fea7a34d..19c2d94ce1 100644 --- a/module/my/view/todo.html.php +++ b/module/my/view/todo.html.php @@ -72,8 +72,8 @@ date == '2030-01-01' ? $lang->todo->periods['future'] : $todo->date;?> todo->typeList[$todo->type];?> - todo->priList, $todo->pri, $todo->pri);?>'>todo->priList, $todo->pri, $todo->pri)?> - createLink('todo', 'view', "id=$todo->id&from=my", '', true), $todo->name, '', "data-toggle='modal' data-type='iframe' data-title='" . $lang->todo->view . "' data-icon='check'");?> + todo->priList, $todo->pri, $todo->pri);?>'>todo->priList, $todo->pri, $todo->pri)?> + createLink('todo', 'view', "id=$todo->id&from=my", '', true), $todo->name, '', "data-toggle='modal' data-type='iframe' data-title='" . $lang->todo->view . "' data-icon='check'");?> begin;?> end;?> todo->statusList[$todo->status];?> diff --git a/module/user/view/edit.html.php b/module/user/view/edit.html.php index 8f9713f6b3..651dca4c96 100644 --- a/module/user/view/edit.html.php +++ b/module/user/view/edit.html.php @@ -26,7 +26,9 @@ user->basicInfo;?> user->realname;?> - realname, "class='form-control' autocomplete='off'");?> + realname, "class='form-control' autocomplete='off'");?> + user->join;?> + join, "class='form-control form-date'");?> user->dept;?> @@ -34,10 +36,6 @@ user->role;?> user->roleList, $user->role, "class='form-control'");?> - - user->join;?> - join, "class='form-control form-date'");?> - group->priv;?> diff --git a/module/user/view/profile.html.php b/module/user/view/profile.html.php index 6701a83e30..83e3cc8d3e 100644 --- a/module/user/view/profile.html.php +++ b/module/user/view/profile.html.php @@ -60,10 +60,12 @@ user->role;?> user->roleList[$user->role];?> - + join == '0000-00-00' ? "style='display:none'" : '';?> + > user->join;?> join;?> - + + user->commiter;?> commiter;?> From d3b4f05f70f7993aa60bc317852251fe15510d4c Mon Sep 17 00:00:00 2001 From: wumo Date: Tue, 3 Apr 2018 15:30:02 +0800 Subject: [PATCH 3/7] * Hide the entry to manage product lines when exists product lines --- module/product/view/create.html.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index a4af8cc391..c4bb8c959c 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -36,11 +36,14 @@
"; - echo html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=line"), $lang->tree->manageLine, '_blank'); - echo '  '; - echo html::a("javascript:loadProductLines({$rootID})", $lang->refresh); - echo ''; + if(count($lines) == 1) + { + echo ""; + echo html::a($this->createLink('tree', 'browse', "rootID=$rootID&view=line"), $lang->tree->manageLine, '_blank'); + echo '  '; + echo html::a("javascript:loadProductLines({$rootID})", $lang->refresh, "class='refresh'"); + echo ''; + } ?>
From fc48a92729addefb16dc1333ab47398e530cdb0d Mon Sep 17 00:00:00 2001 From: JackWuLieHao Date: Tue, 3 Apr 2018 15:58:30 +0800 Subject: [PATCH 4/7] * If entry-date is default,then hidden --- module/user/view/profile.html.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/user/view/profile.html.php b/module/user/view/profile.html.php index 83e3cc8d3e..ce8d1fccdd 100644 --- a/module/user/view/profile.html.php +++ b/module/user/view/profile.html.php @@ -65,7 +65,6 @@ user->join;?> join;?> - user->commiter;?> commiter;?> From 58159b3d42a8dc6a02eb95345e9ef2a025025449 Mon Sep 17 00:00:00 2001 From: wumo Date: Wed, 4 Apr 2018 13:13:09 +0800 Subject: [PATCH 5/7] * Adjust the style of the prompt in multi-user task * Add unique key to team table. --- db/update9.8.2.sql | 2 +- module/task/lang/zh-cn.php | 2 +- module/upgrade/model.php | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/db/update9.8.2.sql b/db/update9.8.2.sql index 6017a40b69..a989df34fd 100644 --- a/db/update9.8.2.sql +++ b/db/update9.8.2.sql @@ -1,3 +1,3 @@ ALTER TABLE `zt_team` DROP PRIMARY KEY; -ALTER TABLE `zt_team` ADD PRIMARY KEY (`root`, `type`, `account`); +ALTER TABLE `zt_team` ADD `id` mediumint(8) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST; ALTER TABLE `zt_project` CHANGE `team` `team` varchar(90) NOT NULL; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index abc4a8526c..14b60cddd5 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -108,7 +108,7 @@ $lang->task->parent = '父任务'; $lang->task->parentAB = '父'; $lang->task->lblPri = 'P'; $lang->task->lblHour = '(h)'; -$lang->task->deniedNotice = '当前任务只有%s才可以%s'; +$lang->task->deniedNotice = '当前任务只有%s才可以%s。'; $lang->task->ditto = '同上'; $lang->task->dittoNotice = "该任务与上一任务不属于同一项目!"; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 5ef63f22c4..65dfe7a300 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -214,6 +214,7 @@ class upgradeModel extends model $this->resetProductLine(); case '9_8_2': $this->execSQL($this->getUpgradeFile('9.8.2')); + $this->addUniqueKeyToTeam(); } $this->deletePatch(); @@ -2244,4 +2245,33 @@ class upgradeModel extends model $this->dao->update(TABLE_PRODUCT)->set('line')->eq(0)->where('line')->in($deletedLines)->exec(); return !dao::isError(); } + + /** + * Add unique key to team table. + * + * @access public + * @return bool + */ + public function addUniqueKeyToTeam() + { + $members = $this->dao->select('root, type, account')->from(TABLE_TEAM)->groupBy('root, type, account')->having('count(*)')->gt(1)->fetchAll(); + + foreach($members as $member) + { + $maxID = $this->dao->select('MAX(id) id') + ->from(TABLE_TEAM) + ->where('root')->eq($member->root) + ->andWhere('`type`')->eq($member->type) + ->andWhere('account')->eq($member->account) + ->fetch('id'); + $this->dao->delete()->from(TABLE_TEAM) + ->where('root')->eq($member->root) + ->andWhere('`type`')->eq($member->type) + ->andWhere('account')->eq($member->account) + ->andWhere('id')->ne($maxID) + ->exec(); + } + $this->dao->exec("ALTER TABLE `zt_team` ADD UNIQUE `team` (`root`, `type`, `account`)"); + return !dao::isError(); + } } From 69e065a8030ae9809ae6cb6c3924fb5cfa7804ed Mon Sep 17 00:00:00 2001 From: wumo Date: Wed, 4 Apr 2018 13:23:03 +0800 Subject: [PATCH 6/7] * Add the unique key to team table. --- db/zentao.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/zentao.sql b/db/zentao.sql index 1c6dbc5d9d..6a8be26f11 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -644,6 +644,7 @@ CREATE TABLE IF NOT EXISTS `zt_taskestimate` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_team`; CREATE TABLE IF NOT EXISTS `zt_team` ( + `id` mediumint(8) unsigned NOT NULL auto_increment, `root` mediumint(8) unsigned NOT NULL default '0', `type` enum('project','task') NOT NULL DEFAULT 'project', `account` char(30) NOT NULL default '', @@ -656,7 +657,8 @@ CREATE TABLE IF NOT EXISTS `zt_team` ( `consumed` DECIMAL(12,2) UNSIGNED NOT NULL DEFAULT '0', `left` DECIMAL(12,2) UNSIGNED NOT NULL DEFAULT '0', `order` TINYINT(3) NOT NULL DEFAULT '0', - PRIMARY KEY (`root`,`type`,`account`) + PRIMARY KEY (`id`), + UNIQUE KEY `team` (`root`,`type`,`account`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_testreport`; CREATE TABLE IF NOT EXISTS `zt_testreport` ( From e5b822276d967d3d9f7b500cee9b0c032fa71674 Mon Sep 17 00:00:00 2001 From: JackWuLieHao Date: Wed, 4 Apr 2018 14:35:09 +0800 Subject: [PATCH 7/7] * Finish bug #1486 #1502 --- module/doc/css/view.css | 8 ++++++++ module/productplan/model.php | 7 +++++++ module/project/control.php | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/module/doc/css/view.css b/module/doc/css/view.css index d15fdf60ef..da6f92a519 100644 --- a/module/doc/css/view.css +++ b/module/doc/css/view.css @@ -7,3 +7,11 @@ fieldset > .content table tr th { border-top: 1px solid #BBB; } fieldset > .content table tr th, fieldset > .content table tr td{ padding: 5px 10px; } .col-main{width:100%} + +.content table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important} +.content table{margin-bottom:10px;border-collapse:collapse;display:table;} +.content td,th{padding: 5px 10px;border: 1px solid #DDD;} +.content caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;} +.content th{border-top:1px solid #BBB;background-color:#F7F7F7;} +.content table tr.firstRow th{border-top-width:2px;} +.content td p{margin:0;padding:0;} diff --git a/module/productplan/model.php b/module/productplan/model.php index 97f306b8d0..375eead92a 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -134,6 +134,13 @@ class productplanModel extends model ->fetchPairs(); } + foreach($plans as $key => $value) + { + if(strpos($value,'2030-01-01')) + { + $plans[$key] = str_replace('2030-01-01 ~ 2030-01-01',$this->lang->productplan->future,$value); + } + } return array('' => '') + $plans; } diff --git a/module/project/control.php b/module/project/control.php index 8b716d2205..83f5bec2af 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -925,7 +925,8 @@ class project extends control $acl = $copyProject->acl; $whitelist = $copyProject->whitelist; $products = $this->project->getProducts($copyProjectID); - } + } + if(!empty($planID)) { $plan = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('id')->eq($planID)->fetch();