Merge branch '15.0.beta3' of https://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3

This commit is contained in:
wangyidong
2021-04-01 11:35:41 +08:00
25 changed files with 150 additions and 88 deletions
+3 -1
View File
@@ -4139,7 +4139,9 @@ INSERT INTO `zt_lang` (`lang`, `module`, `section`, `key`, `value`, `system`) VA
('zh-cn', 'custom', 'URSRList', '2', '{\"SRName\":\"\\u7814\\u53d1\\u9700\\u6c42\",\"URName\":\"\\u7528\\u6237\\u9700\\u6c42\"}', '1'),
('zh-cn', 'custom', 'URSRList', '3', '{\"SRName\":\"\\u8f6f\\u9700\",\"URName\":\"\\u7528\\u9700\"}', '1'),
('zh-cn', 'custom', 'URSRList', '4', '{\"SRName\":\"\\u6545\\u4e8b\",\"URName\":\"\\u53f2\\u8bd7\"}', '1'),
('zh-cn', 'custom', 'URSRList', '5', '{\"SRName\":\"\\u9700\\u6c42\",\"URName\":\"\\u7528\\u6237\\u9700\\u6c42\"}', '1');
('zh-cn', 'custom', 'URSRList', '5', '{\"SRName\":\"\\u9700\\u6c42\",\"URName\":\"\\u7528\\u6237\\u9700\\u6c42\"}', '1'),
('en', 'custom', 'URSRList', '3', '{\"SRName\":\"Story\",\"URName\":\"Epic\"}', '0'),
('en', 'custom', 'URSRList', '2', '{\"SRName\":\"Story\",\"URName\":\"Requirement\"}', '0');
INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'custom', '', 'hourPoint', '1');
INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', '', 'CRProduct', '1');
+1
View File
@@ -1174,6 +1174,7 @@ class block extends control
*/
public function printWaterfallReportBlock()
{
$this->app->loadLang('programplan');
$project = $this->loadModel('project')->getByID($this->session->project);
$today = helper::today();
$date = date('Ymd', strtotime('this week Monday'));
+1 -1
View File
@@ -34,7 +34,7 @@
<?php if($longBlock):?>
<td class='text-center'><?php echo $project->teamCount;?></td>
<td class='text-right' title="<?php echo $project->consumed . ' ' . $lang->execution->workHour;?>"><?php echo $project->consumed . $lang->execution->workHourUnit;?></td>
<?php $programBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? number_format((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : number_format((float)$project->budget, 2);?>
<?php $programBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? round((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : round((float)$project->budget, 2);?>
<td class='text-right'><?php echo $project->budget != 0 ? zget($lang->project->currencySymbol, $project->budgetUnit) . ' ' . $programBudget : $lang->project->future;?></td>
<td class='text-center'><?php echo $project->leftStories;?></td>
<td class='text-center'><?php echo $project->leftTasks;?></td>
@@ -21,6 +21,7 @@
#cards .project-detail > p {margin-bottom: 8px;}
#cards .project-detail .progress {height: 4px;}
#cards .project-detail .progress-text-left .progress-text {width: 50px; left: -50px;}
#cards .project-detail .col-xs-5 {top: 4px;}
#cards .panel-heading {cursor: pointer;}
#cards .project-stages-container {margin: 0 -16px -16px -16px; padding: 0 4px; height: 46px; overflow-x: auto; position: relative;}
#cards .project-stages:after {content: ' '; width: 30px; display: block; right: -16px; top: 16px; bottom: -6px; z-index: 1; background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); position: absolute;}
@@ -100,14 +101,12 @@
<p class='text-muted'><?php echo $lang->project->lastIteration; ?></p>
<?php if($project):?>
<div class='row'>
<div class='col-xs-5'><?php echo $project->name;?></div>
<div class='col-xs-5'><?php echo html::a($this->createLink('execution', 'task', "executionID={$project->id}"), $project->name);?></div>
<div class='col-xs-7'>
<div class="progress progress-text-left">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo $project->hours->progress;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $project->hours->progress;?>%">
<span class="progress-text"><?php echo $project->hours->progress;?>%</span>
<div class='progress-pie' data-doughnut-size='90' data-color='#00da88' data-value="<?php echo $project->hours->progress;?>" data-width='24' data-height='24' data-back-color='#e8edf3'>
<div class='progress-info'><?php echo $project->hours->progress;?></div>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
@@ -19,8 +19,8 @@
<?php if($longBlock):?>
<th class='w-80px'><?php echo $lang->issue->severity;?></th>
<th class='w-80px'><?php echo $lang->issue->pri;?></th>
<th class='w-120px'><?php echo $lang->issue->owner;?></th>
<th class='w-120px'><?php echo $lang->issue->assignedTo;?></th>
<th class='w-80px'><?php echo $lang->issue->owner;?></th>
<th class='w-80px'><?php echo $lang->issue->assignedTo;?></th>
<?php endif;?>
<th class='w-80px'><?php echo $lang->issue->status;?></th>
</tr>
@@ -1,6 +1,6 @@
<style>
.block-waterfallreport .col-left {width: 25%; text-align: center;}
.block-waterfallreport .col-right {width: 75%;}
.block-waterfallreport .col-right {width: 87%;}
.block-waterfallreport .panel-body {padding-top: 0;}
.block-waterfallreport .table-row {margin-bottom: 20px;}
.block-waterfallreport .stage {position: absolute; top: 14px; left: 90px;}
@@ -26,23 +26,23 @@
<div class='col-right'>
<div class='row tiles'>
<div class="col tile">
<div class="tile-title">PV</div>
<div class="tile-title"><?php echo 'PV(' . $lang->programplan->end . ')';?></div>
<div class="tile-amount"><?php echo $pv == 0 ? 0 : $pv;?></div>
</div>
<div class="col tile">
<div class="tile-title">EV</div>
<div class="tile-title"><?php echo 'EV(' . $lang->programplan->realEnd . ')';?></div>
<div class="tile-amount"><?php echo $ev == 0 ? 0 : $ev;?></div>
</div>
<div class="col tile">
<div class="tile-title">AC</div>
<div class="tile-title"><?php echo 'AC(' . $lang->programplan->ac . ')';?></div>
<div class="tile-amount"><?php echo $ac == 0 ? 0 : $ac;?></div>
</div>
<div class="col tile">
<div class="tile-title">SV%</div>
<div class="tile-title"><?php echo 'SV(' . $lang->programplan->sv . ')';?></div>
<div class="tile-amount"><?php echo $sv . '%';?></div>
</div>
<div class="col tile">
<div class="tile-title">CV%</div>
<div class="tile-title"><?php echo 'CV(' . $lang->programplan->cv . ')';?></div>
<div class="tile-amount"><?php echo $cv . '%';?></div>
</div>
</div>
@@ -15,14 +15,14 @@
<th class='c-id w-50px'><?php echo $lang->idAB;?></th>
<th class='c-name'><?php echo $lang->risk->name;?></th>
<?php if($longBlock):?>
<th class='w-80px'> <?php echo $lang->risk->strategy;?></th>
<th class='w-60px'> <?php echo $lang->risk->strategy;?></th>
<?php endif;?>
<th class='w-80px'><?php echo $lang->risk->status;?></th>
<th class='w-60px'><?php echo $lang->risk->status;?></th>
<?php if($longBlock):?>
<th class='w-80px'><?php echo $lang->risk->rate;?></th>
<th class='w-80px'><?php echo $lang->risk->pri;?></th>
<th class='w-120px'><?php echo $lang->risk->assignedTo;?></th>
<th class='w-120px'><?php echo $lang->risk->category;?></th>
<th class='w-80px'><?php echo $lang->risk->assignedTo;?></th>
<th class='w-80px'><?php echo $lang->risk->category;?></th>
<?php endif;?>
</tr>
</thead>
+6 -5
View File
@@ -48,15 +48,16 @@ class bug extends control
$this->loadModel('qa');
/* Get product data. */
$projectID = 0;
$objectID = 0;
if($this->app->openApp == 'project')
{
$projectID = $this->session->project;
$products = $this->loadModel('project')->getProducts($projectID, false);
$objectID = $this->session->project;
$products = $this->loadModel('project')->getProducts($objectID, false);
}
elseif($this->app->openApp == 'execution')
{
$products = $this->loadModel('execution')->getProducts($this->session->execution, false);
$objectID = $this->session->execution;
$products = $this->loadModel('execution')->getProducts($objectID, false);
}
else
{
@@ -65,7 +66,7 @@ class bug extends control
$this->view->products = $this->products = $products;
$openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa';
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=bug&projectID=$projectID")));
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=bug&objectID=$objectID")));
}
/**
+2 -2
View File
@@ -2572,8 +2572,8 @@ class execution extends control
$projects = $this->loadModel('program')->getProjectList(0, 'all', 0, 'order_asc');
$executionGroups = $this->dao->select('*')->from(TABLE_EXECUTION)
->where('id')->in($this->app->user->view->sprints)
->andWhere('deleted')->eq(0)
->where('deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
->beginIF($this->config->systemMode == 'new')->andWhere('project')->in(array_keys($projects))->fi()
->orderBy('id_desc')
->fetchGroup('project', 'id');
+1 -1
View File
@@ -32,7 +32,7 @@
<p>
<span class="text-muted"><?php echo $lang->bug->noBug;?></span>
<?php if(common::canModify('execution', $execution) and common::hasPriv('bug', 'create')):?>
<?php echo html::a($this->createLink('bug', 'create', "productID=$productID&branch=$branchID&extra=executionID=$execution->id"), "<i class='icon icon-plus'></i> " . $lang->bug->create, '', "class='btn btn-info'");?>
<?php echo html::a($this->createLink('bug', 'create', "productID=$productID&branch=$branchID&extra=executionID=$execution->id"), "<i class='icon icon-plus'></i> " . $lang->bug->create, '', "class='btn btn-info' data-app='execution'");?>
<?php endif;?>
</p>
</div>
-1
View File
@@ -53,7 +53,6 @@
<tr class='text-left'>
<td><?php echo html::a($link, sprintf('%03d', $execution->id));?></td>
<td class='c-name text-left'>
<span class='project-type-label label label-info label-outline'><?php echo zget($lang->execution->typeList, $execution->type);?></span>
<?php echo html::a($link, $execution->name, '', "title='$execution->name'");?>
</td>
<?php if($config->systemMode == 'new'):?>
+1 -1
View File
@@ -64,7 +64,7 @@
<?php endif;?>
<td class='text-left'><?php echo $project->begin;?></td>
<td class='text-left'><?php echo $project->end == LONG_TIME ? $this->lang->project->longTime : $project->end;?></td>
<?php $projectBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? number_format((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : number_format((float)$project->budget, 2);?>
<?php $projectBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? round((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : round((float)$project->budget, 2);?>
<td class='text-right'><?php echo $project->budget != 0 ? zget($lang->project->currencySymbol, $project->budgetUnit) . ' ' . $projectBudget : $lang->project->future;?></td>
<td>
<?php $userID = isset($PMList[$project->PM]) ? $PMList[$project->PM]->id : ''?>
+8 -4
View File
@@ -989,9 +989,10 @@ class product extends control
$this->lang->project->menuOrder = $this->lang->{$project->model}->menuOrder;
$this->app->rawModule = $activeMenu;
if($activeMenu == 'testcase') $this->lang->{$project->model}->menu->qa['subMenu']->testcase['subModule'] = 'product';
if($activeMenu == 'bug') $this->lang->{$project->model}->menu->qa['subMenu']->bug['subModule'] = 'product';
if($activeMenu == 'testtask') $this->lang->{$project->model}->menu->qa['subMenu']->testtask['subModule'] = 'product';
if($activeMenu == 'bug') $this->lang->{$project->model}->menu->qa['subMenu']->bug['subModule'] = 'product';
if($activeMenu == 'testcase') $this->lang->{$project->model}->menu->qa['subMenu']->testcase['subModule'] = 'product';
if($activeMenu == 'testtask') $this->lang->{$project->model}->menu->qa['subMenu']->testtask['subModule'] = 'product';
if($activeMenu == 'testreport') $this->lang->{$project->model}->menu->qa['subMenu']->testreport['subModule'] = 'product';
}
elseif($moduleName == 'qa')
{
@@ -1007,7 +1008,10 @@ class product extends control
{
$this->loadModel('execution')->setMenu($objectID);
$this->app->rawModule = $activeMenu;
if($activeMenu == 'testreport') $this->lang->execution->menu->qa['subMenu']->testtask['subMenu']->testtask['subModule'] = 'product';
if($activeMenu == 'bug') $this->lang->execution->menu->qa['subMenu']->bug['subModule'] = 'product';
if($activeMenu == 'testcase') $this->lang->execution->menu->qa['subMenu']->testcase['subModule'] = 'product';
if($activeMenu == 'testtask') $this->lang->execution->menu->qa['subMenu']->testtask['subModule'] = 'product';
if($activeMenu == 'testreport') $this->lang->execution->menu->qa['subMenu']->testreport['subModule'] = 'product';
}
$this->view->title = $this->lang->$moduleName->common;
+8 -8
View File
@@ -261,14 +261,14 @@ class productModel extends model
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProductPairs();
$products = $this->dao->select('*, IF(INSTR(" closed", t1.status) < 2, 0, 1) AS isClosed, t1.id AS id, t1.name AS name')
->from(TABLE_PRODUCT)->alias('t1')
->leftJoin(TABLE_PROGRAM)->alias('t2')->on('t1.program = t2.id')
->where('t1.deleted')->eq(0)
->beginIF($programID)->andWhere('t1.program')->eq($programID)->fi()
->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('t1.status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->products)->fi()
->orderBy('t2.order_asc, t1.line_desc, t1.order_asc')
$orderBy = !empty($this->config->product->orderBy) ? $this->config->product->orderBy : 'isClosed';
$products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed')
->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->beginIF($programID)->andWhere('program')->eq($programID)->fi()
->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi()
->orderBy($orderBy)
->fetchPairs('id', 'name');
return $products;
}
+1 -1
View File
@@ -76,7 +76,7 @@
<td class='c-status' title='<?php echo $status;?>'>
<span class="status-project status-<?php echo $project->status?>"><?php echo $status;?></span>
</td>
<?php $projectBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? number_format((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : number_format((float)$project->budget, 2);?>
<?php $projectBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? round((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : round((float)$project->budget, 2);?>
<?php $budgetTitle = $project->budget != 0 ? zget($this->lang->project->currencySymbol, $project->budgetUnit) . ' ' . $projectBudget : $this->lang->project->future;?>
<td title='<?php echo $budgetTitle;?>' class='text-ellipsis'><?php echo $budgetTitle;?></td>
<td class="text-right" title="<?php echo $project->hours->totalEstimate . ' ' . $lang->project->workHour;?>"><?php echo $project->hours->totalEstimate . $lang->execution->workHourUnit;?></td>
+1 -1
View File
@@ -57,7 +57,7 @@
<?php $userID = isset($PMList[$program->PM]) ? $PMList[$program->PM]->id : ''?>
<?php if(!empty($program->PM)) echo html::a($this->createLink('user', 'profile', "userID=$userID", '', true), zget($users, $program->PM), '', "data-toggle='modal' data-type='iframe' data-width='600'");?>
</td>
<?php $programBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? number_format((float)$program->budget / 10000, 2) . $lang->project->tenThousand : number_format((float)$program->budget, 2);?>
<?php $programBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? round((float)$program->budget / 10000, 2) . $lang->project->tenThousand : round((float)$program->budget, 2);?>
<td class='text-right'><?php echo $program->budget != 0 ? zget($lang->project->currencySymbol, $program->budgetUnit) . ' ' . $programBudget : $lang->project->future;?></td>
<td class='c-status'><span class="status-program status-<?php echo $program->status?>"><?php echo zget($lang->project->statusList, $program->status, '');?></span></td>
<td><?php echo $program->begin;?></td>
+5 -1
View File
@@ -108,7 +108,11 @@ class project extends control
public function ajaxGetDropMenu($projectID = 0, $module, $method)
{
$programs = $this->dao->select('id, name')->from(TABLE_PROGRAM)->where('type')->eq('program')->andWhere('deleted')->eq(0)->orderBy('order_asc')->fetchPairs();
$projects = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->in($this->app->user->view->projects)->andWhere('deleted')->eq(0)->orderBy('order_asc')->fetchAll('id');
$projects = $this->dao->select('*')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->orderBy('order_asc')
->fetchAll('id');
/* Sort project by program. */
$this->loadModel('program');
+3 -2
View File
@@ -1260,7 +1260,7 @@ class projectModel extends model
if($id == 'budget')
{
$projectBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? number_format((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : number_format((float)$project->budget, 2);
$projectBudget = in_array($this->app->getClientLang(), ['zh-cn','zh-tw']) ? round((float)$project->budget / 10000, 2) . $this->lang->project->tenThousand : round((float)$project->budget, 2);
$budgetTitle = $project->budget != 0 ? zget($this->lang->project->currencySymbol, $project->budgetUnit) . ' ' . $projectBudget : $this->lang->project->future;
$title = "title='$budgetTitle'";
@@ -1618,7 +1618,8 @@ class projectModel extends model
/* Replace waterfall lang. */
if($project->model == 'waterfall')
{
$lang->scrum->menu->execution['link'] = str_replace($lang->executionCommon, $lang->project->stage, $lang->scrum->menu->execution['link']);
$this->loadModel('execution');
$lang->scrum->menu->execution['link'] = str_replace($lang->executionCommon, $lang->project->stage, $lang->scrum->menu->execution['link']);
$lang->execution->create = str_replace($lang->executionCommon, $lang->project->stage, $lang->execution->create);
$lang->execution->name = str_replace($lang->executionCommon, $lang->project->stage, $lang->execution->name);
$lang->execution->status = str_replace($lang->executionCommon, $lang->project->stage, $lang->execution->status);
-3
View File
@@ -54,9 +54,6 @@ js::set('browseType', $browseType);
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
<div class="cell">
<?php echo $programTree;?>
<div class="text-center">
<?php common::printLink('project', 'programTitle', '', $lang->project->moduleSetting, '', "class='btn btn-info btn-wide iframe'", true, true);?>
</div>
</div>
</div>
<?php endif;?>
+13
View File
@@ -585,6 +585,18 @@ class story extends control
$this->commonAction($storyID);
/* Sort products. */
$myProducts = array();
$othersProducts = array();
$products = $this->loadModel('product')->getList();
foreach($products as $product)
{
if($product->status == 'normal' and $product->PO == $this->app->user->account) $myProducts[$product->id] = $product->name;
if($product->status == 'normal' and !($product->PO == $this->app->user->account)) $othersProducts[$product->id] = $product->name;
if($product->status == 'closed') continue;
}
/* Assign. */
$story = $this->story->getById($storyID, 0, true);
$product = $this->product->getById($story->product);
@@ -599,6 +611,7 @@ class story extends control
$this->view->stories = $stories;
$this->view->users = $this->user->getPairs('pofirst|nodeleted', "$story->assignedTo,$story->openedBy,$story->closedBy");
$this->view->product = $product;
$this->view->products = $myProducts + $othersProducts;
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($story->product);
$this->display();
}
+6 -5
View File
@@ -42,15 +42,16 @@ class testcase extends control
$this->loadModel('qa');
/* Get product data. */
$projectID = 0;
$objectID = 0;
if($this->app->openApp == 'project')
{
$projectID = $this->session->project;
$products = $this->loadModel('project')->getProducts($projectID, false);
$objectID = $this->session->project;
$products = $this->loadModel('project')->getProducts($objectID, false);
}
elseif($this->app->openApp == 'execution')
{
$products = $this->loadModel('execution')->getProducts($this->session->execution, false);
$objectID = $this->session->execution;
$products = $this->loadModel('execution')->getProducts($objectID, false);
}
else
{
@@ -59,7 +60,7 @@ class testcase extends control
$this->view->products = $this->products = $products;
$openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa';
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testcase&projectID=$projectID")));
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testcase&objectID=$objectID")));
}
/**
+6 -5
View File
@@ -45,15 +45,16 @@ class testreport extends control
$this->app->loadLang('report');
/* Get product data. */
$projectID = 0;
$objectID = 0;
if($this->app->openApp == 'project')
{
$projectID = $this->session->project;
$products = $this->loadModel('project')->getProducts($projectID, false);
$objectID = $this->session->project;
$products = $this->loadModel('project')->getProducts($objectID, false);
}
elseif($this->app->openApp == 'execution')
{
$products = $this->loadModel('execution')->getProducts($this->session->execution, false);
$objectID = $this->session->execution;
$products = $this->loadModel('execution')->getProducts($objectID, false);
}
else
{
@@ -62,7 +63,7 @@ class testreport extends control
$this->view->products = $this->products = $products;
$openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa';
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testreport&projectID=$projectID")));
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testreport&objectID=$objectID")));
}
/**
+6 -5
View File
@@ -40,15 +40,16 @@ class testtask extends control
$this->loadModel('product');
/* Get product data. */
$projectID = 0;
$objectID = 0;
if($this->app->openApp == 'project')
{
$projectID = $this->session->project;
$products = $this->loadModel('project')->getProducts($projectID, false);
$objectID = $this->session->project;
$products = $this->loadModel('project')->getProducts($objectID, false);
}
elseif($this->app->openApp == 'execution')
{
$products = $this->loadModel('execution')->getProducts($this->session->execution, false);
$objectID = $this->session->execution;
$products = $this->loadModel('execution')->getProducts($objectID, false);
}
else
{
@@ -57,7 +58,7 @@ class testtask extends control
$this->view->products = $this->products = $products;
$openApp = ($this->app->openApp == 'project' or $this->app->openApp == 'execution') ? $this->app->openApp : 'qa';
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testtask&projectID=$projectID")));
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$openApp&activeMenu=testtask&objectID=$objectID")));
}
/**
+40 -2
View File
@@ -636,6 +636,7 @@ class upgradeModel extends model
$this->saveLogs('Execute 15_0');
$this->execSQL($this->getUpgradeFile('15.0'));
$this->adjustWhitelistOfProject();
$this->adjustWhitelistOfProduct();
$this->appendExec('15_0');
case '15_0_beta1':
$this->saveLogs('Execute 15_0_beta1');
@@ -4404,6 +4405,10 @@ class upgradeModel extends model
$groups = explode(',', $product->whitelist);
$groupAccounts = $this->group->getGroupAccounts($groups);
/* Get the whitelist data from the classic version mode upgrade. */
$groupAccounts += $this->dao->select('account')->from(TABLE_ACL)->where('objectID')->eq($product->id)->andWhere('objectType')->eq('product')->andWhere('type')->eq('whitelist')->fetchPairs('account');
$whiteList += $groupAccounts;
$this->personnel->updateWhitelist($groupAccounts, 'product', $product->id, 'whitelist', 'upgrade');
}
@@ -4414,10 +4419,12 @@ class upgradeModel extends model
{
if($sprint->acl != 'private') continue;
$groups = explode(',', $sprint->whitelist);
$groupAccounts = $this->group->getGroupAccounts($groups);
$groups = explode(',', $sprint->whitelist);
$groupAccounts = $this->group->getGroupAccounts($groups);
/* Get the whitelist data from the classic version mode upgrade. */
$groupAccounts += $this->dao->select('account')->from(TABLE_ACL)->where('objectID')->eq($sprint->id)->andWhere('objectType')->eq('sprint')->andWhere('type')->eq('whitelist')->fetchPairs('account');
$this->personnel->updateWhitelist($groupAccounts, 'sprint', $sprint->id, 'whitelist', 'upgrade');
}
}
@@ -4724,4 +4731,35 @@ class upgradeModel extends model
return true;
}
/**
* Adjust the whitelist of projects.
*
* @access public
* @return bool
*/
public function adjustWhitelistOfProduct()
{
$products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('acl')->eq('custom')->fetchAll();
foreach($products as $product)
{
$groups = explode(',', $product->whitelist);
$accounts = $this->dao->select('account')->from(TABLE_USERGROUP)->where('`group`')->in($groups)->fetchPairs('account');
foreach($accounts as $account)
{
$acl = new stdclass();
$acl->account = $account;
$acl->objectType = 'product';
$acl->objectID = $product->id;
$acl->type = 'whitelist';
$acl->source = 'upgrade';
$this->dao->insert(TABLE_ACL)->data($acl)->exec();
}
$this->dao->update(TABLE_PRODUCT)->set('acl')->eq('private')->where('id')->eq($product->id)->exec();
}
return true;
}
}
+22 -22
View File
@@ -77,10 +77,10 @@ class user extends control
$account = $user->account;
$todos = $this->todo->getList($type, $account, $status, 0, $pager, $sort);
$date = (int)$type == 0 ? helper::today() : $type;
$users = $this->loadModel('user')->getPairs('useid|noletter|noclosed');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* set menus. */
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->todo;
$this->view->position[] = $this->lang->user->todo;
@@ -119,7 +119,7 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* Modify story title. */
$this->loadModel('story');
@@ -135,7 +135,7 @@ class user extends control
$this->view->type = $type;
$this->view->user = $user;
$this->view->pager = $pager;
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
$this->display();
}
@@ -162,10 +162,10 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* Set the menu. */
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
/* Assign. */
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->task;
@@ -203,10 +203,10 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* Set menu. */
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
/* Load the lang of bug module. */
$this->app->loadLang('bug');
@@ -243,10 +243,10 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* Set menu. */
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
/* Save session. */
$this->session->set('testtaskList', $this->app->getURI(true), 'qa');
@@ -294,7 +294,7 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
@@ -323,7 +323,7 @@ class user extends control
$this->view->pageID = $pageID;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
$this->display();
}
@@ -345,7 +345,7 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* Load pager. */
$this->app->loadClass('pager', $static = true);
@@ -353,7 +353,7 @@ class user extends control
/* Set the menus. */
$this->loadModel('project');
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->execution;
$this->view->position[] = $this->lang->user->execution;
@@ -385,14 +385,14 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Set the menus. */
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->issue;
$this->view->position[] = $this->lang->user->issue;
@@ -425,14 +425,14 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Set the menus. */
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->risk;
$this->view->position[] = $this->lang->user->risk;
@@ -458,7 +458,7 @@ class user extends control
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
$this->view->title = "USER #$user->id $user->account/" . $this->lang->user->profile;
$this->view->position[] = $this->lang->user->common;
@@ -467,7 +467,7 @@ class user extends control
$this->view->groups = $this->loadModel('group')->getByAccount($account);
$this->view->deptPath = $this->dept->getParents($user->dept);
$this->view->personalData = $this->user->getPersonalData($user->account);
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
$this->display();
}
@@ -1055,10 +1055,10 @@ class user extends control
{
$user = $this->user->getById($userID, 'id');
$account = $user->account;
$users = $this->loadModel('dept')->getDeptUserPairs($user->dept, 'useid');
$users = $this->loadModel('dept')->getDeptUserPairs($this->app->user->dept, 'useid');
/* set menus. */
$this->view->userList = $this->user->setUserList($this->user->getPairs('noempty|noclosed|nodeleted|useid|noletter'), $userID);
$this->view->userList = $this->user->setUserList($users, $userID);
/* Save session. */
$uri = $this->app->getURI(true);