|
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 628-633
item that has a given branch code.
Link Here
|
| 628 |
|
624 |
|
| 629 |
sub CheckItemPreSave { |
625 |
sub CheckItemPreSave { |
| 630 |
my $item_ref = shift; |
626 |
my $item_ref = shift; |
|
|
627 |
require C4::Branch; |
| 631 |
|
628 |
|
| 632 |
my %errors = (); |
629 |
my %errors = (); |
| 633 |
|
630 |
|
|
Lines 1198-1204
sub GetItemsInfo {
Link Here
|
| 1198 |
my $ssth = $dbh->prepare("SELECT serialseq,publisheddate from serialitems left join serial on serialitems.serialid=serial.serialid where serialitems.itemnumber=? "); |
1195 |
my $ssth = $dbh->prepare("SELECT serialseq,publisheddate from serialitems left join serial on serialitems.serialid=serial.serialid where serialitems.itemnumber=? "); |
| 1199 |
while ( my $data = $sth->fetchrow_hashref ) { |
1196 |
while ( my $data = $sth->fetchrow_hashref ) { |
| 1200 |
my $datedue = ''; |
1197 |
my $datedue = ''; |
| 1201 |
my $count_reserves; |
|
|
| 1202 |
$isth->execute( $data->{'itemnumber'} ); |
1198 |
$isth->execute( $data->{'itemnumber'} ); |
| 1203 |
if ( my $idata = $isth->fetchrow_hashref ) { |
1199 |
if ( my $idata = $isth->fetchrow_hashref ) { |
| 1204 |
$data->{borrowernumber} = $idata->{borrowernumber}; |
1200 |
$data->{borrowernumber} = $idata->{borrowernumber}; |
|
Lines 1218-1231
sub GetItemsInfo {
Link Here
|
| 1218 |
($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); |
1214 |
($data->{'serialseq'} , $data->{'publisheddate'}) = $ssth->fetchrow_array(); |
| 1219 |
$serial = 1; |
1215 |
$serial = 1; |
| 1220 |
} |
1216 |
} |
| 1221 |
if ( $datedue eq '' ) { |
1217 |
|
| 1222 |
my ( $restype, $reserves ) = |
|
|
| 1223 |
C4::Reserves::CheckReserves( $data->{'itemnumber'} ); |
| 1224 |
# Previous conditional check with if ($restype) is not needed because a true |
| 1225 |
# result for one item will result in subsequent items defaulting to this true |
| 1226 |
# value. |
| 1227 |
$count_reserves = $restype; |
| 1228 |
} |
| 1229 |
#get branch information..... |
1218 |
#get branch information..... |
| 1230 |
my $bsth = $dbh->prepare( |
1219 |
my $bsth = $dbh->prepare( |
| 1231 |
"SELECT * FROM branches WHERE branchcode = ? |
1220 |
"SELECT * FROM branches WHERE branchcode = ? |
|
Lines 1236-1242
sub GetItemsInfo {
Link Here
|
| 1236 |
$data->{'branchname'} = $bdata->{'branchname'}; |
1225 |
$data->{'branchname'} = $bdata->{'branchname'}; |
| 1237 |
} |
1226 |
} |
| 1238 |
$data->{'datedue'} = $datedue; |
1227 |
$data->{'datedue'} = $datedue; |
| 1239 |
$data->{'count_reserves'} = $count_reserves; |
|
|
| 1240 |
|
1228 |
|
| 1241 |
# get notforloan complete status if applicable |
1229 |
# get notforloan complete status if applicable |
| 1242 |
my $sthnflstatus = $dbh->prepare( |
1230 |
my $sthnflstatus = $dbh->prepare( |
|
Lines 2070-2080
sub MoveItemFromBiblio {
Link Here
|
| 2070 |
ModZebra( $tobiblio, "specialUpdate", "biblioserver", undef, undef ); |
2058 |
ModZebra( $tobiblio, "specialUpdate", "biblioserver", undef, undef ); |
| 2071 |
ModZebra( $frombiblio, "specialUpdate", "biblioserver", undef, undef ); |
2059 |
ModZebra( $frombiblio, "specialUpdate", "biblioserver", undef, undef ); |
| 2072 |
# Checking if the item we want to move is in an order |
2060 |
# Checking if the item we want to move is in an order |
| 2073 |
my $order = GetOrderFromItemnumber($itemnumber); |
2061 |
require C4::Acquisition; |
|
|
2062 |
my $order = C4::Acquisition::GetOrderFromItemnumber($itemnumber); |
| 2074 |
if ($order) { |
2063 |
if ($order) { |
| 2075 |
# Replacing the biblionumber within the order if necessary |
2064 |
# Replacing the biblionumber within the order if necessary |
| 2076 |
$order->{'biblionumber'} = $tobiblio; |
2065 |
$order->{'biblionumber'} = $tobiblio; |
| 2077 |
ModOrder($order); |
2066 |
C4::Acquisition::ModOrder($order); |
| 2078 |
} |
2067 |
} |
| 2079 |
return $tobiblio; |
2068 |
return $tobiblio; |
| 2080 |
} |
2069 |
} |
|
Lines 2325-2333
sub _get_unlinked_subfields_xml {
Link Here
|
| 2325 |
|
2314 |
|
| 2326 |
sub _parse_unlinked_item_subfields_from_xml { |
2315 |
sub _parse_unlinked_item_subfields_from_xml { |
| 2327 |
my $xml = shift; |
2316 |
my $xml = shift; |
| 2328 |
|
2317 |
require C4::Charset; |
| 2329 |
return unless defined $xml and $xml ne ""; |
2318 |
return unless defined $xml and $xml ne ""; |
| 2330 |
my $marc = MARC::Record->new_from_xml(StripNonXmlChars($xml),'UTF-8'); |
2319 |
my $marc = MARC::Record->new_from_xml(C4::Charset::StripNonXmlChars($xml),'UTF-8'); |
| 2331 |
my $unlinked_subfields = []; |
2320 |
my $unlinked_subfields = []; |
| 2332 |
my @fields = $marc->fields(); |
2321 |
my @fields = $marc->fields(); |
| 2333 |
if ($#fields > -1) { |
2322 |
if ($#fields > -1) { |