diff --git a/module/program/config.php b/module/program/config.php index 9e64cb8da7..f8a55e865b 100644 --- a/module/program/config.php +++ b/module/program/config.php @@ -19,7 +19,7 @@ $config->program->editor->prjstart = array('id' => 'comment', 'tools' => 'sim $config->program->editor->prjactivate = array('id' => 'comment', 'tools' => 'simpleTools'); $config->program->list = new stdclass(); -$config->program->list->exportFields = 'id,name,code,template,category,status,begin,end,budget,PM,end,desc'; +$config->program->list->exportFields = 'id,name,code,template,product,status,begin,end,budget,PM,end,desc'; $config->program->PGMCreate = new stdclass(); $config->program->PGMEdit = new stdclass(); diff --git a/module/program/control.php b/module/program/control.php index ec93193063..223f92a406 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -133,7 +133,7 @@ class program extends control /** * Create a project. * - * @param string $template + * @param string $parentProgramID * @access public * @return void */ @@ -676,8 +676,8 @@ class program extends control { $program->PM = zget($users, $program->PM); $program->status = $this->processStatus('project', $program); - $program->template = zget($programLang->templateList, $program->template); - $program->product = zget($programLang->categoryList, $program->product); + $program->model = zget($programLang->modelList, $program->model); + $program->product = zget($programLang->productList, $program->product); $program->budget = $program->budget . zget($programLang->unitList, $program->budgetUnit); if($this->post->exportType == 'selected') @@ -869,14 +869,14 @@ class program extends control /** * Create a project. * - * @param string $template + * @param string $model * @param int $programID * @param string $from PRJ|PGM * @param int $copyProjectID * @access public * @return void */ - public function PRJCreate($template = 'waterfall', $programID = 0, $from = 'PRJ', $copyProjectID = '') + public function PRJCreate($model = 'waterfall', $programID = 0, $from = 'PRJ', $copyProjectID = '') { if($from == 'PRJ') { @@ -917,7 +917,7 @@ class program extends control $acl = $copyProgram->acl; $privway = $copyProgram->privway; $whitelist = $copyProgram->whitelist; - if(empty($template)) $template = $copyProgram->template; + if(empty($model)) $model = $copyProgram->model; } $this->view->title = $this->lang->program->PRJCreate; @@ -925,9 +925,9 @@ class program extends control $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->pmUsers = $this->loadModel('user')->getPairs('noclosed|nodeleted|pmfirst'); - $this->view->programs = array('' => '') + $this->program->getPRJPairsByTemplate($template, $programID); + $this->view->programs = array('' => '') + $this->program->getPRJPairsByTemplate($model, $programID); $this->view->programID = $programID; - $this->view->template = $template; + $this->view->model = $model; $this->view->name = $name; $this->view->code = $code; $this->view->team = $team; diff --git a/module/program/lang/en.php b/module/program/lang/en.php index 261ef12281..36f5bee47c 100644 --- a/module/program/lang/en.php +++ b/module/program/lang/en.php @@ -79,8 +79,8 @@ $lang->program->unitList[''] = ''; $lang->program->unitList['yuan'] = 'Yuan'; $lang->program->unitList['dollar'] = 'Dollars'; -$lang->program->templateList['scrum'] = "Scrum"; -$lang->program->templateList['waterfall'] = "CMMI"; +$lang->program->modelList['scrum'] = "Scrum"; +$lang->program->modelList['waterfall'] = "CMMI"; $lang->program->PRJCategoryList['single'] = "Single product"; $lang->program->PRJCategoryList['multiple'] = "Multiple products"; diff --git a/module/program/lang/zh-cn.php b/module/program/lang/zh-cn.php index 7828f53b59..0458241fc7 100644 --- a/module/program/lang/zh-cn.php +++ b/module/program/lang/zh-cn.php @@ -79,8 +79,8 @@ $lang->program->unitList[''] = ''; $lang->program->unitList['yuan'] = '元'; $lang->program->unitList['dollar'] = 'Dollars'; -$lang->program->templateList['scrum'] = "Scrum"; -$lang->program->templateList['waterfall'] = "瀑布"; +$lang->program->modelList['scrum'] = "Scrum"; +$lang->program->modelList['waterfall'] = "瀑布"; $lang->program->PRJCategoryList['single'] = "单产品项目"; $lang->program->PRJCategoryList['multiple'] = "多产品项目"; diff --git a/module/program/model.php b/module/program/model.php index f8b94a2e00..bab50b3c11 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -292,7 +292,7 @@ class programModel extends model if(!empty($groupPriv)) { $newProgram = $groupPriv->program . ",$programID"; - $this->dao->update(TABLE_USERGROUP)->set('program')->eq($newProgram)->where('account')->eq($groupPriv->account)->andWhere('`group`')->eq($groupPriv->group)->exec(); + $this->dao->update(TABLE_USERGROUP)->set('PRJ')->eq($newProgram)->where('account')->eq($groupPriv->account)->andWhere('`group`')->eq($groupPriv->group)->exec(); } else { @@ -866,7 +866,7 @@ class programModel extends model } /** - * Get project pairs by template. + * Get project pairs by model. * * @param string $model * @param int $programID @@ -1228,7 +1228,7 @@ class programModel extends model echo html::a(helper::createLink('program', 'index', "projectID=$project->id"), $project->name); break; case 'PRJModel': - echo zget($this->lang->program->templateList, $project->model); + echo zget($this->lang->program->modelList, $project->model); break; case 'PRJPM': echo zget($users, $project->PM); diff --git a/module/program/view/pgmbrowsebygrid.html.php b/module/program/view/pgmbrowsebygrid.html.php index 65109a1487..89f94649d8 100644 --- a/module/program/view/pgmbrowsebygrid.html.php +++ b/module/program/view/pgmbrowsebygrid.html.php @@ -4,7 +4,7 @@
id", '', '', $program->id);?>'>
name;?> - template === 'waterfall'): ?> + model === 'waterfall'): ?> program->waterfall; ?> program->scrum; ?> @@ -31,7 +31,7 @@ program->hoursUnit, $program->estimate); ?> budget . '' . zget($lang->program->unitList, $program->budgetUnit);?>
- template === 'waterfall'): ?> + model === 'waterfall'): ?>

