From 6491d70c06aaa3655a4dfa5a010841cebbdd6189 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 7 Dec 2022 09:43:50 +0800 Subject: [PATCH 01/63] * move task get list by search into task model, and add to api. --- api/v1/entries/tasks.php | 22 +++++++++++- module/task/model.php | 34 +++++++++++++++++++ .../extension/xuan/im/ext/bot/zentao.bot.php | 4 +-- .../xuan/task/ext/model/xuanxuan.php | 30 ---------------- 4 files changed, 57 insertions(+), 33 deletions(-) delete mode 100644 xuanxuan/extension/xuan/task/ext/model/xuanxuan.php diff --git a/api/v1/entries/tasks.php b/api/v1/entries/tasks.php index 63ed468957..1fb8282ae9 100644 --- a/api/v1/entries/tasks.php +++ b/api/v1/entries/tasks.php @@ -20,7 +20,27 @@ class tasksEntry extends entry */ public function get($executionID = 0) { - if(!$executionID) + /* Get tasks by search, search arguments available: pri, assignedTo, status, id, name. Pager arguments will be utilized as well. */ + if($this->param('search', 0) == 1) + { + $this->loadModel('task'); + $searchParams = array(); + foreach(array('pri' => 'priList', 'assignedTo' => 'assignedToList', 'status' => 'statusList', 'id' => 'idList', 'name' => 'taskName') as $field => $condName) + { + if($this->param($field, false)) $searchParams[$condName] = $this->param($field); + } + + $this->app->loadClass('pager', $static = true); + $pager = pager::init($this->param('total', 0), $this->param('limit', 20), $this->param('page', 1)); + $tasks = $this->task->getListByConds((object)$searchParams, $this->param('order', 'id_desc'), $pager); + + $data = new stdclass(); + $data->status = 'success'; + $data->data = new stdclass(); + $data->data->tasks = array_values($tasks); + $data->data->pager = (object)$pager; + } + elseif(!$executionID) { /* Get my tasks defaultly. */ $control = $this->loadController('my', 'task'); diff --git a/module/task/model.php b/module/task/model.php index dd57730843..84cba6af2a 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -4339,4 +4339,38 @@ class taskModel extends model $order ++; } } + + /** + * Get task list by conditions. + * + * @param object $conds + * @param string $orderBy + * @param object $pager + * @access public + * @return array + */ + public function getListByConds($conds, $orderBy = 'id_desc', $pager = null) + { + foreach(array('priList' => array(), 'assignedToList' => array(), 'statusList' => array(), 'idList' => array(), 'taskName' => '') as $condKey => $defaultValue) + { + if(!isset($conds->$condKey)) + { + $conds->$condKey = $defaultValue; + continue; + } + if(strripos($condKey, 'list') === strlen($condKey) - 4 && !is_array($conds->$condKey)) $conds->$condKey = array_filter(explode(',', $conds->$condKey)); + } + + return $this->dao->select('*')->from(TABLE_TASK) + ->where('deleted')->eq(0) + ->beginIF(!empty($conds->priList))->andWhere('pri')->in($conds->priList)->fi() + ->beginIF(!empty($conds->assignedToList))->andWhere('assignedTo')->in($conds->assignedToList)->fi() + ->beginIF(!empty($conds->statusList))->andWhere('status')->in($conds->statusList)->fi() + ->beginIF(!empty($conds->idList))->andWhere('id')->in($conds->idList)->fi() + ->beginIF(!empty($conds->taskName))->andWhere('name')->like("%{$conds->taskName}%") + ->beginIF(!$this->app->user->admin)->andWhere('execution')->in($this->app->user->view->sprints)->fi() + ->orderBy($orderBy) + ->page($pager) + ->fetchAll('id'); + } } diff --git a/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php b/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php index 940530236b..f3e03b74fa 100644 --- a/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php +++ b/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php @@ -353,7 +353,7 @@ class zentaoBot extends xuanBot $conds = new stdClass(); $conds->assignedToList = is_object($user) ? $user->account : false; $conds->statusList = 'wait,doing,done,pause,cancel'; - return $this->im->task->getListByConds($conds, 'status_asc', 0, $pager); + return $this->im->task->getListByConds($conds, 'status_asc', $pager); } $keys = array(); @@ -364,7 +364,7 @@ class zentaoBot extends xuanBot $keys['taskName'] = true; $conds = $this->parseArguments($args, $keys); - return $this->im->task->getListByConds($conds, 'status_asc', 0, $pager); + return $this->im->task->getListByConds($conds, 'status_asc', $pager); } /** diff --git a/xuanxuan/extension/xuan/task/ext/model/xuanxuan.php b/xuanxuan/extension/xuan/task/ext/model/xuanxuan.php deleted file mode 100644 index 9d2302186e..0000000000 --- a/xuanxuan/extension/xuan/task/ext/model/xuanxuan.php +++ /dev/null @@ -1,30 +0,0 @@ - array(), 'assignedToList' => array(), 'statusList' => array(), 'idList' => array(), 'taskName' => '') as $condKey => $defaultValue) - { - if(!isset($conds->$condKey)) $conds->$condKey = $defaultValue; - } - - return $this->dao->select('*')->from(TABLE_TASK) - ->where('deleted')->eq(0) - ->beginIF(!empty($conds->priList))->andWhere('pri')->in($conds->priList)->fi() - ->beginIF(!empty($conds->assignedToList))->andWhere('assignedTo')->in($conds->assignedToList)->fi() - ->beginIF(!empty($conds->statusList))->andWhere('status')->in($conds->statusList)->fi() - ->beginIF(!empty($conds->idList))->andWhere('id')->in($conds->idList)->fi() - ->beginIF(!empty($conds->taskName))->andWhere('name')->like("%{$conds->taskName}%") - ->orderBy($orderBy) - ->beginIF($limit > 0)->limit($limit)->fi() - ->page($pager) - ->fetchAll('id'); -} From 8aa30bd2815a60e30422be1f8fc3ded08a8648e4 Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 7 Dec 2022 10:36:49 +0800 Subject: [PATCH 02/63] * use tasks api in zentao bot. --- api/v1/entries/tasks.php | 7 ++- framework/api/entry.class.php | 15 +++-- .../extension/xuan/im/ext/bot/zentao.bot.php | 62 +++++++++++-------- 3 files changed, 53 insertions(+), 31 deletions(-) diff --git a/api/v1/entries/tasks.php b/api/v1/entries/tasks.php index 1fb8282ae9..53477cc5f4 100644 --- a/api/v1/entries/tasks.php +++ b/api/v1/entries/tasks.php @@ -27,7 +27,12 @@ class tasksEntry extends entry $searchParams = array(); foreach(array('pri' => 'priList', 'assignedTo' => 'assignedToList', 'status' => 'statusList', 'id' => 'idList', 'name' => 'taskName') as $field => $condName) { - if($this->param($field, false)) $searchParams[$condName] = $this->param($field); + if($this->param($field, false)) + { + $searchParams[$condName] = $this->param($field); + continue; + } + if($this->param($condName, false)) $searchParams[$condName] = $this->param($condName); } $this->app->loadClass('pager', $static = true); diff --git a/framework/api/entry.class.php b/framework/api/entry.class.php index 33018ca827..0b3f15714b 100644 --- a/framework/api/entry.class.php +++ b/framework/api/entry.class.php @@ -98,7 +98,7 @@ class baseEntry * Get request params. * * @param string $key - * @param string $defaultValue + * @param mixed $defaultValue * @access public * @return mixed */ @@ -112,13 +112,18 @@ class baseEntry * 设置请求参数 * Set request param. * - * @param string $key - * @param mixed $value + * @param string|array $key if is array, set params by its key-value pairs. + * @param mixed $value * @access public - * @return mixed + * @return void */ - public function setParam($key, $value) + public function setParam($key, $value = null) { + if(is_array($key)) + { + foreach($key as $k => $v) $_GET[$k] = $v; + return; + } $_GET[$key] = $value; } diff --git a/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php b/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php index f3e03b74fa..c8b8d27cad 100644 --- a/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php +++ b/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php @@ -344,27 +344,37 @@ class zentaoBot extends xuanBot * @param object $user * @param object $pager * @access public - * @return object|string + * @return array */ public function viewTask($args = array(), $user = null, $pager = null) { + $keys = array(); + foreach(array('pri', 'id', 'status', 'assignTo', 'taskName') as $key) $keys[$key] = true; + if(empty($args)) { - $conds = new stdClass(); - $conds->assignedToList = is_object($user) ? $user->account : false; - $conds->statusList = 'wait,doing,done,pause,cancel'; - return $this->im->task->getListByConds($conds, 'status_asc', $pager); + $keys['assignTo'] = is_object($user) ? $user->account : false; + $keys['status'] = 'wait,doing,done,pause,cancel'; } - $keys = array(); - $keys['pri'] = true; - $keys['id'] = true; - $keys['status'] = true; - $keys['assignTo'] = true; - $keys['taskName'] = true; - $conds = $this->parseArguments($args, $keys); - return $this->im->task->getListByConds($conds, 'status_asc', $pager); + $conds->search = 1; + $conds->order = 'status_asc'; + + $result = $this->loadEntry('tasks', 'get', array(), (array)$conds); + + if(isset($result->tasks)) + { + /* Update pager with result. */ + $pager->setRecTotal($result->total); + $pager->setRecPerPage($result->limit); + $pager->setPageID($result->page); + $pager->setPageTotal(); + + return $result->tasks; + } + + return array(); } /** @@ -578,26 +588,24 @@ class zentaoBot extends xuanBot public function renderTask($tasks, $originArgs, $pager) { $lang = $this->im->lang; - if(!$tasks || $pager->recTotal === 0) return $lang->task->noTask; - $sysURL = common::getSysURL(); + $taskCount = $pager->recTotal ? $pager->recTotal : count($tasks); - if($pager->recTotal == 1) + if($taskCount === 0) return $lang->task->noTask; + + if($taskCount == 1) { $task = current($tasks); $link = str_replace('x.php', 'index.php', helper::createLink('task', 'view', "taskID=$task->id", 'html')); $messages = new stdclass(); $messages->type = 'url'; - $messages->url = $sysURL . $link; - return array(sprintf($this->lang->tasksFound, $pager->recTotal), $messages); + $messages->url = common::getSysURL() . $link; + return array(sprintf($this->lang->tasksFound, $taskCount), $messages); } $messages = array(); - if($pager->pageID == 1) - { - $messages[] = sprintf($this->lang->tasksFound, $pager->recTotal); - } + if($pager->pageID == 1) $messages[] = sprintf($this->lang->tasksFound, $taskCount); $taskTable = $this->renderTaskTable($tasks); @@ -633,7 +641,6 @@ class zentaoBot extends xuanBot public function renderTaskTable($tasks) { $lang = $this->im->lang; - $sysURL = common::getSysURL(); $headMap = array('id'=>'ID', 'pri' => $lang->task->pri, 'name' => $lang->task->name, 'assignedTo' => $lang->task->assignedTo, 'status' => $lang->task->status, 'estimate' => $lang->task->estimateAB, 'consumed' => $lang->task->consumedAB, 'left' => $lang->task->leftAB, 'actions' => $lang->actions); $thead = ''; @@ -645,7 +652,7 @@ class zentaoBot extends xuanBot { $tr = ''; $link = str_replace('x.php', 'index.php', helper::createLink('task', 'view', "taskID=$task->id", 'html')); - $href = urlencode($sysURL . $link); + $href = urlencode(common::getSysURL() . $link); $isParent = $task->parent == -1; $isChild = $task->parent > 0; $isMulti = !empty($task->mode); @@ -948,11 +955,12 @@ class zentaoBot extends xuanBot * @param string $entry * @param string $action * @param array $params + * @param array $query * @param string $version * @access public * @return object */ - public function loadEntry($entry, $action, $params = array(), $version = 'v1') + public function loadEntry($entry, $action, $params = array(), $query = array(), $version = 'v1') { try { @@ -979,6 +987,10 @@ class zentaoBot extends xuanBot { $entry->requestBody = (object)$params; } + elseif($action == 'get' && !empty($query)) + { + $entry->setParam($query); + } $content = call_user_func_array(array($entry, $action), $params); return json_decode($content); From a6258b2d7874b573864c7806ac2a0e05dcd95e5d Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Wed, 7 Dec 2022 10:40:01 +0800 Subject: [PATCH 03/63] * add todo for tasks search api. --- api/v1/entries/tasks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v1/entries/tasks.php b/api/v1/entries/tasks.php index 53477cc5f4..c29d861022 100644 --- a/api/v1/entries/tasks.php +++ b/api/v1/entries/tasks.php @@ -21,7 +21,7 @@ class tasksEntry extends entry public function get($executionID = 0) { /* Get tasks by search, search arguments available: pri, assignedTo, status, id, name. Pager arguments will be utilized as well. */ - if($this->param('search', 0) == 1) + if($this->param('search', 0) == 1) // TODO: document this api. { $this->loadModel('task'); $searchParams = array(); From 88b7894a3f1fd42ad7b9ab2f4d1a44fac846a81a Mon Sep 17 00:00:00 2001 From: zenggang Date: Wed, 7 Dec 2022 02:44:14 +0000 Subject: [PATCH 04/63] * Fix bug#30581 --- module/execution/model.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/execution/model.php b/module/execution/model.php index b1ac471826..5778c712f3 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -5247,7 +5247,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['realBegan'] = $project->realBegan; @@ -5261,6 +5260,8 @@ class executionModel extends model $_POST['status'] = $project->status; $_POST['acl'] = 'open'; + if(!isset($this->config->setCode) or $this->config->setCode == 1) $_POST['code'] = $project->code; + $projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchAll(); foreach($projectProducts as $projectProduct) { From ae62bdff75e61eb06999c1c783713c8f6ee1bb62 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 7 Dec 2022 14:19:36 +0800 Subject: [PATCH 05/63] * Code for task#78661. --- module/tree/control.php | 8 ++++++++ module/tree/view/edit.html.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/module/tree/control.php b/module/tree/control.php index 90280d30ea..9de9df00ab 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -536,6 +536,14 @@ class tree extends control { $optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch); } + + if(strpos($extra, 'excludeModuleID') !== false) + { + parse_str($extra, $output); + $excludeModuleID = $output['excludeModuleID']; + if(isset($optionMenu[$excludeModuleID])) unset($optionMenu[$excludeModuleID]); + } + if($returnType == 'html') { //Code for task #5081. diff --git a/module/tree/view/edit.html.php b/module/tree/view/edit.html.php index 861740098a..233893d74e 100644 --- a/module/tree/view/edit.html.php +++ b/module/tree/view/edit.html.php @@ -189,7 +189,7 @@ function loadModules(branch) if(typeof(branchID) == 'undefined') branchID = 0; if(typeof(moduleID) == 'undefined') moduleID = 0; - link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=¤tModuleID=' + moduleID); + link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=excludeModuleID=' + id;?> + '¤tModuleID=' + moduleID); $(moduleBox).load(link, function() { $(this).children('select').attr('id', 'parent').attr('name', 'parent'); From ec6f263bd3c926624f35558ae1d221ba036c9075 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Wed, 7 Dec 2022 21:42:59 +0800 Subject: [PATCH 06/63] * Code for task#78661. --- module/tree/control.php | 7 ++++--- module/tree/model.php | 5 ++++- module/tree/view/edit.html.php | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/module/tree/control.php b/module/tree/control.php index 9de9df00ab..dc5c7d5285 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -390,7 +390,7 @@ class tree extends control } else { - $this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch); + $this->view->optionMenu = $this->tree->getOptionMenu($module->root, $module->type, 0, $module->branch, 'noMainBranch'); } if($type == 'doc') $this->view->libs = $this->loadModel('doc')->getLibs('all', $extra = 'withObject', '', 0, 'book'); @@ -534,12 +534,13 @@ class tree extends control } else { - $optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch); + $optionMenu = $this->tree->getOptionMenu($rootID, $viewType, $rootModuleID, $branch, $extra); } if(strpos($extra, 'excludeModuleID') !== false) { - parse_str($extra, $output); + list($excludeModule, $noMainBranch) = explode(',', $extra); + parse_str($excludeModule, $output); $excludeModuleID = $output['excludeModuleID']; if(isset($optionMenu[$excludeModuleID])) unset($optionMenu[$excludeModuleID]); } diff --git a/module/tree/model.php b/module/tree/model.php index c84f818e66..c026a3aec2 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -109,11 +109,14 @@ class treeModel extends model ->andWhere('type')->in($type) ->beginIF($grade)->andWhere('grade')->le($grade)->fi() ->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi() - ->beginIF($branch !== 'all' and $branch !== '' and $branch !== false) + ->beginIF($branch !== 'all' and $branch !== '' and $branch !== false and strpos($param, 'noMainBranch') === false) ->andWhere('(branch')->eq(0) ->orWhere('branch')->eq($branch) ->markRight(1) ->fi() + ->beginIF($branch !== 'all' and $branch !== '' and $branch !== false and strpos($param, 'noMainBranch') !== false) + ->andWhere('branch')->eq($branch) + ->fi() ->beginIF(strpos($param, 'nodeleted') !== false)->andWhere('deleted')->eq(0)->fi() ->orderBy('grade desc, `order`') ->get(); diff --git a/module/tree/view/edit.html.php b/module/tree/view/edit.html.php index 233893d74e..09e8713b54 100644 --- a/module/tree/view/edit.html.php +++ b/module/tree/view/edit.html.php @@ -189,7 +189,7 @@ function loadModules(branch) if(typeof(branchID) == 'undefined') branchID = 0; if(typeof(moduleID) == 'undefined') moduleID = 0; - link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=excludeModuleID=' + id;?> + '¤tModuleID=' + moduleID); + link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=' + branchID + '&rootModuleID=0&returnType=html&fieldID=&needManage=true&extra=excludeModuleID=' + id;?> + ',noMainBranch¤tModuleID=' + moduleID); $(moduleBox).load(link, function() { $(this).children('select').attr('id', 'parent').attr('name', 'parent'); From 3e18aa302a8210edc894048573354c4eb9fec615 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 09:16:17 +0800 Subject: [PATCH 07/63] * fix bug #30584. --- module/build/css/view.css | 1 + module/build/view/view.html.php | 6 +++--- module/project/control.php | 5 ++++- module/projectrelease/css/view.css | 1 + module/projectrelease/view/view.html.php | 6 +++--- module/release/css/view.css | 1 + module/release/view/view.html.php | 6 +++--- 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/module/build/css/view.css b/module/build/css/view.css index 3f124385b5..0789a2c0c3 100644 --- a/module/build/css/view.css +++ b/module/build/css/view.css @@ -6,3 +6,4 @@ .body-modal #mainContent {min-height: 200px;} td.article-content{overflow:auto !important;} +td.c-build{white-space: nowrap; overflow:hidden;} diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index abdf3700b4..dfdcb00dbf 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -148,7 +148,7 @@ tbody tr td:first-child input {display: none;} ?> - + openedBy);?> estimate . $config->hourUnit;?> @@ -254,7 +254,7 @@ tbody tr td:first-child input {display: none;} - + openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> @@ -343,7 +343,7 @@ tbody tr td:first-child input {display: none;} $openedBuilds = ''; foreach(explode(',', $bug->openedBuild) as $buildID) $openedBuilds .= ($buildID == 'trunk' ? 'Trunk' : zget($buildPairs, $buildID, '')) . ' '; ?> - + openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> resolvedBy);?> diff --git a/module/project/control.php b/module/project/control.php index 11669e7579..3bdd635c89 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -1466,7 +1466,10 @@ class project extends control { $showBranch = true; $branchPairs = $branchGroups[$build->product]; - foreach(explode(',', trim($build->branch, ',')) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; + foreach(explode(',', trim($build->branch, ',')) as $branchID) + { + if(isset($branchPairs[$branchID])) $build->branchName .= "{$branchPairs[$branchID]},"; + } $build->branchName = trim($build->branchName, ','); } } diff --git a/module/projectrelease/css/view.css b/module/projectrelease/css/view.css index 5be75906d4..a35a23f770 100644 --- a/module/projectrelease/css/view.css +++ b/module/projectrelease/css/view.css @@ -9,3 +9,4 @@ #tabsNav .nav-tabs > li.active + li.pull-right {margin-right: 0;} ol, ul {padding-left: 20px;} .c-id {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} +td.c-build{white-space: nowrap; overflow:hidden;} diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index 12b816fe23..6c1854caac 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -99,7 +99,7 @@ echo html::a($storyLink,$story->title, '', "class='preview'"); ?> - buildName?> + buildName?> openedBy);?> estimate . $config->hourUnit;?> @@ -195,7 +195,7 @@ processStatus('bug', $bug);?> resolvedBuild, '');?> - + openedBy);?> openedDate) ? '' : substr($bug->openedDate, 5, 11);?> resolvedBy);?> @@ -305,7 +305,7 @@ $openedBuildName = ''; foreach(explode(',', $bug->openedBuild) as $buildID) $openedBuildName .= zget($builds, $buildID, '') . ' '; ?> - + openedBy);?> openedDate?> diff --git a/module/release/css/view.css b/module/release/css/view.css index c750db6903..acc96a13fd 100644 --- a/module/release/css/view.css +++ b/module/release/css/view.css @@ -10,3 +10,4 @@ ol, ul {padding-left: 20px;} .body-modal #mainContent {min-height: 240px;} .c-id {width: 110px;} +td.c-build{white-space: nowrap; overflow:hidden;} diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 59862c8d8d..80e65b07f0 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -101,7 +101,7 @@ echo html::a($storyLink,$story->title, '', "class='preview'"); ?> - buildName?> + buildName?> openedBy);?> estimate . $config->hourUnit;?> @@ -197,7 +197,7 @@ processStatus('bug', $bug);?> resolvedBuild, '');?> - + openedBy);?> openedDate, 5, 11)?> resolvedBy);?> @@ -307,7 +307,7 @@ $openedBuildName = ''; foreach(explode(',', $bug->openedBuild) as $buildID) $openedBuildName .= zget($builds, $buildID, '') . ' '; ?> - + openedBy);?> openedDate?> From 44c075b0aedebd804e8c23eafdc8190cdb366524 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 09:50:30 +0800 Subject: [PATCH 08/63] * Fix bug#30613. --- module/execution/control.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/execution/control.php b/module/execution/control.php index 852ff8a755..1c1768fb15 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1312,7 +1312,10 @@ class execution extends control { $showBranch = true; $branchPairs = $branchGroups[$build->product]; - foreach(explode(',', trim($build->branch, ',')) as $branchID) $build->branchName .= "{$branchPairs[$branchID]},"; + foreach(explode(',', trim($build->branch, ',')) as $branchID) + { + if(isset($branchPairs[$branchID])) $build->branchName .= "{$branchPairs[$branchID]},"; + } $build->branchName = trim($build->branchName, ','); } } From e4b9ef4536748336201f1f781c3a7490ea1a664f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 09:56:31 +0800 Subject: [PATCH 09/63] * fix bug #30585. --- module/build/control.php | 2 +- module/build/model.php | 2 ++ module/testtask/control.php | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 021f442967..f351795698 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -428,7 +428,7 @@ class build extends control return print(html::select($varName, $builds, $build, "class='form-control'")); } - $builds = $this->build->getBuildPairs($productID, $branch, $type, 0, 'project', $build); + $builds = $this->build->getBuildPairs($productID, $branch, $type, 0, 'project', $build, false); if(strpos($extra, 'multiple') !== false) $varName .= '[]'; if($isJsonView) return print(json_encode($builds)); return print(html::select($varName, $builds, $build, "class='form-control chosen' $extra")); diff --git a/module/build/model.php b/module/build/model.php index 6f2f11d422..ad3e227710 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -256,6 +256,7 @@ class buildModel extends model ->fetchPairs(); } + $shadows = $this->dao->select('shadow')->from(TABLE_RELEASE)->where('product')->in($products)->fetchPairs('shadow', 'shadow'); $branchs = strpos($params, 'separate') === false ? "0,$branch" : $branch; $allBuilds = $this->dao->select('t1.id, t1.name, t1.execution, t1.date, t1.deleted, t2.status as objectStatus, t3.id as releaseID, t3.status as releaseStatus, t4.name as branchName, t5.type as productType')->from(TABLE_BUILD)->alias('t1') ->beginIF($objectType === 'execution')->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')->fi() @@ -264,6 +265,7 @@ class buildModel extends model ->leftJoin(TABLE_BRANCH)->alias('t4')->on('t1.branch = t4.id') ->leftJoin(TABLE_PRODUCT)->alias('t5')->on('t1.product = t5.id') ->where('1=1') + ->andWhere('t1.id')->notIN($shadows) ->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('t1.deleted')->eq(0)->fi() ->beginIF(strpos($params, 'hasproject') !== false)->andWhere('t1.project')->ne(0)->fi() ->beginIF(strpos($params, 'singled') !== false)->andWhere('t1.execution')->ne(0)->fi() diff --git a/module/testtask/control.php b/module/testtask/control.php index c3d4a34b99..58129d9a6d 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -250,7 +250,7 @@ class testtask extends control /* Create testtask from testtask of test.*/ $productID = $productID ? $productID : key($this->products); $executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID, 'stagefilter'); - $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withexecution', $projectID, 'project'); + $builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withexecution', $projectID, 'project', '', false); $execution = $this->loadModel('execution')->getByID($executionID); if(!empty($execution) and $execution->type == 'kanban') $this->lang->testtask->execution = str_replace($this->lang->execution->common, $this->lang->kanban->common, $this->lang->testtask->execution); @@ -816,11 +816,11 @@ class testtask extends control $executions[$executionID] = $project->name . "({$this->lang->project->disableExecution})"; } } - $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $executionID, 'execution'); + $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $executionID, 'execution', $task->build, false); } else { - $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $task->project, 'project'); + $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk,withexecution', $task->project, 'project', $task->build, false); } $this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit; From 80af5ddba5681fded59153d4cf5b17e7b2b993af Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 10:06:46 +0800 Subject: [PATCH 10/63] * Finish task#78690. --- module/productplan/control.php | 2 +- module/story/control.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index 486c675848..bf60aab4f2 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -605,7 +605,7 @@ class productplan extends control */ public function ajaxGetProductplans($productID, $branch = 0, $number = '', $expired = '') { - $plans = $this->productplan->getPairs($productID, $branch, $expired, true); + $plans = $this->productplan->getPairs($productID, empty($branch) ? '' : $branch, $expired, true); $planName = $number === '' ? 'plan' : "plan[$number]"; $plans = empty($plans) ? array('' => '') : $plans; echo html::select($planName, $plans, '', "class='form-control'"); diff --git a/module/story/control.php b/module/story/control.php index 2bc3434095..6b869ad089 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -691,7 +691,7 @@ class story extends control } $this->view->titles = $titles; } - $plans = $this->loadModel('productplan')->getPairsForStory($productID, ($branch === 'all' or !in_array($branch, array_keys($branches))) ? 0 : $branch, 'skipParent|unexpired|noclosed'); + $plans = $this->loadModel('productplan')->getPairsForStory($productID, ($branch === 'all' or empty($branch)) ? '' : $branch, 'skipParent|unexpired|noclosed'); $plans['ditto'] = $this->lang->story->ditto; $priList = (array)$this->lang->story->priList; From 8472e0a1914966474412aaeb2d6b45f4ee076824 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 10:34:46 +0800 Subject: [PATCH 11/63] * Finish task#78699. --- module/productplan/css/browse.css | 5 +++-- module/productplan/lang/de.php | 1 - module/productplan/lang/en.php | 1 - module/productplan/lang/fr.php | 1 - module/productplan/lang/zh-cn.php | 3 +-- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/module/productplan/css/browse.css b/module/productplan/css/browse.css index 8a0fe5b64d..ae54b036db 100644 --- a/module/productplan/css/browse.css +++ b/module/productplan/css/browse.css @@ -17,11 +17,12 @@ td.c-branch {overflow: hidden; text-align: left !important; white-space: nowrap; @-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;};} .c-title {width: 160px;} -.c-branch {width: 100px;} +.c-branch {width: 130px;} .c-story, .c-status {width: 80px;} .c-execution {width: 60px !important;} .c-bug, .c-hour {width: 60px;} -.c-desc {width: 160px;} +.c-desc {width: 140px;} +.c-date {width: 90px;} .plan-name {position: relative; display: flex; align-items: center;} .plan-name > span {flex: none;} diff --git a/module/productplan/lang/de.php b/module/productplan/lang/de.php index ac56c0aeec..e418f42088 100644 --- a/module/productplan/lang/de.php +++ b/module/productplan/lang/de.php @@ -100,7 +100,6 @@ $lang->productplan->childrenAB = "C"; $lang->productplan->order = "Rank"; $lang->productplan->deleted = "Deleted"; $lang->productplan->mailto = "Mailto"; -$lang->productplan->status = 'Status'; $lang->productplan->planStatus = "Status"; $lang->productplan->statusList['wait'] = 'Wait'; diff --git a/module/productplan/lang/en.php b/module/productplan/lang/en.php index 49a6bf5bd1..86a0808f04 100644 --- a/module/productplan/lang/en.php +++ b/module/productplan/lang/en.php @@ -100,7 +100,6 @@ $lang->productplan->childrenAB = "C"; $lang->productplan->order = "Order"; $lang->productplan->deleted = "Deleted"; $lang->productplan->mailto = "Mailto"; -$lang->productplan->status = "Plan Status"; $lang->productplan->planStatus = "Status"; $lang->productplan->statusList['wait'] = 'Wait'; diff --git a/module/productplan/lang/fr.php b/module/productplan/lang/fr.php index 5fd88247f3..ad1e414469 100644 --- a/module/productplan/lang/fr.php +++ b/module/productplan/lang/fr.php @@ -100,7 +100,6 @@ $lang->productplan->childrenAB = "C"; $lang->productplan->order = "Order"; $lang->productplan->deleted = "Deleted"; $lang->productplan->mailto = "Mailto"; -$lang->productplan->status = 'Status'; $lang->productplan->planStatus = "Status"; $lang->productplan->statusList['wait'] = 'Wait'; diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php index f756060d8e..aee350b57a 100644 --- a/module/productplan/lang/zh-cn.php +++ b/module/productplan/lang/zh-cn.php @@ -86,7 +86,7 @@ $lang->productplan->title = '名称'; $lang->productplan->desc = '描述'; $lang->productplan->begin = '开始日期'; $lang->productplan->end = '结束日期'; -$lang->productplan->status = '计划状态'; +$lang->productplan->status = '状态'; $lang->productplan->last = "上次计划"; $lang->productplan->future = '待定'; $lang->productplan->stories = "{$lang->SRCommon}数"; @@ -100,7 +100,6 @@ $lang->productplan->childrenAB = "子"; $lang->productplan->order = "排序"; $lang->productplan->deleted = "已删除"; $lang->productplan->mailto = "抄送给"; -$lang->productplan->status = "计划状态"; $lang->productplan->planStatus = "状态"; $lang->productplan->statusList['wait'] = '未开始'; From 847bb6be13be6798e3d842510a3fe87619db61b3 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 10:46:58 +0800 Subject: [PATCH 12/63] * Finish task#78698. --- module/productplan/view/view.html.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 47cf7f6a8a..4c91630e9c 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -31,9 +31,6 @@
id;?> title;?> - - type !== 'normal') echo "" . $branchOption[$branchID] . '';?> - begin == $config->productplan->future || $plan->end == $config->productplan->future) ? $lang->productplan->future : $plan->begin . '~' . $plan->end;?> From b7dfd47433959012ca0abde1884a87b754fb919b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 11:04:55 +0800 Subject: [PATCH 13/63] * fix bug. --- lib/pager/pager.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pager/pager.class.php b/lib/pager/pager.class.php index 0d0b016fa9..a3cfd2f4ba 100644 --- a/lib/pager/pager.class.php +++ b/lib/pager/pager.class.php @@ -130,7 +130,11 @@ class pager extends basePager } } - echo "
    "; + global $app, $lang; + $appendApp = ''; + $moduleName = $this->moduleName; + if(isset($lang->navGroup->{$moduleName}) and $lang->navGroup->{$moduleName} != $app->tab) $appendApp = "#app={$app->tab}"; + echo "
      "; } } else From d6f9976aaec0752a6c48e0ceb989be519ff2b14b Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 11:06:04 +0800 Subject: [PATCH 14/63] * Finish Bug #30480 --- module/product/control.php | 2 +- module/productplan/model.php | 20 ++++++++++++++++++++ module/project/control.php | 15 +++++++++++++-- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index f4bcefe82b..368b71b08b 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -356,7 +356,7 @@ class product extends control $this->view->productName = $productName; $this->view->moduleID = $moduleID; $this->view->stories = $stories; - $this->view->plans = $this->loadModel('productplan')->getPairs($productID, ($branch === 'all' or empty($branch)) ? '' : $branch, 'unexpired', true); + $this->view->plans = $this->loadModel('productplan')->getPairs($productID, ($branch === 'all' or empty($branch)) ? '' : $branch, 'unexpired,noclosed', true); $this->view->productPlans = isset($productPlans) ? array(0 => '') + $productPlans : array(); $this->view->summary = $this->product->summary($stories, $storyType); $this->view->moduleTree = $moduleTree; diff --git a/module/productplan/model.php b/module/productplan/model.php index 74d0f09a85..04bfe7f712 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -1355,4 +1355,24 @@ class productplanModel extends model if(!empty($unlinkBugs)) $this->dao->update(TABLE_BUG)->set('plan')->eq(0)->where('plan')->eq($plan->parent)->andWhere('id')->in($unlinkBugs)->exec(); $this->dao->update(TABLE_BUG)->set('plan')->eq($plan->id)->where('plan')->eq($plan->parent)->exec(); } + + /** + * Get plan list by ids. + * + * @param array $planIds + * @param boo $order + * @access public + * @return array + */ + public function getListByIds($planIds, $order = false) + { + $plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN) + ->where('id')->in($planIds) + ->orderBy('begin desc') + ->fetchAll('id'); + + if($order) $plans = $this->relationBranch($plans); + + return $plans; + } } diff --git a/module/project/control.php b/module/project/control.php index 11669e7579..3182e042dd 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -739,7 +739,7 @@ class project extends control { $linkedBranchList[$branchID] = $branchID; - if($branch != BRANCH_MAIN) $productPlans[$productID] = isset($plans[$productID][BRANCH_MAIN]) ? $plans[$productID][BRANCH_MAIN] : array(); + if(!isset($productPlans[$productID])) $productPlans[$productID] = isset($plans[$productID][BRANCH_MAIN]) ? $plans[$productID][BRANCH_MAIN] : array(); $productPlans[$productID] += isset($plans[$productID][$branchID]) ? $plans[$productID][$branchID] : array(); if(!empty($projectStories[$productID][$branchID]) or !empty($projectBranches[$productID][$branchID])) @@ -751,6 +751,17 @@ class project extends control } } + $productPlansOrder = array(); + foreach($productPlans as $productID => $plan) + { + $orderPlans = $this->loadModel('productPlan')->getListByIds(array_keys($plan)); + $orderPlansMap = array_keys($orderPlans); + foreach($orderPlansMap as $planMapID) + { + $productPlansOrder[$productID][$planMapID] = $productPlans[$productID][$planMapID]; + } + } + if($project->model != 'kanban') $canChangeModel = $this->project->checkCanChangeModel($projectID, $project->model); $this->view->title = $this->lang->project->edit; @@ -764,7 +775,7 @@ class project extends control $this->view->projectID = $projectID; $this->view->allProducts = array('0' => '') + $allProducts; $this->view->multiBranchProducts = $this->loadModel('product')->getMultiBranchPairs(); - $this->view->productPlans = array_filter($productPlans); + $this->view->productPlans = array_filter($productPlansOrder); $this->view->linkedProducts = $linkedProducts; $this->view->branches = $branches; $this->view->executions = $this->execution->getPairs($projectID); From 6b61f14d936eac6ec0c3c1d489a8a1ba3b306bc9 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 11:19:14 +0800 Subject: [PATCH 15/63] * Fix bug#30588. --- module/projectrelease/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index e937c2b2f0..f3f4b04e82 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -133,7 +133,7 @@ class projectrelease extends control $this->commonAction($projectID); /* Get the builds that can select. */ - $builds = $this->build->getBuildPairs($this->view->product->id, $this->view->branch, 'notrunk|withbranch|hasproject', $projectID, 'project', '', false); + $builds = $this->build->getBuildPairs($this->view->product->id, 'all', 'notrunk|withbranch|hasproject', $projectID, 'project', '', false); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); From ce8a83998c70b89a2395ae16e697f90b0093e4fc Mon Sep 17 00:00:00 2001 From: Wenrui LI Date: Thu, 8 Dec 2022 11:38:04 +0800 Subject: [PATCH 16/63] * fix zentaobot paging and command concatenation. --- .../extension/xuan/im/ext/bot/zentao.bot.php | 23 +++++++++++-------- .../xuan/im/ext/lang/de/xuanxuan.php | 8 +++---- .../xuan/im/ext/lang/en/xuanxuan.php | 8 +++---- .../xuan/im/ext/lang/fr/xuanxuan.php | 8 +++---- .../xuan/im/ext/lang/zh-cn/xuanxuan.php | 8 +++---- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php b/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php index c8b8d27cad..ff55942fa0 100644 --- a/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php +++ b/xuanxuan/extension/xuan/im/ext/bot/zentao.bot.php @@ -360,17 +360,22 @@ class zentaoBot extends xuanBot $conds = $this->parseArguments($args, $keys); $conds->search = 1; $conds->order = 'status_asc'; + $conds->limit = 10; + + if(is_object($pager)) + { + $conds->page = $pager->pageID; + $conds->limit = $pager->recPerPage; + } $result = $this->loadEntry('tasks', 'get', array(), (array)$conds); if(isset($result->tasks)) { - /* Update pager with result. */ $pager->setRecTotal($result->total); $pager->setRecPerPage($result->limit); $pager->setPageID($result->page); $pager->setPageTotal(); - return $result->tasks; } @@ -459,7 +464,7 @@ class zentaoBot extends xuanBot if(empty($params)) { - $originCommand = rawurlencode($this->lang->finishTask . ' ' . implode(' ', $originArgs)); + $originCommand = rawurlencode($this->lang->finishCommand . ' ' . implode(' ', $originArgs)); $json = (object)array ( @@ -609,7 +614,7 @@ class zentaoBot extends xuanBot $taskTable = $this->renderTaskTable($tasks); - $originCommand = $this->lang->viewTask . ' ' . implode(' ', $originArgs); + $originCommand = $this->lang->viewCommand . ' ' . implode(' ', $originArgs); $paging = "$pager->pageID / $pager->pageTotal"; if($pager->pageID != 1) { @@ -682,13 +687,13 @@ class zentaoBot extends xuanBot } else { - $tr .= "{$this->users[$task->$key]}"; + $tr .= "{$task->assignedTo->realname}"; } break; case 'actions': - $startUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->startTask} #$task->id"; - $finishUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->finishTask} #$task->id"; - $closeUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->closeTask} #$task->id"; + $startUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->startCommand} #$task->id"; + $finishUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->finishCommand} #$task->id"; + $closeUrl = 'xxc://sendContentToServerBySendbox/' . "{$this->lang->closeCommand} #$task->id"; $canStart = in_array($task->status, array('wait', 'pause')); $canFinish = in_array($task->status, array('wait', 'pause', 'doing')); @@ -777,7 +782,7 @@ class zentaoBot extends xuanBot if(count($args) == 0) { - $originCommand = rawurlencode($this->lang->startTask . ' ' . implode(' ', $originArgs)); + $originCommand = rawurlencode($this->lang->startCommand . ' ' . implode(' ', $originArgs)); $realStarted = $this->formatDate($task, 'realStarted'); diff --git a/xuanxuan/extension/xuan/im/ext/lang/de/xuanxuan.php b/xuanxuan/extension/xuan/im/ext/lang/de/xuanxuan.php index c2285839a0..b93b31219f 100644 --- a/xuanxuan/extension/xuan/im/ext/lang/de/xuanxuan.php +++ b/xuanxuan/extension/xuan/im/ext/lang/de/xuanxuan.php @@ -73,10 +73,10 @@ $lang->im->bot->zentaoBot->prevPage = 'Prev Page'; $lang->im->bot->zentaoBot->nextPage = 'Next Page'; $lang->im->bot->zentaoBot->effortRecorded = 'Effort recorded for task #%d.'; -$lang->im->bot->zentaoBot->finishTask = 'finish'; -$lang->im->bot->zentaoBot->closeTask = 'close'; -$lang->im->bot->zentaoBot->startTask = 'start'; -$lang->im->bot->zentaoBot->viewTask = 'view'; +$lang->im->bot->zentaoBot->finishCommand = 'finish'; +$lang->im->bot->zentaoBot->closeCommand = 'close'; +$lang->im->bot->zentaoBot->startCommand = 'start'; +$lang->im->bot->zentaoBot->viewCommand = 'view'; $lang->im->bot->zentaoBot->errors = new stdclass(); $lang->im->bot->zentaoBot->errors->emptyResult = 'No task found.'; diff --git a/xuanxuan/extension/xuan/im/ext/lang/en/xuanxuan.php b/xuanxuan/extension/xuan/im/ext/lang/en/xuanxuan.php index c2285839a0..b93b31219f 100644 --- a/xuanxuan/extension/xuan/im/ext/lang/en/xuanxuan.php +++ b/xuanxuan/extension/xuan/im/ext/lang/en/xuanxuan.php @@ -73,10 +73,10 @@ $lang->im->bot->zentaoBot->prevPage = 'Prev Page'; $lang->im->bot->zentaoBot->nextPage = 'Next Page'; $lang->im->bot->zentaoBot->effortRecorded = 'Effort recorded for task #%d.'; -$lang->im->bot->zentaoBot->finishTask = 'finish'; -$lang->im->bot->zentaoBot->closeTask = 'close'; -$lang->im->bot->zentaoBot->startTask = 'start'; -$lang->im->bot->zentaoBot->viewTask = 'view'; +$lang->im->bot->zentaoBot->finishCommand = 'finish'; +$lang->im->bot->zentaoBot->closeCommand = 'close'; +$lang->im->bot->zentaoBot->startCommand = 'start'; +$lang->im->bot->zentaoBot->viewCommand = 'view'; $lang->im->bot->zentaoBot->errors = new stdclass(); $lang->im->bot->zentaoBot->errors->emptyResult = 'No task found.'; diff --git a/xuanxuan/extension/xuan/im/ext/lang/fr/xuanxuan.php b/xuanxuan/extension/xuan/im/ext/lang/fr/xuanxuan.php index c2285839a0..b93b31219f 100644 --- a/xuanxuan/extension/xuan/im/ext/lang/fr/xuanxuan.php +++ b/xuanxuan/extension/xuan/im/ext/lang/fr/xuanxuan.php @@ -73,10 +73,10 @@ $lang->im->bot->zentaoBot->prevPage = 'Prev Page'; $lang->im->bot->zentaoBot->nextPage = 'Next Page'; $lang->im->bot->zentaoBot->effortRecorded = 'Effort recorded for task #%d.'; -$lang->im->bot->zentaoBot->finishTask = 'finish'; -$lang->im->bot->zentaoBot->closeTask = 'close'; -$lang->im->bot->zentaoBot->startTask = 'start'; -$lang->im->bot->zentaoBot->viewTask = 'view'; +$lang->im->bot->zentaoBot->finishCommand = 'finish'; +$lang->im->bot->zentaoBot->closeCommand = 'close'; +$lang->im->bot->zentaoBot->startCommand = 'start'; +$lang->im->bot->zentaoBot->viewCommand = 'view'; $lang->im->bot->zentaoBot->errors = new stdclass(); $lang->im->bot->zentaoBot->errors->emptyResult = 'No task found.'; diff --git a/xuanxuan/extension/xuan/im/ext/lang/zh-cn/xuanxuan.php b/xuanxuan/extension/xuan/im/ext/lang/zh-cn/xuanxuan.php index f7ff79a914..b827753ce5 100644 --- a/xuanxuan/extension/xuan/im/ext/lang/zh-cn/xuanxuan.php +++ b/xuanxuan/extension/xuan/im/ext/lang/zh-cn/xuanxuan.php @@ -81,10 +81,10 @@ $lang->im->bot->zentaoBot->prevPage = '上一页'; $lang->im->bot->zentaoBot->nextPage = '下一页'; $lang->im->bot->zentaoBot->effortRecorded = '任务 #%d 已完成工时信息填写'; -$lang->im->bot->zentaoBot->finishTask = '完成任务'; -$lang->im->bot->zentaoBot->closeTask = '关闭任务'; -$lang->im->bot->zentaoBot->startTask = '开始任务'; -$lang->im->bot->zentaoBot->viewTask = '查看任务'; +$lang->im->bot->zentaoBot->finishCommand = '完成'; +$lang->im->bot->zentaoBot->closeCommand = '关闭'; +$lang->im->bot->zentaoBot->startCommand = '开始'; +$lang->im->bot->zentaoBot->viewCommand = '查看'; $lang->im->bot->zentaoBot->errors = new stdclass(); $lang->im->bot->zentaoBot->errors->emptyResult = '未查询到相关匹配信息'; From c4c0fe72719e1db125d7567a0b989735fafacbfa Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 12:18:55 +0800 Subject: [PATCH 17/63] * Fix bug#30550,#30607. --- module/productplan/control.php | 2 +- module/productplan/view/batchedit.html.php | 2 +- module/productplan/view/create.html.php | 2 +- module/productplan/view/edit.html.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/productplan/control.php b/module/productplan/control.php index bf60aab4f2..6f7fa1bdce 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -1034,7 +1034,7 @@ class productplan extends control if(!empty($currentBranches) and strpos(",$currentBranches,", ",$parentBranchID,") === false) $currentBranches = str_replace(",$parentBranchID,", ',', $currentBranches); } } - return print(html::select('branch[]', empty($parentID) ? $branchPairs : $parentBranches, trim($currentBranches, ','), "class='form-control chosen' multiple required")); + return print(html::select('branch[]', empty($parentID) ? $branchPairs : $parentBranches, trim($currentBranches, ','), "class='form-control chosen' multiple")); } /** diff --git a/module/productplan/view/batchedit.html.php b/module/productplan/view/batchedit.html.php index c9823725b0..5ce19034f2 100644 --- a/module/productplan/view/batchedit.html.php +++ b/module/productplan/view/batchedit.html.php @@ -23,7 +23,7 @@ productplan->id?> type != 'normal'):?> - product->branch;?> + product->branch;?> productplan->title?> productplan->status?> diff --git a/module/productplan/view/create.html.php b/module/productplan/view/create.html.php index c0534d69fc..4e298be29d 100644 --- a/module/productplan/view/create.html.php +++ b/module/productplan/view/create.html.php @@ -55,7 +55,7 @@ } } ?> - + diff --git a/module/productplan/view/edit.html.php b/module/productplan/view/edit.html.php index cf8f677dc1..81ffe5e5b2 100644 --- a/module/productplan/view/edit.html.php +++ b/module/productplan/view/edit.html.php @@ -43,7 +43,7 @@ shadow and $product->type != 'normal' and $plan->parent != '-1'):?> product->branch;?> - branch, "class='form-control chosen' multiple");?> + branch, "class='form-control chosen' multiple");?> From a7b96c881a01b0c800366c359725b7cc802b842d Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 12:36:50 +0800 Subject: [PATCH 18/63] * Fix bug#30644. --- module/story/control.php | 1 + module/story/model.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/module/story/control.php b/module/story/control.php index 6b869ad089..4e4dc56dcc 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1074,6 +1074,7 @@ class story extends control $modules = array(); $branchTagOption = array(); $products = array(); + $plans = array(); /* Get product id list by the stories. */ $productIdList = array(); diff --git a/module/story/model.php b/module/story/model.php index 69e29a5af4..8303cf05e7 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -5068,6 +5068,11 @@ class storyModel extends model $title = isset($story->planTitle) ? $story->planTitle : ''; $class .= ' text-ellipsis'; } + elseif($id == 'branch') + { + $title = zget($branches, $story->branch, ''); + $class .= ' text-ellipsis'; + } elseif($id == 'sourceNote') { $title = $story->sourceNote; From fd0b180d7128d03b8a58fd634829f68d93fb3485 Mon Sep 17 00:00:00 2001 From: Yagami Date: Thu, 8 Dec 2022 13:15:48 +0800 Subject: [PATCH 19/63] * Finish task #78676. --- module/product/model.php | 16 ++++++++++++++-- module/projectrelease/model.php | 17 +++-------------- module/projectrelease/view/view.html.php | 8 +++++++- module/release/model.php | 18 ++++-------------- module/release/view/view.html.php | 8 +++++++- 5 files changed, 35 insertions(+), 32 deletions(-) diff --git a/module/product/model.php b/module/product/model.php index 8523500b68..a541abf5b6 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1578,7 +1578,13 @@ class productModel extends model if($plan->parent > 0 and isset($parents[$plan->parent])) $plan->title = $parents[$plan->parent] . ' / ' . $plan->title; $year = substr($plan->end, 0, 4); - $roadmap[$year][$plan->branch][] = $plan; + $branchIdList = explode(',', trim($plan->branch, ',')); + $branchIdList = array_unique($branchIdList); + foreach($branchIdList as $branchID) + { + if($branchID === '') continue; + $roadmap[$year][$branchID][] = $plan; + } $total++; if($count > 0 and $total >= $count) return $this->processRoadmap($roadmap); @@ -1595,7 +1601,13 @@ class productModel extends model foreach($releases as $release) { $year = substr($release->date, 0, 4); - $roadmap[$year][$release->branch][] = $release; + $branchIdList = explode(',', trim($release->branch, ',')); + $branchIdList = array_unique($branchIdList); + foreach($branchIdList as $branchID) + { + if($branchID === '') continue; + $roadmap[$year][$branchID][] = $release; + } $total++; if($count > 0 and $total >= $count) return $this->processRoadmap($roadmap); diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index 0b164aac46..259f1ad772 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -35,20 +35,9 @@ class projectreleaseModel extends model $release->branch = trim($release->branch, ','); $release->build = trim($release->build, ','); - $builds = $this->dao->select('id, branch, filePath, scmPath, name, execution, project')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); - - /* Get release's branches by build. */ - $branches = array(); - if($release->productType != 'normal') - { - foreach($builds as $build) - { - $branchIdList = explode(',', $build->branch); - foreach($branchIdList as $branchID) $branches[$branchID] = $branchID; - } - } - - $release->branches = $branches; + $release->branches = array(); + $branchIdList = explode(',', $release->branch); + foreach($branchIdList as $branchID) $release->branches[$branchID] = $branchID; $this->loadModel('file'); $release = $this->file->replaceImgURL($release, 'desc'); diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index 12b816fe23..3704ad1e82 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -377,7 +377,13 @@ release->branch;?> - branches as $branchID) echo zget($branches, $branchID, '') . ' ';?> + branches as $branchID) + { + echo zget($branches, $branchID, ''); + if($branchID != end($release->branches)) echo ', '; + } + ?> diff --git a/module/release/model.php b/module/release/model.php index a9b075ac89..ea1e215de2 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -31,21 +31,11 @@ class releaseModel extends model ->fetch(); if(!$release) return false; - $builds = $this->dao->select('id, branch, filePath, scmPath, name, execution, project')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + $release->builds = $this->dao->select('id, branch, filePath, scmPath, name, execution, project')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); - /* Get release's branches by build. */ - $branches = array(); - if($release->productType != 'normal') - { - foreach($builds as $build) - { - $branchIdList = explode(',', $build->branch); - foreach($branchIdList as $branchID) $branches[$branchID] = $branchID; - } - } - - $release->builds = $builds; - $release->branches = $branches; + $release->branches = array(); + $branchIdList = explode(',', trim($release->branch, ',')); + foreach($branchIdList as $branchID) $release->branches[$branchID] = $branchID; $this->loadModel('file'); $release = $this->file->replaceImgURL($release, 'desc'); diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index 59862c8d8d..d63b2db7d0 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -382,7 +382,13 @@ release->branch;?> - branches as $branchID) echo zget($branches, $branchID, '') . ' ';?> + branches as $branchID) + { + echo zget($branches, $branchID, ''); + if($branchID != end($release->branches)) echo ', '; + } + ?> From 6038b69ea4b23f8ed7cda3a24239db43c36843e3 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 13:31:00 +0800 Subject: [PATCH 20/63] * Fix bug#30651. --- module/project/control.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/project/control.php b/module/project/control.php index 3bdd635c89..66c27f9ae7 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -1471,6 +1471,8 @@ class project extends control if(isset($branchPairs[$branchID])) $build->branchName .= "{$branchPairs[$branchID]},"; } $build->branchName = trim($build->branchName, ','); + + if(empty($build->branchName) and empty($build->builds)) $build->branchName = $this->lang->branch->main; } } } From 8a3d6c4dcd758a4035030b0c198bda0326fa99b6 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 13:41:57 +0800 Subject: [PATCH 21/63] * fix bug #30665. --- module/my/model.php | 6 +++--- module/my/view/audit.html.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/my/model.php b/module/my/model.php index cc02ea712e..af7dd39e3b 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -1038,7 +1038,7 @@ class myModel extends model if($browseType == 'all' or $browseType == 'project') $reviewList = array_merge($reviewList, $this->getReviewingApprovals()); if($browseType == 'all' or $browseType == 'feedback') $reviewList = array_merge($reviewList, $this->getReviewingFeedbacks()); if($browseType == 'all' or $browseType == 'oa') $reviewList = array_merge($reviewList, $this->getReviewingOA()); - if($browseType == 'all' or !in_array($browseType, array('story', 'testcase', 'project', 'feedback', 'oa'))) $reviewList = array_merge($reviewList, $this->getReviewingFlows($browseType)); + if($browseType == 'all' or !in_array($browseType, array('story', 'testcase', 'feedback', 'oa'))) $reviewList = array_merge($reviewList, $this->getReviewingFlows($browseType)); if(empty($reviewList)) return array(); @@ -1175,7 +1175,7 @@ class myModel extends model $data = new stdclass(); $data->id = $review->id; $data->title = $review->title; - $data->type = 'project'; + $data->type = 'projectreview'; $data->time = $review->createdDate; $data->status = $review->status; $reviewList[] = $data; @@ -1423,7 +1423,7 @@ class myModel extends model $review->status = $objectType == 'attend' ? $object->reviewStatus : ((isset($object->status) and !isset($flows[$objectType])) ? $object->status : 'done'); if(strpos($review->result, ',') !== false) list($review->result) = explode(',', $review->result); - if($review->type == 'review') $review->type = 'project'; + if($review->type == 'review') $review->type = 'projectreview'; if($review->type == 'case') $review->type = 'testcase'; $review->title = ''; if(isset($object->title)) diff --git a/module/my/view/audit.html.php b/module/my/view/audit.html.php index 5dc9efa094..1c9a61741c 100644 --- a/module/my/view/audit.html.php +++ b/module/my/view/audit.html.php @@ -53,11 +53,12 @@ type; - if($type == 'project') $type = 'review'; + if($type == 'projectreview') $type = 'review'; $typeName = ''; if(isset($lang->{$review->type}->common)) $typeName = $lang->{$review->type}->common; if($type == 'story') $typeName = $lang->my->auditMenu->audit->story; + if($review->type == 'projectreview') $typeName = $lang->project->common; if(isset($flows[$review->type])) $typeName = $flows[$review->type]; $statusList = array(); From 0f4ef051bf2e93f62b58ae789a2f51e6586a5fcc Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 13:44:28 +0800 Subject: [PATCH 22/63] * Finish Bug #30480 --- module/project/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/project/control.php b/module/project/control.php index 3182e042dd..247cd85ae8 100755 --- a/module/project/control.php +++ b/module/project/control.php @@ -754,7 +754,7 @@ class project extends control $productPlansOrder = array(); foreach($productPlans as $productID => $plan) { - $orderPlans = $this->loadModel('productPlan')->getListByIds(array_keys($plan)); + $orderPlans = $this->loadModel('productPlan')->getListByIds(array_keys($plan), true); $orderPlansMap = array_keys($orderPlans); foreach($orderPlansMap as $planMapID) { From 72eda6884655441ce5feae1d3e7c63658dc1af07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=94=E4=BB=A4=E8=8C=82?= Date: Thu, 8 Dec 2022 05:55:42 +0000 Subject: [PATCH 23/63] * Resolved feedback #1279 ,testcase display error when import file have html char. --- module/testcase/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/testcase/model.php b/module/testcase/model.php index e0c3290b1c..95242794bb 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -1564,9 +1564,9 @@ class testcaseModel extends model { $caseID = $this->dao->lastInsertID(); $parentStepID = 0; - if($this->post->desc) + if($data->desc) { - foreach($this->post->desc[$key] as $id => $desc) + foreach($data->desc[$key] as $id => $desc) { $desc = trim($desc); if(empty($desc)) continue; @@ -1576,7 +1576,7 @@ class testcaseModel extends model $stepData->case = $caseID; $stepData->version = 1; $stepData->desc = htmlSpecialString($desc); - $stepData->expect = htmlSpecialString($this->post->expect[$key][$id]); + $stepData->expect = htmlSpecialString($data->expect[$key][$id]); $this->dao->insert(TABLE_CASESTEP)->data($stepData)->autoCheck()->exec(); if($stepData->type == 'group') $parentStepID = $this->dao->lastInsertID(); if($stepData->type == 'step') $parentStepID = 0; From bdeb83477b6b737cf38e52317583ac5bbb157714 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Thu, 8 Dec 2022 06:00:06 +0000 Subject: [PATCH 24/63] * Resolve feedback #1646. --- module/common/model.php | 32 ++++++++++++++++++++++++++++++++ module/transfer/config.php | 4 ++-- module/transfer/model.php | 28 +++++++++++++++++++++++++--- 3 files changed, 59 insertions(+), 5 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 0174708a20..0b16444953 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -939,6 +939,38 @@ class commonModel extends model echo "
      " . $html . '
      '; } + /** + * Format the date to YYYY-mm-dd, format the datetime to YYYY-mm-dd HH:ii:ss. + * + * @param int $date + * @param string $type date|datetime|'' + * @access public + * @return string + */ + public function formatDate($date, $type = '') + { + $datePattern = '\w{4}(\/|-)\w{1,2}(\/|-)\w{1,2}'; + $datetimePattern = $datePattern . ' \w{1,2}\:\w{1,2}\:\w{1,2}'; + + if(empty($type)) + { + if(!preg_match("/$datePattern/", $date) and !preg_match("/$datetimePattern/", $date)) return $date; + if(preg_match("/$datePattern/", $date) === 1) $type = 'date'; + if(preg_match("/$datetimePattern/", $date) === 1) $type = 'datetime'; + } + + if(helper::isZeroDate($date)) + { + if($type == 'date') return '0000-00-00'; + if($type == 'datetime') return '0000-00-00 00:00:00'; + } + + if($type == 'date') $format = 'Y-m-d'; + if($type == 'datetime') $format = 'Y-m-d H:i:s'; + + return date($format, strtotime($date)); + } + /** * Get main nav items list * diff --git a/module/transfer/config.php b/module/transfer/config.php index c53f3b1d84..a97d8f24f9 100644 --- a/module/transfer/config.php +++ b/module/transfer/config.php @@ -12,8 +12,8 @@ $config->transfer->fieldList['sort'] = ''; $config->transfer->fieldList['dataSource'] = array('module' => '', 'method' => '', 'params' => '', 'pairs' => '', 'lang' => ''); $config->transfer->initFunction = 'title,control,required,'; -$config->transfer->dateFeilds = 'estStarted,realStarted,deadline,openedDate,assignedDate,finishedDate,canceledDate,closedDate,lastEditedDate,'; -$config->transfer->datetimeFeilds = ''; +$config->transfer->dateFields = 'estStarted,realStarted,deadline,openedDate,assignedDate,finishedDate,canceledDate,closedDate,lastEditedDate,'; +$config->transfer->datetimeFields = ''; $config->transfer->listFields = ''; $config->transfer->sysLangFields = ',pri,status,type,mode,severity,os,browser,resolution,confirmed,source,reviewResult,stage,change,category'; $config->transfer->sysDataFields = 'execution,product,user'; diff --git a/module/transfer/model.php b/module/transfer/model.php index 0721b4d5af..82cf31e94d 100644 --- a/module/transfer/model.php +++ b/module/transfer/model.php @@ -506,10 +506,32 @@ class transferModel extends model { $modelData = $this->getDatasByFile($tmpFile); } + + $modelData = $this->processDate($modelData); if(isset($fields['id'])) unset($fields['id']); return $modelData; } + /** + * Process datas, convert date to YYYY-mm-dd, convert datetime to YYYY-mm-dd HH:ii:ss. + * + * @param array $datas + * @access public + * @return array + */ + public function processDate($datas) + { + foreach($datas as $index => $data) + { + foreach($data as $field => $value) + { + if(strpos($this->modelConfig->dateFields, $field) !== false or strpos($this->modelConfig->datetimeFields, $field) !== false) $data->$field = $this->loadModel('common')->formatDate($value); + } + $datas[$index] = $data; + } + return $datas; + } + /** * Get rows from excel. * @@ -940,7 +962,7 @@ class transferModel extends model foreach($data as $field => $cellValue) { if(empty($cellValue)) continue; - if(strpos($this->transferConfig->dateFeilds, $field) !== false and helper::isZeroDate($cellValue)) $datas[$key]->$field = ''; + if(strpos($this->transferConfig->dateFields, $field) !== false and helper::isZeroDate($cellValue)) $datas[$key]->$field = ''; if(is_array($cellValue)) continue; if(!empty($fieldList[$field]['from']) and in_array($fieldList[$field]['control'], array('select', 'multiple'))) @@ -1325,8 +1347,8 @@ class transferModel extends model if(!isset($modelConfig->export)) $modelConfig->export = new stdClass(); if(!isset($modelConfig->import)) $modelConfig->export = new stdClass(); - $modelConfig->dateFeilds = isset($modelConfig->dateFeilds) ? $modelConfig->dateFeilds : $transferConfig->dateFeilds; - $modelConfig->datetimeFeilds = isset($modelConfig->datetimeFeilds) ? $modelConfig->datetimeFeilds : $transferConfig->datetimeFeilds; + $modelConfig->dateFields = isset($modelConfig->dateFields) ? $modelConfig->dateFields : $transferConfig->dateFields; + $modelConfig->datetimeFields = isset($modelConfig->datetimeFields) ? $modelConfig->datetimeFields : $transferConfig->datetimeFields; $modelConfig->sysLangFields = isset($modelConfig->sysLangFields) ? $modelConfig->sysLangFields : $transferConfig->sysLangFields; $modelConfig->sysDataFields = isset($modelConfig->sysDataFields) ? $modelConfig->sysDataFields : $transferConfig->sysDataFields; $modelConfig->listFields = isset($modelConfig->listFields) ? $modelConfig->listFields : $transferConfig->listFields; From d6db014f9988474ec0bbccf73c65be13544db48b Mon Sep 17 00:00:00 2001 From: Lufei Date: Thu, 8 Dec 2022 14:00:14 +0800 Subject: [PATCH 25/63] * Fix checkPriv error. --- module/common/model.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 0174708a20..9321f7c661 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -395,9 +395,9 @@ class commonModel extends model /** * Deny access. * - * @param varchar $module - * @param varchar $method - * @param bool $reload + * @param string $module + * @param string $method + * @param bool $reload * @access public * @return mixed */ @@ -2454,6 +2454,8 @@ EOD; } catch(EndResponseException $endResponseException) { + if($this->app->getViewType() == 'json' || (defined('RUN_MODE') && RUN_MODE == 'api')) die($endResponseException->getContent()); + echo $endResponseException->getContent(); } } From 91d4f420ec741ce1271ad9aad81bb37761673397 Mon Sep 17 00:00:00 2001 From: Lufei Date: Thu, 8 Dec 2022 14:00:48 +0800 Subject: [PATCH 26/63] * Change resetFileName. --- module/user/control.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/module/user/control.php b/module/user/control.php index 081176c229..8d3c27350b 100755 --- a/module/user/control.php +++ b/module/user/control.php @@ -1090,8 +1090,7 @@ class user extends control } /* Remove the real path for security reason. */ - $pathPos = strrpos($this->app->getBasePath(), DIRECTORY_SEPARATOR, -2); - $resetFileName = substr($resetFileName, $pathPos + 1); + $resetFileName = str_replace($this->app->getBasePath(), '', $resetFileName); $this->view->title = $this->lang->user->resetPassword; $this->view->status = 'reset'; From 7deb82711295e5c21e8fff958ece514601632a15 Mon Sep 17 00:00:00 2001 From: Yagami Date: Thu, 8 Dec 2022 14:12:43 +0800 Subject: [PATCH 27/63] * Fix bug #30683. --- module/projectrelease/view/view.html.php | 6 ------ module/release/view/view.html.php | 6 ------ 2 files changed, 12 deletions(-) diff --git a/module/projectrelease/view/view.html.php b/module/projectrelease/view/view.html.php index b16d38b45c..7a021778c1 100644 --- a/module/projectrelease/view/view.html.php +++ b/module/projectrelease/view/view.html.php @@ -349,12 +349,6 @@ release->product;?> productName;?> - productType != 'normal'):?> - - product->branch, $lang->product->branchName[$product->type]);?> - - - release->name;?> diff --git a/module/release/view/view.html.php b/module/release/view/view.html.php index b8e5ab2678..c07682ab46 100644 --- a/module/release/view/view.html.php +++ b/module/release/view/view.html.php @@ -350,12 +350,6 @@ release->product;?> productName;?> - productType != 'normal'):?> - - product->branch;?> - - - release->name;?> name;?> From fb95d28f5a25540714707a861bfa665a7848a4c4 Mon Sep 17 00:00:00 2001 From: Yagami Date: Thu, 8 Dec 2022 14:17:43 +0800 Subject: [PATCH 28/63] * Fix bug #30569. --- module/project/js/create.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/module/project/js/create.js b/module/project/js/create.js index 92e09db510..347a0406c7 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -189,17 +189,6 @@ function setParentProgram(parentProgram) }); $('#parent').attr('data-lastSelected', parentProgram); - - if(parentProgram != '0') - { - $('.productsBox .addProduct .input-group:first').addClass('required'); - $('.productsBox .row .input-group:first').addClass('required'); - } - else - { - $('.productsBox .addProduct .input-group').removeClass('required'); - $('.productsBox .row .input-group').removeClass('required'); - } } /** From e6989dc17c360902f06433729829f2849f1cff31 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 14:32:27 +0800 Subject: [PATCH 29/63] * Finish Bug #30687 --- module/build/control.php | 6 +++++- module/tree/model.php | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 021f442967..d0ad05431f 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -640,7 +640,11 @@ class build extends control { $branchPairs = $this->loadModel('branch')->getPairs($build->product, 'noempty'); $branches = array('' => '') + array(BRANCH_MAIN => $this->lang->branch->main); - if($build->branch) $branches += array($build->branch => $branchPairs[$build->branch]); + + if($build->branch) + { + foreach(explode(',', $build->branch) as $branchID) $branches += array($branchID => $branchPairs[$branchID]); + } $this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); $this->config->product->search['params']['branch']['values'] = $branches; diff --git a/module/tree/model.php b/module/tree/model.php index c84f818e66..7c94195bd2 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -155,14 +155,14 @@ class treeModel extends model if($type == 'line') $rootID = 0; - $branches = array($branch => ''); + $branches = array(); if($branch != 'all' and strpos('story|bug|case', $type) !== false) { $product = $this->loadModel('product')->getById($rootID); if($product and $product->type != 'normal') { $branchPairs = $this->loadModel('branch')->getPairs($rootID, 'all'); - $branches = array($branch => $branchPairs[$branch]); + foreach(explode(',', $branch) as $branchID) $branches += array($branchID => $branchPairs[$branchID]); } elseif($product and $product->type == 'normal') { @@ -175,7 +175,7 @@ class treeModel extends model $treeMenu = array(); foreach($branches as $branchID => $branch) - { + { $stmt = $this->dbh->query($this->buildMenuQuery($rootID, $type, $startModule, $branchID, $param)); $modules = array(); while($module = $stmt->fetch()) From 9a1d82200b04574c7e578ba6470d518a7ee44d58 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 14:32:21 +0800 Subject: [PATCH 30/63] * fix bug #30667. --- module/my/model.php | 2 +- module/my/view/audit.html.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/module/my/model.php b/module/my/model.php index af7dd39e3b..f454de498e 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -1242,7 +1242,7 @@ class myModel extends model $data->title = (empty($titleFieldName) or !isset($object->$titleFieldName)) ? $title . " #{$object->id}" : $object->$titleFieldName; $data->type = $objectType; $data->time = $object->$openedDateField; - $data->status = (isset($object->status) and !isset($flows[$objectType])) ? $object->status : 'doing'; + $data->status = 'doing'; $approvalList[] = $data; } } diff --git a/module/my/view/audit.html.php b/module/my/view/audit.html.php index 1c9a61741c..1e2320c92e 100644 --- a/module/my/view/audit.html.php +++ b/module/my/view/audit.html.php @@ -64,7 +64,11 @@ $statusList = array(); if(isset($lang->$type->statusList)) $statusList = $lang->$type->statusList; if($type == 'attend') $statusList = $lang->attend->reviewStatusList; - if(isset($flows[$review->type])) $statusList = $lang->approval->statusList; + if(!in_array($type, array('story', 'testcase', 'feedback', 'review')) and strpos(",{$config->my->oaObjectType},", ",$type,") === false) + { + if($rawMethod == 'audit') $statusList = $lang->approval->nodeList; + if(isset($flows[$review->type])) $statusList = $rawMethod == 'audit' ? $lang->approval->nodeList : $lang->approval->statusList; + } ?> id?> From dd7dfa2dc1cb9e47d67c1feb4d544bafc42115ce Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 14:37:24 +0800 Subject: [PATCH 31/63] * fix bug #30660. --- module/my/model.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/module/my/model.php b/module/my/model.php index f454de498e..38b1fd9612 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -1006,7 +1006,7 @@ class myModel extends model if($this->getReviewingCases('id_desc', true)) $typeList[] = 'testcase'; if($this->getReviewingApprovals('id_desc', true)) $typeList[] = 'project'; if($this->getReviewingFeedbacks('id_desc', true)) $typeList[] = 'feedback'; - $typeList = array_merge($typeList, $this->getReviewingOA('status', true)); + if($this->getReviewingOA('status', true)) $typeList[] = 'oa'; $typeList = array_merge($typeList, $this->getReviewingFlows('all', 'id_desc', true)); $flows = ($this->config->edition == 'open') ? array() : $this->dao->select('module,name')->from(TABLE_WORKFLOW)->where('module')->in($typeList)->andWhere('buildin')->eq(0)->fetchPairs('module', 'name'); @@ -1310,12 +1310,10 @@ class myModel extends model if($checkExists) { - $typeList = array(); foreach($oa as $type => $reviewings) { - if(!empty($reviewings)) $typeList[$type] = true; + if(!empty($reviewings)) return true; } - return array_keys($typeList); } $reviewList = array(); From 9b7c5be5cad766b5eb3556c332833ebd6ba74e60 Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 8 Dec 2022 14:46:33 +0800 Subject: [PATCH 32/63] * Finish feedback#130 and story#32666. --- module/story/js/common.js | 4 ++-- module/story/js/create.js | 4 +++- module/story/lang/de.php | 1 + module/story/lang/en.php | 1 + module/story/lang/fr.php | 1 + module/story/lang/zh-cn.php | 1 + module/story/view/create.html.php | 7 ++++++- 7 files changed, 15 insertions(+), 4 deletions(-) diff --git a/module/story/js/common.js b/module/story/js/common.js index ad4df2cb43..c205bc9894 100644 --- a/module/story/js/common.js +++ b/module/story/js/common.js @@ -77,11 +77,11 @@ function getStatus(method, params) * @access public * @return void */ -function loadURS() +function loadURS(allURS) { var productID = $('#product').val(); var branchID = $('#branch').val(); - var moduleID = $('#module').val(); + var moduleID = typeof(allURS) == 'undefined' ? $('#module').val() : 0; var requirementList = $('#URS').val(); requirementList = requirementList ? requirementList.join(',') : ''; diff --git a/module/story/js/create.js b/module/story/js/create.js index e16afa22a3..7a8d0faabf 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -59,7 +59,9 @@ $(function() return false; }); - $(document).on('change', '#module', loadURS); + $('#module').on('change', function(){ + loadURS(); + }); if($(".table-form select[id^='branches']").length == $('.switchBranch #branchBox option').length) { diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 7111526b98..a02500a216 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -80,6 +80,7 @@ $lang->story->currentBranch = 'Current Branch'; $lang->story->siblings = 'Siblings story'; $lang->story->relieved = 'Relieved'; $lang->story->relievedSiblings = 'Relieved Siblings'; +$lang->story->loadAllStories = 'Load all stories'; $lang->story->editAction = "Edit {$lang->SRCommon}"; $lang->story->changeAction = "Change Story"; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 664d1a114b..de58d24c61 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -80,6 +80,7 @@ $lang->story->currentBranch = 'Current Branch'; $lang->story->siblings = 'Siblings story'; $lang->story->relieved = 'Relieved'; $lang->story->relievedSiblings = 'Relieved Siblings'; +$lang->story->loadAllStories = 'Load all stories'; $lang->story->editAction = "Edit {$lang->SRCommon}"; $lang->story->changeAction = "Change {$lang->SRCommon}"; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index e11cd9a62c..07c3f8038c 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -80,6 +80,7 @@ $lang->story->currentBranch = 'Current Branch'; $lang->story->siblings = 'Siblings story'; $lang->story->relieved = 'Relieved'; $lang->story->relievedSiblings = 'Relieved Siblings'; +$lang->story->loadAllStories = 'Load all stories'; $lang->story->editAction = "Edit {$lang->SRCommon}"; $lang->story->changeAction = "Changer Story"; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 048756a3f8..0d183843f4 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -80,6 +80,7 @@ $lang->story->currentBranch = '当前%s'; $lang->story->siblings = '孪生需求'; $lang->story->relieved = '解除'; $lang->story->relievedSiblings = '解除孪生需求'; +$lang->story->loadAllStories = '加载所有需求'; $lang->story->editAction = "编辑{$lang->SRCommon}"; $lang->story->changeAction = "变更{$lang->SRCommon}"; diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index dcd784e481..209063fc58 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -204,7 +204,12 @@ foreach(explode(',', $config->story->create->requiredFields) as $field) config->URAndSR):?> story->parent : $lang->story->requirement;?> - + +
      + + story->loadAllStories, "class='btn btn-default' onclick='loadURS(true)' data-toggle='tooltip'");?> +
      + >
      From d8a5944a84499bc18669c27f0cdcdffa3a0a7bee Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 15:15:49 +0800 Subject: [PATCH 33/63] * Finish Bug --- module/build/view/create.html.php | 2 +- module/build/view/edit.html.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 40269a87dd..5911c0b5f7 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -44,7 +44,7 @@ - '> + '> type == 'normal' ? '' : $lang->product->branchName[$product->type]?>
      diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 5e2ff18c64..5faea8efd7 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -37,7 +37,7 @@ build->notice->changeProduct;?> - '> + '> type == 'normal' ? '' : $lang->product->branchName[$product->type]?>
      From 1b4791f74bbad19a95f929be9601d6c71aa77829 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 15:45:36 +0800 Subject: [PATCH 34/63] * Fix build create --- module/build/js/create.js | 13 +++++++------ module/build/model.php | 4 ++-- module/build/view/create.html.php | 9 +++++++-- module/build/view/edit.html.php | 5 +++++ module/projectrelease/control.php | 2 +- 5 files changed, 22 insertions(+), 11 deletions(-) diff --git a/module/build/js/create.js b/module/build/js/create.js index 35625a6d40..836a71ed59 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -71,15 +71,16 @@ function loadProducts(executionID) $('#productBox').append(data); $('#product').chosen(); + + $.get(createLink('product', 'ajaxGetProductById', 'produtID=' + $("#product").val()), function(data) + { + $('#branchBox').closest('tr').find('th').text(data.branchName); + }, 'json'); + loadBranches($("#product").val()); } }); - $.get(createLink('product', 'ajaxGetProductById', 'produtID=' + $("#product").val()), function(data) - { - $('#branchBox').closest('tr').find('th').text(data.branchName); - }, 'json'); - loadLastBuild(); } @@ -94,7 +95,7 @@ function loadLastBuild() var isIntegrated = $('input[name=isIntegrated]:checked').val(); var projectID = $('#project').val(); var executionID = $('#execution').val(); - if(isIntegrated == 'yes') executionID = 0; + if(isIntegrated == 'yes') executionID = 0; $.get(createLink('build', 'ajaxGetLastBuild', 'projectID=' + projectID + '&executionID=' + executionID), function(data) { $('#lastBuildBox').html(data); diff --git a/module/build/model.php b/module/build/model.php index ad3e227710..ee1f92c4f8 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -407,7 +407,7 @@ class buildModel extends model } $product = $this->loadModel('product')->getByID($build->product); - if($product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch'])) + if(!empty($product) and $product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch'])) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); @@ -456,7 +456,7 @@ class buildModel extends model ->get(); $product = $this->loadModel('product')->getByID($build->product); - if($product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch'])) + if(!empty($product) and $product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch'])) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php index 5911c0b5f7..0309bcc865 100644 --- a/module/build/view/create.html.php +++ b/module/build/view/create.html.php @@ -45,10 +45,15 @@ '> - type == 'normal' ? '' : $lang->product->branchName[$product->type]?> + + product->branchName[$productType]?>
      - branches), "class='form-control chosen' multiple required"); ?> +
      diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 5faea8efd7..45df680489 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -38,6 +38,11 @@ '> + type == 'normal' ? '' : $lang->product->branchName[$product->type]?>
      diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index f3f4b04e82..70c455e1bc 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -204,7 +204,7 @@ class projectrelease extends control $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->edit; $this->view->position[] = $this->lang->release->edit; $this->view->release = $release; - $this->view->builds = $builds; + $this->view->builds = $builds;a($builds);exit; $this->view->users = $this->loadModel('user')->getPairs('noclosed'); $this->display(); From f7b600ffcb9a6ce2c542f3c49b74da3926992603 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 15:49:06 +0800 Subject: [PATCH 35/63] remove code --- module/projectrelease/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 70c455e1bc..f3f4b04e82 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -204,7 +204,7 @@ class projectrelease extends control $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->edit; $this->view->position[] = $this->lang->release->edit; $this->view->release = $release; - $this->view->builds = $builds;a($builds);exit; + $this->view->builds = $builds; $this->view->users = $this->loadModel('user')->getPairs('noclosed'); $this->display(); From e9bc72f2b25163ae873ae27de1260fd288a25c7a Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 15:56:30 +0800 Subject: [PATCH 36/63] * Finish Bug #30689 --- 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 ee1f92c4f8..8e6d83c85b 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -253,6 +253,7 @@ class buildModel extends model ->beginIF($products)->andWhere('product')->in($products)->fi() ->beginIF($objectType === 'execution' and $objectID)->andWhere('execution')->eq($objectID)->fi() ->beginIF($objectType === 'project' and $objectID)->andWhere('project')->eq($objectID)->fi() + ->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('deleted')->eq(0)->fi() ->fetchPairs(); } @@ -456,7 +457,7 @@ class buildModel extends model ->get(); $product = $this->loadModel('product')->getByID($build->product); - if(!empty($product) and $product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch'])) + if(!empty($productgetBuildPairs) and $product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch'])) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); From 4724af01bb407aa74be32a3bd6c5fd050cf8a7cf Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 8 Dec 2022 16:11:20 +0800 Subject: [PATCH 37/63] * Fix bug#30698. --- module/productplan/control.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/productplan/control.php b/module/productplan/control.php index 6f7fa1bdce..8a941102e7 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -1030,6 +1030,7 @@ class productplan extends control $parentPlan = $this->productplan->getByID($parentID); foreach(explode(',', $parentPlan->branch) as $parentBranchID) { + if(!isset($branchPairs[$parentBranchID])) continue; $parentBranches[$parentBranchID] = $branchPairs[$parentBranchID]; if(!empty($currentBranches) and strpos(",$currentBranches,", ",$parentBranchID,") === false) $currentBranches = str_replace(",$parentBranchID,", ',', $currentBranches); } From 43b667ba2bd0b1a948321c3511f77a858d44720d Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 16:16:16 +0800 Subject: [PATCH 38/63] * Finish Bug #30700 --- module/tree/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/tree/model.php b/module/tree/model.php index 88211b5fc1..8b4da78ff1 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -158,7 +158,7 @@ class treeModel extends model if($type == 'line') $rootID = 0; - $branches = array(); + $branches = array($branch => ''); if($branch != 'all' and strpos('story|bug|case', $type) !== false) { $product = $this->loadModel('product')->getById($rootID); From c73d589b54f1454826396138cb5ef6583a2a9368 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 8 Dec 2022 16:28:38 +0800 Subject: [PATCH 39/63] * Finish Bug #30664 --- module/build/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/build/model.php b/module/build/model.php index 8e6d83c85b..b13c40eead 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -457,7 +457,7 @@ class buildModel extends model ->get(); $product = $this->loadModel('product')->getByID($build->product); - if(!empty($productgetBuildPairs) and $product->type != 'normal' and $this->post->isIntegrated == 'no' and !isset($_POST['branch'])) + if(!empty($product) and $product->type != 'normal' and !isset($_POST['branch'])) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); From d9b0d2c2c49f5e157b8e328594862bdce59d239e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 8 Dec 2022 16:50:17 +0800 Subject: [PATCH 40/63] * fix bug #30536. --- module/bug/js/common.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 3cf0a2ac8b..98f2d36bf9 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -24,7 +24,7 @@ if($('#openedBuild').length || $('#resolvedBuild').length || $('[name^=openedBui { $.get(createLink('bug', 'ajaxGetReleasedBuilds', 'productID=' + productID), function(data){releasedBuilds = data;}, 'json'); - $('#openedBuild, #resolvedBuild, [name^=openedBuilds]').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'}); + $('#openedBuild, #resolvedBuild, [name^=openedBuilds]').picker({optionRender: markReleasedBuilds}); } function markReleasedBuilds($option) @@ -212,7 +212,7 @@ function loadAllExecutionBuilds(executionID, productID, buildBox) $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); notice(); - $("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'}); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } if(page == 'edit') @@ -220,7 +220,7 @@ function loadAllExecutionBuilds(executionID, productID, buildBox) if(buildBox == 'openedBuildBox') { link = createLink('build', 'ajaxGetExecutionBuilds', 'executionID=' + executionID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch + '&index=0&needCreate=true&type=all'); - $('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})}); + $('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds})}); } if(buildBox == 'resolvedBuildBox') { @@ -255,7 +255,7 @@ function loadAllProductBuilds(productID, buildBox) $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); notice(); - $("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'}); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } if(page == 'edit') @@ -263,7 +263,7 @@ function loadAllProductBuilds(productID, buildBox) if(buildBox == 'openedBuildBox') { link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch + '&index=0&type=all'); - $('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})}); + $('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds})}); } if(buildBox == 'resolvedBuildBox') { @@ -474,12 +474,12 @@ function loadProductBuilds(productID) $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); notice(); - $("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'}); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } else { - $('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})}); + $('#openedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds})}); link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch); $('#resolvedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})}); } @@ -632,13 +632,13 @@ function loadProjectBuilds(projectID) $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); notice(); - $("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'}); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } else { var link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch); - $('#openedBuildBox').load(link, function(){$(this).find('select').val(oldOpenedBuild).picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})}); + $('#openedBuildBox').load(link, function(){$(this).find('select').val(oldOpenedBuild).picker({optionRender: markReleasedBuilds})}); var oldResolvedBuild = $('#resolvedBuild').val() ? $('#resolvedBuild').val() : 0; var link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch); @@ -677,13 +677,13 @@ function loadExecutionBuilds(executionID, num) $('#pickerDropMenu-pk_openedBuild').remove(); $('#openedBuild').next('.picker').remove(); notice(); - $("#openedBuild").picker({optionRender: markReleasedBuilds, dropWidth: 'auto'}); + $("#openedBuild").picker({optionRender: markReleasedBuilds}); }) } else { link = createLink('build', 'ajaxGetExecutionBuilds', 'executionID=' + executionID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch + '&index=0&needCreate=false&type=normal&number=' + num); - $('#openedBuildBox' + num).load(link, function(){$(this).find('select').val(oldOpenedBuild).picker({optionRender: markReleaseBuilds, dropWidth: 'auto'})}); + $('#openedBuildBox' + num).load(link, function(){$(this).find('select').val(oldOpenedBuild).picker({optionRender: markReleaseBuilds})}); oldResolvedBuild = $('#resolvedBuild').val() ? $('#resolvedBuild').val() : 0; link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch); From c3c3a295022c90ed2a8d41fd5286c77aadf4a4bc Mon Sep 17 00:00:00 2001 From: mayue Date: Thu, 8 Dec 2022 17:17:30 +0800 Subject: [PATCH 41/63] * Fix bug #30681. --- module/execution/model.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 3f1f901f42..38ec18c4bf 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1582,17 +1582,14 @@ class executionModel extends model ->andWhere('type')->eq('execution') ->fetchPairs(); } - $project = $this->loadModel('project')->getByID($projectID); $executions = $this->dao->select('t1.*,t2.name projectName, t2.model as projectModel')->from(TABLE_EXECUTION)->alias('t1') ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') - ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project') - ->beginIF(!empty($project->division))->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t4.id=t3.product')->fi() + ->beginIF($productID)->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project')->fi() ->where('t1.type')->in('sprint,stage,kanban') ->andWhere('t1.deleted')->eq('0') ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('t1.multiple')->eq('1') - ->beginIF(!empty($project->division))->andWhere('t4.deleted')->eq('0')->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() ->beginIF(!empty($executionQuery))->andWhere($executionQuery)->fi() ->beginIF($productID)->andWhere('t3.product')->eq($productID)->fi() @@ -1607,7 +1604,13 @@ class executionModel extends model ->page($pager) ->fetchAll('id'); - if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchPairs(); + if(empty($productID) and !empty($executions)) + { + $projectProductList = $this->dao->select('t1.project, t1.product, t2.deleted')->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') + ->where('t1.project')->in(array_keys($executions)) + ->fetchAll('project'); + } $hours = $this->loadModel('project')->computerProgress($executions); $burns = $this->getBurnData($executions); @@ -1671,9 +1674,11 @@ class executionModel extends model } /* Bind execution product */ - if(!empty($projectProductIdList) and !empty($projectProductIdList[$execution->id])) + if(!empty($projectProductList) and !empty($projectProductList[$execution->id])) { - $execution->product = $projectProductIdList[$execution->id]; + $execution->product = $projectProductList[$execution->id]->product; + + if($projectProductList[$execution->id]->deleted) unset($executions[$key]); } } return array_values($executions); From 1001e35d9b25c02e382cf51848947f7e0df58e86 Mon Sep 17 00:00:00 2001 From: liuhong Date: Thu, 8 Dec 2022 16:38:50 +0000 Subject: [PATCH 42/63] * Fix bug #30609. --- 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 e15a7fc9b9..00e8371ec6 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1855,7 +1855,7 @@ class bugModel extends model ->andWhere('deleted')->eq(0) ->beginIF($excludeBugs)->andWhere('id')->notIN($excludeBugs)->fi() ->beginIF(!empty($productID) and strpos($bugQuery, 'product') === false and strpos($bugQuery, '`product` IN') === false)->andWhere('product')->eq($productID)->fi() - ->beginIF(!empty($productID) and strpos($bugQuery, 'product') === false and strpos($bugQuery, '`product` IN') === false)->andWhere('branch')->eq($branchID)->fi() + ->beginIF(!empty($productID) and strpos($bugQuery, 'product') === false and strpos($bugQuery, '`product` IN') === false and $branchID != 'all')->andWhere('branch')->eq($branchID)->fi() ->orderBy($orderBy) ->page($pager) ->fetchAll('id'); From adc9fb7c3d9fb12af6f9b5dc88c3d55216f500b3 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 9 Dec 2022 08:39:49 +0800 Subject: [PATCH 43/63] * fix bug #30532. --- module/bug/js/common.js | 16 ++++++++++++++-- module/bug/js/edit.js | 8 +++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index 98f2d36bf9..f6786d9e94 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -27,6 +27,13 @@ if($('#openedBuild').length || $('#resolvedBuild').length || $('[name^=openedBui $('#openedBuild, #resolvedBuild, [name^=openedBuilds]').picker({optionRender: markReleasedBuilds}); } +/** + * Mark released builds. + * + * @param object $option + * @access public + * @return void + */ function markReleasedBuilds($option) { var build = $option.attr('data-value'); @@ -173,7 +180,7 @@ function loadAllBuilds(object) { oldResolvedBuild = $('#resolvedBuild').val() ? $('#resolvedBuild').val() : 0; link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=0&index=0&type=all'); - $('#resolvedBuildBox').load(link, function(){$(this).find('select').chosen()}); + $('#resolvedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})}); } else { @@ -268,7 +275,12 @@ function loadAllProductBuilds(productID, buildBox) if(buildBox == 'resolvedBuildBox') { link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch + '&index=0&type=all'); - $('#resolvedBuildBox').load(link, function(){$(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'})}); + $('#resolvedBuildBox').load(link, function() + { + $(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'}) + var $pkResolvedBuild = $('#pk_resolvedBuild-search'); + $pkResolvedBuild.closest('.picker').css('width', $pkResolvedBuild.closest('td').width() - $pkResolvedBuild.closest('td').find('.input-group-btn').width()); + }); } } } diff --git a/module/bug/js/edit.js b/module/bug/js/edit.js index c077912cab..c827f33982 100644 --- a/module/bug/js/edit.js +++ b/module/bug/js/edit.js @@ -12,9 +12,8 @@ $(function() confirmResult = confirm(confirmUnlinkBuild); if(!confirmResult) { - $('#resolvedBuild').val(oldResolvedBuild); - $('#resolvedBuild').trigger("chosen:updated"); - $('#resolvedBuild').chosen(); + var resolvedBuildPicker = $('#resolvedBuild').data('zui.picker'); + resolvedBuildPicker.setValue(oldResolvedBuild); } } }); @@ -40,6 +39,9 @@ $(function() var modalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '95%', url: link}); modalTrigger.show(); }); + + var $pkResolvedBuild = $('#pk_resolvedBuild-search'); + $pkResolvedBuild.closest('.picker').css('width', $pkResolvedBuild.closest('td').width() - $pkResolvedBuild.closest('td').find('.input-group-btn').width()); }); /** From 3c3cacc47cf1390f6a518b66da714b1aa0347af5 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 9 Dec 2022 08:44:13 +0800 Subject: [PATCH 44/63] * adjust code. --- module/bug/js/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/bug/js/common.js b/module/bug/js/common.js index f6786d9e94..7134ecab5b 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -279,7 +279,7 @@ function loadAllProductBuilds(productID, buildBox) { $(this).find('select').picker({optionRender: markReleasedBuilds, dropWidth: 'auto'}) var $pkResolvedBuild = $('#pk_resolvedBuild-search'); - $pkResolvedBuild.closest('.picker').css('width', $pkResolvedBuild.closest('td').width() - $pkResolvedBuild.closest('td').find('.input-group-btn').width()); + $pkResolvedBuild.closest('.picker').css('width', $pkResolvedBuild.closest('td').width()); }); } } From 3d676b613ade4a32c79c7bc264d19b6496a97090 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 9 Dec 2022 00:59:17 +0000 Subject: [PATCH 45/63] * Fix bug#30719 --- module/story/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/story/model.php b/module/story/model.php index 8303cf05e7..cd53755880 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -1256,7 +1256,7 @@ class storyModel extends model if(empty($childrenStatus)) return $this->dao->update(TABLE_STORY)->set('parent')->eq('0')->where('id')->eq($parentID)->exec(); $status = $oldParentStory->status; - if(count($childrenStatus) == 1 and $oldParentStory->status != 'changing') + if(count($childrenStatus) == 1 and $oldParentStory->status != 'changing' and $oldParentStory->status != 'reviewing') { $status = current($childrenStatus); if($status == 'draft' or $status == 'changing') $status = 'active'; From 8a0cbc6e6d714966161f4088375bb1168eec4d21 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 9 Dec 2022 09:41:06 +0800 Subject: [PATCH 46/63] * Finish Bug #30637 --- module/execution/model.php | 2 +- module/productplan/model.php | 6 +++++- module/story/control.php | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 3f1f901f42..3209275fcf 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2319,7 +2319,7 @@ class executionModel extends model $planPairs = array('' => ''); foreach($products as $productID => $product) { - $plans = $this->productplan->getBranchPlanPairs($productID, array(BRANCH_MAIN) + $product->branches, true); + $plans = $this->productplan->getBranchPlanPairs($productID, array(BRANCH_MAIN) + $product->branches, 'unexpired', true); foreach($plans as $plan) $planPairs += $plan; } $this->config->product->search['params']['plan']['values'] = $planPairs; diff --git a/module/productplan/model.php b/module/productplan/model.php index 04bfe7f712..e182796538 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -460,16 +460,20 @@ class productplanModel extends model * * @param int $productID * @param array $branches + * @param string $param * @param bool $skipParent * @access public * @return array */ - public function getBranchPlanPairs($productID, $branches = '', $skipParent = false) + public function getBranchPlanPairs($productID, $branches = '', $param = '', $skipParent = false) { + $date = date('Y-m-d'); + $param = strtolower($param); $plans = $this->dao->select('parent,branch,id,title,begin,end')->from(TABLE_PRODUCTPLAN) ->where('product')->eq($productID) ->andWhere('deleted')->eq(0) ->beginIF($branches != '')->andWhere('branch')->in($branches)->fi() + ->beginIF(strpos($param, 'unexpired') !== false)->andWhere('end')->ge($date)->fi() ->orderBy('begin desc') ->fetchAll('id'); diff --git a/module/story/control.php b/module/story/control.php index 4e4dc56dcc..7179e888bb 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1064,7 +1064,7 @@ class story extends control $moduleList = $branchProduct ? $modulePairs : array(0 => $modulePairs); $modules = array($productID => $moduleList); - $plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', true)); + $plans = array($productID => $this->productplan->getBranchPlanPairs($productID, '', 'unexpired', true)); $products = array($productID => $product); $branchTagOption = array($productID => $branchTagOption); } @@ -1096,7 +1096,7 @@ class story extends control $modulePairs = $this->tree->getOptionMenu($storyProduct->id, 'story', 0, $branches); $modules[$storyProduct->id] = $storyProduct->type != 'normal' ? $modulePairs : array(0 => $modulePairs); - $plans[$storyProduct->id] = $this->productplan->getBranchPlanPairs($storyProduct->id, $branches, true); + $plans[$storyProduct->id] = $this->productplan->getBranchPlanPairs($storyProduct->id, $branches, 'unexpired', true); if(empty($plans[$storyProduct->id])) $plans[$storyProduct->id][0] = $plans[$storyProduct->id]; if($storyProduct->type != 'normal') $branchProduct = true; From 30b020f372b09594f3ecc1086baf3e7553768a74 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Fri, 9 Dec 2022 09:41:18 +0800 Subject: [PATCH 47/63] * Fix feedback 1397. --- module/webhook/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/webhook/model.php b/module/webhook/model.php index ce5c32ad80..74a292e885 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -422,6 +422,7 @@ class webhookModel extends model $viewLink = $this->getViewLink($objectType == 'kanbancard' ? 'kanban' : $objectType, $objectType == 'kanbancard' ? $object->kanban : $objectID); $objectTypeName = ($objectType == 'story' and $object->type == 'requirement') ? $this->lang->action->objectTypes['requirement'] : $this->lang->action->objectTypes[$objectType]; $title = $this->app->user->realname . $this->lang->action->label->$actionType . $objectTypeName; + $host = (defined('RUN_MODE') and RUN_MODE == 'api') ? '' : $host; $text = $title . ' ' . "[#{$objectID}::{$object->$field}](" . $host . $viewLink . ")"; $mobile = ''; From 0c16f68912ec366f6f5d7f8eae2bb397834ba121 Mon Sep 17 00:00:00 2001 From: chaideqing Date: Fri, 9 Dec 2022 11:01:50 +0800 Subject: [PATCH 48/63] * Fix feedback #1675. --- module/transfer/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/transfer/model.php b/module/transfer/model.php index 0721b4d5af..4fc0a016b0 100644 --- a/module/transfer/model.php +++ b/module/transfer/model.php @@ -830,7 +830,7 @@ class transferModel extends model $storyDatas = end($stories); $lastBranch = $storyDatas->branch; $lastType = $storyDatas->type; - $stories = $this->story->mergePlanTitle($productID , $stories, $lastBranch, $lastType); + $stories = $this->loadModel('story')->mergePlanTitle($productID , $stories, $lastBranch, $lastType); return $stories; } From dd2160fde34e35e3e1bd543a2bd8920ca2993227 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 9 Dec 2022 11:53:58 +0800 Subject: [PATCH 49/63] * Finish Bug #30662 --- module/bug/model.php | 2 +- module/build/model.php | 4 ++-- module/project/view/build.html.php | 2 +- module/projectrelease/control.php | 11 +++++++++++ module/projectrelease/model.php | 2 +- module/projectrelease/view/browse.html.php | 4 ++++ module/release/control.php | 13 ++++++++++++- module/release/model.php | 15 +++++++++++++-- module/release/view/browse.html.php | 8 ++++++++ module/story/control.php | 4 +++- module/story/lang/de.php | 2 +- module/story/lang/en.php | 2 +- module/story/lang/fr.php | 2 +- module/story/lang/zh-cn.php | 2 +- 14 files changed, 60 insertions(+), 13 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index e15a7fc9b9..cf76d974c8 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2319,7 +2319,7 @@ class bugModel extends model $products = $this->session->product; preg_match('/`product` IN \((?P.+)\)/', $this->reportCondition(), $matchs); if(!empty($matchs) and isset($matchs['productIdList'])) $products = str_replace('\'', '', $matchs['productIdList']); - $builds = $this->loadModel('build')->getBuildPairs($products, $branch = 0, $params = 'hasDeleted'); + $builds = $this->loadModel('build')->getBuildPairs($products, $branch = 0, $params = 'hasdeleted'); /* Deal with the situation that a bug maybe associate more than one openedBuild. */ foreach($datas as $buildIDList => $data) diff --git a/module/build/model.php b/module/build/model.php index b13c40eead..e1718d1209 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -253,7 +253,7 @@ class buildModel extends model ->beginIF($products)->andWhere('product')->in($products)->fi() ->beginIF($objectType === 'execution' and $objectID)->andWhere('execution')->eq($objectID)->fi() ->beginIF($objectType === 'project' and $objectID)->andWhere('project')->eq($objectID)->fi() - ->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('deleted')->eq(0)->fi() + ->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('deleted')->eq(0)->fi() ->fetchPairs(); } @@ -267,7 +267,7 @@ class buildModel extends model ->leftJoin(TABLE_PRODUCT)->alias('t5')->on('t1.product = t5.id') ->where('1=1') ->andWhere('t1.id')->notIN($shadows) - ->beginIF(strpos($params, 'hasDeleted') === false)->andWhere('t1.deleted')->eq(0)->fi() + ->beginIF(strpos($params, 'hasdeleted') === false)->andWhere('t1.deleted')->eq(0)->fi() ->beginIF(strpos($params, 'hasproject') !== false)->andWhere('t1.project')->ne(0)->fi() ->beginIF(strpos($params, 'singled') !== false)->andWhere('t1.execution')->ne(0)->fi() ->beginIF($products)->andWhere('t1.product')->in($products)->fi() diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 34820f516d..d6ba063499 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -52,7 +52,7 @@ hasProduct):?> build->product;?> - build->branch;?> + build->branch;?> multiple):?> diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index f3f4b04e82..c836b6701e 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -87,6 +87,16 @@ class projectrelease extends control $releases = $this->projectrelease->getList($projectID, $type, $orderBy, $pager); + $showBranch = false; + foreach($releases as $release) + { + if($release->productType != 'normal') + { + $showBranch = true; + break; + } + } + $this->view->title = $objectName . $this->lang->colon . $this->lang->release->browse; $this->view->execution = $execution; $this->view->project = $project; @@ -97,6 +107,7 @@ class projectrelease extends control $this->view->type = $type; $this->view->from = $this->app->tab; $this->view->pager = $pager; + $this->view->showBranch = $showBranch; $this->display(); } diff --git a/module/projectrelease/model.php b/module/projectrelease/model.php index 259f1ad772..1cb51eee9e 100644 --- a/module/projectrelease/model.php +++ b/module/projectrelease/model.php @@ -59,7 +59,7 @@ class projectreleaseModel extends model */ public function getList($projectID, $type = 'all', $orderBy = 't1.date_desc', $pager = null) { - $releases = $this->dao->select('t1.*, t2.name as productName')->from(TABLE_RELEASE)->alias('t1') + $releases = $this->dao->select('t1.*, t2.name as productName, t2.type as productType')->from(TABLE_RELEASE)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->where('t1.deleted')->eq(0) ->andWhere("FIND_IN_SET($projectID, t1.project)") diff --git a/module/projectrelease/view/browse.html.php b/module/projectrelease/view/browse.html.php index 39e62aca76..013ea04061 100644 --- a/module/projectrelease/view/browse.html.php +++ b/module/projectrelease/view/browse.html.php @@ -53,7 +53,9 @@ projectrelease->product;?> release->includedBuild;?> + release->branch;?> + release->status;?> release->date;?> createLink($build->execution ? 'build' : 'projectbuild', 'view', "buildID=$buildID"), $build->name, '', "data-app='project' title='{$build->name}'");?> processStatus('release', $release);?> + class='c-branch text-center'>branchName; ?> + class='c-status text-center' title=''> diff --git a/module/release/control.php b/module/release/control.php index 46712fb037..1ca2c17474 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -50,12 +50,23 @@ class release extends control $uri = $this->app->getURI(true); $this->session->set('releaseList', $uri, 'product'); $this->session->set('buildList', $uri); + $releases = $this->release->getList($productID, $branch, $type, $orderBy, $pager); + $showBranch = false; + foreach($releases as $release) + { + if($release->productType != 'normal') + { + $showBranch = true; + break; + } + } $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->browse; $this->view->position[] = $this->lang->release->browse; - $this->view->releases = $this->release->getList($productID, $branch, $type, $orderBy, $pager); + $this->view->releases = $releases; $this->view->type = $type; $this->view->pager = $pager; + $this->view->showBranch = $showBranch; $this->display(); } diff --git a/module/release/model.php b/module/release/model.php index ea1e215de2..b647e47907 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -58,7 +58,7 @@ class releaseModel extends model */ public function getList($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc', $pager = null) { - $releases = $this->dao->select('t1.*, t2.name as productName')->from(TABLE_RELEASE)->alias('t1') + $releases = $this->dao->select('t1.*, t2.name as productName, t2.type as productType')->from(TABLE_RELEASE)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->where('t1.deleted')->eq(0) ->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi() @@ -84,8 +84,19 @@ class releaseModel extends model $releaseBuilds[] = $builds[$buildID]; } - $release->builds = $releaseBuilds; + + $branchName = ''; + if($release->branch != 'normal') + { + foreach(explode(',', $release->branch) as $releaseBranch) + { + $branchName .= $this->loadModel('branch')->getById($releaseBranch); + $branchName .= ','; + } + $branchName = trim($branchName, ','); + } + $release->branchName = empty($branchName) ? $this->lang->branch->main : $branchName; } return $releases; diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index ad9b6aa7c4..2f0fe5bf04 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -52,6 +52,9 @@ release->id;?> release->name;?> release->includedBuild;?> + + release->branch;?> + release->relatedProject;?> release->status;?> release->date;?> @@ -98,6 +101,11 @@ ?> + + + class='c-branch text-center'>branchName; ?> + + projectName;?> processStatus('release', $release);?> diff --git a/module/story/control.php b/module/story/control.php index 7179e888bb..25e576180b 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -263,7 +263,9 @@ class story extends control } else { - $response['locate'] = $this->session->storyList; + $sessionStoryList = $this->session->storyList; + if(count($_POST['branches']) > 1) $sessionStoryList = preg_replace('/branch=(\d+|[A-Za-z]+)/', 'branch=all', $this->session->storyList); + $response['locate'] = $sessionStoryList; } } } diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 7111526b98..ae9c9be281 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -520,4 +520,4 @@ $lang->requirement->linkStory = 'Link Story'; $lang->story->addBranch = 'Add %s'; $lang->story->deleteBranch = 'Delete %s'; -$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; +$lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 664d1a114b..71011fa6e5 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -520,4 +520,4 @@ $lang->requirement->linkStory = 'Link Story'; $lang->story->addBranch = 'Add %s'; $lang->story->deleteBranch = 'Delete %s'; -$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; +$lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index e11cd9a62c..de973be396 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -520,4 +520,4 @@ $lang->requirement->linkStory = 'Lier Story'; $lang->story->addBranch = 'Add %s'; $lang->story->deleteBranch = 'Delete %s'; -$lang->story->notice->branch = 'Each branch will establish a requirement, and the requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; +$lang->story->notice->branch = 'Each branch will establish a requirement. The requirements are twins. The twins requirements are synchronized except for the product, branch, module, plan, and stage fields. You can manually remove the twins relationship later'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 048756a3f8..86738be9c8 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -520,4 +520,4 @@ $lang->requirement->linkStory = "关联{$lang->SRCommon}"; $lang->story->addBranch = '添加%s'; $lang->story->deleteBranch = '删除%s'; -$lang->story->notice->branch = '每个分支会建立一个需求,需求间互为孪生关系,孪生需求间除产品、分支、模块、计划、阶段字段外均同步,后期您可以手动解除孪生关系'; +$lang->story->notice->branch = '每个分支会建立一个需求,需求间互为孪生关系。孪生需求间除产品、分支、模块、计划、阶段字段外均保持同步,后期您可以手动解除孪生关系。'; From f1b27ca35a68865c6f43a442a803f66810320058 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 9 Dec 2022 12:23:09 +0800 Subject: [PATCH 50/63] * fix bug #30745. --- module/execution/view/build.html.php | 18 ++++++++++++++++-- module/project/view/build.html.php | 18 ++++++++++++++++-- module/projectrelease/control.php | 4 +++- module/release/control.php | 4 +++- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/module/execution/view/build.html.php b/module/execution/view/build.html.php index de268f907f..38b6f48b2e 100644 --- a/module/execution/view/build.html.php +++ b/module/execution/view/build.html.php @@ -72,8 +72,22 @@ createLink('build', 'view', "build=$build->id"), $build->name);?> scmPath) echo "
      " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath, $build->scmPath, '_blank') : $build->scmPath) . '
      '; - if($build->filePath) echo "
      " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath, $build->filePath, '_blank') : $build->filePath) . '
      '; + if($build->scmPath) + { + $colorStyle = strpos($build->scmPath, 'http') === 0 ? "style='color:#2463c7;'" : ''; + echo "
      "; + echo ""; + echo $colorStyle ? html::a($build->scmPath, $build->scmPath, '_blank', $colorStyle) : $build->scmPath; + echo '
      '; + } + if($build->filePath) + { + $colorStyle = strpos($build->filePath, 'http') === 0 ? "style='color:#2463c7;'" : ''; + echo "
      "; + echo ""; + echo $colorStyle ? html::a($build->filePath, $build->filePath, '_blank', $colorStyle) : $build->filePath; + echo '
      '; + } ?> date?> diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 34820f516d..3f032ac745 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -103,8 +103,22 @@ scmPath) echo "
      " . (strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath, $build->scmPath, '_blank') : $build->scmPath) . '
      '; - if($build->filePath) echo "
      " . (strpos($build->filePath, 'http') === 0 ? html::a($build->filePath, $build->filePath, '_blank') : $build->filePath) . '
      '; + if($build->scmPath) + { + $colorStyle = strpos($build->scmPath, 'http') === 0 ? "style='color:#2463c7;'" : ''; + echo "
      "; + echo ""; + echo $colorStyle ? html::a($build->scmPath, $build->scmPath, '_blank', $colorStyle) : $build->scmPath; + echo '
      '; + } + if($build->filePath) + { + $colorStyle = strpos($build->filePath, 'http') === 0 ? "style='color:#2463c7;'" : ''; + echo "
      "; + echo ""; + echo $colorStyle ? html::a($build->filePath, $build->filePath, '_blank', $colorStyle) : $build->filePath; + echo '
      '; + } ?> date?> diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index f3f4b04e82..3aa33fb6b4 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -263,6 +263,7 @@ class projectrelease extends control foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage; $bugPager = new pager($type == 'bug' ? $recTotal : 0, $recPerPage, $type == 'bug' ? $pageID : 1); + $sort = common::appendOrder($orderBy); $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('id')->in($release->bugs) ->andWhere('deleted')->eq(0) @@ -271,8 +272,9 @@ class projectrelease extends control ->fetchAll(); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'linkedBug'); - $leftBugPager = new pager($type == 'leftBug' ? $recTotal : 0, $recPerPage, $type == 'leftBug' ? $pageID : 1); + $sort = common::appendOrder($orderBy); if($type == 'leftBug' and strpos($orderBy, 'severity_') !== false) $sort = str_replace('severity_', 'severityOrder_', $sort); + $leftBugPager = new pager($type == 'leftBug' ? $recTotal : 0, $recPerPage, $type == 'leftBug' ? $pageID : 1); $leftBugs = $this->dao->select("*, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG) ->where('id')->in($release->leftBugs) diff --git a/module/release/control.php b/module/release/control.php index 46712fb037..611f4b1684 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -199,6 +199,7 @@ class release extends control foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage; $bugPager = new pager($type == 'bug' ? $recTotal : 0, $recPerPage, $type == 'bug' ? $pageID : 1); + $sort = common::appendOrder($orderBy); $bugs = $this->dao->select('*')->from(TABLE_BUG) ->where('id')->in($release->bugs) ->andWhere('deleted')->eq(0) @@ -207,8 +208,9 @@ class release extends control ->fetchAll(); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'linkedBug'); - $leftBugPager = new pager($type == 'leftBug' ? $recTotal : 0, $recPerPage, $type == 'leftBug' ? $pageID : 1); + $sort = common::appendOrder($orderBy); if($type == 'leftBug' and strpos($orderBy, 'severity_') !== false) $sort = str_replace('severity_', 'severityOrder_', $sort); + $leftBugPager = new pager($type == 'leftBug' ? $recTotal : 0, $recPerPage, $type == 'leftBug' ? $pageID : 1); $leftBugs = $this->dao->select("*, IF(`severity` = 0, {$this->config->maxPriValue}, `severity`) as severityOrder")->from(TABLE_BUG) ->where('id')->in($release->leftBugs) From 68973d2a1967a15dade59080c97f80d1ef6e592e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 9 Dec 2022 13:20:40 +0800 Subject: [PATCH 51/63] * fix bug #30753. --- module/block/control.php | 5 +++++ module/block/view/reviewblock.html.php | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/module/block/control.php b/module/block/control.php index d3483b2d07..55475bd481 100755 --- a/module/block/control.php +++ b/module/block/control.php @@ -1951,6 +1951,11 @@ class block extends control $hasViewPriv['review'] = true; $count['review'] = count($reviews); $this->view->reviews = $reviews; + if($this->config->edition == 'max') + { + $this->app->loadLang('approval'); + $this->view->flows = $this->dao->select('module,name')->from(TABLE_WORKFLOW)->where('buildin')->eq(0)->fetchPairs('module', 'name'); + } } $this->view->selfCall = $this->selfCall; diff --git a/module/block/view/reviewblock.html.php b/module/block/view/reviewblock.html.php index b379ef8713..cd32e23dfc 100644 --- a/module/block/view/reviewblock.html.php +++ b/module/block/view/reviewblock.html.php @@ -29,13 +29,21 @@ type; - if($type == 'project') $type = 'review'; + if($type == 'projectreview') $type = 'review'; - $typeName = $lang->$type->common; + $typeName = ''; + if(isset($lang->{$review->type}->common)) $typeName = $lang->{$review->type}->common; if($type == 'story') $typeName = $lang->my->auditMenu->audit->story; + if($review->type == 'projectreview') $typeName = $lang->project->common; + if(isset($flows[$review->type])) $typeName = $flows[$review->type]; - $statusList = $lang->$type->statusList; + $statusList = array(); + if(isset($lang->$type->statusList)) $statusList = $lang->$type->statusList; if($type == 'attend') $statusList = $lang->attend->reviewStatusList; + if(!in_array($type, array('story', 'testcase', 'feedback', 'review')) and strpos(",{$config->my->oaObjectType},", ",$type,") === false) + { + $statusList = $lang->approval->nodeList; + } ?> id?> @@ -82,6 +90,10 @@ { common::printLink($module, 'view', $params, $reviewIcon, '', "class='btn' data-toggle='modal' title='{$lang->review->common}'", true, true); } + elseif(!in_array($module, array('story', 'testcase', 'feedback'))) + { + common::printLink($module, 'approvalreview', $params, $reviewIcon, '', "class='btn' data-toggle='modal' title='{$lang->review->common}'", true, true); + } else { common::printLink($module, $method, $params, $reviewIcon, '', "class='btn iframe' title='{$lang->review->common}'", true, true); From 26fc535d8256f192b2995397c4f19acd8a2fff99 Mon Sep 17 00:00:00 2001 From: Yagami Date: Fri, 9 Dec 2022 13:44:31 +0800 Subject: [PATCH 52/63] * Finish task #78677. --- module/testtask/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/testtask/model.php b/module/testtask/model.php index 4f837c3ba7..8841c5f707 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -91,7 +91,7 @@ class testtaskModel extends model ->beginIF($scopeAndStatus[0] == 'all')->andWhere('t1.product')->in($products)->fi() ->beginIF(strtolower($scopeAndStatus[1]) == 'totalstatus')->andWhere('t1.status')->in('blocked,doing,wait,done')->fi() ->beginIF(!in_array(strtolower($scopeAndStatus[1]), array('totalstatus', 'review'), true))->andWhere('t1.status')->eq($scopeAndStatus[1])->fi() - ->beginIF($branch !== 'all')->andWhere('t4.branch')->eq($branch)->fi() + ->beginIF($branch !== 'all')->andWhere("CONCAT(',', t4.branch, ',')")->like("%,$branch,%")->fi() ->beginIF($beginTime)->andWhere('t1.begin')->ge($beginTime)->fi() ->beginIF($endTime)->andWhere('t1.end')->le($endTime)->fi() ->beginIF($branch == BRANCH_MAIN) From d07a8a3e371aa011724b618073bfb883506723c5 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 9 Dec 2022 13:44:48 +0800 Subject: [PATCH 53/63] * Fix Bug #78695 --- module/execution/view/story.html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 15d06fd689..6ca7343939 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -408,7 +408,8 @@
      From 0b6503dfcf952ecbdb09360ac465eb49e5789d7e Mon Sep 17 00:00:00 2001 From: wangzemei Date: Fri, 9 Dec 2022 13:48:26 +0800 Subject: [PATCH 54/63] * Fix chosen class about execution --- module/execution/css/create.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/execution/css/create.css b/module/execution/css/create.css index b3ef4c9ba2..a71b046e42 100644 --- a/module/execution/css/create.css +++ b/module/execution/css/create.css @@ -31,7 +31,7 @@ #endLabel {white-space: nowrap;} #copyProjectModal .projectSelect {display: inline-block; margin-left: 10px; width: 20%;} #copyProjectModal .titleBox{position: relative; bottom: 3px; display: inline-block;} -a.chosen-single > div > b {top: -4px !important;} +#copyProjectModal .projectSelect a.chosen-single > div > b {top: -4px !important;} .productsBox a {border-radius: 2px !important;} .productsBox .required:after {right: -9.5px !important;} From 980b2998ad68c082a0fa172fdfff23adf1ac7c9c Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 9 Dec 2022 13:58:10 +0800 Subject: [PATCH 55/63] * Fix Bug #78688 --- module/execution/control.php | 2 +- module/execution/model.php | 4 ++++ module/product/control.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 1c1768fb15..0e3a109c25 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -898,7 +898,7 @@ class execution extends control $storyBugs = $this->loadModel('bug')->getStoryBugCounts($storyIdList, $executionID); $storyCases = $this->loadModel('testcase')->getStoryCaseCounts($storyIdList); - $plans = $this->execution->getPlans($products, 'skipParent|withMainPlan', $executionID); + $plans = $this->execution->getPlans($products, 'skipParent|withMainPlan|unexpired|noclosed', $executionID); $allPlans = array('' => ''); if(!empty($plans)) { diff --git a/module/execution/model.php b/module/execution/model.php index 3209275fcf..2b56bbae9b 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4656,6 +4656,8 @@ class executionModel extends model { $this->loadModel('productplan'); + $date = date('Y-m-d'); + $param = strtolower($param); $branchIdList = strpos($param, 'withmainplan') !== false ? array(BRANCH_MAIN => BRANCH_MAIN) : array(); $branchGroups = $this->getBranchByProduct(array_keys($products), $executionID, 'noclosed'); @@ -4686,6 +4688,8 @@ class executionModel extends model ->where('t1.product')->in(array_keys($products)) ->andWhere('t1.deleted')->eq(0) ->andWhere($branchQuery) + ->beginIF(strpos($param, 'unexpired') !== false)->andWhere('t1.end')->ge($date)->fi() + ->beginIF(strpos($param, 'noclosed') !== false)->andWhere('t1.status')->ne('closed')->fi() ->orderBy('t1.begin desc') ->fetchAll('id'); diff --git a/module/product/control.php b/module/product/control.php index 368b71b08b..0d4a8e9e9d 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -257,7 +257,7 @@ class product extends control $this->products = $this->product->getProducts($projectID, 'all', '', false); $projectProducts = $this->product->getProducts($projectID); - $productPlans = $this->execution->getPlans($projectProducts, 'skipParent', $projectID); + $productPlans = $this->execution->getPlans($projectProducts, 'skipParent,unexpired,noclosed', $projectID); if($browseType == 'bybranch') $param = $branchID; $stories = $this->story->getExecutionStories($projectID, $productID, $branchID, $sort, $browseType, $param, $storyType, '', $pager); From 6f9d1f9fdbf6fb3bc444d3b758a214dee689d3ff Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Fri, 9 Dec 2022 06:37:38 +0000 Subject: [PATCH 56/63] * Handle feedback #1707. --- module/file/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/file/control.php b/module/file/control.php index c19efc9cc2..7bf6ae7588 100755 --- a/module/file/control.php +++ b/module/file/control.php @@ -131,7 +131,7 @@ class file extends control { echo(js::alert($this->lang->file->accessDenied)); if(isonlybody()) return print(js::reload('parent.parent')); - return print(js::locate(helper::createLink('my', 'index'))); + return print(js::locate(helper::createLink('my', 'index'), 'parent.parent')); } /* Judge the mode, down or open. */ From c87bc410188a64624fcea91a6eec3c7b65c46aba Mon Sep 17 00:00:00 2001 From: mayue Date: Fri, 9 Dec 2022 14:53:14 +0800 Subject: [PATCH 57/63] * Restore code. --- module/execution/model.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 38ec18c4bf..15be632a16 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1604,13 +1604,7 @@ class executionModel extends model ->page($pager) ->fetchAll('id'); - if(empty($productID) and !empty($executions)) - { - $projectProductList = $this->dao->select('t1.project, t1.product, t2.deleted')->from(TABLE_PROJECTPRODUCT)->alias('t1') - ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') - ->where('t1.project')->in(array_keys($executions)) - ->fetchAll('project'); - } + if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->fetchPairs(); $hours = $this->loadModel('project')->computerProgress($executions); $burns = $this->getBurnData($executions); @@ -1674,11 +1668,9 @@ class executionModel extends model } /* Bind execution product */ - if(!empty($projectProductList) and !empty($projectProductList[$execution->id])) + if(!empty($projectProductIdList) and !empty($projectProductIdList[$execution->id])) { - $execution->product = $projectProductList[$execution->id]->product; - - if($projectProductList[$execution->id]->deleted) unset($executions[$key]); + $execution->product = $projectProductIdList[$execution->id]; } } return array_values($executions); From 9158f6f79ff5ed42d2ca2db0670af9ed79f23f56 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 9 Dec 2022 15:38:54 +0800 Subject: [PATCH 58/63] * Fix Bug #30616 --- module/build/js/create.js | 10 ++++++++++ module/build/view/edit.html.php | 2 +- module/projectrelease/control.php | 1 - module/release/model.php | 9 +++++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/module/build/js/create.js b/module/build/js/create.js index 836a71ed59..0626390b86 100644 --- a/module/build/js/create.js +++ b/module/build/js/create.js @@ -25,6 +25,7 @@ $().ready(function() { var projectID = $('#project').val(); var executionID = $('#execution').val(); + if($(this).val() == 'no') { $('#execution').closest('tr').show(); @@ -35,7 +36,16 @@ $().ready(function() { $('#execution').closest('tr').hide(); $('#buildBox').closest('tr').show(); + + $.ajaxSettings.async = false; loadProducts(projectID); + var productID = $('#product').val(); + $.get(createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=builds&build=&branch=all&index=&needCreate=&type=noempty,notrunk,separate,singled&extra=multiple'), function(data) + { + if(data) $('#buildBox').html(data); + $('#builds').attr('data-placeholder', multipleSelect).chosen(); + }); + $.ajaxSettings.async = true; } }); $('#product').change(); diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php index 45df680489..82f83870e5 100644 --- a/module/build/view/edit.html.php +++ b/module/build/view/edit.html.php @@ -37,7 +37,7 @@ build->notice->changeProduct;?> - '> + execution)) echo 'hidden'?>'> build->getBuildPairs($this->view->product->id, 'all', 'notrunk|withbranch|hasproject', $projectID, 'project', '', false); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); - $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->create; $this->view->projectID = $projectID; $this->view->builds = $builds; diff --git a/module/release/model.php b/module/release/model.php index b647e47907..2b089d5860 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -235,6 +235,7 @@ class releaseModel extends model $linkedBuilds = array_merge($linkedBuilds, explode(',', $build->builds)); } if($linkedBuilds) $builds += $this->dao->select('id,project,branch,builds,stories,bugs')->from(TABLE_BUILD)->where('id')->in($linkedBuilds)->fetchAll('id'); + $branches = array(); foreach($builds as $build) { foreach(explode(',', $build->branch) as $buildBranch) @@ -339,10 +340,14 @@ class releaseModel extends model /* update release project and branch */ if($release->build) { - $builds = $this->dao->select('project, branch')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + $builds = $this->dao->select('project, branch')->from(TABLE_BUILD)->where('id')->in($release->build)->fetchAll(); + $branches = array(); foreach($builds as $build) { - $branches[$build->branch] = $build->branch; + foreach(explode(',', $build->branch) as $buildBranch) + { + if(!isset($branches[$buildBranch])) $branches[$buildBranch] = $buildBranch; + } $projects[$build->project] = $build->project; } $release->build = ',' . trim($release->build, ',') . ','; From 7405efe5c7e87386add8af77da44c3a513ef2cb6 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 9 Dec 2022 15:39:55 +0800 Subject: [PATCH 59/63] * Code for task#78690. --- module/product/control.php | 2 +- module/productplan/model.php | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 368b71b08b..8f1001d8f1 100755 --- a/module/product/control.php +++ b/module/product/control.php @@ -1056,7 +1056,7 @@ class product extends control $param = strtolower($param); if(strpos($param, 'forstory') === false) { - $plans = $this->loadModel('productplan')->getPairs($productID, $branch, $expired, strpos($param, 'skipparent') !== false); + $plans = $this->loadModel('productplan')->getPairs($productID, empty($branch) ? 'all' : $branch, $expired, strpos($param, 'skipparent') !== false); } else { diff --git a/module/productplan/model.php b/module/productplan/model.php index 04bfe7f712..ad8a367e33 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -466,10 +466,23 @@ class productplanModel extends model */ public function getBranchPlanPairs($productID, $branches = '', $skipParent = false) { + $branchQuery = ''; + if($branches !== '' and $branches !== 'all') + { + $branchQuery .= '('; + if(!is_array($branches)) $branches = explode(',', $branches); + foreach($branches as $branchID) + { + $branchQuery .= "CONCAT(',', branch, ',') LIKE '%,$branchID,%'"; + if($branchID != end($branches)) $branchQuery .= ' OR '; + } + $branchQuery .= ')'; + } + $plans = $this->dao->select('parent,branch,id,title,begin,end')->from(TABLE_PRODUCTPLAN) ->where('product')->eq($productID) ->andWhere('deleted')->eq(0) - ->beginIF($branches != '')->andWhere('branch')->in($branches)->fi() + ->beginIF(!empty($branchQuery))->andWhere($branchQuery)->fi() ->orderBy('begin desc') ->fetchAll('id'); @@ -482,6 +495,7 @@ class productplanModel extends model if($plan->parent > 0 and isset($plans[$plan->parent])) $plan->title = $plans[$plan->parent]->title . ' /' . $plan->title; $planPairs[$branch][$planID] = $plan->title . ' [' . $plan->begin . '~' . $plan->end . ']'; + if($branch !== BRANCH_MAIN) $planPairs[BRANCH_MAIN][$planID] = $plan->title . ' [' . $plan->begin . '~' . $plan->end . ']'; } } return $planPairs; From e6301a8ec3ca465612a6e28fa41e69099b922d19 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 9 Dec 2022 16:03:32 +0800 Subject: [PATCH 60/63] * Fix Bug #30616 --- module/build/control.php | 5 ++++- module/build/model.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index f701326654..b570b1938f 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -643,7 +643,10 @@ class build extends control if($build->branch) { - foreach(explode(',', $build->branch) as $branchID) $branches += array($branchID => $branchPairs[$branchID]); + foreach(explode(',', $build->branch) as $branchID) + { + if(isset($branchPairs[$branchID])) $branches += array($branchID => $branchPairs[$branchID]); + } } $this->config->product->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); diff --git a/module/build/model.php b/module/build/model.php index e1718d1209..6e3f5ff96a 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -457,7 +457,7 @@ class buildModel extends model ->get(); $product = $this->loadModel('product')->getByID($build->product); - if(!empty($product) and $product->type != 'normal' and !isset($_POST['branch'])) + if(!empty($product) and $product->type != 'normal' and !isset($_POST['branch']) and isset($_POST['product'])) { $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); dao::$errors['branch'] = sprintf($this->lang->error->notempty, $this->lang->product->branch); From 4cf85b7656cdf1045b6fd6a725689d3c04a0a23d Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 9 Dec 2022 16:06:34 +0800 Subject: [PATCH 61/63] * Fix Bug #30616 --- module/projectrelease/control.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 385c074093..279122c073 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -147,6 +147,7 @@ class projectrelease extends control $builds = $this->build->getBuildPairs($this->view->product->id, 'all', 'notrunk|withbranch|hasproject', $projectID, 'project', '', false); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); + $this->view->title = $this->view->project->name . $this->lang->colon . $this->lang->release->create; $this->view->projectID = $projectID; $this->view->builds = $builds; From 240111bc70f96ecdf7af90da48e62b32fd4dbcd4 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 9 Dec 2022 16:23:57 +0800 Subject: [PATCH 62/63] * code task #79283. --- module/my/control.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/my/control.php b/module/my/control.php index f4f4a98646..75e03d3233 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -962,7 +962,10 @@ EOF; } else { - $this->lang->my->auditMenu->audit = $this->my->getReviewingTypeList(); + $typeList = $this->my->getReviewingTypeList(); + if(!isset($typeList->$browseType)) $browseType = 'all'; + + $this->lang->my->auditMenu->audit = $typeList; $reviewList = $this->my->getReviewingList($browseType, $orderBy, $pager); } From 81d3403a20c08b3075eca1eba080ce562947a429 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 9 Dec 2022 16:54:17 +0800 Subject: [PATCH 63/63] * code for task #79279. --- module/build/control.php | 2 ++ module/build/model.php | 2 +- module/project/view/build.html.php | 7 ++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index f701326654..5b48118a20 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -283,6 +283,8 @@ class build extends control foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage; /* Set menu. */ + $objectType = 'execution'; + $objectID = $build->execution; if($this->app->tab == 'project') { $this->loadModel('project')->setMenu($build->project); diff --git a/module/build/model.php b/module/build/model.php index e1718d1209..9f090d2793 100644 --- a/module/build/model.php +++ b/module/build/model.php @@ -63,7 +63,7 @@ class buildModel extends model */ public function getProjectBuilds($projectID = 0, $type = 'all', $param = 0, $orderBy = 't1.date_desc,t1.id_desc', $pager = null) { - return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t3.name as productName') + return $this->dao->select('t1.*, t2.name as executionName, t2.id as executionID, t2.deleted as executionDeleted, t3.name as productName') ->from(TABLE_BUILD)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id') diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php index 37540fa8c5..c1f1db4e25 100644 --- a/module/project/view/build.html.php +++ b/module/project/view/build.html.php @@ -84,7 +84,12 @@ multiple):?> execution):?> - executionName;?> + + executionName;?> + executionDeleted):?> + build->deleted;?> + +