* adjust for status name for api.

This commit is contained in:
王怡栋
2021-12-06 11:55:50 +08:00
parent 5a8e51a9c6
commit 641929d5fc
6 changed files with 19 additions and 11 deletions

View File

@@ -39,7 +39,8 @@ class bugsEntry extends entry
if($bug->status == 'active' and $bug->confirmed) $status = array('code' => 'confirmed', 'name' => $this->lang->bug->labelConfirmed);
if($bug->resolution == 'postponed') $status = array('code' => 'postponed', 'name' => $this->lang->bug->labelPostponed);
if(!empty($bug->delay)) $status = array('code' => 'delay', 'name' => $this->lang->bug->overdueBugs);
$bug->status = $status;
$bug->status = $status['code'];
$bug->statusName = $status['name'];
$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');
}
@@ -53,7 +54,8 @@ class bugsEntry extends entry
foreach($storyChangeds as $bugID)
{
$status = array('code' => 'storyChanged', 'name' => $this->lang->bug->changed);
$result[$bugID]->status = $status;
$result[$bugID]->status = $status['code'];
$result[$bugID]->statusName = $status['name'];
}
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'bugs' => array_values($result)));

View File

@@ -39,7 +39,8 @@ class executionBugsEntry extends entry
if($bug->status == 'active' and $bug->confirmed) $status = array('code' => 'confirmed', 'name' => $this->lang->bug->labelConfirmed);
if($bug->resolution == 'postponed') $status = array('code' => 'postponed', 'name' => $this->lang->bug->labelPostponed);
if(!empty($bug->delay)) $status = array('code' => 'delay', 'name' => $this->lang->bug->overdueBugs);
$bug->status = $status;
$bug->status = $status['code'];
$bug->statusName = $status['name'];
$result[$bug->id] = $this->format($bug, 'activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time,deadline:date,deleted:bool');
}
@@ -53,7 +54,8 @@ class executionBugsEntry extends entry
foreach($storyChangeds as $bugID)
{
$status = array('code' => 'storyChanged', 'name' => $this->lang->bug->changed);
$result[$bugID]->status = $status;
$result[$bugID]->status = $status['code'];
$result[$bugID]->statusName = $status['name'];
}
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'bugs' => array_values($result)));

View File

@@ -35,7 +35,7 @@ class executionCasesEntry extends entry
$result = array();
foreach($cases as $case)
{
$case->status = array('code' => $case->status, 'name' => $this->lang->testcase->statusList[$case->status]);
$case->statusName = 'name' => $this->lang->testcase->statusList[$case->status];
$result[] = $this->format($case, 'openedDate:time,reviewedDate:date,lastEditedDate:time,lastRunDate:time');
}

View File

@@ -39,7 +39,8 @@ class projectBugsEntry extends entry
if($bug->status == 'active' and $bug->confirmed) $status = array('code' => 'confirmed', 'name' => $this->lang->bug->labelConfirmed);
if($bug->resolution == 'postponed') $status = array('code' => 'postponed', 'name' => $this->lang->bug->labelPostponed);
if(!empty($bug->delay)) $status = array('code' => 'delay', 'name' => $this->lang->bug->overdueBugs);
$bug->status = $status;
$bug->status = $status['code'];
$bug->statusName = $status['name'];
$result[$bug->id] = $this->format($bug, 'activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time,deadline:date,deleted:bool');
}
@@ -53,7 +54,8 @@ class projectBugsEntry extends entry
foreach($storyChangeds as $bugID)
{
$status = array('code' => 'storyChanged', 'name' => $this->lang->bug->changed);
$result[$bugID]->status = $status;
$result[$bugID]->status = $status['code'];
$result[$bugID]->statusName = $status['name'];
}
return $this->send(200, array('page' => $pager->pageID, 'total' => $pager->recTotal, 'limit' => $pager->recPerPage, 'bugs' => array_values($result)));

View File

@@ -38,7 +38,7 @@ class projectCasesEntry extends entry
$result = array();
foreach($cases as $case)
{
$case->status = array('code' => $case->status, 'name' => $this->lang->testcase->statusList[$case->status]);
$case->statusName = $this->lang->testcase->statusList[$case->status];
$result[] = $this->format($case, 'openedDate:time,reviewedDate:date,lastEditedDate:time,lastRunDate:time');
}

View File

@@ -221,7 +221,8 @@ class userEntry extends Entry
if($bug->status == 'active' and $bug->confirmed) $status = array('code' => 'confirmed', 'name' => $this->lang->bug->labelConfirmed);
if($bug->resolution == 'postponed') $status = array('code' => 'postponed', 'name' => $this->lang->bug->labelPostponed);
if(!empty($bug->delay)) $status = array('code' => 'delay', 'name' => $this->lang->bug->overdueBugs);
$bug->status = $status;
$bug->status = $status['code'];
$bug->statusName = $status['name'];
$bugs[$bug->id] = $bug;
}
@@ -235,7 +236,8 @@ class userEntry extends Entry
foreach($storyChangeds as $bugID)
{
$status = array('code' => 'storyChanged', 'name' => $this->lang->bug->changed);
$bugs[$bugID]->status = $status;
$bugs[$bugID]->status = $status['code'];
$bugs[$bugID]->statusName = $status['name'];
}
$info->bug['total'] = $data->data->pager->recTotal;
@@ -271,7 +273,7 @@ class userEntry extends Entry
$stories = array();
foreach($data->data->stories as $story)
{
$story->status = array('code' => $story->status, 'name' => $this->lang->story->statusList[$story->status]);
$story->statusName = $this->lang->story->statusList[$story->status];
$stories[$story->id] = $story;
}