diff --git a/db/update17.6.1.sql b/db/update17.6.1.sql new file mode 100644 index 0000000000..e8749557cf --- /dev/null +++ b/db/update17.6.1.sql @@ -0,0 +1 @@ +ALTER table `zt_project` ADD `noExecution` enum('0', '1') NOT NULL DEFAULT '0'; diff --git a/db/zentao.sql b/db/zentao.sql index d5266fc5e3..da4c5c0d2b 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1193,6 +1193,7 @@ CREATE TABLE IF NOT EXISTS `zt_project` ( `vision` varchar(10) NOT NULL DEFAULT 'rnd', `displayCards` smallint(6) NOT NULL default '0', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', + `noExecution` enum('0', '1') NOT NULL DEFAULT '0', `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `parent` (`parent`), diff --git a/module/block/lang/zh-tw.php b/module/block/lang/zh-tw.php index 1929912983..030dff1817 100644 --- a/module/block/lang/zh-tw.php +++ b/module/block/lang/zh-tw.php @@ -260,14 +260,11 @@ $lang->block->default['full']['my']['4']['grid'] = 4; $lang->block->default['full']['my']['4']['source'] = 'todo'; $lang->block->default['full']['my']['4']['params']['count'] = '20'; -if($config->systemMode == 'new') -{ - $lang->block->default['full']['my']['5']['title'] = '項目統計'; - $lang->block->default['full']['my']['5']['block'] = 'statistic'; - $lang->block->default['full']['my']['5']['source'] = 'project'; - $lang->block->default['full']['my']['5']['grid'] = 8; - $lang->block->default['full']['my']['5']['params']['count'] = '20'; -} +$lang->block->default['full']['my']['5']['title'] = '項目統計'; +$lang->block->default['full']['my']['5']['block'] = 'statistic'; +$lang->block->default['full']['my']['5']['source'] = 'project'; +$lang->block->default['full']['my']['5']['grid'] = 8; +$lang->block->default['full']['my']['5']['params']['count'] = '20'; $lang->block->default['full']['my']['6']['title'] = '我的貢獻'; $lang->block->default['full']['my']['6']['block'] = 'contribute'; @@ -292,23 +289,15 @@ $lang->block->default['full']['my']['8']['params']['issueCount'] = '20'; $lang->block->default['full']['my']['8']['params']['storyCount'] = '20'; $lang->block->default['full']['my']['8']['params']['meetingCount'] = '20'; -if($config->systemMode == 'new') -{ - $lang->block->default['full']['my']['9']['title'] = '項目人力投入'; - $lang->block->default['full']['my']['9']['block'] = 'projectteam'; - $lang->block->default['full']['my']['9']['source'] = 'project'; - $lang->block->default['full']['my']['9']['grid'] = 8; -} +$lang->block->default['full']['my']['9']['title'] = '項目人力投入'; +$lang->block->default['full']['my']['9']['block'] = 'projectteam'; +$lang->block->default['full']['my']['9']['source'] = 'project'; +$lang->block->default['full']['my']['9']['grid'] = 8; $lang->block->default['full']['my']['10']['title'] = '項目列表'; $lang->block->default['full']['my']['10']['block'] = 'project'; $lang->block->default['full']['my']['10']['source'] = 'project'; $lang->block->default['full']['my']['10']['grid'] = 8; -if($config->systemMode == 'classic') -{ - $lang->block->default['full']['my']['10']['block'] = 'execution'; - $lang->block->default['full']['my']['10']['source'] = 'execution'; -} $lang->block->default['full']['my']['10']['params']['orderBy'] = 'id_desc'; $lang->block->default['full']['my']['10']['params']['count'] = '15'; @@ -334,7 +323,7 @@ $lang->block->availableBlocks->issue = '我的問題'; $lang->block->availableBlocks->meeting = '我的會議'; $lang->block->availableBlocks->feedback = '我的反饋'; -if($config->systemMode == 'new') $lang->block->moduleList['project'] = '項目'; +$lang->block->moduleList['project'] = '項目'; $lang->block->moduleList['product'] = $lang->productCommon; $lang->block->moduleList['execution'] = $lang->execution->common; $lang->block->moduleList['qa'] = '測試'; @@ -345,7 +334,7 @@ $lang->block->modules['project']->availableBlocks = new stdclass(); $lang->block->modules['project']->availableBlocks->project = '項目列表'; $lang->block->modules['project']->availableBlocks->recentproject = '近期項目'; $lang->block->modules['project']->availableBlocks->statistic = '項目統計'; -if($config->systemMode == 'new') $lang->block->modules['project']->availableBlocks->projectteam = '項目人力投入'; +$lang->block->modules['project']->availableBlocks->projectteam = '項目人力投入'; $lang->block->modules['scrum']['index'] = new stdclass(); $lang->block->modules['scrum']['index']->availableBlocks = new stdclass(); @@ -502,7 +491,7 @@ $lang->block->typeList->testtask['done'] = '已測版本'; $lang->block->typeList->testtask['all'] = '全部'; $lang->block->modules['project']->moreLinkList = new stdclass(); -$lang->block->modules['project']->moreLinkList->recentproject = $config->systemMode == 'new' ? 'project|browse|' : 'execution|all|'; +$lang->block->modules['project']->moreLinkList->recentproject = 'project|browse|'; $lang->block->modules['project']->moreLinkList->statistic = 'project|browse|'; $lang->block->modules['project']->moreLinkList->project = 'project|browse|'; $lang->block->modules['project']->moreLinkList->cmmireport = 'weekly|index|'; diff --git a/module/bug/config.php b/module/bug/config.php index ad67ba65e3..e330b23679 100644 --- a/module/bug/config.php +++ b/module/bug/config.php @@ -38,18 +38,10 @@ $config->bug->exportFields = 'id, product, branch, module, project, execution, s lastEditedBy, lastEditedDate, files ,feedbackBy, notifyEmail'; -if($config->systemMode == 'classic') $config->bug->exportFields = str_replace(' project,', '', $config->bug->exportFields); $config->bug->list->customCreateFields = 'execution,noticefeedbackBy,story,task,pri,severity,os,browser,deadline,mailto,keywords'; $config->bug->list->customBatchEditFields = 'type,severity,pri,productplan,assignedTo,deadline,resolvedBy,resolution,os,browser,keywords'; -if($config->systemMode == 'new') -{ - $config->bug->list->customBatchCreateFields = 'project,execution,steps,type,pri,deadline,severity,os,browser,keywords'; -} -else -{ - $config->bug->list->customBatchCreateFields = 'execution,steps,type,pri,deadline,severity,os,browser,keywords'; -} +$config->bug->list->customBatchCreateFields = 'project,execution,steps,type,pri,deadline,severity,os,browser,keywords'; $config->bug->custom = new stdclass(); $config->bug->custom->createFields = $config->bug->list->customCreateFields; @@ -83,7 +75,7 @@ $config->bug->search['fields']['status'] = $lang->bug->status; $config->bug->search['fields']['confirmed'] = $lang->bug->confirmed; $config->bug->search['fields']['story'] = $lang->bug->story; -if($config->systemMode == 'new') $config->bug->search['fields']['project'] = $lang->bug->project; +$config->bug->search['fields']['project'] = $lang->bug->project; $config->bug->search['fields']['product'] = $lang->bug->product; $config->bug->search['fields']['branch'] = ''; $config->bug->search['fields']['plan'] = $lang->bug->productplan; @@ -129,7 +121,7 @@ $config->bug->search['params']['status'] = array('operator' => '=', $config->bug->search['params']['confirmed'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->confirmedList); $config->bug->search['params']['story'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); -if($config->systemMode == 'new') $config->bug->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => ''); +$config->bug->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->bug->search['params']['product'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->bug->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => ''); $config->bug->search['params']['plan'] = array('operator' => '=', 'control' => 'select', 'values' => ''); @@ -209,15 +201,12 @@ $config->bug->datatable->fieldList['type']['fixed'] = 'no'; $config->bug->datatable->fieldList['type']['width'] = '90'; $config->bug->datatable->fieldList['type']['required'] = 'no'; -if($config->systemMode == 'new') -{ - $config->bug->datatable->fieldList['project']['title'] = 'project'; - $config->bug->datatable->fieldList['project']['fixed'] = 'no'; - $config->bug->datatable->fieldList['project']['width'] = '120'; - $config->bug->datatable->fieldList['project']['required'] = 'no'; - $config->bug->datatable->fieldList['project']['control'] = 'hidden'; - $config->bug->datatable->fieldList['project']['dataSource'] = array('module' => 'product', 'method' => 'getProjectPairsByProduct', 'params' => '$productID'); -} +$config->bug->datatable->fieldList['project']['title'] = 'project'; +$config->bug->datatable->fieldList['project']['fixed'] = 'no'; +$config->bug->datatable->fieldList['project']['width'] = '120'; +$config->bug->datatable->fieldList['project']['required'] = 'no'; +$config->bug->datatable->fieldList['project']['control'] = 'hidden'; +$config->bug->datatable->fieldList['project']['dataSource'] = array('module' => 'product', 'method' => 'getProjectPairsByProduct', 'params' => '$productID'); $config->bug->datatable->fieldList['execution']['title'] = 'execution'; $config->bug->datatable->fieldList['execution']['fixed'] = 'no'; diff --git a/module/bug/control.php b/module/bug/control.php index a77e087cab..7ca593e3ce 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -630,20 +630,13 @@ class bug extends control /* Get executions. */ $executions = array(0 => ''); - if(isset($projects[$projectID]) or $this->config->systemMode == 'classic') $executions += $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID); + if(isset($projects[$projectID])) $executions += $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID); $execution = $executionID ? $this->loadModel('execution')->getByID($executionID) : ''; $executions = isset($executions[$executionID]) ? $executions : $executions + array($executionID => $execution->name); /* Set custom. */ foreach(explode(',', $this->config->bug->list->customCreateFields) as $field) $customFields[$field] = $this->lang->bug->$field; - /* In repair classic mode, when the project is required, the asterisk is not displayed. */ - if($this->config->systemMode == 'classic' and strpos(",{$this->config->bug->create->requiredFields},", ',project,') !== false) - { - $this->config->bug->create->requiredFields = str_replace(',project,', ',execution,', ",{$this->config->bug->create->requiredFields},"); - $this->config->bug->create->requiredFields = trim($this->config->bug->create->requiredFields, ','); - } - $this->view->title = isset($this->products[$productID]) ? $this->products[$productID] . $this->lang->colon . $this->lang->bug->create : $this->lang->bug->create; $this->view->customFields = $customFields; $this->view->showFields = $this->config->bug->custom->createFields; diff --git a/module/bug/model.php b/module/bug/model.php index 029d351d5f..81b285335c 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -66,7 +66,7 @@ class bugModel extends model ->setDefault('openedBuild', '') ->setDefault('notifyEmail', '') ->setDefault('deadline', '0000-00-00') - ->setIF($this->config->systemMode == 'new' && $this->lang->navGroup->bug != 'qa', 'project', $this->session->project) + ->setIF($this->lang->navGroup->bug != 'qa', 'project', $this->session->project) ->setIF(strpos($this->config->bug->create->requiredFields, 'deadline') !== false, 'deadline', $this->post->deadline) ->setIF($this->post->assignedTo != '', 'assignedDate', $now) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) @@ -89,9 +89,6 @@ class bugModel extends model $bug = $this->loadModel('file')->processImgURL($bug, $this->config->bug->editor->create['id'], $this->post->uid); - /* Use classic mode to replace required project. */ - if($this->config->systemMode == 'classic' and strpos($this->config->bug->create->requiredFields, 'project') !== false) $this->config->bug->create->requiredFields = str_replace('project', 'execution', $this->config->bug->create->requiredFields); - $this->dao->insert(TABLE_BUG)->data($bug) ->autoCheck() ->checkIF($bug->notifyEmail, 'notifyEmail', 'email') @@ -288,7 +285,7 @@ class bugModel extends model } } - if($this->config->systemMode == 'new' && $this->lang->navGroup->bug != 'qa') $bug->project = $this->session->project; + if($this->lang->navGroup->bug != 'qa') $bug->project = $this->session->project; $this->dao->insert(TABLE_BUG)->data($bug) ->autoCheck() ->batchCheck($this->config->bug->create->requiredFields, 'notempty') @@ -1617,7 +1614,7 @@ class bugModel extends model $this->config->bug->search['actionURL'] = $actionURL; $this->config->bug->search['queryID'] = $queryID; - if($this->config->systemMode == 'new') $this->config->bug->search['params']['project']['values'] = $projectParams; + $this->config->bug->search['params']['project']['values'] = $projectParams; $this->config->bug->search['params']['product']['values'] = $productParams; $this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID); $this->config->bug->search['params']['module']['values'] = $modules; @@ -2041,8 +2038,7 @@ class bugModel extends model $users = $this->dao->select("t2.id, t2.account, t2.realname")->from(TABLE_TEAM)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account') ->where('t1.root')->in(array_keys($projects)) - ->beginIF($this->config->systemMode == 'new')->andWhere('t1.type')->eq('project')->fi() - ->beginIF($this->config->systemMode == 'classic')->andWhere('t1.type')->eq('execution')->fi() + ->andWhere('t1.type')->eq('project') ->andWhere('t2.deleted')->eq(0) ->fi() ->fetchAll('account'); diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index c99a3a42f6..e385e28e06 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -78,9 +78,9 @@ if($this->app->tab == 'project') js::set('objectID', $projectID); + projectMode) and $config->projectMode == 'noExecution');?>