@@ -, +, @@ an onsite one unchecked onsite checkout box should be already checked --- circ/circulation.pl | 5 ++++- .../mysql/atomicupdate/bug_23686_autocheck_onsitecheckout.perl | 8 ++++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/circulation.pref | 6 ++++++ koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++++ 5 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_23686_autocheck_onsitecheckout.perl --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -148,9 +148,12 @@ my $force_allow_issue = $query->param('forceallow') || 0; if (!C4::Auth::haspermission( C4::Context->userenv->{id} , { circulate => 'force_checkout' } )) { $force_allow_issue = 0; } - my $onsite_checkout = $query->param('onsite_checkout'); +if (C4::Context->preference("OnSiteCheckoutAutoCheck") && $onsite_checkout eq "on") { + $template->param(onsite_checkout => $onsite_checkout); +} + my @failedrenews = $query->multi_param('failedrenew'); # expected to be itemnumbers our %renew_failed = (); for (@failedrenews) { $renew_failed{$_} = 1; } --- a/installer/data/mysql/atomicupdate/bug_23686_autocheck_onsitecheckout.perl +++ a/installer/data/mysql/atomicupdate/bug_23686_autocheck_onsitecheckout.perl @@ -0,0 +1,8 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + + $dbh->do(qq{ + INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES + ('OnSiteCheckoutAutoCheck','0','','onsite Checkout by default if last checkout was an onsite checkout box','YesNo') + }); +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -243,6 +243,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('RecordedBooksLibraryID','','','Library ID for RecordedBooks integration','Integer'), ('OnSiteCheckouts','0','','Enable/Disable the on-site checkouts feature','YesNo'), ('OnSiteCheckoutsForce','0','','Enable/Disable the on-site for all cases (Even if a user is debarred, etc.)','YesNo'), +('OnSiteCheckoutAutoCheck','0','','onsite Checkout by default if last checkout was an onsite checkout box','YesNo'), ('INTRAdidyoumean','',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), ('IntranetBiblioDefaultView','normal','normal|marc|isbd|labeled_marc','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','Choice'), ('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -160,6 +160,12 @@ Circulation: Checkout Policy: - + - pref: OnSiteCheckoutAutoCheck + choices: + yes: Enable + no: Don't enable + - onsite checkout by default if last checkout was an onsite one + - - pref: AutoReturnCheckedOutItems choices: yes: Don't --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -600,7 +600,11 @@ [% ELSE %] + [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %] + + [% ELSE %] + [% END %] [% END %] [% END %] --