117 |
push( @conditions, ' files.shareid = ' . $param->{'search_share'} ) if ($param->{'search_share'}); |
push( @conditions, ' files.shareid = ' . $param->{'search_share'} ) if ($param->{'search_share'}); |
118 |
push (@conditions, " upper(files.path) LIKE upper('%".$param->{'search_filename'}."%')") if ($param->{'search_filename'}); |
push (@conditions, " upper(files.path) LIKE upper('%".$param->{'search_filename'}."%')") if ($param->{'search_filename'}); |
119 |
|
|
120 |
|
if ( $param->{burned} ) { |
121 |
|
my $is_what = 'is null'; |
122 |
|
$is_what = '= 1' if ($param->{burned} eq 'burned'); |
123 |
|
push @conditions, "archive_burned.part $is_what"; |
124 |
|
push @conditions, "archive_burned.copy $is_what"; |
125 |
|
} |
126 |
|
|
127 |
return join(" and ", @conditions); |
return join(" and ", @conditions); |
128 |
} |
} |
129 |
|
|
219 |
my $where = getWhere($param); |
my $where = getWhere($param); |
220 |
$sql_where = " WHERE ". $where if ($where); |
$sql_where = " WHERE ". $where if ($where); |
221 |
|
|
222 |
|
# do we have to add tables for burned media? |
223 |
|
if ( $param->{burned} ) { |
224 |
|
$sql_from .= qq{ |
225 |
|
LEFT OUTER JOIN archive_backup on archive_backup.backup_id = backups.id |
226 |
|
LEFT OUTER JOIN archive_burned on archive_burned.archive_id = archive_backup.archive_id |
227 |
|
}; |
228 |
|
} |
229 |
|
|
230 |
my $order = getSort('search', 'sql', $param->{'sort'}); |
my $order = getSort('search', 'sql', $param->{'sort'}); |
231 |
|
|
232 |
my $sql_order = qq{ |
my $sql_order = qq{ |