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/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` ( 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/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/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 ''; + } ?>
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(); diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index ad2f3a0f78..edcb65f5fc 100644 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -109,7 +109,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 7ff310546a..a0d22d2a7d 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);?>

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(); + } } 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..ce8d1fccdd 100644 --- a/module/user/view/profile.html.php +++ b/module/user/view/profile.html.php @@ -60,10 +60,11 @@ user->role;?> user->roleList[$user->role];?> - + join == '0000-00-00' ? "style='display:none'" : '';?> + > user->join;?> join;?> - + user->commiter;?> commiter;?>