Ignore:
Timestamp:
08/07/12 18:26:33 (12 years ago)
Author:
nanardon
Message:

Add filter to object list

Location:
trunk/LATMOS-Accounts-Web
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/MANIFEST

    r1084 r1107  
    5555root/html/ajax/set_attrs.tt 
    5656root/html/ajax/user_to_group_form.tt 
     57root/html/ajax/select_objects_list.tt 
    5758root/html/aliases/default.tt 
    5859root/html/aliases/index.tt 
     
    7576root/html/includes/obj_prev_next.tt 
    7677root/html/includes/sidebar.tt 
     78root/html/includes/select_objects_list.tt 
    7779root/html/login.tt 
    7880root/html/logout.tt 
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Ajax.pm

    r1081 r1107  
    185185} 
    186186 
     187sub select_objects_list : Local { 
     188    my ($self, $c, $otype) = @_; 
     189    $c->stash->{ofilter} = $c->model('AttrFilter', $otype); 
     190} 
     191 
    187192sub end : Private { 
    188193    my ( $self, $c ) = @_; 
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Request.pm

    r982 r1107  
    4242    if ($accreq->get_attributes('requireObject')) { 
    4343        if (!$obj) { 
     44            $c->stash->{ofilter} = $c->model('AttrFilter', $otype); 
    4445            $c->stash->{select_object} = 1; 
    4546            return; 
  • trunk/LATMOS-Accounts-Web/root/html/request/default.tt

    r971 r1107  
    55[% IF select_object %] 
    66<form action="[% c.uri_for('/request', accreq.id) %]"> 
    7 <select name="obj" id="obj"> 
    8 <option value="">--</option> 
    9 [% FOREACH objname = c.model('accounts').db.list_objects(accreq.get_attributes('oType')) %] 
    10 <option value="[% objname | html %]">[% objname | html %]</option> 
    11 [% END %] 
    12 </select> 
     7<input name=q value="[% c.req.param('q') | html %]" id="q"><br> 
     8 
     9<span style="display:none" id="list_objects_ind">Searching...</span> 
     10[% c.prototype.observe_field('q', { 
     11    url => c.uri_for('/ajax', 'select_objects_list', ofilter.otype), 
     12    with   => "'q='+value", 
     13    update => 'list_objects', 
     14    frequency => 1, 
     15    before => "document.getElementById('list_objects_ind').style.display='block';", 
     16    loaded => "document.getElementById('list_objects_ind').style.display='none';", 
     17}) %] 
     18 
     19<div id="list_objects"> 
     20[% INCLUDE 'includes/select_objects_list.tt' %] 
     21</div> 
    1322 
    1423[% c.prototype.observe_field( 'obj', 
Note: See TracChangeset for help on using the changeset viewer.