From 2eb3300ca6314f720a3e235bd462e80f9f7697e8 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Wed, 28 Sep 2022 13:29:26 +0800 Subject: [PATCH 001/129] * add xuanxuan notification send feedback and review --- .../ext/model/class/xuanxuan.class.php | 72 +++++++++++++++++-- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php index 8a33333ac8..9ea25f0734 100644 --- a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php @@ -23,10 +23,19 @@ class xuanxuanMessage extends messageModel { $field = 'obj.*,project.name as projectName,product.name as productName,execu.name as execuName'; } + else if($objectType == 'feedback') + { + $field = 'obj.*,product.name as productName'; + } + else if($objectType == 'review') + { + $field = 'obj.*,project.name as projectName'; + } else { $field = 'obj.*'; } + $object = $this->dao->select($field)->from($this->config->objectTables[$objectType])->alias('obj') ->beginIF($objectType == 'task') ->leftJoin($this->config->objectTables['project'])->alias('project')->on('project.id = obj.project') @@ -40,6 +49,12 @@ class xuanxuanMessage extends messageModel ->leftJoin($this->config->objectTables['execution'])->alias('execu')->on('execu.id = obj.execution') ->leftJoin($this->config->objectTables['product'])->alias('product')->on('product.id = obj.product') ->fi() + ->beginIF($objectType == 'feedback') + ->leftJoin($this->config->objectTables['product'])->alias('product')->on('product.id = obj.product') + ->fi() + ->beginIF($objectType == 'review') + ->leftJoin($this->config->objectTables['project'])->alias('project')->on('project.id = obj.project') + ->fi() ->where('obj.id')->eq($objectID) ->fetch(); $field = $this->config->action->objectNameFields[$objectType]; @@ -49,18 +64,43 @@ class xuanxuanMessage extends messageModel $notifyType = strtolower(explode(',', $extra)[0]); if ($notifyType == 'pass') { - $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyPassTitle, $this->app->user->realname, 1); + $title = sprintf($this->lang->message->notifyPassTitle, $this->app->user->realname, 1); } else if($notifyType == 'clarify') { - $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyClarifyTitle, $this->app->user->realname, 1); + $title = sprintf($this->lang->message->notifyClarifyTitle, $this->app->user->realname, 1); } else if($notifyType == 'reject') { - $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyRejectTitle, $this->app->user->realname, 1); + $title = sprintf($this->lang->message->notifyRejectTitle, $this->app->user->realname, 1); } } + if ($objectType == 'feedback' && ($actionType == 'tobug' || $actionType == 'tostory' || $actionType == 'totask' || $actionType == 'todo')) + { + if ($actionType == 'tobug') + { + $title = sprintf($this->lang->message->feedbackToBugTitle, $this->app->user->realname, 1); + } + else if($actionType == 'tostory') + { + $title = sprintf($this->lang->message->feedbackToStoryTitle, $this->app->user->realname, 1); + } + else if($actionType == 'totask') + { + $title = sprintf($this->lang->message->feedbackToTaskTitle, $this->app->user->realname, 1); + } + else if($actionType == 'todo') + { + $title = sprintf($this->lang->message->feedbackToDoTitle, $this->app->user->realname, 1); + } + } + + if ($objectType == 'review' && $actionType == 'toaudit') + { + $title = sprintf($this->lang->message->reviewToauditTitle, $this->app->user->realname, 1); + } + $server = $this->loadModel('im')->getServer('zentao'); $onlybody = isset($_GET['onlybody']) ? $_GET['onlybody'] : ''; unset($_GET['onlybody']); @@ -71,10 +111,12 @@ class xuanxuanMessage extends messageModel if(!empty($object->assignedTo)) $target .= $object->assignedTo == 'closed' ? $object->openedBy : $object->assignedTo; if(!empty($object->mailto)) $target .= ",{$object->mailto}"; if(($objectType == 'mr' or $objectType == 'kanbancard') and !empty($object->createdBy)) $target .= ",{$object->createdBy}"; + if($objectType == 'review') $target .= ",{$object->auditedBy}"; $target = trim($target, ','); + $target = explode(',', $target); $target = $this->dao->select('id')->from(TABLE_USER) ->where('account')->in($target) - ->beginIF($objectType != 'mr')->andWhere('account')->ne($this->app->user->account)->fi() + ->beginIF($objectType != 'mr' && $objectType != 'review')->andWhere('account')->ne($this->app->user->account)->fi() ->fetchAll('id'); $target = array_keys($target); @@ -110,6 +152,24 @@ class xuanxuanMessage extends messageModel $subcontent->parentURL = "xxc:openInApp/zentao-integrated/" . urlencode($server . helper::createLink($parentType, 'browse', "id=$subcontent->parent", 'html')); $subcontent->cardURL = $url; } + elseif($objectType == 'feedback') + { + $subcontent->headTitle = $object->productName; + $subcontent->headSubTitle = $object->execuName; + $subcontent->parentType = 'product'; + $subcontent->parent = $object->product; + $subcontent->parentURL = "xxc:openInApp/zentao-integrated/" . urlencode($server . helper::createLink('feedback', 'browse', "id=$object->product", 'html')); + $subcontent->cardURL = $url; + } + elseif($objectType == 'review') + { + $subcontent->headTitle = $object->projectName; + $subcontent->headSubTitle = $object->execuName; + $subcontent->parentType = 'product'; + $subcontent->parent = $object->product; + $subcontent->parentURL = "xxc:openInApp/zentao-integrated/" . urlencode($server . helper::createLink('review', 'browse', "id=$object->product", 'html')); + $subcontent->cardURL = $url; + } else { $subcontent->parentType = $objectType; @@ -146,11 +206,11 @@ class xuanxuanMessage extends messageModel $contentData->actions = array(); $contentData->url = "xxc:openInApp/zentao-integrated/" . urlencode($url); } - $contentData->extra = $extra; + $contentData->extra = is_array($extra) ? $extra : ''; $content = json_encode($contentData); $avatarUrl = $server . $this->app->getWebRoot() . 'favicon.ico'; - if($target && ($objectType == 'bug' || $objectType == 'task' || $objectType == 'story')) $this->loadModel('im')->messageCreateNotify($target, $title, $subtitle = '', $content, $contentType = 'object', $url, $actions = array(), $sender = array('id' => 'zentao', 'realname' => $this->lang->message->sender, 'name' => $this->lang->message->sender, 'avatar' => $avatarUrl)); + if($target && ($objectType == 'bug' || $objectType == 'task' || $objectType == 'story' || $objectType == 'feedback' || $objectType == 'review')) $this->loadModel('im')->messageCreateNotify($target, $title, $subtitle = '', $content, $contentType = 'object', $url, $actions = array(), $sender = array('id' => 'zentao', 'realname' => $this->lang->message->sender, 'name' => $this->lang->message->sender, 'avatar' => $avatarUrl)); if($objectType == 'mr' and is_array($this->lang->message->mr->$actionType) and !empty($object->assignee)) { From 434afe33af0d7b175fcf229e368d03ebc4ce2df0 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Wed, 28 Sep 2022 16:03:11 +0800 Subject: [PATCH 002/129] * add lang about zentao client notification feedback and review --- xuanxuan/extension/xuan/message/ext/lang/de/xuanxuan.php | 7 +++++++ xuanxuan/extension/xuan/message/ext/lang/en/xuanxuan.php | 7 +++++++ xuanxuan/extension/xuan/message/ext/lang/fr/xuanxuan.php | 7 +++++++ .../extension/xuan/message/ext/lang/zh-cn/xuanxuan.php | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/xuanxuan/extension/xuan/message/ext/lang/de/xuanxuan.php b/xuanxuan/extension/xuan/message/ext/lang/de/xuanxuan.php index 8fbd39f334..73807b5a85 100644 --- a/xuanxuan/extension/xuan/message/ext/lang/de/xuanxuan.php +++ b/xuanxuan/extension/xuan/message/ext/lang/de/xuanxuan.php @@ -8,6 +8,13 @@ $lang->message->notifyPassTitle = '%s passed %d stories'; $lang->message->notifyClarifyTitle = '%s clarify %d stories'; $lang->message->notifyRejectTitle = '%s reject %d stories'; +$lang->message->feedbackToBugTitle = '%s have forwarded %d feedback to bug'; +$lang->message->feedbackToTaskTitle = '%s have forwarded %d feedback to task'; +$lang->message->feedbackToDoTitle = '%s have forwarded %d feedback to todo'; +$lang->message->feedbackToStoryTitle = '%s have forwarded %d feedback to story'; + +$lang->message->reviewToauditTitle = '%s have submit %d audits'; + $lang->message->mr = new stdClass(); $lang->message->mr->logTitle = 'Build log'; $lang->message->mr->compilefail = 'Your submitted merge request: %s, build failed'; diff --git a/xuanxuan/extension/xuan/message/ext/lang/en/xuanxuan.php b/xuanxuan/extension/xuan/message/ext/lang/en/xuanxuan.php index 8fbd39f334..73807b5a85 100644 --- a/xuanxuan/extension/xuan/message/ext/lang/en/xuanxuan.php +++ b/xuanxuan/extension/xuan/message/ext/lang/en/xuanxuan.php @@ -8,6 +8,13 @@ $lang->message->notifyPassTitle = '%s passed %d stories'; $lang->message->notifyClarifyTitle = '%s clarify %d stories'; $lang->message->notifyRejectTitle = '%s reject %d stories'; +$lang->message->feedbackToBugTitle = '%s have forwarded %d feedback to bug'; +$lang->message->feedbackToTaskTitle = '%s have forwarded %d feedback to task'; +$lang->message->feedbackToDoTitle = '%s have forwarded %d feedback to todo'; +$lang->message->feedbackToStoryTitle = '%s have forwarded %d feedback to story'; + +$lang->message->reviewToauditTitle = '%s have submit %d audits'; + $lang->message->mr = new stdClass(); $lang->message->mr->logTitle = 'Build log'; $lang->message->mr->compilefail = 'Your submitted merge request: %s, build failed'; diff --git a/xuanxuan/extension/xuan/message/ext/lang/fr/xuanxuan.php b/xuanxuan/extension/xuan/message/ext/lang/fr/xuanxuan.php index 8fbd39f334..73807b5a85 100644 --- a/xuanxuan/extension/xuan/message/ext/lang/fr/xuanxuan.php +++ b/xuanxuan/extension/xuan/message/ext/lang/fr/xuanxuan.php @@ -8,6 +8,13 @@ $lang->message->notifyPassTitle = '%s passed %d stories'; $lang->message->notifyClarifyTitle = '%s clarify %d stories'; $lang->message->notifyRejectTitle = '%s reject %d stories'; +$lang->message->feedbackToBugTitle = '%s have forwarded %d feedback to bug'; +$lang->message->feedbackToTaskTitle = '%s have forwarded %d feedback to task'; +$lang->message->feedbackToDoTitle = '%s have forwarded %d feedback to todo'; +$lang->message->feedbackToStoryTitle = '%s have forwarded %d feedback to story'; + +$lang->message->reviewToauditTitle = '%s have submit %d audits'; + $lang->message->mr = new stdClass(); $lang->message->mr->logTitle = 'Build log'; $lang->message->mr->compilefail = 'Your submitted merge request: %s, build failed'; diff --git a/xuanxuan/extension/xuan/message/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/extension/xuan/message/ext/lang/zh-cn/xuanxuan.php index 7503db0276..2d71146eab 100644 --- a/xuanxuan/extension/xuan/message/ext/lang/zh-cn/xuanxuan.php +++ b/xuanxuan/extension/xuan/message/ext/lang/zh-cn/xuanxuan.php @@ -8,6 +8,13 @@ $lang->message->notifyPassTitle = '%s 通过了%d个研发需求'; $lang->message->notifyClarifyTitle = '%s 驳回了%d个研发需求'; $lang->message->notifyRejectTitle = '%s 拒绝了%d个研发需求'; +$lang->message->feedbackToBugTitle = '%s 已将%d个反馈转至bug'; +$lang->message->feedbackToTaskTitle = '%s 已将%d个反馈转至任务'; +$lang->message->feedbackToDoTitle = '%s 已将%d个反馈转至待办'; +$lang->message->feedbackToStoryTitle = '%s 已将%d个反馈转至研发需求'; + +$lang->message->reviewToauditTitle = '%s 已经提交了%d个审计'; + $lang->message->mr = new stdClass(); $lang->message->mr->logTitle = '构建日志'; $lang->message->mr->compilefail = '您提交的合并请求:%s,构建任务执行失败'; From d807c2d0d1ef882358fbd18735af3eb9843e27d4 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Wed, 28 Sep 2022 16:54:01 +0800 Subject: [PATCH 003/129] * fix delete user show dialog abnormal in zentao client --- module/user/css/delete.css | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 module/user/css/delete.css diff --git a/module/user/css/delete.css b/module/user/css/delete.css new file mode 100644 index 0000000000..21e3b77e30 --- /dev/null +++ b/module/user/css/delete.css @@ -0,0 +1,4 @@ +.xxc-embed.body-modal #mainContent { + position: relative; + top: 70px; +} \ No newline at end of file From 9637c6d3030461983922fb08f2ddbbaba5004d52 Mon Sep 17 00:00:00 2001 From: jyeu Date: Thu, 29 Sep 2022 16:20:02 +0800 Subject: [PATCH 004/129] * add an exception for approval flow notifications. --- .../extension/xuan/im/ext/model/class/xuanxuan.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php b/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php index 8391277656..d1074e6e53 100644 --- a/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php @@ -214,11 +214,16 @@ class xuanxuanIm extends imModel $messageGroups[$contentData->contentType][] = $message; continue; } - if ($contentData->objectType == 'story' && $contentData->action == 'reviewed') + if($contentData->objectType == 'story' && $contentData->action == 'reviewed') { $extra = explode(',', $contentDataOuter->extra)[0]; $messageGroups["$contentData->objectType-$contentData->parentType-$contentData->action-$contentData->actor-$extra"][] = $message; } + if($message->contentType == 'text') + { + $messageGroups['text'][] = $message; + continue; + } else { $messageGroups["$contentData->objectType-$contentData->parentType-$contentData->action-$contentData->actor"][] = $message; From 98bb2938b77cf8fb2c670ea79a6dc74345ddcedc Mon Sep 17 00:00:00 2001 From: denghongtao Date: Mon, 10 Oct 2022 01:36:40 +0000 Subject: [PATCH 005/129] Add repo unittest. --- test/class/repo.class.php | 22 ++++++++++++++++++---- test/model/repo/getcloneurl.php | 15 ++++++++++++++- test/model/repo/getlistbyscm.php | 7 ++++++- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/test/class/repo.class.php b/test/class/repo.class.php index 7ed1021ee4..85ced91220 100644 --- a/test/class/repo.class.php +++ b/test/class/repo.class.php @@ -43,20 +43,34 @@ class repoTest public function getListTest($projectID = 0, $SCM = '', $orderBy = 'id_desc', $pager = null) { - $objects = $this->objectModel->getList($projectID, $SCM, $orderBy, $pager); + $objects = $this->objectModel->getList($projectID , $SCM, $orderBy , $pager ); if(dao::isError()) return dao::getError(); - return $objects; + if(!empty($objects)) + { + return $objects[1]->name; + } + else + { + return 'empty'; + } } public function getListBySCMTest($scm, $type = 'all') { - $objects = $this->objectModel->getListBySCM($scm, $type); + $objects = $this->objectModel->getListBySCM($scm, $type = 'all'); if(dao::isError()) return dao::getError(); - return $objects; + if(!empty($objects)) + { + return $objects[0]->name; + } + else + { + return 'empty'; + } } public function createTest() diff --git a/test/model/repo/getcloneurl.php b/test/model/repo/getcloneurl.php index 0cb095ca1c..8ec0ae5734 100644 --- a/test/model/repo/getcloneurl.php +++ b/test/model/repo/getcloneurl.php @@ -13,5 +13,18 @@ pid=1 */ $repo = new repoTest(); +$result1 = $repo->getCloneUrlTest(1); +$result2 = $repo->getCloneUrlTest(2); +$result3 = $repo->getCloneUrlTest(3); +$result4 = $repo->getCloneUrlTest(4); +$result5 = $repo->getCloneUrlTest(7); +$result6 = $repo->getCloneUrlTest(11); +$result7 = $repo->getCloneUrlTest(0); -r($repo->getCloneUrlTest()) && p() && e(); \ No newline at end of file +r($result1) && p('http') && e(''); +r($result2) && p('http') && e(''); +r($result3) && p('http') && e(''); +r($result4) && p('http') && e(''); +r($result5) && p('http') && e(''); +r($result6) && p('http') && e(''); +r($result7) && p('http') && e(''); diff --git a/test/model/repo/getlistbyscm.php b/test/model/repo/getlistbyscm.php index ad618ee52b..d5f4a2b09e 100644 --- a/test/model/repo/getlistbyscm.php +++ b/test/model/repo/getlistbyscm.php @@ -13,5 +13,10 @@ pid=1 */ $repo = new repoTest(); +$result1 = $repo->getListBySCMTest('Gitlab'); +$result2 = $repo->getListBySCMTest('gogs'); +$result3 = $repo->getListBySCMTest('empty'); -r($repo->getListBySCMTest()) && p() && e(); \ No newline at end of file +r($result1) && p('') && e('723test'); +r($result2) && p('') && e('empty'); +r($result3) && p('') && e('empty'); From 57c0dcbb8403611f0c6db3c0f106c90c57162281 Mon Sep 17 00:00:00 2001 From: Chenjianyu Date: Wed, 26 Oct 2022 13:13:50 +0800 Subject: [PATCH 006/129] Revert "* add an exception for approval flow notifications." This reverts commit 9637c6d3030461983922fb08f2ddbbaba5004d52. --- .../extension/xuan/im/ext/model/class/xuanxuan.class.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php b/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php index d1074e6e53..8391277656 100644 --- a/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/extension/xuan/im/ext/model/class/xuanxuan.class.php @@ -214,16 +214,11 @@ class xuanxuanIm extends imModel $messageGroups[$contentData->contentType][] = $message; continue; } - if($contentData->objectType == 'story' && $contentData->action == 'reviewed') + if ($contentData->objectType == 'story' && $contentData->action == 'reviewed') { $extra = explode(',', $contentDataOuter->extra)[0]; $messageGroups["$contentData->objectType-$contentData->parentType-$contentData->action-$contentData->actor-$extra"][] = $message; } - if($message->contentType == 'text') - { - $messageGroups['text'][] = $message; - continue; - } else { $messageGroups["$contentData->objectType-$contentData->parentType-$contentData->action-$contentData->actor"][] = $message; From c761197f0a63b1dbe07a70d2885805ac63031b1b Mon Sep 17 00:00:00 2001 From: Chenjianyu Date: Wed, 26 Oct 2022 13:14:09 +0800 Subject: [PATCH 007/129] Revert "* add xuanxuan notification send feedback and review" This reverts commit 2eb3300ca6314f720a3e235bd462e80f9f7697e8. --- .../ext/model/class/xuanxuan.class.php | 72 ++----------------- 1 file changed, 6 insertions(+), 66 deletions(-) diff --git a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php index 9ea25f0734..8a33333ac8 100644 --- a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php @@ -23,19 +23,10 @@ class xuanxuanMessage extends messageModel { $field = 'obj.*,project.name as projectName,product.name as productName,execu.name as execuName'; } - else if($objectType == 'feedback') - { - $field = 'obj.*,product.name as productName'; - } - else if($objectType == 'review') - { - $field = 'obj.*,project.name as projectName'; - } else { $field = 'obj.*'; } - $object = $this->dao->select($field)->from($this->config->objectTables[$objectType])->alias('obj') ->beginIF($objectType == 'task') ->leftJoin($this->config->objectTables['project'])->alias('project')->on('project.id = obj.project') @@ -49,12 +40,6 @@ class xuanxuanMessage extends messageModel ->leftJoin($this->config->objectTables['execution'])->alias('execu')->on('execu.id = obj.execution') ->leftJoin($this->config->objectTables['product'])->alias('product')->on('product.id = obj.product') ->fi() - ->beginIF($objectType == 'feedback') - ->leftJoin($this->config->objectTables['product'])->alias('product')->on('product.id = obj.product') - ->fi() - ->beginIF($objectType == 'review') - ->leftJoin($this->config->objectTables['project'])->alias('project')->on('project.id = obj.project') - ->fi() ->where('obj.id')->eq($objectID) ->fetch(); $field = $this->config->action->objectNameFields[$objectType]; @@ -64,43 +49,18 @@ class xuanxuanMessage extends messageModel $notifyType = strtolower(explode(',', $extra)[0]); if ($notifyType == 'pass') { - $title = sprintf($this->lang->message->notifyPassTitle, $this->app->user->realname, 1); + $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyPassTitle, $this->app->user->realname, 1); } else if($notifyType == 'clarify') { - $title = sprintf($this->lang->message->notifyClarifyTitle, $this->app->user->realname, 1); + $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyClarifyTitle, $this->app->user->realname, 1); } else if($notifyType == 'reject') { - $title = sprintf($this->lang->message->notifyRejectTitle, $this->app->user->realname, 1); + $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyRejectTitle, $this->app->user->realname, 1); } } - if ($objectType == 'feedback' && ($actionType == 'tobug' || $actionType == 'tostory' || $actionType == 'totask' || $actionType == 'todo')) - { - if ($actionType == 'tobug') - { - $title = sprintf($this->lang->message->feedbackToBugTitle, $this->app->user->realname, 1); - } - else if($actionType == 'tostory') - { - $title = sprintf($this->lang->message->feedbackToStoryTitle, $this->app->user->realname, 1); - } - else if($actionType == 'totask') - { - $title = sprintf($this->lang->message->feedbackToTaskTitle, $this->app->user->realname, 1); - } - else if($actionType == 'todo') - { - $title = sprintf($this->lang->message->feedbackToDoTitle, $this->app->user->realname, 1); - } - } - - if ($objectType == 'review' && $actionType == 'toaudit') - { - $title = sprintf($this->lang->message->reviewToauditTitle, $this->app->user->realname, 1); - } - $server = $this->loadModel('im')->getServer('zentao'); $onlybody = isset($_GET['onlybody']) ? $_GET['onlybody'] : ''; unset($_GET['onlybody']); @@ -111,12 +71,10 @@ class xuanxuanMessage extends messageModel if(!empty($object->assignedTo)) $target .= $object->assignedTo == 'closed' ? $object->openedBy : $object->assignedTo; if(!empty($object->mailto)) $target .= ",{$object->mailto}"; if(($objectType == 'mr' or $objectType == 'kanbancard') and !empty($object->createdBy)) $target .= ",{$object->createdBy}"; - if($objectType == 'review') $target .= ",{$object->auditedBy}"; $target = trim($target, ','); - $target = explode(',', $target); $target = $this->dao->select('id')->from(TABLE_USER) ->where('account')->in($target) - ->beginIF($objectType != 'mr' && $objectType != 'review')->andWhere('account')->ne($this->app->user->account)->fi() + ->beginIF($objectType != 'mr')->andWhere('account')->ne($this->app->user->account)->fi() ->fetchAll('id'); $target = array_keys($target); @@ -152,24 +110,6 @@ class xuanxuanMessage extends messageModel $subcontent->parentURL = "xxc:openInApp/zentao-integrated/" . urlencode($server . helper::createLink($parentType, 'browse', "id=$subcontent->parent", 'html')); $subcontent->cardURL = $url; } - elseif($objectType == 'feedback') - { - $subcontent->headTitle = $object->productName; - $subcontent->headSubTitle = $object->execuName; - $subcontent->parentType = 'product'; - $subcontent->parent = $object->product; - $subcontent->parentURL = "xxc:openInApp/zentao-integrated/" . urlencode($server . helper::createLink('feedback', 'browse', "id=$object->product", 'html')); - $subcontent->cardURL = $url; - } - elseif($objectType == 'review') - { - $subcontent->headTitle = $object->projectName; - $subcontent->headSubTitle = $object->execuName; - $subcontent->parentType = 'product'; - $subcontent->parent = $object->product; - $subcontent->parentURL = "xxc:openInApp/zentao-integrated/" . urlencode($server . helper::createLink('review', 'browse', "id=$object->product", 'html')); - $subcontent->cardURL = $url; - } else { $subcontent->parentType = $objectType; @@ -206,11 +146,11 @@ class xuanxuanMessage extends messageModel $contentData->actions = array(); $contentData->url = "xxc:openInApp/zentao-integrated/" . urlencode($url); } - $contentData->extra = is_array($extra) ? $extra : ''; + $contentData->extra = $extra; $content = json_encode($contentData); $avatarUrl = $server . $this->app->getWebRoot() . 'favicon.ico'; - if($target && ($objectType == 'bug' || $objectType == 'task' || $objectType == 'story' || $objectType == 'feedback' || $objectType == 'review')) $this->loadModel('im')->messageCreateNotify($target, $title, $subtitle = '', $content, $contentType = 'object', $url, $actions = array(), $sender = array('id' => 'zentao', 'realname' => $this->lang->message->sender, 'name' => $this->lang->message->sender, 'avatar' => $avatarUrl)); + if($target && ($objectType == 'bug' || $objectType == 'task' || $objectType == 'story')) $this->loadModel('im')->messageCreateNotify($target, $title, $subtitle = '', $content, $contentType = 'object', $url, $actions = array(), $sender = array('id' => 'zentao', 'realname' => $this->lang->message->sender, 'name' => $this->lang->message->sender, 'avatar' => $avatarUrl)); if($objectType == 'mr' and is_array($this->lang->message->mr->$actionType) and !empty($object->assignee)) { From 5a84b1669ea417ed9e3360dafcc47fcc9abb5782 Mon Sep 17 00:00:00 2001 From: Chenjianyu Date: Wed, 26 Oct 2022 13:29:20 +0800 Subject: [PATCH 008/129] * add xuanxuan feedback notifications. --- .../xuan/message/ext/lang/de/xuanxuan.php | 2 - .../xuan/message/ext/lang/en/xuanxuan.php | 2 - .../xuan/message/ext/lang/fr/xuanxuan.php | 2 - .../xuan/message/ext/lang/zh-cn/xuanxuan.php | 2 - .../ext/model/class/xuanxuan.class.php | 46 +++++++++++++++++-- 5 files changed, 41 insertions(+), 13 deletions(-) diff --git a/xuanxuan/extension/xuan/message/ext/lang/de/xuanxuan.php b/xuanxuan/extension/xuan/message/ext/lang/de/xuanxuan.php index 73807b5a85..f81d6076f2 100644 --- a/xuanxuan/extension/xuan/message/ext/lang/de/xuanxuan.php +++ b/xuanxuan/extension/xuan/message/ext/lang/de/xuanxuan.php @@ -13,8 +13,6 @@ $lang->message->feedbackToTaskTitle = '%s have forwarded %d feedback to task'; $lang->message->feedbackToDoTitle = '%s have forwarded %d feedback to todo'; $lang->message->feedbackToStoryTitle = '%s have forwarded %d feedback to story'; -$lang->message->reviewToauditTitle = '%s have submit %d audits'; - $lang->message->mr = new stdClass(); $lang->message->mr->logTitle = 'Build log'; $lang->message->mr->compilefail = 'Your submitted merge request: %s, build failed'; diff --git a/xuanxuan/extension/xuan/message/ext/lang/en/xuanxuan.php b/xuanxuan/extension/xuan/message/ext/lang/en/xuanxuan.php index 73807b5a85..f81d6076f2 100644 --- a/xuanxuan/extension/xuan/message/ext/lang/en/xuanxuan.php +++ b/xuanxuan/extension/xuan/message/ext/lang/en/xuanxuan.php @@ -13,8 +13,6 @@ $lang->message->feedbackToTaskTitle = '%s have forwarded %d feedback to task'; $lang->message->feedbackToDoTitle = '%s have forwarded %d feedback to todo'; $lang->message->feedbackToStoryTitle = '%s have forwarded %d feedback to story'; -$lang->message->reviewToauditTitle = '%s have submit %d audits'; - $lang->message->mr = new stdClass(); $lang->message->mr->logTitle = 'Build log'; $lang->message->mr->compilefail = 'Your submitted merge request: %s, build failed'; diff --git a/xuanxuan/extension/xuan/message/ext/lang/fr/xuanxuan.php b/xuanxuan/extension/xuan/message/ext/lang/fr/xuanxuan.php index 73807b5a85..f81d6076f2 100644 --- a/xuanxuan/extension/xuan/message/ext/lang/fr/xuanxuan.php +++ b/xuanxuan/extension/xuan/message/ext/lang/fr/xuanxuan.php @@ -13,8 +13,6 @@ $lang->message->feedbackToTaskTitle = '%s have forwarded %d feedback to task'; $lang->message->feedbackToDoTitle = '%s have forwarded %d feedback to todo'; $lang->message->feedbackToStoryTitle = '%s have forwarded %d feedback to story'; -$lang->message->reviewToauditTitle = '%s have submit %d audits'; - $lang->message->mr = new stdClass(); $lang->message->mr->logTitle = 'Build log'; $lang->message->mr->compilefail = 'Your submitted merge request: %s, build failed'; diff --git a/xuanxuan/extension/xuan/message/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/extension/xuan/message/ext/lang/zh-cn/xuanxuan.php index 2d71146eab..ab4bfdae20 100644 --- a/xuanxuan/extension/xuan/message/ext/lang/zh-cn/xuanxuan.php +++ b/xuanxuan/extension/xuan/message/ext/lang/zh-cn/xuanxuan.php @@ -13,8 +13,6 @@ $lang->message->feedbackToTaskTitle = '%s 已将%d个反馈转至任务'; $lang->message->feedbackToDoTitle = '%s 已将%d个反馈转至待办'; $lang->message->feedbackToStoryTitle = '%s 已将%d个反馈转至研发需求'; -$lang->message->reviewToauditTitle = '%s 已经提交了%d个审计'; - $lang->message->mr = new stdClass(); $lang->message->mr->logTitle = '构建日志'; $lang->message->mr->compilefail = '您提交的合并请求:%s,构建任务执行失败'; diff --git a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php index 8a33333ac8..b5cfc3ba77 100644 --- a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php @@ -23,6 +23,10 @@ class xuanxuanMessage extends messageModel { $field = 'obj.*,project.name as projectName,product.name as productName,execu.name as execuName'; } + else if($objectType == 'feedback') + { + $field = 'obj.*,product.name as productName'; + } else { $field = 'obj.*'; @@ -40,6 +44,9 @@ class xuanxuanMessage extends messageModel ->leftJoin($this->config->objectTables['execution'])->alias('execu')->on('execu.id = obj.execution') ->leftJoin($this->config->objectTables['product'])->alias('product')->on('product.id = obj.product') ->fi() + ->beginIF($objectType == 'feedback') + ->leftJoin($this->config->objectTables['product'])->alias('product')->on('product.id = obj.product') + ->fi() ->where('obj.id')->eq($objectID) ->fetch(); $field = $this->config->action->objectNameFields[$objectType]; @@ -49,15 +56,35 @@ class xuanxuanMessage extends messageModel $notifyType = strtolower(explode(',', $extra)[0]); if ($notifyType == 'pass') { - $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyPassTitle, $this->app->user->realname, 1); + $title = sprintf($this->lang->message->notifyPassTitle, $this->app->user->realname, 1); } else if($notifyType == 'clarify') { - $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyClarifyTitle, $this->app->user->realname, 1); + $title = sprintf($this->lang->message->notifyClarifyTitle, $this->app->user->realname, 1); } else if($notifyType == 'reject') { - $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyRejectTitle, $this->app->user->realname, 1); + $title = sprintf($this->lang->message->notifyRejectTitle, $this->app->user->realname, 1); + } + } + + if ($objectType == 'feedback' && ($actionType == 'tobug' || $actionType == 'tostory' || $actionType == 'totask' || $actionType == 'todo')) + { + if ($actionType == 'tobug') + { + $title = sprintf($this->lang->message->feedbackToBugTitle, $this->app->user->realname, 1); + } + else if($actionType == 'tostory') + { + $title = sprintf($this->lang->message->feedbackToStoryTitle, $this->app->user->realname, 1); + } + else if($actionType == 'totask') + { + $title = sprintf($this->lang->message->feedbackToTaskTitle, $this->app->user->realname, 1); + } + else if($actionType == 'todo') + { + $title = sprintf($this->lang->message->feedbackToDoTitle, $this->app->user->realname, 1); } } @@ -110,6 +137,15 @@ class xuanxuanMessage extends messageModel $subcontent->parentURL = "xxc:openInApp/zentao-integrated/" . urlencode($server . helper::createLink($parentType, 'browse', "id=$subcontent->parent", 'html')); $subcontent->cardURL = $url; } + elseif($objectType == 'feedback') + { + $subcontent->headTitle = $object->productName; + $subcontent->headSubTitle = $object->execuName; + $subcontent->parentType = 'product'; + $subcontent->parent = $object->product; + $subcontent->parentURL = "xxc:openInApp/zentao-integrated/" . urlencode($server . helper::createLink('feedback', 'browse', "id=$object->product", 'html')); + $subcontent->cardURL = $url; + } else { $subcontent->parentType = $objectType; @@ -146,11 +182,11 @@ class xuanxuanMessage extends messageModel $contentData->actions = array(); $contentData->url = "xxc:openInApp/zentao-integrated/" . urlencode($url); } - $contentData->extra = $extra; + $contentData->extra = is_array($extra) ? $extra : ''; $content = json_encode($contentData); $avatarUrl = $server . $this->app->getWebRoot() . 'favicon.ico'; - if($target && ($objectType == 'bug' || $objectType == 'task' || $objectType == 'story')) $this->loadModel('im')->messageCreateNotify($target, $title, $subtitle = '', $content, $contentType = 'object', $url, $actions = array(), $sender = array('id' => 'zentao', 'realname' => $this->lang->message->sender, 'name' => $this->lang->message->sender, 'avatar' => $avatarUrl)); + if($target && ($objectType == 'bug' || $objectType == 'task' || $objectType == 'story' || $objectType == 'feedback')) $this->loadModel('im')->messageCreateNotify($target, $title, $subtitle = '', $content, $contentType = 'object', $url, $actions = array(), $sender = array('id' => 'zentao', 'realname' => $this->lang->message->sender, 'name' => $this->lang->message->sender, 'avatar' => $avatarUrl)); if($objectType == 'mr' and is_array($this->lang->message->mr->$actionType) and !empty($object->assignee)) { From eb68363dee0d33b2be904f623a6ba64eaa1afdc4 Mon Sep 17 00:00:00 2001 From: Chenjianyu Date: Thu, 27 Oct 2022 14:31:35 +0800 Subject: [PATCH 009/129] * fix xuanxuan feedback notify users. --- .../message/ext/model/class/xuanxuan.class.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php index b5cfc3ba77..a289572e73 100644 --- a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php @@ -95,10 +95,23 @@ class xuanxuanMessage extends messageModel $url = $server . helper::createLink($objectType == 'kanbancard' ? 'kanban' : $objectType, 'view', "id=$dataID", 'html'); $target = ''; - if(!empty($object->assignedTo)) $target .= $object->assignedTo == 'closed' ? $object->openedBy : $object->assignedTo; - if(!empty($object->mailto)) $target .= ",{$object->mailto}"; + if($objectType == 'feedback') + { + $feedback = $this->loadModel('feedback')->getByID($objectID); + $senderUser = $this->feedback->getToAndCcList($feedback); + foreach ($senderUser as $user) + { + $target .= ',' . $user; + } + } + else + { + if(!empty($object->assignedTo)) $target .= $object->assignedTo == 'closed' ? $object->openedBy : $object->assignedTo; + if(!empty($object->mailto)) $target .= ",{$object->mailto}"; + } if(($objectType == 'mr' or $objectType == 'kanbancard') and !empty($object->createdBy)) $target .= ",{$object->createdBy}"; $target = trim($target, ','); + $target = explode(',', $target); $target = $this->dao->select('id')->from(TABLE_USER) ->where('account')->in($target) ->beginIF($objectType != 'mr')->andWhere('account')->ne($this->app->user->account)->fi() From c9996776961550d1b2be73032f33fc42b9082199 Mon Sep 17 00:00:00 2001 From: Chenjianyu Date: Thu, 27 Oct 2022 16:28:09 +0800 Subject: [PATCH 010/129] Revert "* fix delete user show dialog abnormal in zentao client" This reverts commit d807c2d0d1ef882358fbd18735af3eb9843e27d4. --- module/user/css/delete.css | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 module/user/css/delete.css diff --git a/module/user/css/delete.css b/module/user/css/delete.css deleted file mode 100644 index 21e3b77e30..0000000000 --- a/module/user/css/delete.css +++ /dev/null @@ -1,4 +0,0 @@ -.xxc-embed.body-modal #mainContent { - position: relative; - top: 70px; -} \ No newline at end of file From f54206866f058ba7a3d5eb69b67287119a7e08e6 Mon Sep 17 00:00:00 2001 From: Chenjianyu Date: Fri, 28 Oct 2022 08:48:56 +0800 Subject: [PATCH 011/129] * clean up white space. --- .../xuan/message/ext/model/class/xuanxuan.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php index a289572e73..7debadf704 100644 --- a/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php +++ b/xuanxuan/extension/xuan/message/ext/model/class/xuanxuan.class.php @@ -51,10 +51,10 @@ class xuanxuanMessage extends messageModel ->fetch(); $field = $this->config->action->objectNameFields[$objectType]; $title = $objectType == 'mr' ? '' : sprintf($this->lang->message->notifyTitle, $this->app->user->realname, $this->lang->action->label->$actionType, 1, $this->lang->action->objectTypes[$objectType]); - if ($objectType == 'story' && $actionType == 'reviewed' && !empty($extra)) + if($objectType == 'story' && $actionType == 'reviewed' && !empty($extra)) { $notifyType = strtolower(explode(',', $extra)[0]); - if ($notifyType == 'pass') + if($notifyType == 'pass') { $title = sprintf($this->lang->message->notifyPassTitle, $this->app->user->realname, 1); } @@ -68,9 +68,9 @@ class xuanxuanMessage extends messageModel } } - if ($objectType == 'feedback' && ($actionType == 'tobug' || $actionType == 'tostory' || $actionType == 'totask' || $actionType == 'todo')) + if($objectType == 'feedback' && ($actionType == 'tobug' || $actionType == 'tostory' || $actionType == 'totask' || $actionType == 'todo')) { - if ($actionType == 'tobug') + if($actionType == 'tobug') { $title = sprintf($this->lang->message->feedbackToBugTitle, $this->app->user->realname, 1); } @@ -99,7 +99,7 @@ class xuanxuanMessage extends messageModel { $feedback = $this->loadModel('feedback')->getByID($objectID); $senderUser = $this->feedback->getToAndCcList($feedback); - foreach ($senderUser as $user) + foreach($senderUser as $user) { $target .= ',' . $user; } From 43be2741b43fb4d08fd9abf337df9389242f3323 Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 3 Nov 2022 05:42:11 +0000 Subject: [PATCH 012/129] * Resolved feedback #1353. --- module/execution/control.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/execution/control.php b/module/execution/control.php index 22b35d12db..babd7a50ec 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2564,6 +2564,12 @@ class execution extends control $projects = $this->project->getPairsByProgram('', 'noclosed'); $executions = $this->execution->getStatData(0, 'all', 0, 0, false, '', 'id_desc'); + foreach($executions as $execution) + { + $execution->name = htmlspecialchars_decode($execution->name); + $execution->team = htmlspecialchars_decode($execution->team); + } + $teams = $this->dao->select('root,account')->from(TABLE_TEAM) ->where('root')->in($this->app->user->view->sprints) ->andWhere('type')->eq('execution') From c25a79a1f5b78dd65e13ef2c6410119d75def9e7 Mon Sep 17 00:00:00 2001 From: liyang Date: Tue, 15 Nov 2022 11:02:27 +0800 Subject: [PATCH 013/129] * Add cteate yaml file test example. --- test/lib/yaml.class.php | 90 ++++++++++++++++++++++------------- test/model/action/getbyid.php | 13 +++-- 2 files changed, 68 insertions(+), 35 deletions(-) diff --git a/test/lib/yaml.class.php b/test/lib/yaml.class.php index 8e96353772..d96e1e90c2 100644 --- a/test/lib/yaml.class.php +++ b/test/lib/yaml.class.php @@ -1,6 +1,6 @@ * @package ZenTaoPMS - * @version $Id: $ + * @version 1.0 * @link http://www.zentao.net/ */ -class yaml + +/** + * Set fields for test data yaml file. + * + * @copyright Copyright 2009-2022 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com) + * @author liyang + * @package + * @license LGPL + * @version 1.0 + * @Link https://www.zentao.net + */ +class field { /** * Global config. @@ -22,12 +33,12 @@ class yaml public $config; /** - * Filed Arr. + * Field Arr. * * @var array * @access public */ - public $fieldArr = array(); + public $fieldArr = array(); /** * Field. @@ -72,7 +83,7 @@ class yaml } /** - * Set yaml filed. + * Set yaml field. * * @param string $value * @access public @@ -86,7 +97,7 @@ class yaml } /** - * Set filed rang. + * Set field rang. * * @param string $range * @access public @@ -118,7 +129,7 @@ class yaml * @access public * @return object */ - function postfix($postfix) + public function postfix($postfix) { $this->fieldArr[$this->field]['postfix'] = $postfix; return $this; @@ -131,7 +142,7 @@ class yaml * @access public * @return object */ - function type($type) + public function type($type) { $this->fieldArr[$this->field]['type'] = $type; return $this; @@ -144,24 +155,24 @@ class yaml * @access public * @return object */ - function format($format) + public function format($format) { $this->fieldArr[$this->field]['format'] = $format; return $this; } /** - * set field fields. + * Set field fields. * * @param array $fields * @access public * @return object */ - function fields($fields) + public function fields($fields) { if(!is_array($fields)) { - echo "fileds must be an array"; + echo "fields must be an array"; return; } @@ -170,31 +181,32 @@ class yaml } /** - * get field array value. + * Get field array. * * @access public * @return array */ - function getField() + public function getFields() { + var_dump($this->fieldArr); return $this->fieldArr; } /** * Assembly field generation rules. * - * @param array $filedArr + * @param array $fieldArr * @access public * @return array */ - function setFieldRule($filedArr) + public function setFieldRule($fieldArr) { $ruleArr = array(); $index = 0; - foreach($filedArr as $filed => $rule) + foreach($fieldArr as $field => $rule) { - $ruleArr[$index]['field'] = $filed; + $ruleArr[$index]['field'] = $field; if(array_key_exists('fields', $rule)) { @@ -202,7 +214,7 @@ class yaml } else { - if(!empty($rule['range'])) $ruleArr[$index]['range'] = $rule['range']; + if(!empty($rule['range'])) $ruleArr[$index]['range'] = $rule['range']; } if(!empty($rule['prefix'])) $ruleArr[$index]['prefix'] = $rule['prefix']; @@ -224,23 +236,37 @@ class yaml * @access public * @return void */ - function build($model, $name, $version = '') + public function build($model, $name, $version = '') { if(!is_dir($this->yamlDir . "/{$model}/data")) mkdir($this->yamlDir . "/{$model}/data", 0700); $yamlFile = $this->yamlDir . "/{$model}/data/{$name}.yaml"; $yamlDataArr = array(); - $yamlDataArr['title'] = "zt_{$name}"; - $yamlDataArr['author'] = "auto_{$name}"; + $yamlDataArr['title'] = "zt_{$name}"; + $yamlDataArr['author'] = "auto_{$name}"; $version ? $yamlDataArr['version'] = $version : $yamlDataArr['version'] = '1.0'; if(empty($this->fieldArr)) return; $yamlDataArr['fields'] = $this->setFieldRule($this->fieldArr); - yaml_emit_file($yamlFile, $yamlDataArr); + yaml_emit_file($yamlFile, $yamlDataArr, YAML_UTF8_ENCODING); } +} +/** + * Create test data from yaml file. + * + * @copyright Copyright 2009-2022 QingDao Nature Easy Soft Network Technology Co,LTD (www.cnezsoft.com) + * @author liyang + * @package + * @uses field + * @license LGPL + * @version 1.0 + * @Link https://www.zentao.net + */ +class yaml extends field +{ /** * Insert the data into database. * @@ -252,8 +278,8 @@ class yaml */ function insertDB($model, $file, $tableName, $rows, $isClear = false) { - $yamlFile = $this->yamlDir . "/{$model}/data/{$file}.yaml"; - $tableSqlDir = $this->yamlDir . "/{$model}/data/sql"; + $yamlFile = $this->yamlDir . "/{$model}/data/{$file}.yaml"; + $tableSqlDir = $this->yamlDir . "/{$model}/data/sql"; if(!is_dir($tableSqlDir)) mkdir($tableSqlDir, 0700); $dumpCommand = "mysqldump -u%s -p%s -h%s -P%s %s %s > {$tableSqlDir}/{$tableName}.sql"; @@ -269,7 +295,7 @@ class yaml $dbUser = $this->config->db->user; $dbPWD = $this->config->db->password; - $command = "$zdPath -c %s -d %s -n %d -t %s --trim -dns mysql://%s:%s@%s:%s/%s#utf8"; + $command = "$zdPath -c %s -d %s -n %d -t %s -dns mysql://%s:%s@%s:%s/%s#utf8"; if($isClear === true) $command .= ' --clear'; $execYaml = sprintf($command, $configYaml, $yamlFile, $rows, $tableName, $dbUser, $dbPWD, $dbHost, $dbPort, $dbName); $execDump = sprintf($dumpCommand, $dbUser, $dbPWD, $dbHost, $dbPort, $dbName, $tableName); @@ -290,11 +316,11 @@ class yaml $tableSql = $this->yamlDir . "/{$model}/data/sql/$tableName.sql"; if(!is_file($tableSql)) return false; - $dbName = $this->config->db->name; - $dbHost = $this->config->db->host; - $dbPort = $this->config->db->port; - $dbUser = $this->config->db->user; - $dbPWD = $this->config->db->password; + $dbName = $this->config->db->name; + $dbHost = $this->config->db->host; + $dbPort = $this->config->db->port; + $dbUser = $this->config->db->user; + $dbPWD = $this->config->db->password; $command = "mysql -u%s -p%s -h%s -P%s %s < %s"; $execRestore = sprintf($command, $dbUser, $dbPWD, $dbHost, $dbPort, $dbName, $tableSql); diff --git a/test/model/action/getbyid.php b/test/model/action/getbyid.php index 1df040499b..35c9d7b48c 100755 --- a/test/model/action/getbyid.php +++ b/test/model/action/getbyid.php @@ -3,7 +3,13 @@ include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; include dirname(dirname(dirname(__FILE__))) . '/class/action.class.php'; su('admin'); - +$yaml->id->range('101-105'); +$yaml->objectType->range("product,story,productplan,release"); +$yaml->action->range("common,extra,opened,created,changed"); +$yaml->comment->range("1-5")->prefix("这是一个系统日志测试备注"); +$yaml->getFields(); +$yaml->build('action', 'action_getbyid'); +$yaml->insertDB('action', 'action_getbyid', 'action', 5); /** title=测试 actionModel->getById(); @@ -18,7 +24,7 @@ pid=1 */ -$actionIDList = array('1', '2', '3', '4', '5'); +$actionIDList = array('101', '102', '103', '104', '105'); $action = new actionTest(); @@ -26,4 +32,5 @@ r($action->getByIdTest($actionIDList[0])) && p('objectType,objectId,action,comme r($action->getByIdTest($actionIDList[1])) && p('objectType,objectId,action,comment') && e('story,,extra,这是一个系统日志测试备注2'); // 测试获取动态2的信息 r($action->getByIdTest($actionIDList[2])) && p('objectType,objectId,action,comment') && e('productplan,,opened,这是一个系统日志测试备注3'); // 测试获取动态3的信息 r($action->getByIdTest($actionIDList[3])) && p('objectType,objectId,action,comment') && e('release,,created,这是一个系统日志测试备注4'); // 测试获取动态4的信息 -r($action->getByIdTest($actionIDList[4])) && p('objectType,objectId,action,comment') && e('project,,changed,这是一个系统日志测试备注5'); // 测试获取动态5的信息 \ No newline at end of file +r($action->getByIdTest($actionIDList[4])) && p('objectType,objectId,action,comment') && e('project,,changed,这是一个系统日志测试备注5'); // 测试获取动态5的信息 +$yaml->restoreTable('action', 'action'); From 5db92a2dad935ba9fee923b6df87d7c94e44b0b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 16 Nov 2022 13:51:46 +0800 Subject: [PATCH 014/129] * fix bug #29648. --- module/project/js/create.js | 1 + 1 file changed, 1 insertion(+) diff --git a/module/project/js/create.js b/module/project/js/create.js index 502b08126f..8f8dfa19e7 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -163,6 +163,7 @@ function setParentProgram(parentProgram) $(this).find('[name^=products]').attr('name', 'products[' + index + ']').attr('id', 'products' + index).attr('data-branch', selectedBranch).attr('data-plan', selectedPlan); $(this).find('[name^=products]').val(selectedProduct).chosen().change(); }); + $('#productsBox .row .col-sm-4:last').find('.input-group').append($('#productsBox .addProduct .input-group:first .input-group-addon').prop('outerHTML')); } if(parentProgram != 0) From 8370d27ee446406da1c514624768ee8f082d1691 Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 16 Nov 2022 08:24:12 +0000 Subject: [PATCH 015/129] * Fix feedback#1231 --- module/user/css/batchcreate.css | 3 ++ module/user/js/batchcreate.js | 52 +++++++++++++++++++++++++++ module/user/model.php | 26 ++++++++++++-- module/user/view/batchcreate.html.php | 10 ++++++ 4 files changed, 88 insertions(+), 3 deletions(-) diff --git a/module/user/css/batchcreate.css b/module/user/css/batchcreate.css index 6a5695e048..f3edda60aa 100644 --- a/module/user/css/batchcreate.css +++ b/module/user/css/batchcreate.css @@ -4,3 +4,6 @@ td .passwordBox {border-left-width: 0px!important;} .c-id {width: 40px;} .c-realname, .c-visions {width: 130px;} .c-dept, .c-role, .c-group, .c-commiter, .c-join, .c-contact {width: 120px;} +.c-company {width: 210px;} + +.user-type{margin: 8px 0px 0px 8px; float: left;} diff --git a/module/user/js/batchcreate.js b/module/user/js/batchcreate.js index 600d327709..ac36a2a3d3 100644 --- a/module/user/js/batchcreate.js +++ b/module/user/js/batchcreate.js @@ -186,3 +186,55 @@ $(document).on('change', "select[id^='visions']", function() }(n))); } }); + +/** + * Show or hide companies based on user type. + * + * @param type $type + * @access public + * @return void + */ +function changeType(type) +{ + if(type == 'inside') + { + $('#companyBox').addClass('hide'); + $('select[id^=dept], input[id^=join]').closest('td').removeClass('hide'); + $('select[id^=company]').closest('td').addClass('hide'); + $('th.c-dept, th.c-join').removeClass('hide'); + $('th.c-company').addClass('hide'); + } + else + { + $('#companyBox').removeClass('hide'); + $('select[id^=dept], input[id^=join]').closest('td').addClass('hide'); + $('select[id^=company]').closest('td').removeClass('hide'); + $('th.c-dept, th.c-join').addClass('hide'); + $('th.c-company').removeClass('hide'); + } + $('#userType').val(type); +} + +$(function() +{ + $(":checkbox[name^='new']").change(function() + { + var companyNode = $(this).prop('checked') ? $(this).closest('span').prevAll('select') : $(this).closest('span').prevAll('input'); + var companyNodeID = $(companyNode).attr('id'); + var companyNodeName = $(companyNode).attr('name'); + + if($(this).prop('checked')) + { + $(companyNode).replaceWith(""); + $('#' + companyNodeID + '_chosen').remove(); + } + else + { + var i = companyNodeID.replace(/[^0-9]/ig, ''); + var dataHtml = $(companies).attr('id', companyNodeID).attr('name', companyNodeName).prop('outerHTML'); + $('#' + companyNodeID).replaceWith(dataHtml); + if(i == 1) $('#' + companyNodeID).find('option[value="ditto"]').remove(); + $('#' + companyNodeID).chosen(); + } + }) +}); diff --git a/module/user/model.php b/module/user/model.php index 0f6acebe7c..12626b46c3 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -425,9 +425,19 @@ class userModel extends model } $data[$i] = new stdclass(); - $data[$i]->dept = $users->dept[$i] == 'ditto' ? (isset($prev['dept']) ? $prev['dept'] : 0) : $users->dept[$i]; + if($users->userType == 'outside') + { + $data[$i]->company = $users->company[$i] == 'ditto' ? (isset($prev['company']) ? $prev['company'] : 0) : $users->company[$i]; + $data[$i]->newCompany = isset($users->new[$i]) ? true : false; + $data[$i]->type = 'outside'; + } + else + { + $data[$i]->dept = $users->dept[$i] == 'ditto' ? (isset($prev['dept']) ? $prev['dept'] : 0) : $users->dept[$i]; + $data[$i]->join = empty($users->join[$i]) ? '0000-00-00' : ($users->join[$i]); + $data[$i]->type = 'inside'; + } $data[$i]->account = $users->account[$i]; - $data[$i]->type = 'inside'; $data[$i]->realname = $users->realname[$i]; $data[$i]->role = $role; $data[$i]->group = in_array('ditto', isset($users->group[$i]) ? $users->group[$i] : array()) ? (isset($prev['group']) ? $prev['group'] : '') : $users->group[$i]; @@ -435,7 +445,6 @@ class userModel extends model $data[$i]->gender = $users->gender[$i]; $data[$i]->password = md5(trim($users->password[$i])); $data[$i]->commiter = $users->commiter[$i]; - $data[$i]->join = empty($users->join[$i]) ? '0000-00-00' : ($users->join[$i]); $data[$i]->skype = $users->skype[$i]; $data[$i]->qq = $users->qq[$i]; $data[$i]->dingding = $users->dingding[$i]; @@ -474,6 +483,7 @@ class userModel extends model } $accounts[$i] = $data[$i]->account; + $prev['company'] = $data[$i]->company; $prev['dept'] = $data[$i]->dept; $prev['role'] = $data[$i]->role; $prev['group'] = $data[$i]->group; @@ -486,6 +496,16 @@ class userModel extends model $userIDList = array(); foreach($data as $user) { + if($user->type == 'outside' and $user->newCompany) + { + $company = new stdClass(); + $company->name = $user->company; + $this->dao->insert(TABLE_COMPANY)->data($company)->exec(); + + $user->company = $this->dao->lastInsertID(); + } + unset($user->newCompany); + if(is_array($user->group)) { foreach($user->group as $group) diff --git a/module/user/view/batchcreate.html.php b/module/user/view/batchcreate.html.php index 422d385075..2eb957bc8b 100644 --- a/module/user/view/batchcreate.html.php +++ b/module/user/view/batchcreate.html.php @@ -13,9 +13,11 @@ +

user->batchCreate;?>

+
user->typeList , 'inside', "onclick='changeType(this.value)'");?>
createLink('custom', 'ajaxSaveCustomFields', 'module=user§ion=custom&key=batchCreateFields')?> @@ -42,11 +44,13 @@ $showVisionList = count($visionList) > 1; ?>
+
+ @@ -80,6 +84,12 @@ user->batchCreate; $i++):?> + From cdb40c819028a38950bf18affce48fb7ab8c24ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Wed, 16 Nov 2022 16:27:09 +0800 Subject: [PATCH 016/129] * Modify user api bug. --- api/v1/entries/user.php | 7 +++++-- module/user/model.php | 2 -- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/v1/entries/user.php b/api/v1/entries/user.php index d419d970d4..773bf66c44 100644 --- a/api/v1/entries/user.php +++ b/api/v1/entries/user.php @@ -408,8 +408,11 @@ class userEntry extends entry $this->setPost('gender', $gender); $password = $this->request('password', zget($_POST, 'password', '')); - $this->setPost('password1', md5($password)); - $this->setPost('password2', md5($password)); + if($password) + { + $this->setPost('password1', md5($password)); + $this->setPost('password2', md5($password)); + } $this->setPost('verifyPassword', md5($this->app->user->password . $this->app->session->rand)); $control = $this->loadController('user', 'edit'); diff --git a/module/user/model.php b/module/user/model.php index 0f6acebe7c..de537a6c98 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -547,8 +547,6 @@ class userModel extends model ->remove('new, password1, password2, groups,verifyPassword, passwordStrength,passwordLength') ->get(); - /* Fix bug for api requests using json. */ - if($this->app->getViewType() == 'json') $this->post->verifyPassword = md5(md5($this->post->verifyPassword) . $this->session->rand); if(empty($_POST['verifyPassword']) or $this->post->verifyPassword != md5($this->app->user->password . $this->session->rand)) { dao::$errors['verifyPassword'][] = $this->lang->user->error->verifyPassword; From 4692b3e26ee5f36027152d53033f89ff55e276b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E8=BE=B0=E8=BD=A9?= Date: Wed, 16 Nov 2022 16:31:03 +0800 Subject: [PATCH 017/129] * Don not check password strength. --- api/v1/entries/user.php | 1 + 1 file changed, 1 insertion(+) diff --git a/api/v1/entries/user.php b/api/v1/entries/user.php index 773bf66c44..87782cf8c3 100644 --- a/api/v1/entries/user.php +++ b/api/v1/entries/user.php @@ -412,6 +412,7 @@ class userEntry extends entry { $this->setPost('password1', md5($password)); $this->setPost('password2', md5($password)); + $this->setPost('passwordStrength', 2); } $this->setPost('verifyPassword', md5($this->app->user->password . $this->app->session->rand)); From 4058d33d5d762be83e9aee8ca9e2ccaedc4e5c64 Mon Sep 17 00:00:00 2001 From: liyang Date: Wed, 16 Nov 2022 16:46:33 +0800 Subject: [PATCH 018/129] * Fix function of generate test data. --- test/lib/init.php | 1 - test/lib/yaml.class.php | 187 +++++++++++++++++++--------------- test/model/action/getbyid.php | 15 ++- 3 files changed, 114 insertions(+), 89 deletions(-) diff --git a/test/lib/init.php b/test/lib/init.php index 53aa259cb8..9fed533cd7 100644 --- a/test/lib/init.php +++ b/test/lib/init.php @@ -63,7 +63,6 @@ include $testPath. 'lib/db.class.php'; include $testPath. 'lib/yaml.class.php'; include $testPath. 'lib/rest.php'; $db = new db(); -$yaml = new yaml(); if(!empty($config->test->account) and !empty($config->test->password) and !empty($config->test->base)) { diff --git a/test/lib/yaml.class.php b/test/lib/yaml.class.php index d96e1e90c2..3dfa204431 100644 --- a/test/lib/yaml.class.php +++ b/test/lib/yaml.class.php @@ -24,14 +24,6 @@ */ class field { - /** - * Global config. - * - * @var object - * @access public - */ - public $config; - /** * Field Arr. * @@ -48,40 +40,6 @@ class field */ private $field; - /** - * Yaml Dir root. - * - * @var int - * @access public - */ - public $yamlDir; - - /** - * __construct function load config. - * - * @access public - * @return void - */ - public function __construct() - { - global $config; - $this->config = $config; - $this->yamlDir = dirname(__FILE__, 2) . '/model'; - } - - /** - * Magic method, return fild. - * - * @param string $property_name - * @access protected - * @return object - */ - public function __get($property_name) - { - $this->setField($property_name); - return $this; - } - /** * Set yaml field. * @@ -144,7 +102,7 @@ class field */ public function type($type) { - $this->fieldArr[$this->field]['type'] = $type; + $this->fieldArr[$this->field]['type'] = $type; return $this; } @@ -157,7 +115,7 @@ class field */ public function format($format) { - $this->fieldArr[$this->field]['format'] = $format; + $this->fieldArr[$this->field]['format'] = $format; return $this; } @@ -176,7 +134,7 @@ class field return; } - $this->fieldArr[$this->field]['fields'] = $fields; + $this->fieldArr[$this->field]['fields'] = $fields; return $this; } @@ -188,7 +146,6 @@ class field */ public function getFields() { - var_dump($this->fieldArr); return $this->fieldArr; } @@ -226,32 +183,6 @@ class field return $ruleArr; } - - /** - * Build yaml file. - * - * @param string $model - * @param string $name - * @param string $version - * @access public - * @return void - */ - public function build($model, $name, $version = '') - { - if(!is_dir($this->yamlDir . "/{$model}/data")) mkdir($this->yamlDir . "/{$model}/data", 0700); - $yamlFile = $this->yamlDir . "/{$model}/data/{$name}.yaml"; - - $yamlDataArr = array(); - - $yamlDataArr['title'] = "zt_{$name}"; - $yamlDataArr['author'] = "auto_{$name}"; - $version ? $yamlDataArr['version'] = $version : $yamlDataArr['version'] = '1.0'; - - if(empty($this->fieldArr)) return; - $yamlDataArr['fields'] = $this->setFieldRule($this->fieldArr); - - yaml_emit_file($yamlFile, $yamlDataArr, YAML_UTF8_ENCODING); - } } /** @@ -265,21 +196,106 @@ class field * @version 1.0 * @Link https://www.zentao.net */ -class yaml extends field +class yaml { + /** + * Set fields for yaml file. + * + * @var int + * @access public + */ + public $field; + + /** + * Global config. + * + * @var object + * @access public + */ + public $config; + + /** + * The generated data table name. + * + * @var string + * @access public + */ + public $tableName; + + /** + * __construct function load config and tableName. + * @param string $tableName + * @access public + * @return void + */ + public function __construct($tableName) + { + global $config; + $this->config = $config; + $this->tableName = $tableName; + $this->field = new field(); + } + + /** + * Magic method, return fild. + * + * @param string $property_name + * @access protected + * @return object + */ + public function __get($property_name) + { + $this->field->setField($property_name); + return $this->field; + } + + /** + * Build yaml file and insert table. + * + * @param int $rows + * @param bool $isDefault + * @param string $version + * @access public + * @return void + */ + public function gen($rows, $isDefault = false, $version = '') + { + $runFileDir = $_SERVER['PWD']; + $runFileName = str_replace(strrchr($_SERVER['SCRIPT_FILENAME'], "."), "", $_SERVER['SCRIPT_FILENAME']); + + if(!is_dir("$runFileDir/data")) mkdir("$runFileDir/data", 0700); + $yamlFile = "{$runFileDir}/data/{$this->tableName}_{$runFileName}.yaml"; + + $yamlDataArr = array(); + + $yamlDataArr['title'] = "zt_{$this->tableName}"; + $yamlDataArr['author'] = "auto_{$runFileName}"; + $version ? $yamlDataArr['version'] = $version : $yamlDataArr['version'] = '1.0'; + + if(empty($this->field->fieldArr)) return; + $yamlDataArr['fields'] = $this->field->setFieldRule($this->field->fieldArr); + + yaml_emit_file($yamlFile, $yamlDataArr, YAML_UTF8_ENCODING); + + $isDefault === true ? $this->insertDB($yamlFile, $this->tableName, $rows, true) : $this->insertDB($yamlFile, $this->tableName, $rows); + } + /** * Insert the data into database. * - * @param string $model + * @param string $yamlFile * @param string $tableName * @param int $rows + * @param bool $isDefault + * @param bool $isClear * @access public * @return string */ - function insertDB($model, $file, $tableName, $rows, $isClear = false) + function insertDB($yamlFile, $tableName, $rows, $isDefault = false, $isClear = true) { - $yamlFile = $this->yamlDir . "/{$model}/data/{$file}.yaml"; - $tableSqlDir = $this->yamlDir . "/{$model}/data/sql"; + if($isDefault === true) $yamlFile = dirname(dirname(__FILE__)) . "/data/{$tableName}.yaml"; + + $tableSqlDir = "{$_SERVER['PWD']}/data/sql"; if(!is_dir($tableSqlDir)) mkdir($tableSqlDir, 0700); $dumpCommand = "mysqldump -u%s -p%s -h%s -P%s %s %s > {$tableSqlDir}/{$tableName}.sql"; @@ -306,14 +322,13 @@ class yaml extends field /** * Restore table data. * - * @param string $model * @param string $tableName * @access public * @return mixed */ - public function restoreTable($model, $tableName) + public function restoreTable($tableName) { - $tableSql = $this->yamlDir . "/{$model}/data/sql/$tableName.sql"; + $tableSql = "{$_SERVER['PWD']}/data/sql/$tableName.sql"; if(!is_file($tableSql)) return false; $dbName = $this->config->db->name; @@ -327,3 +342,15 @@ class yaml extends field system($execRestore); } } + +/** + * Return yaml class + * + * @param string $table + * @access public + * @return mixed + */ +function zdTable($table) +{ + return new yaml($table); +} diff --git a/test/model/action/getbyid.php b/test/model/action/getbyid.php index 35c9d7b48c..3cca080ae1 100755 --- a/test/model/action/getbyid.php +++ b/test/model/action/getbyid.php @@ -3,13 +3,13 @@ include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; include dirname(dirname(dirname(__FILE__))) . '/class/action.class.php'; su('admin'); -$yaml->id->range('101-105'); -$yaml->objectType->range("product,story,productplan,release"); -$yaml->action->range("common,extra,opened,created,changed"); -$yaml->comment->range("1-5")->prefix("这是一个系统日志测试备注"); -$yaml->getFields(); -$yaml->build('action', 'action_getbyid'); -$yaml->insertDB('action', 'action_getbyid', 'action', 5); + +$action = zdTable('action'); +$action->id->range('101-105'); +$action->objectType->range("product,story,productplan,release,project"); +$action->action->range("common,extra,opened,created,changed"); +$action->comment->range("1-5")->prefix("这是一个系统日志测试备注"); +$action->gen(5); /** title=测试 actionModel->getById(); @@ -33,4 +33,3 @@ r($action->getByIdTest($actionIDList[1])) && p('objectType,objectId,action,comme r($action->getByIdTest($actionIDList[2])) && p('objectType,objectId,action,comment') && e('productplan,,opened,这是一个系统日志测试备注3'); // 测试获取动态3的信息 r($action->getByIdTest($actionIDList[3])) && p('objectType,objectId,action,comment') && e('release,,created,这是一个系统日志测试备注4'); // 测试获取动态4的信息 r($action->getByIdTest($actionIDList[4])) && p('objectType,objectId,action,comment') && e('project,,changed,这是一个系统日志测试备注5'); // 测试获取动态5的信息 -$yaml->restoreTable('action', 'action'); From 75d9b5ceb9ab7a3c234529addfe0506cf91f05c5 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Wed, 16 Nov 2022 17:01:58 +0800 Subject: [PATCH 019/129] * Fix bug execution menu --- module/common/lang/menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index d9c8aca692..86fbd5789c 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -343,7 +343,7 @@ $lang->execution->menu->view = array('link' => "$lang->view|execution|grouptas if($config->edition != 'open') $lang->execution->menu->view = array('link' => "$lang->view|execution|gantt|executionID=%s", 'alias' => 'grouptask,tree,taskeffort,gantt,calendar,relation,maintainrelation'); $lang->execution->menu->storyGroup = array('link' => "{$lang->common->story}|execution|story|executionID=%s",'class' => 'dropdown dropdown-hover', 'subModule' => 'story', 'alias' => 'batchcreate,storykanban'); -$lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story,execution', 'alias' => 'storykanban,linkstory'); +$lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'storykanban,linkstory'); $lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|bug|executionID=%s", 'subModule' => 'bug,testcase,testtask,testreport', 'alias' => 'qa,bug,testcase,testtask,testreport'); $lang->execution->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); $lang->execution->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=execution&objectID=%s", 'subModule' => 'doc'); From f4452f6d041c342df130684f9fcdf77216886f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 16 Nov 2022 17:06:12 +0800 Subject: [PATCH 020/129] * fix for link story and bug for project release. --- module/bug/model.php | 23 +++++++++++------------ module/projectrelease/control.php | 7 ++----- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 9d1449e37e..936a3766fe 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1943,7 +1943,7 @@ class bugModel extends model ->beginIF(!empty($productID))->andWhere('t1.product')->eq($productID)->fi() ->beginIF($type == 'unresolved')->andWhere('t1.status')->eq('active')->fi() ->beginIF($type == 'noclosed')->andWhere('t1.status')->ne('closed')->fi() - ->beginIF($build)->andWhere("CONCAT(',', t1.openedBuild, ',') like '%,$build,%'")->fi() + ->beginIF($build)->andWhere("FIND_IN_SET($build, t1.openedBuild)")->fi() ->beginIF(!empty($param))->andWhere('t2.path')->like("%,$param,%")->andWhere('t2.deleted')->eq(0)->fi() ->beginIF($excludeBugs)->andWhere('t1.id')->notIN($excludeBugs)->fi() ->orderBy($orderBy) @@ -1972,11 +1972,8 @@ class bugModel extends model $builds = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->in($build)->fetchAll('id'); $executionIdList = array(); - foreach($builds as $build) - { - if(empty($build->execution)) continue; - $executionIdList[$build->execution] = $build->execution; - } + foreach($builds as $build) $executionIdList[$build->execution] = empty($build->execution) ? $build->project : $build->execution; + $executionIdList = array_unique($executionIdList); if(empty($executionIdList)) return array(); $executions = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->in($executionIdList)->fetchAll(); @@ -2085,13 +2082,15 @@ class bugModel extends model */ public function getReleaseBugs($buildID, $productID, $branch = 0, $linkedBugs = '', $pager = null) { - $executions = $this->dao->select('t1.id,t1.begin')->from(TABLE_EXECUTION)->alias('t1') - ->leftJoin(TABLE_BUILD)->alias('t2')->on('t1.id = t2.execution') - ->where('t2.id')->in($buildID) - ->fetchAll('id'); + $builds = $this->dao->select('id,project,execution')->from(TABLE_BUILD)->where('id')->in($buildID)->fetchAll('id'); + $executionIdList = array(); + foreach($builds as $build) $executionIdList[] = empty($build->execution) ? $build->project : $build->execution; + $executionIdList = array_unique($executionIdList); + if(empty($executionIdList)) return array(); - $condition = 'execution NOT ' . helper::dbIN(array_keys($executions)); - $minBegin = ''; + $executions = $this->dao->select('id,begin')->from(TABLE_EXECUTION)->where('id')->in($executionIdList)->fetchAll('id'); + $condition = 'execution NOT ' . helper::dbIN($executionIdList); + $minBegin = ''; foreach($executions as $execution) { if(empty($minBegin) or $minBegin > $execution->begin) $minBegin = $execution->begin; diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 64a5d6b9e9..2d7fa4fb26 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -575,11 +575,8 @@ class projectrelease extends control $this->loadModel('search')->setSearchParams($this->config->product->search); $executionIdList = array(); - foreach($builds as $build) - { - if(empty($build->execution)) continue; - $executionIdList[$build->execution] = $build->execution; - } + foreach($builds as $build) $executionIdList[] = empty($build->execution) ? $build->project : $build->execution; + $executionIdList = array_unique($executionIdList); $allStories = array(); if($browseType == 'bySearch') From 0fdbf58dc900a0e4f52cd55122126d4e1845e346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Wed, 16 Nov 2022 17:09:07 +0800 Subject: [PATCH 021/129] * adjust code. --- module/bug/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/model.php b/module/bug/model.php index 936a3766fe..657b2ae145 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1972,7 +1972,7 @@ class bugModel extends model $builds = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->in($build)->fetchAll('id'); $executionIdList = array(); - foreach($builds as $build) $executionIdList[$build->execution] = empty($build->execution) ? $build->project : $build->execution; + foreach($builds as $build) $executionIdList[] = empty($build->execution) ? $build->project : $build->execution; $executionIdList = array_unique($executionIdList); if(empty($executionIdList)) return array(); From 40ff070bc92b2cac0587bc4db01d7ebefe84305b Mon Sep 17 00:00:00 2001 From: daitingting Date: Wed, 16 Nov 2022 09:15:15 +0000 Subject: [PATCH 022/129] * Fix bug #29652. --- extension/lite/execution/ext/control/create.php | 4 ++-- framework/router.class.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extension/lite/execution/ext/control/create.php b/extension/lite/execution/ext/control/create.php index cd8f6aed3a..f5f9ffd2f1 100644 --- a/extension/lite/execution/ext/control/create.php +++ b/extension/lite/execution/ext/control/create.php @@ -4,7 +4,7 @@ class myExecution extends execution { public function create($projectID = '', $executionID = 0, $copyExecutionID = '', $planID = 0, $confirm = 'no', $productID = 0, $extra = '') { - $this->config->execution->create->requiredFields = 'name,code,begin,end'; + $this->config->execution->create->requiredFields = 'name,code,begin,end'; parent::create($projectID, $executionID, $copyExecutionID, $planID, $confirm, $productID, $extra); } -} \ No newline at end of file +} diff --git a/framework/router.class.php b/framework/router.class.php index 54a15be084..dac06b4ac9 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -181,7 +181,7 @@ class router extends baseRouter $hourKey = $planKey = $URSR = $URAndSR = 0; - $mode = 'new'; + $mode = 'ALM'; $score = '0'; $projectKey = ITERATION_KEY; $disabledFeatures = ''; @@ -200,7 +200,7 @@ class router extends baseRouter } /* Lite Version is compatible with classic modes */ - if($config->vision == 'lite') $mode = 'new'; + if($config->vision == 'lite') $mode = 'ALM'; /* Record system mode. */ $config->systemMode = $mode; From 679f2641aaffe0a1d22ccefa2a9834547d2ae4ae Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 16 Nov 2022 17:19:43 +0800 Subject: [PATCH 023/129] * Fallback code for bug#29896. --- module/program/model.php | 1 - module/project/js/create.js | 2 -- 2 files changed, 3 deletions(-) diff --git a/module/program/model.php b/module/program/model.php index 9d5ff89348..50948a015c 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -88,7 +88,6 @@ class programModel extends model $dao = $this->dao->select('id, name, program')->from(TABLE_PRODUCT) ->where('deleted')->eq(0) ->andWhere('vision')->eq($this->config->vision) - ->beginIF($programID !== '')->andWhere('program')->eq($programID)->fi() ->beginIF($shadow !== 'all')->andWhere('shadow')->eq((int)$shadow)->fi() ->beginIF($mode == 'assign')->andWhere('program')->eq($programID)->fi() ->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() diff --git a/module/project/js/create.js b/module/project/js/create.js index 2646ba755d..f140841f41 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -160,10 +160,8 @@ function setParentProgram(parentProgram) var selectedProduct = $(this).find('[name^=products]').val(); var selectedBranch = $(this).find('[name^=branch]').val(); var selectedPlan = $('#plan' + index ).find('[name^=plans]').val(); - var newProductHtml = $(this).find('span.input-group-addon'); $(this).html(productSelectHtml); - $(this).append(newProductHtml); $(this).find('[name^=products]').attr('name', 'products[' + index + ']').attr('id', 'products' + index).attr('data-branch', selectedBranch).attr('data-plan', selectedPlan); $(this).find('[name^=products]').val(selectedProduct).chosen().change(); }); From 9e8cd23ebdb4198707e8349542fce87d8afd7de3 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 17 Nov 2022 08:44:24 +0800 Subject: [PATCH 024/129] * Optimize code. --- module/projectstory/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/projectstory/control.php b/module/projectstory/control.php index 8e2eb76c43..35b2292286 100644 --- a/module/projectstory/control.php +++ b/module/projectstory/control.php @@ -40,7 +40,7 @@ class projectStory extends control if($projectID) { $project = $this->loadModel('project')->getByID($projectID); - if(!$project->hasProduct) $productID = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetch('product'); + if(!$project->hasProduct) $productID = $this->loadModel('product')->getShadowProductByProject($projectID)->id; } $this->products = $this->loadModel('product')->getProductPairsByProject($projectID); From 617ebf6d8d11cca8a07c20227e29a8c77a4e0760 Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 17 Nov 2022 08:45:30 +0800 Subject: [PATCH 025/129] * Fix bug #28841. --- module/story/view/edit.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index ea2bc86610..0db4bb5372 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -204,7 +204,7 @@ status);?> - status) !== false and $story->type == 'story'):?> + status) !== false and $story->type == 'story'):?> + shadow):?> + id);?> + + From 101f0844b49e84b69bcc8e5092447b939a3d03b2 Mon Sep 17 00:00:00 2001 From: liyang Date: Thu, 17 Nov 2022 09:11:59 +0800 Subject: [PATCH 027/129] * Fix yaml function. --- test/lib/yaml.class.php | 34 ++++++++++++++++++---------------- test/model/action/getbyid.php | 3 +++ 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/test/lib/yaml.class.php b/test/lib/yaml.class.php index 3dfa204431..687e869c07 100644 --- a/test/lib/yaml.class.php +++ b/test/lib/yaml.class.php @@ -22,7 +22,7 @@ * @version 1.0 * @Link https://www.zentao.net */ -class field +class fields { /** * Field Arr. @@ -126,7 +126,7 @@ class field * @access public * @return object */ - public function fields($fields) + public function setFields($fields) { if(!is_array($fields)) { @@ -204,7 +204,7 @@ class yaml * @var int * @access public */ - public $field; + public $fields; /** * Global config. @@ -233,7 +233,7 @@ class yaml global $config; $this->config = $config; $this->tableName = $tableName; - $this->field = new field(); + $this->fields = new fields(); } /** @@ -245,20 +245,19 @@ class yaml */ public function __get($property_name) { - $this->field->setField($property_name); - return $this->field; + $this->fields->setField($property_name); + return $this->fields; } /** * Build yaml file and insert table. * * @param int $rows - * @param bool $isDefault * @param string $version * @access public * @return void */ - public function gen($rows, $isDefault = false, $version = '') + public function gen($rows, $version = '') { $runFileDir = $_SERVER['PWD']; $runFileName = str_replace(strrchr($_SERVER['SCRIPT_FILENAME'], "."), "", $_SERVER['SCRIPT_FILENAME']); @@ -272,12 +271,18 @@ class yaml $yamlDataArr['author'] = "auto_{$runFileName}"; $version ? $yamlDataArr['version'] = $version : $yamlDataArr['version'] = '1.0'; - if(empty($this->field->fieldArr)) return; - $yamlDataArr['fields'] = $this->field->setFieldRule($this->field->fieldArr); + if(empty($this->fields->fieldArr)) + { + $yamlFile = dirname(dirname(__FILE__)) . "/data/{$this->tableName}.yaml"; + } + else + { + $yamlDataArr['fields'] = $this->fields->setFieldRule($this->fields->fieldArr); - yaml_emit_file($yamlFile, $yamlDataArr, YAML_UTF8_ENCODING); + yaml_emit_file($yamlFile, $yamlDataArr, YAML_UTF8_ENCODING); + } - $isDefault === true ? $this->insertDB($yamlFile, $this->tableName, $rows, true) : $this->insertDB($yamlFile, $this->tableName, $rows); + $this->insertDB($yamlFile, $this->tableName, $rows); } /** @@ -286,15 +291,12 @@ class yaml * @param string $yamlFile * @param string $tableName * @param int $rows - * @param bool $isDefault * @param bool $isClear * @access public * @return string */ - function insertDB($yamlFile, $tableName, $rows, $isDefault = false, $isClear = true) + function insertDB($yamlFile, $tableName, $rows, $isClear = true) { - if($isDefault === true) $yamlFile = dirname(dirname(__FILE__)) . "/data/{$tableName}.yaml"; - $tableSqlDir = "{$_SERVER['PWD']}/data/sql"; if(!is_dir($tableSqlDir)) mkdir($tableSqlDir, 0700); diff --git a/test/model/action/getbyid.php b/test/model/action/getbyid.php index 3cca080ae1..20df22fe78 100755 --- a/test/model/action/getbyid.php +++ b/test/model/action/getbyid.php @@ -10,6 +10,9 @@ $action->objectType->range("product,story,productplan,release,project"); $action->action->range("common,extra,opened,created,changed"); $action->comment->range("1-5")->prefix("这是一个系统日志测试备注"); $action->gen(5); + +//zdTable('action')->gen(5); + /** title=测试 actionModel->getById(); From f7506fa050905fe3b804ef81a92e0d67dd478379 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 17 Nov 2022 09:23:02 +0800 Subject: [PATCH 028/129] * Fix task #76408 --- module/story/control.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/story/control.php b/module/story/control.php index a9beabac45..1f16da235e 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -972,6 +972,7 @@ class story extends control $project = $this->dao->findByID($executionID)->from(TABLE_PROJECT)->fetch(); if($project->type == 'project') { + if(!($project->model == 'scrum' and !$project->hasProduct and $project->multiple)) $this->view->hiddenPlan = true; $this->project->setMenu($executionID); } else From 3a0d499acfe73f7c15e50b98a48c75bb141027ad Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 17 Nov 2022 09:28:31 +0800 Subject: [PATCH 029/129] * Fix bug#29831. --- module/design/control.php | 3 +++ module/design/view/browse.html.php | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/design/control.php b/module/design/control.php index 9a78f85dc4..4e371238de 100755 --- a/module/design/control.php +++ b/module/design/control.php @@ -115,6 +115,9 @@ class design extends control $pager = pager::init(0, $recPerPage, $pageID); $designs = $this->design->getList($projectID, $productID, $type, $queryID, $orderBy, $pager); + $project = $this->loadModel('project')->getByID($projectID); + $this->view->hiddenProduct = $project->hasProduct ? false : true; + $this->view->title = $this->lang->design->common . $this->lang->colon . $this->lang->design->browse; $this->view->position[] = $this->lang->design->browse; diff --git a/module/design/view/browse.html.php b/module/design/view/browse.html.php index 495122acb6..ec4b2db71a 100644 --- a/module/design/view/browse.html.php +++ b/module/design/view/browse.html.php @@ -32,9 +32,9 @@ recTotal}&recPerPage={$pager->recPerPage}";?> - - - + + + @@ -47,7 +47,7 @@ - + From 6c0a92fa653a22879ff0a9ca6c1d982aa8c3f7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Thu, 17 Nov 2022 09:40:51 +0800 Subject: [PATCH 030/129] * adjust for sync build to release. --- module/bug/model.php | 73 +++++++++++++++++++++++++++------------- module/release/model.php | 9 ++++- 2 files changed, 57 insertions(+), 25 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 657b2ae145..a4f3f48f17 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1959,21 +1959,17 @@ class bugModel extends model /** * Get product left bugs. * - * @param int $build - * @param int $productID - * @param int $branch - * @param string $linkedBugs - * @param object $pager + * @param int|string $buildIdList + * @param int $productID + * @param int $branch + * @param string $linkedBugs + * @param object $pager * @access public * @return array */ - public function getProductLeftBugs($build, $productID, $branch = '', $linkedBugs = '', $pager = null) + public function getProductLeftBugs($buildIdList, $productID, $branch = '', $linkedBugs = '', $pager = null) { - $builds = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->in($build)->fetchAll('id'); - - $executionIdList = array(); - foreach($builds as $build) $executionIdList[] = empty($build->execution) ? $build->project : $build->execution; - $executionIdList = array_unique($executionIdList); + $executionIdList = $this->getLinkedExecutionByIdList($buildIdList); if(empty($executionIdList)) return array(); $executions = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->in($executionIdList)->fetchAll(); @@ -2072,29 +2068,26 @@ class bugModel extends model /** * Get bugs according to buildID and productID. * - * @param int $buildID - * @param int $productID - * @param string $branch - * @param string $linkedBugs - * @param object $pager + * @param int|string $buildIdList + * @param int $productID + * @param string $branch + * @param string $linkedBugs + * @param object $pager * @access public * @return array */ - public function getReleaseBugs($buildID, $productID, $branch = 0, $linkedBugs = '', $pager = null) + public function getReleaseBugs($buildIdList, $productID, $branch = 0, $linkedBugs = '', $pager = null) { - $builds = $this->dao->select('id,project,execution')->from(TABLE_BUILD)->where('id')->in($buildID)->fetchAll('id'); - $executionIdList = array(); - foreach($builds as $build) $executionIdList[] = empty($build->execution) ? $build->project : $build->execution; - $executionIdList = array_unique($executionIdList); + $executionIdList = $this->getLinkedExecutionByIdList($buildIdList); if(empty($executionIdList)) return array(); - $executions = $this->dao->select('id,begin')->from(TABLE_EXECUTION)->where('id')->in($executionIdList)->fetchAll('id'); + $executions = $this->dao->select('id,type,begin')->from(TABLE_EXECUTION)->where('id')->in($executionIdList)->fetchAll('id'); $condition = 'execution NOT ' . helper::dbIN($executionIdList); $minBegin = ''; foreach($executions as $execution) { if(empty($minBegin) or $minBegin > $execution->begin) $minBegin = $execution->begin; - $condition .= " OR (execution = '{$execution->id}' AND openedDate < '{$execution->begin}')"; + $condition .= " OR (`execution` = '{$execution->id}' AND openedDate < '{$execution->begin}')"; } $bugs = $this->dao->select('*')->from(TABLE_BUG) @@ -2107,10 +2100,42 @@ class bugModel extends model ->andWhere('deleted')->eq(0) ->orderBy('openedDate ASC') ->page($pager) - ->fetchAll(); + ->fetchAll('id'); return $bugs; } + /** + * Get linked execution by build id list. + * + * @param string $buildIdList + * @access public + * @return array + */ + public function getLinkedExecutionByIdList($buildIdList) + { + $builds = $this->dao->select('id,execution')->from(TABLE_BUILD)->where('id')->in($buildIdList)->fetchAll('id'); + + $executionIdList = array(); + $linkedBuildIdList = array(); + foreach($builds as $build) + { + if($build->builds) $linkedBuildIdList = array_merge($linkedBuildIdList, explode(',', $build->builds)); + + if(empty($build->execution)) continue; + $executionIdList[$build->execution] = $build->execution; + } + if($linkedBuildIdList) + { + $linkedBuilds = $this->dao->select('*')->from(TABLE_BUILD)->where('id')->in(array_unique($linkedBuildIdList))->fetchAll('id'); + foreach($linkedBuilds as $build) + { + if(empty($build->execution)) continue; + $executionIdList[$build->execution] = $build->execution; + } + } + return $executionIdList; + } + /** * Get bugs of a story. * diff --git a/module/release/model.php b/module/release/model.php index 92d8aaa8d4..387c6eb131 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -168,6 +168,8 @@ class releaseModel extends model $release = fixer::input('post') ->add('product', (int)$productID) ->add('branch', (int)$branch) + ->add('stories', '') + ->add('bugs', '') ->setIF($projectID, 'project', $projectID) ->setIF($this->post->build == false, 'build', 0) ->setDefault('stories', '') @@ -224,7 +226,7 @@ class releaseModel extends model if($release->build) { - $builds = $this->dao->select('project, branch, stories, bugs')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + $builds = $this->dao->select('id,project,branch,stories,bugs')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll('id'); foreach($builds as $build) { $branches[$build->branch] = $build->branch; @@ -238,6 +240,11 @@ class releaseModel extends model if($build->bugs) $release->bugs .= ',' . $build->bugs; } } + if($this->post->sync == 'true' and $release->bugs) + { + $releaseBugs = $this->loadModel('bug')->getReleaseBugs(array_keys($builds), $release->product, $release->branch); + $release->bugs = join(',', array_intersect(explode(',', $release->bugs), array_keys($releaseBugs))); + } $release->build = ',' . trim($release->build, ',') . ','; $release->branch = ',' . trim(implode(',', $branches), ',') . ','; From 5de7f127294794a5b87b6d1e77db592f09c0628f Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 17 Nov 2022 09:57:15 +0800 Subject: [PATCH 031/129] * Fix bug #29817. --- module/project/view/ajaxgetdropmenu.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/view/ajaxgetdropmenu.html.php b/module/project/view/ajaxgetdropmenu.html.php index 6400849538..155449efde 100644 --- a/module/project/view/ajaxgetdropmenu.html.php +++ b/module/project/view/ajaxgetdropmenu.html.php @@ -24,7 +24,7 @@ #swapper li {padding-top: 0; padding-bottom: 0;} #swapper .tree li>.list-toggle {top: -1px;} -#closed {width: 90px; height: 25px; line-height: 25px; background-color: #ddd; color: #3c495c; text-align: center; margin-left: 15px; border-radius: 2px;} +div#closed {width: 90px; height: 25px; line-height: 25px; background-color: #ddd; color: #3c495c; text-align: center; margin-left: 15px; border-radius: 2px;} #gray-line {width:230px; height: 1px; margin-left: 10px; margin-bottom:2px; background-color: #ddd;} Date: Thu, 17 Nov 2022 10:01:34 +0800 Subject: [PATCH 032/129] * Remove story stage for edit. --- module/story/view/edit.html.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/module/story/view/edit.html.php b/module/story/view/edit.html.php index 0db4bb5372..96697c0fab 100644 --- a/module/story/view/edit.html.php +++ b/module/story/view/edit.html.php @@ -204,26 +204,6 @@ status);?> - status) !== false and $story->type == 'story'):?> - - - - - From d032dccb9d877d4679cf075fa9a15450d5375b7f Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 17 Nov 2022 02:02:07 +0000 Subject: [PATCH 033/129] * Fix bug #29658. --- .../lite/product/ext/view/browse.html.php | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/extension/lite/product/ext/view/browse.html.php b/extension/lite/product/ext/view/browse.html.php index 524ca6c491..898cc404f8 100644 --- a/extension/lite/product/ext/view/browse.html.php +++ b/extension/lite/product/ext/view/browse.html.php @@ -20,22 +20,25 @@ body {margin-bottom: 25px;} .assignedTo{border-radius: 4px !important;} #productStoryForm table tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #F4F5F7; margin: 0 4px 0 0;} - - - - -app->rawModule);?> -app->tab == 'product' ? $product->type : '');?> product->browse->unfoldStories) ? json_decode($config->product->browse->unfoldStories, true) : array(); -$unfoldStories = zget($unfoldStories, $productID, array()); +$lang->story->createCommon = $storyType == 'story' ? $lang->story->createStory : $lang->story->createRequirement; +$unfoldStories = isset($config->product->browse->unfoldStories) ? json_decode($config->product->browse->unfoldStories, true) : array(); +$unfoldStories = zget($unfoldStories, $productID, array()); +$isProjectStory = $this->app->rawModule == 'projectstory'; +$projectHasProduct = $isProjectStory && !empty($project->hasProduct); +$projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; js::set('unfoldStories', $unfoldStories); js::set('unfoldAll', $lang->execution->treeLevel['all']); js::set('foldAll', $lang->execution->treeLevel['root']); js::set('storyType', $storyType); -$lang->story->createCommon = $storyType == 'story' ? $lang->story->createStory : $lang->story->createRequirement; -$isProjectStory = $this->app->rawModule == 'projectstory'; -$projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; +js::set('browseType', $browseType); +js::set('productID', $productID); +js::set('projectID', $projectID); +js::set('branch', $branch); +js::set('rawModule', $this->app->rawModule); +js::set('productType', $this->app->tab == 'product' ? $product->type : ''); +js::set('projectHasProduct', $projectHasProduct); +js::set('URAndSR', $this->config->URAndSR); ?> loadModel('project')->setMenu($this->session->project); $this->app->rawModule = 'qa'; - $this->lang->project->menu->qa['subMenu']->testcase['subModule'] = 'story'; $products = $this->product->getProducts($this->session->project, 'all', '', false); $productID = $this->product->saveState($productID, $products); $this->lang->modulePageNav = $this->product->select($products, $productID, 'testcase', 'zeroCase', "projectID=$projectID", $branchID); From 4328c922aa34926161c9ca42d0e6134156a695fd Mon Sep 17 00:00:00 2001 From: Lufei Date: Thu, 17 Nov 2022 14:01:25 +0800 Subject: [PATCH 045/129] * Fix year in copyright. --- module/misc/lang/de.php | 2 +- module/misc/lang/en.php | 2 +- module/misc/lang/fr.php | 2 +- module/misc/lang/vi.php | 2 +- module/misc/lang/zh-cn.php | 2 +- module/misc/lang/zh-tw.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/misc/lang/de.php b/module/misc/lang/de.php index becf60a744..620c0d9f9d 100644 --- a/module/misc/lang/de.php +++ b/module/misc/lang/de.php @@ -59,7 +59,7 @@ $lang->misc->zentao->others['meshiot' ] = "Nature Easy Soft Network Technology Co,LTD Email Max@easysoft.ltd"; +$lang->misc->copyright = "© 2009 - " . date('Y') . " Nature Easy Soft Network Technology Co,LTD Email Max@easysoft.ltd"; $lang->misc->checkTable = "Prüfe Datentabellen"; $lang->misc->needRepair = "Repariere Datentabellen"; $lang->misc->repairTable = "Datenbank íst beschädigt. Bitte brüfen und reparieren!"; diff --git a/module/misc/lang/en.php b/module/misc/lang/en.php index 419a88168d..98b516bad7 100644 --- a/module/misc/lang/en.php +++ b/module/misc/lang/en.php @@ -59,7 +59,7 @@ $lang->misc->zentao->others['meshiot' ] = "EasyCorp Email Renee@easycorp.ltd"; +$lang->misc->copyright = "© 2009 - " . date('Y') . " EasyCorp Email Renee@easycorp.ltd"; $lang->misc->checkTable = "Check Data Table"; $lang->misc->needRepair = "Repair Table"; $lang->misc->repairTable = "Database table might be damaged due to power outage. Please check and repair!"; diff --git a/module/misc/lang/fr.php b/module/misc/lang/fr.php index cdf35826b2..6ad3cd0fa1 100644 --- a/module/misc/lang/fr.php +++ b/module/misc/lang/fr.php @@ -59,7 +59,7 @@ $lang->misc->zentao->others['meshiot' ] = "Nature Easy Soft Email Renee@easysoft.ltd"; +$lang->misc->copyright = "© 2009 - " . date('Y') . " Nature Easy Soft Email Renee@easysoft.ltd"; $lang->misc->checkTable = "Vérifiez les Données de la Table"; $lang->misc->needRepair = "Réparer la Table"; $lang->misc->repairTable = "La Base de Données est peut-être endommagée. Elle a besoin d'être vérifiée et éventuellement réparée !"; diff --git a/module/misc/lang/vi.php b/module/misc/lang/vi.php index e0410ae5b5..a374fd8464 100644 --- a/module/misc/lang/vi.php +++ b/module/misc/lang/vi.php @@ -59,7 +59,7 @@ $lang->misc->zentao->others['meshiot' ] = "Nature Easy Soft Email Renee@easysoft.ltd"; +$lang->misc->copyright = "© 2009 - " . date('Y') . " Nature Easy Soft Email Renee@easysoft.ltd"; $lang->misc->checkTable = "Check Data Table"; $lang->misc->needRepair = "Repair Table"; $lang->misc->repairTable = "Database table might be damaged due to power outage. Vui lòng check and repair!"; diff --git a/module/misc/lang/zh-cn.php b/module/misc/lang/zh-cn.php index 1488df05d3..5e03904eb2 100644 --- a/module/misc/lang/zh-cn.php +++ b/module/misc/lang/zh-cn.php @@ -59,7 +59,7 @@ $lang->misc->zentao->others['meshiot' ] = "青岛易软天创网络科技有限公司 电话:4006-8899-23 Email:co@zentao.net QQ:1492153927"; +$lang->misc->copyright = "© 2009 - " . date('Y') . " 青岛易软天创网络科技有限公司 电话:4006-8899-23 Email:co@zentao.net QQ:1492153927"; $lang->misc->checkTable = "检查修复数据表"; $lang->misc->needRepair = "修复表"; $lang->misc->repairTable = "数据库表可能因为断电原因损坏,需要检查修复!!"; diff --git a/module/misc/lang/zh-tw.php b/module/misc/lang/zh-tw.php index 5f3caf9615..3daf3d5f61 100644 --- a/module/misc/lang/zh-tw.php +++ b/module/misc/lang/zh-tw.php @@ -59,7 +59,7 @@ $lang->misc->zentao->others['meshiot' ] = "青島易軟天創網絡科技有限公司 電話:4006-8899-23 Email:co@zentao.net QQ:1492153927"; +$lang->misc->copyright = "© 2009 - " . date('Y') . " 青島易軟天創網絡科技有限公司 電話:4006-8899-23 Email:co@zentao.net QQ:1492153927"; $lang->misc->checkTable = "檢查修復數據表"; $lang->misc->needRepair = "修復表"; $lang->misc->repairTable = "資料庫表可能因為斷電原因損壞,需要檢查修復!!"; From 93a772e01e911def0d74e7735606e6022a47cef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Thu, 17 Nov 2022 14:01:09 +0800 Subject: [PATCH 046/129] * fix bug #29834. --- module/project/model.php | 16 ++++++++++++++++ module/release/model.php | 2 +- module/release/view/browse.html.php | 12 +++++++++++- module/release/view/view.html.php | 7 ++++++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/module/project/model.php b/module/project/model.php index b5d90b1f05..27fd8ce7cd 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1,6 +1,22 @@ app->user->admin) return true; + return (strpos(",{$this->app->user->view->projects},", ",{$projectID},") !== false); + } + /** * Get Multiple linked products for project. * diff --git a/module/release/model.php b/module/release/model.php index 2f08f19efc..90f4b12acc 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -66,7 +66,7 @@ class releaseModel extends model ->page($pager) ->fetchAll(); - $builds = $this->dao->select("t1.id, t1.name, t1.execution, IF(t2.name IS NOT NULL, t2.name, '') AS projectName, IF(t3.name IS NOT NULL, t3.name, '{$this->lang->trunk}') AS branchName") + $builds = $this->dao->select("t1.id, t1.name, t1.project, t1.execution, IF(t2.name IS NOT NULL, t2.name, '') AS projectName, IF(t3.name IS NOT NULL, t3.name, '{$this->lang->trunk}') AS branchName") ->from(TABLE_BUILD)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->leftJoin(TABLE_BRANCH)->alias('t3')->on('t1.branch = t3.id') diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index c6f0049c4e..86a23ef7bd 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -63,6 +63,10 @@ + loadModel('project'); + $this->loadModel('execution'); + ?> builds);?> @@ -82,7 +86,13 @@ type != 'normal'):?> branchName;?> - createLink($build->execution ? 'build' : 'projectbuild', 'view', "buildID=$build->id"), $build->name);?> + execution ? 'build' : 'projectbuild'; + $canClickable = false; + if($moduleName == 'projectbuild' and $this->project->checkPriv($build->project)) $canClickable = true; + if($moduleName == 'build' and $this->execution->checkPriv($build->execution)) $canClickable = true; + echo $canClickable ? html::a($this->createLink($moduleName, 'view', "buildID=$build->id"), $build->name, '', "data-app='project'") : $build->name; + ?> diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index bcf319defc..accbb8d1b7 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -356,7 +356,12 @@ $buildHtml = array(); foreach($release->builds as $build) { - $buildHtml[] = html::a($this->createLink($build->execution ? 'build' : 'projectbuild', 'view', "buildID=$build->id"), $build->name, '', "data-app='project'"); + $moduleName = $build->execution ? 'build' : 'projectbuild'; + $canClickable = false; + if($moduleName == 'projectbuild' and $this->loadModel('project')->checkPriv($build->project)) $canClickable = true; + if($moduleName == 'build' and $this->loadModel('execution')->checkPriv($build->execution)) $canClickable = true; + + $buildHtml[] = $canClickable ? html::a($this->createLink($moduleName, 'view', "buildID=$build->id"), $build->name, '', "data-app='project'") : $build->name; } echo join($lang->comma, $buildHtml); ?> From 49f6118bb2f864c8e99f8b10e9f4e1c6e7297290 Mon Sep 17 00:00:00 2001 From: Lufei Date: Thu, 17 Nov 2022 14:01:46 +0800 Subject: [PATCH 047/129] - Remove useless config items. --- module/admin/config.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/module/admin/config.php b/module/admin/config.php index 197e7da4e2..8fa6c10599 100644 --- a/module/admin/config.php +++ b/module/admin/config.php @@ -1,14 +1,4 @@ url = new stdclass(); -$config->url->community = 'https://www.zentao.net'; -$config->url->ask = 'https://www.zentao.net/ask-browse.html'; -$config->url->document = 'https://www.zentao.net/help-book-zentaopmshelp.html'; -$config->url->feedback = 'https://www.zentao.net/forum-board-1074.html'; -$config->url->faq = 'https://www.zentao.net/ask-faq.html'; -$config->url->extension = 'https://www.zentao.net/extension-browse.html'; -$config->url->donation = 'https://www.zentao.net/help-donation.html'; -$config->url->service = 'https://www.cnezsoft.com/article-browse-1078.html'; - $config->admin->apiRoot = 'https://www.zentao.net'; $config->admin->log = new stdclass(); From 9c2bdb208154e1d233e428a4e015e77723a55e84 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 17 Nov 2022 14:04:37 +0800 Subject: [PATCH 048/129] * Fix task #76407 --- module/common/lang/menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 86fbd5789c..2d117dbc76 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -266,7 +266,7 @@ $lang->waterfall->menu->design = array('link' => "{$lang->design->common}|de $lang->waterfall->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport'); $lang->waterfall->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=project&objectID=%s"); $lang->waterfall->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); -$lang->waterfall->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); +$lang->waterfall->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s", 'subModule' => 'projectbuild'); $lang->waterfall->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease'); $lang->waterfall->menu->dynamic = array('link' => "$lang->dynamic|project|dynamic|project=%s"); From 825a67ca8f68eabc66829bde5933fe9275882063 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 17 Nov 2022 06:06:11 +0000 Subject: [PATCH 049/129] * Adjust xuanxuan commit. --- xuanxuan/XUANVERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xuanxuan/XUANVERSION b/xuanxuan/XUANVERSION index b95ebc1a59..15c65ccf5b 100644 --- a/xuanxuan/XUANVERSION +++ b/xuanxuan/XUANVERSION @@ -1 +1 @@ -v6.6.0 +a975bd7e7e1fd29bc95ee7b9c5bafdc94a4e9eb0 From 3796966b17f787d84e5f4d52cdd9b51071c91b6f Mon Sep 17 00:00:00 2001 From: dingyongliang Date: Thu, 17 Nov 2022 06:10:46 +0000 Subject: [PATCH 050/129] * fix getBoundingClientRect of undefined. --- module/index/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/index/js/index.js b/module/index/js/index.js index d46dab6ee4..aba2977080 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -564,7 +564,7 @@ /* The magic number "111" is the space between dropdown trigger btn and the bottom of screen */ var listStyle = {maxHeight: 'initial', top: moreMenuHeight > 111 ? 111 - moreMenuHeight : ''}; - if($list[0].getBoundingClientRect) + if($list[0] && $list[0].getBoundingClientRect) { var btnBounding = $list.prev('a')[0].getBoundingClientRect(); if(btnBounding.height) @@ -803,7 +803,7 @@ $(function() { var val = $searchQuery.val(); var searchType = changeSearchObject(); - if(val !== null && val !== "") + if(val) { var isQuickGo = !reg.test(val); $dropmenu.toggleClass('show-quick-go', isQuickGo); From a344340f1c1fb0cf788db275f26e89f65e3d9dc6 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 17 Nov 2022 06:11:54 +0000 Subject: [PATCH 051/129] * Remove the unwanted xuan sql. --- db/standard/{zentao18.0.sql => zentao18.0.beta1.sql} | 2 ++ db/zentao.sql | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) rename db/standard/{zentao18.0.sql => zentao18.0.beta1.sql} (99%) diff --git a/db/standard/zentao18.0.sql b/db/standard/zentao18.0.beta1.sql similarity index 99% rename from db/standard/zentao18.0.sql rename to db/standard/zentao18.0.beta1.sql index cae78ceb4e..c9897d527a 100644 --- a/db/standard/zentao18.0.sql +++ b/db/standard/zentao18.0.beta1.sql @@ -1232,6 +1232,8 @@ CREATE TABLE `zt_im_chat` ( `pinnedMessages` text NOT NULL, `mergedChats` text NOT NULL DEFAULT '', `adminInvite` enum('0','1') NOT NULL DEFAULT '0', + `avatar` text NOT NULL DEFAULT '', + `archiveDate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), KEY `gid` (`gid`), KEY `name` (`name`), diff --git a/db/zentao.sql b/db/zentao.sql index 557a6663ad..31412ef369 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -6407,8 +6407,7 @@ CREATE TABLE IF NOT EXISTS `zt_im_message` ( KEY `mgid` (`gid`), KEY `mcgid` (`cgid`), KEY `muser` (`user`), - KEY `mtype` (`type`), - UNIQUE `unique_msg`(`index`, `cgid`) + KEY `mtype` (`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- DROP TABLE IF EXISTS `zt_im_message_backup`; From dc998d0082647ca5548afcecf45fdf99cfe670ea Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 17 Nov 2022 14:40:50 +0800 Subject: [PATCH 052/129] * Fix task #76411 --- module/productplan/view/view.html.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index d8354e7776..4a7c514fda 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -192,7 +192,7 @@ @@ -464,7 +464,7 @@ - + - @@ -44,15 +43,15 @@ +
idAB;?>'>user->company;?> '> user->dept;?> user->account;?> user->realname;?>
+
+ 1 ? 'ditto' : '', "class='form-control chosen'");?> + company->create);?> +
+
' style='overflow:visible'> 1 ? 'ditto' : $deptID, "class='form-control chosen'");?>
story->stage;?> From 0de7525880e07252d42f47e7cf37b551d729c40b Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 17 Nov 2022 09:05:40 +0800 Subject: [PATCH 026/129] * Fix bug#29716. --- module/projectrelease/view/create.html.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module/projectrelease/view/create.html.php b/module/projectrelease/view/create.html.php index a17fe99ce5..d3c905fec9 100644 --- a/module/projectrelease/view/create.html.php +++ b/module/projectrelease/view/create.html.php @@ -26,13 +26,18 @@ release->name;?> + shadow):?>
+ release->last . ': ' . $lastRelease->name . ')';?>
release->product;?> @@ -43,6 +48,7 @@
release->build;?>
idAB);?> design->name);?> design->product);?> idAB);?> design->name);?>design->product);?> design->type);?> design->assignedTo);?> design->createdByAB);?>
id);?> createLink('design', 'view', "id={$design->id}"), $design->name) : $design->name;?> product);?>product);?> design->typeList, $design->type);?> design->printAssignedHtml($design, $users);?> createdBy);?>
story->stage;?> - stages and $branchTagOption) - { - foreach($story->stages as $branch => $stage) - { - if(isset($branchTagOption[$branch])) echo '

' . $branchTagOption[$branch] . html::select("stages[$branch]", $lang->story->stageList, $stage, "class='form-control chosen'") . '

'; - } - } - else - { - echo html::select('stage', $lang->story->stageList, $story->stage, "class='form-control chosen'"); - } - ?> -
story->category;?> story->categoryList, $story->category, "class='form-control chosen'");?>
projectName;?> parent > 0) echo "story->children}>{$lang->story->childrenAB}"; - echo html::a($viewLink , $story->title, '', "style='color: $story->color'"); + echo html::a($viewLink , $story->title, '', "style='color: $story->color' data-app={$this->app->tab}"); ?> openedBy);?> bug->priList, $bug->pri);?>createLink('bug', 'view', "bugID=$bug->id"), $bug->title, '', 'data-app="product"');?>createLink('bug', 'view', "bugID=$bug->id"), $bug->title, '', "data-app={$this->app->tab}");?> openedBy);?> assignedTo);?> From 55947f4fec92d267dd9952171f1dae016f34f773 Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 17 Nov 2022 14:49:32 +0800 Subject: [PATCH 053/129] * Fix bug #29428. --- module/story/control.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index 1f16da235e..a7e5d7de8d 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -2727,10 +2727,11 @@ class story extends control $this->loadModel('execution')->setMenu($projectID); } - if(!$project->hasProduct and !$project->multiple) + if(!$project->hasProduct) { unset($this->lang->story->report->charts['storysPerProduct']); - unset($this->lang->story->report->charts['storysPerPlan']); + + if(!$project->multiple) unset($this->lang->story->report->charts['storysPerPlan']); } } else From d2771d367bb4744d384c4267b061d9434aa70eab Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 17 Nov 2022 15:15:20 +0800 Subject: [PATCH 054/129] * Fix bug#29941. --- module/story/css/batchclose.css | 2 +- module/story/js/batchclose.js | 6 ------ module/story/view/batchclose.html.php | 7 +++---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/module/story/css/batchclose.css b/module/story/css/batchclose.css index 680e3638d9..576dfc65bd 100644 --- a/module/story/css/batchclose.css +++ b/module/story/css/batchclose.css @@ -1,5 +1,5 @@ .c-id {width: 50px;} -.c-reason {width: 150px;} +.c-reason {width: 210px;} td[id^="duplicateStoryBox"].required:after {top: 6px; right: 2px;} td[id^="duplicateStoryBox"] {overflow: visible;} td.reasons-td {overflow: visible;} diff --git a/module/story/js/batchclose.js b/module/story/js/batchclose.js index bd33321844..7c15a5c040 100755 --- a/module/story/js/batchclose.js +++ b/module/story/js/batchclose.js @@ -12,22 +12,16 @@ function setDuplicateAndChild(resolution, storyID) { $('#childStoryBox' + storyID).hide(); $('#duplicateStoryBox' + storyID).show(); - $('#duplicateStoryTitle').show(); - $('.form-actions').attr('colspan', 6); } else if(resolution == 'subdivided') { $('#duplicateStoryBox' + storyID).hide(); $('#childStoryBox' + storyID).show(); - $('#duplicateStoryTitle').hide(); - $('.form-actions').attr('colspan', 5); } else { $('#duplicateStoryBox' + storyID).hide(); $('#childStoryBox' + storyID).hide(); - $('#duplicateStoryTitle').hide(); - $('.form-actions').attr('colspan', 5); } } diff --git a/module/story/view/batchclose.html.php b/module/story/view/batchclose.html.php index be938128d6..21cf183703 100755 --- a/module/story/view/batchclose.html.php +++ b/module/story/view/batchclose.html.php @@ -28,7 +28,6 @@ story->title;?> story->status;?> story->closedReason;?> story->comment;?>
' closedReason != 'duplicate') echo "style='display:none'";?>> + '') + $productStoryList[$story->product][$story->branch], $story->duplicateStory ? $story->duplicateStory : '', "class='form-control' placeholder='{$lang->bug->duplicateTip}'");?> + ' closedReason != 'subdivided') echo "style='display:none'";?>> idAB}'");?>
- ' closedReason != 'duplicate') echo "style='display:none'";?>> - '') + $productStoryList[$story->product][$story->branch], $story->duplicateStory ? $story->duplicateStory : '', "class='form-control' placeholder='{$lang->bug->duplicateTip}'");?> - From 0428c7e97307f48a3dbf39372fcdc4e238c0943f Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Thu, 17 Nov 2022 15:25:52 +0800 Subject: [PATCH 055/129] * Finish ticket #043. --- module/file/view/buildform.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/file/view/buildform.html.php b/module/file/view/buildform.html.php index c6f0b907f6..eb5de22561 100644 --- a/module/file/view/buildform.html.php +++ b/module/file/view/buildform.html.php @@ -3,7 +3,7 @@ $maxUploadSize = strtoupper(ini_get('upload_max_filesize')); js::set('dangerExtensions', ',' . $this->config->file->dangers . ','); js::set('maxUploadSize', $maxUploadSize); ?> -
+
From 67017be8974928e195dcffdfbaf932a1b4bbbe71 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 17 Nov 2022 15:41:39 +0800 Subject: [PATCH 056/129] * Fix bug#29883. --- module/programplan/lang/zh-cn.php | 2 +- module/programplan/lang/zh-tw.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/programplan/lang/zh-cn.php b/module/programplan/lang/zh-cn.php index b264ab5e54..167261e1f1 100644 --- a/module/programplan/lang/zh-cn.php +++ b/module/programplan/lang/zh-cn.php @@ -102,7 +102,7 @@ $lang->programplan->ganttCustom['delay'] = '是否延期'; $lang->programplan->ganttCustom['delayDays'] = '延期天数'; $lang->programplan->error = new stdclass(); -$lang->programplan->error->percentNumber = '"工作量比例"必须为数字'; +$lang->programplan->error->percentNumber = '"工作量占比"必须为数字'; $lang->programplan->error->planFinishSmall = '"计划完成时间"必须大于"计划开始时间"'; $lang->programplan->error->percentOver = '工作量占比累计不应当超过100%'; $lang->programplan->error->createdTask = '已分解任务,不可添加子阶段'; diff --git a/module/programplan/lang/zh-tw.php b/module/programplan/lang/zh-tw.php index c951235dd4..2eec985e1e 100644 --- a/module/programplan/lang/zh-tw.php +++ b/module/programplan/lang/zh-tw.php @@ -72,7 +72,7 @@ $lang->programplan->stageCustom->date = '顯示日期'; $lang->programplan->stageCustom->task = '顯示任務'; $lang->programplan->error = new stdclass(); -$lang->programplan->error->percentNumber = '"工作量比例"必須為數字'; +$lang->programplan->error->percentNumber = '"工作量占比"必須為數字'; $lang->programplan->error->planFinishSmall = '"計劃完成時間"必須大於"計劃開始時間"'; $lang->programplan->error->percentOver = '工作量占比累計不應當超過100%'; $lang->programplan->error->createdTask = '已分解任務,不可添加子階段'; From e31283d2f97a0b801c36283df27627d530637ce6 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 17 Nov 2022 15:47:12 +0800 Subject: [PATCH 057/129] * Modified Obtain the configuration information about the workweek. --- module/holiday/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/holiday/model.php b/module/holiday/model.php index e43442f049..cfffe7ff23 100644 --- a/module/holiday/model.php +++ b/module/holiday/model.php @@ -198,12 +198,13 @@ class holidayModel extends model { if(empty($begin) or empty($end) or $begin == '0000-00-00' or $end == '0000-00-00') return array(); + $this->app->loadConfig('execution'); $actualDays = array(); $currentDay = $begin; $holidays = $this->getHolidays($begin, $end); $workingDays = $this->getWorkingDays($begin, $end); - $weekend = isset($this->config->project->weekend) ? $this->config->project->weekend : 2; + $weekend = isset($this->config->execution->weekend) ? $this->config->execution->weekend : 2; $holidaysFlip = array_flip($holidays); $workingDaysFlip = array_flip($workingDays); From 5233ebd8138755647991457d957834d1948c7099 Mon Sep 17 00:00:00 2001 From: Lufei Date: Thu, 17 Nov 2022 15:50:55 +0800 Subject: [PATCH 058/129] * Optimize checkSafeFile tips for backup. --- module/backup/control.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/module/backup/control.php b/module/backup/control.php index e7ab01797e..26713a2d5e 100644 --- a/module/backup/control.php +++ b/module/backup/control.php @@ -337,11 +337,12 @@ class backup extends control { $this->app->loadLang('extension'); - $search = dirname($this->app->getBasePath()) . DS; + $search = $this->app->getBasePath(); $pos = strpos($statusFile, $search); - if($pos !== false) $statusFile = substr_replace($statusFile, '', $pos, strlen($search)); + $okFile = $statusFile; + if($pos !== false) $okFile = substr_replace($statusFile, '', $pos, strlen($search)); - $this->view->error = sprintf($this->lang->extension->noticeOkFile, $statusFile, $statusFile); + $this->view->error = sprintf($this->lang->extension->noticeOkFile, $okFile, $statusFile); return print($this->display()); } From 7d80105cff1a5f170186fb36032363a466e34572 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 17 Nov 2022 16:00:46 +0800 Subject: [PATCH 059/129] * Code for bug #29355. --- db/standard/zentao17.7.sql | 4 ++-- db/standard/zentao17.8.sql | 4 ++-- db/standard/zentao18.0.sql | 4 ++-- db/update17.6.2.sql | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/db/standard/zentao17.7.sql b/db/standard/zentao17.7.sql index 32e0edfa70..68e0850ff9 100644 --- a/db/standard/zentao17.7.sql +++ b/db/standard/zentao17.7.sql @@ -1489,7 +1489,7 @@ CREATE TABLE `zt_kanban` ( `showWIP` enum('0','1') NOT NULL DEFAULT '1', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `object` varchar(255) NOT NULL, `alignment` varchar(10) NOT NULL DEFAULT 'center', @@ -2187,7 +2187,7 @@ CREATE TABLE `zt_project` ( `displayCards` smallint(6) NOT NULL DEFAULT '0', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), diff --git a/db/standard/zentao17.8.sql b/db/standard/zentao17.8.sql index 32e0edfa70..68e0850ff9 100644 --- a/db/standard/zentao17.8.sql +++ b/db/standard/zentao17.8.sql @@ -1489,7 +1489,7 @@ CREATE TABLE `zt_kanban` ( `showWIP` enum('0','1') NOT NULL DEFAULT '1', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `object` varchar(255) NOT NULL, `alignment` varchar(10) NOT NULL DEFAULT 'center', @@ -2187,7 +2187,7 @@ CREATE TABLE `zt_project` ( `displayCards` smallint(6) NOT NULL DEFAULT '0', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), diff --git a/db/standard/zentao18.0.sql b/db/standard/zentao18.0.sql index cae78ceb4e..cc7f44fe8d 100644 --- a/db/standard/zentao18.0.sql +++ b/db/standard/zentao18.0.sql @@ -1490,7 +1490,7 @@ CREATE TABLE `zt_kanban` ( `showWIP` enum('0','1') NOT NULL DEFAULT '1', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `object` varchar(255) NOT NULL, `alignment` varchar(10) NOT NULL DEFAULT 'center', @@ -2192,7 +2192,7 @@ CREATE TABLE `zt_project` ( `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `multiple` enum('0', '1') NOT NULL DEFAULT '1', `colWidth` smallint(4) NOT NULL DEFAULT '264', - `minColWidth` smallint(4) NOT NULL DEFAULT '180', + `minColWidth` smallint(4) NOT NULL DEFAULT '200', `maxColWidth` smallint(4) NOT NULL DEFAULT '384', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), diff --git a/db/update17.6.2.sql b/db/update17.6.2.sql index 3217d8b7db..7807d1bbcd 100644 --- a/db/update17.6.2.sql +++ b/db/update17.6.2.sql @@ -62,10 +62,10 @@ CREATE TABLE `zt_ticketrelation` ( ALTER TABLE `zt_product` ADD `ticket` varchar(30) NOT NULL AFTER `feedback`; ALTER TABLE `zt_kanban` ADD `colWidth` smallint(4) NOT NULL DEFAULT '264' AFTER `fluidBoard`; -ALTER TABLE `zt_kanban` ADD `minColWidth` smallint(4) NOT NULL DEFAULT '180' AFTER `colWidth`; +ALTER TABLE `zt_kanban` ADD `minColWidth` smallint(4) NOT NULL DEFAULT '200' AFTER `colWidth`; ALTER TABLE `zt_kanban` ADD `maxColWidth` smallint(4) NOT NULL DEFAULT '384' AFTER `minColWidth`; ALTER TABLE `zt_project` ADD `colWidth` smallint(4) NOT NULL DEFAULT '264' AFTER `fluidBoard`; -ALTER TABLE `zt_project` ADD `minColWidth` smallint(4) NOT NULL DEFAULT '180' AFTER `colWidth`; +ALTER TABLE `zt_project` ADD `minColWidth` smallint(4) NOT NULL DEFAULT '200' AFTER `colWidth`; ALTER TABLE `zt_project` ADD `maxColWidth` smallint(4) NOT NULL DEFAULT '384' AFTER `minColWidth`; REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', 'global', 'syncProduct', '{"feedback":{},"ticket":{}}'); From 532bef39f38e04fcc22aabcbe6fa6c46604d766a Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Thu, 17 Nov 2022 08:03:03 +0000 Subject: [PATCH 060/129] * Finish task #76434. --- module/build/control.php | 7 ++++- module/build/js/create.js | 50 ++++++++++++++++++++++++++++++ module/build/lang/de.php | 5 +++ module/build/lang/en.php | 5 +++ module/build/lang/fr.php | 5 +++ module/build/lang/zh-cn.php | 5 +++ module/build/model.php | 23 ++++---------- module/build/view/create.html.php | 13 ++++++-- module/common/lang/menu.php | 2 +- module/group/lang/resource.php | 2 -- module/product/control.php | 21 +++++++++++++ module/project/view/build.html.php | 2 +- 12 files changed, 115 insertions(+), 25 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 0abe7eb54e..14d1f9d9f7 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -54,7 +54,7 @@ class build extends control if(defined('TUTORIAL')) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true)); // Fix bug #21095. - $buildID = $this->build->create($executionID, $projectID); + $buildID = $this->build->create(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $this->loadModel('action')->create('build', $buildID, 'opened'); @@ -72,6 +72,8 @@ class build extends control if($this->app->tab == 'project') { $this->project->setMenu($projectID); + $executions = $this->execution->getPairs($projectID, 'all', 'stagefilter'); + $executionID = empty($executionID) ? key($executions) : $executionID; $productGroups = $this->product->getProducts($projectID); $branchGroups = $this->project->getBranchesByProject($projectID); $this->session->set('project', $projectID); @@ -79,6 +81,7 @@ class build extends control elseif($this->app->tab == 'execution') { $execution = $this->execution->getByID($executionID); + $executions = $this->execution->getPairs($execution->project); $projectID = $execution->project; $productGroups = $this->product->getProducts($executionID); $branchGroups = $this->project->getBranchesByProject($executionID); @@ -89,6 +92,7 @@ class build extends control { $execution = $this->execution->getByID($executionID); $projectID = $execution ? $execution->project : 0; + $executions = $this->execution->getPairs($projectID); $productGroups = $this->product->getProducts($executionID); $branchGroups = $this->project->getBranchesByProject($executionID); } @@ -119,6 +123,7 @@ class build extends control $this->view->executionID = $executionID; $this->view->products = $products; $this->view->projectID = $projectID; + $this->view->executions = $executions; $this->view->lastBuild = $this->build->getLast($executionID, $projectID); $this->view->productGroups = $productGroups; $this->view->users = $this->user->getPairs('nodeleted|noclosed'); diff --git a/module/build/js/create.js b/module/build/js/create.js index 24e9448c82..c70dafe3f1 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -15,5 +15,55 @@ $().ready(function() $('#builds').chosen(); }); }); + + $('input[name=type]').change(function() + { + if($(this).val() == 'execution') + { + $('#execution').closest('tr').show(); + $('#buildBox').closest('tr').hide(); + loadProducts($('#execution').val()); + } + else + { + $('#execution').closest('tr').hide(); + $('#buildBox').closest('tr').show(); + loadProducts($('#project').val()); + } + }); $('#product').change(); }); + +/** + * Load products. + * + * @param int $executionID + * @access public + * @return void + */ +function loadProducts(executionID) +{ + $('#product').remove(); + $('#product_chosen').remove(); + $('#branch').remove(); + $('#branch_chosen').remove(); + $('#noProduct').remove(); + $.get(createLink('product', 'ajaxGetProducts', 'executionID=' + executionID), function(data) + { + if(data) + { + if(data.indexOf("required") != -1) + { + $('#productBox').addClass('required'); + } + else + { + $('#productBox').removeClass('required'); + } + + $('#productBox').append(data); + $('#product').chosen(); + loadBranches($("#product").val()); + } + }); +} diff --git a/module/build/lang/de.php b/module/build/lang/de.php index 39f5f213c7..b6987753bd 100644 --- a/module/build/lang/de.php +++ b/module/build/lang/de.php @@ -33,6 +33,7 @@ $lang->build->project = 'Project'; $lang->build->branch = 'Platform/Branch'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; +$lang->build->type = 'Type'; $lang->build->builds = 'Linked Builds'; $lang->build->name = 'Name'; $lang->build->date = 'Datum'; @@ -73,3 +74,7 @@ $lang->build->action->buildopened = '$date, erstellt von $actor $lang->backhome = 'zurück'; $lang->build->featureBar['browse']['all'] = 'Build List'; + +$lang->build->typeList = array(); +$lang->build->typeList['execution'] = "{$lang->executionCommon}版本"; +$lang->build->typeList['project'] = '项目版本'; diff --git a/module/build/lang/en.php b/module/build/lang/en.php index df6d81e8d1..9a1e7727cc 100644 --- a/module/build/lang/en.php +++ b/module/build/lang/en.php @@ -34,6 +34,7 @@ $lang->build->branch = 'Platform/Branch'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; $lang->build->builds = 'Linked Builds'; +$lang->build->type = 'Type'; $lang->build->name = 'Name'; $lang->build->date = 'Date'; $lang->build->builder = 'Builder'; @@ -73,3 +74,7 @@ $lang->build->action->buildopened = '$date, created by $actor, $lang->backhome = 'back'; $lang->build->featureBar['browse']['all'] = 'Build List'; + +$lang->build->typeList = array(); +$lang->build->typeList['execution'] = "{$lang->executionCommon}版本"; +$lang->build->typeList['project'] = '项目版本'; diff --git a/module/build/lang/fr.php b/module/build/lang/fr.php index 30ed628f70..e5e151b4e4 100644 --- a/module/build/lang/fr.php +++ b/module/build/lang/fr.php @@ -33,6 +33,7 @@ $lang->build->project = 'Project'; $lang->build->branch = 'Plateforme/Branche'; $lang->build->branchName = '%s'; $lang->build->execution = $lang->executionCommon; +$lang->build->type = 'Type'; $lang->build->builds = 'Linked Builds'; $lang->build->name = 'Nom'; $lang->build->date = 'Date'; @@ -73,3 +74,7 @@ $lang->build->action->buildopened = '$date, Build $extra créé $lang->backhome = 'Retour'; $lang->build->featureBar['browse']['all'] = 'Build List'; + +$lang->build->typeList = array(); +$lang->build->typeList['execution'] = "{$lang->executionCommon}版本"; +$lang->build->typeList['project'] = '项目版本'; diff --git a/module/build/lang/zh-cn.php b/module/build/lang/zh-cn.php index 0be8d8c8b5..13da7f11b3 100644 --- a/module/build/lang/zh-cn.php +++ b/module/build/lang/zh-cn.php @@ -33,6 +33,7 @@ $lang->build->project = '所属项目'; $lang->build->branch = '平台/分支'; $lang->build->branchName = '所属%s'; $lang->build->execution = '所属' . $lang->executionCommon; +$lang->build->type = '版本类型'; $lang->build->builds = '关联版本'; $lang->build->name = '名称编号'; $lang->build->date = '打包日期'; @@ -71,3 +72,7 @@ $lang->build->action = new stdclass(); $lang->build->action->buildopened = '$date, 由 $actor 创建版本 $extra。' . "\n"; $lang->backhome = '返回'; + +$lang->build->typeList = array(); +$lang->build->typeList['execution'] = "{$lang->executionCommon}版本"; +$lang->build->typeList['project'] = '项目版本'; diff --git a/module/build/model.php b/module/build/model.php index 695656a2f1..44791f4da6 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -302,42 +302,31 @@ class buildModel extends model /** * Create a build * - * @param int $executionID - * @param int $projectID * @access public * @return void */ - public function create($executionID = 0, $projectID = 0) + public function create() { $build = new stdclass(); $build->stories = ''; $build->bugs = ''; - if($projectID && !$executionID) - { - $project = $this->loadModel('project')->getByID($projectID); - if(!$project->multiple) $executionID = $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq($projectID)->fetch('id'); - } - else if($executionID && !$projectID) - { - $execution = $this->loadModel('execution')->getByID($executionID); - $projectID = $execution->project; - } - $build = fixer::input('post') - ->setDefault('project', $projectID) + ->setDefault('project', 0) + ->setDefault('execution', 0) ->setDefault('product', 0) ->setDefault('branch', 0) ->setDefault('builds', '') ->cleanInt('product,branch') - ->add('execution', $executionID) ->add('createdBy', $this->app->user->account) ->add('createdDate', helper::now()) ->stripTags($this->config->build->editor->create['id'], $this->config->allowedTags) ->join('builds', ',') - ->remove('resolvedBy,allchecker,files,labels,uid') + ->remove('resolvedBy,allchecker,files,labels,type,uid') ->get(); + if($this->post->type == 'project') $build->execution = 0; + $build = $this->loadModel('file')->processImgURL($build, $this->config->build->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_BUILD)->data($build) ->autoCheck() diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 6a26488df3..e7b45afe8f 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -19,6 +19,14 @@
+ + + + + + + + @@ -42,13 +50,11 @@ - tab == 'project' && !empty($multipleProject)):?> - + - @@ -86,6 +92,7 @@ diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 86fbd5789c..2d117dbc76 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -266,7 +266,7 @@ $lang->waterfall->menu->design = array('link' => "{$lang->design->common}|de $lang->waterfall->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport'); $lang->waterfall->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=project&objectID=%s"); $lang->waterfall->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); -$lang->waterfall->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s"); +$lang->waterfall->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s", 'subModule' => 'projectbuild'); $lang->waterfall->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease'); $lang->waterfall->menu->dynamic = array('link' => "$lang->dynamic|project|dynamic|project=%s"); diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index f06717998d..f2d23d70cb 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -237,7 +237,6 @@ $lang->project->methodOrder[190] = 'manageRepo'; $lang->resource->projectbuild = new stdclass(); $lang->resource->projectbuild->browse = 'browse'; -$lang->resource->projectbuild->create = 'create'; $lang->resource->projectbuild->edit = 'edit'; $lang->resource->projectbuild->view = 'view'; $lang->resource->projectbuild->delete = 'delete'; @@ -249,7 +248,6 @@ $lang->resource->projectbuild->unlinkBug = 'unlinkBug'; $lang->resource->projectbuild->batchUnlinkBug = 'batchUnlinkBug'; $lang->projectbuild->methodOrder[5] = 'browse'; -$lang->projectbuild->methodOrder[10] = 'create'; $lang->projectbuild->methodOrder[15] = 'edit'; $lang->projectbuild->methodOrder[20] = 'view'; $lang->projectbuild->methodOrder[25] = 'delete'; diff --git a/module/product/control.php b/module/product/control.php index 8f701aee51..0a93b24502 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -880,6 +880,27 @@ class product extends control $this->display(); } + /** + * Ajax get products. + * + * @param int $executionID + * @access public + * @return void + */ + public function ajaxGetProducts($executionID) + { + $this->loadModel('build'); + $products = $this->product->getProductPairsByProject($executionID); + if(empty($products)) + { + return printf($this->lang->build->noProduct, $this->createLink('execution', 'manageproducts', "executionID=$executionID&from=buildCreate", '', 'true'), 'project'); + } + else + { + return print(html::select('product', $products, empty($product) ? '' : $product->id, "onchange='loadBranches(this.value);' class='form-control chosen' required data-toggle='modal' data-type='iframe'")); + } + } + /** * AJAX: get projects of a product in html select. * diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 82c19cbc1f..817fbd1a37 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -35,7 +35,7 @@ execution->byQuery;?>
- " . $lang->build->create, '', "class='btn btn-primary' id='createBuild'");?> + " . $lang->build->create, '', "class='btn btn-primary' id='createBuild'");?>
From 85a5d00a53cd42b38eb7d6d875aa0f62dedd4440 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 17 Nov 2022 16:03:27 +0800 Subject: [PATCH 061/129] * Fix bug #29947 --- module/execution/view/create.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index 5885a10933..eea845b2be 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -150,7 +150,7 @@ - + model == 'scrum' or empty($products)):?>
From 3ef1c553c4b8dc240efe70a18bee546d2b8e3f1a Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 17 Nov 2022 16:04:56 +0800 Subject: [PATCH 062/129] * Fix bug #29755. --- module/productplan/model.php | 15 +++++++-------- module/productplan/view/edit.html.php | 6 +++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index 2a73256dac..1f05807b2d 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -531,22 +531,21 @@ class productplanModel extends model ->get(); $parentPlan = $this->getByID($plan->parent); - + $futureTime = $this->config->productplan->future; if($plan->parent > 0) { - if($parentPlan->begin !== $this->config->productplan->future) + if($parentPlan->begin !== $futureTime) { if($plan->begin < $parentPlan->begin) dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $parentPlan->begin); } - if($parentPlan->end !== $this->config->productplan->future) + if($parentPlan->end !== $futureTime) { - if($plan->end !== $this->config->productplan->future and $plan->end > $parentPlan->end) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end); + if($plan->end !== $futureTime and $plan->end > $parentPlan->end) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end); } } - elseif($oldPlan->parent == -1 and $plan->begin != $this->config->productplan->future) + elseif($oldPlan->parent == -1 and ($plan->begin != $futureTime or $plan->end != $futureTime)) { - $plan->parent = -1; $childPlans = $this->getChildren($planID); $minBegin = $plan->begin; $maxEnd = $plan->end; @@ -556,8 +555,8 @@ class productplanModel extends model if($childPlan->begin < $minBegin) $minBegin = $childPlan->begin; if($childPlan->end > $maxEnd) $maxEnd = $childPlan->end; } - if($minBegin < $plan->begin and $minBegin != $this->config->productplan->future) dao::$errors['begin'] = sprintf($this->lang->productplan->beginGreaterChildTip, $oldPlan->title, $plan->begin, $minBegin); - if($maxEnd > $plan->end and $maxEnd != $this->config->productplan->future) dao::$errors['end'] = sprintf($this->lang->productplan->endLetterChildTip, $oldPlan->title, $plan->end, $maxEnd); + if($minBegin < $plan->begin and $minBegin != $futureTime) dao::$errors['begin'] = sprintf($this->lang->productplan->beginGreaterChildTip, $oldPlan->title, $plan->begin, $minBegin); + if($maxEnd > $plan->end and $maxEnd != $futureTime) dao::$errors['end'] = sprintf($this->lang->productplan->endLetterChildTip, $oldPlan->title, $plan->end, $maxEnd); } if(dao::isError()) return false; diff --git a/module/productplan/view/edit.html.php b/module/productplan/view/edit.html.php index 1e045bdebd..2deed208bc 100644 --- a/module/productplan/view/edit.html.php +++ b/module/productplan/view/edit.html.php @@ -41,10 +41,14 @@
- parent == '-1' ? "class='hidden'": '';?>> + parent == '-1'):?> + parent);?> + + + parent == -1 ? "disabled='disabled'" : '' ;?> From 97073567df09ee79b7377ba9ed9bb744bd38c4c0 Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Thu, 17 Nov 2022 08:42:31 +0000 Subject: [PATCH 063/129] =?UTF-8?q?*=20Finish=20task=20#76435=E3=80=817643?= =?UTF-8?q?6=E3=80=8176437.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/build/control.php | 28 ++++++++++------------------ module/build/model.php | 30 ++++++++++++++---------------- module/build/view/view.html.php | 4 ++-- 3 files changed, 26 insertions(+), 36 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 0abe7eb54e..45fae6f3d5 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -255,7 +255,7 @@ class build extends control $bugPager = new pager($type == 'bug' ? $recTotal : 0, $recPerPage, $type == 'bug' ? $pageID : 1); $bugs = $this->dao->select('*')->from(TABLE_BUG) - ->where('id')->in($build->bugs) + ->where('id')->in($build->allBugs) ->andWhere('deleted')->eq(0) ->beginIF($type == 'bug')->orderBy($sort)->fi() ->page($bugPager) @@ -264,7 +264,7 @@ class build extends control /* Get stories and stages. */ $storyPager = new pager($type == 'story' ? $recTotal : 0, $recPerPage, $type == 'story' ? $pageID : 1); $stories = $this->dao->select("*, IF(`pri` = 0, {$this->config->maxPriValue}, `pri`) as priOrder")->from(TABLE_STORY) - ->where('id')->in($build->stories) + ->where('id')->in($build->allStories) ->andWhere('deleted')->eq(0) ->beginIF($type == 'story')->orderBy($sort)->fi() ->page($storyPager) @@ -277,10 +277,14 @@ class build extends control if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($build->project); + $objectType = 'project'; + $objectID = $build->project; } elseif($this->app->tab == 'execution') { $this->loadModel('execution')->setMenu($build->execution); + $objectType = 'execution'; + $objectID = $build->execution; } $executions = $this->loadModel('execution')->getPairs($this->session->project, 'all', 'empty'); @@ -297,18 +301,6 @@ class build extends control $this->executeHooks($buildID); - if($this->app->tab == 'execution') - { - $objectType = 'execution'; - $objectID = $build->execution; - } - else - { - $objectType = 'project'; - $objectID = $build->project; - } - - /* Assign. */ $this->view->canBeChanged = common::canBeChanged('build', $build); // Determines whether an object is editable. $this->view->users = $this->loadModel('user')->getPairs('noletter'); @@ -611,11 +603,11 @@ class build extends control $executionID = $build->execution ? $build->execution : $build->project; if($browseType == 'bySearch') { - $allStories = $this->story->getBySearch($build->product, $build->branch, $queryID, 'id', $executionID, 'story', $build->stories, $pager); + $allStories = $this->story->getBySearch($build->product, $build->branch, $queryID, 'id', $executionID, 'story', $build->allStories, $pager); } else { - $allStories = $this->story->getExecutionStories($executionID, $build->product, 0, 't1.`order`_desc', 'byBranch', $build->branch, 'story', $build->stories, $pager); + $allStories = $this->story->getExecutionStories($executionID, $build->product, 0, 't1.`order`_desc', 'byBranch', $build->branch, 'story', $build->allStories, $pager); } $this->view->allStories = $allStories; @@ -735,11 +727,11 @@ class build extends control $executionID = $build->execution ? $build->execution : $build->project; if($browseType == 'bySearch') { - $allBugs = $this->bug->getBySearch($build->product, $build->branch, $queryID, 'id_desc', $build->bugs, $pager, $build->project); + $allBugs = $this->bug->getBySearch($build->product, $build->branch, $queryID, 'id_desc', $build->allBugs, $pager, $build->project); } else { - $allBugs = $this->bug->getExecutionBugs($executionID, 0, 'all', $buildID, 'noclosed', 0, 'status_desc,id_desc', $build->bugs, $pager); + $allBugs = $this->bug->getExecutionBugs($executionID, 0, 'all', $buildID, 'noclosed', 0, 'status_desc,id_desc', $build->allBugs, $pager); } $this->view->allBugs = $allBugs; diff --git a/module/build/model.php b/module/build/model.php index 695656a2f1..02698c30e5 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -31,6 +31,7 @@ class buildModel extends model ->fetch(); if(!$build) return false; + $build = $this->linkChildBuilds($build); $build = $this->loadModel('file')->replaceImgURL($build, 'desc'); $build->files = $this->file->getByObject('build', $buildID); if($setImgSize) $build->desc = $this->file->setImgSize($build->desc); @@ -349,7 +350,6 @@ class buildModel extends model if(!dao::isError()) { $buildID = $this->dao->lastInsertID(); - $this->linkChildBuilds($buildID, $build->builds); $this->file->updateObjectID($this->post->uid, $buildID, 'build'); $this->file->saveUpload('build', $buildID); $this->loadModel('score')->create('build', 'create', $buildID); @@ -389,8 +389,6 @@ class buildModel extends model if(isset($build->branch) and $oldBuild->branch != $build->branch) $this->dao->update(TABLE_RELEASE)->set('branch')->eq($build->branch)->where('build')->eq($buildID)->exec(); if(!dao::isError()) { - $addBuilds = array_diff(explode(',', $build->builds), explode(',', $oldBuild->builds)); - if($addBuilds) $this->linkChildBuilds($buildID, $addBuilds); $this->file->updateObjectID($this->post->uid, $buildID, 'build'); return common::createChanges($oldBuild, $build); } @@ -569,28 +567,28 @@ class buildModel extends model /** * Bugs and stories associated with child builds. * - * @param int $buildID - * @param string $childBuildIDList + * @param object $build * @access public - * @return void + * @return object */ - public function linkChildBuilds($buildID, $childBuildIDList) + public function linkChildBuilds($build) { - $build = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->eq($buildID)->fetch(); - $childBuilds = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->in($childBuildIDList)->fetchAll(); + $build->allBugs = $build->bugs; + $build->allStories = $build->stories; + $childBuilds = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll(); foreach($childBuilds as $childBuild) { - if($childBuild->bugs) $build->bugs .= ",{$childBuild->bugs}"; - if($childBuild->stories) $build->stories .= ",{$childBuild->stories}"; + if($childBuild->bugs) $build->allBugs .= ",{$childBuild->bugs}"; + if($childBuild->stories) $build->allStories .= ",{$childBuild->stories}"; } - $build->bugs = explode(',', $build->bugs); - $build->bugs = join(',', array_unique(array_filter($build->bugs))); - $build->stories = explode(',', $build->stories); - $build->stories = join(',', array_unique(array_filter($build->stories))); + $build->allBugs = explode(',', $build->allBugs); + $build->allBugs = join(',', array_unique(array_filter($build->allBugs))); + $build->allStories = explode(',', $build->allStories); + $build->allStories = join(',', array_unique(array_filter($build->allStories))); - $this->dao->update(TABLE_BUILD)->data($build)->where('id')->eq($buildID)->exec(); + return $build; } /** diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 9ca7217e2d..048b6082b1 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -98,7 +98,7 @@ tbody tr td:first-child input {display: none;}
build->type;?>build->typeList, 'execution');?>
executionCommon;?>
build->product;?>
build->builds;?> build->notice->autoRelation;?>
build->name;?>
+
productplan->title;?> title, "class='form-control' required");?>
productplan->parent;?> '') + $parentPlanPairs, $plan->parent, "class='form-control chosen'");?>
productplan->status;?>
- id => sprintf('%03d', $story->id)));?> + id => sprintf('%03d', $story->id)), '', strpos(",$build->stories,", ",$story->id,") !== false ? '' : "disabled");?> id);?> @@ -198,7 +198,7 @@ tbody tr td:first-child input {display: none;}
- id => sprintf('%03d', $bug->id)));?> + id => sprintf('%03d', $bug->id)), '', strpos(",$build->bugs,", ",$bug->id,") !== false ? '' : "disabled");?> id);?> From 05d9cef073f03287fccaf8c7fa5fae8a8ef1a7bf Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 17 Nov 2022 16:52:31 +0800 Subject: [PATCH 064/129] * Fix bug #29957. --- module/repo/js/edit.js | 3 ++- module/repo/model.php | 1 + module/repo/view/edit.html.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/repo/js/edit.js b/module/repo/js/edit.js index 85c1b2f921..19ff865cfb 100644 --- a/module/repo/js/edit.js +++ b/module/repo/js/edit.js @@ -1,6 +1,6 @@ $(function() { - scmChanged(scm, true); + scmChanged(repoSCM, true); $('#submit').mousedown(function() { $form = $(this).closest('form'); @@ -86,6 +86,7 @@ function scmChanged(scm, isFirstRequest = false) if(scm == 'Git' || scm == 'Gitea' || scm == 'Gogs') { $('.account-fields').addClass('hidden'); + if(['Git', 'Gitea', 'Gogs'].indexOf(repoSCM) === -1) $('#client').val(''); $('.tips-git').removeClass('hidden'); $('.tips-svn').addClass('hidden'); diff --git a/module/repo/model.php b/module/repo/model.php index 817dd0abe3..a4b49e5fba 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -253,6 +253,7 @@ class repoModel extends model public function update($id) { $repo = $this->getRepoByID($id); + if(!$this->checkConnection()) return false; $isPipelineServer = in_array(strtolower($this->post->SCM), $this->config->repo->gitServiceList) ? true : false; diff --git a/module/repo/view/edit.html.php b/module/repo/view/edit.html.php index 2f35e7b3b3..15cfacde7f 100644 --- a/module/repo/view/edit.html.php +++ b/module/repo/view/edit.html.php @@ -18,7 +18,7 @@ .user-addon{padding-right: 16px; padding-left: 16px;} -SCM);?> +SCM);?>
From 4fe09fb5077c9eaf7e78a6ffa584669f91e1ed13 Mon Sep 17 00:00:00 2001 From: Lufei Date: Fri, 18 Nov 2022 08:49:38 +0800 Subject: [PATCH 065/129] * Fix GH-104, Get extension removePath error. --- lib/zfile/zfile.class.php | 2 +- module/extension/control.php | 7 +++---- module/extension/model.php | 10 ++++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/zfile/zfile.class.php b/lib/zfile/zfile.class.php index 8e24357a7a..4903d50df4 100644 --- a/lib/zfile/zfile.class.php +++ b/lib/zfile/zfile.class.php @@ -223,7 +223,7 @@ class zfile * * @param string $patern * @access public - * @return avoid + * @return void */ public function batchRemoveFile($patern) { diff --git a/module/extension/control.php b/module/extension/control.php index 1ff63ffd9e..fb760bed0e 100644 --- a/module/extension/control.php +++ b/module/extension/control.php @@ -145,7 +145,6 @@ class extension extends control $this->view->upgrade = $upgrade; $this->view->title = $installTitle . $extension; - $statusFile = $this->loadModel('common')->checkSafeFile(); if($statusFile) { @@ -186,7 +185,7 @@ class extension extends control $incompatible = $condition->zentao['incompatible']; if($this->extension->checkVersion($incompatible)) { - $this->view->error = sprintf($this->lang->extension->errorIncompatible); + $this->view->error = $this->lang->extension->errorIncompatible; return $this->display(); } @@ -220,7 +219,7 @@ class extension extends control $noDepends = false; if(isset($installedExts[$code])) { - if($this->extension->compare4Limit($installedExts[$code]->version, $limit, 'noBetween'))$noDepends = true; + if($this->extension->compare4Limit($installedExts[$code]->version, $limit, 'noBetween')) $noDepends = true; } else { @@ -235,7 +234,7 @@ class extension extends control if(!empty($limit['max'])) $extVersion .= ' <=v' . $limit['max']; $extVersion .=')'; } - if($noDepends)$dependsExt .= $code . $extVersion . ' ' . html::a(inlink('obtain', 'type=bycode¶m=' . helper::safe64Encode($code)), $this->lang->extension->installExt, '_blank') . '
'; + if($noDepends) $dependsExt .= $code . $extVersion . ' ' . html::a(inlink('obtain', 'type=bycode¶m=' . helper::safe64Encode($code)), $this->lang->extension->installExt, '_blank') . '
'; } if($noDepends) diff --git a/module/extension/model.php b/module/extension/model.php index e1d16fd42d..9094b74003 100644 --- a/module/extension/model.php +++ b/module/extension/model.php @@ -525,9 +525,11 @@ class extensionModel extends model /* Extract files. */ $packageFile = $this->getPackageFile($extension); $this->app->loadClass('pclzip', true); - $zip = new pclzip($packageFile); - $files = $zip->listContent(); - $removePath = $files[0]['filename']; + $zip = new pclzip($packageFile); + $files = $zip->listContent(); + $pathinfo = pathinfo($files[0]['filename']); + $removePath = isset($pathinfo['dirname']) && $pathinfo['dirname'] != '.' ? $pathinfo['dirname'] : $pathinfo['basename']; + if($zip->extract(PCLZIP_OPT_PATH, $extensionPath, PCLZIP_OPT_REMOVE_PATH, $removePath) == 0) { $return->result = 'fail'; @@ -548,7 +550,7 @@ class extensionModel extends model { $appRoot = $this->app->getAppRoot(); $extensionDir = "ext/$extension/"; - $paths = scandir($extensionDir); + $paths = scandir($extensionDir); $copiedFiles = array(); foreach($paths as $path) From 86812c33bf3709bce3d35ed61233f6bfcef8c8f1 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 18 Nov 2022 09:17:39 +0800 Subject: [PATCH 066/129] * Fix bug#29742. --- module/product/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 3bb5714f04..896dfb8304 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -124,7 +124,7 @@ class productModel extends model if($isQaModule) $moduleName = 'bug'; if($isFeedbackModel) $moduleName = 'feedback'; $dropMenuLink = helper::createLink($moduleName, 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra"); - $output = "
diff --git a/extension/lite/product/ext/view/browse.html.php b/extension/lite/product/ext/view/browse.html.php index 898cc404f8..2a08521f61 100644 --- a/extension/lite/product/ext/view/browse.html.php +++ b/extension/lite/product/ext/view/browse.html.php @@ -203,7 +203,7 @@ js::set('URAndSR', $this->config->URAndSR);

story->noStory : $lang->story->noRequirement;?> - createLink('story', 'create', "productID={$productID}&branch={$branch}&moduleID={$moduleID}&storyID=0&projectID=$projectID&bugID=0&planID=0&todoID=0&extra=&type=$storyType"), " " . $lang->story->createCommon, '', "class='btn btn-info' data-app='$from'");?> + createLink('story', 'create', "productID={$productID}&branch={$branch}&moduleID={$moduleID}&storyID=0&projectID=$projectID&bugID=0&planID=0&todoID=0&extra=&type=$storyType"), " " . $lang->story->create, '', "class='btn btn-info' data-app='$from'");?>

