Changeset 407
- Timestamp:
- 08/31/09 17:11:21 (15 years ago)
- Location:
- LATMOS-Accounts-Web
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Ajax.pm
r272 r407 56 56 } 57 57 58 sub objattrexist : Local { 59 my ($self, $c, $otype, $attr) = @_; 60 my $base = $c->model('Accounts')->db; 61 my $val = $c->req->param('val'); 62 my @obj = $base->search_objects($otype, "$attr=$val"); 63 64 if (my $filter = $c->req->param('exclude')) { 65 @obj = grep { $_ ne $filter } @obj; 66 } 67 $c->stash->{'exists'} = join(', ', @obj); 68 } 69 58 70 sub end : Private { 59 71 my ( $self, $c ) = @_; -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm
r373 r407 17 17 my $attrs = { 18 18 uid => [ 'Login', 'text:12' ], 19 uidNumber => [ 'UID', 'text :6' ],19 uidNumber => [ 'UID', 'text-U:6' ], 20 20 gidNumber => [ 'GID', 'select:group:gidNumber' ], 21 21 manager => [ 'Responsable', 'select-N:user' ], … … 23 23 sn => [ 'Nom' ], 24 24 givenName => [ 'Prénom' ], 25 homeDirectory => [ 'Home' ],25 homeDirectory => [ 'Home', 'text-U:15' ], 26 26 loginShell => [ 'Shell', 'text-A' ], 27 27 physicalDeliveryOfficeName => [ 'Bureau' ], … … 43 43 site => [ 'Site', 'select-N:site' ], 44 44 co => [ 'Pays' ], 45 mail => [ 'Mail', 'text-U:30' ], 45 46 }; 46 47 … … 187 188 # group list here, really the number ! 188 189 $type ||= 'text'; 189 $type = 'text:6' if (($self->{form} || '') =~ /^group/ && $attr eq 'gidNumber'); 190 my $htmlname = ($self->{object} ? $self->{object}->id . '_' : '') . $attr; 190 $type = 'text-U:6' if (($self->{form} || '') =~ /^group/ && $attr eq 'gidNumber'); 191 my $htmlname = $self->escape(($self->{object} ? $self->{object}->id . '_' : 192 '') . $attr); 191 193 for ($type) { 192 194 /^textarea$/ and return sprintf( … … 280 282 ); 281 283 if ($flag =~ /A/) { 282 $textf .= qq {<span id="${htmlname}_auto_complete"></span>};284 $textf .= qq|<span id="${htmlname}_auto_complete"></span>|; 283 285 $textf .= "\n"; 284 286 $textf .= $self->{c}->prototype->auto_complete_field( 285 287 $htmlname, 286 { 288 { 289 update => "${htmlname}_auto_complete", 287 290 url => $self->{c}->uri_for('/ajax', 'attrvalues', $self->otype, $attr), 288 291 indicator => "${htmlname}_stat", min_chars => 1, 289 292 with => "'val='+document.getElementById('$htmlname').value", 293 frequency => 2, 290 294 } 291 ) . 292 qq|<span style="display:none" id="${htmlname}_stat">Searching...</span>|; 295 ); 293 296 } 297 if ($flag =~ /U/) { 298 $textf .= qq|<span id="${htmlname}_observer_uniq"></span>|; 299 $textf .= "\n"; 300 $textf .= $self->{c}->prototype->observe_field( 301 $htmlname, 302 { 303 update => "${htmlname}_observer_uniq", 304 url => $self->{c}->uri_for('/ajax', 'objattrexist', 305 $self->otype, $attr), 306 frequency => 2, 307 indicator => "${htmlname}_stat", min_chars => 1, 308 with => "'val='+document.getElementById('$htmlname').value" . 309 ($self->{object} ? "+'&exclude=" . $self->{object}->id . "'" : 310 ''), 311 } 312 ); 313 } 314 $textf .= qq|<span style="display:none" id="${htmlname}_stat">Searching...</span>|; 315 294 316 return $textf; 295 317 }; -
LATMOS-Accounts-Web/root/html/users/index.tt
r220 r407 1 1 [% db = c.model('Accounts').db %] 2 <!-- $Id -->2 <!-- $Id$ --> 3 3 <div style="float: right" id="filter"> 4 4 [% INCLUDE 'includes/filter.tt'
Note: See TracChangeset
for help on using the changeset viewer.