|
Lines 221-226
sub ldap_entry_2_hash ($$) {
Link Here
|
| 221 |
( substr($borrower{'firstname'},0,1) |
221 |
( substr($borrower{'firstname'},0,1) |
| 222 |
. substr($borrower{ 'surname' },0,1) |
222 |
. substr($borrower{ 'surname' },0,1) |
| 223 |
. " "); |
223 |
. " "); |
|
|
224 |
|
| 225 |
# XXX check if categorycode exists, if not, fallback to default from koha-conf.xml |
| 226 |
my $dbh = C4::Context->dbh; |
| 227 |
my $sth = $dbh->prepare("SELECT categorycode FROM categories WHERE upper(categorycode) = upper(?)"); |
| 228 |
$sth->execute( $borrower{'categorycode'} ); |
| 229 |
if ( my $row = $sth->fetchrow_hashref ) { |
| 230 |
|
| 231 |
} else { |
| 232 |
my $default = $mapping{'categorycode'}->{content}; |
| 233 |
warn "Can't find ", $borrower{'categorycode'}, " default to: $default for ", $borrower{userid}; |
| 234 |
$borrower{'categorycode'} = $default |
| 235 |
} |
| 236 |
|
| 224 |
return %borrower; |
237 |
return %borrower; |
| 225 |
} |
238 |
} |
| 226 |
|
239 |
|
| 227 |
- |
|
|