diff --git a/module/block/control.php b/module/block/control.php index 99f761ec01..29e22af8e0 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -49,9 +49,17 @@ class block extends control if(!common::hasPriv($moduleKey, 'index')) unset($modules[$moduleKey]); } + if($this->config->global->flow != 'full') + { + unset($modules['todo']); + unset($modules['qa']); + } + if($this->config->global->flow == 'onlyStory') unset($modules['project']); + if($this->config->global->flow == 'onlyTask') unset($modules['product']); + $closedBlock = isset($this->config->block->closed) ? $this->config->block->closed : ''; if(strpos(",$closedBlock,", ",|dynamic,") === false) $modules['dynamic'] = $this->lang->block->dynamic; - if(strpos(",$closedBlock,", ",|flowchart,") === false) $modules['flowchart'] = $this->lang->block->lblFlowchart; + if(strpos(",$closedBlock,", ",|flowchart,") === false and $this->config->global->flow == 'full') $modules['flowchart'] = $this->lang->block->lblFlowchart; if(strpos(",$closedBlock,", ",|html,") === false) $modules['html'] = 'HTML'; $modules = array('' => '') + $modules; @@ -203,8 +211,11 @@ class block extends control if($this->block->initBlock($module)) die(js::reload()); } - foreach($blocks as $block) + foreach($blocks as $key => $block) { + if($this->config->global->flow == 'onlyStory' and strpos(',product,story,', ',' . $block->source . ',') === false and $block->block != 'dynamic') unset($blocks[$key]); + if($this->config->global->flow == 'onlyTask' and strpos(',project,task,', ',' . $block->source . ',') === false and $block->block != 'dynamic') unset($blocks[$key]); + $block->params = json_decode($block->params); $blockID = $block->block; $source = empty($block->source) ? 'common' : $block->source; diff --git a/module/common/model.php b/module/common/model.php index 53e95b8c8a..4eec958ef7 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -125,6 +125,20 @@ class commonModel extends model $this->config->system = isset($config['system']) ? $config['system'] : array(); $this->config->personal = isset($config[$account]) ? $config[$account] : array(); + foreach($this->config->system as $module => $records) + { + /* Overide the items defined in config/config.php and config/my.php. */ + if(!isset($this->config->$module)) $this->config->$module = new stdclass(); + if(isset($this->config->system->$module)) helper::mergeConfig($this->config->system->$module, $module); + } + + foreach($this->config->personal as $module => $records) + { + /* Overide the items defined in config/config.php and config/my.php. */ + if(!isset($this->config->$module)) $this->config->$module = new stdclass(); + if(isset($this->config->personal->$module)) helper::mergeConfig($this->config->personal->$module, $module); + } + /* Overide the items defined in config/config.php and config/my.php. */ if(isset($this->config->system->common)) helper::mergeConfig($this->config->system->common, 'common'); if(isset($this->config->personal->common)) helper::mergeConfig($this->config->personal->common, 'common'); @@ -374,11 +388,33 @@ class commonModel extends model */ public static function printSearchBox() { - global $app, $lang; + global $app, $config, $lang; $moduleName = $app->getModuleName(); $methodName = $app->getMethodName(); $searchObject = $moduleName; + if($config->global->flow == 'onlyStory') + { + /* Adjust search items. */ + unset($lang->searchObjects['bug']); + unset($lang->searchObjects['task']); + unset($lang->searchObjects['testcase']); + unset($lang->searchObjects['project']); + unset($lang->searchObjects['build']); + unset($lang->searchObjects['testtask']); + } + elseif($config->global->flow == 'onlyTask') + { + unset($lang->searchObjects['bug']); + unset($lang->searchObjects['story']); + unset($lang->searchObjects['product']); + unset($lang->searchObjects['testcase']); + unset($lang->searchObjects['build']); + unset($lang->searchObjects['release']); + unset($lang->searchObjects['productplan']); + unset($lang->searchObjects['testtask']); + } + if($moduleName == 'product') { if($methodName == 'browse') $searchObject = 'story'; @@ -391,7 +427,12 @@ class commonModel extends model { $searchObject = $methodName; } - if(empty($lang->searchObjects[$searchObject])) $searchObject = 'bug'; + if(empty($lang->searchObjects[$searchObject])) + { + $searchObject = 'bug'; + if($config->global->flow == 'onlyStory') $searchObject = 'story'; + if($config->global->flow == 'onlyTask') $searchObject = 'task'; + } echo "
| story->legendFromBug;?> | @@ -337,8 +344,9 @@||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| story->legendLinkStories;?> | +story->legendLinkStories;?> |
|
||||||||
| task->story;?> |
@@ -65,7 +65,9 @@
name, "class='form-control' autocomplete='off'");?>
+ config->global->flow != 'onlyTask'):?>
task->copyStoryTitle;?>
+
files;?>
| fetch('file', 'buildform');?> | ||||||||
| task->afterSubmit;?> | -task->afterChoices, 'continueAdding');?> | +task->afterChoices, $this->config->global->flow == 'onlyTask' ? 'toTaskList' : 'continueAdding');?> | ||||||||
| diff --git a/module/user/control.php b/module/user/control.php index da25826d2f..9949bbcc02 100644 --- a/module/user/control.php +++ b/module/user/control.php @@ -36,6 +36,9 @@ class user extends control */ public function view($account) { + if($this->config->global->flow == 'onlyStory') $this->locate($this->createLink('user', 'dynamic', "period=today&account=$account")); + if($this->config->global->flow == 'onlyTask') $this->locate($this->createLink('user', 'task', "account=$account")); + if($this->config->global->flow == 'onlyTest') $this->locate($this->createLink('user', 'bug', "account=$account")); $this->locate($this->createLink('user', 'todo', "account=$account")); } diff --git a/module/user/view/featurebar.html.php b/module/user/view/featurebar.html.php index 698a247696..62cfa9b2c4 100755 --- a/module/user/view/featurebar.html.php +++ b/module/user/view/featurebar.html.php @@ -7,13 +7,32 @@ $date = isset($date) ? $date : helper::today(); echo " | ||||||||||