CC-3174 : showbuilder

fix ordering problem with track column.
This commit is contained in:
Naomi Aro 2012-02-20 11:41:44 +01:00
parent 44dccf15ce
commit 17c3cdcfb2
2 changed files with 19 additions and 23 deletions

View File

@ -556,7 +556,7 @@ class Application_Model_StoredFile {
*
* @return string $runtime
*/
private static function formatDuration($dt){
private static function formatDuration($dt) {
$hours = $dt->format("H");
$min = $dt->format("i");
@ -569,7 +569,7 @@ class Application_Model_StoredFile {
$hours = $p_interval->format("%h");
$mins = $p_interval->format("%i");
if( $hours == 0) {
if ( $hours == 0) {
$runtime = $p_interval->format("%i:%S");
}
else {
@ -579,8 +579,7 @@ class Application_Model_StoredFile {
return $runtime;
}
public static function searchFilesForPlaylistBuilder($datatables)
{
public static function searchFilesForPlaylistBuilder($datatables) {
global $CC_CONFIG;
$displayData = array("track_title", "artist_name", "album_title", "genre", "length", "year", "utime", "mtime", "ftype", "track_number");
@ -610,9 +609,6 @@ class Application_Model_StoredFile {
} else if ($key === "mtime") {
$plSelect .= $key.", ";
$fileSelect .= $key.", ";
} else if ($key === "track_number") {
$plSelect .= "NULL AS ".$key.", ";
$fileSelect .= $key.", ";
} else {
$plSelect .= "NULL AS ".$key.", ";
$fileSelect .= $key.", ";
@ -627,7 +623,7 @@ class Application_Model_StoredFile {
$results = Application_Model_StoredFile::searchFiles($fromTable, $datatables);
foreach($results['aaData'] as &$row){
foreach ($results['aaData'] as &$row) {
$row['id'] = intval($row['id']);
@ -649,7 +645,7 @@ class Application_Model_StoredFile {
//TODO url like this to work on both playlist/showbuilder screens.
//datatable stuff really needs to be pulled out and generalized within the project
//access to zend view methods to access url helpers is needed.
if($type == "au") {
if ($type == "au") {
$row['image'] = '<img src="/css/images/icon_audioclip.png">';
}
else {
@ -738,7 +734,7 @@ class Application_Model_StoredFile {
}
//display sql executed in airtime log for testing
//Logging::log($sql);
Logging::log($sql);
$results = $CC_DBC->getAll($sql);

View File

@ -310,7 +310,7 @@ function createDataTable(data) {
/* Length */ {"sTitle": "Length", "sName": "length", "mDataProp": "length", "sClass": "library_length"},
/* Upload Time */ {"sTitle": "Uploaded", "sName": "utime", "mDataProp": "utime", "sClass": "library_upload_time"},
/* Last Modified */ {"sTitle": "Last Modified", "sName": "mtime", "bVisible": false, "mDataProp": "mtime", "sClass": "library_modified_time"},
/* Track Number */ {"sTitle": "Track", "sName": "track", "bSearchable": false, "bVisible": false, "mDataProp": "track_number", "sClass": "library_track"}
/* Track Number */ {"sTitle": "Track", "sName": "track_number", "bSearchable": false, "bVisible": false, "mDataProp": "track_number", "sClass": "library_track"}
],
"aaSorting": [[2,'asc']],
"sPaginationType": "full_numbers",