From dfc29b5cb286b83cf60c08054dc66329d6adaeff Mon Sep 17 00:00:00 2001 From: liyuchun Date: Fri, 29 Oct 2021 14:48:38 +0800 Subject: [PATCH] * Fix error of save WIP. --- module/kanban/lang/en.php | 1 + module/kanban/lang/zh-cn.php | 1 + module/kanban/model.php | 10 ++++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/module/kanban/lang/en.php b/module/kanban/lang/en.php index b8e49f81fb..9ff353ed58 100644 --- a/module/kanban/lang/en.php +++ b/module/kanban/lang/en.php @@ -17,6 +17,7 @@ $lang->kanban->columnColor = 'Column Color'; $lang->kanban->noColumnUniqueName = 'The Kanban column name already exists.'; $lang->kanban->error = new stdclass(); +$lang->kanban->error->mustBeInt = 'The WIPs must be positive integer.'; $lang->kanban->error->parentLimitNote = 'The WIPs in the parent column cannot be < the sum of the WIPs in the child column.'; $lang->kanban->error->childLimitNote = 'The sum of products in the child column cannot be > the number of products in the parent column.'; diff --git a/module/kanban/lang/zh-cn.php b/module/kanban/lang/zh-cn.php index 0317b72171..82278e5bae 100644 --- a/module/kanban/lang/zh-cn.php +++ b/module/kanban/lang/zh-cn.php @@ -50,6 +50,7 @@ $lang->kanban->columnColor = '看板列颜色'; $lang->kanban->noColumnUniqueName = '看板列名称已存在'; $lang->kanban->error = new stdclass(); +$lang->kanban->error->mustBeInt = '在制品数量必须是正整数。'; $lang->kanban->error->parentLimitNote = '父列的在制品数量不能小于子列在制品数量之和'; $lang->kanban->error->childLimitNote = '子列在制品数量之和不能大于父列的在制品数量'; diff --git a/module/kanban/model.php b/module/kanban/model.php index e018344bb0..a1482051f8 100644 --- a/module/kanban/model.php +++ b/module/kanban/model.php @@ -491,10 +491,12 @@ class kanbanModel extends model public function setWIP($columnID) { $oldColumn = $this->getColumnById($columnID); - $column = fixer::input('post') - ->cleanInt('limit') - ->remove('WIPCount,noLimit') - ->get(); + $column = fixer::input('post')->remove('WIPCount,noLimit')->get(); + if(!preg_match("/^-?\d+$/", $column->limit)) + { + dao::$errors['limit'] = $this->lang->kanban->error->mustBeInt; + return false; + } /* Check column limit. */ $sumChildLimit = 0;