From 06e36d6b4009df47b0912c0f5b438171d153558f Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 9 Apr 2017 04:31:43 -0400 Subject: Add stage function getIssues_ordByDueByNumb() --- app/class/stage.class.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'app') diff --git a/app/class/stage.class.php b/app/class/stage.class.php index 1d21dcb..08a3708 100644 --- a/app/class/stage.class.php +++ b/app/class/stage.class.php @@ -95,6 +95,25 @@ class stage extends object return $stages; } + /* + * Get all issues in this stage, sorted by due date, then by + * issue number. + */ + public function getIssues_ordByDueByNumb() : array + { + $query = "SELECT o.guid FROM objects o JOIN issues i ON o.guid = i.guid " . + "WHERE o.objtype = 'issue' AND o.parent = '" . database::esc($this->guid) . + "' ORDER BY i.due, i.numb"; + $res = database::query($query); + + $issues = array(); + + foreach ($res as $i) + $issues[] = new issue($i['guid']); + + return $issues; + } + /* * Reorder the stages of a pipeline by moving this one forward. * This swaps the places of the current stage and the one following -- cgit v1.2.3