- | id; ?> |
+
+
+
+
+ id; ?>
+ |
date == '2030-01-01' ? $lang->todo->dayInFuture : $todo->date;?> |
todo->typeList->{$todo->type};?> |
pri;?> |
@@ -82,15 +87,9 @@
createLink('todo', 'batchEdit', "from=myTodo&type=$type&account=$account&status=$status");
- echo html::commonButton($lang->todo->batchEdit, "onclick=\"changeAction('todoform', 'batchEdit', '$actionLink')\"");
-
- }
if(common::hasPriv('todo', 'import2Today') and $importFuture)
{
+ echo html::selectAll() . html::selectReverse();
$actionLink = $this->createLink('todo', 'import2Today');
echo html::commonButton($lang->todo->import2Today, "onclick=\"changeAction('todoform', 'import2Today', '$actionLink')\"");
}
diff --git a/module/todo/control.php b/module/todo/control.php
index 8f967cc1a6..a2f8ebc8e6 100644
--- a/module/todo/control.php
+++ b/module/todo/control.php
@@ -123,89 +123,6 @@ class todo extends control
$this->display();
}
- /**
- * Batch edit todo.
- *
- * @param string $from example:myTodo, todoBatchEdit.
- * @param string $type
- * @param string $account
- * @param string $status
- * @access public
- * @return void
- */
- public function batchEdit($from = '', $type = 'today', $account = '', $status = 'all')
- {
- /* Get form data for my-todo. */
- if($from == 'myTodo')
- {
- /* Initialize vars. */
- $editedTodos = array();
- $todoIDList = array();
- $columns = 7;
- $showSuhosinInfo = false;
-
- if($account == '') $account = $this->app->user->account;
- $bugs = $this->bug->getUserBugPairs($account);
- $tasks = $this->task->getUserTaskPairs($account, $status);
- $allTodos = $this->todo->getList($type, $account, $status);
- if($this->post->todoIDList) $todoIDList = $this->post->todoIDList;
-
- /* Initialize todos whose need to edited. */
- foreach($allTodos as $todo)
- {
- if(in_array($todo->id, $todoIDList))
- {
- $editedTodos[$todo->id] = $todo;
- }
- }
- foreach($editedTodos as $todo)
- {
- if($todo->type == 'task') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_TASK)->fetch('name');
- if($todo->type == 'bug') $todo->name = $this->dao->findById($todo->idvalue)->from(TABLE_BUG)->fetch('title');
- $todo->date = str_replace('-', '', $todo->date);
- $todo->begin = str_replace(':', '', $todo->begin);
- $todo->end = str_replace(':', '', $todo->end);
- }
-
- /* Judge whether the edited todos is too large. */
- $showSuhosinInfo = $this->loadModel('common')->judgeSuhosinSetting(count($editedTodos), $columns);
-
- /* Set the sessions. */
- $this->app->session->set('showSuhosinInfo', $showSuhosinInfo);
-
- /* Assign. */
- $header['title'] = $this->lang->my->common . $this->lang->colon . $this->lang->todo->batchEdit;
- $position[] = $this->lang->todo->common;
- $position[] = $this->lang->todo->batchEdit;
-
- if($showSuhosinInfo) $this->view->suhosinInfo = $this->lang->suhosinInfo;
- $this->view->bugs = $bugs;
- $this->view->tasks = $tasks;
- $this->view->editedTodos = $editedTodos;
- $this->view->times = $this->todo->buildTimeList($this->config->todo->times->begin, $this->config->todo->times->end, $this->config->todo->times->delta);
- $this->view->time = $this->todo->now();
- $this->view->header = $header;
- $this->view->position = $position;
-
- $this->display();
- }
- /* Get form data from todo-batchEdit. */
- elseif($from == 'todoBatchEdit')
- {
- $allChanges = $this->todo->batchUpdate();
- foreach($allChanges as $todoID => $changes)
- {
- if(!empty($changes))
- {
- $actionID = $this->loadModel('action')->create('todo', $todoID, 'edited');
- $this->action->logHistory($actionID, $changes);
- }
- }
-
- die(js::locate($this->session->todoList, 'parent'));
- }
- }
-
/**
* View a todo.
*
diff --git a/module/todo/lang/en.php b/module/todo/lang/en.php
index 369dc5bbfe..34591c0474 100644
--- a/module/todo/lang/en.php
+++ b/module/todo/lang/en.php
@@ -13,7 +13,6 @@ $lang->todo->common = 'TODO';
$lang->todo->index = "Index";
$lang->todo->create = "Create";
$lang->todo->batchCreate = "Batch create";
-$lang->todo->batchEdit = "Batch edit";
$lang->todo->edit = "Edit";
$lang->todo->view = "Info";
$lang->todo->viewAB = "Info";
diff --git a/module/todo/lang/zh-cn.php b/module/todo/lang/zh-cn.php
index 5bfc659b19..732e03744f 100644
--- a/module/todo/lang/zh-cn.php
+++ b/module/todo/lang/zh-cn.php
@@ -13,7 +13,6 @@ $lang->todo->common = 'TODO';
$lang->todo->index = "todo一览";
$lang->todo->create = "新增TODO";
$lang->todo->batchCreate = "批量添加";
-$lang->todo->batchEdit = "批量编辑";
$lang->todo->edit = "更新TODO";
$lang->todo->view = "TODO详情";
$lang->todo->viewAB = "详情";
diff --git a/module/todo/model.php b/module/todo/model.php
index ce35100cef..23dd59f57a 100644
--- a/module/todo/model.php
+++ b/module/todo/model.php
@@ -120,65 +120,6 @@ class todoModel extends model
if(!dao::isError()) return common::createChanges($oldTodo, $todo);
}
- /**
- * Batch update todo.
- *
- * @access public
- * @return void
- */
- public function batchUpdate()
- {
- $todos = array();
- $allChanges = array();
- $todoIDList = $this->post->todoIDList ? $this->post->todoIDList : array();
-
- /* Adjust whether the post data is complete, if not, remove the last element of $todoIDList. */
- if($this->session->showSuhosinInfo) array_pop($taskIDList);
-
- if(!empty($todoIDList))
- {
- /* Initialize todos from the post data. */
- foreach($todoIDList as $todoID)
- {
- $todo->date = $this->post->dates[$todoID];
- $todo->type = $this->post->types[$todoID];
- $todo->pri = $this->post->pris[$todoID];
- $todo->name = $todo->type == 'custom' ? htmlspecialchars($this->post->names[$todoID]) : '';
- $todo->begin = $this->post->begins[$todoID];
- $todo->end = $this->post->ends[$todoID];
- if($todo->type == 'task') $todo->idvalue = isset($this->post->tasks[$todoID]) ? $this->post->tasks[$todoID] : 0;
- if($todo->type == 'bug') $todo->idvalue = isset($this->post->bugs[$todoID]) ? $this->post->bugs[$todoID] : 0;
-
- $todos[$todoID] = $todo;
- unset($todo);
- }
-
- foreach($todos as $todoID => $todo)
- {
- $oldTodo = $this->getById($todoID);
- if($oldTodo->type != 'custom') $oldTodo->name = '';
- $this->dao->update(TABLE_TODO)->data($todo)
- ->autoCheck()
- ->checkIF($todo->type == 'custom', $this->config->todo->edit->requiredFields, 'notempty')
- ->checkIF($todo->type == 'bug', 'idvalue', 'notempty')
- ->checkIF($todo->type == 'task', 'idvalue', 'notempty')
- ->where('id')->eq($todoID)
- ->exec();
-
- if(!dao::isError())
- {
- $allChanges[$todoID] = common::createChanges($oldTodo, $todo);
- }
- else
- {
- die(js::error('todo#' . $todoID . dao::getError(true)));
- }
- }
- }
-
- return $allChanges;
- }
-
/**
* Change the status of a todo.
*
diff --git a/module/todo/view/batchedit.html.php b/module/todo/view/batchedit.html.php
deleted file mode 100755
index 89fdf481be..0000000000
--- a/module/todo/view/batchedit.html.php
+++ /dev/null
@@ -1,62 +0,0 @@
-
- * @package todo
- * @version $Id: create.html.php 2741 2012-04-07 07:24:21Z areyou123456 $
- * @link http://www.zentao.net
- */
-?>
-
-
-
-
-
|