From 774027c9bdcd3fc8156f936e8be761a3a96dc9f8 Mon Sep 17 00:00:00 2001 From: Naomi Date: Fri, 2 Aug 2013 15:30:35 -0400 Subject: [PATCH] crlf --- .../controllers/PlayouthistoryController.php | 20 +-- airtime_mvc/application/models/Preference.php | 12 +- .../application/services/HistoryService.php | 150 +++++++++--------- 3 files changed, 91 insertions(+), 91 deletions(-) diff --git a/airtime_mvc/application/controllers/PlayouthistoryController.php b/airtime_mvc/application/controllers/PlayouthistoryController.php index 9b14e8feb..06bf794a8 100644 --- a/airtime_mvc/application/controllers/PlayouthistoryController.php +++ b/airtime_mvc/application/controllers/PlayouthistoryController.php @@ -73,9 +73,9 @@ class PlayouthistoryController extends Zend_Controller_Action $historyService = new Application_Service_HistoryService(); $columns = json_encode($historyService->getDatatablesLogSheetColumns()); $script = "localStorage.setItem( 'datatables-historyitem-aoColumns', JSON.stringify($columns) ); "; - - $columns = json_encode($historyService->getDatatablesFileSummaryColumns()); - $script.= "localStorage.setItem( 'datatables-historyfile-aoColumns', JSON.stringify($columns) );"; + + $columns = json_encode($historyService->getDatatablesFileSummaryColumns()); + $script.= "localStorage.setItem( 'datatables-historyfile-aoColumns', JSON.stringify($columns) );"; $this->view->headScript()->appendScript($script); } @@ -213,9 +213,9 @@ class PlayouthistoryController extends Zend_Controller_Action public function configureTemplateAction() { - $CC_CONFIG = Config::getConfig(); - $baseUrl = Application_Common_OsPath::getBaseDir(); - + $CC_CONFIG = Config::getConfig(); + $baseUrl = Application_Common_OsPath::getBaseDir(); + $this->view->headScript()->appendFile($baseUrl.'js/airtime/playouthistory/configuretemplate.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); try { @@ -226,10 +226,10 @@ class PlayouthistoryController extends Zend_Controller_Action $template = $historyService->loadTemplate($templateId); $templateType = $template["type"]; - $supportedTypes = $historyService->getSupportedTemplateTypes(); - - if (!in_array($templateType, $supportedTypes)) { - throw new Exception("Error: $templateType is not supported."); + $supportedTypes = $historyService->getSupportedTemplateTypes(); + + if (!in_array($templateType, $supportedTypes)) { + throw new Exception("Error: $templateType is not supported."); } $getMandatoryFields = "mandatory".ucfirst($templateType)."Fields"; diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 76e10e751..015d400c5 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1378,11 +1378,11 @@ class Application_Model_Preference return self::getValue("history_item_template"); } - public static function SetHistoryFileTemplate($value) { - self::setValue("history_file_template", $value); - } - - public static function GetHistoryFileTemplate() { - return self::getValue("history_file_template"); + public static function SetHistoryFileTemplate($value) { + self::setValue("history_file_template", $value); + } + + public static function GetHistoryFileTemplate() { + return self::getValue("history_file_template"); } } diff --git a/airtime_mvc/application/services/HistoryService.php b/airtime_mvc/application/services/HistoryService.php index 13f6fd96e..dbe3a7e59 100644 --- a/airtime_mvc/application/services/HistoryService.php +++ b/airtime_mvc/application/services/HistoryService.php @@ -640,11 +640,11 @@ class Application_Service_HistoryService return $fields; } - public function mandatoryFileFields() { - - $fields = array("played", MDATA_KEY_TITLE, MDATA_KEY_CREATOR); - - return $fields; + public function mandatoryFileFields() { + + $fields = array("played", MDATA_KEY_TITLE, MDATA_KEY_CREATOR); + + return $fields; } private function defaultItemTemplate() { @@ -666,30 +666,30 @@ class Application_Service_HistoryService /* * Default File Summary Template. Taken from The Czech radio requirements (customer requested this in the past). */ - private function defaultFileTemplate() { - - $template = array(); - $fields = array(); - - $fields[] = array("name" => MDATA_KEY_TITLE, "type" => TEMPLATE_STRING, "isFileMd" => true); + private function defaultFileTemplate() { + + $template = array(); + $fields = array(); + + $fields[] = array("name" => MDATA_KEY_TITLE, "type" => TEMPLATE_STRING, "isFileMd" => true); $fields[] = array("name" => MDATA_KEY_CREATOR, "type" => TEMPLATE_STRING, "isFileMd" => true); $fields[] = array("name" => "played", "type" => TEMPLATE_INT, "isFileMd" => false); $fields[] = array("name" => MDATA_KEY_DURATION, "type" => TEMPLATE_STRING, "isFileMd" => true); $fields[] = array("name" => MDATA_KEY_COMPOSER, "type" => TEMPLATE_STRING, "isFileMd" => true); - $fields[] = array("name" => MDATA_KEY_COPYRIGHT, "type" => TEMPLATE_STRING, "isFileMd" => true); - - $template["name"] = "File Summary ".date("Y-m-d H:i:s")." Template"; - $template["fields"] = $fields; - - return $template; + $fields[] = array("name" => MDATA_KEY_COPYRIGHT, "type" => TEMPLATE_STRING, "isFileMd" => true); + + $template["name"] = "File Summary ".date("Y-m-d H:i:s")." Template"; + $template["fields"] = $fields; + + return $template; } public function loadTemplate($id) { try { - if (!is_numeric($id)) { - throw new Exception("Error: $id is not numeric."); + if (!is_numeric($id)) { + throw new Exception("Error: $id is not numeric."); } $template = CcPlayoutHistoryTemplateQuery::create()->findPk($id, $this->con); @@ -770,25 +770,25 @@ class Application_Service_HistoryService return $this->getTemplates(self::TEMPLATE_TYPE_ITEM); } - public function getFileTemplates() { - return $this->getTemplates(self::TEMPLATE_TYPE_FILE); + public function getFileTemplates() { + return $this->getTemplates(self::TEMPLATE_TYPE_FILE); } private function datatablesColumns($template) { - $columns = array(); - - foreach ($template["fields"] as $index=>$field) { - - $key = $field["name"]; - - $columns[] = array( - "sTitle"=> $key, - "mDataProp"=> $key, - "sClass"=> "his_{$key}" - ); - } - + $columns = array(); + + foreach ($template["fields"] as $index=>$field) { + + $key = $field["name"]; + + $columns[] = array( + "sTitle"=> $key, + "mDataProp"=> $key, + "sClass"=> "his_{$key}" + ); + } + return $columns; } @@ -803,15 +803,15 @@ class Application_Service_HistoryService } } - public function getDatatablesFileSummaryColumns() { - - try { - $template = $this->getConfiguredFileTemplate(); - return $this->datatablesColumns($template); - } - catch (Exception $e) { - throw $e; - } + public function getDatatablesFileSummaryColumns() { + + try { + $template = $this->getConfiguredFileTemplate(); + return $this->datatablesColumns($template); + } + catch (Exception $e) { + throw $e; + } } public function getConfiguredItemTemplate() { @@ -841,46 +841,46 @@ class Application_Service_HistoryService } } - public function getConfiguredFileTemplate() { - - try { - $id = Application_Model_Preference::GetHistoryFileTemplate(); - - if (is_numeric($id)) { - $template = $this->loadTemplate($id); - } - else { - $template = $this->defaultFileTemplate(); - } - return $template; - } - catch (Exception $e) { - throw $e; - } + public function getConfiguredFileTemplate() { + + try { + $id = Application_Model_Preference::GetHistoryFileTemplate(); + + if (is_numeric($id)) { + $template = $this->loadTemplate($id); + } + else { + $template = $this->defaultFileTemplate(); + } + return $template; + } + catch (Exception $e) { + throw $e; + } } - public function setConfiguredFileTemplate($id) { - try { - Application_Model_Preference::SetHistoryFileTemplate($id); - } - catch (Exception $e) { - throw $e; - } + public function setConfiguredFileTemplate($id) { + try { + Application_Model_Preference::SetHistoryFileTemplate($id); + } + catch (Exception $e) { + throw $e; + } } - public function setConfiguredTemplate($id) { - try { + public function setConfiguredTemplate($id) { + try { $template = $this->loadTemplate($id); $type = $template["type"]; $setTemplate = "setConfigured".ucfirst($type)."Template"; - $this->$setTemplate($id); - } - catch (Exception $e) { - throw $e; - } + $this->$setTemplate($id); + } + catch (Exception $e) { + throw $e; + } } public function getConfiguredTemplateIds() { @@ -895,8 +895,8 @@ class Application_Service_HistoryService $configured[] = $id; } - if (is_numeric($id2)) { - $configured[] = $id2; + if (is_numeric($id2)) { + $configured[] = $id2; } return $configured;