* Rename program to prj.

This commit is contained in:
Yagami
2020-09-22 11:31:56 +08:00
parent cec65da271
commit 92ee6ca3b2
11 changed files with 33 additions and 33 deletions
+1 -1
View File
@@ -552,7 +552,7 @@ class router extends baseRouter
*/
public function mergeParams($defaultParams, $passedParams)
{
if(isset($_GET['pgm'])) $this->session->set('program', $_GET['pgm']);
if(isset($_GET['PRJ'])) $this->session->set('PRJ', $_GET['PRJ']);
/* If the isFlow is true, reset the passed params. */
if($this->isFlow)
{
+13 -12
View File
@@ -620,7 +620,7 @@ class block extends control
->andWhere('t3.status')->ne('done')
->andWhere('t3.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t2.program')->eq((int)$this->session->PRJ)->fi()
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t2.PRJ')->eq((int)$this->session->PRJ)->fi()
->orderBy($this->params->orderBy)
->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi()
->fetchAll();
@@ -629,7 +629,7 @@ class block extends control
{
$cases = $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_CASE)
->andWhere('deleted')->eq(0)
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('program')->eq((int)$this->session->PRJ)->fi()
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('PRJ')->eq((int)$this->session->PRJ)->fi()
->orderBy($this->params->orderBy)
->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi()
->fetchAll();
@@ -654,7 +654,7 @@ class block extends control
->leftJoin(TABLE_PROJECT)->alias('t4')->on('t1.project=t4.id')
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.project=t5.project')
->where('t1.deleted')->eq('0')
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.program')->eq((int)$this->session->PRJ)->fi()
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.PRJ')->eq((int)$this->session->PRJ)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
->andWhere('t1.product = t5.product')
->beginIF($this->params->type != 'all')->andWhere('t1.status')->eq($this->params->type)->fi()
@@ -696,7 +696,7 @@ class block extends control
$this->view->plans = $this->dao->select('t1.*,t2.name as productName')->from(TABLE_PRODUCTPLAN)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->where('t1.deleted')->eq('0')
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t2.program')->eq((int)$this->session->PRJ)->fi()
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t2.PRJ')->eq((int)$this->session->PRJ)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
->orderBy('t1.begin desc')
->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi()
@@ -717,7 +717,7 @@ class block extends control
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build=t3.id')
->where('t1.deleted')->eq('0')
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.program')->eq((int)$this->session->PRJ)->fi()
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.PRJ')->eq((int)$this->session->PRJ)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
->orderBy('t1.id desc')
->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi()
@@ -738,7 +738,7 @@ class block extends control
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
->where('t1.deleted')->eq('0')
->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in($this->app->user->view->projects)->fi()
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.program')->eq((int)$this->session->PRJ)->fi()
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('t1.PRJ')->eq((int)$this->session->PRJ)->fi()
->orderBy('t1.id desc')
->beginIF($this->viewType != 'json')->limit((int)$this->params->count)->fi()
->fetchAll();
@@ -1151,7 +1151,7 @@ class block extends control
$task = $this->dao->select("
sum(consumed) as totalConsumed,
sum(if(status != 'cancel' and status != 'closed', `left`, 0)) as totalLeft")
->from(TABLE_TASK)->where('program')->eq($this->session->PRJ)
->from(TABLE_TASK)->where('PRJ')->eq($this->session->PRJ)
->andWhere('deleted')->eq(0)
->andWhere('parent')->lt(1)
->fetch();
@@ -1226,9 +1226,9 @@ class block extends control
$budget = $this->loadModel('workestimation')->getBudget($programID);
if(empty($budget)) $budget = new stdclass();
$this->view->people = $this->dao->select('sum(people) as people')->from(TABLE_DURATIONESTIMATION)->where('program')->eq($this->session->PRJ)->fetch('people');
$this->view->people = $this->dao->select('sum(people) as people')->from(TABLE_DURATIONESTIMATION)->where('PRJ')->eq($this->session->PRJ)->fetch('people');
$this->view->members = count($members) ? count($members) - 1 : 0;
$this->view->consumed = $this->dao->select('sum(consumed) as consumed')->from(TABLE_TASK)->where('program')->eq($programID)->andWhere('deleted')->eq(0)->andWhere('parent')->lt(1)->fetch('consumed');
$this->view->consumed = $this->dao->select('sum(consumed) as consumed')->from(TABLE_TASK)->where('PRJ')->eq($programID)->andWhere('deleted')->eq(0)->andWhere('parent')->lt(1)->fetch('consumed');
$this->view->budget = $budget;
}
@@ -1315,7 +1315,7 @@ class block extends control
$releases = array();
$count = isset($this->params->count) ? (int)$this->params->count : 15;
$products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('program')->eq($this->session->PRJ)->limit(15)->fetchPairs();
$products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('PRJ')->eq($this->session->PRJ)->limit(15)->fetchPairs();
$productIdList = array_keys($products);
if(!empty($productIdList))
{
@@ -1341,7 +1341,8 @@ class block extends control
{
$status = $this->dao->select('status, count(*) as count')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
->andWhere('program')->eq($this->session->PRJ)
->andWhere('type')->eq('sprint')
->andWhere('parent')->eq($this->session->PRJ)
->groupBy('status')
->fetchPairs();
@@ -1594,7 +1595,7 @@ class block extends control
{
$casePairs = $this->dao->select('lastRunResult, COUNT(*) AS count')->from(TABLE_CASE)
->where('1=1')
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('program')->eq((int)$this->session->PRJ)->fi()
->beginIF($this->view->block->module != 'my' and $this->session->PRJ)->andWhere('PRJ')->eq((int)$this->session->PRJ)->fi()
->groupBy('lastRunResult')
->fetchPairs();
+1 -1
View File
@@ -400,7 +400,7 @@ class designModel extends model
$productID = in_array($productID, array_keys($products)) ? $productID : key($products);
$productID = $this->loadModel('product')->saveState($productID, $products);
if($program->category == 'multiple') $this->loadModel('product')->setMenu($products, $productID);
if($program->product == 'multiple') $this->loadModel('product')->setMenu($products, $productID);
}
/**
+2 -2
View File
@@ -20,14 +20,14 @@
<form class="load-indicator main-form form-ajax" method='post' enctype='multipart/form-data' id='dataform'>
<table class="table table-form">
<tbody>
<?php if($program->category == 'multiple'):?>
<?php if($program->product == 'multiple'):?>
<tr>
<th class='w-120px'><?php echo $lang->design->product;?></th>
<td><?php echo html::select('product', $products, $productID, "class='form-control chosen'");?></td>
<td></td>
</tr>
<?php endif;?>
<?php if($program->category == 'single') echo html::hidden('product', $productID);?>
<?php if($program->product == 'single') echo html::hidden('product', $productID);?>
<tr>
<th class='w-120px'><?php echo $lang->design->story;?></th>
<td><?php echo html::select('story', empty($stories) ? '' : $stories, '', "class='form-control chosen'");?></td>
+1 -1
View File
@@ -20,7 +20,7 @@
<form class="load-indicator main-form form-ajax" method='post' enctype='multipart/form-data' id='dataform'>
<table class="table table-form">
<tbody>
<?php if($program->category == 'multiple'):?>
<?php if($program->product == 'multiple'):?>
<tr>
<th class='w-120px'><?php echo $lang->design->product;?></th>
<td><?php echo html::select('product', $products, $design->product, "class='form-control chosen'");?></td>
+2 -2
View File
@@ -103,7 +103,7 @@ class issueModel extends model
$issueList = $this->dao->select('*')->from(TABLE_ISSUE)
->where('deleted')->eq('0')
->beginIF($programID)->andWhere('program')->eq($programID)->fi()
->beginIF($programID)->andWhere('PRJ')->eq($programID)->fi()
->beginIF($browseType == 'open')->andWhere('status')->eq('active')->fi()
->beginIF($browseType == 'assignto')->andWhere('assignedTo')->eq($this->app->user->account)->fi()
->beginIF($browseType == 'closed')->andWhere('status')->eq('closed')->fi()
@@ -131,7 +131,7 @@ class issueModel extends model
{
$issueList = $this->dao->select('*')->from(TABLE_ISSUE)
->where('deleted')->eq('0')
->beginIF($programID)->andWhere('program')->eq($programID)->fi()
->beginIF($programID)->andWhere('PRJ')->eq($programID)->fi()
->beginIF($browseType == 'open')->andWhere('status')->eq('active')->fi()
->beginIF($browseType == 'assignto')->andWhere('assignedTo')->eq($this->app->user->account)->fi()
->beginIF($browseType == 'closed')->andWhere('status')->eq('closed')->fi()
+1 -1
View File
@@ -681,7 +681,7 @@ class program extends control
$program->PM = zget($users, $program->PM);
$program->status = $this->processStatus('project', $program);
$program->template = zget($programLang->templateList, $program->template);
$program->category = zget($programLang->categoryList, $program->category);
$program->product = zget($programLang->categoryList, $program->product);
$program->budget = $program->budget . zget($programLang->unitList, $program->budgetUnit);
if($this->post->exportType == 'selected')
+2 -2
View File
@@ -74,8 +74,8 @@ $lang->program->unitList['dollar'] = 'Dollars';
$lang->program->templateList['scrum'] = "Scrum";
$lang->program->templateList['waterfall'] = "CMMI";
$lang->program->categoryList['single'] = "Single product";
$lang->program->categoryList['multiple'] = "Multiple products";
$lang->program->productList['single'] = "Single product";
$lang->program->productList['multiple'] = "Multiple products";
$lang->program->featureBar['all'] = 'All';
$lang->program->featureBar['doing'] = 'Going';
+7 -8
View File
@@ -113,7 +113,7 @@ class programplanModel extends model
foreach($plans as $planID => $plan)
{
$name = $plan->name;
if($program->category == 'multiple') $name = $plan->productName . '/' . $name;
if($program->product == 'multiple') $name = $plan->productName . '/' . $name;
$pairs[$planID] = '/'.$name;
foreach($plan->children as $childID => $child)
@@ -630,9 +630,9 @@ class programplanModel extends model
{
$projects = $this->getProjectsByProduct($oldPlan->product);
$devCounts = $this->dao->select('count(*) AS count')->from(TABLE_PROJECT)
->where('program')->eq($oldPlan->program)
->where('parent')->eq($oldPlan->program)
->andWhere('type')->eq('stage')
->andWhere('deleted')->eq(0)
->andWhere('parent')->eq(0)
->andWhere('attribute')->eq('dev')
->andWhere('id')->ne($oldPlan->id)
->andWhere('id')->in($projects)
@@ -829,8 +829,8 @@ class programplanModel extends model
public function getMilestones($programID = 0)
{
return $this->dao->select('id, name')->from(TABLE_PROJECT)
->where('program')->eq($programID)
->andWhere('type')->eq('project')
->where('parent')->eq($programID)
->andWhere('type')->eq('stage')
->andWhere('milestone')->eq(1)
->andWhere('deleted')->eq(0)
->orderBy('begin asc')
@@ -885,9 +885,8 @@ class programplanModel extends model
$parentStage = $this->dao->select('id,name')->from(TABLE_PROJECT)
->where('id')->in($projects)
->andWhere('type')->eq('project')
->andWhere('program')->eq($programID)
->andWhere('parent')->eq(0)
->andWhere('type')->eq('stage')
->andWhere('parent')->eq($programID)
->andWhere('deleted')->eq('0')
->fetchPairs('id');
+2 -2
View File
@@ -191,7 +191,7 @@ class projectModel extends model
if(isset($currentProject->program)) $program = $this->getByID($currentProject->program);
if(isset($program->category) and $program->category == 'multiple')
if(isset($program->product) and $program->product == 'multiple')
{
$productID = $this->loadModel('product')->getProductIDByProject($currentProject->id);
$productName = $this->dao->findByID($productID)->from(TABLE_PRODUCT)->fetch('name');
@@ -868,7 +868,7 @@ class projectModel extends model
{
if($project->parent and isset($projects[$project->id]) and isset($projects[$project->parent])) $projects[$project->id]->name = $projects[$project->parent]->name . '/' . $project->name;
}
if($program->category == 'multiple')
if($program->product == 'multiple')
{
foreach($projects as $projectID => $project) $projects[$projectID]->name = $project->productName . '/' . $project->name;
}
+1 -1
View File
@@ -3859,7 +3859,7 @@ class upgradeModel extends model
$program->code = $data->code;
$program->template = 'scrum';
$program->type = 'program';
$program->category = count($productIdList) > 1 ? 'multiple' : 'single';
$program->product = count($productIdList) > 1 ? 'multiple' : 'single';
$program->status = 'wait';
$program->begin = $data->begin;
$program->end = $data->end;