From 0789de93925c434bd71f9dd1c3ede0b866b4ca76 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Fri, 19 Sep 2014 13:02:38 -0400 Subject: [PATCH] Updated Show services to account for added show instance description field --- airtime_mvc/application/services/ShowFormService.php | 10 +++++++--- airtime_mvc/application/services/ShowService.php | 10 +++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/airtime_mvc/application/services/ShowFormService.php b/airtime_mvc/application/services/ShowFormService.php index 342e0abea..6f8c0a9b7 100644 --- a/airtime_mvc/application/services/ShowFormService.php +++ b/airtime_mvc/application/services/ShowFormService.php @@ -92,6 +92,7 @@ class Application_Service_ShowFormService * when the user edits a repeating instance */ $forms["what"]->makeReadonly(); + $forms["what"]->enableInstanceDesc(); $forms["repeats"]->disable(); $forms["who"]->disable(); $forms["style"]->disable(); @@ -124,14 +125,17 @@ class Application_Service_ShowFormService private function populateFormWhat($form) { - $form->populate( + $ccShowInstance = CcShowInstancesQuery::create()->findPk($this->instanceId); + + $form->populate( array( 'add_show_instance_id' => $this->instanceId, 'add_show_id' => $this->ccShow->getDbId(), 'add_show_name' => $this->ccShow->getDbName(), 'add_show_url' => $this->ccShow->getDbUrl(), 'add_show_genre' => $this->ccShow->getDbGenre(), - 'add_show_description' => $this->ccShow->getDbDescription())); + 'add_show_description' => $this->ccShow->getDbDescription(), + 'add_show_instance_description' => $ccShowInstance->getDbDescription())); } private function populateFormWhen($form) @@ -292,7 +296,7 @@ class Application_Service_ShowFormService array( 'add_show_background_color' => $this->ccShow->getDbBackgroundColor(), 'add_show_color' => $this->ccShow->getDbColor(), - 'show_logo_current' => $src)); + 'add_show_logo_current' => $src)); } /** diff --git a/airtime_mvc/application/services/ShowService.php b/airtime_mvc/application/services/ShowService.php index e651f6168..198673cd4 100644 --- a/airtime_mvc/application/services/ShowService.php +++ b/airtime_mvc/application/services/ShowService.php @@ -141,9 +141,17 @@ class Application_Service_ShowService $ccShowInstance->updateDbTimeFilled($con); $ccShowInstance->updateScheduleStatus($con); + $ccShowInstance + ->setDbDescription($showData['add_show_instance_description']) + ->save(); + + //delete the edited instance from the repeating sequence - $ccShowInstanceOrig->setDbModifiedInstance(true)->save(); + $ccShowInstanceOrig + ->setDbModifiedInstance(true) + ->setDbDescription($showData['add_show_instance_description']) + ->save(); $con->commit(); Application_Model_RabbitMq::PushSchedule();