diff --git a/extension/lite/project/ext/config/lite.php b/extension/lite/project/ext/config/lite.php index 587a29764b..24640cf74b 100644 --- a/extension/lite/project/ext/config/lite.php +++ b/extension/lite/project/ext/config/lite.php @@ -1,2 +1,4 @@ project->list->exportFields = 'id,code,name,status,budget,PM,desc'; +$config->project->list->exportFields = 'id,code,name,status,PM,desc'; +$config->project->datatable->defaultField = array('id', 'name', 'status', 'PM', 'begin', 'end', 'progress', 'actions'); +unset($config->project->datatable->fieldList['budget']); From 35fd254797f1ba35ce4df37d1dcd7f3cbdca4750 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 18 Nov 2022 14:57:52 +0800 Subject: [PATCH 100/129] * Fix bug create execution --- module/execution/view/create.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index eea845b2be..468a57bf4e 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -150,7 +150,7 @@ - model == 'scrum' or empty($products)):?> + model) and $project->model == 'scrum') or empty($products)):?>
From 37c83b3d36b75caa8b6880e096223df5a72ae374 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 18 Nov 2022 14:58:10 +0800 Subject: [PATCH 101/129] * Fix bug #29714. --- module/block/view/waterfallganttblock.html.php | 2 +- module/programplan/model.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/module/block/view/waterfallganttblock.html.php b/module/block/view/waterfallganttblock.html.php index 672dfa6916..68b5c3132e 100644 --- a/module/block/view/waterfallganttblock.html.php +++ b/module/block/view/waterfallganttblock.html.php @@ -124,7 +124,7 @@ { plan.progress = !plan.tasks.length ? 0 : plan.progress / plan.tasks.length; var $plan = $('
'); - $plan.append('
' + plan.text + '
'); + $plan.append('
' + plan.text + '
'); $plans.append($plan); var $bar = $('
'); diff --git a/module/programplan/model.php b/module/programplan/model.php index 3402e2c654..cf547525d6 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -187,6 +187,7 @@ class programplanModel extends model $data->id = $plan->id; $data->type = 'plan'; $data->text = empty($plan->milestone) ? $plan->name : $plan->name . $isMilestone ; + $data->name = $plan->name; $data->percent = $plan->percent; $data->attribute = zget($this->lang->stage->typeList, $plan->attribute); $data->milestone = zget($this->lang->programplan->milestoneList, $plan->milestone); From 07c1b0cc4535fc86a1b9a0c93bea01a6528ad619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Fri, 18 Nov 2022 15:09:21 +0800 Subject: [PATCH 102/129] * adjust for create release. --- module/build/model.php | 3 ++- module/projectrelease/model.php | 8 ++++++-- module/release/model.php | 27 +++++++++++++++++++-------- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/module/build/model.php b/module/build/model.php index 3b3f8c0ca9..e8c4f0c306 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -279,8 +279,9 @@ class buildModel extends model if($branch !== 'all') { $inBranch = false; - foreach(explode(',', trim( $release->branch, ',')) as $branchID) + foreach(explode(',', trim($release->branch, ',')) as $branchID) { + if(empty($branchID)) continue; if(strpos(",{$branchs},", ",{$branchID},") !== false) $inBranch = true; } if(!$inBranch) continue; diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index 476d3a353c..9311581055 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -114,13 +114,17 @@ class projectreleaseModel extends model */ public function getReleasedBuilds($projectID) { - $releases = $this->dao->select('build')->from(TABLE_RELEASE) + $releases = $this->dao->select('shadow,build')->from(TABLE_RELEASE) ->where('deleted')->eq(0) ->andWhere("FIND_IN_SET($projectID, project)") ->fetchAll(); $buildIdList = array(); - foreach($releases as $release) $buildIdList = array_merge($buildIdList, explode(',', trim($release->build, ','))); + foreach($releases as $release) + { + $buildIdList = array_merge($buildIdList, explode(',', trim($release->build, ','))); + $buildIdList[] = $release->shadow; + } return $buildIdList; } diff --git a/module/release/model.php b/module/release/model.php index f0c219967b..c866d7574b 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -116,19 +116,30 @@ class releaseModel extends model */ public function getReleasedBuilds($productID, $branch = 'all') { - $builds = $this->dao->select('build')->from(TABLE_RELEASE) + $releases = $this->dao->select('branch,shadow,build')->from(TABLE_RELEASE) ->where('deleted')->eq(0) ->andWhere('product')->eq($productID) - ->beginIF($branch !== 'all')->andWhere('branch')->eq($branch)->fi() - ->fetchPairs('build'); + ->fetchAll(); - $buildIDList = array(); - foreach($builds as $build) + $buildIdList = array(); + foreach($releases as $release) { - $build = explode(',', $build); - $buildIDList = array_merge($buildIDList, $build); + if($branch != 'all') + { + $inBranch = false; + foreach(explode(',', trim($release->branch, ',')) as $branchID) + { + if(empty($branchID)) continue; + if(strpos(",{$branch},", ",{$branchID},") !== false) $inBranch = true; + } + if(!$inBranch) continue; + } + + $builds = explode(',', $release->build); + $buildIdList = array_merge($buildIdList, $builds); + $buildIdList[] = $release->shadow; } - return $buildIDList; + return $buildIdList; } /** From 0b2bb1a273bc6c5c55645a6356cdbc16f115b2bd Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 18 Nov 2022 15:18:57 +0800 Subject: [PATCH 103/129] * Fix bug #29442#29695 --- module/execution/model.php | 4 ++-- module/project/js/execution.js | 5 +++++ module/project/view/execution.html.php | 13 +++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 129b2aa23c..00f4f38d0b 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4712,7 +4712,7 @@ class executionModel extends model echo "{$this->lang->execution->typeList[$execution->type]} "; if(empty($execution->children)) { - echo html::a(helper::createLink('execution', 'view', "executionID=$execution->id"), $execution->name, '', 'class="text-ellipsis"'); + echo html::a(helper::createLink('execution', 'view', "executionID=$execution->id"), $execution->name, '', "class='text-ellipsis' title='{$execution->name}'"); if(!helper::isZeroDate($execution->end)) { if($execution->status != 'closed') @@ -4742,7 +4742,7 @@ class executionModel extends model echo "" . $execution->hours->totalLeft . $this->lang->execution->workHourUnit . ''; echo '' . html::ring($execution->hours->progress) . ''; echo ""; - echo ''; + echo ''; common::printIcon('execution', 'start', "executionID={$execution->id}", $execution, 'list', '', '', 'iframe', true); $class = !empty($execution->children) ? 'disabled' : ''; common::printIcon('task', 'create', "executionID={$execution->id}", '', 'list', '', '', $class, false, "data-app='execution'"); diff --git a/module/project/js/execution.js b/module/project/js/execution.js index f3d71fc092..49a94fd3f4 100644 --- a/module/project/js/execution.js +++ b/module/project/js/execution.js @@ -116,6 +116,11 @@ $(function() return (checkedTotal ? checkedSummary : pageSummary).replace('%total%', $rows.length).replace('%wait%', checkedWait).replace('%doing%', checkedDoing); } }) + + if(project.division && project.hasProduct && $('#executionList thead th.table-nest-title').width() < 240) + { + $('#executionList thead th.table-nest-title').width(240) + } }) window.addEventListener('scroll', this.handleScroll) diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php index 569d2b4159..88788e85a4 100644 --- a/module/project/view/execution.html.php +++ b/module/project/view/execution.html.php @@ -1,5 +1,6 @@ + edit);?> selectAll);?> execution->checkedExecutions);?> @@ -87,15 +88,15 @@
- division and $project->hasProduct) echo "{$lang->project->product}";?> + division and $project->hasProduct) echo "{$lang->project->product}";?> project->status;?> - execution->owner;?> + execution->owner;?> programplan->begin;?> programplan->end;?> - task->estimateAB;?> - task->consumedAB;?> - task->leftAB;?> - project->progress;?> + task->estimateAB;?> + task->consumedAB;?> + task->leftAB;?> + project->progress;?> execution->burn;?> actions;?> From de8cfb9fec71c3719246d14a5d2395e61c82a4a3 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 18 Nov 2022 15:19:18 +0800 Subject: [PATCH 104/129] * Fix bug#29997. --- module/execution/view/create.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index eea845b2be..1b3aca4f43 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -113,7 +113,7 @@ stage->percent;?> - +
% From 8ef4f02bf8dae78322b27b8f977fd206d7b827dc Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 18 Nov 2022 15:38:59 +0800 Subject: [PATCH 105/129] * Fix bug #29442#29695 --- module/project/view/execution.html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/project/view/execution.html.php b/module/project/view/execution.html.php index 88788e85a4..211674df6c 100644 --- a/module/project/view/execution.html.php +++ b/module/project/view/execution.html.php @@ -93,9 +93,9 @@ execution->owner;?> programplan->begin;?> programplan->end;?> - task->estimateAB;?> - task->consumedAB;?> - task->leftAB;?> + task->estimateAB;?> + task->consumedAB;?> + task->leftAB;?> project->progress;?> execution->burn;?> actions;?> From 29cddd773a53d29ca7146a66fa2dd8ce64b7c2ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Fri, 18 Nov 2022 16:25:14 +0800 Subject: [PATCH 106/129] * fix bug #75779. --- module/story/control.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index bf6a2ef71d..5c9c92a74b 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1053,19 +1053,10 @@ class story extends control $branchTagOption = array(); $products = array(); - if($executionID) - { - /* The stories of project or execution. */ - $execution = $this->execution->getByID($executionID); - $products = $this->loadModel('product')->getProducts($executionID); - } - else - { - /* The stories of my. */ - $productIdList = array(); - foreach($stories as $story) $productIdList[$story->product] = $story->product; - $products = $this->product->getByIdList($productIdList); - } + /* Get product id list by the stories. */ + $productIdList = array(); + foreach($stories as $story) $productIdList[$story->product] = $story->product; + $products = $this->product->getByIdList($productIdList); foreach($products as $storyProduct) { @@ -1133,8 +1124,6 @@ class story extends control } } - $this->view->position[] = $this->lang->story->common; - $this->view->position[] = $this->lang->story->batchEdit; $this->view->title = $this->lang->story->batchEdit; $this->view->users = $users; $this->view->priList = array('0' => '', 'ditto' => $this->lang->story->ditto) + $this->lang->story->priList; From d264eb022cb49648ffd85b048e5343158d7b4fd5 Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 18 Nov 2022 16:03:03 +0800 Subject: [PATCH 107/129] * Fix bug #29687. --- module/bug/control.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/bug/control.php b/module/bug/control.php index 7c12932430..f52c5b55c3 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -2353,6 +2353,8 @@ class bug extends control if($this->app->tab == 'project' or $this->app->tab == 'execution') { + $execution = $this->loadModel('execution')->getByID($executionID); + if(empty($execution->multiple)) $this->config->bug->exportFields = str_replace('execution,', '', $this->config->bug->exportFields); if($product->shadow) $this->config->bug->exportFields = str_replace('product,', '', $this->config->bug->exportFields); } From efb20b02d8032e410c2674ba2709b2d0b1586bbb Mon Sep 17 00:00:00 2001 From: liuhong Date: Mon, 21 Nov 2022 00:01:24 +0000 Subject: [PATCH 108/129] * Adjust code for feedback #1468. --- module/productplan/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/productplan/model.php b/module/productplan/model.php index c2654d796b..f014d79f54 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -255,7 +255,7 @@ class productplanModel extends model $plans = $this->reorder4Children($plans); $planPairs = array(); - $mainplan = array(); + $mainPlan = array(); $this->app->loadLang('bug'); $this->app->loadLang('branch'); foreach($plans as $plan) @@ -267,11 +267,11 @@ class productplanModel extends model if($plan->productType != 'normal') $planPairs[$plan->id] = ($plan->branchName ? $plan->branchName : $this->lang->branch->main) . ' / ' . $planPairs[$plan->id]; if(empty($plan->branchName)) { - $mainplan = $planPairs[$plan->id]; + $mainPlan = $planPairs[$plan->id]; unset($planPairs[$plan->id]); } } - array_splice($planPairs, 0, 0, $mainplan); + array_splice($planPairs, 0, 0, $mainPlan); return array('' => '', 'ditto' => $this->lang->bug->ditto) + $planPairs; } From 16df34b4aefbcbe81ea5b6ccd63f1744a3b74f4d Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 21 Nov 2022 00:40:29 +0000 Subject: [PATCH 109/129] * Adjust the standard sql. --- db/standard/zentao18.0.beta1.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/standard/zentao18.0.beta1.sql b/db/standard/zentao18.0.beta1.sql index 03eda84c01..2f014929d2 100644 --- a/db/standard/zentao18.0.beta1.sql +++ b/db/standard/zentao18.0.beta1.sql @@ -2280,6 +2280,7 @@ CREATE TABLE `zt_release` ( `project` varchar(255) NOT NULL, `product` mediumint(8) unsigned NOT NULL DEFAULT '0', `branch` varchar(255) NOT NULL, + `shadow` mediumint(8) unsigned NOT NULL default '0', `build` varchar(255) NOT NULL, `name` varchar(255) NOT NULL DEFAULT '', `marker` enum('0','1') NOT NULL DEFAULT '0', From e993d076703b9c333ac3d689171e809bdb5eb28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Mon, 21 Nov 2022 09:28:51 +0800 Subject: [PATCH 110/129] * fix bug for show build. --- module/build/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/build/model.php b/module/build/model.php index e368fbed59..f4ab227ef9 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -282,7 +282,7 @@ class buildModel extends model $inBranch = false; foreach(explode(',', trim($release->branch, ',')) as $branchID) { - if(empty($branchID)) continue; + if($branchID === '') continue; if(strpos(",{$branchs},", ",{$branchID},") !== false) $inBranch = true; } if(!$inBranch) continue; @@ -294,6 +294,7 @@ class buildModel extends model $builds[$release->date][$release->shadow] = $releaseName; foreach(explode(',', trim($release->build, ',')) as $buildID) { + if(!isset($allBuilds[$buildID])) continue; $build = $allBuilds[$buildID]; unset($builds[$build->date][$buildID]); } From adb1434d5b8f6ec3cef95ad26a42595d98daef69 Mon Sep 17 00:00:00 2001 From: Yagami Date: Mon, 21 Nov 2022 09:31:09 +0800 Subject: [PATCH 111/129] * Finish task #76491. --- module/story/css/view.css | 1 + 1 file changed, 1 insertion(+) diff --git a/module/story/css/view.css b/module/story/css/view.css index 782054d7ad..2bd6c198d5 100644 --- a/module/story/css/view.css +++ b/module/story/css/view.css @@ -13,3 +13,4 @@ .linkStoryTr > td {padding-left: 0px !important;} .removeButton {margin-left: -10px;} .resolution {white-space: nowrap; overflow: hidden;} +.body-modal #mainMenu+#mainContent.main-row {padding: 0px 10px 0;} From bdb570c00eac177ec2c48594b4d0bb205d396f39 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 21 Nov 2022 09:43:56 +0800 Subject: [PATCH 112/129] * Fix bug#29461. --- module/datatable/control.php | 3 +++ module/execution/view/bug.html.php | 2 ++ module/execution/view/story.html.php | 3 +++ module/project/view/bug.html.php | 2 ++ 4 files changed, 10 insertions(+) diff --git a/module/datatable/control.php b/module/datatable/control.php index 7f3d7b1291..5ff84da3f2 100644 --- a/module/datatable/control.php +++ b/module/datatable/control.php @@ -106,6 +106,7 @@ class datatable extends control if(!$project->multiple) unset($cols['execution']); if(!$project->hasProduct and $project->model != 'scrum') unset($cols['plan']); + if(!$project->hasProduct) unset($cols['branch']); } if($moduleName == 'execution' and $method == 'bug') @@ -113,12 +114,14 @@ class datatable extends control $execution = $this->loadModel('execution')->getByID($this->session->execution); $project = $this->loadModel('project')->getByID($execution->project); if(!$project->hasProduct and $project->model != 'scrum') unset($cols['plan']); + if(!$project->hasProduct) unset($cols['branch']); } if($moduleName == 'execution' and $method == 'story') { $execution = $this->loadModel('execution')->getByID($this->session->execution); if(!$execution->hasProduct and !$execution->multiple) unset($cols['plan']); + if(!$execution->hasProduct) unset($cols['branch']); } $this->view->cols = $cols; diff --git a/module/execution/view/bug.html.php b/module/execution/view/bug.html.php index 88c458f49d..32aa5c5ac2 100644 --- a/module/execution/view/bug.html.php +++ b/module/execution/view/bug.html.php @@ -125,6 +125,7 @@ foreach($setting as $value) { if(!$project->hasProduct and $project->model != 'scrum' and $value->id == 'plan') continue; + if(!$project->hasProduct and $value->id == 'branch') continue; if($value->show) { if(common::checkNotCN() and $value->id == 'severity') $value->name = $lang->bug->severity; @@ -154,6 +155,7 @@ hasProduct and $project->model != 'scrum' and $value->id == 'plan') continue; + if(!$project->hasProduct and $value->id == 'branch') continue; $this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table', $projectPairs); } ?> diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index f09acee452..2bb0854b82 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -254,6 +254,7 @@ $value) { + if(!$execution->hasProduct and $value->id == 'branch') continue; if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue; if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue; if(!$execution->hasProduct and !$execution->multiple and $storyType == 'requirement' and $value->id == 'taskCount') continue; @@ -274,6 +275,7 @@ $value) { + if(!$execution->hasProduct and $value->id == 'branch') continue; if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue; if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue; if(!$execution->hasProduct and !$execution->multiple and $storyType == 'requirement' and $value->id == 'taskCount') continue; @@ -290,6 +292,7 @@ $value) { + if(!$execution->hasProduct and $value->id == 'branch') continue; if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue; if(!$execution->hasProduct and !$execution->multiple and $value->id == 'stage') continue; if(!$execution->hasProduct and !$execution->multiple and $storyType == 'requirement' and $value->id == 'taskCount') continue; diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 44d489418a..2efb621a8e 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -99,6 +99,7 @@ foreach($setting as $key => $value) { if(!$project->hasProduct and $project->model != 'scrum' and $value->id == 'plan') continue; + if(!$project->hasProduct and $value->id == 'branch') continue; if($value->show) { @@ -119,6 +120,7 @@ hasProduct and $project->model != 'scrum' and $value->id == 'plan') continue; + if(!$project->hasProduct and $value->id == 'branch') continue; $this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table', $projectPairs); } ?> From 182f1abc9a8e608f334894f22c950b818da76166 Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Mon, 21 Nov 2022 01:51:24 +0000 Subject: [PATCH 113/129] * Fix bug #30003. --- module/upgrade/model.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 4fc7b2a4ec..22aef7f208 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -7558,7 +7558,6 @@ class upgradeModel extends model $projectID = $this->dao->lastInsertId(); - $this->action->create('project', $projectID, 'openedbysystem'); if($project->status == 'closed') $this->action->create('project', $projectID, 'closedbysystem'); $project->id = $projectID; @@ -7568,6 +7567,14 @@ class upgradeModel extends model $this->processMergedData($programID, $projectID, '', $productIdList, array($sprint->id)); if($fromMode == 'classic') $this->dao->update(TABLE_PROJECT)->set('multiple')->eq('0')->where('id')->eq($sprint->id)->exec(); + $this->dao->update(TABLE_ACTION) + ->set('objectID')->eq($projectID) + ->set('objectType')->eq('project') + ->set('execution')->eq('0') + ->set('project')->eq($projectID) + ->where('objectType')->eq('execution') + ->andWhere('objectID')->eq($sprint->id) + ->exec(); } $this->fixProjectPath($programID); From 84b13838201bd41bb3f16cce399f7849bb9b438a Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 21 Nov 2022 02:12:42 +0000 Subject: [PATCH 114/129] * Display all products of the top program. --- module/project/control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/project/control.php b/module/project/control.php index eba49dd1a7..2d05470023 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -2237,13 +2237,14 @@ class project extends control $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($allProducts), 'ignoreNormal|noclosed'); if($this->config->systemMode == 'ALM') { + $topProgramID = $this->program->getTopByPath($project->path); $productsGroupByProgram = $this->product->getProductsGroupByProgram(); $currentProducts = array(); $otherProducts = array(); foreach($productsGroupByProgram as $programID => $programProducts) { - if($programID != $project->parent) + if($programID != $topProgramID) { foreach($programProducts as $productID => $productName) { From f7d7f68fc9ec0d8b157836158fb8bae2b55b0f5b Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Mon, 21 Nov 2022 02:18:59 +0000 Subject: [PATCH 115/129] * Fix bug #30000. --- module/execution/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 6b396e9e80..75ed75ee7e 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -5112,7 +5112,6 @@ class executionModel extends model $_POST = array(); $_POST['project'] = $projectID; $_POST['name'] = $project->name; - $_POST['code'] = $project->code; $_POST['begin'] = $project->begin; $_POST['end'] = $project->end; $_POST['status'] = 'wait'; @@ -5126,6 +5125,7 @@ class executionModel extends model $_POST['RD'] = ''; $_POST['multiple'] = '0'; $_POST['hasProduct'] = $project->hasProduct; + if($project->code) $_POST['code'] = $project->code; $projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchAll(); foreach($projectProducts as $projectProduct) From 66bc58139f6d7ffc985d386a84bd56fc1d82336e Mon Sep 17 00:00:00 2001 From: Yagami Date: Mon, 21 Nov 2022 10:23:28 +0800 Subject: [PATCH 116/129] * Finish task #76486. --- module/bug/control.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index 8f0edd9a6c..e340263ed4 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -2048,7 +2048,11 @@ class bug extends control if(!$project->hasProduct) { unset($this->config->bug->search['fields']['product']); - if($project->model != 'scrum') unset($this->config->bug->search['fields']['plan']); + if(!$project->multiple) + { + unset($this->config->bug->search['fields']['execution']); + unset($this->config->bug->search['fields']['plan']); + } } } From 5811dc886d0b912070bdcf7c17b25bd0041640c0 Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Mon, 21 Nov 2022 02:23:48 +0000 Subject: [PATCH 117/129] * Fix bug #28274. --- module/action/lang/zh-cn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 080aea9711..c75f93a663 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -224,7 +224,7 @@ $lang->action->desc->reopen = '$date, 由 $actor $lang->action->desc->merged = '$date, 由 $actor 合并。' . "\n"; $lang->action->desc->submitreview = '$date, 由 $actor 提交评审。' . "\n"; $lang->action->desc->ganttmove = '$date, 由 $actor 排序。' . "\n"; -$lang->action->desc->switchtolight = '$date, 由 '. $lang->admin->system .' 从全生命周期管理模式切换为轻量管理模式。' . "\n"; +$lang->action->desc->switchtolight = '$date, 由于 '. $lang->admin->system .' 从全生命周期管理模式切换为轻量管理模式,项目访问控制由项目集内公开调整为私有。' . "\n"; $lang->action->desc->unlinkproduct = '$date, 系统判断由于迭代所属项目与$extra取消关联,同步将迭代与$extra取消关联。' . "\n"; /* 用来描述和父子任务相关的操作历史记录。*/ From d0908ccddecfa1c2186703e31e585951215706c6 Mon Sep 17 00:00:00 2001 From: mayue Date: Mon, 21 Nov 2022 10:26:37 +0800 Subject: [PATCH 118/129] * Fix bug #29684. --- module/bug/js/common.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 31541c655f..9f0d4a336f 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -587,13 +587,13 @@ function loadProjectBuilds(projectID) function loadExecutionBuilds(executionID, num) { if(typeof(num) == 'undefined') num = ''; - var branch = $('#branch' + num).val(); - - if(typeof(branch) == 'undefined') var branch = 0; - + var branch = $('#branch' + num).val(); var oldOpenedBuild = $('#openedBuild' + num).val() ? $('#openedBuild' + num).val() : 0; var productID = $('#product' + num).val(); + if(typeof(branch) == 'undefined') var branch = 0; + if(typeof(productID) == 'undefined') var productID = 0; + if(page == 'create') { link = createLink('build', 'ajaxGetExecutionBuilds', 'executionID=' + executionID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + "&branch=" + branch + "&index=0&needCreate=true"); From 4dce7205acc0b1dd98fa5ec03cecde0e9fa21133 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 21 Nov 2022 10:36:28 +0800 Subject: [PATCH 119/129] * Fix task #76458 --- module/execution/model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index 6b396e9e80..1e9607a938 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -565,6 +565,9 @@ class executionModel extends model if($oldExecution->type == 'stage' and $field == 'name') $this->lang->project->name = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->project->name); } + $relationExecutionsID = $this->getRelatedExecutions($executionID); + $relationExecutionsID = !empty($relationExecutionsID) ? implode(',', array_keys($relationExecutionsID)) : ''; + /* Update data. */ $this->lang->error->unique = $this->lang->error->repeat; $executionProject = isset($execution->project) ? $execution->project : '0'; @@ -574,7 +577,7 @@ class executionModel extends model ->checkIF($execution->begin != '', 'begin', 'date') ->checkIF($execution->end != '', 'end', 'date') ->checkIF($execution->end != '', 'end', 'ge', $execution->begin) - ->checkIF(!empty($execution->name), 'name', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `project` = $executionProject and `deleted` = '0'") + ->checkIF(!empty($execution->name), 'name', 'unique', "id in ('$relationExecutionsID') and type in ('sprint','stage', 'kanban') and `project` = $executionProject and `deleted` = '0'") ->checkIF(!empty($execution->code), 'code', 'unique', "id != $executionID and type in ('sprint','stage', 'kanban') and `deleted` = '0'") ->checkFlow() ->where('id')->eq($executionID) From bddf9e66025e88d00f314f00bb69a6e006afc646 Mon Sep 17 00:00:00 2001 From: wangyuting <851424971@qq.com> Date: Mon, 21 Nov 2022 02:37:08 +0000 Subject: [PATCH 120/129] * Fix bug #29561. --- module/execution/view/linkstory.html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/execution/view/linkstory.html.php b/module/execution/view/linkstory.html.php index bc1af1e745..29ad96fe0e 100644 --- a/module/execution/view/linkstory.html.php +++ b/module/execution/view/linkstory.html.php @@ -110,7 +110,8 @@
rawModule == 'execution' and !$project->hasProduct) ? 'projectNoStories' : 'whyNoStories';?> -

