* Add bug->productStatus and task->executionStatus .

This commit is contained in:
=
2022-04-27 16:37:39 +08:00
parent f5cf71f41f
commit a2f3cfc2da
6 changed files with 23 additions and 11 deletions
+3 -2
View File
@@ -32,8 +32,9 @@ class bugEntry extends entry
$bug = $data->data->bug;
/* Set product name */
$bug->productName = $data->data->product->name;
/* Set product name and status */
$bug->productName = $data->data->product->name;
$bug->productStatus = $data->data->product->status;
/* Set module title */
$moduleTitle = '';
+4
View File
@@ -33,6 +33,7 @@ class bugsEntry extends entry
$bugs = $data->data->bugs;
$pager = $data->data->pager;
$result = array();
$this->loadModel('product');
foreach($bugs as $bug)
{
$status = array('code' => $bug->status, 'name' => $this->lang->bug->statusList[$bug->status]);
@@ -42,6 +43,9 @@ class bugsEntry extends entry
$bug->status = $status['code'];
$bug->statusName = $status['name'];
$product = $this->product->getById($bug->product);
$bug->productStatus = $product->status;
$result[$bug->id] = $this->format($bug, 'activatedDate:time,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,mailto:userList,resolvedBy:user,resolvedDate:time,closedBy:user,closedDate:time,lastEditedBy:user,lastEditedDate:time,deadline:date,deleted:bool');
}
+8 -7
View File
@@ -21,13 +21,14 @@ class configsEntry extends baseEntry
{
$configs = array();
$configs[] = array('key' => 'language', 'value' => $this->config->default->lang);
$configs[] = array('key' => 'version', 'value' => $this->config->version);
$configs[] = array('key' => 'charset', 'value' => $this->config->charset);
$configs[] = array('key' => 'timezone', 'value' => $this->config->timezone);
$configs[] = array('key' => 'systemMode', 'value' => $this->config->systemMode);
$configs[] = array('key' => 'hourUnit', 'value' => $this->config->hourUnit);
$configs[] = array('key' => 'CRProduct', 'value' => $this->config->CRProduct);
$configs[] = array('key' => 'language', 'value' => $this->config->default->lang);
$configs[] = array('key' => 'version', 'value' => $this->config->version);
$configs[] = array('key' => 'charset', 'value' => $this->config->charset);
$configs[] = array('key' => 'timezone', 'value' => $this->config->timezone);
$configs[] = array('key' => 'systemMode', 'value' => $this->config->systemMode);
$configs[] = array('key' => 'hourUnit', 'value' => $this->config->hourUnit);
$configs[] = array('key' => 'CRProduct', 'value' => $this->config->CRProduct);
$configs[] = array('key' => 'CRExecution', 'value' => $this->config->CRExecution);
$this->send(200, $configs);
}
+1 -2
View File
@@ -63,9 +63,8 @@ class projectEntry extends entry
$project->teams = $teams;
break;
case "products":
$status = $this->param('status', 'all');
$project->products = array();
$productList = $this->loadModel('product')->getOrderedProducts($status, 40, $projectID);
$productList = $this->loadModel('product')->getProducts($projectID, $this->param('status', 'all'));
foreach($productList as $product) $project->products[] = $product;
break;
case "stat":
+4
View File
@@ -33,6 +33,7 @@ class projectBugsEntry extends entry
$bugs = $data->data->bugs;
$pager = $data->data->pager;
$result = array();
$this->loadModel('product');
foreach($bugs as $bug)
{
$status = array('code' => $bug->status, 'name' => $this->lang->bug->statusList[$bug->status]);
@@ -42,6 +43,9 @@ class projectBugsEntry extends entry
$bug->status = $status['code'];
$bug->statusName = $status['name'];
$product = $this->product->getById($bug->product);
$bug->productStatus = $product->status;
$result[$bug->id] = $this->format($bug, 'activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time,deadline:date,deleted:bool');
}
+3
View File
@@ -87,6 +87,9 @@ class taskEntry extends Entry
$task->preAndNext['pre'] = $preAndNext->pre ? $preAndNext->pre->id : '';
$task->preAndNext['next'] = $preAndNext->next ? $preAndNext->next->id : '';
$execution = $this->loadModel('project')->getByID($task->execution, 'execution');
$task->executionStatus = $execution->status;
$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'));
}