From 9f52eca642bb3a1814b92260575290844c5b056d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Sun, 28 Jun 2009 14:37:38 +0200 Subject: [PATCH] Properly handle queued apps with more than one version --- include/application_queue.php | 12 ++++++++++++ include/version.php | 3 +++ 2 files changed, 15 insertions(+) diff --git a/include/application_queue.php b/include/application_queue.php index c2b31e2..c3c51d1 100644 --- a/include/application_queue.php +++ b/include/application_queue.php @@ -99,6 +99,18 @@ class application_queue $this->oApp->unQueue(); $this->oVersionQueue->unQueue(); + + /* Has anyone submitted new versions while the app was queued? + If so we need to change their state from pending to queued */ + $aOtherVersions = $this->oApp->objectGetChildrenClassSpecific('version'); + foreach($aOtherVersions as $oVersion) + { + if($oVersion->objectGetState() == 'pending') + { + $oVersion->objectSetState('queued'); + $oVersion->update(); + } + } } function reQueue() diff --git a/include/version.php b/include/version.php index 055a530..b1bceae 100644 --- a/include/version.php +++ b/include/version.php @@ -247,6 +247,9 @@ class version { } } + if($this->objectGetState() != $oVersion->objectGetState()) + query_parameters("UPDATE appVersion SET state = '?' WHERE versionId = '?'", $this->objectGetState(), $this->objectGetId()); + if($sWhatChanged and !$bSilent) $this->SendNotificationMail("edit",$sWhatChanged); return true;