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

This commit is contained in:
hufangzhou
2021-04-27 16:17:56 +08:00
8 changed files with 69 additions and 24 deletions
+1 -1
View File
@@ -63,7 +63,7 @@
<?php if($i == 0):?>
<td <?php if($rowspan > 1) echo "rowspan='$rowspan'"?>><?php echo date(DT_DATETIME1, $backupFile->time);?></td>
<?php endif;?>
<td class='text-left' style='padding-left:5px;'><?php echo $file;?></td>
<td title=<?php echo $file;?> class='text-left' style='padding-left:5px;'><?php echo $file;?></td>
<td><?php echo zget($summary, 'allCount', '');?></td>
<td><?php echo zget($summary, 'count', '');?></td>
<td>
+2 -2
View File
@@ -61,7 +61,7 @@ class bug extends control
}
else
{
$products = $this->product->getPairs();
$products = $this->product->getPairs('', 0, 'program_asc');
}
$this->view->products = $this->products = $products;
@@ -514,7 +514,7 @@ class bug extends control
if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story")));
/* Get products and projects. */
$products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed');
$products = $this->config->CRProduct ? $this->products : $this->product->getPairs('noclosed', 0, 'program_asc');
$projects = array(0 => '');
if($projectID)
{
+25 -10
View File
@@ -261,21 +261,36 @@ class productModel extends model
*
* @param string $mode
* @param string $programID
* @param string $orderBy program_asc
* @return array
*/
public function getPairs($mode = '', $programID = 0)
public function getPairs($mode = '', $programID = 0, $orderBy = '')
{
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getProductPairs();
$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');
if($orderBy == 'program_asc')
{
$products = $this->dao->select('t1.id as id, t1.name as name, t1.*, IF(INSTR(" closed", t1.status) < 2, 0, 1) AS isClosed')->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_desc')
->fetchPairs('id', 'name');
}
else
{
$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;
}
+3 -2
View File
@@ -40,7 +40,7 @@
<th class='w-80px'><?php echo $lang->project->begin;?></th>
<th class='w-80px'><?php echo $lang->project->end;?></th>
<th class='w-70px'><?php echo $lang->project->status;?></th>
<th class="w-70px"><?php echo $lang->project->budget;?></th>
<th class="w-80px text-center"><?php echo $lang->project->budget;?></th>
<th class="w-60px text-center"><?php echo $lang->project->estimate;?></th>
<th class="w-60px text-center"><?php echo $lang->project->consume;?></th>
<th class='w-50px'><?php echo $lang->project->progress;?></th>
@@ -78,7 +78,8 @@
</td>
<?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 text-right padding-right'><?php echo $budgetTitle;?></td>
<?php $textStyle = $project->budget != 0 ? 'text-right' : 'text-center';?>
<td title='<?php echo $budgetTitle;?>' class="text-ellipsis <?php echo $textStyle;?>"><?php echo $budgetTitle;?></td>
<td class="text-right padding-right" title="<?php echo $project->hours->totalEstimate . ' ' . $lang->execution->workHour;?>"><?php echo $project->hours->totalEstimate . $lang->execution->workHourUnit;?></td>
<td class="text-right padding-right" title="<?php echo $project->hours->totalConsumed . ' ' . $lang->execution->workHour;?>"><?php echo $project->hours->totalConsumed . $lang->execution->workHourUnit;?></td>
<td class='padding-right text-center'>
+12
View File
@@ -260,6 +260,18 @@ class testreport extends control
die(js::locate('back'));
}
if($this->app->openApp == 'qa')
{
$productID = $this->product->saveState(key($productIdList), $this->products);
$this->loadModel('qa')->setMenu($this->products, $productID);
}
elseif($this->app->openApp == 'project')
{
$projects = $this->project->getPairsByProgram();
$projectID = $this->project->saveState($execution->project, $projects);
$this->project->setMenu($projectID);
}
$builds = $this->build->getByList($buildIdList);
$stories = !empty($builds) ? $this->testreport->getStories4Test($builds) : $this->story->getExecutionStories($execution->id);;
+2 -1
View File
@@ -116,7 +116,8 @@
<?php
if(common::canBeChanged('report', $report))
{
if(common::hasPriv('testreport', 'create')) echo html::a(inLink('create', "objectID=$report->objectID&objectType=$report->objectType&extra=$report->id"), "<i class='icon-refresh'></i>", '', "class='btn' title='{$lang->testreport->recreate}' data-app='{$this->app->openApp}'");
$extra = $report->objectType == 'execution' ? "&extra=$report->tasks" : '';
if(common::hasPriv('testreport', 'create')) echo html::a(inLink('create', "objectID=$report->objectID&objectType=$report->objectType" . $extra), "<i class='icon-refresh'></i>", '', "class='btn' title='{$lang->testreport->recreate}' data-app='{$this->app->openApp}'");
common::printIcon('testreport', 'edit', "reportID=$report->id", '', 'button');
common::printIcon('testreport', 'delete', "reportID=$report->id", '', 'button', 'trash', 'hiddenwin');
}
+8 -2
View File
@@ -279,8 +279,11 @@ class todo extends control
{
$confirmNote = 'confirm' . ucfirst($todo->type);
$confirmURL = $this->createLink($todo->type, 'view', "id=$todo->idvalue");
if($todo->type == 'bug') $app = 'qa';
if($todo->type == 'task') $app = 'execution';
if($todo->type == 'story') $app = 'product';
$cancelURL = $this->server->HTTP_REFERER;
die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, 'parent', 'parent'));
die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, 'window.parent.$.apps.open', 'parent', $app));
}
if(isonlybody())die(js::reload('parent.parent'));
die(js::reload('parent'));
@@ -446,8 +449,11 @@ class todo extends control
{
$confirmNote = 'confirm' . ucfirst($todo->type);
$confirmURL = $this->createLink($todo->type, 'view', "id=$todo->idvalue");
if($todo->type == 'bug') $app = 'qa';
if($todo->type == 'task') $app = 'execution';
if($todo->type == 'story') $app = 'product';
$cancelURL = $this->server->HTTP_REFERER;
die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, 'parent', 'parent'));
die(js::confirm(sprintf($this->lang->todo->$confirmNote, $todo->idvalue), $confirmURL, $cancelURL, 'window.parent.$.apps.open', 'parent', $app));
}
if(isonlybody())die(js::reload('parent.parent'));
die(js::reload('parent'));