From 4cd8b4e9cac6ff104141cfb9154d11353cf9aab5 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 9 Apr 2017 04:44:09 -0400 Subject: Add stage function removeStage() --- app/class/stage.class.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'app/class/stage.class.php') 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(); + } } ?> -- cgit v1.2.3