diff --git a/db/zentao.sql b/db/zentao.sql index a930fe8d96..fc87f65dbc 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -667,8 +667,8 @@ INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type ('*', '*', '*', '*', '*', '', '监控定时任务', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), ('30', '23', '*', '*', '*', 'moduleName=project&methodName=computeburn', '更新燃尽图', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), ('0', '1', '*', '*', '*', 'moduleName=report&methodName=remind', '每日任务提醒', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), -('*/5', '*', '*', '*', '*', 'moduleName=svn&methodName=run', '同步SVN', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), -('*/5', '*', '*', '*', '*', 'moduleName=git&methodName=run', '同步GIT', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), +('*/5', '*', '*', '*', '*', 'moduleName=svn&methodName=run', '同步SVN', 'zentao', 1, 'stop', '0000-00-00 00:00:00'), +('*/5', '*', '*', '*', '*', 'moduleName=git&methodName=run', '同步GIT', 'zentao', 1, 'stop', '0000-00-00 00:00:00'), ('30', '0', '*', '*', '*', 'moduleName=backup&methodName=backup', '备份数据和附件', 'zentao', 1, 'normal', '0000-00-00 00:00:00'), ('*/5', '*', '*', '*', '*', 'moduleName=mail&methodName=asyncSend', '异步发信', 'zentao', 1, 'normal', '0000-00-00 00:00:00'); diff --git a/module/common/view/header.lite.html.php b/module/common/view/header.lite.html.php index 494a4bcb25..008c066511 100755 --- a/module/common/view/header.lite.html.php +++ b/module/common/view/header.lite.html.php @@ -1,5 +1,6 @@ getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> loadModel('custom')->customByConfig(); $webRoot = $this->app->getWebRoot(); $jsRoot = $webRoot . "js/"; $themeRoot = $webRoot . "theme/"; diff --git a/module/custom/control.php b/module/custom/control.php index cf58b5df71..f91dbd1ab4 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -97,5 +97,20 @@ class custom extends control $this->custom->deleteItems("module=$module§ion=$field"); die(js::reload('parent')); } -} + /** + * Flow zentao. + * + * @access public + * @return void + */ + public function flow() + { + if($_POST) + { + $this->loadModel('setting')->setItem('system.custom.productproject', $this->post->productproject); + die(js::reload('parent')); + } + $this->display(); + } +} diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index ae10bff1dd..9d4b707564 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -5,6 +5,7 @@ $lang->custom->set = 'Set custom'; $lang->custom->restore = 'restore'; $lang->custom->key = 'Key'; $lang->custom->value = 'Value'; +$lang->custom->flow = 'Flow'; $lang->custom->object['story'] = 'Story'; $lang->custom->object['task'] = 'Task'; @@ -69,3 +70,19 @@ $lang->custom->notice->userRole = 'The length of key must be less than 20!'; $lang->custom->storyReview = 'Reviewed procedure'; $lang->custom->reviewList[1] = 'Open'; $lang->custom->reviewList[0] = 'Close'; + +$lang->custom->flowList['productproject'] = 'The relation of product and project'; + +$lang->custom->productproject = new stdclass(); +$lang->custom->productproject->relation['0_0'] = 'Product - Project'; +$lang->custom->productproject->relation['0_1'] = 'Product - Iterative'; +$lang->custom->productproject->relation['1_1'] = 'Project - Iterative'; + +$lang->custom->productproject->product[0] = 'Product'; +$lang->custom->productproject->product[1] = 'Project'; +$lang->custom->productproject->project[0] = 'Project'; +$lang->custom->productproject->project[1] = 'Iterative'; + +$lang->custom->productproject->locked = 'PMS'; + +$lang->custom->productproject->notice = 'You can change the name of product and project, and the corresponding name display'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 1f71f0fc28..2dc30291b3 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -5,6 +5,7 @@ $lang->custom->set = '自定义配置'; $lang->custom->restore = '恢复默认'; $lang->custom->key = '键'; $lang->custom->value = '值'; +$lang->custom->flow = '流程'; $lang->custom->object['story'] = '需求'; $lang->custom->object['task'] = '任务'; @@ -69,3 +70,19 @@ $lang->custom->notice->userRole = '键的长度必须小于20个字符!'; $lang->custom->storyReview = '评审流程'; $lang->custom->reviewList[1] = '开启'; $lang->custom->reviewList[0] = '关闭'; + +$lang->custom->flowList['productproject'] = '产项关系'; + +$lang->custom->productproject = new stdclass(); +$lang->custom->productproject->relation['0_0'] = '产品 - 项目'; +$lang->custom->productproject->relation['0_1'] = '产品 - 迭代'; +$lang->custom->productproject->relation['1_1'] = '项目 - 迭代'; + +$lang->custom->productproject->product[0] = '产品'; +$lang->custom->productproject->product[1] = '项目'; +$lang->custom->productproject->project[0] = '项目'; +$lang->custom->productproject->project[1] = '迭代'; + +$lang->custom->productproject->locked = '项目管理'; + +$lang->custom->productproject->notice = '可以修改产品视图和项目视图的名称,以及相应的名称显示'; diff --git a/module/custom/model.php b/module/custom/model.php index 109843f9a6..86e7e267c3 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -122,4 +122,72 @@ class customModel extends model ->beginIF($params['section'])->andWhere('section')->in($params['section'])->fi() ->beginIF($params['key'])->andWhere('`key`')->in($params['key'])->fi(); } + + /** + * Custom by config. + * + * @access public + * @return void + */ + public function customByConfig() + { + if(!isset($this->config->custom->productproject)) return true; + + $productproject = $this->config->custom->productproject; + if(strpos($productproject, '_') === false) return true; + + list($product, $project) = explode('_', $productproject); + if($product == 0 and $project == 0) return true; + $change['before'] = $this->lang->custom->productproject->project[0]; + $change['after'] = $this->lang->custom->productproject->project[$project]; + $changes[] = $change; + if($product != 0) + { + $change['before'] = $this->lang->custom->productproject->product[0]; + $change['after'] = $this->lang->custom->productproject->product[$product]; + $changes[] = $change; + } + + $this->changeAllLang($this->lang, $changes); + } + + /** + * Change all lang. + * + * @param object $lang + * @param array $changes + * @access public + * @return object + */ + public function changeAllLang($lang, $changes = array()) + { + if(empty($changes)) return true; + static $changed = array(); + $type = is_array($lang) ? 'array' : 'object'; + foreach($lang as $key => $value) + { + if($lang == $this->lang->custom) continue; + if(is_object($value) or is_array($value)) + { + if($type == 'array') $lang[$key] = $this->changeAllLang($value, $changes); + if($type == 'object') $lang->$key = $this->changeAllLang($value, $changes); + } + if(is_string($value)) + { + if(isset($changed[$value])) continue; + if(strpos($value, $this->lang->custom->productproject->locked) !== false) continue; + foreach($changes as $change) + { + if(strpos($value, $change['before']) !== false) + { + $value = str_replace($change['before'], $change['after'], $value); + if($type == 'array') $lang[$key] = $value; + if($type == 'object')$lang->$key = $value; + $changed[$value] = true; + } + } + } + } + return $lang; + } } diff --git a/module/custom/view/flow.html.php b/module/custom/view/flow.html.php new file mode 100644 index 0000000000..b975168d4d --- /dev/null +++ b/module/custom/view/flow.html.php @@ -0,0 +1,45 @@ + + * @package custom + * @version $Id$ + * @link http://www.zentao.net + */ +?> + + +
+ +
+
+
+ + + + + + + + + + +
custom->flowList['productproject'];?>custom->productproject->relation, isset($config->custom->productproject) ? $config->custom->productproject : '', "class='form-control'");?>custom->productproject->notice?>
+
+
+ diff --git a/module/custom/view/set.html.php b/module/custom/view/set.html.php index 349fa9b011..a61cbbb59a 100644 --- a/module/custom/view/set.html.php +++ b/module/custom/view/set.html.php @@ -41,6 +41,9 @@ EOT; common::printLink('custom', 'set', "module=$object", $name); echo ''; } + echo '
  • '; + common::printLink('custom', 'flow', "", $lang->custom->flow); + echo '
  • '; ?>