diff --git a/config/config.php b/config/config.php
index 086f7c2e26..6059aa9124 100644
--- a/config/config.php
+++ b/config/config.php
@@ -134,7 +134,7 @@ define('TABLE_FILE', '`' . $config->db->prefix . 'file`');
define('TABLE_HISTORY', '`' . $config->db->prefix . 'history`');
define('TABLE_EXTENSION', '`' . $config->db->prefix . 'extension`');
define('TABLE_WEBAPP', '`' . $config->db->prefix . 'webapp`');
-define('TABLE_CUSTOMLANG', '`' . $config->db->prefix . 'customLang`');
+define('TABLE_CUSTOM', '`' . $config->db->prefix . 'custom`');
$config->objectTables['product'] = TABLE_PRODUCT;
$config->objectTables['story'] = TABLE_STORY;
@@ -151,7 +151,7 @@ $config->objectTables['user'] = TABLE_USER;
$config->objectTables['doc'] = TABLE_DOC;
$config->objectTables['doclib'] = TABLE_DOCLIB;
$config->objectTables['todo'] = TABLE_TODO;
-$config->objectTables['customlang'] = TABLE_CUSTOMLANG;
+$config->objectTables['custom'] = TABLE_CUSTOM;
/* Include extension config files. */
$extConfigFiles = glob($configRoot . 'ext/*.php');
diff --git a/db/update4.3.sql b/db/update4.3.sql
index feb60a2460..5c74da0efd 100644
--- a/db/update4.3.sql
+++ b/db/update4.3.sql
@@ -1,7 +1,10 @@
-REATE TABLE `demoTTT`.`zt_customLang` (
- `id` MEDIUMINT( 8 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
- `lang` VARCHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
- `object` VARCHAR( 30 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
- `key` VARCHAR( 60 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
- `value` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
-) ENGINE = MYISAM;
+CREATE TABLE IF NOT EXISTS `zt_custom` (
+ `id` mediumint(8) unsigned NOT NULL auto_increment,
+ `lang` varchar(30) NOT NULL,
+ `module` varchar(30) NOT NULL,
+ `section` varchar(30) NOT NULL,
+ `key` varchar(60) NOT NULL,
+ `value` text NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `lang` (`lang`,`module`,`section`,`key`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/framework/router.class.php b/framework/router.class.php
index aa529cb38b..80a8e98a1f 100755
--- a/framework/router.class.php
+++ b/framework/router.class.php
@@ -1464,6 +1464,19 @@ class router
$loadedLangs[] = $langFile;
}
+ /* Merge from the db lang. */
+ if($moduleName != 'common' and isset($lang->db->custom))
+ {
+ foreach($lang->db->custom as $record)
+ {
+ if($moduleName == $record->module)
+ {
+ if(!$record->key) continue;
+ $lang->{$record->module}->{$record->section}[$record->key] = $record->value;
+ }
+ }
+ }
+
$this->lang = $lang;
return $lang;
}
diff --git a/module/build/view/create.html.php b/module/build/view/create.html.php
index 928db52764..59ef60e253 100644
--- a/module/build/view/create.html.php
+++ b/module/build/view/create.html.php
@@ -86,7 +86,7 @@
title, '', "class='preview'");?> |
bug->statusList[$bug->status];?> |
- status == 'resolved' ? $bug->resolvedBy : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?> |
+ status == 'resolved' ? substr($users[$bug->resolvedBy], 2) : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?> |
diff --git a/module/build/view/edit.html.php b/module/build/view/edit.html.php
index e0ceb4703a..8f845383a6 100644
--- a/module/build/view/edit.html.php
+++ b/module/build/view/edit.html.php
@@ -105,7 +105,7 @@
bugs . ',', ',' . $bug->id . ',') !== false) echo 'checked';?>> id);?> |
title, '', "class='preview'");?> |
bug->statusList[$bug->status];?> |
- status == 'resolved' ? $bug->resolvedBy : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?> |
+ status == 'resolved' ? substr($users[$bug->resolvedBy], 2) : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?> |
diff --git a/module/common/control.php b/module/common/control.php
index c6ef323199..87386cdc45 100644
--- a/module/common/control.php
+++ b/module/common/control.php
@@ -25,6 +25,7 @@ class common extends control
$this->common->setCompany();
$this->common->setUser();
$this->common->loadConfigFromDB();
+ $this->common->loadCustomFromDB();
if($this->app->getViewType() == 'mhtml') $this->common->setMobileMenu();
$this->app->loadLang('company');
}
@@ -163,18 +164,20 @@ class common extends control
if(empty($method)) $method = $app->getMethodName();
$className = 'header';
- if(strpos($orderBy, $fieldName) !== false)
+ $order = explode('_', $orderBy);
+ $order[0] = trim($order[0], '`');
+ if($order[0] == $fieldName)
{
- if(stripos($orderBy, 'desc') !== false)
+ if(isset($order[1]) and $order[1] == 'asc')
{
- $orderBy = str_ireplace('desc', 'asc', $orderBy);
- $className = 'headerSortUp';
- }
- elseif(stripos($orderBy, 'asc') !== false)
- {
- $orderBy = str_ireplace('asc', 'desc', $orderBy);
+ $orderBy = "`{$order[0]}`_desc";
$className = 'headerSortDown';
}
+ else
+ {
+ $orderBy = "`{$order[0]}`_asc";
+ $className = 'headerSortUp';
+ }
}
else
{
diff --git a/module/common/lang/en.php b/module/common/lang/en.php
index 57fa053e15..265923f82b 100644
--- a/module/common/lang/en.php
+++ b/module/common/lang/en.php
@@ -270,32 +270,32 @@ $lang->user->menu = $lang->company->menu;
/* Admin menu. */
$lang->admin = new stdclass();
$lang->admin->menu = new stdclass();
-$lang->admin->menu->index = array('link' => 'Index|admin|index');
-$lang->admin->menu->extension = array('link' => 'Extension|extension|browse', 'subModule' => 'extension,editor');
-$lang->admin->menu->customlang = array('link' => 'Custom lang|customlang|story', 'subModule' => 'customlang');
-$lang->admin->menu->mail = array('link' => 'Email|mail|index', 'subModule' => 'mail');
-$lang->admin->menu->clearData = array('link' => 'Clear data|admin|cleardata');
-$lang->admin->menu->convert = array('link' => 'Import|convert|index', 'subModule' => 'convert');
-$lang->admin->menu->trashes = array('link' => 'Trash|action|trash', 'subModule' => 'action');
-$lang->admin->menu->sso = array('link' => 'SSO|sso|browse', 'subModule' => 'sso');
+$lang->admin->menu->index = array('link' => 'Index|admin|index');
+$lang->admin->menu->extension = array('link' => 'Extension|extension|browse', 'subModule' => 'extension,editor');
+$lang->admin->menu->custom = array('link' => 'Custom|custom|index', 'subModule' => 'custom');
+$lang->admin->menu->mail = array('link' => 'Email|mail|index', 'subModule' => 'mail');
+$lang->admin->menu->clearData = array('link' => 'Clear data|admin|cleardata');
+$lang->admin->menu->convert = array('link' => 'Import|convert|index', 'subModule' => 'convert');
+$lang->admin->menu->trashes = array('link' => 'Trash|action|trash', 'subModule' => 'action');
+$lang->admin->menu->sso = array('link' => 'SSO|sso|browse', 'subModule' => 'sso');
-$lang->convert = new stdclass();
-$lang->upgrade = new stdclass();
-$lang->action = new stdclass();
-$lang->extension = new stdclass();
-$lang->customlang = new stdclass();
-$lang->editor = new stdclass();
-$lang->mail = new stdclass();
-$lang->sso = new stdclass();
+$lang->convert = new stdclass();
+$lang->upgrade = new stdclass();
+$lang->action = new stdclass();
+$lang->extension = new stdclass();
+$lang->custom = new stdclass();
+$lang->editor = new stdclass();
+$lang->mail = new stdclass();
+$lang->sso = new stdclass();
-$lang->convert->menu = $lang->admin->menu;
-$lang->upgrade->menu = $lang->admin->menu;
-$lang->action->menu = $lang->admin->menu;
-$lang->extension->menu = $lang->admin->menu;
-$lang->customlang->menu = $lang->admin->menu;
-$lang->editor->menu = $lang->admin->menu;
-$lang->mail->menu = $lang->admin->menu;
-$lang->sso->menu = $lang->admin->menu;
+$lang->convert->menu = $lang->admin->menu;
+$lang->upgrade->menu = $lang->admin->menu;
+$lang->action->menu = $lang->admin->menu;
+$lang->extension->menu = $lang->admin->menu;
+$lang->custom->menu = $lang->admin->menu;
+$lang->editor->menu = $lang->admin->menu;
+$lang->mail->menu = $lang->admin->menu;
+$lang->sso->menu = $lang->admin->menu;
/* Groups. */
$lang->menugroup = new stdclass();
diff --git a/module/common/lang/menuOrder.php b/module/common/lang/menuOrder.php
index 1df47d8c05..c46f62f023 100644
--- a/module/common/lang/menuOrder.php
+++ b/module/common/lang/menuOrder.php
@@ -108,17 +108,17 @@ $lang->user->menuOrder = $lang->company->menuOrder;
/* admin menu order. */
$lang->admin->menuOrder[5] = 'index';
$lang->admin->menuOrder[10] = 'extension';
-$lang->admin->menuOrder[15] = 'customlang';
+$lang->admin->menuOrder[15] = 'custom';
$lang->admin->menuOrder[20] = 'editor';
$lang->admin->menuOrder[25] = 'mail';
$lang->admin->menuOrder[30] = 'sso';
$lang->admin->menuOrder[35] = 'convert';
$lang->admin->menuOrder[40] = 'trashes';
-$lang->convert->menuOrder = $lang->admin->menuOrder;
-$lang->upgrade->menuOrder = $lang->admin->menuOrder;
-$lang->action->menuOrder = $lang->admin->menuOrder;
-$lang->extension->menuOrder = $lang->admin->menuOrder;
-$lang->customlang->menuOrder = $lang->admin->menuOrder;
-$lang->editor->menuOrder = $lang->admin->menuOrder;
-$lang->mail->menuOrder = $lang->admin->menuOrder;
-$lang->sso->menuOrder = $lang->admin->menuOrder;
+$lang->convert->menuOrder = $lang->admin->menuOrder;
+$lang->upgrade->menuOrder = $lang->admin->menuOrder;
+$lang->action->menuOrder = $lang->admin->menuOrder;
+$lang->extension->menuOrder = $lang->admin->menuOrder;
+$lang->custom->menuOrder = $lang->admin->menuOrder;
+$lang->editor->menuOrder = $lang->admin->menuOrder;
+$lang->mail->menuOrder = $lang->admin->menuOrder;
+$lang->sso->menuOrder = $lang->admin->menuOrder;
diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php
index f24188e87a..1ce3e653e5 100644
--- a/module/common/lang/zh-cn.php
+++ b/module/common/lang/zh-cn.php
@@ -270,14 +270,14 @@ $lang->user->menu = $lang->company->menu;
/* 后台管理菜单设置。*/
$lang->admin = new stdclass();
$lang->admin->menu = new stdclass();
-$lang->admin->menu->index = array('link' => '首页|admin|index');
-$lang->admin->menu->extension = array('link' => '扩展|extension|browse', 'subModule' => 'extension,editor');
-$lang->admin->menu->customlang = array('link' => '语言配置|customlang|story', 'subModule' => 'customlang');
-$lang->admin->menu->mail = array('link' => '发信|mail|index', 'subModule' => 'mail');
-$lang->admin->menu->clearData = array('link' => '清除数据|admin|cleardata');
-$lang->admin->menu->convert = array('link' => '导入|convert|index', 'subModule' => 'convert');
-$lang->admin->menu->trashes = array('link' => '回收站|action|trash', 'subModule' => 'action');
-$lang->admin->menu->sso = array('link' => '单点登录|sso|browse', 'subModule' => 'sso');
+$lang->admin->menu->index = array('link' => '首页|admin|index');
+$lang->admin->menu->extension = array('link' => '扩展|extension|browse', 'subModule' => 'extension,editor');
+$lang->admin->menu->custom = array('link' => '自定义配置|custom|index', 'subModule' => 'custom');
+$lang->admin->menu->mail = array('link' => '发信|mail|index', 'subModule' => 'mail');
+$lang->admin->menu->clearData = array('link' => '清除数据|admin|cleardata');
+$lang->admin->menu->convert = array('link' => '导入|convert|index', 'subModule' => 'convert');
+$lang->admin->menu->trashes = array('link' => '回收站|action|trash', 'subModule' => 'action');
+$lang->admin->menu->sso = array('link' => '单点登录|sso|browse', 'subModule' => 'sso');
$lang->convert = new stdclass();
$lang->upgrade = new stdclass();
@@ -288,14 +288,14 @@ $lang->editor = new stdclass();
$lang->mail = new stdclass();
$lang->sso = new stdclass();
-$lang->convert->menu = $lang->admin->menu;
-$lang->upgrade->menu = $lang->admin->menu;
-$lang->action->menu = $lang->admin->menu;
-$lang->extension->menu = $lang->admin->menu;
-$lang->customlang->menu = $lang->admin->menu;
-$lang->editor->menu = $lang->admin->menu;
-$lang->mail->menu = $lang->admin->menu;
-$lang->sso->menu = $lang->admin->menu;
+$lang->convert->menu = $lang->admin->menu;
+$lang->upgrade->menu = $lang->admin->menu;
+$lang->action->menu = $lang->admin->menu;
+$lang->extension->menu = $lang->admin->menu;
+$lang->custom->menu = $lang->admin->menu;
+$lang->editor->menu = $lang->admin->menu;
+$lang->mail->menu = $lang->admin->menu;
+$lang->sso->menu = $lang->admin->menu;
/* 菜单分组。*/
$lang->menugroup = new stdclass();
diff --git a/module/common/model.php b/module/common/model.php
index 923eae6290..a7f63644cc 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -118,6 +118,20 @@ class commonModel extends model
}
}
+ /**
+ * Load custom lang from db.
+ *
+ * @access public
+ * @return void
+ */
+ public function loadCustomFromDB()
+ {
+ if(!$this->config->db->name) return;
+ $records = $this->loadModel('custom')->getAll();
+ if(!$records) return;
+ $this->lang->db->custom = $records;
+ }
+
/**
* Juage a method of one module is open or not?
*
diff --git a/module/custom/config.php b/module/custom/config.php
new file mode 100644
index 0000000000..39a2bfdcd3
--- /dev/null
+++ b/module/custom/config.php
@@ -0,0 +1,18 @@
+custom = new stdClass();
+
+$config->custom->story = new stdClass();
+$config->custom->story->fields['priList'] = '优先级';
+$config->custom->story->fields['sourceList'] = '来源';
+$config->custom->story->fields['reasonList'] = '关闭原因';
+$config->custom->story->fields['reviewResultList'] = '评审结果';
+$config->custom->story->fields['statusList'] = '状态';
+$config->custom->story->fields['stageList'] = '阶段';
+$config->custom->story->canAdd = 'reasonList,reviewResultList,sourceList,priList';
+
+$config->custom->task = '';
+$config->custom->bug = '';
+$config->custom->testcase = '';
+$config->custom->testtask = '';
+$config->custom->todo = '';
+$config->custom->user = '';
diff --git a/module/custom/control.php b/module/custom/control.php
new file mode 100644
index 0000000000..9d727c8601
--- /dev/null
+++ b/module/custom/control.php
@@ -0,0 +1,48 @@
+
+ * @package custom
+ * @version $Id$
+ * @link http://www.zentao.net
+ */
+class custom extends control
+{
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ public function index($module = 'story', $field = 'priList')
+ {
+ $lang = $this->app->getClientLang();
+
+ $this->app->loadLang($module);
+ $fieldList = $this->lang->$module->$field;
+ if(!empty($_POST))
+ {
+ foreach($_POST['keys'] as $index => $key)
+ {
+// $value = $_POST['values'][$index];
+ // if(isset($fieldList[$key]) and $fieldList[$key] == $value) continue;
+ $this->custom->setItem("{$lang}.{$module}.{$field}.{$key}", $value);
+ }
+ if(!dao::getError()) die(js::reload('parent'));
+ }
+
+ $this->view->standardList = $this->custom->getStandardList($module, $field);
+ $this->view->title = $this->lang->custom->common . $this->lang->colon . $this->lang->custom->story;
+ $this->view->position[] = $this->lang->custom->common;
+ $this->view->position[] = $this->lang->custom->$module;
+ $this->view->fieldList = $fieldList;
+ $this->view->field = $field;
+ $this->view->module = $module;
+ $this->view->canAdd = strpos($this->config->custom->$module->canAdd, $field) !== false;
+
+ $this->display();
+ }
+}
+
diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php
new file mode 100644
index 0000000000..90970f42d9
--- /dev/null
+++ b/module/custom/lang/en.php
@@ -0,0 +1,12 @@
+custom->common = 'Custom';
+$lang->custom->key = 'Key';
+$lang->custom->value = 'Value';
+
+$lang->custom->story = 'Story';
+$lang->custom->task = 'Task';
+$lang->custom->bug = 'Bug';
+$lang->custom->testcase = 'Test case';
+$lang->custom->testtask = 'Test task';
+$lang->custom->todo = 'Todo';
+$lang->custom->user = 'User';
diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php
new file mode 100644
index 0000000000..62954b6207
--- /dev/null
+++ b/module/custom/lang/zh-cn.php
@@ -0,0 +1,12 @@
+custom->common = '自定义配置';
+$lang->custom->key = '键';
+$lang->custom->value = '值';
+
+$lang->custom->story = '需求';
+$lang->custom->task = '任务';
+$lang->custom->bug = 'Bug';
+$lang->custom->testcase = '测试用例';
+$lang->custom->testtask = '测试任务';
+$lang->custom->todo = '待办';
+$lang->custom->user = '用户';
diff --git a/module/custom/model.php b/module/custom/model.php
new file mode 100644
index 0000000000..be1f04096a
--- /dev/null
+++ b/module/custom/model.php
@@ -0,0 +1,116 @@
+
+ * @package xxx
+ * @version $Id$
+ * @link http://www.zentao.net
+ */
+class customModel extends model
+{
+ /**
+ * Get config of system and one user.
+ *
+ * @param string $account
+ * @access public
+ * @return array
+ */
+ public function getAll()
+ {
+ return $this->dao->select('*')->from(TABLE_CUSTOM)->orderBy('id')->fetchAll('id');
+ }
+
+ /**
+ * Set value of an item.
+ *
+ * @param string $path system.common.global.sn or system.common.sn
+ * @param string $value
+ * @access public
+ * @return void
+ */
+ public function setItem($path, $value = '')
+ {
+ $level = substr_count($path, '.');
+ $section = '';
+
+ if($level <= 1) return false;
+ if($level == 2) list($lang, $module, $key) = explode('.', $path);
+ if($level == 3) list($lang, $module, $section, $key) = explode('.', $path);
+
+ $item = new stdclass();
+ $item->lang = $lang;
+ $item->module = $module;
+ $item->section = $section;
+ $item->key = $key;
+ $item->value = $value;
+
+ $this->dao->replace(TABLE_CUSTOM)->data($item)->exec();
+ }
+
+ public function getStandardList($module, $field)
+ {
+ $this->loadModel($module);
+ $lang = $this->app->getClientLang();
+ $currentList = $this->lang->$module->$field;
+ $dbList = $this->getItems("{$lang}.{$module}.{$field}");
+ }
+
+ public function getItems($paramString)
+ {
+ return $this->createDAO($this->parseItemParam($paramString), 'select')->fetchAll('id');
+ }
+
+ /**
+ * Delete items.
+ *
+ * @param string $paramString see parseItemParam();
+ * @access public
+ * @return void
+ */
+ public function deleteItems($paramString)
+ {
+ $this->createDAO($this->parseItemParam($paramString), 'delete')->exec();
+ }
+
+ /**
+ * Parse the param string for select or delete items.
+ *
+ * @param string $paramString owner=xxx&key=sn and so on.
+ * @access public
+ * @return array
+ */
+ public function parseItemParam($paramString)
+ {
+ /* Parse the param string into array. */
+ parse_str($paramString, $params);
+
+ /* Init fields not set in the param string. */
+ $fields = 'lang,module,section,key';
+ $fields = explode(',', $fields);
+ foreach($fields as $field) if(!isset($params[$field])) $params[$field] = '';
+
+ return $params;
+ }
+
+ /**
+ * Create a DAO object to select or delete one or more records.
+ *
+ * @param array $params the params parsed by parseItemParam() method.
+ * @param string $method select|delete.
+ * @access public
+ * @return object
+ */
+ public function createDAO($params, $method = 'select')
+ {
+ return $this->dao->$method('*')->from(TABLE_CUSTOM)->where('1 = 1')
+ ->beginIF($params['lang'])->andWhere('lang')->in($params['lang'])->fi()
+ ->beginIF($params['module'])->andWhere('module')->in($params['module'])->fi()
+ ->beginIF($params['section'])->andWhere('section')->in($params['section'])->fi()
+ ->beginIF($params['key'])->andWhere('`key`')->in($params['key'])->fi();
+ }
+
+}
+
diff --git a/module/custom/view/header.html.php b/module/custom/view/header.html.php
new file mode 100755
index 0000000000..6bf5f36a39
--- /dev/null
+++ b/module/custom/view/header.html.php
@@ -0,0 +1,15 @@
+
+
+
+ "; common::printLink('custom', 'index', "module=story", $lang->custom->story); echo '';
+ echo ""; common::printLink('custom', 'index', "module=task", $lang->custom->task); echo '';
+ echo ""; common::printLink('custom', 'index', "module=bug", $lang->custom->bug); echo '';
+ echo ""; common::printLink('custom', 'index', "module=testcase", $lang->custom->testcase); echo '';
+ echo ""; common::printLink('custom', 'index', "module=testtask", $lang->custom->testtask); echo '';
+ echo ""; common::printLink('custom', 'index', "module=todo", $lang->custom->todo); echo '' ;
+ echo ""; common::printLink('custom', 'index', "module=user", $lang->custom->user); echo '';
+ echo "";
+ ?>
+
+
diff --git a/module/custom/view/index.html.php b/module/custom/view/index.html.php
new file mode 100644
index 0000000000..c79b466f23
--- /dev/null
+++ b/module/custom/view/index.html.php
@@ -0,0 +1,65 @@
+
+ * @package xxx
+ * @version $Id$
+ * @link http://www.zentao.net
+ */
+?>
+
+
+ |
+
+
+
+
+ |
+
+EOT;
+?>
+
+
+
+ config->custom->story->fields as $key => $value)
+ {
+ echo "" . html::a(inlink('index', "module=$module&field=$key"), $value) . "";
+ }
+ ?>
+
+
+
+
+
diff --git a/module/customlang/config.php b/module/customlang/config.php
deleted file mode 100644
index 969e01960a..0000000000
--- a/module/customlang/config.php
+++ /dev/null
@@ -1,19 +0,0 @@
-customlang = new stdClass();
-
-$config->customlang->story = new stdClass();
-$config->customlang->story->fields['priList'] = '优先级';
-$config->customlang->story->fields['sourceList'] = '来源';
-$config->customlang->story->fields['reasonList'] = '关闭原因';
-$config->customlang->story->fields['reviewResultList'] = '评审结果';
-$config->customlang->story->fields['statusList'] = '状态';
-$config->customlang->story->fields['stageList'] = '阶段';
-$config->customlang->story->canAdd = 'reasonList,reviewResultList,sourceList,priList';
-
-$config->customlang->task = '';
-$config->customlang->bug = '';
-$config->customlang->testcase = '';
-$config->customlang->testtask = '';
-$config->customlang->todo = '';
-$config->customlang->user = '';
-
diff --git a/module/customlang/control.php b/module/customlang/control.php
deleted file mode 100644
index 847a20444f..0000000000
--- a/module/customlang/control.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- * @package xxx
- * @version $Id$
- * @link http://www.zentao.net
- */
-class customlang extends control
-{
- public function __construct()
- {
- parent::__construct();
- }
-
- public function story($field = 'priList')
- {
- if(!empty($_POST))
- {
- $this->customlang->update('story', $field);
- if(!dao::getError()) die(js::reload('parent'));
- }
-
- $this->app->loadLang('story');
- $fieldList = array();
- $standardList = $this->lang->story->$field;
- $fieldList = $this->customlang->getLang('', $this->app->getClientLang(), 'story', $field);
- $fieldList = $fieldList ? unserialize($fieldList->value) + $standardList: $standardList;
-
- $this->view->title = $this->lang->customlang->common . $this->lang->colon . $this->lang->customlang->story;
- $this->view->position[] = $this->lang->customlang->common;
- $this->view->position[] = $this->lang->customlang->story;
- $this->view->standardList = $standardList;
- $this->view->fieldList = $fieldList;
- $this->view->field = $field;
- $this->view->canAdd = strpos($this->config->customlang->story->canAdd, $field) !== false;
-
- $this->display();
- }
-}
-
diff --git a/module/customlang/lang/en.php b/module/customlang/lang/en.php
deleted file mode 100644
index 40cf1af301..0000000000
--- a/module/customlang/lang/en.php
+++ /dev/null
@@ -1,10 +0,0 @@
-customlang->common = 'Custom lang';
-
-$lang->customlang->story = 'Story';
-$lang->customlang->task = 'Task';
-$lang->customlang->bug = 'Bug';
-$lang->customlang->testcase = 'Test case';
-$lang->customlang->testtask = 'Test task';
-$lang->customlang->todo = 'Todo';
-$lang->customlang->user = 'User';
diff --git a/module/customlang/lang/zh-cn.php b/module/customlang/lang/zh-cn.php
deleted file mode 100644
index 216ad80438..0000000000
--- a/module/customlang/lang/zh-cn.php
+++ /dev/null
@@ -1,10 +0,0 @@
-customlang->common = '语言配置';
-
-$lang->customlang->story = '需求';
-$lang->customlang->task = '任务';
-$lang->customlang->bug = 'Bug';
-$lang->customlang->testcase = '测试用例';
-$lang->customlang->testtask = '测试任务';
-$lang->customlang->todo = '待办';
-$lang->customlang->user = '用户';
diff --git a/module/customlang/model.php b/module/customlang/model.php
deleted file mode 100644
index 85479a0a0d..0000000000
--- a/module/customlang/model.php
+++ /dev/null
@@ -1,41 +0,0 @@
-
- * @package xxx
- * @version $Id$
- * @link http://www.zentao.net
- */
-class customlangModel extends model
-{
- public function getLang($id, $lang, $object, $key, $value)
- {
- return $this->dao->select('*')->from(TABLE_CUSTOMLANG)
- ->where('1=1')
- ->beginIF($id)->andWhere('id')->eq($id)->fi()
- ->beginIF($lang)->andWhere('lang')->eq($lang)->fi()
- ->beginIF($object)->andWhere('object')->eq($object)->fi()
- ->beginIF($key)->andWhere('`key`')->eq($key)->fi()
- ->beginIF($value)->andWhere('value')->eq($value)->fi()
- ->fetch();
- }
-
- public function update($object, $field)
- {
- $item = new stdClass();
- $item->lang = $this->app->getClientLang();
- $item->object = $object;
- $item->key = $field;
- $item->value = serialize($this->post->$field);
- $oldItem = $this->getLang('', $item->lang, $item->object, $item->key);
- if($oldItem)
- {
- return $this->dao->update(TABLE_CUSTOMLANG)->set('value')->eq($item->value)->where('id')->eq($oldItem->id)->exec();
- }
- return $this->dao->insert(TABLE_CUSTOMLANG)->data($item)->exec();
- }
-}
-
diff --git a/module/customlang/view/header.html.php b/module/customlang/view/header.html.php
deleted file mode 100755
index d280894543..0000000000
--- a/module/customlang/view/header.html.php
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- "; common::printLink('customlang', 'story', "", $lang->customlang->story); echo '';
- echo ""; common::printLink('customlang', 'task', "", $lang->customlang->task); echo '';
- echo ""; common::printLink('customlang', 'bug', "", $lang->customlang->bug); echo '';
- echo ""; common::printLink('customlang', 'testcase', "", $lang->customlang->testcase); echo '';
- echo ""; common::printLink('customlang', 'testtask', "", $lang->customlang->testtask); echo '';
- echo ""; common::printLink('customlang', 'todo', "", $lang->customlang->todo); echo '' ;
- echo ""; common::printLink('customlang', 'user', "", $lang->customlang->user); echo '';
- echo "";
- ?>
-
-
diff --git a/module/customlang/view/story.html.php b/module/customlang/view/story.html.php
deleted file mode 100644
index 32467c8d7d..0000000000
--- a/module/customlang/view/story.html.php
+++ /dev/null
@@ -1,40 +0,0 @@
-
- * @package xxx
- * @version $Id$
- * @link http://www.zentao.net
- */
-?>
-
-
-
- config->customlang->story->fields as $key => $value)
- {
- echo "" . html::a(inlink('story', "field=$key"), $value) . "";
- }
- ?>
-
-
-
-
-
diff --git a/module/productplan/control.php b/module/productplan/control.php
index 875cd55558..50f3eaaa5a 100644
--- a/module/productplan/control.php
+++ b/module/productplan/control.php
@@ -45,9 +45,18 @@ class productplan extends control
$this->commonAction($product);
$lastPlan = $this->productplan->getLast($product);
+ if($lastPlan)
+ {
+ $timestamp = strtotime($lastPlan->end);
+ $weekday = date('w', $timestamp);
+ $delta = 1;
+ if($weekday == '5' or $weekday == '6') $delta = 8 - $weekday;
+
+ $begin = date('Y-m-d', strtotime("+$delta days", $timestamp));
+ }
+ $this->view->begin = $lastPlan ? $begin : '';
$this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->productplan->create;
- $this->view->begin = $lastPlan ? $lastPlan->end : '';
$this->display();
}
diff --git a/module/report/model.php b/module/report/model.php
index f7a5dba3cf..42dd2d83aa 100644
--- a/module/report/model.php
+++ b/module/report/model.php
@@ -121,7 +121,7 @@ $(function ()
series: {lines:{show: true, lineWidth: 2}, points: {show: true},hoverable: true},
legend: {noColumns: 1},
grid: { hoverable: true, clickable: true },
- xaxis: { ticks:ticks, tickFormatter: function(val) {tick = new Date(dateList[val]);;if(dateList[val] != undefined){return (tick.getMonth() + 1) + '-' + tick.getDate()}else{return ''}}},
+ xaxis: { ticks:ticks, tickFormatter: function(val) {tick = new Date(dateList[val]);;if(dateList[val] != undefined){return tick.getDate() + '/' + (tick.getMonth() + 1)}else{return ''}}},
yaxis: {mode: null, min: 0, minTickSize: [1, "day"]}};
var placeholder = $("#placeholder");
diff --git a/module/testcase/view/import.html.php b/module/testcase/view/import.html.php
index 6b4f5fcfc7..87d61214bd 100755
--- a/module/testcase/view/import.html.php
+++ b/module/testcase/view/import.html.php
@@ -1,7 +1,7 @@