Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iss_updated_date_ts to Issue::getDetails, issue_url to Note::getDetails #855

Merged
merged 3 commits into from May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/eventum/class.issue.php
Expand Up @@ -2570,8 +2570,9 @@ public static function getDetails($issue_id, $force_refresh = false)

$res['access_level_name'] = Access::getAccessLevelName($res['iss_access_level']);

// add issue url to simplify client apps
// helpers to simplify client apps
$res['issue_url'] = Setup::getBaseUrl() . 'view.php?id=' . $issue_id;
$res['iss_updated_date_ts'] = Date_Helper::getUnixTimestamp($res['iss_updated_date'], 'GMT');

$returns[$issue_id] = $res;

Expand Down
3 changes: 3 additions & 0 deletions lib/eventum/class.note.php
Expand Up @@ -97,6 +97,9 @@ public static function getDetails($note_id): array
$res['attachments'] = $mail->getAttachment()->getAttachments();
}

// helpers to simplify client apps
$res['issue_url'] = Setup::getBaseUrl() . 'view.php?id=' . $res['not_iss_id'];

/** @deprecated */
$res['timestamp'] = $res['not_created_date_ts'];

Expand Down
4 changes: 3 additions & 1 deletion src/RPC/RemoteApi.php
Expand Up @@ -707,6 +707,8 @@ public function getNoteDetails($note_id, $fields)
throw new RemoteApiException($e->getMessage(), $e->getCode(), $e);
}

$this->checkIssuePermissions($note['not_iss_id']);

if ($fields) {
$note = $this->filterKeys($note, $fields);
}
Expand Down Expand Up @@ -1386,7 +1388,7 @@ private static function getRemoteAssocListByUser($usr_id, $only_customer_project
* @param int $issue_id
* @since 3.2.2
*/
private function checkIssuePermissions($issue_id)
private function checkIssuePermissions(int $issue_id): void
{
$projects = $this->getUserAssignedProjects(false);
$details = $this->getIssueDetails($issue_id);
Expand Down