summaryrefslogtreecommitdiffstats
path: root/app/class
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-04-09 04:31:43 -0400
committerMalf Furious <m@lfurio.us>2017-04-09 18:37:31 -0400
commit06e36d6b4009df47b0912c0f5b438171d153558f (patch)
treea33f2f85a3687fca2c94074efe12d7b0f550c66c /app/class
parentdd3aeb526b497ccde45e7ba018e963f2e249387a (diff)
downloadscrott-06e36d6b4009df47b0912c0f5b438171d153558f.tar.gz
scrott-06e36d6b4009df47b0912c0f5b438171d153558f.zip
Add stage function getIssues_ordByDueByNumb()
Diffstat (limited to 'app/class')
-rw-r--r--app/class/stage.class.php19
1 files changed, 19 insertions, 0 deletions
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
@@ -96,6 +96,25 @@ class stage extends object
}
/*
+ * 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
* it. If this stage is the last in its pipeline, nothing is done