* Merge 18.4 todo module.

This commit is contained in:
hufangzhou
2023-11-20 14:21:34 +08:00
parent c67bc17de3
commit 8002a79e66
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -332,6 +332,16 @@ class todo extends control
{
if($confirm == 'no') return $this->send(array('result' => 'success', 'load' => array('confirm' => $this->lang->todo->confirmDelete, 'confirmed' => $this->createLink('todo', 'delete', "todoID={$todoID}&confirm=yes"), 'canceled' => $this->session->todoList ? $this->session->todoList : $this->createLink('my', 'todo'))));
$todo = $this->todo->getByID($todoID);
$allowDelete = true;
if(!$this->app->user->admin && $todo && $todo->account != $this->app->user->account && $todo->assignedTo != $this->app->user->account) $allowDelete = false;
if(!$allowDelete)
{
if(isonlybody()) return print(js::alert($this->lang->error->accessDenied));
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => $this->lang->error->accessDenied));
if(helper::isAjaxRequest()) return $this->send(array('result' => 'fail', 'message' => $this->lang->error->accessDenied));
}
$this->todo->delete(TABLE_TODO, $todoID);
if(helper::isAjaxRequest())
+1
View File
@@ -104,6 +104,7 @@ function loadList(type, id, todoDefaultType, objectID)
id = id ? id : '';
var param = 'userID=' + userID + '&id=' + id;
if(type == 'task') param += '&status=wait,doing';
if(type == 'risk') param += '&status=active,hangup';
if(todoDefaultType && type == todoDefaultType && objectID != 0) param += '&objectID=' + objectID;