Add test for auto scale and don't rescale. Use find_one when loading StorageArea so as to use caching
This commit is contained in:
parent
34c7ee32ee
commit
77edb8f74b
|
@ -911,7 +911,7 @@ function reScale( $dimension, $dummy ) {
|
|||
$new_dimension = $dimension;
|
||||
for ( $i = 1; $i < func_num_args(); $i++ ) {
|
||||
$scale = func_get_arg( $i );
|
||||
if ( !empty($scale) && $scale != SCALE_BASE )
|
||||
if ( !empty($scale) && ($scale != 'auto') && ($scale != SCALE_BASE) )
|
||||
$new_dimension = (int)(($new_dimension*$scale)/SCALE_BASE);
|
||||
}
|
||||
return( $new_dimension );
|
||||
|
@ -1114,7 +1114,7 @@ function parseFilter(&$filter, $saveToSession=false, $querySep='&') {
|
|||
if ( ! $StorageArea ) {
|
||||
for ( $j = 0; $j < count($terms); $j++ ) {
|
||||
if ( isset($terms[$j]['attr']) and $terms[$j]['attr'] == 'StorageId' and isset($terms[$j]['val']) ) {
|
||||
$StorageArea = new Storage($terms[$j]['val']);
|
||||
$StorageArea = Storage::find_one(array('Id'=>$terms[$j]['val']));
|
||||
break;
|
||||
}
|
||||
} // end foreach remaining term
|
||||
|
@ -1128,7 +1128,7 @@ function parseFilter(&$filter, $saveToSession=false, $querySep='&') {
|
|||
if ( ! $StorageArea ) {
|
||||
for ( $j = $i; $j < count($terms); $j++ ) {
|
||||
if ( isset($terms[$i]['attr']) and $terms[$i]['attr'] == 'StorageId' and isset($terms[$j]['val']) ) {
|
||||
$StorageArea = new Storage($terms[$i]['val']);
|
||||
$StorageArea = Storage::find_one(array('Id'=>$terms[$j]['val']));
|
||||
}
|
||||
} // end foreach remaining term
|
||||
} // end no StorageArea found yet
|
||||
|
@ -1160,7 +1160,7 @@ function parseFilter(&$filter, $saveToSession=false, $querySep='&') {
|
|||
}
|
||||
break;
|
||||
case 'StorageId':
|
||||
$StorageArea = new Storage( $value );
|
||||
$StorageArea = Storage::find_one(array('Id'=>$value));
|
||||
if ( $value != 'NULL' )
|
||||
$value = dbEscape($value);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue