Changeset 362
- Timestamp:
- 08/17/09 05:33:11 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm
r272 r362 202 202 ); 203 203 $html .= q{<DIV ID="testdiv1" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>}; 204 $html .= qq {204 $html .= qq| 205 205 <A HREF="#" 206 206 onClick="cal13.select(document.forms[0].$htmlname,'${htmlname}_anc','dd/MM/yyyy');return false;" 207 207 TITLE="cal13.select(document.forms[0].$htmlname,'${htmlname}_anc','dd/MM/yyyy');return false;" 208 208 NAME="${htmlname}_anc" ID="${htmlname}_anc"> 209 <img src="} . $self->{c}->uri_for(qw(/static icons view-calendar-day.png)) 210 . qq{" style="ref"></A>} . "\n"; 209 <img src="| . $self->{c}->uri_for(qw(/static icons view-calendar-day.png)) 210 . qq{" style="ref"></A> 211 } . "\n"; 211 212 return $html; 212 213 }; … … 215 216 $self->escape($htmlname), 216 217 $self->attr_raw_value($attr) ? ' checked="yes"' : '' 217 ); 218 ) . sprintf('<input type="hidden" name="%s">', 219 $self->escape($htmlname)); 218 220 }; 219 221 /^select(-\w+)?:([^:]+)(?::(.*))?$/ and do { … … 221 223 my $otype = $2; 222 224 my $keyfield = $3; 225 my $observe_keyfield = $keyfield || 'displayName'; 223 226 my $select = sprintf('<select id="%s" name="%s">', 224 227 $self->escape($htmlname), … … 226 229 $select .= '<option value="">--</option>' . "\n" if ($options =~ /N/); 227 230 my $value = $self->attr_raw_value($attr) || ''; 231 my $initial_observed = ''; 228 232 foreach my $id ($self->base->list_objects($otype)) { 229 233 my $obj = $self->base->get_object($otype, $id) or next; … … 236 240 ); 237 241 $select .= "\n"; 242 $initial_observed = $obj->get_c_field($observe_keyfield) 243 if($value eq $val); 238 244 } 239 245 $select .= "</select>\n"; … … 242 248 url => $self->{c}->uri_for('/ajax', 'rawattr', $otype), 243 249 frequency => 1, 244 with => "'attr=displayName&id='+value", 250 with => "'attr=" . $observe_keyfield . 251 "&id='+element.options[element.selectedIndex].text", 245 252 }) . 246 qq {<span id="${htmlname}_span"></span>};253 qq|<span id="${htmlname}_span">$initial_observed</span>|; 247 254 return $select; 248 255 }; … … 267 274 } 268 275 ) . 269 qq {<span style="display:none" id="${htmlname}_stat">Searching...</span>};276 qq|<span style="display:none" id="${htmlname}_stat">Searching...</span>|; 270 277 } 271 278 return $textf; … … 292 299 ? ($self->{c}->req->param("$prefix$_") ? 1 : 0) 293 300 : ($self->{c}->req->param("$prefix$_") || undef) 294 } $self->attributes301 } grep { $self->base->get_field_name($self->otype, $_, 'w') } $self->attributes 295 302 ) or return; 296 303 $self->{object}->base->commit;
Note: See TracChangeset
for help on using the changeset viewer.