Lines 1247-1319
sub GetItemsInfo {
Link Here
|
1247 |
$data->{'datedue'} = $datedue; |
1247 |
$data->{'datedue'} = $datedue; |
1248 |
|
1248 |
|
1249 |
# get notforloan complete status if applicable |
1249 |
# get notforloan complete status if applicable |
1250 |
my $sthnflstatus = $dbh->prepare( |
1250 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.notforloan', $data->{frameworkcode} ) ) { |
1251 |
'SELECT authorised_value |
1251 |
$data->{notforloanvalue} = C4::Koha::GetAuthorisedValueByCode( $code, $data->{itemnotforloan} ); |
1252 |
FROM marc_subfield_structure |
|
|
1253 |
WHERE kohafield="items.notforloan" |
1254 |
' |
1255 |
); |
1256 |
|
1257 |
$sthnflstatus->execute; |
1258 |
my ($authorised_valuecode) = $sthnflstatus->fetchrow; |
1259 |
if ($authorised_valuecode) { |
1260 |
$sthnflstatus = $dbh->prepare( |
1261 |
"SELECT lib FROM authorised_values |
1262 |
WHERE category=? |
1263 |
AND authorised_value=?" |
1264 |
); |
1265 |
$sthnflstatus->execute( $authorised_valuecode, |
1266 |
$data->{itemnotforloan} ); |
1267 |
my ($lib) = $sthnflstatus->fetchrow; |
1268 |
$data->{notforloanvalue} = $lib; |
1269 |
} |
1252 |
} |
1270 |
|
1253 |
|
1271 |
# get restricted status and description if applicable |
1254 |
# get restricted status and description if applicable |
1272 |
my $restrictedstatus = $dbh->prepare( |
1255 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.restricted', $data->{frameworkcode} ) ) { |
1273 |
'SELECT authorised_value |
1256 |
$data->{restricted} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted} ); |
1274 |
FROM marc_subfield_structure |
1257 |
$data->{restrictedopac} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted}, 'opac' ); |
1275 |
WHERE kohafield="items.restricted" |
|
|
1276 |
' |
1277 |
); |
1278 |
|
1279 |
$restrictedstatus->execute; |
1280 |
($authorised_valuecode) = $restrictedstatus->fetchrow; |
1281 |
if ($authorised_valuecode) { |
1282 |
$restrictedstatus = $dbh->prepare( |
1283 |
"SELECT lib,lib_opac FROM authorised_values |
1284 |
WHERE category=? |
1285 |
AND authorised_value=?" |
1286 |
); |
1287 |
$restrictedstatus->execute( $authorised_valuecode, |
1288 |
$data->{restricted} ); |
1289 |
|
1290 |
if ( my $rstdata = $restrictedstatus->fetchrow_hashref ) { |
1291 |
$data->{restricted} = $rstdata->{'lib'}; |
1292 |
$data->{restrictedopac} = $rstdata->{'lib_opac'}; |
1293 |
} |
1294 |
} |
1258 |
} |
1295 |
|
1259 |
|
1296 |
# my stack procedures |
1260 |
# my stack procedures |
1297 |
my $stackstatus = $dbh->prepare( |
1261 |
if ( my $code = C4::Koha::GetAuthValCode( 'items.stack', $data->{frameworkcode} ) ) { |
1298 |
'SELECT authorised_value |
1262 |
$data->{stack} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{stack} ); |
1299 |
FROM marc_subfield_structure |
|
|
1300 |
WHERE kohafield="items.stack" |
1301 |
' |
1302 |
); |
1303 |
$stackstatus->execute; |
1304 |
|
1305 |
($authorised_valuecode) = $stackstatus->fetchrow; |
1306 |
if ($authorised_valuecode) { |
1307 |
$stackstatus = $dbh->prepare( |
1308 |
"SELECT lib |
1309 |
FROM authorised_values |
1310 |
WHERE category=? |
1311 |
AND authorised_value=? |
1312 |
" |
1313 |
); |
1314 |
$stackstatus->execute( $authorised_valuecode, $data->{stack} ); |
1315 |
my ($lib) = $stackstatus->fetchrow; |
1316 |
$data->{stack} = $lib; |
1317 |
} |
1263 |
} |
1318 |
# Find the last 3 people who borrowed this item. |
1264 |
# Find the last 3 people who borrowed this item. |
1319 |
my $sth2 = $dbh->prepare("SELECT * FROM old_issues,borrowers |
1265 |
my $sth2 = $dbh->prepare("SELECT * FROM old_issues,borrowers |
1320 |
- |
|
|