From 23dc1bda51414c2b76a95fa56ca087a7a4a2934f Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Wed, 23 Dec 2009 15:50:05 +0100 Subject: [PATCH] (bug 3536) fix homeorholdingbranch on return this patch create a new systempreference "homeorholdingbranch"-like used only for returns. --- C4/Circulation.pm | 3 ++- admin/systempreferences.pl | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql | 1 + installer/data/mysql/updatedatabase30.pl | 8 ++++++++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 438ecf423b..dffe5933d0 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1400,7 +1400,8 @@ sub AddReturn { $iteminformation->{'itemlost'} = $curr_iteminfo->{'itemlost'}; # check if the book is in a permanent collection.... - my $hbr = $iteminformation->{C4::Context->preference("HomeOrHoldingBranch")}; + my $hbr = C4::Context->preference("HomeOrHoldingBranchReturn") || "homebranch"; + $hbr = $iteminformation->{$hbr}; my $branches = GetBranches(); # FIXME -- This 'PE' attribute is largely undocumented. afaict, there's no user interface that reflects this functionality. if ( $hbr && $branches->{$hbr}->{'PE'} ) { diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 9748f601d5..92118567c7 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -150,6 +150,7 @@ $tabsysprefs{finesCalendar} = "Circulation"; $tabsysprefs{previousIssuesDefaultSortOrder} = "Circulation"; $tabsysprefs{todaysIssuesDefaultSortOrder} = "Circulation"; $tabsysprefs{HomeOrHoldingBranch} = "Circulation"; +$tabsysprefs{HomeOrHoldingBranchReturn} = "Circulation"; $tabsysprefs{RandomizeHoldsQueueWeight} = "Circulation"; $tabsysprefs{StaticHoldsQueueWeight} = "Circulation"; $tabsysprefs{AllowOnShelfHolds} = "Circulation"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index c59e102656..a2a4aba603 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -167,6 +167,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacRenewalAllowed',0,'If ON, users can renew their issues directly from their OPAC account',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('PatronsPerPage','20','Number of Patrons Per Page displayed by default','20','Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranch','holdingbranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','holdingbranch|homebranch','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranchReturn','homebranch','Used by Circulation to determine which branch of an item to check checking-in items','holdingbranch|homebranch','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHighlightedWords','1','If Set, then queried words are higlighted in OPAC','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 42e0066fe4..8bca3121bc 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -167,6 +167,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACBaseURL',NULL,'Specify the Base URL of the OPAC, e.g., opac.mylibrary.com, the http:// will be added automatically by Koha.',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacRenewalAllowed',0,'Si activé, les utilisateurs peuvent renouveller leurs prêts directement depuis leur compte à l''OPAC',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranch','holdingbranch','Détermine si l''on utilise le site propriétaire ou le site dépositaire dans les opérations de circulation ou d''affichage de la disponibilité','holdingbranch|homebranch','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranchReturn','holdingbranch','Détermine si l''on utilise le site propriétaire ou le site dépositaire dans les opérations de retour','holdingbranch|homebranch','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHighlightedWords','0','Si activé, les mots recherchés dans la notices sont affichés dans l''OPAC','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','Si activé, le service OAI-PMH est disponible',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:archiveID','KOHA-OAI-TEST','Identification de l''archive OAI-PMH',NULL,'Free'); diff --git a/installer/data/mysql/updatedatabase30.pl b/installer/data/mysql/updatedatabase30.pl index 5002f0ffe8..62880266d9 100644 --- a/installer/data/mysql/updatedatabase30.pl +++ b/installer/data/mysql/updatedatabase30.pl @@ -689,6 +689,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { } +$DBversion = "3.00.06.001"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my $value = $dbh->selectrow_array("SELECT value FROM systempreferences WHERE variable = 'HomeOrHoldingBranch'"); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranchReturn','$value','Used by Circulation to determine which branch of an item to check checking-in items','holdingbranch|homebranch','Choice');"); + print "Upgrade to $DBversion done (Add HomeOrHoldingBranchReturn system preference)\n"; + SetVersion ($DBversion); +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table -- 2.39.5