{$app->rawModule}->{$emptyTips};?>

+ loadLang('projectstory');?> +

multiple ? $lang->{$app->rawModule}->{$emptyTips} : $lang->projectstory->whyNoStories;?>

From d9e22f597687c4b7cea66ba85919da8df4163efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=A1=E6=A0=8B?= Date: Mon, 21 Nov 2022 10:47:36 +0800 Subject: [PATCH 121/129] * fix bug #29670. --- .../execution/view/ajaxgetdropmenu.html.php | 1 + module/project/view/ajaxgetdropmenu.html.php | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/module/execution/view/ajaxgetdropmenu.html.php b/module/execution/view/ajaxgetdropmenu.html.php index 779e67a96b..0dc5ab2f16 100644 --- a/module/execution/view/ajaxgetdropmenu.html.php +++ b/module/execution/view/ajaxgetdropmenu.html.php @@ -82,6 +82,7 @@ foreach($executions as $projectID => $projectExecutions) $isKanbanMethod = ((in_array($method, $config->execution->kanbanMethod) and $module == 'execution') or (strpos(',create,edit,', ",$method,") !== false and $module == 'build')); if(isset($execution->type) and $execution->type == 'kanban' and !$isKanbanMethod) $executionLink = $kanbanLink; if(isset($execution->type) and $execution->type != 'kanban' and strpos(',kanban,cfd,', ",$method,") !== false) $executionLink = $taskLink; + if(isset($execution->type) and $execution->type == 'stage' and in_array($module, array('issue', 'risk', 'opportunity', 'pssp', 'auditplan', 'meeting'))) $executionLink = $taskLink; if($execution->id == $executionID) $currentExecution = $execution; $selected = $execution->id == $executionID ? 'selected' : ''; diff --git a/module/project/view/ajaxgetdropmenu.html.php b/module/project/view/ajaxgetdropmenu.html.php index 768ab1d93b..aae6f062f1 100644 --- a/module/project/view/ajaxgetdropmenu.html.php +++ b/module/project/view/ajaxgetdropmenu.html.php @@ -57,6 +57,7 @@ $myProjectsHtml = $config->systemMode == 'ALM' ? '
    ' : '
      '; $closedProjectsHtml = $config->systemMode == 'ALM' ? '
        ' : '
          '; +$indexLink = helper::createLink('project', 'index', "projectID=%s"); foreach($projects as $programID => $programProjects) { /* Add the program name before project. */ @@ -77,19 +78,36 @@ foreach($projects as $programID => $programProjects) if($project->model != 'waterfall' and (in_array($module, $config->waterfallModules) or $method == 'track')) { - $link = helper::createLink('project', 'index', "projectID=%s"); + $link = $indexLink; + } + elseif($project->model == 'scrum' and + ( + (in_array($module, array('issue', 'risk', 'meeting')) and !helper::hasFeature("scrum_{$module}")) or + ($module == 'report' and $method == 'projectsummary' and !helper::hasFeature("scrum_measrecord")) + )) + { + $link = $indexLink; + } + elseif($project->model == 'waterfall' and + ( + (in_array($module, array('issue', 'risk', 'opportunity', 'measrecord', 'auditplan', 'meeting')) and !helper::hasFeature("waterfall_{$module}")) or + ($module == 'pssp' and !helper::hasFeature("waterfall_process")) or + ($module == 'report' and $method == 'projectsummary' and !helper::hasFeature("scrum_measrecord")) + )) + { + $link = $indexLink; } elseif($project->model == 'kanban' and (($module == 'project' and !in_array($method, array('build', 'view', 'manageproducts', 'team', 'whitelist', 'managemembers', 'addwhitelist'))) or $module != 'project')) { - $link = helper::createLink('project', 'index', "projectID=%s"); + $link = $indexLink; } elseif(empty($project->hasProduct) and $module == 'project' and $method == 'manageproducts') { - $link = helper::createLink('project', 'index', "projectID=%s"); + $link = $indexLink; } elseif(empty($project->multiple)) { - $link = helper::createLink('project', 'index', "projectID=%s"); + $link = $indexLink; } else { From 8b84363de84fbe861df21c409600114c2f67792c Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 21 Nov 2022 10:58:48 +0800 Subject: [PATCH 122/129] * Fix task #76483 --- module/execution/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index bd6f5618de..f7d2b2acde 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -250,7 +250,7 @@ class execution extends control $this->view->moduleTree = $this->tree->getTaskTreeMenu($executionID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'), $extra); $this->view->memberPairs = $memberPairs; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products)); - $this->view->setModule = true; + $this->view->setModule = !$execution->multiple ? false : true; $this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable. $this->view->showBranch = $showBranch; $this->view->projectName = $this->loadModel('project')->getById($execution->project)->name . ' / ' . $execution->name; From bacdc498f8531fcb113e9f754fcc490c957b56a2 Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Mon, 21 Nov 2022 11:19:59 +0800 Subject: [PATCH 123/129] * Fix bug #30011. --- extension/lite/product/ext/control/browse.php | 1 + extension/lite/product/ext/view/browse.html.php | 1 + module/product/js/browse.js | 2 +- module/product/view/browse.html.php | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/extension/lite/product/ext/control/browse.php b/extension/lite/product/ext/control/browse.php index 7fcc313b0d..fd021e27e7 100644 --- a/extension/lite/product/ext/control/browse.php +++ b/extension/lite/product/ext/control/browse.php @@ -90,6 +90,7 @@ class product extends control $product = $this->product->getById($productID); /* Get stories. */ + if($browseType == 'reviewing') $browseType = 'reviewingstory'; $stories = $this->product->getStories($productID, $branchID, $browseType, $queryID, $moduleID, $storyType, $sort, $pager); /* Display status of branch. */ diff --git a/extension/lite/product/ext/view/browse.html.php b/extension/lite/product/ext/view/browse.html.php index 2a08521f61..3f8207045a 100644 --- a/extension/lite/product/ext/view/browse.html.php +++ b/extension/lite/product/ext/view/browse.html.php @@ -39,6 +39,7 @@ js::set('rawModule', $this->app->rawModule); js::set('productType', $this->app->tab == 'product' ? $product->type : ''); js::set('projectHasProduct', $projectHasProduct); js::set('URAndSR', $this->config->URAndSR); +js::set('vision', $this->config->vision); ?>