From 9b7eb2f9c4bea2b1e759106bc0a4f80e2b7d3d76 Mon Sep 17 00:00:00 2001 From: xia0ta0 Date: Tue, 17 Jun 2014 17:19:15 +0800 Subject: [PATCH] * code for task#1889. --- module/todo/js/batchcreate.js | 14 ++++++++++++++ module/todo/model.php | 4 ++-- module/todo/view/batchcreate.html.php | 3 ++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/module/todo/js/batchcreate.js b/module/todo/js/batchcreate.js index 6ae7cda750..a0e22a5f00 100644 --- a/module/todo/js/batchcreate.js +++ b/module/todo/js/batchcreate.js @@ -12,3 +12,17 @@ function updateAction(date) link = createLink('todo', 'batchCreate', 'date=' + date); location.href=link; } + +function switchDateList(number) +{ + if($('#switchDate' + number).attr('checked') == 'checked') + { + $('#begins' + number).attr('disabled', 'disabled'); + $('#ends' + number).attr('disabled', 'disabled'); + } + else + { + $('#begins' + number).removeAttr('disabled'); + $('#ends' + number).removeAttr('disabled'); + } +} diff --git a/module/todo/model.php b/module/todo/model.php index a96a4928b1..31e8b3b4ef 100644 --- a/module/todo/model.php +++ b/module/todo/model.php @@ -71,8 +71,8 @@ class todoModel extends model $todo->pri = $todos->pris[$i]; $todo->name = isset($todos->names[$i]) ? htmlspecialchars($todos->names[$i]) : ''; $todo->desc = htmlspecialchars($todos->descs[$i]); - $todo->begin = $todos->begins[$i]; - $todo->end = $todos->ends[$i]; + $todo->begin = isset($todos->begins[$i]) ? $todos->begins[$i] : 2400; + $todo->end = isset($todos->ends[$i]) ? $todos->ends[$i] : 2400; $todo->status = "wait"; $todo->private = 0; $todo->idvalue = 0; diff --git a/module/todo/view/batchcreate.html.php b/module/todo/view/batchcreate.html.php index 38f9a9b7f7..9dccb7c257 100755 --- a/module/todo/view/batchcreate.html.php +++ b/module/todo/view/batchcreate.html.php @@ -32,7 +32,7 @@ todo->pri;?> todo->name;?> todo->desc;?> - todo->beginAndEnd;?> + todo->beginAndEnd;?> @@ -49,6 +49,7 @@
+ todo->periods['future'];?>