diff --git a/db/zentao.sql b/db/zentao.sql index 9c47c48449..6690d04830 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -8816,7 +8816,7 @@ ALTER TABLE `zt_story` ADD `fromStory` mediumint(8) unsigned NOT NULL default 0 ALTER TABLE `zt_story` ADD `fromVersion` smallint(6) NOT NULL default 1 after `fromStory`; ALTER TABLE `zt_story` ADD `approvedDate` date NOT NULL after `assignedDate`; -ALTER TABLE `zt_todo` CHANGE `type` `type` char(15) NOT NULL AFTER `feedback`; +ALTER TABLE `zt_todo` CHANGE `type` char(15) NOT NULL AFTER `feedback`; -- DROP TABLE IF EXISTS `zt_durationestimation`; CREATE TABLE IF NOT EXISTS `zt_durationestimation` ( diff --git a/module/custom/control.php b/module/custom/control.php index 8001a8cdc9..62ad339866 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -172,14 +172,14 @@ class custom extends control } if(!empty($key) and !isset($oldCustoms[$key]) and $key != 'n/a' and !validater::checkREG($key, '/^[a-z_A-Z_0-9]+$/')) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStringKey)); - /* The length of roleList in user module and typeList in todo module is less than 10. check it when saved. */ - if($field == 'roleList' or $module == 'todo' and $field == 'typeList') - { - if(strlen($key) > 10) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['ten'])); - } + /* The length of roleList in user module is less than 10. check it when saved. */ + if($module == 'user' and $field == 'roleList' and strlen($key) > 10) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['ten'])); + + /* The length of typeList in todo module is less than 15. check it when saved. */ + if($module == 'todo' and $field == 'typeList' and strlen($key) > 15) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['fifteen'])); /* The length of sourceList in story module and typeList in task module is less than 20, check it when saved. */ - if($field == 'sourceList' or $module == 'task' and $field == 'typeList') + if(($module == 'story' and $field == 'sourceList') or ($module == 'task' and $field == 'typeList')) { if(strlen($key) > 20) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['twenty'])); } @@ -188,7 +188,7 @@ class custom extends control if($module == 'testcase' and $field == 'stageList' and strlen($key) > 255) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['twoHundred'])); /* The length of field that in bug and testcase module and reasonList in story and task module is less than 30, check it when saved. */ - if($module == 'bug' or $field == 'reasonList' or $module == 'testcase') + if(in_array($module, array('bug', 'testcase')) or (in_array($module, array('story', 'task')) and $field == 'reasonList')) { if(strlen($key) > 30) return $this->send(array('result' => 'fail', 'message' => $this->lang->custom->notice->invalidStrlen['thirty'])); } diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index efcc7f963f..a9396a720d 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -183,6 +183,7 @@ $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has Project Home. Do $lang->custom->notice->indexPage['qa'] = "ZenTao 8.2+ has Test Homepage. Do you want to go to Test Homepage?"; $lang->custom->notice->invalidStrlen['ten'] = 'The key should be <= 10 characters.'; +$lang->custom->notice->invalidStrlen['fifteen'] = 'The key should be <= 15 characters.'; $lang->custom->notice->invalidStrlen['twenty'] = 'The key should be <= 20 characters.'; $lang->custom->notice->invalidStrlen['thirty'] = 'The key should be <= 30 characters.'; $lang->custom->notice->invalidStrlen['twoHundred'] = 'The key should be <= 225 characters.'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 5e77ee1f0e..991319a060 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -183,6 +183,7 @@ $lang->custom->notice->indexPage['project'] = "从8.2版本起增加了项目主 $lang->custom->notice->indexPage['qa'] = "从8.2版本起增加了测试主页视图,是否默认进入测试主页?"; $lang->custom->notice->invalidStrlen['ten'] = '键的长度必须小于10个字符!'; +$lang->custom->notice->invalidStrlen['fifteen'] = '键的长度必须小于15个字符!'; $lang->custom->notice->invalidStrlen['twenty'] = '键的长度必须小于20个字符!'; $lang->custom->notice->invalidStrlen['thirty'] = '键的长度必须小于30个字符!'; $lang->custom->notice->invalidStrlen['twoHundred'] = '键的长度必须小于225个字符!'; diff --git a/module/my/control.php b/module/my/control.php index 7351545fd0..ea6d26055d 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -420,6 +420,7 @@ EOF; $projects = $this->dao->select('t1.id,t1.name,t2.id as execution')->from(TABLE_PROJECT)->alias('t1') ->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.id=t2.project') ->where('t2.id')->in($executionIDList) + ->andWhere('t1.type')->eq('project') ->fetchAll('execution'); }