diff --git a/module/common/lang/en.php b/module/common/lang/en.php index fd5f308979..4f9fc2a66b 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -45,6 +45,7 @@ $lang->goback = 'Back'; $lang->goPC = 'PC'; $lang->more = 'More'; $lang->day = 'Day'; +$lang->customConfig = 'Custom'; $lang->actions = 'Actions'; $lang->comment = 'Comment'; @@ -62,6 +63,7 @@ $lang->duplicate = '%s has the same title'; $lang->ipLimited = "
Sorry, current IP is limited by Administrator. Please contact the Administrator to lift the restrictions."; $lang->unfold = '+'; $lang->fold = '-'; +$lang->checked2Hide = 'Hide checked field.'; $lang->preShortcutKey = '[Shortcut key:←]'; $lang->nextShortcutKey = '[Shortcut key:→]'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 70412217c6..984344eb2e 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -45,6 +45,7 @@ $lang->goback = '返回'; $lang->goPC = 'PC版'; $lang->more = '更多'; $lang->day = '天'; +$lang->customConfig = '自定义'; $lang->actions = '操作'; $lang->comment = '备注'; @@ -62,6 +63,7 @@ $lang->duplicate = '已有相同标题的%s'; $lang->ipLimited = "抱歉,管理员限制当前IP登录,请联系管理员解除限制。"; $lang->unfold = '+'; $lang->fold = '-'; +$lang->checked2Hide = '选中字段在页面不显示'; $lang->preShortcutKey = '[快捷键:←]'; $lang->nextShortcutKey = '[快捷键:→]'; diff --git a/module/common/view/customfield.html.php b/module/common/view/customfield.html.php new file mode 100644 index 0000000000..2382036b80 --- /dev/null +++ b/module/common/view/customfield.html.php @@ -0,0 +1,31 @@ + + * @package common + * @version $Id$ + * @link http://www.zentao.net + */ +?> + + diff --git a/module/custom/control.php b/module/custom/control.php index ea47ee4264..1f66209754 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -142,4 +142,23 @@ class custom extends control $this->view->position[] = $this->lang->custom->flow; $this->display(); } + + /** + * Ajax save custom. + * + * @param string $module + * @param string $section + * @param string $key + * @access public + * @return void + */ + public function ajaxSaveCustom($module, $section, $key) + { + if($_POST) + { + $account = $this->app->user->account; + $this->loadModel('setting')->setItem("$account.$module.$section.$key", join(',', $this->post->fields)); + die(js::reload('parent')); + } + } } diff --git a/module/story/config.php b/module/story/config.php index 2748af8e1f..87ae669151 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -39,6 +39,7 @@ $config->story->list->exportFields = ' closedBy, closedDate, closedReason, lastEditedBy, lastEditedDate, childStories, linkStories, duplicateStory, files'; +$config->story->list->customCreateFields = 'source,verify,pri,estimate,mailto,keywords'; $config->story->datatable = new stdclass(); $config->story->datatable->defaultField = array('id', 'pri', 'title', 'plan', 'source', 'openedBy', 'assignedTo', 'estimate', 'status', 'stage', 'actions'); diff --git a/module/story/control.php b/module/story/control.php index 40e94f2314..d134f41495 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -161,6 +161,11 @@ class story extends control } } + /* Set Custom*/ + foreach(explode(',', $this->config->story->list->customCreateFields) as $field) $customFields[$field] = $this->lang->story->$field; + $this->view->customFields = $customFields; + $this->view->hiddenFields = isset($this->config->story->custom->create) ? $this->config->story->custom->create : ''; + $this->view->title = $product->name . $this->lang->colon . $this->lang->story->create; $this->view->position[] = html::a($this->createLink('product', 'browse', "product=$productID&branch=$branch"), $product->name); $this->view->position[] = $this->lang->story->common; diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php index a8b396e34b..d674421e03 100644 --- a/module/story/view/create.html.php +++ b/module/story/view/create.html.php @@ -19,6 +19,9 @@ icons['story']);?> icons['create']);?> story->create;?> +