From 2b89c9f5f6ea10c87c3cb5706f67bb075f749214 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Tue, 11 Feb 2020 17:58:46 +0800 Subject: [PATCH] complete task #6886,#6884,#6882,#6880. --- module/my/control.php | 8 +++++--- module/productplan/view/batchedit.html.php | 4 ++-- module/project/model.php | 2 +- module/search/model.php | 5 ++--- module/todo/control.php | 19 +++++++------------ module/todo/lang/zh-cn.php | 1 + module/todo/lang/zh-tw.php | 1 + 7 files changed, 19 insertions(+), 21 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 1f72c3595c..b080304914 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -182,10 +182,12 @@ class my extends control if($this->app->getViewType() == 'mhtml') $recPerPage = 10; $pager = pager::init($recTotal, $recPerPage, $pageID); - /* Append id for secend sort. */ + /* append id for secend sort. */ $sort = $this->loadModel('common')->appendOrder($orderBy); - $this->loadModel('product'); - + + /* Get the story language configuration. */ + $this->app->loadLang('story'); + /* Assign. */ $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->task; $this->view->position[] = $this->lang->my->task; diff --git a/module/productplan/view/batchedit.html.php b/module/productplan/view/batchedit.html.php index 779e96b6fe..36fa9ff1af 100644 --- a/module/productplan/view/batchedit.html.php +++ b/module/productplan/view/batchedit.html.php @@ -30,8 +30,8 @@ - begin == '2030-01-01' || $plan->end == '2030-01-01') ? 'form-input-hidden' : 'form-input-show';?> - begin == '2030-01-01' || $plan->end == '2030-01-01') ? 'form-input-show' : 'form-input-hidden';?> + begin == '2030-01-01' || $plan->end == '2030-01-01') ? 'form-input-hidden' : 'form-input-show';?> + begin == '2030-01-01' || $plan->end == '2030-01-01') ? 'form-input-show' : 'form-input-hidden';?> begin == '2030-01-01' || $plan->end == '2030-01-01') ? 'checked="checked"' : '';?> id . html::hidden("id[$plan->id]", $plan->id);?> diff --git a/module/project/model.php b/module/project/model.php index 5de6d2bf8d..6c9f54aa56 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -1044,7 +1044,7 @@ class projectModel extends model $delay = helper::diffDate(helper::today(), $project->end); if($delay > 0) $project->delay = $delay; } - /* Fix bug #2943. */ + $total = $this->dao->select(' SUM(estimate) AS totalEstimate, SUM(consumed) AS totalConsumed, diff --git a/module/search/model.php b/module/search/model.php index 0c1dc796aa..19c558fbf9 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -153,15 +153,14 @@ class searchModel extends model $condition = $operator . ' ' . $this->dbh->quote($value) . ' '; } - /* Set filed name. */ + /* Processing query criteria. */ if($operator == '=' and preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value)) { $condition = '`' . $this->post->$fieldName . "` >= '$value' AND `" . $this->post->$fieldName . "` <= '$value 23:59:59'"; $where .= " $andOr ($condition)"; } - elseif ($operator == '<=' and preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value)) + elseif($operator == '<=' and preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value)) { - /* Fix bug #2896. */ $where .= " $andOr " . '`' . $this->post->$fieldName . "` <= '$value 23:59:59'"; } elseif($condition) diff --git a/module/todo/control.php b/module/todo/control.php index bffd80c9fc..dde5d46942 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -448,20 +448,15 @@ class todo extends control */ public function batchClose() { - if(!empty($_POST['todoIDList'])) + $waitID = array(); + foreach($_POST['todoIDList'] as $todoID) { - $waitID = array(); - $todoIDList = array(); - foreach($_POST['todoIDList'] as $todoID) - { - $todo = $this->todo->getById($todoID); - ($todo->status != 'done' && $todo->status != 'closed') ? $waitID[] = $todoID : $todoIDList[] = $todoID; - } - if(!empty($waitID)) die(js::execute('alert("ID: ' .implode(',', $waitID). '的待办处于未完成状态。");')); - - foreach($todoIDList as $todoID) $this->todo->close($todoID); - die(js::reload('parent')); + $todo = $this->todo->getById($todoID); + ($todo->status == 'done') ? $this->todo->close($todoID) : $waitID[] = $todoID; } + if(!empty($waitID)) die(js::alert('ID: ' . implode(',', $waitID) . $this->lang->todo->unfinishedTodo)); + + die(js::reload('parent')); } /** diff --git a/module/todo/lang/zh-cn.php b/module/todo/lang/zh-cn.php index 4c090f8688..0df898c051 100644 --- a/module/todo/lang/zh-cn.php +++ b/module/todo/lang/zh-cn.php @@ -102,6 +102,7 @@ $lang->todo->lblBeforeDays = "提前%s天生成待办"; $lang->todo->lblClickCreate = "点击添加待办"; $lang->todo->noTodo = '该类型没有待办事务'; $lang->todo->noAssignedTo = '被指派人不能为空'; +$lang->todo->unfinishedTodo = ' 待办处于未完成状态。'; $lang->todo->periods['all'] = '所有待办'; $lang->todo->periods['thisYear'] = '本年'; diff --git a/module/todo/lang/zh-tw.php b/module/todo/lang/zh-tw.php index ae6a302037..a7731750df 100644 --- a/module/todo/lang/zh-tw.php +++ b/module/todo/lang/zh-tw.php @@ -102,6 +102,7 @@ $lang->todo->lblBeforeDays = "提前%s天生成待辦"; $lang->todo->lblClickCreate = "點擊添加待辦"; $lang->todo->noTodo = '該類型沒有待辦事務'; $lang->todo->noAssignedTo = '被指派人不能為空'; +$lang->todo->unfinishedTodo = ' 待辦處於未完成狀態。'; $lang->todo->periods['all'] = '所有待辦'; $lang->todo->periods['thisYear'] = '本年';