From 601878e7f1e040e45879fe05d4d94cb3a85d4900 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 27 Sep 2012 11:27:50 -0400 Subject: [PATCH] Bug 8839 - Independant Branches - Checkout to patron belonging to another branch Content-Type: text/plain; charset="utf-8" Adds the new system preference IndependantBranchesPreventIssuing to control whether IndependantBranches stops one branch from viewing the patron record or issuing items to a patron from a different library. --- C4/Members.pm | 5 +---- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 8 +++++++- .../prog/en/modules/admin/preferences/admin.pref | 7 +++++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index b2f45b9..fc459df 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -250,10 +250,7 @@ sub Search { } } - # $showallbranches was not used at the time SearchMember() was mainstreamed into Search(). - # Mentioning for the reference - - if ( C4::Context->preference("IndependantBranches") ) { # && !$showallbranches){ + if ( C4::Context->preference("IndependantBranches") && C4::Context->preference("IndependantBranchesCirculation") ) { if ( my $userenv = C4::Context->userenv ) { my $branch = $userenv->{'branch'}; if ( ($userenv->{flags} % 2 !=1) && diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index a4fceea..e6fc93c 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -386,3 +386,4 @@ INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'); INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'); +INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('IndependantBranchesCirculation', '1', NULL, 'If enabled, and IndependantBranches is also enabled, this preference will prevent a librarian from issuing items to another libraries patrons.', 'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index e67bf3e..9eb26e3 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5971,7 +5971,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } - $DBversion = "3.09.00.057"; if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { $dbh->do("ALTER TABLE aqbasket ADD deliveryplace VARCHAR(10) default NULL AFTER basketgroupid;"); @@ -6011,6 +6010,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion ="3.09.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('IndependantBranchesCirculation', '1', NULL, 'If enabled, and IndependantBranches is also enabled, this preference will prevent a librarian from issuing items to another libraries patrons.', 'YesNo')"); + print "Upgrade to $DBversion done (Add system preference IndependantBranchesCirculation)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) 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 4e907e1..82b19fb 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 @@ -77,6 +77,13 @@ Administration: yes: Prevent no: "Don't prevent" - staff (but not superlibrarians) from modifying objects (holds, items, patrons, etc.) belonging to other libraries. + - + - pref: IndependantBranchesCirculation + default: 0 + choices: + yes: Prevent + no: "Don't prevent" + - staff (but not superlibrarians) from viewing and issuing items to patrons belonging to other libraries. This setting is ignored unless IndependantBranches is set to "Prevent". CAS Authentication: - - pref: casAuthentication -- 1.7.2.5