Lines 1167-1172
If this is set, it is set to C<One Order>.
Link Here
|
1167 |
sub GetItemsInfo { |
1167 |
sub GetItemsInfo { |
1168 |
my ( $biblionumber ) = @_; |
1168 |
my ( $biblionumber ) = @_; |
1169 |
my $dbh = C4::Context->dbh; |
1169 |
my $dbh = C4::Context->dbh; |
|
|
1170 |
|
1171 |
my $sth_auth_val = $dbh->prepare( |
1172 |
'SELECT authorised_value |
1173 |
FROM marc_subfield_structure |
1174 |
WHERE kohafield=? |
1175 |
' |
1176 |
); |
1177 |
|
1178 |
$sth_auth_val->execute("items.notforloan"); |
1179 |
my ($authorised_valuecode_notforloan) = $sth_auth_val->fetchrow; |
1180 |
my $sthnflstatus = $dbh->prepare( |
1181 |
"SELECT lib FROM authorised_values |
1182 |
WHERE category=? |
1183 |
AND authorised_value=?" |
1184 |
); |
1185 |
|
1186 |
$sth_auth_val->execute("items.restricted"); |
1187 |
my ($authorised_valuecode_restricted) = $sth_auth_val->fetchrow; |
1188 |
my $restrictedstatus = $dbh->prepare( |
1189 |
"SELECT lib,lib_opac FROM authorised_values |
1190 |
WHERE category=? |
1191 |
AND authorised_value=?" |
1192 |
); |
1193 |
|
1194 |
$sth_auth_val->execute("items.stack"); |
1195 |
my ($authorised_valuecode_stack) = $sth_auth_val->fetchrow; |
1196 |
my $stackstatus = $dbh->prepare( |
1197 |
"SELECT lib |
1198 |
FROM authorised_values |
1199 |
WHERE category=? |
1200 |
AND authorised_value=? |
1201 |
" |
1202 |
); |
1203 |
|
1170 |
# note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance. |
1204 |
# note biblioitems.* must be avoided to prevent large marc and marcxml fields from killing performance. |
1171 |
my $query = " |
1205 |
my $query = " |
1172 |
SELECT items.*, |
1206 |
SELECT items.*, |
Lines 1185-1191
sub GetItemsInfo {
Link Here
|
1185 |
items.notforloan as itemnotforloan, |
1219 |
items.notforloan as itemnotforloan, |
1186 |
itemtypes.description, |
1220 |
itemtypes.description, |
1187 |
itemtypes.notforloan as notforloan_per_itemtype, |
1221 |
itemtypes.notforloan as notforloan_per_itemtype, |
1188 |
branchurl |
1222 |
branches.branchcode, |
|
|
1223 |
branches.branchname, |
1224 |
branches.branchaddress1, |
1225 |
branches.branchaddress2, |
1226 |
branches.branchaddress3, |
1227 |
branches.branchphone, |
1228 |
branches.branchemail, |
1229 |
branches.branchnotes, |
1230 |
branches.branchurl |
1189 |
FROM items |
1231 |
FROM items |
1190 |
LEFT JOIN branches ON items.holdingbranch = branches.branchcode |
1232 |
LEFT JOIN branches ON items.holdingbranch = branches.branchcode |
1191 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber |
1233 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber |
Lines 1235-1291
sub GetItemsInfo {
Link Here
|
1235 |
# value. |
1277 |
# value. |
1236 |
$count_reserves = $restype; |
1278 |
$count_reserves = $restype; |
1237 |
} |
1279 |
} |
1238 |
#get branch information..... |
|
|
1239 |
my $bsth = $dbh->prepare( |
1240 |
"SELECT * FROM branches WHERE branchcode = ? |
1241 |
" |
1242 |
); |
1243 |
$bsth->execute( $data->{'holdingbranch'} ); |
1244 |
if ( my $bdata = $bsth->fetchrow_hashref ) { |
1245 |
$data->{'branchname'} = $bdata->{'branchname'}; |
1246 |
} |
1247 |
$data->{'datedue'} = $datedue; |
1280 |
$data->{'datedue'} = $datedue; |
1248 |
$data->{'count_reserves'} = $count_reserves; |
1281 |
$data->{'count_reserves'} = $count_reserves; |
1249 |
|
1282 |
|
1250 |
# get notforloan complete status if applicable |
1283 |
# get notforloan complete status if applicable |
1251 |
my $sthnflstatus = $dbh->prepare( |
1284 |
if ($authorised_valuecode_notforloan) { |
1252 |
'SELECT authorised_value |
1285 |
$sthnflstatus->execute( $authorised_valuecode_notforloan, |
1253 |
FROM marc_subfield_structure |
|
|
1254 |
WHERE kohafield="items.notforloan" |
1255 |
' |
1256 |
); |
1257 |
|
1258 |
$sthnflstatus->execute; |
1259 |
my ($authorised_valuecode) = $sthnflstatus->fetchrow; |
1260 |
if ($authorised_valuecode) { |
1261 |
$sthnflstatus = $dbh->prepare( |
1262 |
"SELECT lib FROM authorised_values |
1263 |
WHERE category=? |
1264 |
AND authorised_value=?" |
1265 |
); |
1266 |
$sthnflstatus->execute( $authorised_valuecode, |
1267 |
$data->{itemnotforloan} ); |
1286 |
$data->{itemnotforloan} ); |
1268 |
my ($lib) = $sthnflstatus->fetchrow; |
1287 |
my ($lib) = $sthnflstatus->fetchrow; |
1269 |
$data->{notforloanvalue} = $lib; |
1288 |
$data->{notforloanvalue} = $lib; |
1270 |
} |
1289 |
} |
1271 |
|
1290 |
|
1272 |
# get restricted status and description if applicable |
1291 |
# get restricted status and description if applicable |
1273 |
my $restrictedstatus = $dbh->prepare( |
1292 |
if ($authorised_valuecode_restricted) { |
1274 |
'SELECT authorised_value |
1293 |
$restrictedstatus->execute( $authorised_valuecode_restricted, |
1275 |
FROM marc_subfield_structure |
|
|
1276 |
WHERE kohafield="items.restricted" |
1277 |
' |
1278 |
); |
1279 |
|
1280 |
$restrictedstatus->execute; |
1281 |
($authorised_valuecode) = $restrictedstatus->fetchrow; |
1282 |
if ($authorised_valuecode) { |
1283 |
$restrictedstatus = $dbh->prepare( |
1284 |
"SELECT lib,lib_opac FROM authorised_values |
1285 |
WHERE category=? |
1286 |
AND authorised_value=?" |
1287 |
); |
1288 |
$restrictedstatus->execute( $authorised_valuecode, |
1289 |
$data->{restricted} ); |
1294 |
$data->{restricted} ); |
1290 |
|
1295 |
|
1291 |
if ( my $rstdata = $restrictedstatus->fetchrow_hashref ) { |
1296 |
if ( my $rstdata = $restrictedstatus->fetchrow_hashref ) { |
Lines 1295-1318
sub GetItemsInfo {
Link Here
|
1295 |
} |
1300 |
} |
1296 |
|
1301 |
|
1297 |
# my stack procedures |
1302 |
# my stack procedures |
1298 |
my $stackstatus = $dbh->prepare( |
1303 |
if ($authorised_valuecode_stack) { |
1299 |
'SELECT authorised_value |
1304 |
$stackstatus->execute( $authorised_valuecode_stack, $data->{stack} ); |
1300 |
FROM marc_subfield_structure |
|
|
1301 |
WHERE kohafield="items.stack" |
1302 |
' |
1303 |
); |
1304 |
$stackstatus->execute; |
1305 |
|
1306 |
($authorised_valuecode) = $stackstatus->fetchrow; |
1307 |
if ($authorised_valuecode) { |
1308 |
$stackstatus = $dbh->prepare( |
1309 |
"SELECT lib |
1310 |
FROM authorised_values |
1311 |
WHERE category=? |
1312 |
AND authorised_value=? |
1313 |
" |
1314 |
); |
1315 |
$stackstatus->execute( $authorised_valuecode, $data->{stack} ); |
1316 |
my ($lib) = $stackstatus->fetchrow; |
1305 |
my ($lib) = $stackstatus->fetchrow; |
1317 |
$data->{stack} = $lib; |
1306 |
$data->{stack} = $lib; |
1318 |
} |
1307 |
} |