@@ -92,7 +94,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
diff --git a/db/update17.4.sql b/db/update17.4.sql index 3c90e379ff..0b52eaead8 100644 --- a/db/update17.4.sql +++ b/db/update17.4.sql @@ -217,3 +217,5 @@ INSERT IGNORE INTO `zt_workflowfield` (`module`, `field`, `type`, `length`, `nam ('productplan', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 12, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), ('release', 'createdBy', 'varchar', '30', '由谁创建', 'select', '', 'user', '', '', '', 14, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'), ('release', 'createdDate', 'datetime', '', '创建时间', 'datetime', '', '', '', '', '', 15, 0, 0, '0', '0', '0', '1', 1, 'buildin', '', '', '2022-08-02 14:49', '', '0000-00-00 00:00:00'); + +UPDATE `zt_project` SET `closedDate`='' AND `closedBy`='' WHERE `status` != 'closed'; diff --git a/module/block/control.php b/module/block/control.php index fecf665e14..1b826ea93b 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -599,7 +599,7 @@ class block extends control { $limit = ($this->viewType == 'json' or !isset($this->params->count)) ? 0 : (int)$this->params->count; $todos = $this->loadModel('todo')->getList('all', $this->app->user->account, 'wait, doing', $limit, $pager = null, $orderBy = 'date, begin'); - $uri = $this->app->getURI(true); + $uri = $this->createLink('my', 'index'); $this->session->set('todoList', $uri, 'my'); $this->session->set('bugList', $uri, 'qa'); @@ -629,7 +629,7 @@ class block extends control */ public function printTaskBlock() { - $this->session->set('taskList', $this->app->getURI(true), 'execution'); + $this->session->set('taskList', $this->createLink('my', 'index'), 'execution'); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) return; $account = $this->app->user->account; @@ -647,7 +647,7 @@ class block extends control */ public function printBugBlock() { - $this->session->set('bugList', $this->app->getURI(true), 'qa'); + $this->session->set('bugList', $this->createLink('my', 'index'), 'qa'); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) return; $projectID = $this->lang->navGroup->qa == 'project' ? $this->session->project : 0; @@ -663,7 +663,7 @@ class block extends control */ public function printCaseBlock() { - $this->session->set('caseList', $this->app->getURI(true), 'qa'); + $this->session->set('caseList', $this->createLink('my', 'index'), 'qa'); $this->app->loadLang('testcase'); $this->app->loadLang('testtask'); @@ -708,9 +708,10 @@ class block extends control { $this->app->loadLang('testtask'); - $this->session->set('productList', $this->app->getURI(true), 'product'); - $this->session->set('testtaskList', $this->app->getURI(true), 'qa'); - $this->session->set('buildList', $this->app->getURI(true), 'execution'); + $uri = $this->createLink('my', 'index'); + $this->session->set('productList', $uri, 'product'); + $this->session->set('testtaskList', $uri, 'qa'); + $this->session->set('buildList', $uri, 'execution'); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) return; $this->view->testtasks = $this->dao->select('distinct t1.*,t2.name as productName,t3.name as buildName,t4.name as projectName')->from(TABLE_TESTTASK)->alias('t1') @@ -736,7 +737,7 @@ class block extends control */ public function printStoryBlock() { - $this->session->set('storyList', $this->app->getURI(true), 'product'); + $this->session->set('storyList', $this->createLink('my', 'index'), 'product'); if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) return; $this->app->loadClass('pager', $static = true); diff --git a/module/block/view/dashboard.html.php b/module/block/view/dashboard.html.php index 9746ce22e8..5390ef52c8 100644 --- a/module/block/view/dashboard.html.php +++ b/module/block/view/dashboard.html.php @@ -59,7 +59,7 @@ $useGuest = $this->app->user->account == 'guest'; - fetch('block', 'printBlock', "id=$block->id&module=$module")?> +
@@ -94,7 +94,7 @@ $useGuest = $this->app->user->account == 'guest'; - fetch('block', 'printBlock', "id=$block->id&module=$module")?> + @@ -136,6 +136,11 @@ $(function() }); } setTimeout(checkRemind, 1000); + + $('#dashboard .row .panel').each(function() + { + refreshBlock($(this)); + }) }); getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> diff --git a/module/bug/model.php b/module/bug/model.php index f4e4c1f5cd..f4e2b71060 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -1720,8 +1720,8 @@ class bugModel extends model ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi() ->beginIF($type != 'all' and $type != 'bySearch')->andWhere("t1.`$type`")->eq($account)->fi() ->beginIF($type == 'bySearch' and $moduleName == 'workBug')->andWhere("t1.assignedTo")->eq($account)->fi() - ->beginIF($type == 'bySearch' and $moduleName == 'contributeBug') ->beginIF($type == 'assignedTo' and $moduleName == 'workBug')->andWhere('t1.status')->ne('closed')->fi() + ->beginIF($type == 'bySearch' and $moduleName == 'contributeBug') ->andWhere('t1.openedBy', 1)->eq($account) ->orWhere('t1.closedBy')->eq($account) ->orWhere('t1.resolvedBy')->eq($account) diff --git a/module/execution/config.php b/module/execution/config.php index f9b0af12cf..46880f681f 100644 --- a/module/execution/config.php +++ b/module/execution/config.php @@ -119,6 +119,39 @@ $config->execution->search['params']['canceledDate'] = array('operator' => '=' $config->execution->search['params']['lastEditedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); $config->execution->search['params']['activatedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$app->loadLang('execution'); +$config->execution->all = new stdclass(); +$config->execution->all->search['module'] = 'execution'; +$config->execution->all->search['fields']['name'] = $lang->execution->execName; +$config->execution->all->search['fields']['id'] = $lang->execution->execId; +$config->execution->all->search['fields']['status'] = $lang->execution->execStatus; +$config->execution->all->search['fields']['project'] = $lang->execution->project; +$config->execution->all->search['fields']['PM'] = $lang->execution->owner; +$config->execution->all->search['fields']['openedBy'] = $lang->execution->openedBy; +$config->execution->all->search['fields']['openedDate'] = $lang->execution->openedDate; +$config->execution->all->search['fields']['begin'] = $lang->execution->begin; +$config->execution->all->search['fields']['end'] = $lang->execution->end; +$config->execution->all->search['fields']['realBegan'] = $lang->execution->realBegan; +$config->execution->all->search['fields']['realEnd'] = $lang->execution->realEnd; +$config->execution->all->search['fields']['closedBy'] = $lang->execution->closedBy; +$config->execution->all->search['fields']['lastEditedDate'] = $lang->execution->lastEditedDate; +$config->execution->all->search['fields']['closedDate'] = $lang->execution->closedDate; + +$config->execution->all->search['params']['name'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->execution->all->search['params']['id'] = array('operator' => '=', 'control' => 'input', 'values' => ''); +$config->execution->all->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => array('') + $lang->execution->statusList); +$config->execution->all->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => ''); +$config->execution->all->search['params']['PM'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->execution->all->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->execution->all->search['params']['openedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->execution->all->search['params']['begin'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->execution->all->search['params']['end'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->execution->all->search['params']['realBegan'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->execution->all->search['params']['realEnd'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->execution->all->search['params']['closedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->execution->all->search['params']['lastEditedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->execution->all->search['params']['closedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); + $config->printKanban = new stdClass(); $config->printKanban->col['story'] = 1; $config->printKanban->col['wait'] = 2; diff --git a/module/execution/control.php b/module/execution/control.php index d1b3a9c8f4..a8a7f93e52 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -241,7 +241,7 @@ class execution extends control $this->view->moduleID = $moduleID; $this->view->moduleTree = $this->tree->getTaskTreeMenu($executionID, $productID, $startModuleID = 0, array('treeModel', 'createTaskLink'), $extra); $this->view->memberPairs = $memberPairs; - $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); + $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products)); $this->view->setModule = true; $this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable. $this->view->showBranch = $showBranch; @@ -3678,13 +3678,14 @@ class execution extends control * @param int $projectID * @param string $orderBy * @param int $productID + * @param string $param * @param int $recTotal * @param int $recPerPage * @param int $pageID * @access public * @return void */ - public function all($status = 'undone', $projectID = 0, $orderBy = 'order_asc', $productID = 0, $recTotal = 0, $recPerPage = 100, $pageID = 1) + public function all($status = 'undone', $projectID = 0, $orderBy = 'order_asc', $productID = 0, $param = '', $recTotal = 0, $recPerPage = 100, $pageID = 1) { $this->app->loadLang('my'); $this->app->loadLang('product'); @@ -3714,10 +3715,14 @@ class execution extends control $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); + $queryID = ($status == 'bySearch') ? (int)$param : 0; + $actionURL = $this->createLink('execution', 'all', "status=bySearch&projectID=$projectID&orderBy=$orderBy&productID=$productID¶m=myQueryID"); + $this->execution->buildSearchFrom($queryID, $actionURL); + $this->view->title = $this->lang->execution->allExecutions; $this->view->position[] = $this->lang->execution->allExecutions; - $executionStats = $this->project->getStats($projectID, $status, $productID, 0, 30, $orderBy, $pager); + $executionStats = $this->project->getStats($projectID, $status, $productID, 0, 30, $orderBy, $pager, false, $queryID); $parentIdList = array(); foreach($executionStats as $execution) @@ -3742,6 +3747,7 @@ class execution extends control $this->view->users = $this->loadModel('user')->getPairs('noletter'); $this->view->status = $status; $this->view->from = $from; + $this->view->param = $param; $this->view->isStage = (isset($project->model) and $project->model == 'waterfall') ? true : false; $this->display(); diff --git a/module/execution/css/all.css b/module/execution/css/all.css index 36584c5c7a..f13f24181c 100644 --- a/module/execution/css/all.css +++ b/module/execution/css/all.css @@ -35,3 +35,4 @@ canvas {height: 28px;} .parent.has-child.c-name.flex, .table-child-bottom > .c-name.flex {border-bottom: 1px solid #cbd0db !important;} .parent.has-child.c-name.flex {margin-bottom: -2px !important;} #tableCustomBtn {padding-bottom: 5px;} +#bysearchTab {margin-left: 5px;} diff --git a/module/execution/lang/de.php b/module/execution/lang/de.php index e3a93dd771..0261d10f35 100644 --- a/module/execution/lang/de.php +++ b/module/execution/lang/de.php @@ -137,6 +137,7 @@ $lang->execution->batchCreateTask = 'Batch create task'; $lang->execution->kanbanNoLinkProduct = "Kanban not linked {$lang->productCommon}"; $lang->execution->myTask = "My Task"; $lang->execution->list = "{$lang->executionCommon} List"; +$lang->execution->allProject = 'All'; /* Fields of zt_team. */ $lang->execution->root = 'Root'; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 37254e4b4c..3d8cbb0fdf 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -137,11 +137,12 @@ $lang->execution->batchCreateTask = 'Batch create task'; $lang->execution->kanbanNoLinkProduct = "Kanban not linked {$lang->productCommon}"; $lang->execution->myTask = "My Task"; $lang->execution->list = 'List'; +$lang->execution->allProject = 'All'; /* Fields of zt_team. */ $lang->execution->root = 'Root'; -$lang->execution->estimate = 'estimate'; -$lang->execution->consumed = 'consumed'; +$lang->execution->estimate = 'Estimate'; +$lang->execution->consumed = 'Consumed'; $lang->execution->left = 'Left'; if($this->config->systemMode == 'new') $lang->execution->copyTeamTip = "copy Project/{$lang->execution->common} team members"; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index 60f4d20c71..6352bcc766 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -137,6 +137,7 @@ $lang->execution->batchCreateTask = 'Batch create task'; $lang->execution->kanbanNoLinkProduct = "Kanban not linked {$lang->productCommon}"; $lang->execution->myTask = "My Task"; $lang->execution->list = "{$lang->executionCommon} List"; +$lang->execution->allProject = 'Tous'; /* Fields of zt_team. */ $lang->execution->root = 'Root'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index 5025ccf4de..363002d338 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -137,6 +137,7 @@ $lang->execution->batchCreateTask = '批量建任务'; $lang->execution->kanbanNoLinkProduct = "看板没有关联{$lang->productCommon}"; $lang->execution->myTask = "我的任务"; $lang->execution->list = '列表'; +$lang->execution->allProject = '全部项目'; /* Fields of zt_team. */ $lang->execution->root = '源ID'; diff --git a/module/execution/model.php b/module/execution/model.php index 1cce86f1be..9a090b9465 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -949,6 +949,8 @@ class executionModel extends model ->setDefault('status', 'doing') ->setDefault('lastEditedBy', $this->app->user->account) ->setDefault('lastEditedDate', $now) + ->setDefault('closedBy', '') + ->setDefault('closedDate', '') ->stripTags($this->config->execution->editor->activate['id'], $this->config->allowedTags) ->remove('comment,readjustTime,readjustTask') ->get(); @@ -4722,4 +4724,23 @@ class executionModel extends model echo ''; } } + + /* + * Build search form + * + * @param int $queryID + * @param string $actionURL + * @return void + * */ + public function buildSearchFrom($queryID, $actionURL) + { + $this->config->execution->all->search['queryID'] = $queryID; + $this->config->execution->all->search['actionURL'] = $actionURL; + + $projectPairs = array(0 => ''); + $projectPairs += $this->loadModel('project')->getPairsByProgram(); + $this->config->execution->all->search['params']['project']['values'] = $projectPairs + array('all' => $this->lang->execution->allProject); + + $this->loadModel('search')->setSearchParams($this->config->execution->all->search); + } } diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php index 512b25aae3..beb720a7e2 100644 --- a/module/execution/view/all.html.php +++ b/module/execution/view/all.html.php @@ -59,6 +59,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN()) execution->selectProject}'");?> + execution->byQuery;?>@@ -92,7 +94,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())