From 2f4df16070c5e6ba820d4fe4ad20fd30f5277049 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 25 Aug 2016 14:03:31 +0000 Subject: [PATCH] [SIGNED-OFF] Bug 10300 - Allow transferring of items to be have separate IndependentBranches syspref Some libraries want to have IndependentBranches enabled, but still be able to transfer items between themselves. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Enable IndpendentBranches and IndependentBranchesTransfers 4) Log in as a super librarian 5) Note you can transfer items 6) Log in as a non-super librarian 7) Note you cannot transfer items 8) Disable IndependentBranchesTransfers 9) Note you can now transfer items Signed-off-by: Maribeth Shafer --- circ/branchtransfers.pl | 2 +- circ/circulation-home.pl | 2 +- installer/data/mysql/atomicupdate/bug_10300.sql | 3 +++ installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/preferences/admin.pref | 7 +++++++ 5 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_10300.sql diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index a826289..2baf89f 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -236,7 +236,7 @@ $template->param( cancelled => $cancelled, setwaiting => $setwaiting, trsfitemloop => \@trsfitemloop, - branchoptionloop => GetBranchesLoop($tobranchcd), + branchoptionloop => GetBranchesLoop($tobranchcd, C4::Context->IsSuperLibrarian() ? 0 : C4::Context->preference("IndependentBranchesTransfers") ), errmsgloop => \@errmsgloop, CircAutocompl => C4::Context->preference("CircAutocompl") ); diff --git a/circ/circulation-home.pl b/circ/circulation-home.pl index 3821007..bd5f035 100755 --- a/circ/circulation-home.pl +++ b/circ/circulation-home.pl @@ -40,7 +40,7 @@ my $fa = getframeworkinfo('FA'); $template->param( fast_cataloging => 1 ) if (defined $fa); # Checking if the transfer page needs to be displayed -$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) ); +$template->param( display_transfer => 1 ) if ( $flags->{'superlibrarian'} == 1 || C4::Context->preference("IndependentBranchesTransfers") == 0 ); $template->{'VARS'}->{'AllowOfflineCirculation'} = C4::Context->preference('AllowOfflineCirculation'); diff --git a/installer/data/mysql/atomicupdate/bug_10300.sql b/installer/data/mysql/atomicupdate/bug_10300.sql new file mode 100644 index 0000000..1bcf5d9 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_10300.sql @@ -0,0 +1,3 @@ +INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) +SELECT 'IndependentBranchesTransfers', value, NULL, 'Allow non-superlibrarians to transfer items between libraries','YesNo' +FROM systempreferences WHERE variable = 'IndependentBranches'; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index ac6f852..b60c22d 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -185,6 +185,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('IncludeSeeFromInSearches','0','','Include see-from references in searches.','YesNo'), ('IndependentBranches','0',NULL,'If ON, increases security between libraries','YesNo'), ('IndependentBranchesPatronModifications','0', NULL, 'Show only modification request for the logged in branch','YesNo'), +('IndependentBranchesTransfers','0', NULL, 'Allow non-superlibrarians to transfer items between libraries','YesNo'), ('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'), ('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'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref index 03e23ac..771889f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -115,6 +115,13 @@ Administration: yes: Prevent no: "Don't prevent" - staff (but not superlibrarians) from viewing and approving/denying patron modification requests for patrons belonging to other libraries. + - + - pref: IndependentBranchesTransfers + default: 0 + choices: + yes: Prevent + no: "Don't prevent" + - staff (but not superlibrarians) transfering items to other libraries. CAS authentication: - - pref: casAuthentication -- 2.1.4