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 @@ product->code;?> - +
product->line;?> diff --git a/module/product/view/edit.html.php b/module/product/view/edit.html.php index 95ca3b1385..616f056113 100644 --- a/module/product/view/edit.html.php +++ b/module/product/view/edit.html.php @@ -29,7 +29,7 @@ product->code;?> - code, "class='form-control' autocomplete='off'");?> +
code, "class='form-control' autocomplete='off'");?> product->line;?> diff --git a/module/productplan/view/linkbug.html.php b/module/productplan/view/linkbug.html.php index 66c07a5fd9..3fa65b5e07 100644 --- a/module/productplan/view/linkbug.html.php +++ b/module/productplan/view/linkbug.html.php @@ -31,10 +31,7 @@ include '../../common/view/tablesorter.html.php'; - id])) continue; - if($bug->plan and helper::diffDate($plans[$bug->plan], helper::today()) > 0) continue; - ?> + id])) continue;?> diff --git a/module/productplan/view/view.html.php b/module/productplan/view/view.html.php index 22d048b38f..69733c2767 100644 --- a/module/productplan/view/view.html.php +++ b/module/productplan/view/view.html.php @@ -28,40 +28,40 @@
- session->productPlanList ? $this->session->productPlanList : inlink('browse', "planID=$plan->id"); - if(!$plan->deleted) - { - ob_start(); - echo "
"; - echo "
"; - common::printIcon('story', 'create', "productID=$plan->product&branch=$plan->branch&moduleID=0&storyID=0&projectID=0&bugID=0&planID=$plan->id", $plan, 'button', 'plus'); - $batchMisc = common::hasPriv('story', 'batchCreate') ? '' : "disabled"; - $batchLink = common::hasPriv('story', 'batchCreate') ? $this->createLink('story', 'batchCreate', "productID=$plan->product&branch=$plan->branch&moduleID=0&story=0&project=0&plan={$plan->id}") : '#'; - echo ""; - echo "'; - echo '
'; - if(common::hasPriv('productplan', 'linkStory')) - { - echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkStory, '', "class='btn'"); - } - if(common::hasPriv('productplan', 'linkBug') and $config->global->flow != 'onlyStory') - { - echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkBug, '', "class='btn'"); - } - echo '
'; - echo "
"; - common::printIcon('productplan', 'edit', "planID=$plan->id", $plan); - common::printIcon('productplan', 'delete', "planID=$plan->id", $plan, 'button', '', 'hiddenwin'); - echo '
'; - $actionLinks = ob_get_contents(); - ob_end_clean(); - echo $actionLinks; - } - common::printRPN($browseLink); - ?> + session->productPlanList ? $this->session->productPlanList : inlink('browse', "planID=$plan->id"); + if(!$plan->deleted) + { + ob_start(); + echo "
"; + echo "
"; + common::printIcon('story', 'create', "productID=$plan->product&branch=$plan->branch&moduleID=0&storyID=0&projectID=0&bugID=0&planID=$plan->id", $plan, 'button', 'plus'); + $batchMisc = common::hasPriv('story', 'batchCreate') ? '' : "disabled"; + $batchLink = common::hasPriv('story', 'batchCreate') ? $this->createLink('story', 'batchCreate', "productID=$plan->product&branch=$plan->branch&moduleID=0&story=0&project=0&plan={$plan->id}") : '#'; + echo ""; + echo "'; + echo '
'; + if(common::hasPriv('productplan', 'linkStory')) + { + echo html::a(inlink('view', "planID=$plan->id&type=story&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkStory, '', "class='btn'"); + } + if(common::hasPriv('productplan', 'linkBug') and $config->global->flow != 'onlyStory') + { + echo html::a(inlink('view', "planID=$plan->id&type=bug&orderBy=id_desc&link=true"), ' ' . $lang->productplan->linkBug, '', "class='btn'"); + } + echo '
'; + echo "
"; + common::printIcon('productplan', 'edit', "planID=$plan->id", $plan); + common::printIcon('productplan', 'delete', "planID=$plan->id", $plan, 'button', '', 'hiddenwin'); + echo '
'; + $actionLinks = ob_get_contents(); + ob_end_clean(); + echo $actionLinks; + } + common::printRPN($browseLink); + ?>
diff --git a/module/project/control.php b/module/project/control.php index baf1643134..a5887cbd1a 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -915,7 +915,7 @@ class project extends control $whitelist = ''; $acl = 'open'; $plan = new stdClass(); - $productPlan = new stdClass(); + $productPlan = array(); if($copyProjectID) { @@ -969,7 +969,7 @@ class project extends control $this->view->code = $code; $this->view->team = $team; $this->view->products = $products; - $this->view->productPlan = $productPlan; + $this->view->productPlan = array(0 => '') + $productPlan; $this->view->whitelist = $whitelist; $this->view->copyProjectID = $copyProjectID; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products)); diff --git a/module/project/model.php b/module/project/model.php index 0deb04c9a4..87f4bca07e 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -908,6 +908,8 @@ class projectModel extends model if(($this->session->taskBrowseType) and ($this->session->taskBrowseType != 'bysearch')) $browseType = $this->session->taskBrowseType; } + $this->session->set('taskWithChildren', in_array($browseType, array('unclosed', 'byproject', 'all')) ? false : true); + /* Get tasks. */ $tasks = array(); if($browseType != "bysearch") diff --git a/module/project/view/bug.html.php b/module/project/view/bug.html.php index 14064dc887..5124141717 100644 --- a/module/project/view/bug.html.php +++ b/module/project/view/bug.html.php @@ -17,7 +17,7 @@ Build:' . $build->name . ''; ?>
- + id");?>
diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 16853416fa..a1059cf7b0 100644 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -121,7 +121,12 @@ product . "]", $productPlan, $plan->id, "class='form-control'");?> id)?> - + +
+ + +
+ diff --git a/module/project/view/taskheader.html.php b/module/project/view/taskheader.html.php index 285cffeca0..9ebb5cc06f 100644 --- a/module/project/view/taskheader.html.php +++ b/module/project/view/taskheader.html.php @@ -97,7 +97,7 @@