program->ongoingStage; ?>

- + project->weekend);?> @@ -29,7 +29,7 @@ - @@ -44,13 +44,13 @@ - + - + @@ -88,7 +88,7 @@ - +
program->PRJTemplate;?>program->templateList, $template, '');?> + program->modelList, $model, '');?>
program->PRJCode;?>
program->PRJCategory;?> program->PRJLifeTimeList, '', "class='form-control'");?>
program->PRJCategory;?> program->PRJCategoryList, '', "class='form-control'");?>
project->days;?> @@ -126,7 +126,7 @@
diff --git a/module/program/view/prjedit.html.php b/module/program/view/prjedit.html.php index 24d9b71243..a0370c2d2a 100644 --- a/module/program/view/prjedit.html.php +++ b/module/program/view/prjedit.html.php @@ -23,7 +23,7 @@ - diff --git a/module/task/control.php b/module/task/control.php index 153dd00389..6b462e1ac6 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -242,7 +242,7 @@ class task extends control } $program = $this->loadModel('project')->getByID($this->session->PRJ); - if($program->template == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline'; + if($program->model == 'waterfall') $this->config->task->create->requiredFields .= ',estStarted,deadline'; $project = $this->project->getById($projectID); $taskLink = $this->createLink('project', 'browse', "projectID=$projectID&tab=task"); diff --git a/module/upgrade/control.php b/module/upgrade/control.php index f7953ffa78..1810df515c 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -201,7 +201,7 @@ class upgrade extends control else { $programID = $this->post->programs; - $this->dao->update(TABLE_PROJECT)->set('category')->eq('multiple')->where('id')->eq($programID)->andWhere('category')->eq('single')->exec(); + $this->dao->update(TABLE_PROJECT)->set('product')->eq('multiple')->where('id')->eq($programID)->andWhere('product')->eq('single')->exec(); } /* Change program field for product and project. */ @@ -246,7 +246,7 @@ class upgrade extends control else { $programID = $this->post->programs; - $this->dao->update(TABLE_PROJECT)->set('category')->eq('multiple')->where('id')->eq($programID)->andWhere('category')->eq('single')->exec(); + $this->dao->update(TABLE_PROJECT)->set('product')->eq('multiple')->where('id')->eq($programID)->andWhere('product')->eq('single')->exec(); } /* Change program field for product and project. */ @@ -273,7 +273,7 @@ class upgrade extends control else { $programID = $this->post->programs; - $this->dao->update(TABLE_PROJECT)->set('category')->eq('multiple')->where('id')->eq($programID)->andWhere('category')->eq('single')->exec(); + $this->dao->update(TABLE_PROJECT)->set('product')->eq('multiple')->where('id')->eq($programID)->andWhere('product')->eq('single')->exec(); } $productID = $this->upgrade->createProduct4Program($programID); @@ -306,7 +306,7 @@ class upgrade extends control /* Get no merged product and project count. */ $noMergedProductCount = $this->dao->select('count(*) as count')->from(TABLE_PRODUCT)->where('program')->eq(0)->andWhere('deleted')->eq(0)->fetch('count'); - $noMergedProjectCount = $this->dao->select('count(*) as count')->from(TABLE_PROJECT)->where('program')->eq(0)->andWhere('template')->eq('')->andWhere('deleted')->eq(0)->fetch('count'); + $noMergedProjectCount = $this->dao->select('count(*) as count')->from(TABLE_PROJECT)->where('model')->eq('')->andWhere('deleted')->eq(0)->fetch('count'); /* When all products and projects merged then finish and locate afterExec page. */ if(empty($noMergedProductCount) and empty($noMergedProjectCount)) @@ -333,8 +333,7 @@ class upgrade extends control $noMergedProjects = $this->dao->select('t1.*')->from(TABLE_PROJECT)->alias('t1') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id=t2.project') - ->where('t1.program')->eq(0) - ->andWhere('t1.template')->eq('') + ->where('t1.model')->eq('') ->andWhere('t1.deleted')->eq(0) ->andWhere('t2.product')->in(array_keys($noMergedProducts)) ->fetchAll('id'); @@ -373,8 +372,7 @@ class upgrade extends control $noMergedProjects = $this->dao->select('t1.*')->from(TABLE_PROJECT)->alias('t1') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id=t2.project') - ->where('t1.program')->eq(0) - ->andWhere('t1.template')->eq('') + ->where('t1.model')->eq('') ->andWhere('t1.deleted')->eq(0) ->andWhere('t2.product')->in(array_keys($noMergedProducts)) ->fetchAll('id'); @@ -402,7 +400,7 @@ class upgrade extends control /* Get no merged projects than is not linked product. */ if($type == 'project') { - $noMergedProjects = $this->dao->select('*')->from(TABLE_PROJECT)->where('program')->eq(0)->andWhere('template')->eq('')->andWhere('deleted')->eq(0)->fetchAll('id'); + $noMergedProjects = $this->dao->select('*')->from(TABLE_PROJECT)->where('model')->eq('')->andWhere('deleted')->eq(0)->fetchAll('id'); $projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($noMergedProjects))->fetchGroup('project', 'product'); foreach($projectProducts as $projectID => $products) unset($noMergedProjects[$projectID]); @@ -413,7 +411,7 @@ class upgrade extends control /* Get no merged projects that link more then two products. */ if($type == 'moreLink') { - $noMergedProjects = $this->dao->select('*')->from(TABLE_PROJECT)->where('program')->eq(0)->andWhere('template')->eq('')->andWhere('deleted')->eq(0)->fetchAll('id'); + $noMergedProjects = $this->dao->select('*')->from(TABLE_PROJECT)->where('model')->eq('')->andWhere('deleted')->eq(0)->fetchAll('id'); $projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($noMergedProjects))->fetchGroup('project', 'product'); $productPairs = array(); @@ -442,7 +440,7 @@ class upgrade extends control $this->view->title = $this->lang->upgrade->mergeProgram; - $this->view->programs = $this->dao->select('*')->from(TABLE_PROJECT)->where('program')->eq(0)->andWhere('deleted')->eq(0)->andWhere('template')->eq('scrum')->fetchPairs('id', 'name'); + $this->view->programs = $this->dao->select('*')->from(TABLE_PROJECT)->where('deleted')->eq(0)->andWhere('model')->eq('scrum')->fetchPairs('id', 'name'); $this->view->users = $this->loadModel('user')->getPairs('noclosed|noempty'); $this->view->groups = $this->loadModel('group')->getPairs(); $this->display(); diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 8eb3aa15d8..00070944af 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -3857,9 +3857,9 @@ class upgradeModel extends model $program = new stdclass(); $program->name = $data->name; $program->code = $data->code; - $program->template = 'scrum'; + $program->model = 'scrum'; $program->type = 'program'; - $program->product = count($productIdList) > 1 ? 'multiple' : 'single'; + $program->product = count($productIdList) > 1 ? 'multiple' : 'single'; $program->status = 'wait'; $program->begin = $data->begin; $program->end = $data->end; diff --git a/module/weekly/control.php b/module/weekly/control.php index 938b89f26f..3a180b3acc 100644 --- a/module/weekly/control.php +++ b/module/weekly/control.php @@ -71,9 +71,7 @@ class weekly extends control { $programs = $this->dao->select('id, name')->from(TABLE_PROJECT) ->where('deleted')->eq(0) - ->andWhere('isCat')->eq(0) - ->andWhere('template')->ne('') - ->andWhere('program')->eq(0) + ->andWhere('type')->eq('project') ->fetchPairs(); $date = helper::today();
program->PRJTemplate;?>program->templateList, $project->model, '');?> + program->modelList, $project->model, '');?>