@@ -, +, @@ scripts --- C4/Auth.pm | 4 +++- circ/branchoverdues.pl | 4 ---- circ/branchtransfers.pl | 4 ---- circ/checkout-notes.pl | 6 ------ circ/circulation.pl | 4 ---- circ/on-site_checkouts.pl | 3 --- circ/renew.pl | 4 ---- circ/returns.pl | 4 ---- circ/selectbranchprinter.pl | 4 ---- circ/transferstoreceive.pl | 4 ---- circ/view_holdsqueue.pl | 4 ---- circ/waitingreserves.pl | 4 ---- koha-tmpl/intranet-tmpl/prog/en/includes/circ-nav.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt | 6 +++--- mainpage.pl | 3 --- 15 files changed, 7 insertions(+), 53 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -33,6 +33,7 @@ use C4::Search::History; use Koha; use Koha::Caches; use Koha::AuthUtils qw(get_script_name hash_password); +use Koha::Checkouts; use Koha::DateUtils qw(dt_from_string); use Koha::Library::Groups; use Koha::Libraries; @@ -499,7 +500,8 @@ sub get_template_and_user { EnableBorrowerFiles => C4::Context->preference('EnableBorrowerFiles'), UseKohaPlugins => C4::Context->preference('UseKohaPlugins'), UseCourseReserves => C4::Context->preference("UseCourseReserves"), - useDischarge => C4::Context->preference('useDischarge') + useDischarge => C4::Context->preference('useDischarge'), + pending_checkout_notes => scalar Koha::Checkouts->search({ noteseen => 0 }), ); } else { --- a/circ/branchoverdues.pl +++ a/circ/branchoverdues.pl @@ -27,7 +27,6 @@ use C4::Koha; use C4::Debug; use Koha::DateUtils; use Koha::BiblioFrameworks; -use Koha::Checkouts; use Data::Dumper; =head1 branchoverdues.pl @@ -99,13 +98,10 @@ 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 @@ -35,7 +35,6 @@ use Koha::AuthorisedValues; use Koha::Holds; use Koha::Items; use Koha::Patrons; -use Koha::Checkouts; ############################################### # Getting state @@ -222,8 +221,6 @@ 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, @@ -239,7 +236,6 @@ $template->param( trsfitemloop => \@trsfitemloop, errmsgloop => \@errmsgloop, 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,12 +37,6 @@ 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 $action; foreach (qw( seen notseen )) { $action = $_ if ( $query->param("mark_selected-$_") ); --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -56,7 +56,6 @@ use Koha::Patron::Messages; use Koha::SearchEngine; use Koha::SearchEngine::Search; use Koha::Patron::Modifications; -use Koha::Checkouts; use Date::Calc qw( Today @@ -146,9 +145,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( ); my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; -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,7 +23,6 @@ use C4::Circulation qw( GetPendingOnSiteCheckouts ); use C4::Output; use C4::Koha; use Koha::BiblioFrameworks; -use Koha::Checkouts; my $cgi = new CGI; @@ -40,12 +39,10 @@ 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_onsite_checkouts => $pending_onsite_checkouts, - pending_checkout_notes => $pending_checkout_notes, ); output_html_with_http_headers $cgi, $cookie, $template->output; --- a/circ/renew.pl +++ a/circ/renew.pl @@ -28,7 +28,6 @@ use C4::Koha; use Koha::DateUtils; use Koha::Database; use Koha::BiblioFrameworks; -use Koha::Checkouts; my $cgi = new CGI; @@ -122,7 +121,4 @@ 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 @@ -52,7 +52,6 @@ use Koha::BiblioFrameworks; use Koha::Holds; use Koha::Items; use Koha::Patrons; -use Koha::Checkouts; my $query = new CGI; @@ -580,8 +579,6 @@ 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, @@ -592,7 +589,6 @@ $template->param( forgivemanualholdsexpire => $forgivemanualholdsexpire, overduecharges => $overduecharges, AudioAlerts => C4::Context->preference("AudioAlerts"), - pending_checkout_notes => $pending_checkout_notes, ); $itemnumber = GetItemnumberFromBarcode( $barcode ); --- a/circ/selectbranchprinter.pl +++ a/circ/selectbranchprinter.pl @@ -27,7 +27,6 @@ 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,14 +126,11 @@ 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 @@ -40,7 +40,6 @@ use Koha::Libraries; use Koha::DateUtils; use Koha::BiblioFrameworks; use Koha::Patrons; -use Koha::Checkouts; my $input = new CGI; my $itemnumber = $input->param('itemnumber'); @@ -126,14 +125,11 @@ 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 @@ -30,7 +30,6 @@ use C4::Biblio; use C4::Items; use C4::HoldsQueue qw(GetHoldsQueueItems); use Koha::BiblioFrameworks; -use Koha::Checkouts; use Koha::ItemTypes; my $query = new CGI; @@ -64,9 +63,6 @@ if ( $run_report ) { ); } -my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; -$template->param( pending_checkout_notes => $pending_checkout_notes ); - # Checking if there is a Fast Cataloging Framework $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' ); --- a/circ/waitingreserves.pl +++ a/circ/waitingreserves.pl @@ -39,7 +39,6 @@ use Koha::BiblioFrameworks; use Koha::Items; use Koha::ItemTypes; use Koha::Patrons; -use Koha::Checkouts; my $input = new CGI; @@ -151,8 +150,6 @@ while ( my $hold = $holds->next ) { $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, @@ -161,7 +158,6 @@ $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 @@ -34,7 +34,7 @@
  • Fast cataloging
  • [% END %][% END %] [% IF Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes %] -
  • Checkout notes [% IF pending_checkout_notes %][% pending_checkout_notes %][% END %]
  • +
  • Checkout notes [% IF pending_checkout_notes.count %][% pending_checkout_notes.count %][% END %]
  • [% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt @@ -125,7 +125,7 @@
    [%# Following statement must be in one line for translatability %] - [% IF ( ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_acquisition && pendingsuggestions ) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests) || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes ) %] + [% IF ( ( CAN_user_tools_moderate_comments && pendingcomments ) || ( CAN_user_tools_moderate_tags && pendingtags ) || ( CAN_user_borrowers_edit_borrowers && pending_borrower_modifications ) || ( CAN_user_acquisition && pendingsuggestions ) || ( CAN_user_borrowers_edit_borrowers && pending_discharge_requests ) || pending_article_requests) || ( Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count ) %]
    [% IF pending_article_requests %]
    @@ -172,10 +172,10 @@
    [% END %] - [% IF Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes %] + [% IF Koha.Preference('AllowCheckoutNotes') && CAN_user_circulate_manage_checkout_notes && pending_checkout_notes.count %]
    Checkout notes pending: - [% pending_checkout_notes %] + [% pending_checkout_notes.count %]
    [% END %] --- a/mainpage.pl +++ a/mainpage.pl @@ -31,7 +31,6 @@ use Koha::Patron::Modifications; use Koha::Patron::Discharge; use Koha::Reviews; use Koha::ArticleRequests; -use Koha::Checkouts; my $query = new CGI; @@ -75,7 +74,6 @@ my $pending_article_requests = Koha::ArticleRequests->search_limited( $branch ? ( branchcode => $branch ) : (), } )->count; -my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count; $template->param( pendingcomments => $pendingcomments, @@ -84,7 +82,6 @@ $template->param( pending_borrower_modifications => $pending_borrower_modifications, pending_discharge_requests => $pending_discharge_requests, pending_article_requests => $pending_article_requests, - pending_checkout_notes => $pending_checkout_notes, ); output_html_with_http_headers $query, $cookie, $template->output; --