}
}
- my $hbranch = C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ? 'homebranch' : 'holdingbranch';
- my $otherbranch = C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ? 'holdingbranch' : 'homebranch';
+ my $hbranch = C4::Context->preference('StaffSearchResultsDisplayBranch');
+ my $otherbranch = $hbranch eq 'homebranch' ? 'holdingbranch' : 'homebranch';
# set item's branch name, use HomeOrHoldingBranch syspref first, fall back to the other one
if ($item->{$hbranch}) {
('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'),
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)
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: