Changeset 1506 for trunk/LATMOS-Accounts/lib/LATMOS
- Timestamp:
- 12/18/15 18:35:42 (9 years ago)
- Location:
- trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Employment.pm
r1504 r1506 142 142 143 143 if ($expire != $nextexpire) { 144 $user-> _set_c_fields(expire => $endemploy);144 $user->set_fields(expire => $endemploy); 145 145 } 146 146 … … 158 158 159 159 if ($uval ne $cval) { 160 $attrsets{$attr} = $cval; 160 my $oattr = $self->base->attribute('user', $attr); 161 $attrsets{$oattr->iname} = $cval; 161 162 } 162 163 } 163 164 164 165 if (keys %attrsets) { 165 return $user-> _set_c_fields(%attrsets);166 return $user->set_fields(%attrsets); 166 167 } else { 167 168 return 1; -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
r1504 r1506 196 196 monitored => 1, 197 197 }, 198 expire => { inline => 1, formtype => 'DATETIME', monitored => 1, }, 199 endcircuit => { inline => 1, formtype => 'DATE', monitored => 1, }, 198 expire => { 199 ro => sub { !$_[0] and return 1; $_[0]->listEmployment ? 1 : 0 }, 200 inline => 1, 201 formtype => 'DATETIME', 202 monitored => 1, 203 }, 204 endcircuit => { 205 ro => sub { !$_[0] and return 1; $_[0]->listEmployment ? 1 : 0 }, 206 inline => 1, 207 formtype => 'DATE', 208 monitored => 1, 209 }, 200 210 endEmployment => { 201 211 formtype => 'DATETIME', … … 237 247 $listold->execute($self->id); 238 248 my $res = $listold->fetchrow_hashref; 239 $listold->finish; 240 if ($res) { 249 if ($res && $res->{lastday}) { 241 250 $end = DateTime->from_epoch(epoch => str2time($res->{lastday})); 242 251 $end->set_time_zone( DateTime::TimeZone->new( name => 'local' ) ); 243 252 $end->add(hours => 23, minutes => 59, seconds => 59); 244 253 } 254 $listold->finish; 245 255 } 246 256 return $end ? $end->iso8601 : undef … … 473 483 }, 474 484 department => { 485 ro => sub { !$_[0] and return 1; $_[0]->listEmployment ? 1 : 0 }, 475 486 reference => 'group', 476 487 can_values => sub { … … 480 491 }, 481 492 contratType => { 493 ro => sub { !$_[0] and return 1; $_[0]->listEmployment ? 1 : 0 }, 482 494 reference => 'group', 483 495 can_values => sub { … … 797 809 }, 798 810 managerContact => { 811 ro => sub { !$_[0] and return 1; $_[0]->listEmployment ? 1 : 0 }, 799 812 delayed => 1, 800 813 can_values => sub { … … 909 922 encryptedPassword => { }, 910 923 description => { }, 911 company => { }, 924 company => { 925 ro => sub { !$_[0] and return 1; $_[0]->listEmployment ? 1 : 0 }, 926 }, 912 927 comment => { }, 913 928 college => { },
Note: See TracChangeset
for help on using the changeset viewer.