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 636-641
item that has a given branch code.
Link Here
|
636 |
|
632 |
|
637 |
sub CheckItemPreSave { |
633 |
sub CheckItemPreSave { |
638 |
my $item_ref = shift; |
634 |
my $item_ref = shift; |
|
|
635 |
require C4::Branch; |
639 |
|
636 |
|
640 |
my %errors = (); |
637 |
my %errors = (); |
641 |
|
638 |
|
Lines 1206-1212
sub GetItemsInfo {
Link Here
|
1206 |
my $ssth = $dbh->prepare("SELECT serialseq,publisheddate from serialitems left join serial on serialitems.serialid=serial.serialid where serialitems.itemnumber=? "); |
1203 |
my $ssth = $dbh->prepare("SELECT serialseq,publisheddate from serialitems left join serial on serialitems.serialid=serial.serialid where serialitems.itemnumber=? "); |
1207 |
while ( my $data = $sth->fetchrow_hashref ) { |
1204 |
while ( my $data = $sth->fetchrow_hashref ) { |
1208 |
my $datedue = ''; |
1205 |
my $datedue = ''; |
1209 |
my $count_reserves; |
|
|
1210 |
$isth->execute( $data->{'itemnumber'} ); |
1206 |
$isth->execute( $data->{'itemnumber'} ); |
1211 |
if ( my $idata = $isth->fetchrow_hashref ) { |
1207 |
if ( my $idata = $isth->fetchrow_hashref ) { |
1212 |
$data->{borrowernumber} = $idata->{borrowernumber}; |
1208 |
$data->{borrowernumber} = $idata->{borrowernumber}; |
Lines 1227-1240
sub GetItemsInfo {
Link Here
|
1227 |
($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); |
1223 |
($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); |
1228 |
$serial = 1; |
1224 |
$serial = 1; |
1229 |
} |
1225 |
} |
1230 |
if ( $datedue eq '' ) { |
|
|
1231 |
my ( $restype, $reserves, undef ) = |
1232 |
C4::Reserves::CheckReserves( $data->{'itemnumber'} ); |
1233 |
# Previous conditional check with if ($restype) is not needed because a true |
1234 |
# result for one item will result in subsequent items defaulting to this true |
1235 |
# value. |
1236 |
$count_reserves = $restype; |
1237 |
} |
1238 |
#get branch information..... |
1226 |
#get branch information..... |
1239 |
my $bsth = $dbh->prepare( |
1227 |
my $bsth = $dbh->prepare( |
1240 |
"SELECT * FROM branches WHERE branchcode = ? |
1228 |
"SELECT * FROM branches WHERE branchcode = ? |
Lines 1245-1251
sub GetItemsInfo {
Link Here
|
1245 |
$data->{'branchname'} = $bdata->{'branchname'}; |
1233 |
$data->{'branchname'} = $bdata->{'branchname'}; |
1246 |
} |
1234 |
} |
1247 |
$data->{'datedue'} = $datedue; |
1235 |
$data->{'datedue'} = $datedue; |
1248 |
$data->{'count_reserves'} = $count_reserves; |
|
|
1249 |
|
1236 |
|
1250 |
# get notforloan complete status if applicable |
1237 |
# get notforloan complete status if applicable |
1251 |
my $sthnflstatus = $dbh->prepare( |
1238 |
my $sthnflstatus = $dbh->prepare( |
Lines 2178-2188
sub MoveItemFromBiblio {
Link Here
|
2178 |
ModZebra( $tobiblio, "specialUpdate", "biblioserver", undef, undef ); |
2165 |
ModZebra( $tobiblio, "specialUpdate", "biblioserver", undef, undef ); |
2179 |
ModZebra( $frombiblio, "specialUpdate", "biblioserver", undef, undef ); |
2166 |
ModZebra( $frombiblio, "specialUpdate", "biblioserver", undef, undef ); |
2180 |
# Checking if the item we want to move is in an order |
2167 |
# Checking if the item we want to move is in an order |
2181 |
my $order = GetOrderFromItemnumber($itemnumber); |
2168 |
require C4::Acquisition; |
|
|
2169 |
my $order = C4::Acquisition::GetOrderFromItemnumber($itemnumber); |
2182 |
if ($order) { |
2170 |
if ($order) { |
2183 |
# Replacing the biblionumber within the order if necessary |
2171 |
# Replacing the biblionumber within the order if necessary |
2184 |
$order->{'biblionumber'} = $tobiblio; |
2172 |
$order->{'biblionumber'} = $tobiblio; |
2185 |
ModOrder($order); |
2173 |
C4::Acquisition::ModOrder($order); |
2186 |
} |
2174 |
} |
2187 |
return $tobiblio; |
2175 |
return $tobiblio; |
2188 |
} |
2176 |
} |
Lines 2437-2445
sub _get_unlinked_subfields_xml {
Link Here
|
2437 |
|
2425 |
|
2438 |
sub _parse_unlinked_item_subfields_from_xml { |
2426 |
sub _parse_unlinked_item_subfields_from_xml { |
2439 |
my $xml = shift; |
2427 |
my $xml = shift; |
2440 |
|
2428 |
require C4::Charset; |
2441 |
return unless defined $xml and $xml ne ""; |
2429 |
return unless defined $xml and $xml ne ""; |
2442 |
my $marc = MARC::Record->new_from_xml(StripNonXmlChars($xml),'UTF-8'); |
2430 |
my $marc = MARC::Record->new_from_xml(C4::Charset::StripNonXmlChars($xml),'UTF-8'); |
2443 |
my $unlinked_subfields = []; |
2431 |
my $unlinked_subfields = []; |
2444 |
my @fields = $marc->fields(); |
2432 |
my @fields = $marc->fields(); |
2445 |
if ($#fields > -1) { |
2433 |
if ($#fields > -1) { |