Changeset 1135 for trunk/LATMOS-Accounts-Web
- Timestamp:
- 09/15/12 08:52:16 (12 years ago)
- Location:
- trunk/LATMOS-Accounts-Web
- Files:
-
- 20 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts-Web/MANIFEST
r1132 r1135 15 15 lib/LATMOS/Accounts/Web/Controller/Admin/Requests.pm 16 16 lib/LATMOS/Accounts/Web/Controller/Ajax.pm 17 lib/LATMOS/Accounts/Web/Controller/Ajax/Services/Mailing.pm 17 18 lib/LATMOS/Accounts/Web/Controller/Aliases.pm 18 19 lib/LATMOS/Accounts/Web/Controller/Create.pm … … 25 26 lib/LATMOS/Accounts/Web/Controller/Rpc.pm 26 27 lib/LATMOS/Accounts/Web/Controller/Search.pm 28 lib/LATMOS/Accounts/Web/Controller/Services/Mailing.pm 27 29 lib/LATMOS/Accounts/Web/Controller/Sites.pm 28 30 lib/LATMOS/Accounts/Web/Controller/Summary/Departments.pm … … 54 56 root/html/ajax/select_freeip_select.tt 55 57 root/html/ajax/select_objects_list.tt 58 root/html/ajax/services/mailing/dest_list.tt 59 root/html/ajax/services/mailing/users_list.tt 56 60 root/html/ajax/set_attrs.tt 57 61 root/html/ajax/user_to_group_form.tt … … 95 99 root/html/request/recorded.tt 96 100 root/html/search/index.tt 101 root/html/services/mailing/filter.tt 102 root/html/services/mailing/index.tt 103 root/html/services/mailing/send.tt 104 root/html/services/mailing/to.tt 97 105 root/html/sites/default.tt 98 106 root/html/sites/index.tt … … 122 130 root/static/icons/document-save-as.png 123 131 root/static/icons/document-save.png 132 root/static/icons/editclear.png 124 133 root/static/icons/emblem-favorite.png 125 134 root/static/icons/emblem-urgent.png 126 135 root/static/icons/expired.png 136 root/static/icons/find.png 127 137 root/static/icons/gnome-session-logout.png 128 138 root/static/icons/gnome-stock-mail-snd.png … … 139 149 root/static/icons/gtk-home.png 140 150 root/static/icons/gtk-jump-to-rtl.png 151 root/static/icons/gtk-refresh.png 141 152 root/static/icons/help-contents.png 142 153 root/static/icons/icon_edit.png … … 198 209 t/04config_load.t 199 210 t/controller_About.t 211 t/controller_Ajax-Services-Mailing.t 200 212 t/controller_Ajax.t 201 213 t/controller_Aliases.t … … 206 218 t/controller_Request.t 207 219 t/controller_Search.t 220 t/controller_Services-Mailing.t 208 221 t/controller_Sites.t 209 222 t/controller_Summary-Department.t -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Ajax.pm
r1107 r1135 46 46 47 47 sub displayattr : Local { 48 my ($self, $c, $otype ) = @_;49 my $attribute = $c->model('Accounts')->db->attribute($otype,50 $c->req->param('attr')) or return;48 my ($self, $c, $otype, $attr) = @_; 49 $attr ||= $c->req->param('attr'); 50 my $attribute = $c->model('Accounts')->db->attribute($otype, $attr) or return; 51 51 $c->stash->{value} = $attribute->display($c->req->param('id')); 52 52 } … … 56 56 57 57 my $base = $c->model('Accounts')->db; 58 my $val = $c->req->param('val'); 59 $c->stash->{'complete'} = $c->prototype->auto_complete_result([ 58 my $val = $c->req->param('val') || ''; 59 $c->stash->{values} = [ 60 sort 60 61 grep { /^\Q$val\E/ } $base->attributes_summary($otype, $attr) 61 ] );62 ]; 62 63 63 64 } -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrFilter.pm
r1131 r1135 41 41 42 42 my @objlist = (); 43 if ($c->req->params->{'q'}) { 44 my %objs; 45 foreach my $attr (@{ $c->config->{objects}{$otype}{quick_search} || [ 'cn' ]}) { 46 foreach ($base->search_objects( 47 $otype, "$attr~" . $c->req->params->{'q'})) { 48 $objs{$_} = 1; 43 if ($c->req->params->{'q'} || exists($c->req->params->{'attr'}) ) { 44 my %objs = (); 45 if ($c->req->params->{'q'}) { 46 foreach my $attr (@{ $c->config->{objects}{$otype}{quick_search} || [ 'cn' ]}) { 47 foreach ($base->search_objects( 48 $otype, "$attr~" . $c->req->params->{'q'})) { 49 $objs{$_} = 1; 50 } 51 @objlist = sort keys %objs; 49 52 } 50 @objlist = sort keys %objs;51 53 } 52 } elsif (exists($c->req->params->{'attr'})) { 53 $self->{filter}{'attr'} = [ $c->req->param('attr') ]; 54 $self->{filter}{'attrval'} = [ $c->req->param('attrval') ]; 55 my @filter = $self->filter; 56 @objlist = $base->search_objects($otype, @filter); 54 55 if (exists($c->req->params->{'attr'})) { 56 $self->{filter}{'attr'} = [ $c->req->param('attr') ]; 57 $self->{filter}{'attrval'} = [ $c->req->param('attrval') ]; 58 my @filter = $self->filter; 59 @objlist = $base->search_objects($otype, @filter); 60 if ($c->req->params->{'q'}) { 61 @objlist = grep { $objs{$_} } @objlist; 62 } 63 } 57 64 } else { 58 65 @objlist = $base->list_objects($otype); -
trunk/LATMOS-Accounts-Web/root/html/ajax/attrvalues.tt
r971 r1135 1 [% complete %] 1 [% IF c.req.param('type') == 'select' %] 2 <select name="toto"> 3 <option value="">--</option> 4 [% FOREACH v = values %] 5 <option value="[% v | html %]">[% v | html %]</option> 6 [% END %] 7 </select> 8 [% ELSE %] 9 [% c.prototype.auto_complete_result(values) %] 10 [% END %] -
trunk/LATMOS-Accounts-Web/root/html/includes/select_objects_list.tt
r1131 r1135 9 9 [% IF objectslist.size < 20 %] 10 10 [% object = c.model('Accounts').db.get_object(ofilter.otype, name) %] 11 <option value="[% name | html %]">[% name | html %] ([% 12 object.get_attributes('displayName') | html %])</option> 11 <option value="[% name | html %]">[% name | html %] 12 [% disp = object.get_attributes('displayName') %] 13 [% IF disp %] 14 ([%disp | html %]) 15 [% END %] 16 </option> 13 17 [% ELSE %] 14 18 <option value="[% name | html %]">[% name | html %]</option>
Note: See TracChangeset
for help on using the changeset viewer.