# Authorities
$tabsysprefs{authoritysep}="Authorities";
$tabsysprefs{AuthDisplayHierarchy}="Authorities";
- $tabsysprefs{dontmerge}="Authorities";
- $tabsysprefs{BiblioAddsAuthorities}="Authorities";
+ $tabsysprefs{dontmerge}="Authorities";
+ $tabsysprefs{BiblioAddsAuthorities}="Authorities";
# Catalogue
$tabsysprefs{advancedMARCEditor}="Catalogue";
$tabsysprefs{autoBarcode}="Catalogue";
$tabsysprefs{useDaysMode}="Circulation";
$tabsysprefs{ReservesNeedReturns}="Circulation";
$tabsysprefs{CircAutocompl}="Circulation";
+ $tabsysprefs{canreservefromotherbranches}="Circulation";
# Intranet
$tabsysprefs{TemplateEncoding}="Intranet";
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('QueryFuzzy','1','If ON, enables fuzzy option for searches',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('QueryWeightFields','1','If ON, enables field weighting',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('yuipath','http://yui.yahooapis.com/2.3.1/build','Insert the path to YUI libraries',NULL,'free');
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('canreservefromotherbranches','1','','With Independent branches on, can a user from one library reserve an item from another library','YesNo')"
+
SetVersion ($DBversion);
}
+$DBversion = "3.00.00.028";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type)
+ VALUES ('canreservefromotherbranches','1','','With Independent branches on, can a user from one library reserve an item from another library','YesNo')");
+ print "Upgrade to $DBversion done (adding new system preference for changing reserve/holds behaviour with independent branches)\n";
+ SetVersion ($DBversion);
+}
+
+
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table
# and is automatically called by Auth.pm when needed.
sub kohaversion {
- return "3.00.00.027";
+ return "3.00.00.028";
}
1;
# If there is no loan, return and transfer, we show a checkbox.
$item->{notforloan} = $item->{notforloan} || 0;
-
+
+ # if independent branches is on we need to check if the person can reserve
+ # for branches they arent logged in to
+ if ( C4::Context->preference("IndependantBranches") ) {
+ if (! C4::Context->preference("canreservefromotherbranches")){
+ # cant reserve items so need to check if item homebranch and userenv branch match if not we cant reserve
+ my $userenv = C4::Context->userenv;
+ if ( ($userenv) && ( $userenv->{flags} != 1 ) ) {
+ $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} );
+ }
+ }
+ }
# An item is available only if:
if (
not defined $reservedate # not reserved yet
and $issues->{'date_due'} eq '' # not currently on loan
and not $item->{itemlost} # not lost
and not $item->{notforloan} # not forbidden to loan
+ and not $item->{cantreserve}
and $transfertwhen eq '' # not currently on transfert
)
{