From 499b0f6a1948680db1ec6609ecf0a464218c001e 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..9efcf06 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("IndependantBranchesPreventIssuing") ) { 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 ef2538c..7a79981 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -383,3 +383,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowLibrariesPulldownMobile','1','Show the libraries pulldown on the mobile version of the OPAC.',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowFiltersPulldownMobile','1','Show the search filters pulldown on the mobile version of the OPAC.',NULL,'YesNo'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('AuthDisplayHierarchy','0','Display authority hierarchies','','YesNo'); +INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('IndependantBranchesPreventIssuing', '1', NULL, 'If enabled, and IndependantBranches is also enabled, this preference will prevent a librarian from issuing items to another libraries patrons.', 'YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index eb45fb2..0507396 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5973,7 +5973,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;"); @@ -5982,6 +5981,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 ('IndependantBranchesPreventIssuing', '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 IndependantBranchesPreventIssuing)\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..c4da5b8 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: IndependantBranchesPreventIssuing + 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