Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/181_tianshujie_46672
This commit is contained in:
@@ -429,7 +429,7 @@ class bugModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getModuleBugs($productIDList, $branch = 0, $moduleIdList = 0, $executions, $orderBy = 'id_desc', $pager = null, $projectID)
|
||||
public function getModuleBugs($productIDList, $branch = 0, $moduleIdList = 0, $executions = array(), $orderBy = 'id_desc', $pager = null, $projectID = 0)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_BUG)
|
||||
->where('product')->in($productIDList)
|
||||
@@ -1304,7 +1304,7 @@ class bugModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBugs2Link($bugID, $browseType = 'bySearch', $queryID)
|
||||
public function getBugs2Link($bugID, $browseType = 'bySearch', $queryID = 0)
|
||||
{
|
||||
if($browseType == 'bySearch')
|
||||
{
|
||||
@@ -2221,7 +2221,7 @@ class bugModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getAllBugs($productIDList, $branch, $modules, $executions, $orderBy, $pager = null, $projectID)
|
||||
public function getAllBugs($productIDList, $branch, $modules, $executions, $orderBy, $pager = null, $projectID = 0)
|
||||
{
|
||||
$bugs = $this->dao->select('t1.*, t2.title as planTitle')->from(TABLE_BUG)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id')
|
||||
@@ -2513,7 +2513,7 @@ class bugModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBySearch($productIDList, $branch = 0, $queryID, $orderBy, $excludeBugs = '', $pager = null, $projectID = 0)
|
||||
public function getBySearch($productIDList, $branch = 0, $queryID = 0, $orderBy = '', $excludeBugs = '', $pager = null, $projectID = 0)
|
||||
{
|
||||
if($queryID)
|
||||
{
|
||||
|
||||
@@ -1360,7 +1360,7 @@ class commonModel extends model
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public static function printLink($module, $method, $vars = '', $label, $target = '', $misc = '', $newline = true, $onlyBody = false, $object = null)
|
||||
public static function printLink($module, $method, $vars = '', $label = '', $target = '', $misc = '', $newline = true, $onlyBody = false, $object = null)
|
||||
{
|
||||
/* Add data-app attribute. */
|
||||
global $app;
|
||||
|
||||
@@ -74,7 +74,7 @@ class companyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUsers($browseType = 'inside', $type, $queryID, $deptID, $sort, $pager)
|
||||
public function getUsers($browseType = 'inside', $type = '', $queryID = 0, $deptID = 0, $sort = '', $pager = null)
|
||||
{
|
||||
/* Get users. */
|
||||
if($type == 'bydept')
|
||||
|
||||
@@ -608,7 +608,7 @@ class gitlabModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function apiGetProjectsPager($gitlabID, $keyword = '', $orderBy, $pager)
|
||||
public function apiGetProjectsPager($gitlabID, $keyword = '', $orderBy = '', $pager = null)
|
||||
{
|
||||
$gitlab = $this->getByID($gitlabID);
|
||||
if(!$gitlab) return array();
|
||||
|
||||
@@ -295,6 +295,7 @@ class productplan extends control
|
||||
$this->view->plans = $this->productplan->getList($productID, $branch, $browseType, $pager, $sort);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->projects = $this->product->getProjectPairsByProduct($productID, $branch);
|
||||
$this->view->statusList = $this->lang->productplan->featureBar['browse'];
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -400,7 +401,7 @@ class productplan extends control
|
||||
else
|
||||
{
|
||||
$changes = $this->productplan->updateStatus($planID, 'doing');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'started');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
@@ -442,7 +443,7 @@ class productplan extends control
|
||||
else
|
||||
{
|
||||
$changes = $this->productplan->updateStatus($planID, 'done');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'finished');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
@@ -468,7 +469,7 @@ class productplan extends control
|
||||
else
|
||||
{
|
||||
$changes = $this->productplan->updateStatus($planID, 'closed');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'closed');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
@@ -494,7 +495,7 @@ class productplan extends control
|
||||
else
|
||||
{
|
||||
$changes = $this->productplan->updateStatus($planID, 'doing');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
$actionID = $this->loadModel('action')->create('productplan', $planID, 'activated');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
@@ -26,6 +26,7 @@ td.c-branch {overflow: hidden; text-align: left !important; text-overflow: ellip
|
||||
|
||||
.c-title.has-child > .plan-name.has-suffix > a, .c-title.has-child > .plan-name.has-prefix > a {overflow:hidden; max-width: calc(100% - 70px);}
|
||||
.plan-name.has-suffix > a, .plan-name.has-prefix > a {overflow:hidden; max-width: calc(100% - 46px);}
|
||||
#productplanList .plan-name > .label.label-danger {margin-left:3px; }
|
||||
|
||||
.switchButton {background: #fff !important;}
|
||||
.panel-actions {position: relative; padding: 0 0; padding-top: 1px;}
|
||||
|
||||
@@ -25,5 +25,5 @@ ol, ul {padding-left: 20px;}
|
||||
.body-modal #mainMenu>.btn-toolbar {width: auto;}
|
||||
.body-modal #mainContent {min-height: 240px;}
|
||||
|
||||
.btn.disabled{color: #9e54ae; background-color: transparent; border-color:transparent;}
|
||||
#mainMenu .btn-link.disabled {color: #9e54ae; background: transparent; border-color:transparent;}
|
||||
#mainMenu .icon-checked, #mainMenu .icon-off, #mainMenu .icon-play, #mainMenu .icon-magic {margin-right: 3px;}
|
||||
|
||||
@@ -107,6 +107,8 @@ $lang->productplan->errorNoEnd = 'ID %s end time should not be empty.';
|
||||
$lang->productplan->beginGeEnd = 'ID %s begin time should not be >= end time.';
|
||||
$lang->productplan->beginLetterParent = "The start date of the parent plan: %s, the start date cannot be less than the start date of the parent plan.";
|
||||
$lang->productplan->endGreaterParent = "The completion date of the parent plan: %s, the completion date cannot be greater than the completion date of the parent plan.";
|
||||
$lang->productplan->beginGreaterChild = "The start date of the child plan: %s, the start date cannot be greater than the start date of the child plan.";
|
||||
$lang->productplan->endLetterChild = "The completion date of the child plan: %s, the completion date cannot be less than the completion date of the child plan.";
|
||||
$lang->productplan->noLinkedProject = "The current product has not been linked with a project. Please enter the list of the product to link or create a project.";
|
||||
$lang->productplan->enterProjectList = "Enter the list of the product";
|
||||
|
||||
|
||||
@@ -18,13 +18,12 @@ $lang->productplan->delete = "删除计划";
|
||||
$lang->productplan->start = "开始计划";
|
||||
$lang->productplan->finish = "完成计划";
|
||||
$lang->productplan->close = "关闭计划";
|
||||
$lang->productplan->activate = "激活计划";
|
||||
$lang->productplan->startAB = "开始";
|
||||
$lang->productplan->finishAB = "完成";
|
||||
$lang->productplan->closeAB = "关闭";
|
||||
$lang->productplan->activateAB = "激活";
|
||||
$lang->productplan->view = "计划详情";
|
||||
$lang->productplan->activate = "激活计划";
|
||||
$lang->productplan->view = "计划详情";
|
||||
$lang->productplan->bugSummary = "本页共 <strong>%s</strong> 个Bug";
|
||||
$lang->productplan->basicInfo = '基本信息';
|
||||
$lang->productplan->batchEdit = '批量编辑';
|
||||
@@ -107,6 +106,8 @@ $lang->productplan->errorNoEnd = 'ID %s 结束时间不能为空';
|
||||
$lang->productplan->beginGeEnd = 'ID %s 开始时间不能大于结束时间';
|
||||
$lang->productplan->beginLetterParent = "父计划的开始日期:%s,开始日期不能小于父计划的开始日期";
|
||||
$lang->productplan->endGreaterParent = "父计划的完成日期:%s,完成日期不能大于父计划的完成日期";
|
||||
$lang->productplan->beginGreaterChild = "子计划的开始日期:%s,开始日期不能大于子计划的开始日期";
|
||||
$lang->productplan->endLetterChild = "子计划的完成日期:%s,完成日期不能小于子计划的完成日期";
|
||||
$lang->productplan->noLinkedProject = "当前产品还未关联项目,请进入产品的项目列表关联或创建一个项目";
|
||||
$lang->productplan->enterProjectList = "进入产品的项目列表";
|
||||
|
||||
|
||||
@@ -499,32 +499,81 @@ class productplanModel extends model
|
||||
*/
|
||||
public function updateStatus($planID, $status = '')
|
||||
{
|
||||
$oldPlan = $this->dao->findByID((int)$planID)->from(TABLE_PRODUCTPLAN)->fetch();
|
||||
$planID = (int)$planID;
|
||||
$oldPlan = $this->getByID($planID);
|
||||
if($oldPlan->parent > 0) $parentPlan = $this->getByID($oldPlan->parent);
|
||||
|
||||
if($status == 'doing' and $_POST)
|
||||
if($status == 'doing' and !empty($_POST))
|
||||
{
|
||||
$plan = fixer::input('post')->add('status', $status)->get();
|
||||
|
||||
$this->checkDate4Plan($oldPlan, $plan->begin, $plan->end);
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)
|
||||
->data($plan)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->productplan->start->requiredFields, 'notempty')
|
||||
->checkIF(!empty($_POST['begin']) && !empty($_POST['end']), 'end', 'ge', $plan->begin)
|
||||
->where('id')->eq((int)$planID)
|
||||
->where('id')->eq($planID)
|
||||
->beginIF(isset($parentPlan))->orWhere('id')->eq($oldPlan->parent)->fi()
|
||||
->exec();
|
||||
}
|
||||
elseif($status == 'doing' and isset($parentPlan) and $parentPlan->status != 'doing')
|
||||
{
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)
|
||||
->set('`status`')->eq($status)
|
||||
->where('id')->eq($planID)
|
||||
->orWhere('id')->eq($oldPlan->parent)
|
||||
->exec();
|
||||
}
|
||||
elseif($status == 'done' and isset($parentPlan))
|
||||
{
|
||||
$parentDone = true;
|
||||
$childPlans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('parent')->eq($oldPlan->parent)->andWhere('deleted')->eq(0)->fetchAll();
|
||||
foreach($childPlans as $childPlan )
|
||||
{
|
||||
if(in_array($childPlan->status, array('wait', 'doing')) and $planID != $childPlan->id)
|
||||
{
|
||||
$parentDone = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)
|
||||
->set('`status`')->eq($status)
|
||||
->where('id')->eq($planID)
|
||||
->beginIF($parentDone)->orWhere('id')->eq($oldPlan->parent)->fi()
|
||||
->exec();
|
||||
}
|
||||
elseif($status == 'closed' and isset($parentPlan))
|
||||
{
|
||||
$parentClosed = true;
|
||||
$childPlans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('parent')->eq($oldPlan->parent)->andWhere('deleted')->eq(0)->fetchAll();
|
||||
foreach($childPlans as $childPlan)
|
||||
{
|
||||
if(in_array($childPlan->status, array('wait', 'doing', 'done')) and $planID != $childPlan->id)
|
||||
{
|
||||
$parentClosed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)
|
||||
->set('`status`')->eq($status)
|
||||
->where('id')->eq($planID)
|
||||
->beginIF($parentClosed)->orWhere('id')->eq($oldPlan->parent)->fi()
|
||||
->exec();
|
||||
|
||||
if(dao::isError()) return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)
|
||||
->set('`status`')->eq($status)
|
||||
->where('id')->eq((int)$planID)
|
||||
->where('id')->eq($planID)
|
||||
->exec();
|
||||
|
||||
$plan = $this->dao->findByID((int)$planID)->from(TABLE_PRODUCTPLAN)->fetch();
|
||||
}
|
||||
|
||||
if(dao::isError()) return false;
|
||||
|
||||
if(!isset($plan)) $plan = $this->getByID($planID);
|
||||
if(!dao::isError())return common::createChanges($oldPlan, $plan);
|
||||
}
|
||||
|
||||
@@ -589,6 +638,38 @@ class productplanModel extends model
|
||||
return $changes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check date for plan.
|
||||
*
|
||||
* @param object $plan
|
||||
* @param string $begin
|
||||
* @param string $end
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkDate4Plan($plan, $begin, $end)
|
||||
{
|
||||
if($plan->parent == -1)
|
||||
{
|
||||
$childPlans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('parent')->eq($plan->id)->andWhere('deleted')->eq(0)->fetchAll();
|
||||
$minBegin = $begin;
|
||||
$maxEnd = $end;
|
||||
foreach($childPlans as $childPlan)
|
||||
{
|
||||
if($childPlan->begin < $minBegin) $minBegin = $childPlan->begin;
|
||||
if($childPlan->end > $maxEnd) $maxEnd = $childPlan->end;
|
||||
}
|
||||
if($minBegin < $begin) dao::$errors['begin'] = sprintf($this->lang->beginGreaterChild, $minBegin);
|
||||
if($maxEnd > $end) dao::$errors['end'] = sprintf($this->lang->endLetterChild, $maxEnd);
|
||||
}
|
||||
elseif($plan->parent > 0)
|
||||
{
|
||||
$parentPlan = $this->getByID($plan->parent);
|
||||
if($begin < $parentPlan->begin) dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $parentPlan->begin);
|
||||
if($end > $parentPlan->end) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Change parent field by planID.
|
||||
*
|
||||
@@ -788,4 +869,37 @@ class productplanModel extends model
|
||||
|
||||
return $plans;
|
||||
}
|
||||
|
||||
/**
|
||||
* Judge an action is clickable or not.
|
||||
*
|
||||
* @param object $plan
|
||||
* @param string $action
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public static function isClickable($plan, $action)
|
||||
{
|
||||
$action = strtolower($action);
|
||||
$clickable = commonModel::hasPriv('productplan', $action);
|
||||
if(!$clickable) return false;
|
||||
|
||||
switch($action)
|
||||
{
|
||||
case 'start' :
|
||||
if($plan->status != 'wait' or $plan->parent < 0) return false;
|
||||
break;
|
||||
case 'finish' :
|
||||
if($plan->status != 'doing' or $plan->parent < 0) return false;
|
||||
break;
|
||||
case 'close' :
|
||||
if($plan->status != 'done' or $plan->parent < 0) return false;
|
||||
break;
|
||||
case 'activate' :
|
||||
if($plan->status != 'closed' or $plan->parent < 0) return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<style>
|
||||
.c-actions {width: 240px;}
|
||||
</style>
|
||||
<style> .c-actions {width: 240px;} </style>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php foreach(customModel::getFeatureMenu($this->moduleName, $this->methodName) as $menuItem):?>
|
||||
@@ -58,6 +56,9 @@
|
||||
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
|
||||
</th>
|
||||
<th class='c-title'><?php common::printOrderLink('title', $orderBy, $vars, $lang->productplan->title);?></th>
|
||||
<?php if($browseType == 'all'):?>
|
||||
<th><?php common::printOrderLink('status', $orderBy, $vars, $lang->productplan->status);?></th>
|
||||
<?php endif;?>
|
||||
<?php if($this->session->currentProductType != 'normal'):?>
|
||||
<th class='c-branch'><?php common::printOrderLink('branch',$orderBy, $vars, $lang->productplan->branch);?></th>
|
||||
<?php endif;?>
|
||||
@@ -119,6 +120,9 @@
|
||||
if(!empty($suffix)) echo $suffix . '</div>';
|
||||
?>
|
||||
</td>
|
||||
<?php if($browseType == 'all'):?>
|
||||
<td><?php echo zget($statusList, $plan->status)?></td>
|
||||
<?php endif;?>
|
||||
<?php if($this->session->currentProductType != 'normal'):?>
|
||||
<td class='c-branch' title='<?php echo $branchOption[$plan->branch];?>'><?php if($plan->parent != '-1') echo $branchOption[$plan->branch];?></td>
|
||||
<?php endif;?>
|
||||
@@ -135,22 +139,22 @@
|
||||
<?php foreach($extendFields as $extendField) echo "<td>" . $this->loadModel('flow')->getFieldValue($extendField, $plan) . "</td>";?>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
$attr = "target='hiddenwin'";
|
||||
$isOnlyBody = false;
|
||||
$class = '';
|
||||
if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')
|
||||
if($plan->parent >= 0 )
|
||||
{
|
||||
$class = 'iframe';
|
||||
$attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'";
|
||||
$isOnlyBody = true;
|
||||
$attr = "target='hiddenwin'";
|
||||
$isOnlyBody = false;
|
||||
$class = '';
|
||||
if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')
|
||||
{
|
||||
$class = 'iframe';
|
||||
$attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'";
|
||||
$isOnlyBody = true;
|
||||
}
|
||||
common::printIcon('productplan', 'start', "planID=$plan->id", $plan, 'list', 'play', '', $class, $isOnlyBody, $attr, $lang->productplan->start);
|
||||
common::printIcon('productplan', 'finish', "planID=$plan->id", $plan, 'list', 'checked', '', $class, false, $attr, $lang->productplan->finish);
|
||||
common::printIcon('productplan', 'close', "planID=$plan->id", $plan, 'list', 'off', '', $class, false, $attr, $lang->productplan->close);
|
||||
}
|
||||
|
||||
$class = $plan->status == 'wait' ? $class : 'disabled';
|
||||
common::printLink('productplan', 'start', "planID=$plan->id", '<i class="icon-play"></i>', '', "class='btn {$class}'{$attr} title='{$lang->productplan->start}'", '', $isOnlyBody);
|
||||
$class = $plan->status == 'doing' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'finish', "planID=$plan->id", '<i class="icon-checked"></i>', '', "class='btn {$class}' target='hiddenwin' title='{$lang->productplan->finish}'");
|
||||
$class = $plan->status == 'done' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'close', "planID=$plan->id", '<i class="icon-off"></i>', '', "class='btn {$class}' target='hiddenwin' title='{$lang->productplan->close}'");
|
||||
$attr = $plan->expired ? "disabled='disabled'" : '';
|
||||
if(common::hasPriv('execution', 'create', $plan) and $plan->parent >= 0)
|
||||
{
|
||||
|
||||
@@ -42,25 +42,27 @@
|
||||
{
|
||||
echo $this->buildOperateMenu($plan, 'view');
|
||||
|
||||
$attr = "target='hiddenwin'";
|
||||
$isOnlyBody = false;
|
||||
$class = '';
|
||||
if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')
|
||||
if($plan->parent >= 0)
|
||||
{
|
||||
$class = 'iframe';
|
||||
$attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'";
|
||||
$isOnlyBody = true;
|
||||
$attr = "target='hiddenwin'";
|
||||
$isOnlyBody = false;
|
||||
$class = '';
|
||||
if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')
|
||||
{
|
||||
$class = 'iframe';
|
||||
$attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'";
|
||||
$isOnlyBody = true;
|
||||
}
|
||||
$class = $plan->status == 'wait' ? $class : 'disabled';
|
||||
common::printLink('productplan', 'start', "planID=$plan->id", "<i class='icon-play'></i>{$lang->productplan->startAB}", '', "class='btn btn-link {$class}'{$attr} title='{$lang->productplan->start}'", '', $isOnlyBody, $plan);
|
||||
$class = $plan->status == 'doing' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'finish', "planID=$plan->id", "<i class='icon-checked'></i>{$lang->productplan->finishAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->finish}'", '', false, $plan);
|
||||
$class = $plan->status == 'done' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'close', "planID=$plan->id", "<i class='icon-off'></i>{$lang->productplan->closeAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->close}'", '', false, $plan);
|
||||
$class = $plan->status == 'closed' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'activate', "planID=$plan->id", "<i class='icon-magic'></i>{$lang->productplan->activateAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->activate}'", '', false, $plan);
|
||||
}
|
||||
|
||||
$class = $plan->status == 'wait' ? $class : 'disabled';
|
||||
common::printLink('productplan', 'start', "planID=$plan->id", "<i class='icon-play'></i>{$lang->productplan->startAB}", '', "class='btn btn-link {$class}'{$attr} title='{$lang->productplan->start}'", '', $isOnlyBody);
|
||||
$class = $plan->status == 'doing' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'finish', "planID=$plan->id", "<i class='icon-checked'></i>{$lang->productplan->finishAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->finish}'");
|
||||
$class = $plan->status == 'done' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'close', "planID=$plan->id", "<i class='icon-off'></i>{$lang->productplan->closeAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->close}'");
|
||||
$class = $plan->status == 'closed' ? '' : 'disabled';
|
||||
common::printLink('productplan', 'activate', "planID=$plan->id", "<i class='icon-magic'></i>{$lang->productplan->activateAB}", '', "class='btn btn-link {$class}' target='hiddenwin' title='{$lang->productplan->activate}'");
|
||||
|
||||
if(common::hasPriv('productplan', 'create', $plan) and $plan->parent <= '0') echo html::a($this->createLink('productplan', 'create', "product={$plan->product}&branch={$plan->branch}&parent={$plan->id}"), "<i class='icon-split'></i> " . $this->lang->productplan->children , '', "class='btn btn-link' title='{$this->lang->productplan->children}'");
|
||||
if(common::hasPriv('productplan', 'edit', $plan)) echo html::a($this->createLink('productplan', 'edit', "planID=$plan->id"), "<i class='icon-common-edit icon-edit'></i> " . $this->lang->edit, '', "class='btn btn-link' title='{$this->lang->edit}'");
|
||||
if(common::hasPriv('productplan', 'delete', $plan) and $plan->parent >= 0) echo html::a($this->createLink('productplan', 'delete', "planID=$plan->id"), "<i class='icon-common-delete icon-trash'></i> " . $this->lang->delete, '', "class='btn btn-link' title='{$this->lang->delete}' target='hiddenwin'");
|
||||
|
||||
@@ -496,7 +496,7 @@ class programModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getStakeholders($programID = 0, $orderBy, $pager = null)
|
||||
public function getStakeholders($programID = 0, $orderBy = '', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t2.account,t2.realname,t2.role,t2.qq,t2.mobile,t2.phone,t2.weixin,t2.email,t1.id,t1.type,t1.from,t1.key')->from(TABLE_STAKEHOLDER)->alias('t1')
|
||||
->leftJoin(TABLE_USER)->alias('t2')->on('t1.user=t2.account')
|
||||
|
||||
@@ -340,7 +340,7 @@ class projectModel extends model
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function getTotalStoriesByProject($projectID = 0, $productIdList, $type = 'story', $status = 'all')
|
||||
public function getTotalStoriesByProject($projectID = 0, $productIdList = array(), $type = 'story', $status = 'all')
|
||||
{
|
||||
return $this->dao->select('count(t2.id) as stories')->from(TABLE_PROJECTSTORY)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
|
||||
@@ -698,7 +698,7 @@ class projectModel extends model
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getTreeMenu($projectID = 0, $userFunc, $param = 0)
|
||||
public function getTreeMenu($projectID = 0, $userFunc = '', $param = 0)
|
||||
{
|
||||
$projectMenu = array();
|
||||
$stmt = $this->dbh->query($this->buildMenuQuery($projectID));
|
||||
|
||||
@@ -2286,7 +2286,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByAssignedTo($productID, $branch, $modules, $account, $type = 'story', $orderBy, $pager)
|
||||
public function getByAssignedTo($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
|
||||
{
|
||||
return $this->getByField($productID, $branch, $modules, 'assignedTo', $account, $type, $orderBy, $pager);
|
||||
}
|
||||
@@ -2302,7 +2302,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByOpenedBy($productID, $branch, $modules, $account, $type = 'story', $orderBy, $pager)
|
||||
public function getByOpenedBy($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
|
||||
{
|
||||
return $this->getByField($productID, $branch, $modules, 'openedBy', $account, $type, $orderBy, $pager);
|
||||
}
|
||||
@@ -2318,7 +2318,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByReviewedBy($productID, $branch, $modules, $account, $type = 'story', $orderBy, $pager)
|
||||
public function getByReviewedBy($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
|
||||
{
|
||||
return $this->getByField($productID, $branch, $modules, 'reviewedBy', $account, $type, $orderBy, $pager, 'include');
|
||||
}
|
||||
@@ -2336,7 +2336,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByReviewBy($productID, $branch, $modules, $account, $type = 'story', $orderBy, $pager)
|
||||
public function getByReviewBy($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
|
||||
{
|
||||
return $this->getByField($productID, $branch, $modules, 'reviewBy', $account, $type, $orderBy, $pager);
|
||||
}
|
||||
@@ -2351,7 +2351,7 @@ class storyModel extends model
|
||||
* @param object $pager
|
||||
* @return array
|
||||
*/
|
||||
public function getByClosedBy($productID, $branch, $modules, $account, $type = 'story', $orderBy, $pager)
|
||||
public function getByClosedBy($productID, $branch, $modules, $account, $type = 'story', $orderBy = '', $pager = null)
|
||||
{
|
||||
return $this->getByField($productID, $branch, $modules, 'closedBy', $account, $type, $orderBy, $pager);
|
||||
}
|
||||
@@ -2367,7 +2367,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByStatus($productID, $branch, $modules, $status, $type = 'story', $orderBy, $pager)
|
||||
public function getByStatus($productID, $branch, $modules, $status, $type = 'story', $orderBy = '', $pager = null)
|
||||
{
|
||||
return $this->getByField($productID, $branch, $modules, 'status', $status, $type, $orderBy, $pager);
|
||||
}
|
||||
@@ -2385,7 +2385,7 @@ class storyModel extends model
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getByPlan($productID, $branch, $modules, $plan, $type = 'story', $orderBy, $pager)
|
||||
public function getByPlan($productID, $branch, $modules, $plan, $type = 'story', $orderBy = '', $pager = null)
|
||||
{
|
||||
return $this->getByField($productID, $branch, $modules, 'plan', $plan, $type, $orderBy, $pager);
|
||||
}
|
||||
@@ -2405,7 +2405,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByField($productID, $branch, $modules, $fieldName, $fieldValue, $type = 'story', $orderBy, $pager, $operator = 'equal')
|
||||
public function getByField($productID, $branch, $modules, $fieldName, $fieldValue, $type = 'story', $orderBy = '', $pager = null, $operator = 'equal')
|
||||
{
|
||||
if(!$this->loadModel('common')->checkField(TABLE_STORY, $fieldName) and $fieldName != 'reviewBy') return array();
|
||||
|
||||
@@ -2471,7 +2471,7 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBySearch($productID, $branch = '', $queryID, $orderBy, $executionID = '', $type = 'story', $excludeStories = '', $pager = null)
|
||||
public function getBySearch($productID, $branch = '', $queryID = 0, $orderBy = '', $executionID = '', $type = 'story', $excludeStories = '', $pager = null)
|
||||
{
|
||||
$executionID = empty($executionID) ? 0 : $executionID;
|
||||
$products = $this->loadModel('product')->getProducts($executionID);
|
||||
|
||||
@@ -353,7 +353,7 @@ class testcaseModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBySuite($productID, $branch = 0, $suiteID, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
|
||||
public function getBySuite($productID, $branch = 0, $suiteID = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.title as storyTitle, t3.version as version')->from(TABLE_CASE)->alias('t1')
|
||||
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
|
||||
@@ -623,7 +623,7 @@ class testcaseModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByStatus($productID = 0, $branch, $type = 'all', $status = 'all', $moduleID = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
|
||||
public function getByStatus($productID = 0, $branch = 0, $type = 'all', $status = 'all', $moduleID = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
|
||||
{
|
||||
$modules = $moduleID ? $this->loadModel('tree')->getAllChildId($moduleID) : '0';
|
||||
|
||||
@@ -856,7 +856,7 @@ class testcaseModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getCases2Link($caseID, $browseType = 'bySearch', $queryID)
|
||||
public function getCases2Link($caseID, $browseType = 'bySearch', $queryID = 0)
|
||||
{
|
||||
if($browseType == 'bySearch')
|
||||
{
|
||||
|
||||
@@ -534,7 +534,7 @@ class tree extends control
|
||||
* @access public
|
||||
* @return string the html select string.
|
||||
*/
|
||||
public function ajaxGetModules($productID, $viewType = 'story', $branchID, $number, $currentModuleID = 0)
|
||||
public function ajaxGetModules($productID, $viewType = 'story', $branchID = 0, $number = 0, $currentModuleID = 0)
|
||||
{
|
||||
$currentModule = $this->tree->getById($currentModuleID);
|
||||
$currentModuleID = (isset($currentModule->branch) and $currentModule->branch == 0) ? $currentModuleID : 0;
|
||||
|
||||
+10
-10
@@ -386,7 +386,7 @@ class treeModel extends model
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getTreeMenu($rootID, $type = 'root', $startModule = 0, $userFunc, $extra = '', $branch = 0, $extraParams = '')
|
||||
public function getTreeMenu($rootID, $type = 'root', $startModule = 0, $userFunc = '', $extra = '', $branch = 0, $extraParams = '')
|
||||
{
|
||||
if($type == 'line') $rootID = 0;
|
||||
|
||||
@@ -448,12 +448,12 @@ class treeModel extends model
|
||||
* @param int $rootID
|
||||
* @param int $productID
|
||||
* @param int $startModule
|
||||
* @param int $userFunc
|
||||
* @param string $userFunc
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getTaskTreeMenu($rootID, $productID = 0, $startModule = 0, $userFunc, $extra = '')
|
||||
public function getTaskTreeMenu($rootID, $productID = 0, $startModule = 0, $userFunc = '', $extra = '')
|
||||
{
|
||||
$extra = array('executionID' => $rootID, 'productID' => $productID, 'tip' => true, 'extra' => $extra);
|
||||
|
||||
@@ -630,12 +630,12 @@ class treeModel extends model
|
||||
* @param int $rootID
|
||||
* @param int $productID
|
||||
* @param int $startModule
|
||||
* @param int $userFunc
|
||||
* @param string $userFunc
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getBugTreeMenu($rootID, $productID = 0, $startModule = 0, $userFunc, $extra = '')
|
||||
public function getBugTreeMenu($rootID, $productID = 0, $startModule = 0, $userFunc = '', $extra = '')
|
||||
{
|
||||
$extra = array('executionID' => $rootID, 'productID' => $productID, 'tip' => true, 'extra' => $extra);
|
||||
|
||||
@@ -704,12 +704,12 @@ class treeModel extends model
|
||||
* @param int $rootID
|
||||
* @param int $productID
|
||||
* @param int $startModule
|
||||
* @param int $userFunc
|
||||
* @param string $userFunc
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getCaseTreeMenu($rootID, $productID = 0, $startModule = 0, $userFunc, $extra = '')
|
||||
public function getCaseTreeMenu($rootID, $productID = 0, $startModule = 0, $userFunc = '', $extra = '')
|
||||
{
|
||||
$extra = array('projectID' => $rootID, 'productID' => $productID, 'tip' => true, 'extra' => $extra);
|
||||
|
||||
@@ -787,11 +787,11 @@ class treeModel extends model
|
||||
*
|
||||
* @param int $rootID
|
||||
* @param int $startModule
|
||||
* @param array $userFunc
|
||||
* @param string $userFunc
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getProjectStoryTreeMenu($rootID, $startModule = 0, $userFunc)
|
||||
public function getProjectStoryTreeMenu($rootID, $startModule = 0, $userFunc = '')
|
||||
{
|
||||
$this->app->loadLang('branch');
|
||||
|
||||
@@ -856,7 +856,7 @@ class treeModel extends model
|
||||
* @param & $&treeMenu
|
||||
* @param object $module
|
||||
* @param string $type
|
||||
* @param array $userFunc
|
||||
* @param string $userFunc
|
||||
* @param array $extra
|
||||
* @param int $branch
|
||||
* @access public
|
||||
|
||||
Reference in New Issue
Block a user