* code for task #45297.

This commit is contained in:
王怡栋
2021-12-01 09:17:20 +08:00
parent 8b6bacdcfd
commit fc591306b5
5 changed files with 27 additions and 6 deletions
+5
View File
@@ -91,6 +91,11 @@ class bugEntry extends entry
$bug->actions = $this->loadModel('action')->processActionForAPI($data->data->actions, $data->data->users, $this->lang->bug);
$preAndNext = $data->data->preAndNext;
$bug->preAndNext = array();
$bug->preAndNext['pre'] = $preAndNext->pre ? $preAndNext->pre->id : '';
$bug->preAndNext['next'] = $preAndNext->next ? $preAndNext->next->id : '';
$this->send(200, $this->format($bug, 'activatedDate:time,openedDate:time,assignedDate:time,resolvedDate:time,closedDate:time,lastEditedDate:time,deadline:date,deleted:bool'));
}
+5
View File
@@ -44,6 +44,11 @@ class docEntry extends entry
$doc->addedBy = zget($usersWithAvatar, $doc->addedBy);
}
$preAndNext = $data->data->preAndNext;
$doc->preAndNext = array();
$doc->preAndNext['pre'] = $preAndNext->pre ? $preAndNext->pre->id : '';
$doc->preAndNext['next'] = $preAndNext->next ? $preAndNext->next->id : '';
$this->send(200, $this->format($doc, 'addedDate:time,assignedDate:date,editedDate:time'));
}
+5
View File
@@ -105,6 +105,11 @@ class storyEntry extends Entry
$story->actions = $this->loadModel('action')->processActionForAPI($data->data->actions, $data->data->users, $this->lang->story);
$preAndNext = $data->data->preAndNext;
$story->preAndNext = array();
$story->preAndNext['pre'] = $preAndNext->pre ? $preAndNext->pre->id : '';
$story->preAndNext['next'] = $preAndNext->next ? $preAndNext->next->id : '';
$this->send(200, $this->format($story, 'openedDate:time,assignedDate:time,reviewedDate:time,lastEditedDate:time,closedDate:time'));
}
+5
View File
@@ -99,6 +99,11 @@ class taskEntry extends Entry
$task->actions = $this->loadModel('action')->processActionForAPI($data->data->actions, $data->data->users, $this->lang->task);
$preAndNext = $data->data->preAndNext;
$task->preAndNext = array();
$task->preAndNext['pre'] = $preAndNext->pre ? $preAndNext->pre->id : '';
$task->preAndNext['next'] = $preAndNext->next ? $preAndNext->next->id : '';
$this->send(200, $this->format($task, 'openedDate:time,assignedDate:time,realStarted:time,finishedDate:time,canceledDate:time,closedDate:time,lastEditedDate:time,deleted:bool'));
}
+7 -6
View File
@@ -1845,13 +1845,18 @@ EOD;
$typeOnlyCondition = $type . 'OnlyCondition';
$queryCondition = $this->session->$queryCondition;
$preAndNextObject = new stdClass();
$preAndNextObject->pre = '';
$preAndNextObject->next = '';
if(empty($queryCondition)) return $preAndNextObject;
$table = $this->config->objectTables[$type];
$orderBy = $type . 'OrderBy';
$orderBy = $this->session->$orderBy;
if(empty($queryCondition) or $this->session->$typeOnlyCondition)
if($this->session->$typeOnlyCondition)
{
$sql = $this->dao->select('*')->from($table)
->beginIF($queryCondition != false)->where($queryCondition)->fi()
->where($queryCondition)
->beginIF($orderBy != false)->orderBy($orderBy)->fi()
->get();
}
@@ -1879,10 +1884,6 @@ EOD;
$existsObjectList = $this->session->$objectIdListKey;
}
$preAndNextObject = new stdClass();
$preAndNextObject->pre = '';
$preAndNextObject->next = '';
$preObj = false;
if(isset($existsObjectList['objectList']))
{