* Refactored update swimlane code.
This commit is contained in:
+19
-13
@@ -801,10 +801,11 @@ class task extends control
|
||||
* Start a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function start($taskID)
|
||||
public function start($taskID, $extra = '')
|
||||
{
|
||||
$this->commonAction($taskID);
|
||||
|
||||
@@ -813,7 +814,7 @@ class task extends control
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->task->start($taskID);
|
||||
$changes = $this->task->start($taskID, $extra);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
@@ -967,17 +968,18 @@ class task extends control
|
||||
* Finish a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function finish($taskID)
|
||||
public function finish($taskID, $extra = '')
|
||||
{
|
||||
$this->commonAction($taskID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->task->finish($taskID);
|
||||
$changes = $this->task->finish($taskID, $extra);
|
||||
if(dao::isError())
|
||||
{
|
||||
if($this->viewType == 'json' or (defined('RUN_MODE') && RUN_MODE == 'api')) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
@@ -1053,17 +1055,18 @@ class task extends control
|
||||
* Pause task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function pause($taskID)
|
||||
public function pause($taskID, $extra = '')
|
||||
{
|
||||
$this->commonAction($taskID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->task->pause($taskID);
|
||||
$changes = $this->task->pause($taskID, $extra);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
@@ -1129,18 +1132,19 @@ class task extends control
|
||||
/**
|
||||
* Close a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param int $taskID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function close($taskID)
|
||||
public function close($taskID, $extra = '')
|
||||
{
|
||||
$this->commonAction($taskID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->task->close($taskID);
|
||||
$changes = $this->task->close($taskID, $extra);
|
||||
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
@@ -1261,17 +1265,18 @@ class task extends control
|
||||
* Cancel a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function cancel($taskID)
|
||||
public function cancel($taskID, $extra = '')
|
||||
{
|
||||
$this->commonAction($taskID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->task->cancel($taskID);
|
||||
$changes = $this->task->cancel($taskID, $extra);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
@@ -1297,17 +1302,18 @@ class task extends control
|
||||
* Activate a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function activate($taskID)
|
||||
public function activate($taskID, $extra = '')
|
||||
{
|
||||
$this->commonAction($taskID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$changes = $this->task->activate($taskID);
|
||||
$changes = $this->task->activate($taskID, $extra);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
|
||||
Reference in New Issue
Block a user