Ignore:
Timestamp:
12/17/10 03:26:32 (14 years ago)
Author:
nanardon
Message:
  • support by dep search on web site
File:
1 edited

Legend:

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

    r128 r129  
    2929        $c->req->params->{search} = $c->session->{search}; 
    3030        $c->req->params->{type} = $c->session->{type}; 
     31        $c->req->params->{deptype} = $c->session->{deptype}; 
    3132    } else { 
    3233        $c->session->{search} = $c->req->params->{search}; 
    3334        $c->session->{type} = $c->req->params->{type}; 
     35        $c->session->{deptype} = $c->req->params->{deptype}; 
    3436    } 
    3537 
     
    4244            $c->forward('byname', [ $searchspec, $c->req->param('search') || 
    4345                    undef ]); 
     46            last; 
     47        }; 
     48        /^bydep$/ and do { 
     49            $c->forward('bydep', [ $searchspec, $c->req->param('deptype'), grep { $_ } split (/\s+/, 
     50                        $c->req->param('search') || '') ]); 
    4451            last; 
    4552        }; 
     
    6471 
    6572    } 
     73} 
     74 
     75sub adv_search :Local { 
     76    my ( $self, $c ) = @_; 
    6677} 
    6778 
     
    288299                    ] } 
    289300                    : ()), 
    290                 $distrs 
     301                ($distrs 
    291302                    ? { pkgid => { IN => $distrs->get_column('pkgid')->as_query, }, } 
    292                     : (), 
     303                    : ()), 
    293304            ]      
    294305        }, 
     
    354365                        )->get_column('pkgid')->as_query, }, } 
    355366                : ()), 
     367            ($searchspec->{pkgid} 
     368                ? { pkgid => $searchspec->{pkgid} } 
     369                : ()), 
    356370            ] 
    357371        }, 
     
    381395                ($distrs  
    382396                    ? (pkgid => { IN => $distrs->get_column('pkgid')->as_query, },) 
     397                    : ()), 
     398                ($searchspec->{pkgid} 
     399                    ? { pkgid => $searchspec->{pkgid} } 
    383400                    : ()), 
    384401            ], 
Note: See TracChangeset for help on using the changeset viewer.