This commit is contained in:
Naomi Aro 2013-07-18 01:37:39 -04:00
parent 29c8570ade
commit ec44b81f6a
5 changed files with 93 additions and 93 deletions

View file

@ -39,29 +39,29 @@ class Application_Service_HistoryService
public function getListView($startDT, $endDT, $opts)
{
$this->translateColumns($opts);
$select = array (
"file.track_title as title",
"file.artist_name as artist",
"playout.starts",
"playout.ends",
"playout.history_id"
);
$start = $startDT->format("Y-m-d H:i:s");
$end = $endDT->format("Y-m-d H:i:s");
$historyTable = "(
$this->translateColumns($opts);
$select = array (
"file.track_title as title",
"file.artist_name as artist",
"playout.starts",
"playout.ends",
"playout.history_id"
);
$start = $startDT->format("Y-m-d H:i:s");
$end = $endDT->format("Y-m-d H:i:s");
$historyTable = "(
select history.starts as starts, history.ends as ends,
history.id as history_id, history.file_id as file_id
from cc_playout_history as history
where history.starts >= '{$start}' and history.starts < '{$end}'
) AS playout
left join cc_files as file on (file.id = playout.file_id)";
$results = Application_Model_Datatables::findEntries($this->con, $select, $historyTable, $opts, "history");
history.id as history_id, history.file_id as file_id
from cc_playout_history as history
where history.starts >= '{$start}' and history.starts < '{$end}'
) AS playout
left join cc_files as file on (file.id = playout.file_id)";
$results = Application_Model_Datatables::findEntries($this->con, $select, $historyTable, $opts, "history");
return $results;
}
@ -157,7 +157,7 @@ class Application_Service_HistoryService
/* id is an id in cc_files */
public function makeHistoryFileForm($id) {
try {
$form = new Application_Form_EditHistoryFile();
@ -165,17 +165,17 @@ class Application_Service_HistoryService
$md = $file->getDbColMetadata();
$form->populate(array(
'his_file_id' => $id,
'his_file_title' => $md[MDATA_KEY_TITLE],
'his_file_creator' => $md[MDATA_KEY_CREATOR],
'his_file_composer' => $md[MDATA_KEY_COMPOSER],
'his_file_id' => $id,
'his_file_title' => $md[MDATA_KEY_TITLE],
'his_file_creator' => $md[MDATA_KEY_CREATOR],
'his_file_composer' => $md[MDATA_KEY_COMPOSER],
'his_file_copyright' => $md[MDATA_KEY_COPYRIGHT]
));
return $form;
}
catch (Exception $e) {
Logging::debug($e);
return $form;
}
catch (Exception $e) {
Logging::debug($e);
}
}
@ -203,7 +203,7 @@ class Application_Service_HistoryService
MDATA_KEY_COMPOSER => $data['his_file_composer'],
MDATA_KEY_COPYRIGHT => $data['his_file_copyright']
);
$file->setDbColMetadata($md);
}