Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
james 2012-09-19 12:51:13 -04:00
commit b2e452acbb
9 changed files with 112 additions and 46 deletions

View file

@ -396,7 +396,6 @@ SQL;
return $possible_ext;
}
// We fallback to guessing the extension from the mimetype if we
// cannot extract it from the file name
@ -993,15 +992,18 @@ SQL;
/**
*
* Enter description here ...
* @param $dir_id - if this is not provided, it returns all files with full path constructed.
* @param $dir_id - if this is not provided, it returns all files with full
* path constructed.
*/
public static function listAllFiles($dir_id=null, $all)
{
$con = Propel::getConnection();
$sql = "SELECT filepath as fp"
." FROM CC_FILES as f"
." WHERE f.directory = :dir_id";
$sql = <<<SQL
SELECT filepath AS fp
FROM CC_FILES AS f
WHERE f.directory = :dir_id
SQL;
if (!$all) {
$sql .= " AND f.file_exists = 'TRUE'";

View file

@ -38,6 +38,7 @@ var AIRTIME = (function(AIRTIME) {
"track_num" : "n",
"year" : "n",
"owner_id" : "s",
"info_url" : "s",
"replay_gain" : "n"
};
@ -1041,6 +1042,7 @@ function addQtipToSCIcons(){
*/
function validateAdvancedSearch(divs) {
var valid = true,
allValid = true,
fieldName,
fields,
searchTerm = Array(),
@ -1053,7 +1055,6 @@ function validateAdvancedSearch(divs) {
searchTerm[0] = "";
searchTerm[1] = "";
$.each(divs, function(i, div){
fieldName = $(div).children(':nth-child(2)').attr('id');
fields = $(div).children().find('input');
@ -1085,6 +1086,7 @@ function validateAdvancedSearch(divs) {
//string fields do not need validation
if (searchTermType !== "s") {
valid = regExpr.test(searchTerm[i]);
if (!valid) allValid = false;
}
addRemoveValidationIcons(valid, $(field));
@ -1107,13 +1109,9 @@ function validateAdvancedSearch(divs) {
return false;
}
});
if (!valid) {
return false;
}
});
return valid;
return allValid;
}
function addRemoveValidationIcons(valid, field) {