diff --git a/api/v1/entries/bug.php b/api/v1/entries/bug.php index 7146d2d879..7e311f51ca 100644 --- a/api/v1/entries/bug.php +++ b/api/v1/entries/bug.php @@ -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 = ''; diff --git a/api/v1/entries/bugs.php b/api/v1/entries/bugs.php index 738de8a39d..4694e85145 100644 --- a/api/v1/entries/bugs.php +++ b/api/v1/entries/bugs.php @@ -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'); } diff --git a/api/v1/entries/configs.php b/api/v1/entries/configs.php index 8ac46b7942..f9df6375fe 100644 --- a/api/v1/entries/configs.php +++ b/api/v1/entries/configs.php @@ -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); } diff --git a/api/v1/entries/project.php b/api/v1/entries/project.php index 970823db25..61b8cf819a 100644 --- a/api/v1/entries/project.php +++ b/api/v1/entries/project.php @@ -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": diff --git a/api/v1/entries/projectbugs.php b/api/v1/entries/projectbugs.php index 7468563e61..8ee1827387 100644 --- a/api/v1/entries/projectbugs.php +++ b/api/v1/entries/projectbugs.php @@ -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'); } diff --git a/api/v1/entries/task.php b/api/v1/entries/task.php index 926a337e98..a4b2f8c43e 100644 --- a/api/v1/entries/task.php +++ b/api/v1/entries/task.php @@ -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')); }