crlf
This commit is contained in:
parent
c110b4b4df
commit
774027c9bd
3 changed files with 91 additions and 91 deletions
|
@ -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";
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue