- Timestamp:
- 10/07/21 19:03:50 (3 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrForms.pm
r2413 r2478 68 68 manager 69 69 contratType 70 assigned 71 grade 72 BAP 70 73 expire 71 74 endcircuit … … 148 151 contratType 149 152 assigned 153 grade 154 BAP 150 155 department 151 156 managerContact -
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Model/AttrFormsA.pm
r1953 r2478 372 372 sub attr_LIST { 373 373 my ($self, $value) = @_; 374 375 my @values = $self->can_values;376 374 $value ||= ''; 377 375 378 if (@values < 5) { 379 return sprintf(q|<select id="%s" name="%s">%s%s</select>|, 380 $self->htmlid, 381 $self->htmlname, 382 ($self->mandatory ? '' : '<option value="">--</option>'), 383 join(",\n", map { $_ = sprintf('<option value="%s"%s>%s</option>', $_, ($_ eq $value ? ' selected="selected"' : ''), $self->display($_)) } sort $self->can_values), 384 ); 385 } else { 386 my $html = $self->attr_TEXT($self->display($value)); 387 } 376 my $html = $self->attr_TEXT($self->display($value)); 388 377 } 389 378 … … 392 381 return sprintf(q| 393 382 $('[name="%s"]').autocomplete({ 394 delay: 200,383 delay: 100, 395 384 minLength: 0, 396 385 source: '%s', … … 406 395 ); 407 396 } 397 398 sub attr_SELECT { 399 my ($self, $value) = @_; 400 $value ||= ''; 401 402 return sprintf(q|<select id="%s" name="%s">%s%s</select>|, 403 $self->htmlid, 404 $self->htmlname, 405 ($self->mandatory ? '' : '<option value="">--</option>'), 406 join(",\n", map { $_ = sprintf('<option value="%s"%s>%s</option>', $_, ($_ eq $value ? ' selected="selected"' : ''), $self->display($_)) } sort $self->can_values), 407 ); 408 } 409 410 sub attr_SELECT_js { } 408 411 409 412 sub _uri_part { -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Attributes.pm
r2264 r2478 404 404 405 405 sub form_type { 406 407 my @values = $_[0]->can_values; 408 406 409 $_[0]->readonly ? 'LABEL' : 407 410 $_[0]->{formtype} ? $_[0]->{formtype} : 408 $_[0]->has_values_list ? 'LIST':411 $_[0]->has_values_list ? ( scalar(@values) > 15 ? 'LIST' : 'SELECT') : 409 412 $_[0]->real_form_type 410 413 } -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Ldap/User.pm
r2476 r2478 118 118 physicalDeliveryOfficeName => { }, 119 119 ou => { }, 120 employeeType => {}, 120 121 st => { }, 121 122 l => { }, -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Employment.pm
r2385 r2478 8 8 use LATMOS::Accounts::Log; 9 9 use LATMOS::Accounts::I18N; 10 use LATMOS::Accounts::Bases::Sql::User; 10 11 use Date::Parse; 11 12 use DateTime; … … 161 162 label => l('Department'), 162 163 }, 164 grade => { }, 165 BAP => { }, 163 166 company => { 164 167 label => l('Company'), … … 308 311 if (! $base->config("allow_pasted_employment")) { 309 312 # Completed contract are RO, we allow to still set lastday 310 foreach ( qw(endcircuit firstday contratType department managerContact company employer)) {313 foreach (LATMOS::Accounts::Bases::Sql::User::_reported_atributes(), qw(firstday contratType managerContact)) { 311 314 $attrs->{$_}{ro} = sub { 312 315 my ($self) = $_[0]; -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
r2475 r2478 784 784 label => l('Type of contract'), 785 785 }, 786 employeeType => { 787 iname => 'contratType', 788 ro => 1, 789 }, 790 grade => { }, 791 786 792 site => { 787 793 reference => 'site', … … 1395 1401 }, 1396 1402 grade => { }, 1403 BAP => { }, 1397 1404 givenName => { 1398 1405 label => l('First name'), … … 1653 1660 }; 1654 1661 1655 foreach (_reported_atributes(), qw( departmentmanagerContact contratTypeHistory)) {1662 foreach (_reported_atributes(), qw(managerContact contratTypeHistory)) { 1656 1663 $attrs->{$_}{ro} = $employmentro; 1657 1664 } … … 1761 1768 } 1762 1769 1763 sub _reported_atributes { qw(contratType endcircuit hosted assigned requestId company employer ) }1770 sub _reported_atributes { qw(contratType endcircuit hosted assigned requestId company employer department BAP grade) } 1764 1771 1765 1772 =head2 applyCurrentEmployment … … 1791 1798 appliedEmployement => $currentemployment->id, 1792 1799 ); 1793 foreach my $attr (_reported_atributes(), qw( departmentmanagerContact)) {1800 foreach my $attr (_reported_atributes(), qw(managerContact)) { 1794 1801 my $uval = $self->get_attributes($attr) || ''; 1795 1802 my $cval = $currentemployment->get_attributes($attr) || ''; … … 1839 1846 ); 1840 1847 1841 my @attributesToReset = (_reported_atributes(), qw(department));1848 my @attributesToReset = _reported_atributes(); 1842 1849 1843 1850 foreach my $attr (@attributesToReset) {
Note: See TracChangeset
for help on using the changeset viewer.