Ejemplo n.º 1
0
 public function cancelShowAction()
 {
     $user = Application_Model_User::getCurrentUser();
     if ($user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
         $showInstanceId = $this->_getParam('id');
         try {
             $showInstance = new Application_Model_ShowInstance($showInstanceId);
         } catch (Exception $e) {
             $this->view->show_error = true;
             return false;
         }
         $show = new Application_Model_Show($showInstance->getShowId());
         $show->cancelShow($showInstance->getShowInstanceStart());
         $this->view->show_id = $showInstance->getShowId();
     }
 }
 public function showContentDialogAction()
 {
     $showInstanceId = $this->_getParam('id');
     try {
         $show = new Application_Model_ShowInstance($showInstanceId);
     } catch (Exception $e) {
         $this->view->show_error = true;
         return false;
     }
     $originalShowId = $show->isRebroadcast();
     if (!is_null($originalShowId)) {
         try {
             $originalShow = new Application_Model_ShowInstance($originalShowId);
         } catch (Exception $e) {
             $this->view->show_error = true;
             return false;
         }
         $originalShowName = $originalShow->getName();
         $originalShowStart = $originalShow->getShowInstanceStart();
         //convert from UTC to user's timezone for display.
         $displayTimeZone = new DateTimeZone(Application_Model_Preference::GetTimezone());
         $originalDateTime = new DateTime($originalShowStart, new DateTimeZone("UTC"));
         $originalDateTime->setTimezone($displayTimeZone);
         $this->view->additionalShowInfo = sprintf(_("Rebroadcast of show %s from %s at %s"), $originalShowName, $originalDateTime->format("l, F jS"), $originalDateTime->format("G:i"));
     }
     $this->view->showLength = $show->getShowLength();
     $this->view->timeFilled = $show->getTimeScheduled();
     $this->view->percentFilled = $show->getPercentScheduled();
     $this->view->showContent = $show->getShowListContent();
     $this->view->dialog = $this->view->render('schedule/show-content-dialog.phtml');
     $this->view->showTitle = htmlspecialchars($show->getName());
     unset($this->view->showContent);
 }