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

This commit is contained in:
wangyidong
2021-03-25 17:50:37 +08:00
46 changed files with 378 additions and 189 deletions
+15 -8
View File
@@ -213,16 +213,19 @@ $lang->scrum->menu->settings['subMenu']->whitelist = array('link' => "{$lang->
$lang->scrum->menu->settings['subMenu']->stakeholder = array('link' => "{$lang->stakeholder->common}|stakeholder|browse|project=%s", 'subModule' => 'stakeholder');
$lang->scrum->menu->settings['subMenu']->group = array('link' => "{$lang->priv}|project|group|project=%s", 'alias' => 'group,manageview,managepriv');
$lang->scrum->menu->devops['subMenu'] = new stdclass();
/* Waterfall menu. */
$lang->waterfall->menu = new stdclass();
$lang->waterfall->menu->index = array('link' => "$lang->dashboard|project|index|project=%s");
$lang->waterfall->menu->programplan = array('link' => "{$lang->productplan->shortCommon}|programplan|browse|project=%s", 'subModule' => 'programplan');
$lang->waterfall->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=project&objectID=%s");
$lang->waterfall->menu->story = array('link' => "$lang->SRCommon|projectstory|story|project=%s", 'subModule' => 'projectstory');
$lang->waterfall->menu->design = array('link' => "$lang->design|design|browse|product=%s");
$lang->waterfall->menu->repo = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&objectID=%s", 'subModule' => 'repo');
$lang->waterfall->menu->qa = array('link' => "{$lang->qa->common}|project|qa|projectID=%s", 'subModule' => 'testcase,testtask,bug', 'alias' => 'bug,testtask,testcase');
$lang->waterfall->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse", 'subModule' => 'projectrelease');
$lang->waterfall->menu->design = array('link' => "$lang->design|design|browse|project=%s");
$lang->waterfall->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&objectID=%s", 'subModule' => 'repo');
$lang->waterfall->menu->track = array('link' => "$lang->track|projectstory|track", 'alias' => 'track');
$lang->waterfall->menu->qa = array('link' => "{$lang->qa->common}|project|qa|projectID=%s", 'subModule' => 'testcase,testtask,bug', 'alias' => 'bug,testtask,testcase');
$lang->waterfall->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease');
$lang->waterfall->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s");
$lang->waterfall->menu->dynamic = array('link' => "$lang->dynamic|project|dynamic|project=%s");
$lang->waterfall->menu->other = array('link' => "$lang->other|workestimation|index|project=%s", 'class' => 'dropdown dropdown-hover');
@@ -256,8 +259,8 @@ $lang->waterfall->menu->other['dropMenu'] = new stdclass();
$lang->waterfall->menu->other['dropMenu']->estimation = array('link' => "$lang->estimation|workestimation|index|projectID=%s", 'subModule' => 'workestimation,durationestimation,budget');
$lang->waterfall->menu->other['dropMenu']->issue = array('link' => "$lang->issue|issue|browse|projectID=%s", 'subModule' => 'issue');
$lang->waterfall->menu->other['dropMenu']->risk = array('link' => "$lang->risk|risk|browse|projectID=%s", 'subModule' => 'risk');
$lang->waterfall->menu->other['dropMenu']->stakeholder = array('link' => "{$lang->stakeholder->common}|stakeholder|browse|projectID=%s", 'subModule' => 'stakeholder');
$lang->waterfall->menu->devops = $lang->scrum->menu->devops;
$lang->waterfall->menu->settings = $lang->scrum->menu->settings;
/* Execution menu. */
@@ -272,7 +275,7 @@ $lang->execution->menu->burn = array('link' => "$lang->burn|execution|burn|e
$lang->execution->menu->view = array('link' => "$lang->view|execution|grouptask|executionID=%s", 'alias' => 'grouptask,tree', 'class' => 'dropdown dropdown-hover');
$lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'batchcreate,linkstory,storykanban');
$lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|qa|executionID=%s", 'subModule' => 'bug,testcase,testtask,testreport', 'alias' => 'qa,bug,testcase,testtask,testreport');
$lang->execution->menu->repo = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&objectID=%s", 'subModule' => 'repo');
$lang->execution->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&objectID=%s", 'subModule' => 'repo');
$lang->execution->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=execution&objectID=%s", 'subModule' => 'doc');
$lang->execution->menu->build = array('link' => "{$lang->build->common}|execution|build|executionID=%s", 'subModule' => 'build');
$lang->execution->menu->action = array('link' => "$lang->dynamic|execution|dynamic|executionID=%s");
@@ -297,6 +300,8 @@ $lang->execution->menu->view['subMenu'] = new stdclass();
$lang->execution->menu->view['subMenu']->groupTask = "$lang->groupView|execution|grouptask|executionID=%s";
$lang->execution->menu->view['subMenu']->tree = "$lang->treeView|execution|tree|executionID=%s";
$lang->execution->menu->devops['subMenu'] = new stdclass();
$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');
@@ -344,8 +349,8 @@ $lang->qa->menu->testtask['subMenu'] = new stdclass();
$lang->qa->menu->testtask['subMenu']->testtask = array('link' => "{$lang->testtask->common}|testtask|browse|productID=%s", 'subModule' => 'testtask', 'alias' => 'linkcase,cases,start,close,batchrun,groupcase,report,importunitresult');
$lang->qa->menu->testtask['subMenu']->report = array('link' => "{$lang->testreport->common}|testreport|browse|productID=%s", 'subModule' => 'testreport');
$lang->qa->menu->automation['subMenu'] = new stdclass();
$lang->qa->menu->automation['subMenu']->browse = array('link' => "{$lang->intro}|automation|browse|productID=%s", 'alias' => '');
// $lang->qa->menu->automation['subMenu'] = new stdclass();
// $lang->qa->menu->automation['subMenu']->browse = array('link' => "{$lang->intro}|automation|browse|productID=%s", 'alias' => '');
// $lang->qa->menu->automation['subMenu']->framework = array('link' => '框架|automation|framework|productID=%s', 'alias' => '');
// $lang->qa->menu->automation['subMenu']->data = array('link' => '数据|automation|date|productID=%s', 'alias' => '');
// $lang->qa->menu->automation['subMenu']->interface = array('link' => '接口|automation|interface|productID=%s', 'alias' => '');
@@ -365,6 +370,8 @@ $lang->devops->menuOrder[15] = 'jenkins';
$lang->devops->menuOrder[20] = 'maintain';
$lang->devops->menuOrder[25] = 'rules';
$lang->devops->menu->code['subMenu'] = new stdclass();
/* Doc menu.*/
$lang->doc->menu = new stdclass();
$lang->doc->menu->recent = array('link' => "{$lang->doc->recent}|doc|recent");
+13 -8
View File
@@ -539,7 +539,7 @@ class commonModel extends model
if(!$openApp) return;
$icon = zget($lang->navIcons, $openApp, '');
if(!in_array($openApp, array('program', 'product', 'project')))
{
$nav = $lang->mainNav->$openApp;
@@ -1300,13 +1300,16 @@ EOD;
global $lang, $app;
if(isonlybody()) return false;
$moduleName = ($app->getModuleName() == 'story' and $app->openApp == 'project') ? 'projectstory' : $app->getModuleName();
echo "<nav class='container'>";
if(isset($preAndNext->pre) and $preAndNext->pre)
{
$id = (isset($_SESSION['testcaseOnlyCondition']) and !$_SESSION['testcaseOnlyCondition'] and $app->getModuleName() == 'testcase' and isset($preAndNext->pre->case)) ? 'case' : 'id';
$title = isset($preAndNext->pre->title) ? $preAndNext->pre->title : $preAndNext->pre->name;
$title = '#' . $preAndNext->pre->$id . ' ' . $title . ' ' . $lang->preShortcutKey;
$link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->pre->$id) : inLink('view', "ID={$preAndNext->pre->$id}");
$link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->pre->$id) : helper::createLink($moduleName, 'view', "ID={$preAndNext->pre->$id}");
$link .= '#app=' . $app->openApp;
echo html::a($link, '<i class="icon-pre icon-chevron-left"></i>', '', "id='prevPage' class='btn' title='{$title}'");
}
if(isset($preAndNext->next) and $preAndNext->next)
@@ -1314,7 +1317,8 @@ EOD;
$id = (isset($_SESSION['testcaseOnlyCondition']) and !$_SESSION['testcaseOnlyCondition'] and $app->getModuleName() == 'testcase' and isset($preAndNext->next->case)) ? 'case' : 'id';
$title = isset($preAndNext->next->title) ? $preAndNext->next->title : $preAndNext->next->name;
$title = '#' . $preAndNext->next->$id . ' ' . $title . ' ' . $lang->nextShortcutKey;
$link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->next->$id) : inLink('view', "ID={$preAndNext->next->$id}");
$link = $linkTemplate ? sprintf($linkTemplate, $preAndNext->next->$id) : helper::createLink($moduleName, 'view', "ID={$preAndNext->next->$id}");
$link .= '#app=' . $app->openApp;
echo html::a($link, '<i class="icon-pre icon-chevron-right"></i>', '', "id='nextPage' class='btn' title='$title'");
}
echo '</nav>';
@@ -1486,7 +1490,8 @@ EOD;
$id = $object->$key;
$objectList[$id] = $object;
}
$this->session->set($objectIdListKey, array('sql' => $sql, 'objectList' => $objectList));
$this->session->set($objectIdListKey, array('sql' => $sql, 'objectList' => $objectList), $this->app->openApp);
$existsObjectList = $this->session->$objectIdListKey;
}
@@ -1545,8 +1550,8 @@ EOD;
$queryCondition = trim($queryCondition);
if(empty($queryCondition)) $queryCondition = "1=1";
$this->session->set($objectType . 'QueryCondition', $queryCondition);
$this->session->set($objectType . 'OnlyCondition', $onlyCondition);
$this->session->set($objectType . 'QueryCondition', $queryCondition, $this->app->openApp);
$this->session->set($objectType . 'OnlyCondition', $onlyCondition, $this->app->openApp);
/* Set the query condition session. */
$orderBy = explode(' ORDER BY ', $sql);
@@ -1557,8 +1562,8 @@ EOD;
$orderBy = $orderBy[0];
if($onlyCondition) $orderBy = str_replace('t1.', '', $orderBy);
}
$this->session->set($objectType . 'OrderBy', $orderBy);
$this->session->set($objectType . 'BrowseList', array());
$this->session->set($objectType . 'OrderBy', $orderBy, $this->app->openApp);
$this->session->set($objectType . 'BrowseList', array(), $this->app->openApp);
}
/**
+9 -7
View File
@@ -186,9 +186,7 @@ class execution extends control
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('taskList', $uri, 'execution');
$this->app->session->set('storyList', $uri, 'product');
$this->app->session->set('executionList', $uri, 'execution');
$this->app->session->set('taskList', $uri, 'execution');
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->executionTaskOrder ? $this->cookie->executionTaskOrder : 'status,id_desc';
@@ -720,7 +718,7 @@ class execution extends control
}
/* Save session. */
$this->app->session->set('storyList', $this->app->getURI(true), 'product');
$this->app->session->set('storyList', $this->app->getURI(true), 'execution');
/* Process the order by field. */
if(!$orderBy) $orderBy = $this->cookie->executionStoryOrder ? $this->cookie->executionStoryOrder : 'pri';
@@ -803,7 +801,7 @@ class execution extends control
$this->view->orderBy = $orderBy;
$this->view->type = $this->session->executionStoryBrowseType;
$this->view->param = $param;
$this->view->moduleTree = $this->loadModel('tree')->getExecutionStoryTreeMenu($executionID, $startModuleID = 0, array('treeModel', 'createExecutionStoryLink'));
$this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($executionID, $startModuleID = 0, array('treeModel', 'createStoryLink'));
$this->view->tabID = 'story';
$this->view->storyTasks = $storyTasks;
$this->view->storyBugs = $storyBugs;
@@ -851,7 +849,7 @@ class execution extends control
$this->loadModel('user');
/* Save session. */
$this->session->set('bugList', $this->app->getURI(true), 'qa');
$this->session->set('bugList', $this->app->getURI(true), 'execution');
$type = strtolower($type);
$queryID = ($type == 'bysearch') ? (int)$param : 0;
@@ -921,6 +919,7 @@ class execution extends control
$this->loadModel('testcase');
$this->loadModel('testtask');
$this->commonAction($executionID);
$this->session->set('caseList', $this->app->getURI(true), 'execution');
$products = $this->execution->getProducts($executionID);
$productID = key($products); // Get the first product for creating testcase.
@@ -930,6 +929,8 @@ class execution extends control
$pager = pager::init($recTotal, $recPerPage, $pageID);
$cases = $this->loadModel('testcase')->getExecutionCases($executionID, $orderBy, $pager, $type);
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
$cases = $this->testcase->appendData($cases, 'run');
$this->view->title = $this->lang->execution->testcase;
@@ -1020,8 +1021,9 @@ class execution extends control
public function testtask($executionID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->loadModel('testtask');
/* Save session. */
$this->session->set('testtaskList', $this->app->getURI(true), 'qa');
$this->session->set('testtaskList', $this->app->getURI(true), 'execution');
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
+3 -3
View File
@@ -69,9 +69,9 @@
<th class='thWidth'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->execution->owner);?></th>
<th class='w-100px'><?php common::printOrderLink('end', $orderBy, $vars, $lang->execution->end);?></th>
<th class='w-100px'><?php common::printOrderLink('status', $orderBy, $vars, $from == 'execution' ? $lang->execution->execStatus : $lang->execution->status);?></th>
<th class='w-60px text-center'><?php echo $lang->execution->totalEstimate;?></th>
<th class='w-60px text-center'><?php echo $lang->execution->totalConsumed;?></th>
<th class='w-60px text-center'><?php echo $lang->execution->totalLeft;?></th>
<th class='w-80px text-center'><?php echo $lang->execution->totalEstimate;?></th>
<th class='w-80px text-center'><?php echo $lang->execution->totalConsumed;?></th>
<th class='w-80px text-center'><?php echo $lang->execution->totalLeft;?></th>
<th class='w-60px'><?php echo $lang->execution->progress;?></th>
<th class='w-100px'><?php echo $lang->execution->burn;?></th>
</tr>
+3 -2
View File
@@ -77,11 +77,12 @@
<?php
$canBeChanged = common::canBeChanged('bug', $bug);
$arrtibute = $canBeChanged ? '' : 'disabled';
$viewLink = helper::createLink('bug', 'view', "bugID=$bug->id");
?>
<tr>
<td class='cell-id'>
<?php if($canBatchAssignTo):?>
<?php echo html::checkbox('bugIDList', array($bug->id => ''), '', $arrtibute) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?>
<?php echo html::checkbox('bugIDList', array($bug->id => ''), '', $arrtibute) . html::a($viewLink, sprintf('%03d', $bug->id), '', "data-app={$this->app->openApp}");?>
<?php else:?>
<?php printf('%03d', $bug->id);?>
<?php endif;?>
@@ -94,7 +95,7 @@
<?php endif;?>
</td>
<td><span class='label-pri <?php echo 'label-pri-' . $bug->pri?>' title='<?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></span></td>
<td class='text-left' title="<?php echo $bug->title?>"><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title, null, "style='color: $bug->color'");?></td>
<td class='text-left' title="<?php echo $bug->title?>"><?php echo html::a($viewLink, $bug->title, null, "style='color: $bug->color' data-app={$this->app->openApp}");?></td>
<td><?php echo zget($users, $bug->openedBy, $bug->openedBy);?></td>
<td class='c-assignedTo has-btn text-left'><?php $this->bug->printAssignedHtml($bug, $users);?></td>
<td><?php echo zget($users, $bug->resolvedBy, $bug->resolvedBy);?></td>
+2 -2
View File
@@ -74,7 +74,7 @@
<?php
$checkObject = new stdclass();
$checkObject->execution = $executionID;
$link = $this->createLink('task', 'create', "execution=$executionID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : ''));
$link = $this->createLink('task', 'create', "execution=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : ''));
if(common::hasPriv('task', 'create', $checkObject)) echo html::a($link, "<i class='icon icon-plus'></i> {$lang->task->create}", '', "class='btn btn-primary'");
?>
</div>
@@ -85,7 +85,7 @@
<p>
<span class="text-muted"><?php echo $lang->task->noTask;?></span>
<?php if(common::hasPriv('task', 'create', $checkObject)):?>
<?php echo html::a($this->createLink('task', 'create', "execution=$executionID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : '')), "<i class='icon icon-plus'></i> " . $lang->task->create, '', "class='btn btn-info'");?>
<?php echo html::a($this->createLink('task', 'create', "execution=$executionID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : '')), "<i class='icon icon-plus'></i> " . $lang->task->create, '', "class='btn btn-info'");?>
<?php endif;?>
</p>
</div>
+3 -3
View File
@@ -4,7 +4,7 @@
<?php echo html::a(inlink('testcase', "executionID=$executionID&type=$type&orderBy=$orderBy"), "<span class='text'>{$lang->execution->all}</span>", '', "class='btn btn-link btn-active-text'");?>
</div>
<div class="btn-toolbar pull-right">
<?php if(common::canModify('execution', $execution)) echo html::a(helper::createLink('testcase', 'create', "productID=$productID&branch=0&moduleID=0&from=execution&param=$execution->id", '', '', '', true), "<i class='icon icon-plus'></i> " . $lang->testcase->create, '', "class='btn btn-primary' data-app='execution'");?>
<?php if(common::canModify('execution', $execution)) echo html::a(helper::createLink('testcase', 'create', "productID=$productID&branch=0&moduleID=0&from=execution&param=$execution->id", '', '', '', true), "<i class='icon icon-plus'></i> " . $lang->testcase->create, '', "class='btn btn-primary' data-app='{$this->app->openApp}'");?>
</div>
</div>
<div id="mainContent">
@@ -13,7 +13,7 @@
<p>
<span class="text-muted"><?php echo $lang->testcase->noCase;?></span>
<?php if(common::canModify('execution', $execution) and common::hasPriv('testcase', 'create')):?>
<?php echo html::a(helper::createLink('testcase', 'create', "productID=$productID&branch=0&moduleID=0&from=execution&param=$execution->id", '', '', '', true), "<i class='icon icon-plus'></i> " . $lang->testcase->create, '', "class='btn btn-info' data-app='execution'");?>
<?php echo html::a(helper::createLink('testcase', 'create', "productID=$productID&branch=0&moduleID=0&from=execution&param=$execution->id", '', '', '', true), "<i class='icon icon-plus'></i> " . $lang->testcase->create, '', "class='btn btn-info' data-app='{$this->app->openApp}'");?>
<?php endif;?>
</p>
</div>
@@ -49,7 +49,7 @@
<td><span class='label-pri <?php echo 'label-pri-' . $case->pri?>' title='<?php echo zget($lang->testcase->priList, $case->pri, $case->pri);?>'><?php echo zget($lang->testcase->priList, $case->pri, $case->pri)?></span></td>
<?php $params = "testcaseID=$caseID&version=$case->version";?>
<?php if($type == 'assigntome') $params .= "&from=testtask&taskID=$case->task";?>
<td class='text-left'><?php echo html::a($this->createLink('testcase', 'view', $params, '', '', $case->project), $case->title, null, "style='color: $case->color' data-group='project'");?></td>
<td class='text-left'><?php echo html::a($this->createLink('testcase', 'view', $params, '', '', $case->project), $case->title, null, "style='color: $case->color' data-app='{$this->app->openApp}'");?></td>
<td><?php echo zget($lang->testcase->typeList, $case->type);?></td>
<td><?php echo zget($users, $case->openedBy);?></td>
<td><?php echo zget($users, $case->lastRunner);?></td>
+7 -9
View File
@@ -144,8 +144,6 @@ if($config->systemMode == 'new')
{
/* Program. */
$lang->resource->program = new stdclass();
$lang->resource->program->createGuide = 'createGuide';
//$lang->resource->program->index = 'index';
$lang->resource->program->browse = 'browse';
$lang->resource->program->product = 'product';
$lang->resource->program->create = 'create';
@@ -162,8 +160,6 @@ if($config->systemMode == 'new')
$lang->resource->program->batchUnlinkStakeholders = 'batchUnlinkStakeholders';
$lang->resource->program->export = 'export';
$lang->program->methodOrder[0] = 'createGuide';
//$lang->program->methodOrder[5] = 'index';
$lang->program->methodOrder[10] = 'browse';
$lang->program->methodOrder[15] = 'product';
$lang->program->methodOrder[20] = 'create';
@@ -213,6 +209,7 @@ if($config->systemMode == 'new')
$lang->resource->project->bug = 'bug';
$lang->resource->project->testcase = 'testcase';
$lang->resource->project->testtask = 'testtask';
$lang->resource->project->execution = 'execution';
$lang->project->methodOrder[0] = 'index';
$lang->project->methodOrder[5] = 'browse';
@@ -246,6 +243,7 @@ if($config->systemMode == 'new')
$lang->project->methodOrder[145] = 'bug';
$lang->project->methodOrder[150] = 'testcase';
$lang->project->methodOrder[155] = 'testtask';
$lang->project->methodOrder[160] = 'execution';
/* Personnel . */
$lang->resource->personnel = new stdclass();
@@ -517,7 +515,7 @@ $lang->release->methodOrder[70] = 'changeStatus';
/* Execution. */
$lang->resource->execution = new stdclass();
//$lang->resource->execution->index = 'index';
$lang->resource->execution->index = 'index';
$lang->resource->execution->view = 'view';
$lang->resource->execution->browse = 'browse';
$lang->resource->execution->create = 'createExec';
@@ -561,10 +559,10 @@ $lang->resource->execution->printKanban = 'printKanbanAction';
$lang->resource->execution->tree = 'treeAction';
$lang->resource->execution->treeTask = 'treeOnlyTask';
$lang->resource->execution->treeStory = 'treeOnlyStory';
//$lang->resource->execution->all = 'allExecutionAB';
$lang->resource->execution->all = 'allExecutionAB';
$lang->resource->execution->kanbanHideCols = 'kanbanHideCols';
$lang->resource->execution->kanbanColsColor = 'kanbanColsColor';
//$lang->resource->execution->export = 'exportAction';
$lang->resource->execution->export = 'exportAction';
$lang->resource->execution->storyKanban = 'storyKanban';
$lang->resource->execution->storySort = 'storySort';
$lang->resource->execution->whitelist = 'whitelist';
@@ -618,8 +616,8 @@ $lang->execution->methodOrder[205] = 'kanbanColsColor';
$lang->execution->methodOrder[210] = 'tree';
$lang->execution->methodOrder[215] = 'treeTask';
$lang->execution->methodOrder[220] = 'treeStory';
//$lang->execution->methodOrder[225] = 'all';
//$lang->execution->methodOrder[230] = 'export';
$lang->execution->methodOrder[225] = 'all';
$lang->execution->methodOrder[230] = 'export';
$lang->execution->methodOrder[235] = 'storyKanban';
$lang->execution->methodOrder[240] = 'storySort';
$lang->execution->methodOrder[245] = 'whitelist';
+3 -1
View File
@@ -80,7 +80,9 @@ class index extends control
{
$objectType = $this->post->objectType;
$appGroup = zget($this->config->index->appGroup, $objectType, '');
if($objectType == 'testcase') $objectType = 'case';
if($objectType == 'testcase') $objectType = 'case';
if($objectType == 'testreport') $objectType = 'report';
if($objectType == 'productplan') $objectType = 'productPlan';
$this->session->set($objectType . 'List', '', $appGroup);
}
+7
View File
@@ -23,6 +23,13 @@ body.menu-hide {padding-left: 0;}
.menu-hide #menu .nav > li > a {padding: 6px 4px; text-align: center;}
.menu-hide #menu .nav > li > a > .text {display: none;}
.menu-hide #menu .nav > li.has-avatar > a {padding: 2px 0;}
#menuMoreNav {display: none;}
.show-more-nav #menuMoreNav {display: block;}
#menuMoreList {left: 100%; margin-left: -2px; top: -5px; background-color: #3c495c;}
#menuMoreList > li {padding: 2px 6px;}
#menuMoreList > li > a {color: #fff; padding: 4px 6px 4px 12px; border-radius: 2px; margin: 0;}
#menuMoreList > li.divider {opacity: .2; margin: 6px; padding: 0;}
#menu .dropdown-hover:hover > a, #menu .dropdown.open > a {background-color: rgba(0,0,0,.3);}
#moreExecution {display: none; max-height: 520px; min-height: 520px; max-width: 360px; min-width: 150px; position: fixed; bottom: 40px; z-index: 999; background: white; padding: 20px 10px; border: 1px solid #efefef;}
.more-execution-show {left: 96px;}
+57
View File
@@ -416,6 +416,52 @@
appsMap: appsMap
};
/**
* Refresh more menu in #menuNav
* @return {void}
*/
function refreshMoreMenu()
{
var $mainNav = $('#menuMainNav');
var $list = $('#menuMoreList');
var $menuNav = $('#menuNav');
var $menuItems = $mainNav.children('li');
var maxHeight = $menuNav.height();
var showMoreMenu = false;
var currentHeight = 40;
var moreMenuHeight = 13;
$menuItems.each(function()
{
var $item = $(this);
var isDivider = $item.hasClass('divider');
var height = isDivider ? 17 : 40;
currentHeight += height;
if(currentHeight > maxHeight)
{
$item.addClass('hidden');
if(!showMoreMenu)
{
showMoreMenu = true;
$list.empty();
var $prevItem = $item.prev();
if($prevItem.hasClass('divider')) $prevItem.addClass('hidden');
if(isDivider) return;
}
moreMenuHeight += isDivider ? 13 : 31;
$list.append($item.clone().removeClass('hidden'));
}
else
{
$item.removeClass('hidden');
}
});
$list.css('top', moreMenuHeight > 111 ? 111 - moreMenuHeight : '');
$menuNav.toggleClass('show-more-nav', showMoreMenu);
}
/* Init after current page load */
$(function()
{
@@ -468,6 +514,13 @@
options.y = bounding.top;
}
}
var $dropdown = $btn.closest('.dropdown');
if($dropdown.length)
{
$dropdown.addClass('open');
options.onHide = function(){$dropdown.removeClass('open');}
}
$.zui.ContextMenu.show(items, options);
event.preventDefault();
});
@@ -485,6 +538,10 @@
}
if(defaultOpenUrl) openApp(defaultOpenUrl);
else openApp(defaultApp);
/* Refresh more menu on window resize */
$(window).on('resize', refreshMoreMenu);
refreshMoreMenu();
});
}());
+8 -1
View File
@@ -36,6 +36,13 @@ js::set('defaultOpen', $open);
<nav id='menuNav'>
<ul class='nav nav-default' id='menuMainNav'>
</ul>
<ul class='nav nav-default' id='menuMoreNav'>
<li class='divider'></li>
<li class='dropdown dropdown-hover'>
<a title='<?php echo $lang->more; ?>'><i class='icon icon-bars-sign'></i><span class='text'><?php echo $lang->more; ?></span></a>
<ul id='menuMoreList' class='dropdown-menu fade'></ul>
</li>
</ul>
</nav>
<div class="table-col col-right">
<div id="moreExecution" class="more-execution-show" data-ride="searchList">
@@ -79,7 +86,7 @@ js::set('defaultOpen', $open);
</div>
<div id='upgradeContent' class='main-table'>
<div class='main-header' style='padding: 5px 20px 5px 15px;'>
<i class='version-upgrade' id='versionTitle'></i>
<i class='version-upgrade' id='versionTitle'></i>
<h2>
<?php echo $lang->index->upgradeVersion;?>
</h2>
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->my->myExecutions = "My Stage/Sprint/Iteration";
$lang->my->name = 'Name';
$lang->my->code = 'Code';
$lang->my->projects = 'Project';
$lang->my->executions = $lang->executionCommon;
$lang->my->executions = 'Executions';
$lang->my->executionMenu = new stdclass();
$lang->my->executionMenu->undone = 'Undone';
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->my->myExecutions = "My Stage/Sprint/Iteration";
$lang->my->name = 'Name';
$lang->my->code = 'Code';
$lang->my->projects = 'Project';
$lang->my->executions = $lang->executionCommon;
$lang->my->executions = 'Executions';
$lang->my->executionMenu = new stdclass();
$lang->my->executionMenu->undone = 'Undone';
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->my->myExecutions = "My Stage/Sprint/Iteration";
$lang->my->name = 'Name';
$lang->my->code = 'Code';
$lang->my->projects = 'Project';
$lang->my->executions = $lang->executionCommon;
$lang->my->executions = 'Executions';
$lang->my->executionMenu = new stdclass();
$lang->my->executionMenu->undone = 'Undone';
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->my->myExecutions = "My Stage/Sprint/Iteration";
$lang->my->name = 'Name';
$lang->my->code = 'Code';
$lang->my->projects = 'Project';
$lang->my->executions = $lang->executionCommon;
$lang->my->executions = 'Executions';
$lang->my->executionMenu = new stdclass();
$lang->my->executionMenu->undone = 'Undone';
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->my->myExecutions = "我参与的阶段/冲刺/迭代";
$lang->my->name = '名称';
$lang->my->code = '代号';
$lang->my->projects = '所属项目';
$lang->my->executions = '所属' . $lang->executionCommon;
$lang->my->executions = '所属执行';
$lang->my->executionMenu = new stdclass();
$lang->my->executionMenu->undone = '未结束';
+1 -1
View File
@@ -46,7 +46,7 @@ $lang->my->myExecutions = "我參與的階段/衝刺/迭代";
$lang->my->name = '名稱';
$lang->my->code = '代號';
$lang->my->projects = '所屬項目';
$lang->my->executions = '所屬' . $lang->executionCommon;
$lang->my->executions = '所屬執行';
$lang->my->executionMenu = new stdclass();
$lang->my->executionMenu->undone = '未結束';
+19 -32
View File
@@ -122,7 +122,11 @@ class product extends control
$productID = $this->app->openApp != 'project' ? $this->product->saveState($productID, $this->products) : $productID;
if($this->app->openApp == 'product') $this->product->setMenu($productID, $branch);
if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($projectID);
if($this->app->openApp == 'project')
{
$this->session->set('storyList', $this->app->getURI(true), 'project');
$this->loadModel('project')->setMenu($projectID);
}
/* Lower browse type. */
$browseType = strtolower($browseType);
@@ -170,25 +174,20 @@ class product extends control
{
setcookie('treeBranch', (int)$branch, 0, $this->config->webRoot, '', false, false);
$browseType = 'unclosed';
if($this->app->rawModule == 'projectstory' and empty($productID))
{
$moduleTree = $this->tree->getExecutionStoryTreeMenu($this->session->project, 0, array('treeModel', 'createProjectStoryLink'));
}
else
{
$moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', $branch, "&param=$param&storyType=$storyType");
}
}
else
{
if($this->app->rawModule == 'projectstory' and empty($productID))
{
$moduleTree = $this->tree->getExecutionStoryTreeMenu($this->session->project, 0, array('treeModel', 'createProjectStoryLink'));
}
else
{
$moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), '', (int)$this->cookie->treeBranch, "&param=$param&storyType=$storyType");
}
$branch = (int)$this->cookie->treeBranch;
}
/* If in project story and not chose product, get project story mdoules. */
if($this->app->rawModule == 'projectstory' and empty($productID))
{
$moduleTree = $this->tree->getProjectStoryTreeMenu($projectID, 0, array('treeModel', $createModuleLink));
}
else
{
$moduleTree = $this->tree->getTreeMenu($productID, 'story', $startModuleID = 0, array('treeModel', $createModuleLink), array('projectID' => $projectID, 'productID' => $productID), $branch, "&param=$param&storyType=$storyType");
}
if($browseType != 'bymodule' and $browseType != 'bybranch') $this->session->set('storyBrowseType', $browseType);
@@ -211,12 +210,12 @@ class product extends control
if($this->app->rawModule == 'projectstory')
{
if(!empty($product)) $this->session->set('currentProductType', $product->type);
$this->products = $this->loadModel('project')->getProducts($this->session->project, false);
$projectProducts = $this->product->getProducts($this->session->project);
$this->products = $this->loadModel('project')->getProducts($projectID, false);
$projectProducts = $this->product->getProducts($projectID);
$productPlans = $this->execution->getPlans($projectProducts);
if($browseType == 'bybranch') $param = $branch;
$stories = $this->story->getExecutionStories($this->session->project, $productID, $branch, $sort, $browseType, $param, 'story', '', $pager);
$stories = $this->story->getExecutionStories($projectID, $productID, $branch, $sort, $browseType, $param, 'story', '', $pager);
}
else
{
@@ -1172,18 +1171,6 @@ class product extends control
$this->display();
}
/**
* Doc for compatible.
*
* @param int $productID
* @access public
* @return void
*/
public function doc($productID)
{
$this->locate($this->createLink('doc', 'objectLibs', "type=product&objectID=$productID&from=product"));
}
/**
* Build of product.
*
+1
View File
@@ -448,6 +448,7 @@ class productModel extends model
if(isset($currentProduct->type) && $currentProduct->type != 'normal')
{
$this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$currentProduct->type]);
$branches = $this->loadModel('branch')->getPairs($productID);
$branch = empty($branch) ? (int)$this->cookie->preBranch : $branch;
$branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0];
+3 -2
View File
@@ -142,7 +142,8 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
<?php if(common::canModify('product', $product)):?>
<div class='btn-group dropdown'>
<?php $buttonType = $from == 'project' ? 'btn-secondary' : 'btn-primary';?>
<?php echo html::a($this->createLink('story', 'create', "product=$productID&branch=$branch&moduleID=$moduleID&storyID=0&projectID=$projectID"), "<i class='icon icon-plus'></i> {$lang->story->create}", '', "class='btn $buttonType' data-app='$openApp'");?>
<?php $extraParam = $from == 'project' ? '' : "&bugID=0&planID=0&todoID=0&extra=&type=$storyType";?>
<?php echo html::a($this->createLink('story', 'create', "product=$productID&branch=$branch&moduleID=$moduleID&storyID=0&projectID=0$extraParam"), "<i class='icon icon-plus'></i> {$lang->story->create}", '', "class='btn $buttonType' data-app='$openApp'");?>
<button type='button' class="btn <?php echo $buttonType?> dropdown-toggle" data-toggle='dropdown'><span class='caret'></span></button>
<ul class='dropdown-menu pull-right'>
<li>
@@ -320,7 +321,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
<ul class='dropdown-menu'>
<?php
$class = $canBatchClose ? '' : "class='disabled'";
$actionLink = $this->createLink('story', 'batchClose', "productID=$productID&projectID=0");
$actionLink = $this->createLink('story', 'batchClose', "productID=$productID&projectID=0&storyType=$storyType");
$misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink')\"" : '';
echo "<li $class>" . html::a('#', $lang->close, '', $misc) . "</li>";
-15
View File
@@ -18,21 +18,6 @@ class program extends control
$this->loadModel('execution');
}
/**
* Program create guide.
*
* @param int $programID
* @param string $from
* @access public
* @return void
*/
public function createGuide($programID = 0, $from = 'PRJ')
{
$this->view->from = $from;
$this->view->programID = $programID;
$this->display();
}
/**
* Program list.
*
+3 -6
View File
@@ -1,5 +1,5 @@
<?php $canOrder = (common::hasPriv('program', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<form class='main-table' id='programForm' method='post' data-ride='table' data-nested='true' data-expand-nest-child='false' data-checkable='false'>
<form class='main-table' id='programForm' method='post' data-ride='table' data-nested='true' data-expand-nest-child='false' data-checkable='false' data-enable-empty-nested-row='true'>
<table class='table has-sort-head table-fixed table-nested' id='programList'>
<?php $vars = "status=$status&orderBy=%s";?>
<thead>
@@ -121,8 +121,8 @@
#programTableList.sortable-sorting > tr.drag-row {opacity: 1;}
#programTableList > tr.drop-not-allowed {opacity: 0.1!important}
#programList .c-actions {overflow: visible;}
#programList > thead > tr > th .table-nest-toggle-global {top:5px}
#programList > thead > tr > th .table-nest-toggle-global:before {color: #abafbc;}
#programList > thead > tr > th .table-nest-toggle-global {top: 6px}
#programList > thead > tr > th .table-nest-toggle-global:before {color: #a6aab8;}
#programTableList > tr:last-child .c-actions .dropdown-menu {top: auto; bottom: 100%; margin-bottom: -5px;}
#programTableList .icon-project:before {content: '\e99c'; width: 22px; height: 22px; background: none; color: #16a8f8; top: 0; line-height: 22px; margin-right: 2px; font-size: 14px}
</style>
@@ -130,9 +130,6 @@
<script>
$(function()
{
$('.is-nest-child span.icon-program,.no-nest span.icon-program').addClass('table-nest-toggle');
$('.is-nest-child span.icon-program,.no-nest span.icon-program').removeClass('table-nest-icon');
/* Init orders numbers list */
var ordersList = [];
for(var i = 0; i < originOrders.length; ++i) ordersList.push(parseInt(originOrders[i]));
-2
View File
@@ -1356,8 +1356,6 @@ class project extends control
*/
public function whitelist($projectID = 0, $module = 'project', $from = 'project', $objectType = 'project', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
if($from == 'project') $this->project->setMenu($projectID);
echo $this->fetch('personnel', 'whitelist', "objectID=$projectID&module=$module&browseType=$objectType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID&from=$from");
}
+1
View File
@@ -29,6 +29,7 @@ $lang->project->manageGroupMember = 'Manage Group';
$lang->project->moduleSetting = 'List Settings';
$lang->project->moduleOpen = 'Program Name';
$lang->project->dynamic = 'Dynamic';
$lang->project->execution = 'Execution';
$lang->project->qa = 'QA';
$lang->project->bug = 'Bug List';
$lang->project->testcase = 'Case List';
+1
View File
@@ -29,6 +29,7 @@ $lang->project->manageGroupMember = 'Manage Group';
$lang->project->moduleSetting = 'List Settings';
$lang->project->moduleOpen = 'Program Name';
$lang->project->dynamic = 'Dynamic';
$lang->project->execution = 'Execution';
$lang->project->qa = 'QA';
$lang->project->bug = 'Bug List';
$lang->project->testcase = 'Case List';
+1
View File
@@ -29,6 +29,7 @@ $lang->project->manageGroupMember = 'Manage Group';
$lang->project->moduleSetting = 'List Settings';
$lang->project->moduleOpen = 'Program Name';
$lang->project->dynamic = 'Dynamic';
$lang->project->execution = 'Execution';
$lang->project->qa = 'QA';
$lang->project->bug = 'Bug List';
$lang->project->testcase = 'Case List';
+1
View File
@@ -29,6 +29,7 @@ $lang->project->manageGroupMember = 'Manage Group';
$lang->project->moduleSetting = 'List Settings';
$lang->project->moduleOpen = 'Program Name';
$lang->project->dynamic = 'Dynamic';
$lang->project->execution = 'Execution';
$lang->project->qa = 'QA';
$lang->project->bug = 'Bug List';
$lang->project->testcase = 'Case List';
+1
View File
@@ -29,6 +29,7 @@ $lang->project->manageGroupMember = '维护分组用户';
$lang->project->moduleSetting = '列表设置';
$lang->project->moduleOpen = '显示项目集名';
$lang->project->dynamic = '动态';
$lang->project->execution = '执行列表';
$lang->project->qa = '测试仪表盘';
$lang->project->bug = 'Bug列表';
$lang->project->testcase = '用例列表';
+8 -8
View File
@@ -514,9 +514,9 @@ class projectModel extends model
public function getProducts($projectID, $withBranch = true)
{
$query = $this->dao->select('t2.id, t2.name, t2.type, t1.branch, t1.plan')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')
->on('t1.product = t2.id')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.project')->eq((int)$projectID)
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
->andWhere('t2.deleted')->eq(0);
if(!$withBranch) return $query->fetchPairs('id', 'name');
return $query->fetchAll('id');
@@ -1608,19 +1608,19 @@ class projectModel extends model
$projectSubMenu = $this->lang->project->menu->{$key}['dropMenu'];
$dropMenu = common::createDropMenu($this->lang->project->menu->{$key}['dropMenu'], $objectID);
if(!empty($dropMenu))
{
{
foreach($dropMenu as $menuKey => $menu)
{
$itemMenu = zget($projectSubMenu, $menuKey, '');
{
$itemMenu = zget($projectSubMenu, $menuKey, '');
$isActive['method'] = ($moduleName == strtolower($menu->link['module']) and $methodName == strtolower($menu->link['method']));
$isActive['alias'] = ($moduleName == strtolower($menu->link['module']) and (is_array($itemMenu) and isset($itemMenu['alias']) and strpos($itemMenu['alias'], $methodName) !== false));
$isActive['subModule'] = (is_array($itemMenu) and isset($itemMenu['subModule']) and strpos($itemMenu['subModule'], $moduleName) !== false);
if($isActive['method'] or $isActive['alias'] or $isActive['subModule'])
{
{
$this->lang->project->menu->{$key}['link'] = $menu->text . "|" . join('|', $menu->link);
break;
}
}
}
}
$this->lang->project->menu->{$key}['dropMenu'] = $dropMenu;
}
}
+3 -2
View File
@@ -77,11 +77,12 @@
<?php
$canBeChanged = common::canBeChanged('bug', $bug);
$arrtibute = $canBeChanged ? '' : 'disabled';
$viewLink = helper::createLink('bug', 'view', "bugID=$bug->id");
?>
<tr>
<td class='cell-id'>
<?php if($canBatchAssignTo):?>
<?php echo html::checkbox('bugIDList', array($bug->id => ''), '', $arrtibute) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id));?>
<?php echo html::checkbox('bugIDList', array($bug->id => ''), '', $arrtibute) . html::a($viewLink, sprintf('%03d', $bug->id), '', "data-app={$this->app->openApp}");?>
<?php else:?>
<?php printf('%03d', $bug->id);?>
<?php endif;?>
@@ -94,7 +95,7 @@
<?php endif;?>
</td>
<td><span class='label-pri <?php echo 'label-pri-' . $bug->pri?>' title='<?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri)?></span></td>
<td class='text-left' title="<?php echo $bug->title?>"><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title, null, "style='color: $bug->color'");?></td>
<td class='text-left' title="<?php echo $bug->title?>"><?php echo html::a($viewLink, $bug->title, null, "style='color: $bug->color' data-app={$this->app->openApp}");?></td>
<td><?php echo zget($users, $bug->openedBy, $bug->openedBy);?></td>
<td class='c-assignedTo has-btn text-left'><?php $this->bug->printAssignedHtml($bug, $users);?></td>
<td><?php echo zget($users, $bug->resolvedBy, $bug->resolvedBy);?></td>
+2 -2
View File
@@ -30,7 +30,7 @@
<div class="btn-toolbar pull-right">
<?php if(common::canModify('project', $project)):?>
<?php common::printIcon('testreport', 'browse', "objectID=$projectID&objectType=project", '', 'button','flag muted');?>
<?php common::printLink('testtask', 'create', "product=0&projectID=$projectID&build=&projectID=$project->project", "<i class='icon icon-plus'></i> " . $lang->testtask->create, '', "class='btn btn-primary'");?>
<?php common::printLink('testtask', 'create', "product=0&executionID=0&build=0&projectID=$projectID", "<i class='icon icon-plus'></i> " . $lang->testtask->create, '', "class='btn btn-primary'");?>
<?php endif;?>
</div>
</div>
@@ -40,7 +40,7 @@
<p>
<span class="text-muted"><?php echo $lang->testtask->noTesttask;?></span>
<?php if(common::canModify('project', $project) and common::hasPriv('testtask', 'create')):?>
<?php echo html::a($this->createLink('testtask', 'create', "product=0&project=$projectID"), "<i class='icon icon-plus'></i> " . $lang->testtask->create, '', "class='btn btn-info'");?>
<?php echo html::a($this->createLink('testtask', 'create', "product=0&executionID=0&build=0&projectID=$projectID"), "<i class='icon icon-plus'></i> " . $lang->testtask->create, '', "class='btn btn-info'");?>
<?php endif;?>
</p>
</div>
-2
View File
@@ -45,8 +45,6 @@ class projectStory extends control
*/
public function story($projectID = 0, $productID = 0, $branch = 0, $browseType = '', $param = 0, $storyType = 'story', $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->session->set('storyList', $this->app->getURI(true), 'project');
echo $this->fetch('product', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&storyType=$storyType&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
}
+54 -2
View File
@@ -61,6 +61,8 @@ class repo extends control
$this->repo->setMenu($this->repos, $repoID);
}
$this->lang->modulePageNav = $this->repo->select($this->repos, $repoID, $this->app->openApp, $objectID);
if(empty($this->repos) and $this->methodName != 'create') die(js::locate($this->repo->createLink('create', "objectID=$objectID")));
}
@@ -120,7 +122,8 @@ class repo extends control
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
}
$this->commonAction(0, $objectID);
$repoID = $this->repo->saveState(0, $objectID);
$this->commonAction($repoID, $objectID);
$this->app->loadLang('action');
$this->repo->setMenu($this->repos, '', false);
@@ -324,6 +327,9 @@ class repo extends control
*/
public function browse($repoID = 0, $objectID = 0, $path = '', $revision = 'HEAD', $refresh = 0)
{
if($this->get->repoPath) $path = $this->get->repoPath;
$repoID = $this->repo->saveState($repoID, $objectID);
$this->commonAction($repoID, $objectID);
if(empty($refresh) and $this->cookie->repoRefresh) $refresh = $this->cookie->repoRefresh;
@@ -331,7 +337,6 @@ class repo extends control
/* Set menu and session. */
$this->repo->setMenu($this->repos, $repoID);
$this->repo->setBackSession('list', $withOtherModule = true);
if($repoID == 0) $repoID = $this->session->repoID;
/* Get repo and synchronous commit. */
$repo = $this->repo->getRepoByID($repoID);
@@ -1032,4 +1037,51 @@ class repo extends control
}
die(json_encode($dirs));
}
/**
* Ajax get drop menu.
*
* @param int $repoID
* @param string $type
* @param int $objectID
* @access public
* @return void
*/
public function ajaxGetDropMenu($repoID, $type = 'repo', $objectID = 0)
{
$repos = $this->repo->getRepoPairs($type, $objectID);
$reposHtml = "<div class='table-row'><div class='table-col col-left'><div class='list-group' style='margin-bottom: 0;'>";
foreach($repos as $id => $repoName)
{
$selected = $id == $repoID ? 'selected' : '';
$reposHtml .= html::a($this->createLink('repo', 'browse', "repoID=$id"), $repoName, '', "class='$selected'");
}
$reposHtml .= '</div></div></div>';
die($reposHtml);
}
/**
* Ajax get branch drop menu.
*
* @param int $repoID
* @param int $branchID
* @access public
* @return void
*/
public function ajaxGetBranchDropMenu($repoID, $branchID)
{
$repo = $this->repo->getRepoByID($repoID);
$branches = $this->repo->getBranches($repo);
$branchesHtml = "<div class='table-row'><div class='table-col col-left'><div class='list-group' style='margin-bottom: 0;'>";
foreach($branches as $id => $branchName)
{
$selected = $id == $branchID ? 'selected' : '';
$branchesHtml .= html::a($this->createLink('repo', 'browse', "repoID=$repoID&branchID=$branchID"), $branchName, '', "class='$selected'");
}
$branchesHtml .= '</div></div></div>';
die($branchesHtml);
}
}
+67 -15
View File
@@ -56,6 +56,7 @@ class repoModel extends model
}
}
/*
if($showSeleter && !empty($repos))
{
$repoIndex = '<div class="btn-group header-btn" id="swapper"><div class="btn-group"><button data-toggle="dropdown" type="button" class="btn">' . ($repo->SCM == 'Subversion' ? '[SVN] ' : '[GIT] ') . $repo->name . ' <span class="caret"></span></button>';
@@ -93,6 +94,7 @@ class repoModel extends model
$this->lang->switcherMenu = $repoIndex;
}
*/
common::setMenuVars('devops', $repoID);
@@ -106,27 +108,51 @@ class repoModel extends model
*
* @param array $repos
* @param int $repoID
* @param string $currentModule
* @param string $currentMethod
* @param string $type
* @param int $objectID
* @access public
* @return string
*/
public function select($repos, $repoID)
public function select($repos, $repoID, $type = 'repo', $objectID = 0)
{
$selectHtml = "<div class='dropdown-menu search-list' data-ride='searchList'>";
$selectHtml .= "<div class='input-control search-box has-icon-left has-icon-right search-example'>";
$selectHtml .= "<input id='repoSearchBox' type='search' autocomplete='off' class='form-control search-input empty'>";
$selectHtml .= "<label for='repoSearchBox' class='input-control-icon-left search-icon'><i class='icon icon-search'></i></label>";
$selectHtml .= "<a class='input-control-icon-right search-clear-btn'><i class='icon icon-close icon-sm'></i></a></div>";
$selectHtml .= "<div class='list-group'>";
foreach($repos as $id => $name)
$output = '';
if(!empty($repos))
{
$class = $repoID == $id ? "class='active'" : '';
$selectHtml .= html::a(helper::createLink('repo', 'browse', "repoID={$id}"), $name, '', $class);
}
$selectHtml .= "</div></div>";
$dropMenuLink = helper::createLink('repo', 'ajaxGetDropMenu', "repoID=$repoID&type=$type&objectID=$objectID");
return $selectHtml;
$repo = $this->dao->findById($repoID)->from(TABLE_REPO)->fetch();
$scm = $repo->SCM == 'Subversion' ? 'svn' : 'git';
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$repo->name}'><span class='text'>[$scm] {$repo->name}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "</div></div>";
$branches = $this->getBranches($repo);
if(empty($branches))
{
$this->setRepoBranch('');
}
else
{
$branchID = 'master';
if($this->cookie->repoBranch) $branchID = $this->cookie->repoBranch;
if(!isset($branches[$branchID])) $branchID = 'master';
$branch = zget($branches, $branchID);
if(empty($branch)) $branchID = $branch = current($branches);
$this->setRepoBranch($branchID);
$branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0];
$dropMenuLink = helper::createLink('repo', 'ajaxGetBranchDropMenu', "repID=$repoID&branchID=$branchID");
$output .= "<div class='btn-group'><button id='currentBranch' data-toggle='dropdown' type='button' class='btn btn-limit'>{$branchName} <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "</div></div>";
}
}
return $output;
}
/**
@@ -290,6 +316,32 @@ class repoModel extends model
return true;
}
/**
* Save repo state.
*
* @param int $repoID
* @param int $objectID
* @access public
* @return int
*/
public function saveState($repoID = 0, $objectID = 0)
{
if($repoID > 0) $this->session->set('repoID', (int)$repoID);
$repos = $this->getRepoPairs($this->app->openApp, $objectID);
if($repoID == 0 and $this->session->repoID == '')
{
$this->session->set('repoID', key($repos));
}
if(!isset($repos[$this->session->repoID]))
{
$this->session->set('repoID', key($repos));
}
return $this->session->repoID;
}
/**
* Get repo pairs.
*
+7 -6
View File
@@ -1077,7 +1077,7 @@ class story extends control
* @access public
* @return void
*/
public function batchClose($productID = 0, $execution = 0)
public function batchClose($productID = 0, $execution = 0, $storyType = 'story')
{
if($this->post->comments)
{
@@ -1124,7 +1124,7 @@ class story extends control
/* The stories of a product. */
if($productID)
{
$this->product->setMenu($this->product->getPairs('nodeleted'), $productID);
$this->product->setMenu($productID);
$product = $this->product->getByID($productID);
$this->view->position[] = html::a($this->createLink('product', 'browse', "product=$product->id"), $product->name);
$this->view->title = $product->name . $this->lang->colon . $this->lang->story->batchClose;
@@ -1134,7 +1134,7 @@ class story extends control
{
$this->lang->story->menu = $this->lang->execution->menu;
$this->lang->story->menuOrder = $this->lang->execution->menuOrder;
$this->execution->setMenu($this->execution->getPairs($this->session->project, 'all', 'nodeleted'), $executionID);
$this->execution->setMenu($executionID);
$execution = $this->execution->getByID($executionID);
$this->view->position[] = html::a($this->createLink('execution', 'story', "executionID=$execution->id"), $execution->name);
$this->view->title = $execution->name . $this->lang->colon . $this->lang->story->batchClose;
@@ -1163,6 +1163,7 @@ class story extends control
$this->view->productID = $productID;
$this->view->stories = $stories;
$this->view->storyIdList = $storyIdList;
$this->view->storyType = $storyType;
$this->view->reasonList = $this->lang->story->reasonList;
$this->display();
@@ -1318,7 +1319,7 @@ class story extends control
$products = $this->product->getPairs();
/* Set menu. */
$this->product->setMenu($products, $story->product, $story->branch);
$this->product->setMenu($story->product, $story->branch);
$this->view->title = zget($products, $story->product, '') . $this->lang->colon . $this->lang->story->assign;
$this->view->position[] = $this->lang->story->assign;
@@ -1473,7 +1474,7 @@ class story extends control
else
{
$this->app->rawModule = 'testcase';
$this->loadModel('qa')->setMenu($products, $productID);
$this->loadModel('qa')->setMenu($productID);
foreach($this->config->qa->menuList as $module) $this->lang->navGroup->$module = 'qa';
}
@@ -1758,7 +1759,7 @@ class story extends control
$this->story->replaceURLang($storyType);
$this->products = $this->product->getPairs();
$this->lang->product->switcherMenu = $this->product->getSwitcher($productID, $storyType, $branchID);
$this->product->setMenu($this->products, $productID, $branchID);
$this->product->setMenu($productID, $branchID);
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->story->reportChart;
$this->view->position[] = $this->products[$productID];
+1
View File
@@ -11,6 +11,7 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('storyType', $storyType);?>
<div class='main-content' id='mainContent'>
<div class='main-header'>
<h2><?php echo $lang->story->common . $lang->colon . $lang->story->batchClose;?></h2>
+20 -3
View File
@@ -599,7 +599,9 @@ class testcase extends control
else
{
$productID = $case->product;
$this->app->openApp == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->testcase->setMenu($this->products, $productID, $case->branch);
if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($this->session->project);
if($this->app->openApp == 'execution') $this->loadModel('execution')->setMenu($case->execution);
if($this->app->openApp == 'qa') $this->testcase->setMenu($this->products, $productID, $case->branch);
$this->view->title = "CASE #$case->id $case->title - " . $this->products[$productID];
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
@@ -1630,7 +1632,15 @@ class testcase extends control
if($this->post->isEndPage)
{
unlink($tmpFile);
die(js::locate(inlink('browse', "productID=$productID"), 'parent'));
if($this->app->openApp == 'project')
{
die(js::locate($this->createLink('project', 'testcase', "projectID={$this->session->project}&productID=$productID"), 'parent'));
}
else
{
die(js::locate(inlink('browse', "productID=$productID"), 'parent'));
}
}
else
{
@@ -1638,7 +1648,14 @@ class testcase extends control
}
}
$this->testcase->setMenu($this->products, $productID, $branch);
if($this->app->openApp == 'project')
{
$this->loadModel('project')->setMenu($this->session->project);
}
else
{
$this->testcase->setMenu($this->products, $productID, $branch);
}
$caseLang = $this->lang->testcase;
$caseConfig = $this->config->testcase;
+1 -1
View File
@@ -509,7 +509,7 @@ class testcaseModel extends model
->where($caseQuery)
->beginIF($this->app->openApp == 'project')->andWhere('t2.project')->eq($this->session->project)->fi()
->beginIF(!empty($productID) and $queryProductID != 'all')
->beginIF($this->app->openApp == 'project')->andWhere('t2.product')->eq($productID)->fi()
->beginIF($this->app->openApp == 'project' and !empty($productID))->andWhere('t2.product')->eq($productID)->fi()
->beginIF($this->app->openApp != 'project')->andWhere('product')->eq($productID)->fi()
->fi()
->beginIF($auto != 'unit')->andWhere('auto')->ne('unit')->fi()
+2 -1
View File
@@ -26,7 +26,8 @@ js::set('suiteID', $suiteID);
?>
<?php if($this->app->openApp == 'project'): ?>
<style>
#subHeader #dropMenu .col-left .list-group {margin-bottom: 0px;}
#subHeader #dropMenu .col-left .list-group {margin-bottom: 0px; padding-top: 10px;}
#subHeader #dropMenu .col-left {padding-bottom: 0px;}
</style>
<?php endif;?>
<div id="mainContent" class="main-row fade">
+8 -4
View File
@@ -106,6 +106,7 @@
?>
</div>
<div class='btn-toolbar pull-right'>
<?php if(!empty($productID)): ?>
<div class='btn-group'>
<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown'>
<i class='icon icon-export muted'></i> <?php echo $lang->export ?>
@@ -116,16 +117,18 @@
$class = common::hasPriv('testcase', 'export') ? '' : "class=disabled";
$misc = common::hasPriv('testcase', 'export') ? "class='export'" : "class=disabled";
$link = common::hasPriv('testcase', 'export') ? $this->createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy&taskID=0&browseType=$browseType") : '#';
echo "<li $class>" . html::a($link, $lang->testcase->export, '', $misc) . "</li>";
echo "<li $class>" . html::a($link, $lang->testcase->export, '', $misc . "data-app={$this->app->openApp}") . "</li>";
$class = common::hasPriv('testcase', 'exportTemplet') ? '' : "class=disabled";
$misc = common::hasPriv('testcase', 'exportTemplet') ? "class='export'" : "class=disabled";
$link = common::hasPriv('testcase', 'exportTemplet') ? $this->createLink('testcase', 'exportTemplet', "productID=$productID") : '#';
echo "<li $class>" . html::a($link, $lang->testcase->exportTemplet, '', $misc) . "</li>";
echo "<li $class>" . html::a($link, $lang->testcase->exportTemplet, '', $misc . "data-app={$this->app->openApp}") . "</li>";
?>
</ul>
</div>
<?php endif;?>
<?php if(common::canModify('product', $product)):?>
<?php if(!empty($productID)): ?>
<div class='btn-group'>
<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown' id='importAction'><i class='icon icon-import muted'></i> <?php echo $lang->import ?><span class='caret'></span></button>
<ul class='dropdown-menu' id='importActionMenu'>
@@ -133,15 +136,16 @@
$class = common::hasPriv('testcase', 'import') ? '' : "class=disabled";
$misc = common::hasPriv('testcase', 'import') ? "class='export'" : "class=disabled";
$link = common::hasPriv('testcase', 'import') ? $this->createLink('testcase', 'import', "productID=$productID&branch=$branch") : '#';
echo "<li $class>" . html::a($link, $lang->testcase->fileImport, '', $misc) . "</li>";
echo "<li $class>" . html::a($link, $lang->testcase->fileImport, '', $misc . "data-app={$this->app->openApp}") . "</li>";
$class = common::hasPriv('testcase', 'importFromLib') ? '' : "class=disabled";
$misc = common::hasPriv('testcase', 'importFromLib') ? "data-app='{$this->app->openApp}'" : "class=disabled";
$link = common::hasPriv('testcase', 'importFromLib') ? $this->createLink('testcase', 'importFromLib', "productID=$productID&branch=$branch") : '#';
echo "<li $class>" . html::a($link, $lang->testcase->importFromLib, '', $misc) . "</li>";
echo "<li $class>" . html::a($link, $lang->testcase->importFromLib, '', $misc . "data-app={$this->app->openApp}") . "</li>";
?>
</ul>
</div>
<?php endif;?>
<?php $initModule = isset($moduleID) ? (int)$moduleID : 0;?>
<?php if(!common::checkNotCN()):?>
<?php if(common::hasPriv('testcase', 'batchCreate') or common::hasPriv('testcase', 'create')):?>
+1 -1
View File
@@ -44,7 +44,6 @@
</tr>
</thead>
<tbody>
<?php $modules['ditto'] = $lang->testcase->ditto;?>
<?php $i = 0;?>
<?php foreach($cases as $case):?>
<tr>
@@ -63,6 +62,7 @@
<?php $libModule = zget($libModules, $case->module, '');?>
<td class='text-left' title='<?php echo $libModule?>'><?php echo $libModule;?></td>
<td class='text-left' data-module='<?php echo $case->module?>' style='overflow:visible'>
<?php if($i > 0) $modules['ditto'] = $lang->testcase->ditto;?>
<?php echo html::select("module[{$case->id}]", $modules, $i == 0 ? 0 : 'ditto', "class='form-control chosen'");?>
</td>
<td><?php echo zget($lang->testcase->typeList, $case->type);?></td>
+18 -4
View File
@@ -403,7 +403,14 @@ class testtask extends control
if(!$task) die(js::error($this->lang->testtask->checkLinked) . js::locate('back'));
$productID = $task->product;
$this->loadModel('qa')->setMenu($this->products, $productID, $task->branch, $taskID);
if($this->app->openApp == 'project')
{
$this->loadModel('project')->setMenu($this->session->project);
}
else
{
$this->loadModel('qa')->setMenu($this->products, $productID, $task->branch, $taskID);
}
setcookie('preTaskID', $taskID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
/* Determines whether an object is editable. */
@@ -890,7 +897,14 @@ class testtask extends control
$productID = $this->product->saveState($task->product, $this->products);
/* Save session. */
$this->loadModel('qa')->setMenu($this->products, $productID, $task->branch, $taskID);
if($this->app->openApp == 'project')
{
$this->loadModel('project')->setMenu($this->session->project);
}
else
{
$this->loadModel('qa')->setMenu($this->products, $productID, $task->branch, $taskID);
}
/* Load pager. */
$this->app->loadClass('pager', $static = true);
@@ -1096,7 +1110,7 @@ class testtask extends control
$caseIDList = array_unique($caseIDList);
/* The case of tasks of qa. */
if($productID)
if($productID or ($this->app->openApp == 'project' and empty($productID)))
{
$this->app->openApp == 'project' ? $this->loadModel('project')->setMenu($this->session->project) : $this->loadModel('qa')->setMenu($this->products, $productID, $taskID);
$this->view->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'case');
@@ -1121,7 +1135,7 @@ class testtask extends control
$cases = $this->dao->select('t1.*,t2.id as runID')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.id = t2.case')
->where('t2.id')->in($caseIDList)
->fetchAll('runID');
->fetchAll('id');
$caseIDList = array();
foreach($cases as $case) $caseIDList[] = $case->id;
-5
View File
@@ -10,8 +10,3 @@ $(document).on('keyup', 'form input:text', function()
$(preSelect).val('fail');
}
})
$(function()
{
$('#subNavbar li[data-id="testcase"]').addClass('active');
})
+16 -23
View File
@@ -785,7 +785,7 @@ class treeModel extends model
}
/**
* Get execution story tree menu.
* Get project story tree menu.
*
* @param int $rootID
* @param int $startModule
@@ -793,9 +793,9 @@ class treeModel extends model
* @access public
* @return string
*/
public function getExecutionStoryTreeMenu($rootID, $startModule = 0, $userFunc)
public function getProjectStoryTreeMenu($rootID, $startModule = 0, $userFunc)
{
$extra['executionID'] = $rootID;
$extra['projectID'] = $rootID;
$menu = "<ul id='modules' class='tree' data-ride='tree' data-name='tree-story'>";
$startModulePath = '';
if($startModule > 0)
@@ -817,7 +817,6 @@ class treeModel extends model
$productNum = count($products);
foreach($products as $id => $product)
{
$extra['productID'] = $id;
$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;
@@ -1013,12 +1012,22 @@ class treeModel extends model
*
* @param string $type
* @param object $module
* @param array $extra
* @access public
* @return string
*/
public function createStoryLink($type, $module)
public function createStoryLink($type, $module, $extra = array())
{
return html::a(helper::createLink($this->app->rawModule, $this->app->rawMethod, "root={$module->root}&branch=&type=byModule&param={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
if(isset($extra['projectID']))
{
$productID = zget($extra , 'productID', 0);
$projectID = $extra['projectID'];
return html::a(helper::createLink('projectstory', 'story', "projectID=$projectID&productID=$productID&branch=&browseType=byModule&param={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
}
else
{
return html::a(helper::createLink('product', 'browse', "root={$module->root}&branch=&type=byModule&param={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
}
}
/**
@@ -1065,23 +1074,7 @@ class treeModel extends model
public function createProjectStoryLink($type, $module, $extra)
{
$productID = $extra['productID'];
return html::a(helper::createLink('projectstory', 'story', "projectID={$extra['executionID']}productID=$productID&branch=&browseType=byModule&param={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
}
/**
* Create link of execution story.
*
* @param string $type
* @param object $module
* @param array $extra
* @access public
* @return string
*/
public function createExecutionStoryLink($type, $module, $extra)
{
$executionID = $extra['executionID'];
$productID = $extra['productID'];
return html::a(helper::createLink('execution', 'story', "executionID={$executionID}&orderBy=&type=byModule&param={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
return html::a(helper::createLink('projectstory', 'story', "projectID={$extra['executionID']}&productID=$productID&branch=&browseType=byModule&param={$module->id}"), $module->name, '_self', "id='module{$module->id}'");
}
/**
+3 -3
View File
File diff suppressed because one or more lines are too long