* finish task #43339.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* The todo activate entry point of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package entries
|
||||
* @version 1
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class todoActivateEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* GET method.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function get($todoID)
|
||||
{
|
||||
$control = $this->loadController('todo', 'activate');
|
||||
$control->activate($todoID);
|
||||
|
||||
$data = $this->getData();
|
||||
if($data->status == 'fail') return $this->sendError(400, $data->message);
|
||||
|
||||
$todo = $this->loadModel('todo')->getByID($todoID);
|
||||
$this->send(200, $this->format($todo, 'assignedDate:time,finishedDate:time,closedDate:time'));
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -63,9 +63,10 @@ $routes['/projects/:projectID/issues'] = 'issues';
|
||||
$routes['/issues'] = 'issues';
|
||||
$routes['/issues/:issueID'] = 'issue';
|
||||
|
||||
$routes['/todos'] = 'todos';
|
||||
$routes['/todos/:id'] = 'todo';
|
||||
$routes['/todos/:id/finish'] = 'todoFinish';
|
||||
$routes['/todos'] = 'todos';
|
||||
$routes['/todos/:id'] = 'todo';
|
||||
$routes['/todos/:id/finish'] = 'todoFinish';
|
||||
$routes['/todos/:id/activate'] = 'todoActivate';
|
||||
|
||||
$routes['/projects/:projectID/builds'] = 'builds';
|
||||
$routes['/builds'] = 'builds';
|
||||
|
||||
@@ -312,6 +312,7 @@ class todo extends control
|
||||
{
|
||||
$todo = $this->todo->getById($todoID);
|
||||
if($todo->status == 'done' or $todo->status == 'closed') $this->todo->activate($todoID);
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success'));
|
||||
if(isonlybody()) die(js::reload('parent.parent'));
|
||||
die(js::reload('parent'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user