|
Lines 228-233
sub ldap_entry_2_hash ($$) {
Link Here
|
| 228 |
( substr($borrower{'firstname'},0,1) |
228 |
( substr($borrower{'firstname'},0,1) |
| 229 |
. substr($borrower{ 'surname' },0,1) |
229 |
. substr($borrower{ 'surname' },0,1) |
| 230 |
. " "); |
230 |
. " "); |
|
|
231 |
|
| 232 |
# check if categorycode exists, if not, fallback to default from koha-conf.xml |
| 233 |
my $dbh = C4::Context->dbh; |
| 234 |
my $sth = $dbh->prepare("SELECT categorycode FROM categories WHERE categorycode = ?"); |
| 235 |
$sth->execute( uc($borrower{'categorycode'}) ); |
| 236 |
unless ( my $row = $sth->fetchrow_hashref ) { |
| 237 |
my $default = $mapping{'categorycode'}->{content}; |
| 238 |
$debug && warn "Can't find ", $borrower{'categorycode'}, " default to: $default for ", $borrower{userid}; |
| 239 |
$borrower{'categorycode'} = $default |
| 240 |
} |
| 241 |
|
| 231 |
return %borrower; |
242 |
return %borrower; |
| 232 |
} |
243 |
} |
| 233 |
|
244 |
|
| 234 |
- |
|
|