starting to populate with the template.

This commit is contained in:
Naomi Aro 2013-07-26 11:36:58 -04:00
parent ecb2f81211
commit c7b5592fa9
2 changed files with 62 additions and 40 deletions

View File

@ -207,6 +207,26 @@ class Application_Service_HistoryService
Logging::info($e); Logging::info($e);
throw $e; throw $e;
} }
}
public function populateTemplateItem($values) {
$template = $this->getItemTemplate();
$historyRecord = new CcPlayoutHistory();
$timezoneUTC = new DateTimeZone("UTC");
$timezoneLocal = new DateTimeZone($this->timezone);
$dateTime = new DateTime($values["starts"], $timezoneLocal);
$dateTime->setTimezone($timezoneLocal);
$historyRecord->setDbStarts($dateTime->format("Y-m-d H:i:s"));
$dateTime = new DateTime($result["ends"], $timezoneUTC);
$dateTime->setTimezone($timezoneUTC);
$historyRecord->setDbEnds($dateTime->format("Y-m-d H:i:s"));
} }
public function createPlayedItem($data) { public function createPlayedItem($data) {
@ -245,6 +265,7 @@ class Application_Service_HistoryService
$history_id->setRequired(true); $history_id->setRequired(true);
if ($form->isValid($data)) { if ($form->isValid($data)) {
$history_id->setIgnore(true);
$values = $form->getValues(); $values = $form->getValues();
Logging::info("edited list item"); Logging::info("edited list item");
@ -326,8 +347,8 @@ class Application_Service_HistoryService
$fields = array(); $fields = array();
//array index is the position of the item in the history template table. //array index is the position of the item in the history template table.
$fields[] = array("name" => "start", "type" => TEMPLATE_DATETIME, "isFileMd" => false); $fields[] = array("name" => "starts", "type" => TEMPLATE_DATETIME, "isFileMd" => false);
$fields[] = array("name" => "end", "type" => TEMPLATE_DATETIME, "isFileMd" => false); $fields[] = array("name" => "ends", "type" => TEMPLATE_DATETIME, "isFileMd" => false);
$fields[] = array("name" => MDATA_KEY_TITLE, "type" => TEMPLATE_STRING, "isFileMd" => true); //these fields can be populated from an associated file. $fields[] = array("name" => MDATA_KEY_TITLE, "type" => TEMPLATE_STRING, "isFileMd" => true); //these fields can be populated from an associated file.
$fields[] = array("name" => MDATA_KEY_CREATOR, "type" => TEMPLATE_STRING, "isFileMd" => true); $fields[] = array("name" => MDATA_KEY_CREATOR, "type" => TEMPLATE_STRING, "isFileMd" => true);

View File

@ -58,7 +58,8 @@ var AIRTIME = (function(AIRTIME) {
if (oConfig.sExtends == "pdf") { if (oConfig.sExtends == "pdf") {
this.fnSetText( oFlash, this.fnSetText( oFlash,
"title:"+ this.fnGetTitle(oConfig) +"\n"+ //"title:"+ this.fnGetTitle(oConfig) +"\n"+
"title: Testing the Title Out\n"+
"message:"+ oConfig.sPdfMessage +"\n"+ "message:"+ oConfig.sPdfMessage +"\n"+
"colWidth:"+ this.fnCalcColRatios(oConfig) +"\n"+ "colWidth:"+ this.fnCalcColRatios(oConfig) +"\n"+
"orientation:"+ oConfig.sPdfOrientation +"\n"+ "orientation:"+ oConfig.sPdfOrientation +"\n"+