@@ -, +, @@
- the new template circ/circulation_batch_checkouts.tt
- the change into circ/circulation.pl
---
circ/circulation.pl | 41 ++-
.../en/modules/circ/circulation_batch_checkouts.tt | 272 ++++++++++++++++++++
2 files changed, 308 insertions(+), 5 deletions(-)
create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
--- a/circ/circulation.pl
+++ a/circ/circulation.pl
@@ -90,13 +90,33 @@ if (!C4::Context->userenv && !$branch){
}
my $barcodes = [];
+my $batch = $query->param('batch');
if ( my $barcode = $query->param('barcode') ) {
$barcodes = [ $barcode ];
+} else {
+ my $filefh = $query->upload('uploadfile');
+ if ( $filefh ) {
+ while ( my $content = <$filefh> ) {
+ $content =~ s/[\r\n]*$//g;
+ push @$barcodes, $content if $content;
+ }
+ } elsif ( my $list = $query->param('barcodelist') ) {
+ push @$barcodes, split( /\s\n/, $list );
+ $barcodes = [ map { $_ =~ /^\s*$/ ? () : $_ } @$barcodes ];
+ } else {
+ @$barcodes = $query->param('barcodes');
+ }
}
+$barcodes = [ uniq @$barcodes ];
+
+my $template_name = $batch
+ ? q|circ/circulation_batch_checkouts.tt|
+ : q|circ/circulation.tt|;
+
my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
{
- template_name => 'circ/circulation.tt',
+ template_name => $template_name,
query => $query,
type => "intranet",
authnotrequired => 0,
@@ -325,6 +345,7 @@ if (@$barcodes) {
if ( $error->{'UNKNOWN_BARCODE'}
&& C4::Context->preference("itemBarcodeFallbackSearch")
+ && not $batch
)
{
$template_params->{FALLBACK} = 1;
@@ -404,9 +425,16 @@ if (@$barcodes) {
}
push @$checkout_infos, $template_params;
}
-
- $template->param( %{$checkout_infos->[0]} );
- $template->param( barcode => $barcodes->[0] );
+ unless ( $batch ) {
+ $template->param( %{$checkout_infos->[0]} );
+ $template->param( barcode => $barcodes->[0] );
+ } else {
+ my $confirmation_needed = grep { $_->{NEEDSCONFIRMATION} } @$checkout_infos;
+ $template->param(
+ checkout_infos => $checkout_infos,
+ confirmation_needed => $confirmation_needed,
+ );
+ }
}
# reload the borrower info for the sake of reseting the flags.....
@@ -527,6 +555,9 @@ if (C4::Context->preference('ExtendedPatronAttributes')) {
extendedattributes => $attributes
);
}
+my $view = $batch
+ ?'batch_checkout_view'
+ : 'circview';
my @relatives = GetMemberRelatives( $borrower->{'borrowernumber'} );
my $relatives_issues_count =
@@ -559,7 +590,7 @@ $template->param(
totaldue => sprintf('%.2f', $total),
inprocess => $inprocess,
is_child => ($borrowernumber && $borrower->{'category_type'} eq 'C'),
- circview => 1,
+ $view => 1,
soundon => C4::Context->preference("SoundOn"),
fast_cataloging => $fast_cataloging,
CircAutoPrintQuickSlip => C4::Context->preference("CircAutoPrintQuickSlip"),
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt
@@ -0,0 +1,272 @@
+[% USE Branches %]
+[% USE KohaDates %]
+[% IF ( export_remove_fields OR export_with_csv_profile ) %]
+ [% SET exports_enabled = 1 %]
+[% END %]
+[% USE AuthorisedValues %]
+[% INCLUDE 'doc-head-open.inc' %]
+[% SET destination = "circ" %]
+
Koha › Circulation
+[% IF borrowernumber %]
+ › Checking out a batch to [% INCLUDE 'patron-title.inc' invert_name = 1 %]
+[% END %]
+
+[% INCLUDE 'doc-head-close.inc' %]
+[% INCLUDE 'calendar.inc' %]
+[% IF ( UseTablesortForCirc ) %]
+
+[% INCLUDE 'datatables-strings.inc' %]
+[% END %]
+
+
+
+
+
+
+
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'circ-search.inc' %]
+
+
+
+
+
+
+
+
+
+
+[% UNLESS checkout_infos %]
+
+
+[% ELSE %]
+ [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
+
+ [% END %]
+
+
+
+ [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
+
+ [% END %]
+ Barcode
+ Title
+ Information
+
+
+
+ [% FOR checkout_info IN checkout_infos %]
+
+ [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
+
+ [% IF checkout_info.NEEDSCONFIRMATION %]
+
+ [% END %]
+
+ [% END %]
+ [% checkout_info.barcode %]
+
+ [% checkout_info.item.title |html %][% FOREACH subtitl IN checkout_info.item.subtitle %] [% subtitl.subfield %][% END %] [% IF checkout_info.item.author %], by [% checkout_info.item.author %][% END %][% IF ( checkout_info.itme.itemnotes ) %]- [% checkout_info.item.itemnotes %] [% END %] [% checkout_info.item.barcode %]
+
+
+ [% IF checkout_info.NEEDSCONFIRMATION %]
+
+ [% IF checkout_info.AGE_RESTRICTION %]
+ Age restriction [% checkout_info.AGE_RESTRICTION %]
+ [% END %]
+ [% IF checkout_info.DEBT %]
+ The patron has a debt of [% checkout_info.DEBT %]
+ [% END %]
+ [% IF checkout_info.RENEW_ISSUE %]
+ This Item is currently checked out to this patron. Renew?
+ [% END %]
+ [% IF checkout_info.RESERVE_WAITING %]
+ This Item has been waiting for another patron.
+ [% END %]
+ [% IF checkout_info.RESERVED %]
+ This Item has been on hold for another patron.
+ [% END %]
+ [% IF checkout_info.ISSUED_TO_ANOTHER %]
+ This Item is checked out to another patron.
+ [% IF CAN_user_circulate_force_checkout %]
+ Check in and check out?
+ [% END %]
+ [% END %]
+ [% IF checkout_info.TOO_MANY %]
+ Too many checked out.
+ [% END %]
+ [% IF checkout_info.BORRNOTSAMEBRANCH %]
+ This patrons is from a different library ([% checkout_info.BORRNOTSAMEBRANCH %])
+ [% END %]
+ [% IF checkout_ino.PATRON_CANT %]
+ This patron can't check out this item per library circulation policy.
+ [% END %]
+ [% IF checkout_info.NOT_FOR_LOAN_FORCING %]
+ [% IF checkout_info.itemtype_notforloan %]
+ Item type is normally not for loan.
+ [% ELSIF checkout_info.item_notforloan %]
+ [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
+ Item is normally not for loan [% IF item_notforloan_lib %]([% item_notforloan_lib %])[% END %].
+ [% END %]
+ [% END %]
+ [% IF checkout_info.USERBLOCKEDOVERDUE %]
+ Patron has [% checkout_info.USERBLOCKEDOVERDUE %] overdue item(s).
+ [% END %]
+ [% IF checkout_info.ITEM_LOST %]
+ This item has been lost with a status of "[% checkout_info.ITEM_LOST %]".
+ [% END %]
+ [% IF checkout_info.HIGHHOLDS %]
+ High demand item. Loan period shortened to [% checkout_info.HIGHHOLDS.duration %] days (due [% checkout_info.HIGHHOLDS.returndate %]).
+ [% END %]
+ [% IF checkout_info.HIGHHOLDS %]
+
+ [% END %]
+
+ [% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout or checkout_info.HIGHHOLDS ) %]
+ [% IF checkout_info.RESERVED || checkout_info.RESERVE_WAITING %]
+
The hold will be canceled.
+ [% END %]
+ [% END %]
+
+ [% END %]
+
+
+ [% IF checkout_info.alert.ITEM_LOST || checkout_info.alert.OTHER_CHARGES %]
+
+ [% IF checkout_info.alert.ITEM_LOST %]
+ This item has been lost with a status of "[% checkout_info.alert.ITEM_LOST %]".
+ [% END %]
+ [% IF checkout_info.alert.OTHER_CHARGES %]
+ The patron has unpaid charges for reserves, rentals etc of [% checkout_info.alert.OTHER_CHARGES %].
+ [% END %]
+
+ [% END %]
+
+
+ [% IF checkout_info.IMPOSSIBLE %]
+
+ [% IF checkout_info.STATS %]
+ Local use recorded
+ [% END %]
+
+ [% IF checkout_info.NOT_FOR_LOAN %]
+ [% IF checkout_info.itemtype_notforloan %]
+ Item type not for loan.
+ [% ELSIF checkout_info.item_notforloan %]
+ [% item_notforloan_lib = AuthorisedValues.GetByCode( checkout_info.authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
+ Item not for loan [% IF checkout_info.item_notforloan_lib %]([% checkout_info.item_notforloan_lib %])[% END %].
+ [% END %]
+ [% END %]
+ [% IF checkout_info.WTHDRAWN %]
+ Item has been withdrawn
+ [% END %]
+ [% IF checkout_info.RESTRICTED %]
+ Item is restricted
+ [% END %]
+ [% IF checkout_info.GNA %]
+ Patron's address is in doubt
+ [% END %]
+ [% IF checkout_info.CARD_LOST %]
+ Patron's card is lost
+ [% END %]
+ [% IF checkout_info.DEBARRED %]
+ Patron is restricted
+ [% END %]
+ [% IF checkout_info.NO_MORE_RENEWALS %]
+ No more renewals possible
+ [% END %]
+ [% IF checkout_info.EXPIRED %]
+ Patron's card is expired
+ [% END %]
+ [% IF checkout_info.ITEMNOTSAMEBRANCH %]
+ This item belongs to [% Branches.GetName( checkout_info.itemhomebranch ) %] and cannot be checked out from this location.
+ [% END %]
+ [% IF checkout_info.USERBLOCKEDREMAINING %]
+ Patron has had overdue items and is blocked for [% checkout_info.USERBLOCKEDREMAINING %] day(s).
+ [% END %]
+ [% IF checkout_info.USERBLOCKEDOVERDUE %]
+ Checkouts are BLOCKED because patron has overdue items
+ [% END %]
+ [% IF checkout_info.TOO_MANY %]
+ Too many checked out.
+ [% END %]
+ [% IF checkout_info.UNKNOWN_BARCODE %]
+
The barcode was not found [% checkout_info.barcode |html %]
+ [% END %]
+
+ [% END %]
+
+
+ [% END %]
+
+
+
+ [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
+ Please confirm checkout
+
+
+
+
+
+
+
+ [% END %]
+
+[% END %]
+
+
+
+
+
+[% INCLUDE 'circ-menu.inc' %]
+
+
+[% INCLUDE 'intranet-bottom.inc' %]
--