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

This commit is contained in:
tianshujie98
2021-04-02 10:40:23 +08:00
17 changed files with 265 additions and 281 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ ALTER TABLE `zt_user` ADD `analysis` text NOT NULL AFTER `nature`;
ALTER TABLE `zt_user` ADD `strategy` text NOT NULL AFTER `analysis`;
ALTER TABLE `zt_user` CHANGE `avatar` `avatar` text NOT NULL AFTER `commiter`;
REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'custom', '', 'URSR', '6');
REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'custom', '', 'URSR', '2');
REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'project', '', 'unitList', 'CNY,USD');
REPLACE INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'project', '', 'defaultCurrency', 'CNY');
+1 -1
View File
@@ -4146,6 +4146,6 @@ REPLACE INTO `zt_lang` (`lang`, `module`, `section`, `key`, `value`, `system`) V
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');
INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'common', '', 'CRExecution', '1');
INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'custom', '', 'URSR', '6');
INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'custom', '', 'URSR', '2');
INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'project', '', 'unitList', 'CNY,USD');
INSERT INTO `zt_config` (`owner`, `module`, `section`, `key`, `value`) VALUES ('system', 'project', '', 'defaultCurrency', 'CNY');
@@ -62,7 +62,7 @@ html[lang="en"] .product-info .type-info {color: #A6AAB8; text-align: center; po
.block-statistic .data {width: 40%; text-align: left; padding: 10px 0px; font-size: 14px; font-weight: 700;}
.block-statistic .dataTitle {width: 60%; text-align: right; padding: 10px 0px; font-size: 14px;}
.block-statistic .executionName {padding-top: 2px; font-size: 14px;}
.block-statistic .executionName {padding: 2px 10px; font-size: 14px;}
.block-statistic .lastIteration {padding-top: 6px;}
.block-statistic .progress-text-left {margin-right: 90px}
.block-statistic .progress-text-left .progress-text {padding-top: 2px; font-size: 14px; padding-right:5px;}
@@ -134,70 +134,70 @@ $(function()
<?php foreach($projects as $project):?>
<div class="tab-pane fade<?php if($project->id == $selected) echo ' active in';?>" id="tab3Content<?php echo $project->id;?>">
<div class="table-row">
<?php if($project->model == 'scrum'):?>
<div class='table-row'>
<div class="col-4 text-center">
<div><h4><?php echo $lang->block->story;?></h4></div>
<div>
<div class="col dataTitle"><?php echo $lang->project->allStories . ":";?></div>
<div class="col data"><?php echo $project->allStories;?></div>
<?php if($project->model == 'scrum'):?>
<div class='table-row'>
<div class="col-4 text-center">
<div><h4><?php echo $lang->block->story;?></h4></div>
<div>
<div class="col dataTitle"><?php echo $lang->project->allStories . ":";?></div>
<div class="col data"><?php echo $project->allStories;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->project->doneStories . ":";?></div>
<div class="col data"><?php echo $project->doneStories;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->left . ":";?></div>
<div class="col data"><?php echo $project->leftStories;?></div>
</div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->project->doneStories . ":";?></div>
<div class="col data"><?php echo $project->doneStories;?></div>
<div class="col-4 text-center">
<div><h4><?php echo $lang->block->investment;?></h4></div>
<div>
<div class="col dataTitle"><?php echo $lang->block->totalPeople . ":";?></div>
<div class="col data"><?php echo $project->teamCount;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->estimate . ":";?></div>
<div class="col data"><?php echo $project->estimate;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->consumedHours . ":";?></div>
<div class="col data"><?php echo $project->consumed;?></div>
</div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->left . ":";?></div>
<div class="col data"><?php echo $project->leftStories;?></div>
<div class="col-4 text-center">
<div><h4><?php echo $lang->block->bug;?></h4></div>
<div>
<div class="col dataTitle"><?php echo $lang->block->totalBug . ":";?></div>
<div class="col data"><?php echo $project->allBugs;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->doneBugs . ":";?></div>
<div class="col data"><?php echo $project->doneBugs;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->leftBugs . ":";?></div>
<div class="col data"><?php echo $project->leftBugs;?></div>
</div>
</div>
</div>
<div class="col-4 text-center">
<div><h4><?php echo $lang->block->investment;?></h4></div>
<div>
<div class="col dataTitle"><?php echo $lang->block->totalPeople . ":";?></div>
<div class="col data"><?php echo $project->teamCount;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->estimate . ":";?></div>
<div class="col data"><?php echo $project->estimate;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->consumedHours . ":";?></div>
<div class="col data"><?php echo $project->consumed;?></div>
</div>
</div>
<div class="col-4 text-center">
<div><h4><?php echo $lang->block->bug;?></h4></div>
<div>
<div class="col dataTitle"><?php echo $lang->block->totalBug . ":";?></div>
<div class="col data"><?php echo $project->allBugs;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->doneBugs . ":";?></div>
<div class="col data"><?php echo $project->doneBugs;?></div>
</div>
<div>
<div class="col dataTitle"><?php echo $lang->block->leftBugs . ":";?></div>
<div class="col data"><?php echo $project->leftBugs;?></div>
</div>
</div>
</div>
<?php if(!empty($project->executions)):?>
<div class="table-row project-info">
<div class="col-3 text-center"><h4><?php echo $lang->block->last;?></h4></div>
<div class="table-row lastIteration">
<div class='col-3 text-center executionName'><?php echo html::a($this->createLink('execution', 'task', "executionID={$project->executions[0]->id}"), $project->executions[0]->name);?></div>
<div class='col-8'>
<div class='progress progress-text-left'>
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo $project->executions[0]->hours->progress;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $project->executions[0]->hours->progress;?>%">
<span class='progress-text'><?php echo $project->executions[0]->hours->progress . '%';?></span>
<?php if(!empty($project->executions)):?>
<div class="table-row project-info">
<div class="col-2 text-right"><h4><?php echo $lang->block->last;?></h4></div>
<div class="table-row lastIteration">
<div class='col-5 text-center executionName'><?php echo html::a($this->createLink('execution', 'task', "executionID={$project->executions[0]->id}"), $project->executions[0]->name);?></div>
<div class='col-7'>
<div class='progress progress-text-left'>
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="<?php echo $project->executions[0]->hours->progress;?>" aria-valuemin="0" aria-valuemax="100" style="width: <?php echo $project->executions[0]->hours->progress;?>%">
<span class='progress-text'><?php echo $project->executions[0]->hours->progress . '%';?></span>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif;?>
<?php else:?>
<?php endif;?>
<?php else:?>
<div class="col-12">
<div class='table-row text-left weekly-row with-padding'>
<span class='weekly-title'><?php echo $lang->project->weekly;?></span>
+1 -1
View File
@@ -258,7 +258,7 @@ $lang->execution->menu->view['subMenu']->tree = "$lang->treeView|execution|
$lang->execution->menu->qa['subMenu'] = new stdclass();
//$lang->execution->menu->qa['subMenu']->qa = array('link' => "$lang->dashboard|execution|qa|executionID=%s");
$lang->execution->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|execution|bug|executionID=%s", 'subModule' => 'bug');
$lang->execution->menu->qa['subMenu']->testcase = array('link' => "{$lang->testcase->shortCommon}|execution|testcase|executionID=%s", 'alias' => 'create');
$lang->execution->menu->qa['subMenu']->testcase = array('link' => "{$lang->testcase->shortCommon}|execution|testcase|executionID=%s", 'subModule' => 'testcase');
$lang->execution->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|execution|testtask|executionID=%s", 'subModule' => 'testtask');
$lang->execution->menu->qa['subMenu']->testreport = array('link' => "{$lang->testreport->common}|execution|testreport|exeutionID=%s", 'subModule' => 'testreport');
+4 -3
View File
@@ -877,9 +877,9 @@ class doc extends control
// setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$this->session->set('docList', $this->app->getURI(true), 'doc');
$objects = $this->doc->getOrderedObjects($type);
if($type == 'product')
{
$objects = $this->loadModel('product')->getPairs('nocode');
$objectID = $this->product->saveState($objectID, $objects);
$table = TABLE_PRODUCT;
@@ -890,7 +890,6 @@ class doc extends control
}
else
{
$objects = $this->loadModel('project')->getPairsByProgram();
$objectID = $this->project->saveState($objectID, $objects);
$table = TABLE_PROJECT;
@@ -900,6 +899,7 @@ class doc extends control
$this->app->rawMethod = 'project';
}
if(!$libID) $libID = key($libs);
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
if(empty($object)) $this->locate($this->createLink($type, 'create', '', '', '', $this->session->project));
@@ -913,7 +913,7 @@ class doc extends control
$this->doc->buildSearchForm(0, array(), 0, $actionURL, 'objectLibs');
$this->lang->TRActions = common::hasPriv('doc', 'createLib') ? html::a(helper::createLink('doc', 'createLib', "type=$type&objectID=$objectID"), "<i class='icon icon-plus'></i> " . $this->lang->doc->createlib, '', "class='btn btn-secondary iframe' data-width='70%'") : '';
$this->lang->TRActions .= common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($type, $objectID) : '';
$this->lang->TRActions .= common::hasPriv('doc', 'create') ? $this->doc->buildCreateButton4Doc($type, $objectID, $libID) : '';
$this->view->customObjectLibs = $customObjectLibs;
$this->view->showLibs = $this->config->doc->custom->objectLibs;
@@ -924,6 +924,7 @@ class doc extends control
$this->view->type = $type;
$this->view->object = $object;
$this->view->libs = $this->doc->getLibsByObject($type, $objectID);
$this->view->moduleTree = $this->doc->getTreeMenu($type, $objectID, 0);
$this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
$this->display();
}
+2 -1
View File
@@ -3,6 +3,7 @@
.addbtn .icon-plus {font-size: 18px; display: block; opacity: 0.5; transition: opacity .2s; text-shadow: 1px 1px 3px rgba(0,0,0,.2);}
.addbtn:hover .icon-plus {opacity: .9; animation: flash-icon 1s linear alternate infinite;}
#dropMenu {min-width: 250px; box-sizing: inhert;}
#dropMenu .table-col .list-group {padding-top: 10px;}
.main-col .block-files .panel-heading {padding-right: 20px;}
.main-col .block-files .panel-heading .panel-title {height: 35px; line-height: 30px;}
#dropMenu .table-col .list-group {padding-top: 10px;}
.side-col .action a {margin-bottom: 3px;}
+2 -1
View File
@@ -49,6 +49,7 @@ $lang->doc->item = ' Items';
$lang->doc->num = 'Documents';
$lang->doc->searchResult = 'Search Result';
$lang->doc->mailto = 'Mailto';
$lang->doc->noModule = 'No document in this lib, please create it';
$lang->doc->moduleDoc = 'By Module';
$lang->doc->searchDoc = 'Search';
@@ -93,7 +94,7 @@ $lang->doc->createlib = 'Create Document Library';
$lang->doc->allLibs = 'Library List';
$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon} Libraries";
$lang->doc->showFiles = 'Attachments';
$lang->doc->editlib = 'Edit Document Library';
$lang->doc->editLib = 'Edit Document Library';
$lang->doc->deleteLib = 'Delete Document Library';
$lang->doc->fixedMenu = 'Fix to Menu';
$lang->doc->removeMenu = 'Remove from Menu';
+6 -5
View File
@@ -49,6 +49,7 @@ $lang->doc->item = '项';
$lang->doc->num = '文档数量';
$lang->doc->searchResult = '搜索结果';
$lang->doc->mailto = '抄送给';
$lang->doc->noModule = '文档库下没有目录和文档,请维护目录或者创建文档';
$lang->doc->moduleDoc = '按模块浏览';
$lang->doc->searchDoc = '搜索';
@@ -74,10 +75,10 @@ $lang->doc->view = '文档详情';
$lang->doc->diff = '对比';
$lang->doc->diffAction = '对比文档';
$lang->doc->sort = '文档排序';
$lang->doc->manageType = '维护分类';
$lang->doc->editType = '编辑分类';
$lang->doc->deleteType = '删除分类';
$lang->doc->addType = '增加分类';
$lang->doc->manageType = '维护目录';
$lang->doc->editType = '编辑目录';
$lang->doc->deleteType = '删除目录';
$lang->doc->addType = '增加目录';
$lang->doc->childType = '子分类';
$lang->doc->collect = '收藏';
$lang->doc->cancelCollection = '取消收藏';
@@ -93,7 +94,7 @@ $lang->doc->createlib = '创建文档库';
$lang->doc->allLibs = '文档库列表';
$lang->doc->objectLibs = "{$lang->productCommon}/{$lang->executionCommon}库列表";
$lang->doc->showFiles = '附件库';
$lang->doc->editlib = '编辑文档库';
$lang->doc->editLib = '编辑文档库';
$lang->doc->deleteLib = '删除文档库';
$lang->doc->fixedMenu = '固定到菜单栏';
$lang->doc->removeMenu = '从菜单栏移除';
+161 -16
View File
@@ -1152,6 +1152,76 @@ class docModel extends model
return $libs;
}
/**
* Get ordered objects for dic.
*
* @param string $objectType
* @access public
* @return array
*/
public function getOrderedObjects($objectType = 'product')
{
$myObjects = $normalObjects = $closedObjects = array();
if($objectType == 'product')
{
$products = $this->loadModel('product')->getList();
foreach($products as $id => $product)
{
if($product->status == 'normal' and $product->PO == $this->app->user->account)
{
$myObjects[$id] = $product->name;
}
elseif($product->status == 'normal' and !($product->PO == $this->app->user->account))
{
$normalObjects[$id] = $product->name;
}
elseif($product->status == 'closed')
{
$closedObjects[$id] = $product->name;
}
}
}
elseif($objectType == 'project')
{
$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('deleted')->eq(0)
->andWhere('type')->eq('project')
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
->orderBy('order_asc')
->fetchAll('id');
$orderedProjects = array();
foreach($programs as $programID => $programName)
{
foreach($projects as $id => $project)
{
if($project->parent and $project->parent != $programID) continue;
$orderedProjects[$id] = $project;
unset($projects[$project->id]);
}
}
foreach($orderedProjects as $id => $project)
{
if($project->status != 'done' and $project->status != 'closed' and $project->PM == $this->app->user->account)
{
$myObjects[$id] = $project->name;
}
else if($project->status != 'done' and $project->status != 'closed' and !($project->PM == $this->app->user->account))
{
$normalObjects[$id] = $project->name;
}
else if($project->status == 'done' or $project->status == 'closed')
{
$closedObjects[$id] = $project->name;
}
}
}
return $myObjects + $normalObjects + $closedObjects;
}
/**
* Stat module and document counts of lib.
*
@@ -1598,28 +1668,24 @@ class docModel extends model
*
* @param string $type
* @param int $objectID
* @param int $libID
* @access public
* @return string
*/
public function buildCreateButton4Doc($type, $objectID)
public function buildCreateButton4Doc($type, $objectID, $libID)
{
$libs = $this->getLibs('all', strpos($this->config->doc->custom->showLibs, 'unclosed') !== false ? 'unclosedProject' : '');
$html = "";
if($libs)
$html = "<div class='dropdown' id='createDropdown'>";
$html .= "<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i>" . $this->lang->doc->create . " <span class='caret'></span></button>";
$html .= "<ul class='dropdown-menu' style='left:0px'>";
foreach($this->lang->doc->typeList as $typeKey => $typeName)
{
$libID = key($libs);
$html .= "<div class='dropdown' id='createDropdown'>";
$html .= "<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i>" . $this->lang->doc->create . " <span class='caret'></span></button>";
$html .= "<ul class='dropdown-menu' style='left:0px'>";
foreach($this->lang->doc->typeList as $typeKey => $typeName)
{
$class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : '';
$html .= "<li>";
$html .= html::a(helper::createLink('doc', 'create', "type=$type&objectID=$objectID&libID=$libID&moduleID=0&type=$typeKey"), $typeName, '', "class='$class' data-app='{$this->app->openApp}'");
$html .= "</li>";
}
$html .="</ul></div>";
$class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : '';
$html .= "<li>";
$html .= html::a(helper::createLink('doc', 'create', "type=$type&objectID=$objectID&libID=$libID&moduleID=0&type=$typeKey"), $typeName, '', "class='$class' data-app='{$this->app->openApp}'");
$html .= "</li>";
}
$html .= "</ul></div>";
return $html;
}
@@ -1814,4 +1880,83 @@ EOF;
return $output;
}
/**
* Get doc tree menu.
*
* @param string $rootID
* @param int $rootID
* @param int $startModule
* @access public
* @return string
*/
public function getTreeMenu($type, $rootID, $startModule = 0)
{
return '';
$extra['projectID'] = $rootID;
$menu = "<ul id='modules' class='tree' data-ride='tree' data-name='tree-story'>";
$startModulePath = '';
if($startModule > 0)
{
$startModule = $this->getById($startModule);
if($startModule) $startModulePath = $startModule->path . '%';
}
$executionModules = $this->getTaskTreeModules($rootID, true);
$executionBranches = $this->dao->select('DISTINCT t2.branch')->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where('t1.project')->eq($rootID)
->andWhere('t2.deleted')->eq(0)
->fetchPairs();
/* Get module according to product. */
$products = $this->loadModel('product')->getProductPairsByProject($rootID);
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products));
$productNum = count($products);
foreach($products as $id => $product)
{
$projectProductLink = helper::createLink('projectstory', 'story', "projectID=$rootID&productID=$id");
$executionProductLink = helper::createLink('execution', 'story', "executionID=$rootID&ordery=&status=byProduct&praram=$id");
$link = $this->app->rawModule == 'projectstory' ? $projectProductLink : $executionProductLink;
if($productNum > 1) $menu .= "<li>" . html::a($link, $product, '_self', "id='product$id'");
/* tree menu. */
$tree = '';
if(empty($branchGroups[$id])) $branchGroups[$id]['0'] = '';
foreach($branchGroups[$id] as $branch => $branchName)
{
$treeMenu = array();
$query = $this->dao->select('*')->from(TABLE_MODULE)
->where('root')->eq((int)$id)
->andWhere('type')->eq('story')
->beginIF(count($branchGroups[$id]) > 1)->andWhere('branch')->eq($branch)->fi()
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
->andWhere('deleted')->eq(0)
->orderBy('grade desc, branch, `order`, type')
->get();
$stmt = $this->dbh->query($query);
while($module = $stmt->fetch())
{
/* If not manage, ignore unused modules. */
if(isset($executionModules[$module->id]) and $this->app->rawModule == 'execution') $this->buildTree($treeMenu, $module, 'task', $userFunc, $extra);
if($this->app->rawModule == 'projectstory') $this->buildTree($treeMenu, $module, 'task', $userFunc, $extra);
}
if((isset($treeMenu[0]) and $branch) or isset($executionBranches[$branch]))
{
$childMenu = isset($treeMenu[0]) ? "<ul>{$treeMenu[0]}</ul>" : '';
$projectBranchLink = helper::createLink('projectstory', 'story', "projectID=$rootID&productID=$id&branch=" . (empty($branch) ? 0 : $branch) . "&browseType=byBranch");
$executionBranchLink = helper::createLink('execution', 'story', "executionID=$rootID&ordery=&status=byBranch&praram=" . (empty($branch) ? "{$id},0" : $branch));
$link = $this->app->rawModule == 'projectstory' ? $projectBranchLink : $executionBranchLink;
if($branchName) $treeMenu[0] = "<li>" . html::a($link, $branchName, '_self', "id='branch" . (empty($branch) ? "{$id}_0" : $branch) . "'") . "{$childMenu}</li>";
}
$tree .= isset($treeMenu[0]) ? $treeMenu[0] : '';
}
if($productNum > 1) $tree = "<ul>" . $tree . "</ul>\n</li>";
$menu .= $tree;
}
$menu .= '</ul>';
return $menu;
}
}
+14 -185
View File
@@ -15,193 +15,22 @@ if(empty($type)) $type = 'product';
$sideWidth = common::checkNotCN() ? '270' : '238';
?>
<div class="side-col" style="width:<?php echo $sideWidth;?>px" data-min-width="<?php echo $sideWidth;?>">
<div class="cell">
<div class="tabs">
<ul class='nav nav-tabs'>
<?php foreach($lang->doclib->tabList as $tabValue => $tabName):?>
<?php $activeClass = $tabValue == $type ? 'active' : '';?>
<li class='<?php echo $activeClass;?>'><?php echo html::a("#{$tabValue}", $tabName, '', "data-tab");?></li>
<?php endforeach;?>
</ul>
<div class="tab-content">
<?php foreach($lang->doclib->tabList as $tabValue => $tabName):?>
<?php $activeClass = $tabValue == $type ? 'active' : '';?>
<div class="tab-pane <?php echo $activeClass;?>" id="<?php echo "$tabValue";?>">
<ul data-name="docsTree" data-ride="tree" data-initial-state="preserve" class="tree no-margin">
<?php if(isset($sideSubLibs[$tabValue])):?>
<?php if(empty($sideLibs[$tabValue])):?>
<li>
<?php
if($lang->navGroup->doc == 'doc' and $tabValue == 'execution')
{
echo $lang->noData;
}
else
{
$text = zget($lang->doclib->create, $tabValue, '');
if($text and common::hasPriv($tabValue, 'create')) echo html::a($this->createLink($tabValue, 'create', ''), $text, '', "class='text-ellipsis'");
}
?>
</li>
<?php else:?>
<?php foreach($sideLibs[$tabValue] as $tabMenuID => $tabMenuName):?>
<?php
$customLibCount = 0;
$mainLibID = 0;
if(isset($sideSubLibs[$tabValue][$tabMenuID]))
{
foreach($sideSubLibs[$tabValue][$tabMenuID] as $subLibID => $subLibName)
{
if(is_numeric($subLibID) and !empty($mainLibID)) $customLibCount += 1;
if(is_numeric($subLibID) and empty($mainLibID)) $mainLibID = $subLibID;
}
}
$icon = $tabValue == 'product' ? "<i class='icon icon-product'></i> " : "<i class='icon icon-stack'></i> ";
$activeClass = ($this->methodName == 'objectlibs' && $type == $tabValue && $object->id == $tabMenuID) ? 'active' : '';
$activeClass = ($this->methodName == 'browse' && isset($currentLib->id) && $currentLib->id == $mainLibID) ? 'active' : $activeClass;
?>
<li <?php echo "class='$activeClass'";?>>
<?php if($customLibCount > 0):?>
<?php echo html::a($this->createLink('doc', 'objectLibs', "type=$tabValue&objectID=$tabMenuID"), $icon . $tabMenuName, '', "class='text-ellipsis' title='{$tabMenuName}'");?>
<?php else:?>
<?php echo html::a($this->createLink('doc', 'browse', "libID=$mainLibID"), $icon . $tabMenuName, '', "class='text-ellipsis' title='{$tabMenuName}'");?>
<?php endif;?>
<?php if(isset($sideSubLibs[$tabValue][$tabMenuID])):?>
<ul>
<?php foreach($sideSubLibs[$tabValue][$tabMenuID] as $subLibID => $subLibName):?>
<?php
if($subLibID == 'execution')
{
$subLibLink = inlink('allLibs', "type=execution&product=$tabMenuID");
$activeClass = ($this->methodName == 'alllibs' && $type == 'execution' && $$tabValue == $tabMenuID) ? "class='active'" : '';
$icon = 'icon-stack';
}
elseif($subLibID == 'files')
{
$subLibLink = inlink('showFiles', "type=$tabValue&objectID=$tabMenuID");
$activeClass = ($this->methodName == 'showfiles' && $type == $tabValue && $object->id == $tabMenuID) ? "class='active'" : '';
$icon = 'icon-paper-clip';
}
else
{
$subLibLink = inlink('browse', "libID=$subLibID");
$activeClass = ($this->methodName == 'browse' && $browseType != 'bymodule' && $subLibID == $libID) ? "class='active'" : '';
$icon = 'icon-folder-outline';
}
?>
<?php if($customLibCount > 0):?>
<li <?php echo $activeClass;?>>
<?php echo html::a($subLibLink, "<i class='icon {$icon}'></i> " . $subLibName, '', "class='text-ellipsis' title='{$subLibName}'");?>
<?php endif;?>
<?php if(isset($allModules[$subLibID])):?>
<?php if($customLibCount > 0):?>
<ul>
<?php endif;?>
<?php foreach($allModules[$subLibID] as $module):?>
<?php if($module->parent != 0) continue;?>
<li <?php if($this->methodName == 'browse' && $browseType == 'bymodule' && $moduleID == $module->id) echo "class='active'";?>>
<?php echo html::a($this->createLink('doc', 'browse', "libID=$subLibID&browseType=byModule&param={$module->id}"), "<i class='icon icon-folder-outline'></i> " . $module->name, '', "class='text-ellipsis' title='{$module->name}'");?>
<?php $this->doc->printChildModule($module, $subLibID, $this->methodName, $browseType, $moduleID);?>
</li>
<?php endforeach;?>
<?php if($customLibCount > 0):?>
</ul>
<?php endif;?>
<?php endif;?>
<?php if($customLibCount > 0):?>
</li>
<?php endif;?>
<?php if($customLibCount == 0 and !is_numeric($subLibID)):?>
<li <?php echo $activeClass;?>>
<?php echo html::a($subLibLink, "<i class='icon {$icon}'></i> " . $subLibName, '', "class='text-ellipsis' title='{$subLibName}'");?>
</li>
<?php endif;?>
<?php endforeach;?>
</ul>
<?php endif;?>
</li>
<?php endforeach;?>
<?php endif;?>
<?php else:?>
<?php if(empty($sideLibs[$tabValue])):?>
<li>
<?php
$text = zget($lang->doclib->create, $tabValue, '');
if($text and common::hasPriv('doc', 'createLib')) echo html::a($this->createLink('doc', 'createLib', "type={$tabValue}"), $text, '', "class='iframe' data-width='70%'");
?>
</li>
<?php else:?>
<?php foreach($sideLibs[$tabValue] as $sideLibID => $sideLibName):?>
<?php if($tabValue == 'book'):?>
<?php include './bookside.html.php';?>
<?php else:?>
<?php
$activeClass = ($this->methodName == 'objectlibs' && $type == $tabValue && $object->id == $sideLibID) ? 'active' : '';
$activeClass = ($this->methodName == 'browse' && isset($currentLib->id) && $currentLib->id == $sideLibID) ? 'active' : $activeClass;
?>
<li <?php echo "class='$activeClass'";?>>
<?php echo html::a($this->createLink('doc', 'browse', "libID=$sideLibID"), "<i class='icon icon-folder-o'></i> " . $sideLibName, '', "class='text-ellipsis' title='{$sideLibName}'");?>
<?php if(isset($allModules[$sideLibID])):?>
<ul>
<?php foreach($allModules[$sideLibID] as $module):?>
<?php if($module->parent != 0) continue;?>
<li <?php if($this->methodName == 'browse' && $browseType == 'bymodule' && $moduleID == $module->id) echo "class='active'";?>>
<?php echo html::a($this->createLink('doc', 'browse', "libID=$sideLibID&browseType=byModule&param={$module->id}"), "<i class='icon icon-folder-outline'></i> " . $module->name, '', "class='text-ellipsis' title='{$module->name}'");?>
<?php $this->doc->printChildModule($module, $sideLibID, $this->methodName, $browseType, $moduleID);?>
</li>
<?php endforeach;?>
</ul>
<?php endif;?>
</li>
<?php endif;?>
<?php endforeach;?>
<?php endif;?>
<?php endif;?>
</ul>
</div>
<?php endforeach;?>
<div class="cell">
<?php if(!$moduleTree):?>
<hr class="space">
<div class="text-center text-muted">
<?php echo $lang->doc->noModule;?>
</div>
<hr class="space">
<?php endif;?>
<?php echo $moduleTree;?>
<div class="text-center action">
<?php common::printLink('tree', 'browse', "rootID=0&view=story", $lang->doc->manageType, '', "class='btn btn-info btn-wide'");?>
<?php common::printLink('tree', 'browse', "rootID=0&view=story", $lang->doc->editLib, '', "class='btn btn-info btn-wide'");?>
<?php common::printLink('tree', 'browse', "rootID=0&view=story", $lang->doc->deleteLib, '', "class='btn btn-info btn-wide'");?>
<hr class="space-sm" />
</div>
</div>
<div class='side-footer clearfix'>
<span id='customShowLibsBox'>
<?php echo html::a('###', "<i class='icon-cog'></i> {$lang->doc->customShowLibs}", '', "class='setting text-secondary small' data-target='#settingModal' data-toggle='modal'");?>
</span>
<span id='orderBox'>
<?php
if(common::hasPriv('doc', 'sort'))
{
echo html::a('###', "<i class='icon-sort'></i> {$lang->doc->orderLib}", '', "id='orderLib' class='text-secondary small " . (($type != 'product' and $type !='execution') ? '' : 'hidden') . "' style='padding-left:5px;'");
echo html::a('javascript:saveOrder()', "<i class='icon-checked'></i> {$lang->save}", '', "id='saveOrder' class='text-secondary small hidden' style='padding-left:10px;'");
}
?>
</span>
</div>
</div>
<div class='modal fade' id='settingModal' aria-hidden="true">
<div class='modal-dialog mw-400px'>
<div class='modal-content'>
<div class='modal-header'>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only"><?php echo $lang->close;?></span></button>
<strong><?php echo $lang->doc->customShowLibs;?></strong>
</div>
<div class='modal-body'>
<form action='<?php echo $this->createLink('custom', 'ajaxSetDoc');?>' target='hiddenwin' method='post'>
<table class='table table-form'>
<tr>
<td><?php echo html::checkbox('showLibs', $lang->doc->customShowLibsList, $config->doc->custom->showLibs);?></td>
</tr>
<tr>
<td><?php echo html::submitButton();?></td>
</tr>
</table>
</form>
</div>
</div>
</div>
</div>
<script>
$(function()
{
+2 -2
View File
@@ -727,7 +727,7 @@ class execution extends control
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
$queryID = ($type == 'bysearch') ? (int)$param : 0;
$queryID = ($type == 'bysearch') ? (int)$param : 0;
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
@@ -768,7 +768,7 @@ class execution extends control
$storyBugs = $this->loadModel('bug')->getStoryBugCounts($storyIdList, $executionID);
$storyCases = $this->loadModel('testcase')->getStoryCaseCounts($storyIdList);
$plans = $this->execution->getPlans($products);
$plans = $this->execution->getPlans($products);
$allPlans = array('' => '');
if(!empty($plans))
{
+5 -2
View File
@@ -213,7 +213,7 @@
if(commonModel::isTutorialMode())
{
$wizardParams = helper::safe64Encode($param);
echo html::a($this->createLink('tutorial', 'wizard', "module=task&method=create&params=$wizardParams"), "<i class='icon-plus'></i>",'', "class='btn btn-task-create' title='{$lang->execution->wbs}'");
echo html::a($this->createLink('tutorial', 'wizard', "module=task&method=create&params=$wizardParams"), "<i class='icon-plus'></i>",'', "class='btn btn-task-create' title='{$lang->execution->wbs}' data-app='execution'");
}
else
{
@@ -224,7 +224,10 @@
if($hasDBPriv) common::printIcon('task', 'batchCreate', "executionID={$execution->id}&story={$story->id}", '', 'list', 'pluses');
$lang->testcase->batchCreate = $lang->testcase->create;
if($productID && $hasDBPriv) common::printIcon('testcase', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', 'list', 'sitemap');
if($productID and $hasDBPriv and common::hasPriv('testcase', 'create'))
{
echo html::a($this->createLink('testcase', 'create', "productID=$story->product&branch=$story->branch&moduleID=$story->module&form=&param=0&storyID=$story->id"), '<i class="icon-testcase-create icon-sitemap"></i>', '', "title='{$lang->testcase->create}' data-app='qa'");
}
if($canBeChanged and common::hasPriv('execution', 'unlinkStory', $execution))
{
+3 -2
View File
@@ -218,6 +218,7 @@ if($config->systemMode == 'new')
$lang->resource->project->bug = 'bug';
$lang->resource->project->testcase = 'testcase';
$lang->resource->project->testtask = 'testtask';
$lang->resource->project->testreport = 'testreport';
$lang->resource->project->execution = 'execution';
$lang->resource->project->export = 'export';
$lang->resource->project->createGuide = 'createGuide';
@@ -254,8 +255,8 @@ if($config->systemMode == 'new')
$lang->project->methodOrder[145] = 'bug';
$lang->project->methodOrder[150] = 'testcase';
$lang->project->methodOrder[155] = 'testtask';
$lang->project->methodOrder[160] = 'execution';
$lang->project->methodOrder[165] = 'testreport';
$lang->project->methodOrder[160] = 'testreport';
$lang->project->methodOrder[165] = 'execution';
$lang->project->methodOrder[170] = 'export';
$lang->project->methodOrder[175] = 'createGuide';
+1 -1
View File
@@ -905,7 +905,7 @@ class projectModel extends model
if($project->budget != 0 and $program->budget != 0)
{
$availableBudget = $this->loadModel('program')->getBudgetLeft($program);
if($project->budget > $availableBudget + $oldProject->budget) dao::$errors['budget'] = $this->lang->project->beyondParentBudget;
if($project->budget > $availableBudget + $oldProject->budget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget;
}
}
+1 -1
View File
@@ -1776,7 +1776,7 @@ class story extends control
public function report($productID, $branchID, $storyType = 'story', $browseType = 'unclosed', $moduleID = 0, $chartType = 'pie')
{
$this->loadModel('report');
$this->view->charts = array();
$this->view->charts = array();
if(!empty($_POST))
{
+2 -1
View File
@@ -3,8 +3,9 @@ $(function()
if(typeof(resetActive) != 'undefined') return false;
if(typeof(storyType) == 'undefined') storyType = '';
if(typeof(rawModule) == 'undefined') rawModule = 'product';
if(typeof(app) == 'undefined') app = '';
if(typeof(execution) != 'undefined') rawModule = 'projectstory';
if(['project', 'projectstory'].indexOf(rawModule) === -1 && app != 'qa')
if(['project', 'projectstory'].indexOf(rawModule) === -1)
{
$('#navbar .nav li').removeClass('active');
$("#navbar .nav li[data-id=" + storyType + ']').addClass('active');
+2 -1
View File
@@ -13,7 +13,8 @@
<?php include '../../common/view/header.html.php';?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php echo html::a($this->createLink('product', 'browse', "productID=$productID&branch=$branchID&browseType=$browseType&moduleID=$moduleID"), "<i class='icon icon-back icon-sm'> </i>" . $lang->goback, '', "class='btn btn-link'");?>
<?php $browseLink = $this->session->storyList ? $this->session->storyList : $this->createLink('product', 'browse', "productID=$productID&branch=$branchID&browseType=$browseType&moduleID=$moduleID&storyType=$storyType")?>
<?php echo html::a($browseLink, "<i class='icon icon-back icon-sm'> </i>" . $lang->goback, '', "class='btn btn-link'");?>
<div class='divider'></div>
<div class='page-title'>
<span class='text'><?php echo $lang->story->report->common;?></span>