CC-733 : playout history
translating mDataProp values to be able to search table on backend
This commit is contained in:
parent
53b8eb2724
commit
c66b55ec17
|
@ -15,6 +15,15 @@ class Application_Model_PlayoutHistory {
|
||||||
private $epoch_now;
|
private $epoch_now;
|
||||||
private $opts;
|
private $opts;
|
||||||
|
|
||||||
|
private $mDataPropMap = array(
|
||||||
|
"artist" => "file.artist_name",
|
||||||
|
"title" => "file.track_title",
|
||||||
|
"played" => "playout.played",
|
||||||
|
"length" => "file.length",
|
||||||
|
"composer" => "file.composer",
|
||||||
|
"copyright" => "file.copyright",
|
||||||
|
);
|
||||||
|
|
||||||
public function __construct($p_startDT, $p_endDT, $p_opts) {
|
public function __construct($p_startDT, $p_endDT, $p_opts) {
|
||||||
|
|
||||||
$this->con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
|
$this->con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
|
||||||
|
@ -25,8 +34,21 @@ class Application_Model_PlayoutHistory {
|
||||||
$this->opts = $p_opts;
|
$this->opts = $p_opts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* map front end mDataProp labels to proper column names for searching etc.
|
||||||
|
*/
|
||||||
|
private function translateColumns() {
|
||||||
|
|
||||||
|
for ($i = 0; $i < $this->opts["iColumns"]; $i++){
|
||||||
|
|
||||||
|
$this->opts["mDataProp_{$i}"] = $this->mDataPropMap[$this->opts["mDataProp_{$i}"]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function getItems() {
|
public function getItems() {
|
||||||
|
|
||||||
|
$this->translateColumns();
|
||||||
|
|
||||||
$select = array(
|
$select = array(
|
||||||
"file.track_title as title",
|
"file.track_title as title",
|
||||||
"file.artist_name as artist",
|
"file.artist_name as artist",
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
table-layout:fixed;
|
table-layout:fixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
#library_display th {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#library_content #library_display {
|
#library_content #library_display {
|
||||||
width:100%;
|
width:100%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -510,6 +510,11 @@ dl.inline-list dd {
|
||||||
border-width: 1px 1px 1px 1px;
|
border-width: 1px 1px 1px 1px;
|
||||||
width:100%;
|
width:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.datatable th {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
.datatable tr td, .datatable tr th {
|
.datatable tr td, .datatable tr th {
|
||||||
border-color: #b1b1b1;
|
border-color: #b1b1b1;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
|
@ -671,7 +676,6 @@ button.ColVis_Button.ColVis_ShowAll {
|
||||||
|
|
||||||
.library_length {
|
.library_length {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding-right: 1em !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----END Data Table----*/
|
/*----END Data Table----*/
|
||||||
|
|
|
@ -18,7 +18,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
{"sTitle": "Title", "mDataProp": "title", "sClass": "his_title"}, /* Title */
|
{"sTitle": "Title", "mDataProp": "title", "sClass": "his_title"}, /* Title */
|
||||||
{"sTitle": "Artist", "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
|
{"sTitle": "Artist", "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
|
||||||
{"sTitle": "Played", "mDataProp": "played", "sClass": "his_artist"}, /* times played */
|
{"sTitle": "Played", "mDataProp": "played", "sClass": "his_artist"}, /* times played */
|
||||||
{"sTitle": "Length", "mDataProp": "length", "sClass": "his_length"}, /* Length */
|
{"sTitle": "Length", "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */
|
||||||
{"sTitle": "Composer", "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
|
{"sTitle": "Composer", "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
|
||||||
{"sTitle": "Copyright", "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
|
{"sTitle": "Copyright", "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
|
||||||
],
|
],
|
||||||
|
@ -51,6 +51,7 @@ var AIRTIME = (function(AIRTIME) {
|
||||||
|
|
||||||
"sDom": 'lfr<"H"><"dataTables_scrolling"t><"F"ip>',
|
"sDom": 'lfr<"H"><"dataTables_scrolling"t><"F"ip>',
|
||||||
});
|
});
|
||||||
|
oTable.fnSetFilteringDelay(350);
|
||||||
};
|
};
|
||||||
|
|
||||||
return AIRTIME;
|
return AIRTIME;
|
||||||
|
|
Loading…
Reference in New Issue