Ignore:
Timestamp:
12/18/10 17:28:09 (13 years ago)
Author:
nanardon
Message:
  • add search by file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/web/lib/Sophie/Controller/Search.pm

    r130 r134  
    4242    for ($c->req->param('type')) { 
    4343        /^byname$/ and do { 
     44            $c->stash->{sargs} = [ {}, $c->req->param('search') ]; 
    4445            $c->forward('byname', [ $searchspec, $c->req->param('search') || 
    4546                    undef ]); 
     
    4748        }; 
    4849        /^bydep$/ and do { 
    49             $c->forward('bydep', [ $searchspec, $c->req->param('deptype'), grep { $_ } split (/\s+/, 
    50                         $c->req->param('search') || '') ]); 
     50            my @args = ($c->req->param('deptype'), grep { $_ } 
     51                split(/\s+/, $c->req->param('search') || '' )); 
     52            $c->stash->{sargs} = [ {}, @args ], 
     53            $c->forward('bydep', [ $searchspec, @args ]); 
     54            last; 
     55        }; 
     56        /^byfile$/ and do { 
     57            my @args = ($c->req->param('search') || ''); 
     58            $c->stash->{sargs} = [ {}, @args ], 
     59            $c->forward('byfile', [ $searchspec, @args ]); 
    5160            last; 
    5261        }; 
     
    450459    $c->stash->{rs} = $c->model('Base')->resultset('Rpms')->search( 
    451460        { 
    452             $distrs 
    453                 ? { pkgid => { IN => $distrs->get_column('pkgid')->as_query, }, } 
    454                 : (), 
     461            pkgid => { IN => $filers->as_query, }, 
    455462        }, 
    456463    ); 
Note: See TracChangeset for help on using the changeset viewer.