Adding a system pref so you can stop users from reserving items that dont belong at their branch
Signed-off-by: Chris Cormack <crc@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
f131e899fe
commit
e30fb761ec
|
|
@ -75,8 +75,8 @@ my %tabsysprefs;
|
|||
# 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";
|
||||
|
|
@ -116,6 +116,7 @@ my %tabsysprefs;
|
|||
$tabsysprefs{useDaysMode}="Circulation";
|
||||
$tabsysprefs{ReservesNeedReturns}="Circulation";
|
||||
$tabsysprefs{CircAutocompl}="Circulation";
|
||||
$tabsysprefs{canreservefromotherbranches}="Circulation";
|
||||
|
||||
# Intranet
|
||||
$tabsysprefs{TemplateEncoding}="Intranet";
|
||||
|
|
|
|||
|
|
@ -114,3 +114,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
|
|||
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')"
|
||||
|
||||
|
|
|
|||
|
|
@ -661,6 +661,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
|||
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
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
# and is automatically called by Auth.pm when needed.
|
||||
|
||||
sub kohaversion {
|
||||
return "3.00.00.027";
|
||||
return "3.00.00.028";
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
|||
|
|
@ -317,13 +317,25 @@ foreach my $biblioitemnumber (@biblioitemnumbers) {
|
|||
|
||||
# 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
|
||||
)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue