|
Lines 29-38
use C4::Dates qw/format_date format_date_in_iso/;
Link Here
|
| 29 |
use MARC::Record; |
29 |
use MARC::Record; |
| 30 |
use C4::ClassSource; |
30 |
use C4::ClassSource; |
| 31 |
use C4::Log; |
31 |
use C4::Log; |
| 32 |
use C4::Branch; |
|
|
| 33 |
require C4::Reserves; |
| 34 |
use C4::Charset; |
| 35 |
use C4::Acquisition; |
| 36 |
use List::MoreUtils qw/any/; |
32 |
use List::MoreUtils qw/any/; |
| 37 |
use Data::Dumper; # used as part of logging item record changes, not just for |
33 |
use Data::Dumper; # used as part of logging item record changes, not just for |
| 38 |
# debugging; so please don't remove this |
34 |
# debugging; so please don't remove this |
|
Lines 640-645
item that has a given branch code.
Link Here
|
| 640 |
|
636 |
|
| 641 |
sub CheckItemPreSave { |
637 |
sub CheckItemPreSave { |
| 642 |
my $item_ref = shift; |
638 |
my $item_ref = shift; |
|
|
639 |
require C4::Branch; |
| 643 |
|
640 |
|
| 644 |
my %errors = (); |
641 |
my %errors = (); |
| 645 |
|
642 |
|
|
Lines 1210-1216
sub GetItemsInfo {
Link Here
|
| 1210 |
my $ssth = $dbh->prepare("SELECT serialseq,publisheddate from serialitems left join serial on serialitems.serialid=serial.serialid where serialitems.itemnumber=? "); |
1207 |
my $ssth = $dbh->prepare("SELECT serialseq,publisheddate from serialitems left join serial on serialitems.serialid=serial.serialid where serialitems.itemnumber=? "); |
| 1211 |
while ( my $data = $sth->fetchrow_hashref ) { |
1208 |
while ( my $data = $sth->fetchrow_hashref ) { |
| 1212 |
my $datedue = ''; |
1209 |
my $datedue = ''; |
| 1213 |
my $count_reserves; |
|
|
| 1214 |
$isth->execute( $data->{'itemnumber'} ); |
1210 |
$isth->execute( $data->{'itemnumber'} ); |
| 1215 |
if ( my $idata = $isth->fetchrow_hashref ) { |
1211 |
if ( my $idata = $isth->fetchrow_hashref ) { |
| 1216 |
$data->{borrowernumber} = $idata->{borrowernumber}; |
1212 |
$data->{borrowernumber} = $idata->{borrowernumber}; |
|
Lines 1231-1244
sub GetItemsInfo {
Link Here
|
| 1231 |
($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); |
1227 |
($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); |
| 1232 |
$serial = 1; |
1228 |
$serial = 1; |
| 1233 |
} |
1229 |
} |
| 1234 |
if ( $datedue eq '' ) { |
|
|
| 1235 |
my ( $restype, $reserves, undef ) = |
| 1236 |
C4::Reserves::CheckReserves( $data->{'itemnumber'} ); |
| 1237 |
# Previous conditional check with if ($restype) is not needed because a true |
| 1238 |
# result for one item will result in subsequent items defaulting to this true |
| 1239 |
# value. |
| 1240 |
$count_reserves = $restype; |
| 1241 |
} |
| 1242 |
#get branch information..... |
1230 |
#get branch information..... |
| 1243 |
my $bsth = $dbh->prepare( |
1231 |
my $bsth = $dbh->prepare( |
| 1244 |
"SELECT * FROM branches WHERE branchcode = ? |
1232 |
"SELECT * FROM branches WHERE branchcode = ? |
|
Lines 1249-1255
sub GetItemsInfo {
Link Here
|
| 1249 |
$data->{'branchname'} = $bdata->{'branchname'}; |
1237 |
$data->{'branchname'} = $bdata->{'branchname'}; |
| 1250 |
} |
1238 |
} |
| 1251 |
$data->{'datedue'} = $datedue; |
1239 |
$data->{'datedue'} = $datedue; |
| 1252 |
$data->{'count_reserves'} = $count_reserves; |
|
|
| 1253 |
|
1240 |
|
| 1254 |
# get notforloan complete status if applicable |
1241 |
# get notforloan complete status if applicable |
| 1255 |
my $sthnflstatus = $dbh->prepare( |
1242 |
my $sthnflstatus = $dbh->prepare( |
|
Lines 2182-2192
sub MoveItemFromBiblio {
Link Here
|
| 2182 |
ModZebra( $tobiblio, "specialUpdate", "biblioserver", undef, undef ); |
2169 |
ModZebra( $tobiblio, "specialUpdate", "biblioserver", undef, undef ); |
| 2183 |
ModZebra( $frombiblio, "specialUpdate", "biblioserver", undef, undef ); |
2170 |
ModZebra( $frombiblio, "specialUpdate", "biblioserver", undef, undef ); |
| 2184 |
# Checking if the item we want to move is in an order |
2171 |
# Checking if the item we want to move is in an order |
| 2185 |
my $order = GetOrderFromItemnumber($itemnumber); |
2172 |
require C4::Acquisition; |
|
|
2173 |
my $order = C4::Acquisition::GetOrderFromItemnumber($itemnumber); |
| 2186 |
if ($order) { |
2174 |
if ($order) { |
| 2187 |
# Replacing the biblionumber within the order if necessary |
2175 |
# Replacing the biblionumber within the order if necessary |
| 2188 |
$order->{'biblionumber'} = $tobiblio; |
2176 |
$order->{'biblionumber'} = $tobiblio; |
| 2189 |
ModOrder($order); |
2177 |
C4::Acquisition::ModOrder($order); |
| 2190 |
} |
2178 |
} |
| 2191 |
return $tobiblio; |
2179 |
return $tobiblio; |
| 2192 |
} |
2180 |
} |
|
Lines 2441-2449
sub _get_unlinked_subfields_xml {
Link Here
|
| 2441 |
|
2429 |
|
| 2442 |
sub _parse_unlinked_item_subfields_from_xml { |
2430 |
sub _parse_unlinked_item_subfields_from_xml { |
| 2443 |
my $xml = shift; |
2431 |
my $xml = shift; |
| 2444 |
|
2432 |
require C4::Charset; |
| 2445 |
return unless defined $xml and $xml ne ""; |
2433 |
return unless defined $xml and $xml ne ""; |
| 2446 |
my $marc = MARC::Record->new_from_xml(StripNonXmlChars($xml),'UTF-8'); |
2434 |
my $marc = MARC::Record->new_from_xml(C4::Charset::StripNonXmlChars($xml),'UTF-8'); |
| 2447 |
my $unlinked_subfields = []; |
2435 |
my $unlinked_subfields = []; |
| 2448 |
my @fields = $marc->fields(); |
2436 |
my @fields = $marc->fields(); |
| 2449 |
if ($#fields > -1) { |
2437 |
if ($#fields > -1) { |