From 8bdf3508b0d98adf29acb888c29fb30e0f0800ab Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 19 Feb 2013 13:38:35 -0500 Subject: [PATCH] CC-4951: Add cue in and cue out to library filter columns Done --- airtime_mvc/application/models/StoredFile.php | 18 +++++++++++++++--- .../public/js/airtime/library/library.js | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 1c8d83873..87d3bd62f 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -645,7 +645,8 @@ SQL; "track_number", "mood", "bpm", "composer", "info_url", "bit_rate", "sample_rate", "isrc_number", "encoded_by", "label", "copyright", "mime", "language", "filepath", "owner_id", - "conductor", "replay_gain", "lptime", "is_playlist", "is_scheduled" ); + "conductor", "replay_gain", "lptime", "is_playlist", "is_scheduled", + "cuein", "cueout" ); } public static function searchLibraryFiles($datatables) @@ -702,6 +703,11 @@ SQL; $blSelect[] = "NULL::boolean AS ".$key; $fileSelect[] = $key; $streamSelect[] = "NULL::boolean AS ".$key; + } elseif ($key === "cuein" || $key === "cueout") { + $plSelect[] = "NULL::INTERVAL AS ".$key; + $blSelect[] = "NULL::INTERVAL AS ".$key; + $fileSelect[] = $key; + $streamSelect[] = "NULL::INTERVAL AS ".$key; } //same columns in each table. else if (in_array($key, array("length", "utime", "mtime"))) { @@ -783,8 +789,14 @@ SQL; foreach ($results['aaData'] as &$row) { $row['id'] = intval($row['id']); - $formatter = new LengthFormatter($row['length']); - $row['length'] = $formatter->format(); + $len_formatter = new LengthFormatter($row['length']); + $row['length'] = $len_formatter->format(); + + $cuein_formatter = new LengthFormatter($row["cuein"]); + $row["cuein"] = $cuein_formatter->format(); + + $cueout_formatter = new LengthFormatter($row["cueout"]); + $row["cueout"] = $cueout_formatter->format(); if ($row['ftype'] === "audioclip") { $formatter = new SamplerateFormatter($row['sample_rate']); diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 89a03a90f..af30bbfa7 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -467,6 +467,8 @@ var AIRTIME = (function(AIRTIME) { /* Composer */ { "sTitle" : $.i18n._("Composer") , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" }, /* Conductor */ { "sTitle" : $.i18n._("Conductor") , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" }, /* Copyright */ { "sTitle" : $.i18n._("Copyright") , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" }, + /* Cue In */ { "sTitle" : $.i18n._("Cue In") , "mDataProp" : "cuein" , "bVisible" : false , "sClass" : "library_length" , "sWidth" : "80px" }, + /* Cue Out */ { "sTitle" : $.i18n._("Cue Out") , "mDataProp" : "cueout" , "bVisible" : false , "sClass" : "library_length" , "sWidth" : "80px" }, /* Encoded */ { "sTitle" : $.i18n._("Encoded By") , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" }, /* Genre */ { "sTitle" : $.i18n._("Genre") , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" }, /* ISRC Number */ { "sTitle" : $.i18n._("ISRC") , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },