+ Add comments of api.

This commit is contained in:
zhujinyong
2021-09-08 15:34:49 +08:00
parent d1a08fda29
commit 88d981a33c
43 changed files with 874 additions and 185 deletions
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的bug资源类
* 版本V1
* The bug entry point of ZenTaoPMS.
*
* The bug entry point of zentaopms
* Version 1
* @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 bugEntry extends entry
{
/**
* GET method.
*
* @param int $bugID
* @access public
* @return void
*/
public function get($bugID)
{
$control = $this->loadController('bug', 'view');
@@ -18,6 +28,13 @@ class bugEntry extends entry
$this->send(200, $this->format($bug, 'deleted:bool,activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time'));
}
/**
* PUT method.
*
* @param int $bugID
* @access public
* @return void
*/
public function put($bugID)
{
$oldBug = $this->loadModel('bug')->getByID($bugID);
@@ -38,6 +55,13 @@ class bugEntry extends entry
$this->send(200, $this->format($bug, 'activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time'));
}
/**
* DELETE method.
*
* @param int $bugID
* @access public
* @return void
*/
public function delete($bugID)
{
$control = $this->loadController('bug', 'delete');
+21 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的bugs资源类
* 版本V1
* The bugs entry point of ZenTaoPMS.
*
* The bugs entry point of zentaopms
* Version 1
* @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 bugsEntry extends entry
{
/**
* GET method.
*
* @param int $productID
* @access public
* @return void
*/
public function get($productID)
{
$control = $this->loadController('bug', 'browse');
@@ -33,6 +43,13 @@ class bugsEntry extends entry
return $this->sendError(400, 'error');
}
/**
* POST method.
*
* @param int $productID
* @access public
* @return void
*/
public function post($productID)
{
$fields = 'title,project,execution,openedBuild,assignedTo,pri,severity,type,story';
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的build资源类
* 版本V1
* The build entry point of ZenTaoPMS.
*
* The build entry point of zentaopms
* Version 1
* @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 buildEntry extends Entry
{
/**
* GET method.
*
* @param int $buildID
* @access public
* @return void
*/
public function get($buildID)
{
$control = $this->loadController('build', 'view');
@@ -21,6 +31,13 @@ class buildEntry extends Entry
$this->sendError(400, 'error');
}
/**
* PUT method.
*
* @param int $buildID
* @access public
* @return void
*/
public function put($buildID)
{
$old = $this->loadModel('build')->getByID($buildID);
@@ -40,6 +57,13 @@ class buildEntry extends Entry
$this->send(200, $this->format($build, 'createdDate:time,editedDate:time,assignedDate:time'));
}
/**
* DELETE method.
*
* @param int $buildID
* @access public
* @return void
*/
public function delete($buildID)
{
$control = $this->loadController('build', 'delete');
+21 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的builds资源类
* 版本V1
* The builds entry point of ZenTaoPMS.
*
* The builds entry point of zentaopms
* Version 1
* @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 buildsEntry extends entry
{
/**
* GET method.
*
* @param int $projectID
* @access public
* @return void
*/
public function get($projectID = 0)
{
$control = $this->loadController('project', 'build');
@@ -28,6 +38,13 @@ class buildsEntry extends entry
return $this->send(200, $result);
}
/**
* POST method.
*
* @param int $projectID
* @access public
* @return void
*/
public function post($projectID = 0)
{
$project = $this->loadModel('project')->getByID($projectID);
+29 -19
View File
@@ -1,34 +1,44 @@
<?php
/**
* 禅道API的config资源类
* 版本V1
* The config entry point of ZenTaoPMS.
*
* The config entry point of zentaopms
* Version 1
* @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 configEntry extends baseEntry
{
/**
* GET method.
*
* @param int $name language,version,timezone etc.
* @access public
* @return void
*/
public function get($name)
{
$config = array('name' => $name);
switch($name)
{
case 'language':
$config['value'] = $this->config->default->lang;
break;
case 'version':
$config['value'] = $this->config->version;
break;
case 'charset':
$config['value'] = $this->config->charset;
break;
case 'timezone':
$config['value'] = $this->config->timezone;
break;
default:
$this->sendError(400, 'No configuration.');
return;
case 'language':
$config['value'] = $this->config->default->lang;
break;
case 'version':
$config['value'] = $this->config->version;
break;
case 'charset':
$config['value'] = $this->config->charset;
break;
case 'timezone':
$config['value'] = $this->config->timezone;
break;
default:
$this->sendError(400, 'No configuration.');
return;
}
$this->send(200, $config);
+13 -4
View File
@@ -1,13 +1,22 @@
<?php
/**
* 禅道API的configs资源类
* 版本V1
* The configs entry point of ZenTaoPMS.
*
* The configs entry point of zentaopms
* Version 1
* @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 configsEntry extends baseEntry
{
/**
* GET method.
*
* @access public
* @return void
*/
public function get()
{
$configs = array();
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的department资源类
* 版本V1
* The department entry point of ZenTaoPMS.
*
* The department entry point of zentaopms
* Version 1
* @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 departmentEntry extends Entry
{
/**
* GET method.
*
* @param int $departmentID
* @access public
* @return void
*/
public function get($departmentID)
{
$dept = $this->loadModel('dept')->getByID($departmentID);
@@ -16,6 +26,13 @@ class departmentEntry extends Entry
return $this->send(200, $dept);
}
/**
* PUT method.
*
* @param int $departmentID
* @access public
* @return void
*/
public function put($departmentID)
{
$oldDept = $this->loadModel('dept')->getByID($departmentID);
@@ -33,6 +50,13 @@ class departmentEntry extends Entry
$this->send(200, $department);
}
/**
* DELETE method.
*
* @param int $departmentID
* @access public
* @return void
*/
public function delete($departmentID)
{
$control = $this->loadController('dept', 'delete');
+7 -4
View File
@@ -1,10 +1,13 @@
<?php
/**
* 禅道API的departments资源类
* 版本V1
* The departments entry point of ZenTaoPMS.
*
* The departments entry point of zentaopms
* Version 1
* @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 departmentsEntry extends entry
{
+13 -4
View File
@@ -1,13 +1,22 @@
<?php
/**
* 禅道API的错误处理类
* 版本V1
* The error entry point of ZenTaoPMS.
*
* Display errors
* Version 1
* @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 errorEntry extends Entry
{
/**
* 404 Not Found.
*
* @access public
* @return void
*/
public function notFound()
{
$this->send(404, array('error' => 'not found'));
+59 -7
View File
@@ -1,23 +1,68 @@
<?php
/**
* 禅道API的execution资源类
* 版本V1
* The execution entry point of ZenTaoPMS.
*
* The execution entry point of zentaopms
* Version 1
* @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 executionEntry extends Entry
{
/**
* GET method.
*
* @param int $executionID
* @access public
* @return void
*/
public function get($executionID)
{
$fields = $this->param('fields');
$control = $this->loadController('execution', 'view');
$control->view($executionID);
$data = $this->getData();
$execution = $data->data->execution;
$this->send(200, $this->format($execution, 'openedDate:time,lastEditedDate:time,closedDate:time,canceledDate:time'));
$data = $this->getData();
if(!$data or !isset($data->status)) return $this->send400('error');
if(isset($data->status) and $data->status == 'fail')
{
return isset($data->code) and $data->code == 404 ? $this->send404() : $this->sendError(400, $data->message);
}
$execution = $this->format($data->data->execution, 'openedDate:time,lastEditedDate:time,closedDate:time,canceledDate:time');
if(!$fields) $this->send(200, $execution);
/* Set other fields. */
$fields = explode(',', $fields);
foreach($fields as $field)
{
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;
}
break;
}
}
return $this->send(200, $execution);
}
/**
* PUT method.
*
* @param int $executionID
* @access public
* @return void
*/
public function put($executionID)
{
$oldExecution = $this->loadModel('execution')->getByID($executionID);
@@ -39,6 +84,13 @@ class executionEntry extends Entry
$this->send(200, $this->format($execution, 'openedDate:time,lastEditedDate:time,closedDate:time,canceledDate:time'));
}
/**
* DELETE method.
*
* @param int $executionID
* @access public
* @return void
*/
public function delete($executionID)
{
$control = $this->loadController('execution', 'delete');
+14 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的executionStories资源类
* 版本V1
* The execution entry point of ZenTaoPMS.
*
* The executionStories entry point of zentaopms
* Version 1
* @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 execution
* @version 1
* @link http://www.zentao.net
*/
class executionStoriesEntry extends entry
{
/**
* GET method.
*
* @param int $executionID
* @access public
* @return void
*/
public function get($executionID)
{
$control = $this->loadController('execution', 'story');
+21 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的executions资源类
* 版本V1
* The executions entry point of ZenTaoPMS.
*
* The executions entry point of zentaopms
* Version 1
* @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 executionsEntry extends entry
{
/**
* GET method.
*
* @param int $projectID
* @access public
* @return void
*/
public function get($projectID = 0)
{
$control = $this->loadController('execution', 'all');
@@ -29,6 +39,13 @@ class executionsEntry extends entry
return $this->sendError(400, 'error');
}
/**
* POST method.
*
* @param int $projectID
* @access public
* @return void
*/
public function post($projectID = 0)
{
$fields = 'project,code,name,begin,end,lifetime,desc,days';
+29 -4
View File
@@ -1,18 +1,29 @@
<?php
/**
* 禅道API的issue资源类
* 版本V1
* The issue entry point of ZenTaoPMS.
*
* The issue entry point of zentaopms
* Version 1
* @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 issueEntry extends Entry
{
/**
* GET method.
*
* @param int|string $issueID. Issues id for Gitlab has '-', such as task-1, bug-1.
* @access public
* @return void
*/
public function get($issueID)
{
/* If $issueID has '-', go to productIssue entry point for Gitlab. */
if(strpos($issueID, '-') !== FALSE) return $this->fetch('productIssue', 'get', array('issueID' => $issueID));
/* Otherwise, get issue of project. */
$control = $this->loadController('issue', 'view');
$control->view($issueID);
@@ -24,6 +35,13 @@ class issueEntry extends Entry
$this->sendError(400, 'error');
}
/**
* PUT method.
*
* @param int $issueID
* @access public
* @return void
*/
public function put($issueID)
{
$oldIssue = $this->loadModel('issue')->getByID($issueID);
@@ -43,6 +61,13 @@ class issueEntry extends Entry
$this->send(200, $this->format($issue, 'createdDate:time,editedDate:time,assignedDate:time'));
}
/**
* DELETE method.
*
* @param int $issueID
* @access public
* @return void
*/
public function delete($issueID)
{
$control = $this->loadController('issue', 'delete');
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的issues资源类
* 版本V1
* The issues entry point of ZenTaoPMS.
*
* The issues entry point of zentaopms
* Version 1
* @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 issuesEntry extends entry
{
/**
* GET method.
*
* @param int $projectID
* @access public
* @return void
*/
public function get($projectID = 0)
{
if($projectID) return $this->getProjectIssues($projectID);
@@ -30,6 +40,13 @@ class issuesEntry extends entry
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'issues' => $result));
}
/**
* Get issues of project.
*
* @param int $projectID
* @access public
* @return void
*/
private function getProjectIssues($projectID)
{
$project = $this->loadModel('project')->getByID($projectID);
@@ -52,6 +69,13 @@ class issuesEntry extends entry
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'issues' => $result));
}
/**
* POST method.
*
* @param int $projectID
* @access public
* @return void
*/
public function post($projectID = 0)
{
$project = $this->loadModel('project')->getByID($projectID);
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的product资源类
* 版本V1
* The product entry point of ZenTaoPMS.
*
* The product entry point of zentaopms
* Version 1
* @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 productEntry extends Entry
{
/**
* GET method.
*
* @param int $productID
* @access public
* @return void
*/
public function get($productID)
{
$fields = $this->param('fields');
@@ -46,6 +56,13 @@ class productEntry extends Entry
return $this->send(200, $product);
}
/**
* PUT method.
*
* @param int $productID
* @access public
* @return void
*/
public function put($productID)
{
$oldProduct = $this->loadModel('product')->getByID($productID);
@@ -64,6 +81,13 @@ class productEntry extends Entry
$this->sendSuccess(200, $this->format($product, 'createdDate:time'));
}
/**
* DELETE method.
*
* @param int $productID
* @access public
* @return void
*/
public function delete($productID)
{
$control = $this->loadController('product', 'delete');
+15 -5
View File
@@ -1,14 +1,24 @@
<?php
/**
* 禅道API的product issue资源类
* 版本V1
* 目前适用于Gitlab
* The productissue entry point of ZenTaoPMS.
* It is only used by Gitlab.
*
* The product issue entry point of zentaopms
* Version 1
* @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 productIssueEntry extends entry
{
/**
* GET method.
*
* @param string $issueID, such as task-1, story-1, bug-1
* @access public
* @return void
*/
public function get($issueID)
{
$this->loadModel('entry');
+15 -5
View File
@@ -1,14 +1,24 @@
<?php
/**
* 禅道API的product issues资源类
* 版本V1
* 目前适用于Gitlab
* The productissue entry point of ZenTaoPMS.
* It is only used by Gitlab.
*
* The product issues entry point of zentaopms
* Version 1
* @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 productIssuesEntry extends entry
{
/**
* GET method.
*
* @param int $productID
* @access public
* @return void
*/
public function get($productID)
{
if(!is_numeric($productID)) $this->sendError(400, 'The product_id is not supported');
+20 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的products资源类
* 版本V1
* The products entry point of ZenTaoPMS.
*
* The products entry point of zentaopms
* Version 1
* @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 productsEntry extends entry
{
/**
* POST method.
*
* @param int $projectID
* @access public
* @return void
*/
public function get()
{
$programID = $this->param('program', 0);
@@ -49,6 +59,12 @@ class productsEntry extends entry
return $this->sendError(400, 'error');
}
/**
* POST method.
*
* @access public
* @return void
*/
public function post()
{
$fields = 'program,line,name,PO,QD,RD,type,desc,whitelist';
+7 -4
View File
@@ -1,10 +1,13 @@
<?php
/**
* 禅道API的program资源类
* 版本V1
* The program entry point of ZenTaoPMS.
*
* The program entry point of zentaopms
* Version 1
* @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 ProgramEntry extends Entry
{
+13 -4
View File
@@ -1,13 +1,22 @@
<?php
/**
* 禅道API的programs资源类
* 版本V1
* The programs entry point of ZenTaoPMS.
*
* The programs entry point of zentaopms
* Version 1
* @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 ProgramsEntry extends Entry
{
/**
* GET method.
*
* @access public
* @return void
*/
public function get()
{
$program = $this->loadController('program', 'browse');
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的projects资源类
* 版本V1
* The project entry point of ZenTaoPMS.
*
* The project entry point of zentaopms
* Version 1
* @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 projectEntry extends entry
{
/**
* GET method.
*
* @param int $projectID
* @access public
* @return void
*/
public function get($projectID)
{
$control = $this->loadController('project', 'view');
@@ -21,6 +31,13 @@ class projectEntry extends entry
$this->sendError(400, 'error');
}
/**
* PUT method.
*
* @param int $projectID
* @access public
* @return void
*/
public function put($projectID)
{
$oldProject = $this->loadModel('project')->getByID($projectID);
@@ -51,6 +68,13 @@ class projectEntry extends entry
$this->send(200, $this->format($project, 'openedDate:time,lastEditedDate:time,closedDate:time,canceledDate:time'));
}
/**
* DELETE method.
*
* @param int $projectID
* @access public
* @return void
*/
public function delete($projectID)
{
$control = $this->loadController('project', 'delete');
+19 -4
View File
@@ -1,13 +1,22 @@
<?php
/**
* 禅道API的projects资源类
* 版本V1
* The project entry point of ZenTaoPMS.
*
* The projects entry point of zentaopms
* Version 1
* @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 projectsEntry extends entry
{
/**
* GET method.
*
* @access public
* @return void
*/
public function get()
{
$control = $this->loadController('project', 'browse');
@@ -34,6 +43,12 @@ class projectsEntry extends entry
return $this->sendError(400, 'error');
}
/**
* POST method.
*
* @access public
* @return void
*/
public function post()
{
$fields = 'name,begin,end,products';
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的risk资源类
* 版本V1
* The risk entry point of ZenTaoPMS.
*
* The risk entry point of zentaopms
* Version 1
* @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 riskEntry extends Entry
{
/**
* GET method.
*
* @param int $riskID
* @access public
* @return void
*/
public function get($riskID)
{
$control = $this->loadController('risk', 'view');
@@ -21,6 +31,13 @@ class riskEntry extends Entry
$this->sendError(400, 'error');
}
/**
* PUT method.
*
* @param int $riskID
* @access public
* @return void
*/
public function put($riskID)
{
$oldRisk = $this->loadModel('risk')->getByID($riskID);
@@ -40,6 +57,13 @@ class riskEntry extends Entry
$this->send(200, $this->format($risk, 'createdDate:time,editedDate:time'));
}
/**
* DELETE method.
*
* @param int $riskID
* @access public
* @return void
*/
public function delete($riskID)
{
$control = $this->loadController('risk', 'delete');
+21 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的risks资源类
* 版本V1
* The risks entry point of ZenTaoPMS.
*
* The risks entry point of zentaopms
* Version 1
* @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 risksEntry extends entry
{
/**
* GET method.
*
* @param int $projectID
* @access public
* @return void
*/
public function get($projectID = 0)
{
if(!$projectID)
@@ -41,6 +51,13 @@ class risksEntry extends entry
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'risks' => $result));
}
/**
* POST method.
*
* @param int $projectID
* @access public
* @return void
*/
public function post($projectID = 0)
{
$project = $this->loadModel('project')->getByID($projectID);
+21 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的stories资源类
* 版本V1
* The stories entry point of ZenTaoPMS.
*
* The stories entry point of zentaopms
* Version 1
* @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 storiesEntry extends entry
{
/**
* GET method.
*
* @param int $productID
* @access public
* @return void
*/
public function get($productID)
{
$control = $this->loadController('product', 'browse');
@@ -34,6 +44,13 @@ class storiesEntry extends entry
return $this->sendError(400, 'error');
}
/**
* POST method.
*
* @param int $productID
* @access public
* @return void
*/
public function post($productID)
{
$fields = 'title,spec,verify,reviewer,type';
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的story资源类
* 版本V1
* The story entry point of ZenTaoPMS.
*
* The story entry point of zentaopms
* Version 1
* @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 storyEntry extends Entry
{
/**
* GET method.
*
* @param int $storyID
* @access public
* @return void
*/
public function get($storyID)
{
$control = $this->loadController('story', 'view');
@@ -18,6 +28,13 @@ class storyEntry extends Entry
$this->send(200, $this->format($story, 'openedDate:time,assignedDate:time,reviewedDate:time,lastEditedDate:time,closedDate:time'));
}
/**
* PUT method.
*
* @param int $storyID
* @access public
* @return void
*/
public function put($storyID)
{
$oldStory = $this->loadModel('story')->getByID($storyID);
@@ -35,6 +52,13 @@ class storyEntry extends Entry
$this->sendSuccess(200, $this->format($story, 'openedDate:time,assignedDate:time,reviewedDate:time,lastEditedDate:time,closedDate:time'));
}
/**
* DELETE method.
*
* @param int $storyID
* @access public
* @return void
*/
public function delete($storyID)
{
$control = $this->loadController('story', 'delete');
+14 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的story资源类
* 版本V1
* The bug change point of ZenTaoPMS.
*
* The story entry point of zentaopms
* Version 1
* @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 storyChangeEntry extends Entry
{
/**
* POST method.
*
* @param int $storyID
* @access public
* @return void
*/
public function post($storyID)
{
$oldStory = $this->loadModel('story')->getByID($storyID);
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的task资源类
* 版本V1
* The task entry point of ZenTaoPMS.
*
* The task entry point of zentaopms
* Version 1
* @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 taskEntry extends Entry
{
/**
* GET method.
*
* @param int $taskID
* @access public
* @return void
*/
public function get($taskID)
{
$control = $this->loadController('task', 'view');
@@ -25,6 +35,13 @@ class taskEntry extends Entry
$this->send(200, $this->format($task, 'openedDate:time,assignedDate:time,realStarted:time,finishedDate:time,canceledDate:time,closedDate:time,lastEditedDate:time'));
}
/**
* PUT method.
*
* @param int $taskID
* @access public
* @return void
*/
public function put($taskID)
{
$oldTask = $this->loadModel('task')->getByID($taskID);
@@ -41,6 +58,13 @@ class taskEntry extends Entry
$this->send(200, $this->format($task, 'openedDate:time,assignedDate:time,realStarted:time,finishedDate:time,canceledDate:time,closedDate:time,lastEditedDate:time'));
}
/**
* DELETE method.
*
* @param int $taskID
* @access public
* @return void
*/
public function delete($taskID)
{
$control = $this->loadController('task', 'delete');
+14 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的taskAssignTo资源类
* 版本V1
* The task assignto entry point of ZenTaoPMS.
*
* The task entry point of zentaopms
* Version 1
* @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 taskAssignToEntry extends Entry
{
/**
* POST method.
*
* @param int $taskID
* @access public
* @return void
*/
public function post($taskID)
{
$task = $this->loadModel('task')->getByID($taskID);
+14 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的taskStat资源类
* 版本V1
* The task finish entry point of ZenTaoPMS.
*
* The task entry point of zentaopms
* Version 1
* @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 taskFinishEntry extends Entry
{
/**
* POST method.
*
* @param int $taskID
* @access public
* @return void
*/
public function post($taskID)
{
$task = $this->loadModel('task')->getByID($taskID);
+21 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的tasks资源类
* 版本V1
* The tasks entry point of ZenTaoPMS.
*
* The tasks entry point of zentaopms
* Version 1
* @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 tasksEntry extends entry
{
/**
* GET method.
*
* @param int $executionID
* @access public
* @return void
*/
public function get($executionID = 0)
{
if(!$executionID)
@@ -42,6 +52,13 @@ class tasksEntry extends entry
return $this->sendError(400, 'error');
}
/**
* POST method.
*
* @param int $executionID
* @access public
* @return void
*/
public function post($executionID)
{
$fields = 'name,type,assignedTo,estimate,story,parent,execution,module,pri,desc,estStarted,deadline,mailto';
+14 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的taskStat资源类
* 版本V1
* The task start entry point of ZenTaoPMS.
*
* The task entry point of zentaopms
* Version 1
* @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 taskStartEntry extends Entry
{
/**
* POST method.
*
* @param int $taskID
* @access public
* @return void
*/
public function post($taskID)
{
$task = $this->loadModel('task')->getByID($taskID);
+14 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的todo资源类
* 版本V1
* The testcase entry point of ZenTaoPMS.
*
* The testcase entry point of zentaopms
* Version 1
* @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 testcaseEntry extends entry
{
/**
* GET method.
*
* @param int $testcaseID
* @access public
* @return void
*/
public function get($testcaseID)
{
$control = $this->loadController('testcase', 'view');
+13 -4
View File
@@ -1,13 +1,22 @@
<?php
/**
* 禅道API的testcases资源类
* 版本V1
* The testcases entry point of ZenTaoPMS.
*
* The testcases entry point of zentaopms
* Version 1
* @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 testcasesEntry extends entry
{
/**
* GET method.
*
* @access public
* @return void
*/
public function get()
{
$this->app->loadClass('pager', $static = true);
+21 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的todo资源类
* 版本V1
* The testtask entry point of ZenTaoPMS.
*
* The testtask entry point of zentaopms
* Version 1
* @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 testtaskEntry extends entry
{
/**
* GET method.
*
* @param int $testtaskID
* @access public
* @return void
*/
public function get($testtaskID)
{
$control = $this->loadController('testtask', 'view');
@@ -22,6 +32,13 @@ class testtaskEntry extends entry
$this->send(200, $this->format($testtask, 'realFinishedDate:time'));
}
/**
* DELETE method.
*
* @param int $testtaskID
* @access public
* @return void
*/
public function delete($testtaskID)
{
$control = $this->loadController('testtask', 'delete');
+21 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的testtasks资源类
* 版本V1
* The testtasks entry point of ZenTaoPMS.
*
* The testtasks entry point of zentaopms
* Version 1
* @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 testtasksEntry extends entry
{
/**
* GET method.
*
* @param int $projectID
* @access public
* @return void
*/
public function get($projectID = 0)
{
if($projectID) return $this->getProjectTesttasks($projectID);
@@ -31,6 +41,13 @@ class testtasksEntry extends entry
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'testtasks' => $result));
}
/**
* Get testtasks of project.
*
* @param int $projectID
* @access public
* @return void
*/
private function getProjectTesttasks($projectID)
{
$project = $this->loadModel('project')->getByID($projectID);
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的todo资源类
* 版本V1
* The todo entry point of ZenTaoPMS.
*
* The todo entry point of zentaopms
* Version 1
* @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 todoEntry extends entry
{
/**
* GET method.
*
* @param int $todoID
* @access public
* @return void
*/
public function get($todoID)
{
$control = $this->loadController('todo', 'view');
@@ -21,6 +31,13 @@ class todoEntry extends entry
$this->send(200, $this->format($todo, 'assignedDate:time,finishedDate:time,closedDate:time'));
}
/**
* PUT method.
*
* @param int $todoID
* @access public
* @return void
*/
public function put($todoID)
{
$oldTodo = $this->loadModel('todo')->getByID($todoID);
@@ -46,6 +63,13 @@ class todoEntry extends entry
$this->send(200, $this->format($todo, 'assignedDate:time,finishedDate:time,closedDate:time'));
}
/**
* DELETE method.
*
* @param int $todoID
* @access public
* @return void
*/
public function delete($todoID)
{
$control = $this->loadController('todo', 'delete');
+19 -5
View File
@@ -1,13 +1,22 @@
<?php
/**
* 禅道API的todos资源类
* 版本V1
* The todos entry point of ZenTaoPMS.
*
* The todos entry point of zentaopms
* Version 1
* @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 todosEntry extends entry
{
/**
* GET method.
*
* @access public
* @return void
*/
public function get()
{
$control = $this->loadController('my', 'todo');
@@ -26,6 +35,12 @@ class todosEntry extends entry
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'todos' => $result));
}
/**
* POST method.
*
* @access public
* @return void
*/
public function post()
{
$fields = 'name,desc,begin,end,private';
@@ -51,5 +66,4 @@ class todosEntry extends entry
$this->send(201, $this->format($todo, 'assignedDate:time,finishedDate:time,closedDate:time'));
}
}
+13 -4
View File
@@ -1,13 +1,22 @@
<?php
/**
* 禅道API的tokens资源类
* 版本V1
* The tokens entry point of ZenTaoPMS.
*
* The tokens entry point of zentaopms
* Version 1
* @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 tokensEntry extends baseEntry
{
/**
* POST method.
*
* @access public
* @return void
*/
public function post()
{
$account = $this->request('account');
+28 -4
View File
@@ -1,13 +1,23 @@
<?php
/**
* 禅道API的user资源类
* 版本V1
* The user entry point of ZenTaoPMS.
*
* The user entry point of zentaopms
* Version 1
* @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 userEntry extends Entry
{
/**
* GET method.
*
* @param int $userID
* @access public
* @return void
*/
public function get($userID = 0)
{
/* Get my info defaultly. */
@@ -95,6 +105,13 @@ class userEntry extends Entry
$this->send(200, $info);
}
/**
* PUT method.
*
* @param int $userID
* @access public
* @return void
*/
public function put($userID)
{
$oldUser = $this->loadModel('user')->getByID($userID, 'id');
@@ -117,6 +134,13 @@ class userEntry extends Entry
$this->send(200, $this->format($user, 'last:time,locked:time'));
}
/**
* DELETE method.
*
* @param int $userID
* @access public
* @return void
*/
public function delete($userID)
{
$this->setPost('verifyPassword', md5($this->app->user->password . $this->app->session->rand));
+19 -4
View File
@@ -1,13 +1,22 @@
<?php
/**
* 禅道API的users资源类
* 版本V1
* The users entry point of ZenTaoPMS.
*
* The users entry point of zentaopms
* Version 1
* @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 usersEntry extends entry
{
/**
* GET method.
*
* @access public
* @return void
*/
public function get()
{
$control = $this->loadController('company', 'browse');
@@ -28,6 +37,12 @@ class usersEntry extends entry
return $this->sendError(400, 'error');
}
/**
* POST method.
*
* @access public
* @return void
*/
public function post()
{
$fields = 'account,dept,realname,email,commiter,gender';
+10
View File
@@ -2,6 +2,15 @@
/**
* 禅道API的entry类。
* The entry class file of ZenTao API.
*
* @package framework
*
* The author disclaims copyright to this source code. In place of
* a legal notice, here is a blessing:
*
* May you do good and not evil.
* May you find forgiveness for yourself and forgive others.
* May you share freely, never taking more than you give.
*/
class entry extends baseEntry
{
@@ -275,6 +284,7 @@ class baseEntry
$controller = new $className();
$controller->viewType = 'json';
return $controller;
}
+1
View File
@@ -677,6 +677,7 @@ class task extends control
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found'));
die(js::error($this->lang->notFound) . js::locate('back'));
}
$this->session->project = $task->project;
if($task->fromBug != 0)