Changeset 1887 for trunk/LATMOS-Accounts/lib/LATMOS/Accounts
- Timestamp:
- 12/27/16 18:40:15 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/User.pm
r1865 r1887 892 892 my ($self) = @_; 893 893 my $obj = $self->object; 894 895 my $ec = $obj->_get_c_field('endcircuit'); 896 897 my $date = $ec 898 ? sprintf('%s (%s)', $ec, $obj->_get_c_field('expireText')) 899 : $obj->_get_c_field('expireText'); 900 894 901 my $gecos = sprintf("%s,%s,%s,%s", 895 902 join(' ', grep { $_ } … … 901 908 $obj->_get_c_field('physicalDeliveryOfficeName'))) || '', 902 909 $obj->_get_c_field('telephoneNumber') || '', 903 $ obj->_get_c_field('expireText') || '',910 $date, 904 911 ); 905 912 $gecos =~ s/:/ /g; … … 1085 1092 label => l('Manager'), 1086 1093 }, 1087 expireText => { 1088 ro => 1, 1094 expireTextEC => { 1095 ro => 1, 1096 managed => 1, 1089 1097 get => sub { 1090 1098 my ($self) = @_; … … 1093 1101 sprintf( 1094 1102 q{select to_char(COALESCE(endcircuit, expire), 'YYYY/MM/DD') as expire 1103 from %s where %s = ?}, 1104 $obj->db->quote_identifier($obj->_object_table), 1105 $obj->db->quote_identifier($obj->_key_field), 1106 ) 1107 ); 1108 $sth->execute($obj->id) or $obj->db->rollback; 1109 my $res = $sth->fetchrow_hashref; 1110 $sth->finish; 1111 return $res->{expire} 1112 }, 1113 }, 1114 expireText => { 1115 ro => 1, 1116 managed => 1, 1117 get => sub { 1118 my ($self) = @_; 1119 my $obj = $self->object; 1120 my $sth = $obj->db->prepare_cached( 1121 sprintf( 1122 q{select to_char(expire, 'YYYY/MM/DD') as expire 1095 1123 from %s where %s = ?}, 1096 1124 $obj->db->quote_identifier($obj->_object_table),
Note: See TracChangeset
for help on using the changeset viewer.