@@ -, +, @@ circ sidebar --- circ/branchoverdues.pl | 4 +++ circ/branchtransfers.pl | 7 +++- circ/checkout-notes.pl | 8 +++-- circ/circulation.pl | 4 +++ circ/on-site_checkouts.pl | 4 ++- circ/renew.pl | 4 +++ circ/returns.pl | 3 ++ circ/selectbranchprinter.pl | 4 +++ circ/transferstoreceive.pl | 4 +++ circ/view_holdsqueue.pl | 5 ++- circ/waitingreserves.pl | 5 +++ .../intranet-tmpl/prog/en/includes/circ-nav.inc | 4 +++ .../prog/en/modules/circ/checkout-notes.tt | 40 ++++++++++++++-------- 13 files changed, 76 insertions(+), 20 deletions(-) --- a/circ/branchoverdues.pl +++ a/circ/branchoverdues.pl @@ -28,6 +28,7 @@ use C4::Koha; use C4::Debug; use Koha::DateUtils; use Koha::BiblioFrameworks; +use Koha::Checkouts; use Data::Dumper; =head1 branchoverdues.pl @@ -150,10 +151,13 @@ foreach my $num (@getoverdues) { push( @overduesloop, \%overdueforbranch ); } +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; + # initiate the templates for the overdueloop $template->param( overduesloop => \@overduesloop, location => $location, + pending_checkout_notes => $pending_checkout_notes, ); # Checking if there is a Fast Cataloging Framework --- a/circ/branchtransfers.pl +++ a/circ/branchtransfers.pl @@ -33,6 +33,7 @@ use C4::Koha; use C4::Members; use Koha::BiblioFrameworks; use Koha::AuthorisedValues; +use Koha::Checkouts; ############################################### # Getting state @@ -220,6 +221,9 @@ foreach my $code ( keys %$messages ) { # use Data::Dumper; # warn "FINAL ============= ".Dumper(@trsfitemloop); + +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; + $template->param( found => $found, reserved => $reserved, @@ -234,7 +238,8 @@ $template->param( setwaiting => $setwaiting, trsfitemloop => \@trsfitemloop, errmsgloop => \@errmsgloop, - CircAutocompl => C4::Context->preference("CircAutocompl") + CircAutocompl => C4::Context->preference("CircAutocompl"), + pending_checkout_notes => $pending_checkout_notes, ); # Checking if there is a Fast Cataloging Framework --- a/circ/checkout-notes.pl +++ a/circ/checkout-notes.pl @@ -37,10 +37,12 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $schema = Koha::Database->new()->schema(); -my @notes = $schema->resultset('Issue')->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { item => 'biblionumber' } ] }); +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; +my @notes = Koha::Checkouts->search({ 'me.note' => { '!=', undef } }, { prefetch => [ 'borrower', { 'item' => 'biblio' } ] }); + $template->param( - notes => \@notes, + pending_checkout_notes => $pending_checkout_notes, + notes => \@notes, ); my $action; --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -54,6 +54,7 @@ use Koha::Patron::Images; use Koha::SearchEngine; use Koha::SearchEngine::Search; use Koha::Patron::Modifications; +use Koha::Checkouts; use Date::Calc qw( Today @@ -127,6 +128,9 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( } ); +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; +$template->param( pending_checkout_notes => $pending_checkout_notes ); + my $force_allow_issue = $query->param('forceallow') || 0; if (!C4::Auth::haspermission( C4::Context->userenv->{id} , { circulate => 'force_checkout' } )) { $force_allow_issue = 0; --- a/circ/on-site_checkouts.pl +++ a/circ/on-site_checkouts.pl @@ -23,6 +23,7 @@ use C4::Circulation qw( GetPendingOnSiteCheckouts ); use C4::Output; use C4::Koha; use Koha::BiblioFrameworks; +use Koha::Checkouts; my $cgi = new CGI; @@ -39,10 +40,11 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( # Checking if there is a Fast Cataloging Framework $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); - +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; my $pending_onsite_checkouts = C4::Circulation::GetPendingOnSiteCheckouts(); $template->param( + pending_checkout_notes => $pending_checkout_notes, pending_onsite_checkouts => $pending_onsite_checkouts, ); --- a/circ/renew.pl +++ a/circ/renew.pl @@ -28,6 +28,7 @@ use C4::Koha; use Koha::DateUtils; use Koha::Database; use Koha::BiblioFrameworks; +use Koha::Checkouts; my $cgi = new CGI; @@ -121,4 +122,7 @@ if ($barcode) { # Checking if there is a Fast Cataloging Framework $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; +$template->param( pending_checkout_notes => $pending_checkout_notes ); + output_html_with_http_headers( $cgi, $cookie, $template->output ); --- a/circ/returns.pl +++ a/circ/returns.pl @@ -629,6 +629,8 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { push @riloop, \%ri; } +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; + $template->param( riloop => \@riloop, printer => $printer, @@ -640,6 +642,7 @@ $template->param( overduecharges => $overduecharges, AudioAlerts => C4::Context->preference("AudioAlerts"), BlockReturnOfWithdrawnItems => C4::Context->preference("BlockReturnOfWithdrawnItems"), + pending_checkout_notes => $pending_checkout_notes, ); $itemnumber = GetItemnumberFromBarcode( $barcode ); --- a/circ/selectbranchprinter.pl +++ a/circ/selectbranchprinter.pl @@ -28,6 +28,7 @@ use C4::Print; # GetPrinters use C4::Koha; use Koha::BiblioFrameworks; use Koha::Libraries; +use Koha::Checkouts; # this will be the script that chooses branch and printer settings.... @@ -127,11 +128,14 @@ if (scalar @updated and not scalar @recycle_loop) { print $query->redirect($referer || '/cgi-bin/koha/circ/circulation.pl'); } +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; + $template->param( referer => $referer, printerloop => \@printerloop, branch => $branch, recycle_loop=> \@recycle_loop, + pending_checkout_notes => $pending_checkout_notes, ); # Checking if there is a Fast Cataloging Framework --- a/circ/transferstoreceive.pl +++ a/circ/transferstoreceive.pl @@ -39,6 +39,7 @@ use Koha::Items; use Koha::Libraries; use Koha::DateUtils; use Koha::BiblioFrameworks; +use Koha::Checkouts; my $input = new CGI; my $itemnumber = $input->param('itemnumber'); @@ -120,11 +121,14 @@ while ( my $library = $libraries->next ) { push( @branchesloop, \%branchloop ) if %branchloop; } +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; + $template->param( branchesloop => \@branchesloop, show_date => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), TransfersMaxDaysWarning => C4::Context->preference('TransfersMaxDaysWarning'), latetransfers => $latetransfers ? 1 : 0, + pending_checkout_notes => $pending_checkout_notes, ); # Checking if there is a Fast Cataloging Framework --- a/circ/view_holdsqueue.pl +++ a/circ/view_holdsqueue.pl @@ -31,7 +31,7 @@ use C4::Biblio; use C4::Items; use C4::HoldsQueue qw(GetHoldsQueueItems); use Koha::BiblioFrameworks; - +use Koha::Checkouts; use Koha::ItemTypes; my $query = new CGI; @@ -72,8 +72,11 @@ while ( my $itemtype = $itemtypes->next ) { }; } +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; + $template->param( # FIXME Could be improved passing the $itemtypes iterator directly to the template itemtypeloop => \@itemtypesloop, + pending_checkout_notes => $pending_checkout_notes, ); # Checking if there is a Fast Cataloging Framework --- a/circ/waitingreserves.pl +++ a/circ/waitingreserves.pl @@ -37,6 +37,7 @@ use C4::Reserves; use C4::Koha; use Koha::DateUtils; use Koha::BiblioFrameworks; +use Koha::Checkouts; my $input = new CGI; @@ -149,6 +150,9 @@ foreach my $num (@getreserves) { } $template->param(cancel_result => \@cancel_result) if @cancel_result; + +my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; + $template->param( reserveloop => \@reservloop, reservecount => $reservcount, @@ -157,6 +161,7 @@ $template->param( show_date => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), ReservesMaxPickUpDelay => $max_pickup_delay, tab => $tab, + pending_checkout_notes => $pending_checkout_notes, ); # Checking if there is a Fast Cataloging Framework --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc @@ -33,6 +33,10 @@ [% IF ( fast_cataloging ) %][% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
  • Fast cataloging
  • [% END %][% END %] + [% IF ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes ) %] +
  • Checkout notes [% IF ( pending_checkout_notes ) %][% pending_checkout_notes %][% END %]
  • + [% END %] +
    Circulation reports
    --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/checkout-notes.tt @@ -83,9 +83,10 @@ Checkout notes -
    +[% IF Koha.Preference('CircSidebar') %]
    [% ELSE %]
    [% END %]
    + [% IF Koha.Preference('CircSidebar') %]
    [% END %]

    Checkout notes

    @@ -128,20 +129,24 @@ [% FOREACH note IN notes %] - [% note.item.biblionumber.title %] - [% note.item.biblionumber.author %] ([% note.item.barcode %]) + [% note.item.biblio.title %] - [% note.item.biblio.author %] ([% note.item.barcode %]) [% note.note %] [% note.notedate | $KohaDates %] - [% note.borrower.firstname %] [% note.borrower.surname %] ([% note.borrower.cardnumber %]) - [% IF ( note.noteseen == 0 ) %] - Not seen - [% ELSIF ( note.noteseen == 1 ) %] - Seen - [% END %] - [% IF ( note.noteseen == 1 ) %] - - [% ELSIF ( note.noteseen == 0 ) %] - - [% END %] + [% IF ( note.borrower.title ) %][% note.borrower.title %] [% END %][% note.borrower.firstname %] [% note.borrower.surname %] ([% note.borrower.cardnumber %]) + + [% IF ( note.noteseen == 0 ) %] + Not seen + [% ELSIF ( note.noteseen == 1 ) %] + Seen + [% END %] + + + [% IF ( note.noteseen == 1 ) %] + + [% ELSIF ( note.noteseen == 0 ) %] + + [% END %] + [% END %] @@ -158,7 +163,14 @@ [% END %] -
    +
    + + [% IF Koha.Preference('CircSidebar') %] +
    +
    + [% INCLUDE 'circ-nav.inc' %] +
    + [% END %]
    --