diff options
| author | Malf Furious <m@lfurio.us> | 2017-04-09 04:44:09 -0400 | 
|---|---|---|
| committer | Malf Furious <m@lfurio.us> | 2017-04-09 18:37:31 -0400 | 
| commit | 4cd8b4e9cac6ff104141cfb9154d11353cf9aab5 (patch) | |
| tree | 5461ccf7cbd119a1e4b42976bd08fd2152615201 | |
| parent | 06e36d6b4009df47b0912c0f5b438171d153558f (diff) | |
| download | scrott-4cd8b4e9cac6ff104141cfb9154d11353cf9aab5.tar.gz scrott-4cd8b4e9cac6ff104141cfb9154d11353cf9aab5.zip | |
Add stage function removeStage()
Diffstat (limited to '')
| -rw-r--r-- | app/class/stage.class.php | 19 | 
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(); +    }  }  ?> | 
