diff --git a/module/custom/control.php b/module/custom/control.php index 444ec5d9e7..60ea9a794a 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -115,14 +115,34 @@ class custom extends control { foreach($_POST['keys'] as $index => $key) { - /* Fix bug #942. */ if(!empty($key)) $key = trim($key); - if($field == 'priList' and !is_numeric($key) or $key > 255) die(js::alert($this->lang->custom->notice->priListKey)); - if($module == 'bug' and $field == 'severityList' and !is_numeric($key)) die(js::alert($this->lang->custom->notice->severityListKey)); - if(!empty($key) and $key != 'n/a' and !validater::checkREG($key, '/^[a-z_0-9]+$/')) die(js::alert($this->lang->custom->notice->keyList)); + /* Invalid key. It should be numbers. (It includes severityList in bug module and priList in stroy, task, bug, testcasea, testtask and todo module.) */ + if($field == 'priList' or $field == 'severityList') + { + if(!is_numeric($key) or $key > 255) die(js::alert($this->lang->custom->notice->invalidNumberKey)); + } + if(!empty($key) and $key != 'n/a' and !validater::checkREG($key, '/^[a-z_0-9]+$/')) die(js::alert($this->lang->custom->notice->invalidStringKey)); - /* the length of role is 20, check it when save. */ - if($module == 'user' and $field == 'roleList' and strlen($key) > 10) die(js::alert($this->lang->custom->notice->userRole)); + /* The length of role is 10, check it when saved. */ + if($field == 'roleList' or $module == 'todo' and $field == 'typeList') + { + if(strlen($key) > 10) die(js::alert($this->lang->custom->notice->invalidStrlen['ten'])); + } + + /* The length of these string is litter than 20, check it when saved. */ + if($field == 'sourceList' or $module == 'task' and $field == 'typeList') + { + if(strlen($key) > 20) die(js::alert($this->lang->custom->notice->invalidStrlen['twenty'])); + } + + /* The length of stageList is 255, check it when saved. */ + if($module == 'testcase' and $field == 'stageList' and strlen($key) > 255) die(js::alert($this->lang->custom->notice->invalidStrlen['twoHundred'])); + + /* The length of these string is litter than 30, check it when saved. */ + if($module == 'bug' or $field == 'reasonList' or $module == 'testcase') + { + if(strlen($key) > 30) die(js::alert($this->lang->custom->notice->invalidStrlen['thirty'])); + } } $lang = $_POST['lang']; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 9885d04370..43e024974e 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -83,18 +83,22 @@ $lang->custom->allLang = 'All Language'; $lang->custom->confirmRestore = 'Do you want to reset to Default?'; $lang->custom->notice = new stdclass(); -$lang->custom->notice->userRole = 'Key must be no more than 10 characters!'; $lang->custom->notice->canNotAdd = 'These items are parameters of calculation, so customized creation is not enabled.'; $lang->custom->notice->forceReview = '%s Review is required for certain submitters.'; $lang->custom->notice->forceNotReview = "%s Review is NOT required for certain submitters."; $lang->custom->notice->longlife = 'Define shelved bugs.'; -$lang->custom->notice->priListKey = 'Priority list key should be a natural and not greater than 255.'; -$lang->custom->notice->keyList = 'The key should be a combination of lowercase English letters, numbers or underscores'; -$lang->custom->notice->severityListKey = 'Bug severity list key should be numbers.'; +$lang->custom->notice->invalidNumberKey = 'Priority list key should be a natural and not greater than 255.'; +$lang->custom->notice->invalidStringKey = 'The key should be a combination of lowercase English letters, numbers or underscores'; + $lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ has Product Homepage. Do you want to go to Product Homepage?"; $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Homepage. Do you want to go to Project Homepage?"; $lang->custom->notice->indexPage['qa'] = "ZenTao 8.2+ has QA Homepage. Do you want to go to QA Homepage?"; +$lang->custom->notice->invalidStrlen['ten'] = 'The length of the key must be less than 10 characters.'; +$lang->custom->notice->invalidStrlen['twenty'] = 'The length of the key must be less than 20 characters.'; +$lang->custom->notice->invalidStrlen['thirty'] = 'The length of the key must be less than 30 characters.'; +$lang->custom->notice->invalidStrlen['twoHundred'] = 'The length of the key must be less than 225 characters.'; + $lang->custom->storyReview = 'Review'; $lang->custom->forceReview = 'Selective Review'; $lang->custom->forceNotReview = 'No review'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 4022d5052a..aa87bf6d01 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -83,17 +83,21 @@ $lang->custom->allLang = '适用所有语言'; $lang->custom->confirmRestore = '是否要恢复默认配置?'; $lang->custom->notice = new stdclass(); -$lang->custom->notice->userRole = '键的长度必须小于10个字符!'; -$lang->custom->notice->canNotAdd = '该项参与运算,不提供自定义添加功能'; -$lang->custom->notice->forceReview = "指定人提交的%s必须评审。"; -$lang->custom->notice->forceNotReview = "指定人提交的%s不需要评审。"; -$lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。'; -$lang->custom->notice->priListKey = '优先级的键应当为不大于255的自然数'; -$lang->custom->notice->keyList = '键值应当为小写英文字母、数字或下划线的组合'; -$lang->custom->notice->severityListKey = 'Bug严重程度的键应当为数字!'; -$lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?"; -$lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?"; -$lang->custom->notice->indexPage['qa'] = "从8.2版本起增加了测试主页视图,是否默认进入测试主页?"; +$lang->custom->notice->canNotAdd = '该项参与运算,不提供自定义添加功能'; +$lang->custom->notice->forceReview = "指定人提交的%s必须评审。"; +$lang->custom->notice->forceNotReview = "指定人提交的%s不需要评审。"; +$lang->custom->notice->longlife = 'Bug列表页面的久未处理标签中,列出设置天数之前未处理的Bug。'; +$lang->custom->notice->invalidNumberKey = '键值应为不大于255的数字'; +$lang->custom->notice->invalidStringKey = '键值应当为小写英文字母、数字或下划线的组合'; + +$lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?"; +$lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主页视图,是否默认进入项目主页?"; +$lang->custom->notice->indexPage['qa'] = "从8.2版本起增加了测试主页视图,是否默认进入测试主页?"; + +$lang->custom->notice->invalidStrlen['ten'] = '键的长度必须小于10个字符!'; +$lang->custom->notice->invalidStrlen['twenty'] = '键的长度必须小于20个字符!'; +$lang->custom->notice->invalidStrlen['thirty'] = '键的长度必须小于30个字符!'; +$lang->custom->notice->invalidStrlen['twoHundred'] = '键的长度必须小于225个字符!'; $lang->custom->storyReview = '评审流程'; $lang->custom->forceReview = '强制评审'; diff --git a/module/product/config.php b/module/product/config.php index 9ca748dac5..75a090ab8e 100644 --- a/module/product/config.php +++ b/module/product/config.php @@ -2,10 +2,10 @@ $config->product = new stdclass(); $config->product->orderBy = 'isClosed,order_desc'; -$config->product->customBatchEditFields = 'PO,QD,RD,status,type,desc'; +$config->product->customBatchEditFields = 'line,PO,QD,RD,status,type,desc'; $config->product->custom = new stdclass(); -$config->product->custom->batchEditFields = 'PO,QD,RD,status'; +$config->product->custom->batchEditFields = 'line,PO,QD,RD,status'; $config->product->list = new stdclass(); $config->product->list->exportFields = 'id,name,line,activeStories,changedStories,draftStories,closedStories,plans,releases,bugs,unResolvedBugs,assignToNullBugs'; diff --git a/module/product/control.php b/module/product/control.php index e67e58c5ce..113f37dd8f 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -273,7 +273,7 @@ class product extends control $this->product->setMenu($this->products, $productID); - $product = $this->product->getStatByID($productID); + $product = $this->product->getById($productID); $this->view->title = $this->lang->product->edit . $this->lang->colon . $product->name; $this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name); $this->view->position[] = $this->lang->product->edit; @@ -390,7 +390,7 @@ class product extends control { $this->product->setMenu($this->products, $productID); - $product = $this->product->getStatByID($productID); + $product = $this->product->getStatByID($productID); $product->desc = $this->loadModel('file')->setImgSize($product->desc); if(!$product) die(js::error($this->lang->notFound) . js::locate('back')); diff --git a/module/product/model.php b/module/product/model.php index 5f40d8fc07..7de241892e 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -383,7 +383,7 @@ class productModel extends model $products[$productID]->QD = $data->QDs[$productID]; $products[$productID]->RD = $data->RDs[$productID]; $products[$productID]->type = $data->types[$productID]; - $products[$productID]->line = $data->line[$productID]; + $products[$productID]->line = $data->lines[$productID]; $products[$productID]->status = $data->statuses[$productID]; $products[$productID]->desc = strip_tags($this->post->descs[$productID], $this->config->allowedTags); $products[$productID]->order = $data->orders[$productID]; diff --git a/module/product/view/batchedit.html.php b/module/product/view/batchedit.html.php index 9e64e6577c..7cde853b6f 100755 --- a/module/product/view/batchedit.html.php +++ b/module/product/view/batchedit.html.php @@ -42,7 +42,7 @@ foreach(explode(',', $this->config->product->edit->requiredFields) as $field)