From eba84ee87812dae9cb6d1d236476a757be76ebe1 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Tue, 14 Feb 2012 14:44:46 +0100 Subject: [PATCH] CC-3174 : showbuilder disabling editing of past/current shows. --- airtime_mvc/application/models/ShowBuilder.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/ShowBuilder.php b/airtime_mvc/application/models/ShowBuilder.php index fba33c08c..3aec57131 100644 --- a/airtime_mvc/application/models/ShowBuilder.php +++ b/airtime_mvc/application/models/ShowBuilder.php @@ -121,8 +121,12 @@ class Application_Model_ShowBuilder { private function makeScheduledItemRow($p_item) { $row = $this->defaultRowArray; + $epoch_now = time(); - if ($this->user->canSchedule($p_item["show_id"]) == true) { + $showStartDT = new DateTime($p_item["si_starts"], new DateTimeZone("UTC")); + + //can only schedule the show if it hasn't started and you are allowed. + if ($epoch_now < $showStartDT->format('U') && $this->user->canSchedule($p_item["show_id"]) == true) { $row["checkbox"] = true; }