From e547a244ce864f1e386dda23fdbea7afc688d8e2 Mon Sep 17 00:00:00 2001 From: "chencongzhi520@gmail.com" Date: Wed, 29 Aug 2012 09:22:43 +0000 Subject: [PATCH] * finish task#892. --- module/todo/control.php | 3 ++- module/todo/js/batchcreate.js | 1 + module/todo/view/batchcreate.html.php | 9 ++++++--- module/todo/view/footer.html.php | 24 ++++++++++++++++++++++-- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/module/todo/control.php b/module/todo/control.php index b313544029..16350c9f04 100644 --- a/module/todo/control.php +++ b/module/todo/control.php @@ -73,7 +73,8 @@ class todo extends control if(dao::isError()) die(js::error(dao::getError())); /* Locate the browser. */ - die(js::locate($this->createLink('my', 'todo', "date={$this->post->date}"), 'parent')); + $date = str_replace('-', '', $this->post->date); + die(js::locate($this->createLink('my', 'todo', "date=$date"), 'parent')); } $header['title'] = $this->lang->my->common . $this->lang->colon . $this->lang->todo->create; diff --git a/module/todo/js/batchcreate.js b/module/todo/js/batchcreate.js index 44cb770b6d..628839fd7c 100644 --- a/module/todo/js/batchcreate.js +++ b/module/todo/js/batchcreate.js @@ -12,6 +12,7 @@ function updateAction(date) link = createLink('todo', 'batchCreate', 'date=' + date); location.href=link; } + $(function(){ var endDate = new Date('2222', '1', '1'); $("#date").datePicker({ diff --git a/module/todo/view/batchcreate.html.php b/module/todo/view/batchcreate.html.php index a7d59f3e65..756be7b45a 100755 --- a/module/todo/view/batchcreate.html.php +++ b/module/todo/view/batchcreate.html.php @@ -35,8 +35,8 @@
*";?>
- - + + @@ -48,4 +48,7 @@ - + diff --git a/module/todo/view/footer.html.php b/module/todo/view/footer.html.php index 7498e905a9..637c0159fd 100644 --- a/module/todo/view/footer.html.php +++ b/module/todo/view/footer.html.php @@ -49,8 +49,28 @@ function loadList(type, id) function selectNext() { - endIndex = $("#begin ").get(0).selectedIndex + 2; - $("#end ").get(0).selectedIndex = endIndex; + $("#end ").get(0).selectedIndex = $("#begin ").get(0).selectedIndex + 2; +} + +function setBeginsAndEnds(i) +{ + if(typeof i == 'undefined') + { + for(j = 0; j < batchCreateNum; j++) + { + endIndex = $("#begins" + j).get(0).selectedIndex + 2; + $("#ends" + j).get(0).selectedIndex = endIndex; + } + } + else + { + begin = $("#begins" + i).val(); + for(j = i; j < batchCreateNum; j++) + { + $("#begins" + j).val(begin); + $("#ends" + j).get(0).selectedIndex = $("#begins" + i).get(0).selectedIndex + 2; + } + } } function switchDateFeature(switcher)