Merge branch 'Zentao_app1.1'
This commit is contained in:
@@ -92,7 +92,7 @@ class bugEntry extends entry
|
||||
$oldBug = $this->loadModel('bug')->getByID($bugID);
|
||||
|
||||
/* Set $_POST variables. */
|
||||
$fields = 'title,project,execution,openedBuild,assignedTo,pri,severity,type,story,resolvedBy,closedBy,resolution,product,plan,task,module,steps';
|
||||
$fields = 'title,project,execution,openedBuild,assignedTo,pri,severity,type,story,resolvedBy,closedBy,resolution,product,plan,task,module,steps,mailto,keywords';
|
||||
$this->batchSetPost($fields, $oldBug);
|
||||
$this->setPost('notifyEmail', implode(',', $this->request('notifyEmail', array())));
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class bugsEntry extends entry
|
||||
if(!$productID and isset($this->requestBody->product)) $productID = $this->requestBody->product;
|
||||
if(!$productID) return $this->sendError(400, 'Need product id.');
|
||||
|
||||
$fields = 'title,project,execution,openedBuild,assignedTo,pri,severity,type,story';
|
||||
$fields = 'title,project,execution,openedBuild,assignedTo,pri,severity,type,story,task,mailto,keywords,steps';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$this->setPost('product', $productID);
|
||||
|
||||
@@ -21,7 +21,6 @@ class buildsEntry extends entry
|
||||
public function get($projectID = 0)
|
||||
{
|
||||
if(empty($projectID)) $projectID = $this->param('project', 0);
|
||||
if(empty($projectID)) return $this->sendError(400, "Need project id.");
|
||||
|
||||
$control = $this->loadController('project', 'build');
|
||||
$control->build($projectID, $this->param('type', 'all'), $this->param('param', 0), $this->param('order', 't1.date_desc,t1.id_desc'));
|
||||
|
||||
@@ -20,7 +20,8 @@ class executionEntry extends Entry
|
||||
*/
|
||||
public function get($executionID)
|
||||
{
|
||||
$fields = $this->param('fields');
|
||||
$fields = $this->param('fields');
|
||||
$productID = $this->param('productID');
|
||||
|
||||
$control = $this->loadController('execution', 'view');
|
||||
$control->view($executionID);
|
||||
@@ -63,14 +64,8 @@ class executionEntry extends Entry
|
||||
{
|
||||
switch($field)
|
||||
{
|
||||
case 'modules':
|
||||
$control = $this->loadController('tree', 'browsetask');
|
||||
$control->browsetask($executionID);
|
||||
$data = $this->getData();
|
||||
if(isset($data->status) and $data->status == 'success')
|
||||
{
|
||||
$execution->modules = $data->data->tree;
|
||||
}
|
||||
case 'builds':
|
||||
$execution->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,noterminate,nodone', $executionID, 'execution');
|
||||
break;
|
||||
case 'moduleoptionmenu':
|
||||
$execution->moduleOptionMenu = $this->loadModel('tree')->getTaskOptionMenu($executionID, 0, 0, 'allModule');
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* The execution cases 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 executionMembersEntry extends entry
|
||||
{
|
||||
public function get($executionID = 0)
|
||||
{
|
||||
if(!$executionID) $executionID = $this->param('execution', 0);
|
||||
if(empty($executionID)) return $this->sendError(400, 'Need execution id.');
|
||||
$members = $this->loadModel('execution')->getTeamMembers($executionID);
|
||||
if(isset($members))
|
||||
{
|
||||
foreach($members as $member) $result[] = $this->format($member, 'join:date');
|
||||
}
|
||||
return $this->send(200, array('members' => $result));
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@ class executionStoriesEntry extends entry
|
||||
$result = array();
|
||||
foreach($stories as $story)
|
||||
{
|
||||
$story->name =$story->title;
|
||||
$result[] = $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList');
|
||||
}
|
||||
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'stories' => $result));
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* The module 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 moduleStoriesEntry extends Entry
|
||||
{
|
||||
public function get($moduleID)
|
||||
{
|
||||
$executionID = $this->param('executionID', 0);
|
||||
if(empty($executionID)) return $this->sendError(400, 'Need execution id.');
|
||||
$control = $this->loadController('story', 'ajaxGetExecutionStories');
|
||||
$control->ajaxGetExecutionStories($executionID, $this->param('productID', 0), $this->param('branchID', 0), $moduleID);
|
||||
|
||||
$data = $this->getData();
|
||||
$this->loadModel('story');
|
||||
$result = [];
|
||||
foreach($data as $storyID => $storyName)
|
||||
{
|
||||
if(empty($storyID)) continue;
|
||||
$story = $this->story->getById($storyID);
|
||||
$result[] = $this->filterFields($story, 'id,title,module,pri,status,stage,estimate');
|
||||
}
|
||||
return $this->send(200, array('stories' => $result));
|
||||
}
|
||||
}
|
||||
@@ -51,9 +51,16 @@ class productEntry extends Entry
|
||||
$product->modules = $data->data->tree;
|
||||
}
|
||||
break;
|
||||
case 'moduleoptionmenu':
|
||||
$product->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'bug', 0, 'all');
|
||||
break;
|
||||
case 'builds':
|
||||
$product->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,noterminate,nodone,withbranch');
|
||||
break;
|
||||
case 'actions':
|
||||
$product->addComment = common::hasPriv('action', 'comment') ? true : false;
|
||||
|
||||
$users = $this->loadModel('user')->getPairs();
|
||||
$actions = $data->data->actions;
|
||||
$product->actions = $this->loadModel('action')->processActionForAPI($actions, $users, $this->lang->product);
|
||||
break;
|
||||
|
||||
@@ -36,6 +36,7 @@ class productplansEntry extends entry
|
||||
|
||||
foreach($plans as $plan)
|
||||
{
|
||||
$plan->name = $plan->title;
|
||||
if($plan->parent > 0 and isset($result[$plan->parent]))
|
||||
{
|
||||
$parentPlan = $result[$plan->parent];
|
||||
|
||||
@@ -35,6 +35,7 @@ class storiesEntry extends entry
|
||||
$result = array();
|
||||
foreach($stories as $story)
|
||||
{
|
||||
$story->name =$story->title;
|
||||
if(isset($story->children)) $story->children = array_values((array)$story->children);
|
||||
$result[] = $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList');
|
||||
}
|
||||
@@ -54,7 +55,7 @@ class storiesEntry extends entry
|
||||
if(!$productID and isset($this->requestBody->product)) $productID = $this->requestBody->product;
|
||||
if(!$productID) return $this->sendError(400, 'Need product id.');
|
||||
|
||||
$fields = 'title,spec,verify,reviewer,type,plan,module,source,sourceNote,category,pri,estimate';
|
||||
$fields = 'title,spec,verify,reviewer,type,plan,module,moduleOptionMenu,source,sourceNote,category,pri,estimate,mailto,keywords';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
/* If reviewer is not post, set needNotReview. */
|
||||
|
||||
@@ -95,14 +95,19 @@ class storyEntry extends Entry
|
||||
$oldStory = $this->loadModel('story')->getByID($storyID);
|
||||
|
||||
/* Set $_POST variables. */
|
||||
$fields = 'type';
|
||||
$fields = 'title,product,reviewer,type,plan,module,source,sourceNote,category,pri,estimate,mailto,keywords';
|
||||
$this->batchSetPost($fields, $oldStory);
|
||||
$this->setPost('parent', 0);
|
||||
|
||||
$control = $this->loadController('story', 'edit');
|
||||
$control->edit($storyID);
|
||||
|
||||
$this->getData();
|
||||
|
||||
$data = $this->getData();
|
||||
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
|
||||
if(!isset($data->status)) return $this->sendError(400, 'error');
|
||||
|
||||
$story = $this->story->getByID($storyID);
|
||||
$this->send(200, $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* The bug change 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 storyActiveEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function post($storyID)
|
||||
{
|
||||
$oldStory = $this->loadModel('story')->getByID($storyID);
|
||||
|
||||
$fields = 'assignedTo,status,comment';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$control = $this->loadController('story', 'activate');
|
||||
|
||||
$control->activate($storyID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data or !isset($data->status)) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$story = $this->loadModel('story')->getByID($storyID);
|
||||
|
||||
$this->send(200, $story);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* The story assignto 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 storyAssignToEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function post($storyID)
|
||||
{
|
||||
$task = $this->loadModel('story')->getByID($storyID);
|
||||
|
||||
$fields = 'assignedTo';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$control = $this->loadController('story', 'assignTo');
|
||||
$control->assignTo($storyID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$story = $this->story->getByID($storyID);
|
||||
|
||||
$this->send(200, $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class storyChangeEntry extends Entry
|
||||
}
|
||||
|
||||
$control = $this->loadController('story', 'change');
|
||||
$this->requireFields('title,spec,verify');
|
||||
$this->requireFields('title');
|
||||
|
||||
$control->change($storyID);
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* The story component 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 storyChildEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
**/
|
||||
public function post($storyID)
|
||||
{
|
||||
$fields = 'title,spec,verify,reviewer,type,plan,module,moduleOptionMenu,source,sourceNote,category,pri,estimate,keywords,parent';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$fields = explode(',', $fields);
|
||||
foreach($fields as $field) $this->setArrayPost($field);
|
||||
$story = $this->loadModel('story')->getById($storyID);
|
||||
|
||||
$control = $this->loadController('story', 'batchCreate');
|
||||
$control->batchCreate($story->product, 0, 0, $storyID);
|
||||
|
||||
$data = $this->getData();
|
||||
|
||||
$story = $this->story->getById($data->idList[0]);
|
||||
$this->send(200, $this->format($story, 'deadline:date,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,realStarted:time,finishedBy:user,finishedDate:time,closedBy:user,closedDate:time,canceledBy:user,canceledDate:time,lastEditedBy:user,lastEditedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
|
||||
public function setArrayPost($field)
|
||||
{
|
||||
$_POST[$field] = array('0' => $_POST[$field]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* The story close 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 storyCloseEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function post($storyID)
|
||||
{
|
||||
$story = $this->loadModel('story')->getByID($storyID);
|
||||
|
||||
$fields = 'closedReason,duplicateStory,childStories,comment';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$control = $this->loadController('story', 'close');
|
||||
$control->close($storyID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$story = $this->story->getByID($storyID);
|
||||
|
||||
$this->send(200, $this->format($story, 'openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,reviewedBy:user,reviewedDate:time,lastEditedBy:user,lastEditedDate:time,closedBy:user,closedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ class tabsEntry extends baseEntry
|
||||
|
||||
foreach($tabs as $menuKey)
|
||||
{
|
||||
if(!isset($this->lang->my->$menuKey)) continue;
|
||||
if(!common::hasPriv('my', $menuKey)) continue;
|
||||
$label = $this->lang->my->$menuKey;
|
||||
if($menuKey == 'calendar') $label = $this->lang->my->calendarAction;
|
||||
|
||||
@@ -102,13 +102,14 @@ class taskEntry extends Entry
|
||||
$oldTask = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
/* Set $_POST variables. */
|
||||
$fields = 'name,type,assignedTo,estimate,left,consumed,story,parent,execution,module,closedReason,status,estStarted,deadline';
|
||||
$fields = 'name,type,desc,assignedTo,pri,estimate,left,consumed,story,parent,execution,module,closedReason,status,estStarted,deadline,team,teamEstimate,multiple,mailto';
|
||||
$this->batchSetPost($fields, $oldTask);
|
||||
|
||||
$control = $this->loadController('task', 'edit');
|
||||
$control->edit($taskID);
|
||||
|
||||
$this->getData();
|
||||
$data = $this->getData();
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
$task = $this->task->getByID($taskID);
|
||||
$this->send(200, $this->format($task, 'deadline:date,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,realStarted:time,finishedBy:user,finishedDate:time,closedBy:user,closedDate:time,canceledBy:user,canceledDate:time,lastEditedBy:user,lastEditedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* The task close 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 taskCloseEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function post($taskID)
|
||||
{
|
||||
$task = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
$fields = 'comment';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$control = $this->loadController('task', 'close');
|
||||
$control->close($taskID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$task = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
$this->send(200, $task);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* The task component 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 taskComponentEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function post($taskID)
|
||||
{
|
||||
$fields = 'name,type,assignedTo,parent,estimate,story,module,pri,desc,estStarted,deadline';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$fields = explode(',', $fields);
|
||||
foreach($fields as $field) $this->setArrayPost($field);
|
||||
$task = $this->loadModel('task')->getById($taskID);
|
||||
|
||||
$control = $this->loadController('task', 'batchCreate');
|
||||
$control->batchCreate($task->execution, 0, 0, $taskID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$task = $this->task->getById($data->idList[0]);
|
||||
$this->send(200, $this->format($task, 'deadline:date,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,realStarted:time,finishedBy:user,finishedDate:time,closedBy:user,closedDate:time,canceledBy:user,canceledDate:time,lastEditedBy:user,lastEditedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
|
||||
public function setArrayPost($field)
|
||||
{
|
||||
$_POST[$field] = array('0' => $_POST[$field]);
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ class taskFinishEntry extends Entry
|
||||
$control->finish($taskID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data or !isset($data->status)) return $this->send400('error');
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$task = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* The task pause 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 taskPauseEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function post($taskID)
|
||||
{
|
||||
$task = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
$fields = 'comment';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$control = $this->loadController('task', 'pause');
|
||||
$control->pause($taskID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$task = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
$this->send(200, $task);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* The task recordEstimate 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 taskRecordEstimateEntry extends Entry
|
||||
{
|
||||
/**
|
||||
* POST method.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function post($taskID)
|
||||
{
|
||||
if($this->config->edition != 'open')
|
||||
{
|
||||
$fields = 'id,dates,consumed,left,objectType,objectID,work';
|
||||
$this->batchSetPost($fields);
|
||||
$control = $this->loadController('effort', 'createForObject');
|
||||
$control->createForObject('task', $taskID);
|
||||
}
|
||||
else
|
||||
{
|
||||
$fields = 'id,dates,consumed,left,work';
|
||||
$this->batchSetPost($fields);
|
||||
$control = $this->loadController('task', 'recordEstimate');
|
||||
$control->recordEstimate($taskID);
|
||||
}
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$task = $this->loadModel('task')->getById($taskID);
|
||||
$this->send(200, $this->format($task, 'deadline:date,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,realStarted:time,finishedBy:user,finishedDate:time,closedBy:user,closedDate:time,canceledBy:user,canceledDate:time,lastEditedBy:user,lastEditedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ class taskStartEntry extends Entry
|
||||
{
|
||||
$task = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
$fields = 'assignedTo,realStarted,comment,left';
|
||||
$fields = 'assignedTo,realStarted,consumed,left,comment';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$control = $this->loadController('task', 'start');
|
||||
@@ -30,7 +30,7 @@ class taskStartEntry extends Entry
|
||||
$control->start($taskID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data or !isset($data->status)) return $this->send400('error');
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$task = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
+24
-12
@@ -39,12 +39,19 @@ $routes['/products/:id/releases'] = 'releases';
|
||||
$routes['/projects/:id/releases'] = 'projectReleases';
|
||||
$routes['/releases/:id'] = 'release';
|
||||
|
||||
$routes['/stories'] = 'stories';
|
||||
$routes['/products/:id/stories'] = 'stories';
|
||||
$routes['/projects/:id/stories'] = 'projectStories';
|
||||
$routes['/executions/:id/stories'] = 'executionStories';
|
||||
$routes['/stories/:id'] = 'story';
|
||||
$routes['/stories/:id/change'] = 'storyChange';
|
||||
$routes['/stories'] = 'stories';
|
||||
$routes['/products/:id/stories'] = 'stories';
|
||||
$routes['/projects/:id/stories'] = 'projectStories';
|
||||
$routes['/executions/:id/stories'] = 'executionStories';
|
||||
$routes['/stories/:id'] = 'story';
|
||||
$routes['/stories/:id/change'] = 'storyChange';
|
||||
$routes['/stories/:id/close'] = 'storyClose';
|
||||
$routes['/stories/:id/active'] = 'storyActive';
|
||||
$routes['/stories/:id/assign'] = 'storyAssignto';
|
||||
$routes['/stories/:id/recordEstimate'] = 'storyRecordEstimate';
|
||||
$routes['/stories/:id/child'] = 'storyChild';
|
||||
|
||||
$routes['/module/:id/stories'] = 'moduleStories';
|
||||
|
||||
$routes['/products/:id/bugs'] = 'bugs';
|
||||
$routes['/projects/:id/bugs'] = 'projectBugs';
|
||||
@@ -61,12 +68,16 @@ $routes['/projects/:id/executions'] = 'executions';
|
||||
$routes['/executions'] = 'executions';
|
||||
$routes['/executions/:id'] = 'execution';
|
||||
|
||||
$routes['/executions/:id/tasks'] = 'tasks';
|
||||
$routes['/tasks'] = 'tasks';
|
||||
$routes['/tasks/:id'] = 'task';
|
||||
$routes['/tasks/:id/assignto'] = 'taskAssignTo';
|
||||
$routes['/tasks/:id/start'] = 'taskStart';
|
||||
$routes['/tasks/:id/finish'] = 'taskFinish';
|
||||
$routes['/executions/:id/tasks'] = 'tasks';
|
||||
$routes['/tasks'] = 'tasks';
|
||||
$routes['/tasks/:id'] = 'task';
|
||||
$routes['/tasks/:id/component'] = 'taskComponent';
|
||||
$routes['/tasks/:id/assignto'] = 'taskAssignTo';
|
||||
$routes['/tasks/:id/start'] = 'taskStart';
|
||||
$routes['/tasks/:id/pause'] = 'taskPause';
|
||||
$routes['/tasks/:id/finish'] = 'taskFinish';
|
||||
$routes['/tasks/:id/close'] = 'taskClose';
|
||||
$routes['/tasks/:id/recordEstimate'] = 'taskRecordEstimate';
|
||||
|
||||
$routes['/users'] = 'users';
|
||||
$routes['/users/:id'] = 'user';
|
||||
@@ -95,6 +106,7 @@ $routes['/builds/:id'] = 'build';
|
||||
$routes['/products/:id/testcases'] = 'testcases';
|
||||
$routes['/projects/:id/testcases'] = 'projectCases';
|
||||
$routes['/executions/:id/testcases'] = 'executionCases';
|
||||
$routes['/executions/:id/members'] = 'executionMembers';
|
||||
$routes['/testcases'] = 'testcases';
|
||||
$routes['/testcases/:id'] = 'testcase';
|
||||
$routes['/testcases/:id/results'] = 'testresults';
|
||||
|
||||
@@ -246,6 +246,18 @@ class baseEntry
|
||||
$this->send($code, $response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send 400 response.
|
||||
*
|
||||
* @param string message
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function send400($message = 'error')
|
||||
{
|
||||
$this->sendError(400, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send 404 response.
|
||||
*
|
||||
@@ -286,7 +298,20 @@ class baseEntry
|
||||
* 引入该模块的control文件。
|
||||
* Include the control file of the module.
|
||||
**/
|
||||
|
||||
$file2Included = $app->setActionExtFile() ? $app->extActionFile : $app->controlFile;
|
||||
|
||||
$isExt = $app->setActionExtFile();
|
||||
if($isExt)
|
||||
{
|
||||
$controlFile = $app->controlFile;
|
||||
spl_autoload_register(function($class) use ($moduleName, $controlFile)
|
||||
{
|
||||
if($class == $moduleName) include $controlFile;
|
||||
});
|
||||
}
|
||||
|
||||
$file2Included = $isExt ? $app->extActionFile : $app->controlFile;
|
||||
chdir(dirname($file2Included));
|
||||
helper::import($file2Included);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ class execution extends control
|
||||
$execution = $this->commonAction($executionID, $status);
|
||||
$executionID = $execution->id;
|
||||
|
||||
if($execution->type == 'kanban' and $this->config->vision != 'lite') $this->locate($this->createLink('execution', 'kanban', "executionID=$executionID"));
|
||||
if($execution->type == 'kanban' and $this->config->vision != 'lite' and defined('RUN_MODE') and RUN_MODE != 'api') $this->locate($this->createLink('execution', 'kanban', "executionID=$executionID"));
|
||||
|
||||
/* Get products by execution. */
|
||||
$products = $this->product->getProductPairsByProject($executionID);
|
||||
|
||||
@@ -149,6 +149,7 @@ class myModel extends model
|
||||
}
|
||||
|
||||
/* Sort by storyCount, get 5 records */
|
||||
$products = json_decode(json_encode($products), true);
|
||||
array_multisort(array_column($products, 'storyEstimateCount'), SORT_DESC, $products);
|
||||
$products = array_slice($products, 0, 5);
|
||||
|
||||
|
||||
@@ -1351,7 +1351,7 @@ class story extends control
|
||||
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api')
|
||||
{
|
||||
return print(array('status' => 'success', 'data' => $storyID));
|
||||
return $this->send(array('status' => 'success', 'data' => $storyID));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user