CC-1986: Configurable columns for media search
- Fixed some hardcoded array access - Fix js error in ColReorder
This commit is contained in:
parent
d1d01e55ce
commit
cf045652ec
|
@ -228,22 +228,22 @@ class LibraryController extends Zend_Controller_Action
|
||||||
$post = $this->getRequest()->getPost();
|
$post = $this->getRequest()->getPost();
|
||||||
Logging::log(print_r($post, true));
|
Logging::log(print_r($post, true));
|
||||||
$datatables = Application_Model_StoredFile::searchFilesForPlaylistBuilder($post);
|
$datatables = Application_Model_StoredFile::searchFilesForPlaylistBuilder($post);
|
||||||
|
|
||||||
//format clip lengh to 1 decimal
|
//format clip lengh to 1 decimal
|
||||||
foreach($datatables["aaData"] as &$data){
|
foreach($datatables["aaData"] as &$data){
|
||||||
if($data[6] == 'audioclip'){
|
if($data['ftype'] == 'audioclip'){
|
||||||
$file = Application_Model_StoredFile::Recall($data[0]);
|
$file = Application_Model_StoredFile::Recall($data['id']);
|
||||||
$scid = $file->getSoundCloudId();
|
$scid = $file->getSoundCloudId();
|
||||||
if($scid == "-2"){
|
if($scid == "-2"){
|
||||||
$data[1] .= '<span id="'.$data[0].'" class="small-icon progress"></span>';
|
$data['track_title'] .= '<span id="'.$data['id'].'" class="small-icon progress"></span>';
|
||||||
}else if($scid == "-3"){
|
}else if($scid == "-3"){
|
||||||
$data[1] .= '<span id="'.$data[0].'" class="small-icon sc-error"></span>';
|
$data['track_title'] .= '<span id="'.$data['id'].'" class="small-icon sc-error"></span>';
|
||||||
}else if(!is_null($scid)){
|
}else if(!is_null($scid)){
|
||||||
$data[1] .= '<span id="'.$data[0].'" class="small-icon soundcloud"></span>';
|
$data['track_title'] .= '<span id="'.$data['id'].'" class="small-icon soundcloud"></span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$sec = Application_Model_Playlist::playlistTimeToSeconds($data[5]);
|
$sec = Application_Model_Playlist::playlistTimeToSeconds($data['length']);
|
||||||
$data[5] = Application_Model_Playlist::secondsToPlaylistTime($sec);
|
$data['length'] = Application_Model_Playlist::secondsToPlaylistTime($sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
die(json_encode($datatables));
|
die(json_encode($datatables));
|
||||||
|
|
|
@ -524,7 +524,7 @@ function createDataTable(data) {
|
||||||
/* Album */ {"sTitle": "Album", "sName": "album_title", "mDataProp": "album_title", "sClass": "library_album"},
|
/* Album */ {"sTitle": "Album", "sName": "album_title", "mDataProp": "album_title", "sClass": "library_album"},
|
||||||
/* Genre */ {"sTitle": "Genre", "sName": "genre", "mDataProp": "genre", "sWidth": "10%", "sClass": "library_genre"},
|
/* Genre */ {"sTitle": "Genre", "sName": "genre", "mDataProp": "genre", "sWidth": "10%", "sClass": "library_genre"},
|
||||||
/* Year */ {"sTitle": "Year", "sName": "year", "mDataProp": "year", "sWidth": "8%", "sClass": "library_year"},
|
/* Year */ {"sTitle": "Year", "sName": "year", "mDataProp": "year", "sWidth": "8%", "sClass": "library_year"},
|
||||||
/* Length */ {"sTitle": "Length", "sName": "length", "mDataProp": "length", "sWidth": "16%", "sClass": "library_length"},
|
/* Length */ {"sTitle": "Length", "sName": "length", "mDataProp": "length", "sWidth": "10%", "sClass": "library_length"},
|
||||||
/* Type */ {"sTitle": "Type", "sName": "ftype", "bSearchable": false, "mDataProp": "ftype", "sWidth": "9%", "sClass": "library_type"},
|
/* Type */ {"sTitle": "Type", "sName": "ftype", "bSearchable": false, "mDataProp": "ftype", "sWidth": "9%", "sClass": "library_type"},
|
||||||
/* Upload Time */ {"sTitle": "Upload Time", "sName": "utime", "mDataProp": "utime", "sClass": "library_upload_time"},
|
/* Upload Time */ {"sTitle": "Upload Time", "sName": "utime", "mDataProp": "utime", "sClass": "library_upload_time"},
|
||||||
/* Last Modified */ {"sTitle": "Last Modified", "sName": "mtime", "bVisible": false, "mDataProp": "mtime", "sClass": "library_modified_time"},
|
/* Last Modified */ {"sTitle": "Last Modified", "sName": "mtime", "bVisible": false, "mDataProp": "mtime", "sClass": "library_modified_time"},
|
||||||
|
@ -548,7 +548,7 @@ function createDataTable(data) {
|
||||||
"bShowAll": true
|
"bShowAll": true
|
||||||
},
|
},
|
||||||
"oColReorder": {
|
"oColReorder": {
|
||||||
"aiOrder": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] /* code this */,
|
"aiOrder": [ 0, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] /* code this */,
|
||||||
"iFixedColumns": 3
|
"iFixedColumns": 3
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -573,6 +573,6 @@ $(document).ready(function() {
|
||||||
checkImportStatus();
|
checkImportStatus();
|
||||||
setInterval( "checkImportStatus()", 5000 );
|
setInterval( "checkImportStatus()", 5000 );
|
||||||
setInterval( "checkSCUploadStatus()", 5000 );
|
setInterval( "checkSCUploadStatus()", 5000 );
|
||||||
|
|
||||||
addQtipToSCIcons()
|
addQtipToSCIcons()
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue