This commit is contained in:
wangyidong
2021-07-20 09:59:33 +08:00
10 changed files with 117 additions and 37 deletions
+2 -1
View File
@@ -17,12 +17,13 @@ class bugsEntry extends entry
if(isset($data->status) and $data->status == 'success')
{
$bugs = $data->data->bugs;
$pager = $data->data->pager;
$result = array();
foreach($bugs as $bug)
{
$result[] = $bug;
}
return $this->send(200, $result);
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'bugs' => $result));
}
if(isset($data->status) and $data->status == 'fail')
{
+5 -1
View File
@@ -14,7 +14,11 @@ class executionsEntry extends entry
$control->all($this->param('status', 'all'), $this->param('project', $projectID));
$data = $this->getData();
if(isset($data->status) and $data->status == 'success') return $this->send(200, $data->data->executionStats);
if(isset($data->status) and $data->status == 'success')
{
$pager = $data->data->pager;
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'executions' => $data->data->executionStats));
}
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
return $this->sendError(400, 'error');
+3 -2
View File
@@ -12,11 +12,12 @@ class productsEntry extends entry
{
$control = $this->loadController('product', 'all');
$control->all();
$data = $this->getData();
$data = $this->getData();
$pager = $data->data->pager;
if(isset($data->status) and $data->status == 'success')
{
return $this->send(200, $data->data->productStats);
return $this->send(200, array('products' => $data->data->productStats));
}
if(isset($data->status) and $data->status == 'fail')
{
+11
View File
@@ -0,0 +1,11 @@
<?php
/**
* 禅道API的program资源类
* 版本V1
*
* The program entry point of zentaopms
* Version 1
*/
class ProgramEntry extends Entry
{
}
+8 -1
View File
@@ -1,4 +1,11 @@
<?php
/**
* 禅道API的programs资源类
* 版本V1
*
* The programs entry point of zentaopms
* Version 1
*/
class ProgramsEntry extends Entry
{
public function get()
@@ -15,7 +22,7 @@ class ProgramsEntry extends Entry
{
$result[] = $program;
}
return $this->send(200, $result);
return $this->send(200, array('programs' => $result));
}
if(isset($data->status) and $data->status == 'fail')
{
+2 -1
View File
@@ -16,7 +16,8 @@ class projectsEntry extends entry
if(isset($data->status) and $data->status == 'success')
{
return $this->send(200, $data->data->projectStats);
$pager = $data->data->pager;
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'projects' => $data->data->projectStats));
}
if(isset($data->status) and $data->status == 'fail')
{
+3 -1
View File
@@ -17,13 +17,15 @@ class storiesEntry extends entry
if(isset($data->status) and $data->status == 'success')
{
$stories = $data->data->stories;
$pager = $data->data->pager;
$result = array();
foreach($stories as $story)
{
$result[] = $story;
}
return $this->send(200, $result);
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'stories' => $result));
}
if(isset($data->status) and $data->status == 'fail')
{
return $this->sendError(400, $data->message);
+2 -1
View File
@@ -17,12 +17,13 @@ class tasksEntry extends entry
if(isset($data->status) and $data->status == 'success')
{
$tasks = $data->data->tasks;
$pager = $data->data->pager;
$result = array();
foreach($tasks as $task)
{
$result[] = $task;
}
return $this->send(200, $result);
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'tasks' => $result));
}
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
+5 -9
View File
@@ -17,18 +17,14 @@ class usersEntry extends entry
if(isset($data->status) and $data->status == 'success')
{
$users = $data->data->users;
$pager = $data->data->pager;
$result = array();
foreach($users as $user)
{
$result[] = $user;
}
return $this->send(200, $result);
}
if(isset($data->status) and $data->status == 'fail')
{
return $this->sendError(400, $data->message);
foreach($users as $user) $result[] = $user;
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'users' => $result));
}
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
return $this->sendError(400, 'error');
}
+76 -20
View File
@@ -1,5 +1,13 @@
$(function()
{
programBegin = $('.programParams #begin').val();
programEnd = $('.programParams #end').val();
setProgramBegin(programBegin);
setProgramEnd(programEnd);
setProjectPM();
setProgramByProduct($(':checkbox:checked[data-productid]'));
/* Define drag to select relevant parameters. */
var options = {
selector: 'input',
@@ -36,14 +44,17 @@ $(function()
var productID = $('[data-id=' + e.id + ']').val();
$('[data-product=' + productID +']').prop('checked', true);
if(!$("[id^='productLines\[" + lineID + "\]']").prop('checked')) $("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
var checkedProject = isSelectAll(lineID, 'project');
}
else
{
var checkedProduct = isSelectAll(0, 'product');
var productID = $('[data-id=' + e.id + ']').val();
$('[data-product=' + productID +']').prop('checked', true);
var checkedProject = isSelectAll(0, 'project');
}
$('#checkAllProducts').prop('checked', checkedProduct);
$('#checkAllProjects').prop('checked', checkedProject);
}
/* All projects selected. */
@@ -94,6 +105,17 @@ $(function()
$('#checkAllLines').prop('checked', checkedLines);
}
var checkAllLines = true;
var lineNum = $("[id^='productLines'").length;
var checkedLineNum = $("[id^='productLines']:checked").length;
if(lineNum > checkedLineNum) checkAllLines = false;
$("[id='checkAllLines']").prop('checked', checkAllLines);
setProgramBegin(programBegin);
setProgramEnd(programEnd);
setProjectPM();
/* If the project is checked, the relevant form will be displayed according to the selected mode. */
hiddenProject();
}
@@ -107,14 +129,6 @@ $(function()
$('#source .cell').height($('#source').height());
$('#programBox .cell').height($('#programBox').height() - 20);
programBegin = $('.programParams #begin').val();
programEnd = $('.programParams #end').val();
setProgramBegin(programBegin);
setProgramEnd(programEnd);
setProjectPM();
setProgramByProduct($(':checkbox:checked[data-productid]'));
/* Select all product line events. */
$('#checkAllLines').click(function()
{
@@ -152,18 +166,32 @@ $(function()
var lineID = $('li.currentPage').attr('lineid');
if($(this).is(':checked'))
{
$("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
$('#checkAllProjects').prop('checked', true);
$('[name^=products]').prop('checked', true);
$('[name^=sprints]').prop('checked', true);
$('#programName').val($('.main-row .side-col .nav li.currentPage div a').text());
if($('[id^=productLines]').length > 0)
{
$('[data-line=' + lineID + ']').prop('checked', true);
$("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
}
else
{
$('[name^=products]').prop('checked', true);
$('[name^=sprints]').prop('checked', true);
}
}
else
{
$("[id^='productLines\[" + lineID + "\]']").prop('checked', false);
$('#checkAllProjects').prop('checked', false);
$('[name^=products]').prop('checked', false);
$('[name^=sprints]').prop('checked', false);
if($('[id^=productLines]').length > 0)
{
$('[data-line=' + lineID + ']').prop('checked', false);
$("[id^='productLines\[" + lineID + "\]']").prop('checked', false);
}
else
{
$('[name^=products]').prop('checked', false);
$('[name^=sprints]').prop('checked', false);
}
$('#programName').val('');
}
setProgramBegin(programBegin);
@@ -178,19 +206,33 @@ $(function()
var lineID = $('li.currentPage').attr('lineid');
if($(this).is(':checked'))
{
$("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
$('#checkAllProducts').prop('checked', true);
$('[name^=products]').prop('checked', true);
$('[name^=sprints]').prop('checked', true);
$('#programName').val($('.main-row .side-col .nav li.currentPage div a').text());
if($('[id^=productLines]').length > 0)
{
$('[data-line=' + lineID + ']').prop('checked', true);
$("[id^='productLines\[" + lineID + "\]']").prop('checked', true);
}
else
{
$('[name^=products]').prop('checked', true);
$('[name^=sprints]').prop('checked', true);
}
}
else
{
$("[id^='productLines\[" + lineID + "\]']").prop('checked', false);
$('#checkAllProducts').prop('checked', false);
$('[name^=products]').prop('checked', false);
$('[name^=sprints]').prop('checked', false);
$('#programName').val('');
if($('[id^=productLines]').length > 0)
{
$('[data-line=' + lineID + ']').prop('checked', false);
$("[id^='productLines\[" + lineID + "\]']").prop('checked', false);
}
else
{
$('[name^=products]').prop('checked', false);
$('[name^=sprints]').prop('checked', false);
}
}
setProgramBegin(programBegin);
setProgramEnd(programEnd);
@@ -375,6 +417,13 @@ $(function()
checkedLine = false;
}
$("[id^='productLines\[" + lineID + "\]']").prop('checked', checkedLine);
var checkAllLines = true;
var lineNum = $("[id^='productLines'").length;
var checkedLineNum = $("[id^='productLines']:checked").length;
if(lineNum > checkedLineNum) checkAllLines = false;
$("[id='checkAllLines']").prop('checked', checkAllLines);
}
else if($('[id^=products]').length > 0)
{
@@ -455,6 +504,13 @@ $(function()
checkedLine = false;
}
$("[id^='productLines\["+ lineID +"\]").prop('checked', checkedLine);
var checkAllLines = true;
var lineNum = $("[id^='productLines'").length;
var checkedLineNum = $("[id^='productLines']:checked").length;
if(lineNum > checkedLineNum) checkAllLines = false;
$("[id='checkAllLines']").prop('checked', checkAllLines);
}
else if($('[id^=products]').length > 0)
{