Changeset 272
- Timestamp:
- 07/25/09 19:50:20 (15 years ago)
- Location:
- LATMOS-Accounts-Web
- Files:
-
- 11 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web.pm
r229 r272 21 21 Session::Store::FastMmap 22 22 Authentication 23 Prototype 23 24 /; 24 25 -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller.pm
r240 r272 55 55 sub end : ActionClass('RenderView') { 56 56 my ($self, $c) = @_; 57 $c->forward($c->view('TT')); 57 58 $c->model('Accounts')->db->rollback; 58 59 } -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Users.pm
r240 r272 30 30 31 31 sub default : LocalPath { 32 my ( $self, $c, undef, $username, $subform ) = @_;32 my ( $self, $c, undef, $username, $subform, $arg ) = @_; 33 33 34 34 my $base = $c->model('Accounts')->db; -
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm
r237 r272 24 24 givenName => [ 'Prénom' ], 25 25 homeDirectory => [ 'Home' ], 26 loginShell => [ 'Shell' ],26 loginShell => [ 'Shell', 'text-A' ], 27 27 physicalDeliveryOfficeName => [ 'Bureau' ], 28 28 telephoneNumber => [ 'Téléphone' ], 29 29 otherTelephone => [ 'Téléphone (autre)' ], 30 company => [ 'Société' ],30 company => [ 'Société', 'text-A' ], 31 31 l => [ 'Ville' ], 32 32 postalCode => [ 'Code postal' ], … … 154 154 sub attr_label { 155 155 my ($self, $attr) = @_; 156 return $self->escape($attrs->{$attr}[0] || $attr); 156 my $htmlname = ($self->{object} ? $self->{object}->id . '_' : '') . $attr; 157 return sprintf('<label for="%s">%s</label>', 158 $self->escape($htmlname), 159 $self->escape($attrs->{$attr}[0] || $attr) 160 ); 157 161 } 158 162 … … 175 179 for ($type) { 176 180 /^textarea$/ and return sprintf( 177 '<textarea name="%s" cols="40">%s</textarea>', 181 '<textarea id="%s" name="%s" cols="40">%s</textarea>', 182 $self->escape($htmlname), 178 183 $self->escape($htmlname), 179 184 $self->escape($self->attr_raw_value($attr)), … … 191 196 </SCRIPT>} . "\n"; 192 197 $html .= sprintf( 193 '<input type="text" name="%s" value="%s" size="12">', 194 $htmlname, 198 '<input type="text" id="%s" name="%s" value="%s" size="12">', 199 $self->escape($htmlname), 200 $self->escape($htmlname), 195 201 $self->escape($date) 196 202 ); … … 198 204 $html .= qq{ 199 205 <A HREF="#" 200 onClick="cal13.select(document.forms[0].$htmlname,' anchor13','dd/MM/yyyy');return false;"201 TITLE="cal13.select(document.forms[0].$htmlname,' anchor13','dd/MM/yyyy');return false;"202 NAME=" anchor13" ID="anchor13">206 onClick="cal13.select(document.forms[0].$htmlname,'${htmlname}_anc','dd/MM/yyyy');return false;" 207 TITLE="cal13.select(document.forms[0].$htmlname,'${htmlname}_anc','dd/MM/yyyy');return false;" 208 NAME="${htmlname}_anc" ID="${htmlname}_anc"> 203 209 <img src="} . $self->{c}->uri_for(qw(/static icons view-calendar-day.png)) 204 210 . qq{" style="ref"></A>} . "\n"; … … 215 221 my $otype = $2; 216 222 my $keyfield = $3; 217 my $select = sprintf('<select name="%s">', 223 my $select = sprintf('<select id="%s" name="%s">', 224 $self->escape($htmlname), 218 225 $self->escape($htmlname)) . "\n"; 219 226 $select .= '<option value="">--</option>' . "\n" if ($options =~ /N/); … … 231 238 } 232 239 $select .= "</select>\n"; 240 $select .= $self->{c}->prototype->observe_field( $htmlname, { 241 update => "${htmlname}_span", 242 url => $self->{c}->uri_for('/ajax', 'rawattr', $otype), 243 frequency => 1, 244 with => "'attr=displayName&id='+value", 245 }) . 246 qq{<span id="${htmlname}_span"></span>}; 233 247 return $select; 234 248 }; 235 /^text(?::(\d+))?/ and do { 236 return sprintf( 237 '<input type="text" name="%s" value="%s" size="%d">', 249 /^text(-\w+)?(?::(\d+))?/ and do { 250 my $flag = $1 || ''; 251 my $textf = sprintf( 252 '<input type="text" id="%s" name="%s" value="%s" size="%d">', 253 $self->escape($htmlname), 238 254 $self->escape($htmlname), 239 255 $self->escape($self->attr_raw_value($attr)), 240 $ 1|| 30,256 $2 || 30, 241 257 ); 258 if ($flag =~ /A/) { 259 $textf .= qq{<span id="${htmlname}_auto_complete"></span>}; 260 $textf .= "\n"; 261 $textf .= $self->{c}->prototype->auto_complete_field( 262 $htmlname, 263 { 264 url => $self->{c}->uri_for('/ajax', 'attrvalues', $self->otype, $attr), 265 indicator => "${htmlname}_stat", min_chars => 1, 266 with => "'val='+document.getElementById('$htmlname').value", 267 } 268 ) . 269 qq{<span style="display:none" id="${htmlname}_stat">Searching...</span>}; 270 } 271 return $textf; 242 272 }; 243 273 } -
LATMOS-Accounts-Web/root/html/create/user.tt
r246 r272 3 3 <form action="[% c.uri_for('/create', 'user') %]" method="POST"> 4 4 <table border="0"> 5 [% IF step %] 5 6 <tr><td>[% IF idexists %]<img src="[% c.uri_for('/static', 'icons', 'dialog-cancel.png') %]">[% END %] 6 Login:</th><td><input type="text" name="id" value="[% c.req.param('id') | html %]"></td></tr> 7 Login:</td><td><input type="text" name="id" value="[% c.req.param('id') | html %]"></td></tr> 8 [% END %] 7 9 <tr><td>[% form.attr_label('sn') %]</td><td>[% form.attr_field('sn') %]</td></tr> 8 10 <tr><td>[% form.attr_label('givenName') %]</td><td>[% form.attr_field('givenName') %]</td></tr> 9 11 <tr><td>[% form.attr_label('description') %]</td><td>[% form.attr_field('description') %]</td></tr> 10 12 [% IF ! step %] 11 13 <tr><td>Login (si pas de nom)</th><td><input type="text" name="id" value="[% c.req.param('id') | html %]"></td></tr> 12 14 <input type="hidden" name="step" value="1"> 13 15 … … 16 18 <input type="hidden" name="step" value="2"> 17 19 <tr><td>[% form.attr_label('gidNumber') %]</td><td>[% form.attr_field('gidNumber') %]</td></tr> 18 <tr><td>[% form.attr_label('uidNumber') %] </td><td>[% form.attr_field('uidNumber') %]</td></tr>20 <tr><td>[% form.attr_label('uidNumber') %] (attribué)</td><td>[% form.attr_field('uidNumber') %]</td></tr> 19 21 <tr><td>[% form.attr_label('exported') %]</td><td>[% form.attr_field('exported') %]</td></tr> 20 22 -
LATMOS-Accounts-Web/root/html/includes/header.tt
r246 r272 8 8 9 9 <script language="JavaScript" src="[% c.uri_for('/static', 'js', 'CalendarPopup.js') %]"></SCRIPT> 10 <script language="JavaScript" src="[% c.uri_for('/static', 'js', 'prototype.js') %]"></SCRIPT> 11 <script language="JavaScript" src="[% c.uri_for('/static', 'js', 'effects.js') %]"></SCRIPT> 12 <script language="JavaScript" src="[% c.uri_for('/static', 'js', 'dragdrop.js') %]"></SCRIPT> 13 <script language="JavaScript" src="[% c.uri_for('/static', 'js', 'controls.js') %]"></SCRIPT> 14 10 15 11 16 </head>
Note: See TracChangeset
for help on using the changeset viewer.