task->deniedNotice;?>
+task->deniedNotice, $lang->task->start);?>
diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 5284d3aaaa..6bb13d97e2 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -414,7 +414,7 @@ $lang->menugroup->message = 'admin'; /* 错误提示信息。*/ $lang->error = new stdclass(); $lang->error->companyNotFound = "您访问的域名 %s 没有对应的公司。"; -$lang->error->length = array("『%s』长度错误,应当为『%s』", "『%s』长度应当不超过『%s』,且不小于『%s』。"); +$lang->error->length = array("『%s』长度错误,应当为『%s』", "『%s』长度应当小于『%s』,且大于『%s』。"); $lang->error->reg = "『%s』不符合格式,应当为:『%s』。"; $lang->error->unique = "『%s』已经有『%s』这条记录了。如果您确定该记录已删除,请到后台管理-回收站还原。。"; $lang->error->gt = "『%s』应当大于『%s』。"; diff --git a/module/custom/control.php b/module/custom/control.php index 60ea9a794a..94edf5cf97 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -123,22 +123,22 @@ class custom extends control } 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 10, check it when saved. */ + /* 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) die(js::alert($this->lang->custom->notice->invalidStrlen['ten'])); } - /* The length of these string is litter than 20, check it when saved. */ + /* 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(strlen($key) > 20) die(js::alert($this->lang->custom->notice->invalidStrlen['twenty'])); } - /* The length of stageList is 255, check it when saved. */ + /* The length of stageList in testcase module is less than 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. */ + /* 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(strlen($key) > 30) die(js::alert($this->lang->custom->notice->invalidStrlen['thirty'])); diff --git a/module/product/config.php b/module/product/config.php index 75a090ab8e..45033d3d50 100644 --- a/module/product/config.php +++ b/module/product/config.php @@ -82,8 +82,8 @@ $config->product->search['params']['lastEditedDate'] = array('operator' => '=', $config->product->create = new stdclass(); $config->product->edit = new stdclass(); -$config->product->create->requiredFields = 'name,code'; -$config->product->edit->requiredFields = 'name,code'; +$config->product->create->requiredFields = 'name'; +$config->product->edit->requiredFields = 'name'; $config->product->editor = new stdclass(); $config->product->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); diff --git a/module/product/model.php b/module/product/model.php index 7de241892e..303b6841dd 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -309,6 +309,7 @@ class productModel extends model $product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_PRODUCT)->data($product)->autoCheck() ->batchCheck($this->config->product->create->requiredFields, 'notempty') + ->checkIF(strlen($product->code) == 0, 'code', 'notempty') //the value of product code can be 0 or 00.00 ->check('name', 'unique', "deleted = '0'") ->check('code', 'unique', "deleted = '0'") ->exec(); @@ -349,6 +350,7 @@ class productModel extends model $product = $this->loadModel('file')->processImgURL($product, $this->config->product->editor->edit['id'], $this->post->uid); $this->dao->update(TABLE_PRODUCT)->data($product)->autoCheck() ->batchCheck($this->config->product->edit->requiredFields, 'notempty') + ->checkIF(strlen($product->code) == 0, 'code', 'notempty') //the value of product code can be 0 or 00.0 ->check('name', 'unique', "id != $productID and deleted = '0'") ->check('code', 'unique', "id != $productID and deleted = '0'") ->where('id')->eq($productID) @@ -396,6 +398,7 @@ class productModel extends model ->data($product) ->autoCheck() ->batchCheck($this->config->product->edit->requiredFields , 'notempty') + ->checkIF(strlen($product->code) == 0, 'code', 'notempty') //the value of product code can be 0 or 00.0 ->check('name', 'unique', "id != $productID and deleted = '0'") ->check('code', 'unique', "id != $productID and deleted = '0'") ->where('id')->eq($productID) diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index 687bf6ac15..10b17ab16c 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -28,7 +28,7 @@