summaryrefslogtreecommitdiffstats
path: root/app/class
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-04-09 04:44:09 -0400
committerMalf Furious <m@lfurio.us>2017-04-09 18:37:31 -0400
commit4cd8b4e9cac6ff104141cfb9154d11353cf9aab5 (patch)
tree5461ccf7cbd119a1e4b42976bd08fd2152615201 /app/class
parent06e36d6b4009df47b0912c0f5b438171d153558f (diff)
downloadscrott-4cd8b4e9cac6ff104141cfb9154d11353cf9aab5.tar.gz
scrott-4cd8b4e9cac6ff104141cfb9154d11353cf9aab5.zip
Add stage function removeStage()
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 08a3708..1142bdd 100644
--- a/app/class/stage.class.php
+++ b/app/class/stage.class.php
@@ -163,6 +163,25 @@ class stage extends object
$stage->saveObj();
$this->saveObj();
}
+
+ /*
+ * Remove this stage object and move all of its issues. Issues are
+ * moved to the given stage object. Additionally, the pad may be
+ * given, in which case, those issues will be closed.
+ */
+ public function removeStage(object $mvt) : void
+ {
+ if (!($prev = $this->getPrev()))
+ $prev = $this->getParent();
+
+ foreach ($this->getIssues_ordByDueByNumb() as $i)
+ $i->setParent($mvt);
+
+ $prev->stage = $this->stage;
+ $prev->saveObj();
+
+ $this->delObj();
+ }
}
?>