Changeset 1498 for trunk/LATMOS-Accounts/lib/LATMOS/Accounts
- Timestamp:
- 12/18/15 07:24: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/Address.pm
r1329 r1498 310 310 $data{isMainAddress} = 1; 311 311 } 312 $data{exported} = $user->get_attributes('exported'); 312 313 $class->SUPER::_create($base, $id, %data); 313 314 } -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
r1489 r1498 112 112 ); 113 113 } 114 foreach my $al ($self->object->get_attributes('otheraddress')) { 115 my $obj = $self->base->get_object('address', $al) or next; 116 $obj->_set_c_fields( 117 exported => $value, 118 ); 119 } 114 120 }, 115 121 }, … … 282 288 } else { 283 289 $self->base->log(LA_ERR, "Cannot add forward for %s", 284 $self-> id);290 $self->object->id); 285 291 } 286 292 } … … 873 879 ); 874 880 $sth->execute($self->id); 875 if (my $res = $sth->fetchrow_hashref) { 881 my $res = $sth->fetchrow_hashref; 882 $sth->finish; 883 if ($res) { 876 884 return $res->{name} 877 885 } else { … … 902 910 } 903 911 912 =head2 listEmployment 913 914 Return the ordered list of contract 915 916 =cut 917 918 sub listEmployment { 919 my ($self) = @_; 920 921 my $sth = $self->base->db->prepare_cached( 922 q{ 923 select name from employment where "user" = ? 924 order by lastday desc NULLS first 925 } 926 ); 927 $sth->execute($self->id); 928 my @list = (); 929 while (my $res = $sth->fetchrow_hashref) { 930 push(@list, $res->{name}); 931 } 932 933 @list 934 } 935 904 936 1; 905 937
Note: See TracChangeset
for help on using the changeset viewer.