/[BackupPC]/trunk/lib/BackupPC/SearchLib.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/BackupPC/SearchLib.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 352 by dpavlin, Tue Apr 11 13:50:06 2006 UTC revision 353 by dpavlin, Wed Apr 26 11:10:54 2006 UTC
# Line 117  sub getWhere($) { Line 117  sub getWhere($) {
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    
# Line 212  sub getFiles($) { Line 219  sub getFiles($) {
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{

Legend:
Removed from v.352  
changed lines
  Added in v.353

  ViewVC Help
Powered by ViewVC 1.1.26