Ejemplo n.º 1
0
 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.
         $originalDateTime = new DateTime($originalShowStart, new DateTimeZone("UTC"));
         $originalDateTime->setTimezone(new DateTimeZone(date_default_timezone_get()));
         //$timestamp  = Application_Common_DateHelper::ConvertToLocalDateTimeString($originalDateTime->format("Y-m-d H:i:s"));
         $this->view->additionalShowInfo = "Rebroadcast of show \"{$originalShowName}\" from " . $originalDateTime->format("l, F jS") . " at " . $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 = $show->getName();
     unset($this->view->showContent);
 }
 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);
 }