@@ -, +, @@ matches the current value of HomeOrHoldingBranch holding branches. --- C4/Search.pm | 5 +++-- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 9 +++++++++ .../en/modules/admin/preferences/circulation.pref | 7 +++++++ 4 files changed, 20 insertions(+), 2 deletions(-) --- a/C4/Search.pm +++ a/C4/Search.pm @@ -1900,8 +1900,9 @@ sub searchResults { } } - my $hbranch = C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ? 'homebranch' : 'holdingbranch'; - my $otherbranch = C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ? 'holdingbranch' : 'homebranch'; + my $display_branch = C4::Context->preference('StaffSearchResultsDisplayBranch'); + my $hbranch = $display_branch eq 'homebranch' ? 'homebranch' : 'holdingbranch'; + my $otherbranch = $display_branch eq 'homebranch' ? 'holdingbranch' : 'homebranch'; # set item's branch name, use HomeOrHoldingBranch syspref first, fall back to the other one if ($item->{$hbranch}) { --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -373,6 +373,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('StaffAuthorisedValueImages','1',NULL,'','YesNo'), ('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'), ('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'), +('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'), ('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the Staff client','Integer'), ('StaticHoldsQueueWeight','0',NULL,'Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective','Integer'), ('SubfieldsToUseWhenPrefill','','','Define a list of subfields to use when prefilling items (separated by space)','Free'), --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -8570,6 +8570,15 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.17.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + my $pref = C4::Context->preference('HomeOrHoldingBranch'); + $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) + VALUES ('StaffSearchResultsDisplayBranch', ?,'homebranch|holdingbranch','Controls the display of the home or holding branch for staff search results','choice')", undef, $pref); + print "Upgrade to $DBversion done (Bug 12582 - Control of branch displayed in search results linked to HomeOrHoldingBranch)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -240,6 +240,13 @@ Circulation: holdingbranch: only the library the item was checked out from. homeorholdingbranch: either the library the item is from or the library it was checked out from. - + - For search results in the staff client, display the branch of + - pref: StaffSearchResultsDisplayBranch + type: choice + choices: + homebranch: the library the item is from. + holdingbranch: the library the item is held by. + - - Calculate the due date using - pref: useDaysMode choices: --