resolve conflict
This commit is contained in:
@@ -322,7 +322,7 @@ $lang->block->default['full']['my']['10']['title'] = 'Project List';
|
||||
$lang->block->default['full']['my']['10']['block'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['source'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['grid'] = 8;
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noExecution')
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noSprint')
|
||||
{
|
||||
$lang->block->default['full']['my']['10']['block'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['source'] = 'project';
|
||||
@@ -355,7 +355,7 @@ $lang->block->availableBlocks->feedback = 'My Feedbacks';
|
||||
|
||||
$lang->block->moduleList['product'] = $lang->productCommon;
|
||||
$lang->block->moduleList['project'] = 'Project';
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noExecution') $lang->block->moduleList['execution'] = $lang->execution->common;
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noSprint') $lang->block->moduleList['execution'] = $lang->execution->common;
|
||||
$lang->block->moduleList['qa'] = 'QA';
|
||||
$lang->block->moduleList['todo'] = 'Todos';
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ $lang->block->default['full']['my']['10']['title'] = 'Project List';
|
||||
$lang->block->default['full']['my']['10']['block'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['source'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['grid'] = 8;
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noExecution')
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noSprint')
|
||||
{
|
||||
$lang->block->default['full']['my']['10']['block'] = 'execution';
|
||||
$lang->block->default['full']['my']['10']['source'] = 'execution';
|
||||
@@ -355,7 +355,7 @@ $lang->block->availableBlocks->feedback = 'My Feedbacks';
|
||||
|
||||
$lang->block->moduleList['product'] = $lang->productCommon;
|
||||
$lang->block->moduleList['project'] = 'Project';
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noExecution') $lang->block->moduleList['execution'] = $lang->execution->common;
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noSprint') $lang->block->moduleList['execution'] = $lang->execution->common;
|
||||
$lang->block->moduleList['qa'] = 'Test';
|
||||
$lang->block->moduleList['todo'] = 'Todo';
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ $lang->block->default['full']['my']['10']['title'] = 'Project List';
|
||||
$lang->block->default['full']['my']['10']['block'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['source'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['grid'] = 8;
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noExecution')
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noSprint')
|
||||
{
|
||||
$lang->block->default['full']['my']['10']['block'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['source'] = 'project';
|
||||
@@ -355,7 +355,7 @@ $lang->block->availableBlocks->feedback = 'My Feedbacks';
|
||||
|
||||
$lang->block->moduleList['product'] = $lang->productCommon;
|
||||
$lang->block->moduleList['project'] = 'Project';
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noExecution') $lang->block->moduleList['execution'] = $lang->execution->common;
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noSprint') $lang->block->moduleList['execution'] = $lang->execution->common;
|
||||
$lang->block->moduleList['qa'] = 'Test';
|
||||
$lang->block->moduleList['todo'] = 'Todo';
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ $lang->block->default['full']['my']['10']['title'] = '项目列表';
|
||||
$lang->block->default['full']['my']['10']['block'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['source'] = 'project';
|
||||
$lang->block->default['full']['my']['10']['grid'] = 8;
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noExecution')
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noSprint')
|
||||
{
|
||||
$lang->block->default['full']['my']['10']['block'] = 'execution';
|
||||
$lang->block->default['full']['my']['10']['source'] = 'execution';
|
||||
@@ -355,7 +355,7 @@ $lang->block->availableBlocks->feedback = '反馈';
|
||||
|
||||
$lang->block->moduleList['product'] = $lang->productCommon;
|
||||
$lang->block->moduleList['project'] = '项目';
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noExecution') $lang->block->moduleList['execution'] = $lang->execution->common;
|
||||
if(!isset($config->projectMode) || $config->projectMode != 'noSprint') $lang->block->moduleList['execution'] = $lang->execution->common;
|
||||
$lang->block->moduleList['qa'] = '测试';
|
||||
$lang->block->moduleList['todo'] = '待办';
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ class blockModel extends model
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->andWhere('hidden')->eq(0)
|
||||
->beginIF($type)->andWhere('type')->eq($type)->fi()
|
||||
->beginIF(isset($this->config->projectMode) && $this->config->projectMode == 'noExecution')->andWhere('source')->ne('execution')->fi()
|
||||
->beginIF(isset($this->config->projectMode) && $this->config->projectMode == 'noSprint')->andWhere('source')->ne('execution')->fi()
|
||||
->orderBy('`order`')
|
||||
->fetchAll('id');
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
</td>
|
||||
</tr>
|
||||
<?php $showExecution = (strpos(",$showFields,", ',execution,') !== false);?>
|
||||
<?php $noExecution = (isset($config->projectMode) and $config->projectMode == 'noExecution');?>
|
||||
<?php $noSprint = (isset($config->projectMode) and $config->projectMode == 'noSprint');?>
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo ($showExecution) ? $lang->bug->project : $lang->bug->type;?>
|
||||
@@ -111,7 +111,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
<?php endif;?>
|
||||
<?php if($showExecution):?>
|
||||
<td>
|
||||
<?php if(!$noExecution):?>
|
||||
<?php if(!$noSprint):?>
|
||||
<div class='table-row'>
|
||||
<div class='table-col' id='projectBox'>
|
||||
<?php echo html::select('project', $projects, $projectID, "class='form-control chosen' onchange='loadProductExecutions({$productID}, this.value)'");?>
|
||||
|
||||
@@ -62,7 +62,7 @@ $lang->mainNav->menuOrder[55] = 'system';
|
||||
$lang->mainNav->menuOrder[60] = 'admin';
|
||||
|
||||
if($config->systemMode == 'lean') unset($lang->mainNav->program, $lang->mainNav->menuOrder[10]);
|
||||
if(isset($config->projectMode) and $config->projectMode == 'noExecution') unset($lang->mainNav->execution, $lang->mainNav->menuOrder[25]);
|
||||
if(isset($config->projectMode) and $config->projectMode == 'noSprint') unset($lang->mainNav->execution, $lang->mainNav->menuOrder[25]);
|
||||
|
||||
/* My menu. */
|
||||
$lang->my->menu = new stdclass();
|
||||
@@ -89,7 +89,7 @@ $lang->my->menuOrder[45] = 'score';
|
||||
$lang->my->menuOrder[50] = 'contacts';
|
||||
|
||||
if(!$config->systemScore) unset($lang->my->menu->score, $lang->my->menuOrder[45]);
|
||||
if(isset($config->projectMode) and $config->projectMode == 'noExecution') unset($lang->my->menu->execution, $lang->my->menuOrder[30]);
|
||||
if(isset($config->projectMode) and $config->projectMode == 'noSprint') unset($lang->my->menu->execution, $lang->my->menuOrder[30]);
|
||||
|
||||
$lang->my->menu->work['subMenu'] = new stdclass();
|
||||
$lang->my->menu->work['subMenu']->task = array('link' => "{$lang->task->common}|my|work|mode=task", 'subModule' => 'task');
|
||||
@@ -488,13 +488,13 @@ $lang->doc->menuOrder[30] = 'project';
|
||||
$lang->doc->menuOrder[35] = 'execution';
|
||||
$lang->doc->menuOrder[36] = 'api';
|
||||
$lang->doc->menuOrder[40] = 'custom';
|
||||
if(isset($config->projectMode) and $config->projectMode == 'noExecution') unset($lang->doc->menu->execution, $lang->doc->menuOrder[35]);
|
||||
if(isset($config->projectMode) and $config->projectMode == 'noSprint') unset($lang->doc->menu->execution, $lang->doc->menuOrder[35]);
|
||||
|
||||
$lang->doc->menu->product['subMenu'] = new stdclass();
|
||||
$lang->doc->menu->project['subMenu'] = new stdclass();
|
||||
$lang->doc->menu->execution['subMenu'] = new stdclass();
|
||||
$lang->doc->menu->custom['subMenu'] = new stdclass();
|
||||
if(isset($config->projectMode) and $config->projectMode == 'noExecution') unset($lang->doc->menu->execution['subMenu']);
|
||||
if(isset($config->projectMode) and $config->projectMode == 'noSprint') unset($lang->doc->menu->execution['subMenu']);
|
||||
|
||||
$lang->doc->menu->api['subMenu'] = new stdclass();
|
||||
$lang->doc->menu->api['subMenu']->index = array('link' => "{$lang->doc->apiDoc}|api|index|libID=%s", 'alias' => 'create,edit');
|
||||
|
||||
@@ -613,7 +613,7 @@ class commonModel extends model
|
||||
|
||||
if($config->edition == 'open') unset($lang->createIcons['effort']);
|
||||
if($config->systemMode != 'new') unset($lang->createIcons['program']);
|
||||
if(!isset($config->projectMode) || $config->projectMode == 'noExecution') unset($lang->createIcons['execution']);
|
||||
if(!isset($config->projectMode) || $config->projectMode == 'noSprint') unset($lang->createIcons['execution']);
|
||||
|
||||
/* Check whether the creation permission is available, and print create buttons. */
|
||||
|
||||
@@ -1240,7 +1240,7 @@ class commonModel extends model
|
||||
|
||||
$searchObjects = $lang->searchObjects;
|
||||
if($config->systemMode != 'new') unset($searchObjects['program']);
|
||||
if(!isset($config->projectMode) || $config->projectMode == 'noExecution') unset($searchObjects['execution']);
|
||||
if(!isset($config->projectMode) || $config->projectMode == 'noSprint') unset($searchObjects['execution']);
|
||||
|
||||
foreach($searchObjects as $key => $value)
|
||||
{
|
||||
|
||||
@@ -632,15 +632,17 @@ class custom extends control
|
||||
{
|
||||
$mode = fixer::input('post')->get('mode');
|
||||
$program = isset($_POST['program']) ? $_POST['program'] : 0;
|
||||
if($mode == 'lean' and empty($program)) return $this->send(array('result' => 'fail', 'message' => array('program'=>array($this->lang->custom->switchModeHelper))));
|
||||
if($mode == 'lean' and empty($program)) return $this->send(array('result' => 'fail', 'message' => array('program' => $this->lang->custom->switchModeHelper)));
|
||||
|
||||
$this->loadModel('setting')->setItem('system.common.global.mode', $mode);
|
||||
$this->loadModel('setting')->setItem('system.common.global.defaultProgram', $program);
|
||||
|
||||
/* 只有没有关联项目集的产品和项目关联到默认项目集下. */
|
||||
$this->loadModel('upgrade')->relationDefaultProgram($program);
|
||||
|
||||
if($this->post->mode == 'new') $this->loadModel('setting')->deleteItems('owner=system&module=common§ion=global&key=projectMode');
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inLink('mode')));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'top'));
|
||||
}
|
||||
|
||||
$this->app->loadLang('upgrade');
|
||||
|
||||
@@ -138,8 +138,12 @@ class execution extends control
|
||||
array_unshift($recentExecutions, $executionID);
|
||||
$recentExecutions = array_unique($recentExecutions);
|
||||
$recentExecutions = array_slice($recentExecutions, 0, 5);
|
||||
$this->setting->setItem($this->app->user->account . 'common.execution.recentExecutions', implode(',', $recentExecutions));
|
||||
$this->setting->setItem($this->app->user->account . 'common.execution.lastExecution', $executionID);
|
||||
$recentExecutions = join(',', $recentExecutions);
|
||||
if(empty($this->config->projectMode))
|
||||
{
|
||||
if(!isset($this->config->execution->recentExecutions) or $this->config->execution->recentExecutions != $recentExecutions) $this->setting->updateItem($this->app->user->account . 'common.execution.recentExecutions', $recentExecutions);
|
||||
if(!isset($this->config->execution->lastExecution) or $this->config->execution->lastExecution != $executionID) $this->setting->updateItem($this->app->user->account . 'common.execution.lastExecution', $executionID);
|
||||
}
|
||||
|
||||
if($this->cookie->preExecutionID != $executionID)
|
||||
{
|
||||
@@ -181,9 +185,7 @@ class execution extends control
|
||||
$sort = common::appendOrder($orderBy);
|
||||
|
||||
/* Header and position. */
|
||||
$this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->task;
|
||||
$this->view->position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name);
|
||||
$this->view->position[] = $this->lang->execution->task;
|
||||
$this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->task;
|
||||
|
||||
/* Load pager and get tasks. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
@@ -3123,11 +3125,11 @@ class execution extends control
|
||||
}
|
||||
|
||||
/* Get projects, executions and products. */
|
||||
$object = $this->project->getByID($objectID, $this->app->tab == 'project' ? 'project' : 'sprint,stage,kanban');
|
||||
$object = $this->project->getByID($objectID, 'project,sprint,stage,kanban');
|
||||
$products = $this->product->getProducts($objectID);
|
||||
$queryID = ($browseType == 'bySearch') ? (int)$param : 0;
|
||||
$browseLink = $this->session->executionStoryList;
|
||||
if($this->app->tab == 'project') $browseLink = $this->createLink('projectstory', 'story', "objectID=$objectID");
|
||||
if($this->app->tab == 'project' and empty($object->noSprint)) $browseLink = $this->createLink('projectstory', 'story', "objectID=$objectID");
|
||||
|
||||
$this->session->set('storyList', $this->app->getURI(true), $this->app->tab); // Save session.
|
||||
|
||||
@@ -3515,6 +3517,7 @@ class execution extends control
|
||||
$projects = $this->loadModel('program')->getProjectList(0, 'all', 0, 'order_asc', null, 0, 0, true);
|
||||
$executionGroups = $this->dao->select('*')->from(TABLE_EXECUTION)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('noSprint')->eq('0')
|
||||
->andWhere('type')->in('sprint,stage,kanban')
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
|
||||
->andWhere('project')->in(array_keys($projects))
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
common::printLink('story', 'export', "productID=$productID&orderBy=id_desc&executionID=$execution->id", "<i class='icon icon-export muted'></i> " . $lang->story->export, '', "class='btn btn-link export iframe' data-app='execution'");
|
||||
common::printLink('story', 'export', "productID=$productID&orderBy=id_desc&executionID=$execution->id", "<i class='icon icon-export muted'></i> " . $lang->story->export, '', "class='btn btn-link export iframe'");
|
||||
|
||||
if(common::canModify('execution', $execution))
|
||||
{
|
||||
@@ -96,14 +96,14 @@
|
||||
|
||||
$hidden = empty($buttonLink) ? 'hidden' : '';
|
||||
echo "<div class='btn-group dropdown' title='{$buttonTitle}'>";
|
||||
echo html::a($buttonLink, "<i class='icon icon-plus'></i> $buttonTitle", '', "class='btn btn-secondary $hidden' data-app='execution'");
|
||||
echo html::a($buttonLink, "<i class='icon icon-plus'></i> $buttonTitle", '', "class='btn btn-secondary $hidden'");
|
||||
|
||||
if($common::hasPriv('story', 'create') and common::hasPriv('story', 'batchCreate'))
|
||||
{
|
||||
if(!($isAllProduct and count($products) > 1)) echo "<button type='button' class='btn btn-secondary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
|
||||
echo "<ul class='dropdown-menu pull-right'>";
|
||||
echo '<li>' . html::a($createStoryLink, $lang->story->create, '', "data-app='execution'") . '</li>';
|
||||
echo '<li>' . html::a($batchCreateLink, $lang->story->batchCreate, '', "data-app='execution'") . '</li>';
|
||||
echo '<li>' . html::a($createStoryLink, $lang->story->create) . '</li>';
|
||||
echo '<li>' . html::a($batchCreateLink, $lang->story->batchCreate) . '</li>';
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ $lang->stakeholder->methodOrder[75] = 'viewExpect';
|
||||
$lang->stakeholder->methodOrder[80] = 'userIssue';
|
||||
|
||||
global $config;
|
||||
if($config->systemMode == 'new')
|
||||
if($config->systemMode == 'new' || (defined('IN_UPGRADE') && IN_UPGRADE))
|
||||
{
|
||||
/* Design. */
|
||||
$lang->resource->design = new stdclass();
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
</tr>
|
||||
<?php $hiddenProgram = $config->systemMode == 'new' ? '' : 'hidden';?>
|
||||
<?php $rowspan = $config->systemMode == 'new' ? 4 : 3;?>
|
||||
<?php $noExecution = (isset($config->projectMode) and $config->projectMode == 'noExecution');?>
|
||||
<?php $noSprint = (isset($config->projectMode) and $config->projectMode == 'noSprint');?>
|
||||
<?php if($projectAdmins):?>
|
||||
<?php foreach($projectAdmins as $account => $group):?>
|
||||
<tr class="line<?php echo $group->group;?>">
|
||||
@@ -104,7 +104,7 @@
|
||||
<?php echo html::checkbox("productAll[$group->group]", array(1 => ''), $group->products == 'all' ? 1 : '', "onchange=toggleDisabled(this);");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if(!$noExecution):?>
|
||||
<?php if(!$noSprint):?>
|
||||
<tr class="line<?php echo $group->group;?>">
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
@@ -173,7 +173,7 @@
|
||||
<?php echo html::checkbox('productAll[1]', array(1 => ''), '', "onchange=toggleDisabled(this);");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if(!$noExecution):?>
|
||||
<?php if(!$noSprint):?>
|
||||
<tr class='line1'>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
|
||||
@@ -1309,7 +1309,7 @@ class productModel extends model
|
||||
if(empty($productID)) return array();
|
||||
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
$orderBy = $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc';
|
||||
$orderBy = $project && $project->model == 'waterfall' ? 'begin_asc,id_asc' : 'begin_desc,id_desc';
|
||||
|
||||
$executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent,t2.attribute')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
@@ -1324,7 +1324,7 @@ class productModel extends model
|
||||
|
||||
/* The waterfall project needs to show the hierarchy and remove the parent stage. */
|
||||
$executionList = array('0' => '');
|
||||
if($project->model == 'waterfall')
|
||||
if($project && $project->model == 'waterfall')
|
||||
{
|
||||
foreach($executions as $id => $execution)
|
||||
{
|
||||
|
||||
@@ -2495,32 +2495,29 @@ class projectModel extends model
|
||||
$this->config->resetNavGroup['execution'] = 'execution';
|
||||
$this->config->resetNavGroup[$moduleName] = $navGroup;
|
||||
|
||||
$project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($objectID)->andWhere('noSprint')->eq(1)->fetch();
|
||||
$project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($objectID)->andWhere('noSprint')->eq('1')->fetch();
|
||||
if(empty($project)) return;
|
||||
|
||||
if($project->type != 'project' and $project->type != 'sprint') return;
|
||||
|
||||
if($project->type == 'project')
|
||||
{
|
||||
$projectID = $project->id;
|
||||
$executionID = $this->dao->select('*')->from(TABLE_EXECUTION)
|
||||
$executionID = $this->dao->select('id')->from(TABLE_EXECUTION)
|
||||
->where('project')->eq($projectID)
|
||||
->andWhere('noSprint')->eq(1)
|
||||
->andWhere('type')->eq('sprint')
|
||||
->andWhere('deleted')->eq(0)
|
||||
->andWhere('deleted')->eq('0')
|
||||
->fetch('id');
|
||||
}
|
||||
elseif($project->type == 'sprint')
|
||||
{
|
||||
$executionID = $project->id;
|
||||
$projectID = $this->dao->select('*')->from(TABLE_PROJECT)
|
||||
->where('id')->eq($project->project)
|
||||
->andWhere('noSprint')->eq(1)
|
||||
->andWhere('type')->eq('project')
|
||||
->andWhere('deleted')->eq(0)
|
||||
->fetch('id');
|
||||
$projectID = $project->project;
|
||||
}
|
||||
if(empty($projectID) or empty($executionID)) return;
|
||||
|
||||
$this->session->set('project', $projectID, $this->app->tab);
|
||||
$this->app->tab = 'project';
|
||||
$_COOKIE['tab'] = 'project';
|
||||
|
||||
@@ -2554,7 +2551,9 @@ class projectModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
$this->config->resetNavGroup['execution'] = 'project';
|
||||
$this->config->resetNavGroup[$moduleName] = 'project';
|
||||
$this->config->projectMode = 'noSprint';
|
||||
|
||||
/* If objectID is set, cannot use homeMenu. */
|
||||
unset($this->lang->$navGroup->homeMenu);
|
||||
|
||||
+75
-29
@@ -49,36 +49,10 @@ class settingModel extends model
|
||||
*/
|
||||
public function setItem($path, $value = '')
|
||||
{
|
||||
/* Determine vision of config item. */
|
||||
$pathVision = explode('@', $path);
|
||||
$vision = isset($pathVision[1]) ? $pathVision[1] : '';
|
||||
$path = $pathVision[0];
|
||||
|
||||
/* fix bug when account has dot. */
|
||||
$account = isset($this->app->user->account) ? $this->app->user->account : '';
|
||||
$replace = false;
|
||||
if($account and strpos($path, $account) === 0)
|
||||
{
|
||||
$replace = true;
|
||||
$path = preg_replace("/^{$account}/", 'account', $path);
|
||||
}
|
||||
|
||||
$level = substr_count($path, '.');
|
||||
$section = '';
|
||||
|
||||
if($level <= 1) return false;
|
||||
if($level == 2) list($owner, $module, $key) = explode('.', $path);
|
||||
if($level == 3) list($owner, $module, $section, $key) = explode('.', $path);
|
||||
if($replace) $owner = $account;
|
||||
|
||||
$item = new stdclass();
|
||||
$item->owner = $owner;
|
||||
$item->module = $module;
|
||||
$item->section = $section;
|
||||
$item->key = $key;
|
||||
$item->value = $value;
|
||||
if(!empty($vision)) $item->vision = $vision;
|
||||
$item = $this->parseItemPath($path);
|
||||
if(empty($item)) return false;
|
||||
|
||||
$item->value = $value;
|
||||
$this->dao->replace(TABLE_CONFIG)->data($item)->exec();
|
||||
}
|
||||
|
||||
@@ -121,6 +95,37 @@ class settingModel extends model
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* When exists this item then update it. No exists then insert this item.
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $value
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateItem($path, $value = '')
|
||||
{
|
||||
$item = $this->parseItemPath($path);
|
||||
if(empty($item)) return false;
|
||||
if(!isset($item->vision)) $item->vision = '';
|
||||
|
||||
$updateID = $this->dao->select('id')->from(TABLE_CONFIG)
|
||||
->where('owner')->eq($item->owner)
|
||||
->andWhere('vision')->eq($item->vision)
|
||||
->andWhere('module')->eq($item->module)
|
||||
->andWhere('section')->eq($item->section)
|
||||
->andWhere('`key`')->eq($item->key)
|
||||
->fetch('id');
|
||||
if($updateID)
|
||||
{
|
||||
$this->dao->update(TABLE_CONFIG)->set('value')->eq($value)->where('id')->eq($updateID)->exec();
|
||||
return true;
|
||||
}
|
||||
|
||||
$item->value = $value;
|
||||
$this->dao->insert(TABLE_CONFIG)->data($item)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete items.
|
||||
*
|
||||
@@ -133,6 +138,47 @@ class settingModel extends model
|
||||
$this->createDAO($this->parseItemParam($paramString), 'delete')->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse item path
|
||||
*
|
||||
* @param string $path system.common.global.sn | system.common.sn | system.common.global.sn@rnd
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function parseItemPath($path)
|
||||
{
|
||||
/* Determine vision of config item. */
|
||||
$pathVision = explode('@', $path);
|
||||
$vision = isset($pathVision[1]) ? $pathVision[1] : '';
|
||||
$path = $pathVision[0];
|
||||
|
||||
/* fix bug when account has dot. */
|
||||
$account = isset($this->app->user->account) ? $this->app->user->account : '';
|
||||
$replace = false;
|
||||
if($account and strpos($path, $account) === 0)
|
||||
{
|
||||
$replace = true;
|
||||
$path = preg_replace("/^{$account}/", 'account', $path);
|
||||
}
|
||||
|
||||
$level = substr_count($path, '.');
|
||||
$section = '';
|
||||
|
||||
if($level <= 1) return false;
|
||||
if($level == 2) list($owner, $module, $key) = explode('.', $path);
|
||||
if($level == 3) list($owner, $module, $section, $key) = explode('.', $path);
|
||||
if($replace) $owner = $account;
|
||||
|
||||
$item = new stdclass();
|
||||
$item->owner = $owner;
|
||||
$item->module = $module;
|
||||
$item->section = $section;
|
||||
$item->key = $key;
|
||||
if(!empty($vision)) $item->vision = $vision;
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the param string for select or delete items.
|
||||
*
|
||||
|
||||
@@ -4580,7 +4580,7 @@ class storyModel extends model
|
||||
$storyLink = helper::createLink('story', 'view', "storyID=$story->id&version=0¶m=0&storyType=$story->type");
|
||||
$canView = common::hasPriv($story->type, 'view', null, "storyType=$story->type");
|
||||
|
||||
if($tab == 'project')
|
||||
if($tab == 'project' and empty($this->config->projectMode))
|
||||
{
|
||||
$storyLink = helper::createLink('projectstory', 'view', "storyID=$story->id");
|
||||
$canView = common::hasPriv('projectstory', 'view');
|
||||
|
||||
@@ -354,7 +354,7 @@ class task extends control
|
||||
{
|
||||
$taskLink = $this->createLink('my', 'work', 'mode=task');
|
||||
}
|
||||
elseif($this->app->tab == 'project')
|
||||
elseif($this->app->tab == 'project' and empty($execution->noSprint))
|
||||
{
|
||||
$taskLink = $this->createLink('project', 'execution', "browseType=all&projectID={$execution->project}");
|
||||
}
|
||||
|
||||
@@ -7538,8 +7538,8 @@ class upgradeModel extends model
|
||||
*/
|
||||
public function classic2Lean($programID)
|
||||
{
|
||||
/* Set project mode as noExecution. */
|
||||
$this->loadModel('setting')->setItem('system.common.global.projectMode', 'noExecution');
|
||||
/* Set project mode as noSprint. */
|
||||
$this->loadModel('setting')->setItem('system.common.global.projectMode', 'noSprint');
|
||||
|
||||
$this->upgradeInProjectMode($programID);
|
||||
|
||||
@@ -7625,7 +7625,7 @@ class upgradeModel extends model
|
||||
$project->lastEditedDate = $now;
|
||||
$project->grade = 2;
|
||||
$project->acl = $sprint->acl == 'open' ? 'open' : 'private';
|
||||
if($projectMode == 'noExecution') $project->noExecution = '1';
|
||||
if($projectMode == 'noSprint') $project->noSprint = '1';
|
||||
|
||||
$this->dao->insert(TABLE_PROJECT)->data($project)->check('name', 'unique', "type='project' AND parent=$programID AND deleted='0'")->exec();
|
||||
if(dao::isError()) return false;
|
||||
@@ -7637,7 +7637,9 @@ class upgradeModel extends model
|
||||
|
||||
$project->id = $projectID;
|
||||
$this->createProjectDocLib($project);
|
||||
$this->processMergedData($programID, $projectID, '', array(), array($sprint->id));
|
||||
|
||||
$productIdList = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($sprint->id)->fetchPairs();
|
||||
$this->processMergedData($programID, $projectID, '', $productIdList, array($sprint->id));
|
||||
}
|
||||
|
||||
$this->fixProjectPath($programID);
|
||||
@@ -7707,7 +7709,9 @@ class upgradeModel extends model
|
||||
|
||||
$project->id = $projectID;
|
||||
$this->createProjectDocLib($project);
|
||||
$this->processMergedData($programID, $projectID, '', array(), array_keys($sprints));
|
||||
|
||||
$productIdList = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($sprints))->fetchPairs();
|
||||
$this->processMergedData($programID, $projectID, '', $productIdList, array_keys($sprints));
|
||||
}
|
||||
|
||||
$this->fixProjectPath($programID);
|
||||
|
||||
Reference in New Issue
Block a user