Bug 10080 - Change system pref IndependantBranches to IndependentBranches
Test Plan: 1) Enable IndependantBranches 2) Apply this patch 3) Run updatedatabase.pl 4) Verify that the system preference still functions correctly Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
9e4c289d3f
commit
b00ec06968
|
|
@ -870,7 +870,7 @@ sub GetPendingOrders {
|
|||
AND datecancellationprinted IS NULL";
|
||||
my @query_params;
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ( C4::Context->preference("IndependantBranches") ) {
|
||||
if ( C4::Context->preference("IndependentBranches") ) {
|
||||
if ( ($userenv) && ( $userenv->{flags} != 1 ) ) {
|
||||
$strsth .= " AND (borrowers.branchcode = ?
|
||||
or borrowers.branchcode = '')";
|
||||
|
|
@ -1733,7 +1733,7 @@ sub GetParcel {
|
|||
AND aqorders.datereceived = ? ";
|
||||
|
||||
my @query_params = ( $supplierid, $code, $datereceived );
|
||||
if ( C4::Context->preference("IndependantBranches") ) {
|
||||
if ( C4::Context->preference("IndependentBranches") ) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ( ($userenv) && ( $userenv->{flags} != 1 ) ) {
|
||||
$strsth .= " and (borrowers.branchcode = ?
|
||||
|
|
@ -1952,7 +1952,7 @@ sub GetLateOrders {
|
|||
if ( defined $estimateddeliverydatefrom and not defined $estimateddeliverydateto ) {
|
||||
$from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= CAST(now() AS date)';
|
||||
}
|
||||
if (C4::Context->preference("IndependantBranches")
|
||||
if (C4::Context->preference("IndependentBranches")
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{flags} != 1 ) {
|
||||
$from .= ' AND borrowers.branchcode LIKE ? ';
|
||||
|
|
@ -2061,7 +2061,7 @@ sub GetHistory {
|
|||
LEFT JOIN aqinvoices ON aqorders.invoiceid = aqinvoices.invoiceid";
|
||||
|
||||
$query .= " LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber"
|
||||
if ( C4::Context->preference("IndependantBranches") );
|
||||
if ( C4::Context->preference("IndependentBranches") );
|
||||
|
||||
$query .= " WHERE (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') ";
|
||||
|
||||
|
|
@ -2121,7 +2121,7 @@ sub GetHistory {
|
|||
push @query_params, "%$basketgroupname%";
|
||||
}
|
||||
|
||||
if ( C4::Context->preference("IndependantBranches") ) {
|
||||
if ( C4::Context->preference("IndependentBranches") ) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ( $userenv && ($userenv->{flags} || 0) != 1 ) {
|
||||
$query .= " AND (borrowers.branchcode = ? OR borrowers.branchcode ='' ) ";
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ sub get_template_and_user {
|
|||
CalendarFirstDayOfWeek => (C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday")?0:1,
|
||||
CircAutocompl => C4::Context->preference("CircAutocompl"),
|
||||
FRBRizeEditions => C4::Context->preference("FRBRizeEditions"),
|
||||
IndependantBranches => C4::Context->preference("IndependantBranches"),
|
||||
IndependentBranches => C4::Context->preference("IndependentBranches"),
|
||||
IntranetNav => C4::Context->preference("IntranetNav"),
|
||||
IntranetmainUserblock => C4::Context->preference("IntranetmainUserblock"),
|
||||
LibraryName => C4::Context->preference("LibraryName"),
|
||||
|
|
@ -873,7 +873,7 @@ sub checkauth {
|
|||
$branchname = GetBranchName($branchcode);
|
||||
}
|
||||
my $branches = GetBranches();
|
||||
if (C4::Context->boolean_preference('IndependantBranches') && C4::Context->boolean_preference('Autolocation')){
|
||||
if (C4::Context->boolean_preference('IndependentBranches') && C4::Context->boolean_preference('Autolocation')){
|
||||
# we have to check they are coming from the right ip range
|
||||
my $domain = $branches->{$branchcode}->{'branchip'};
|
||||
if ($ip !~ /^$domain/){
|
||||
|
|
@ -1018,7 +1018,7 @@ sub checkauth {
|
|||
IntranetNav => C4::Context->preference("IntranetNav"),
|
||||
IntranetFavicon => C4::Context->preference("IntranetFavicon"),
|
||||
intranetuserjs => C4::Context->preference("intranetuserjs"),
|
||||
IndependantBranches=> C4::Context->preference("IndependantBranches"),
|
||||
IndependentBranches=> C4::Context->preference("IndependentBranches"),
|
||||
AutoLocation => C4::Context->preference("AutoLocation"),
|
||||
wrongip => $info{'wrongip'},
|
||||
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"),
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ our %strings = (
|
|||
|
||||
=item true_p
|
||||
|
||||
if ( C4::Boolean::true_p(C4::Context->preference("IndependantBranches")) ) {
|
||||
if ( C4::Boolean::true_p(C4::Context->preference("IndependentBranches")) ) {
|
||||
...
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ The functions in this module deal with branches.
|
|||
|
||||
$branches = &GetBranches();
|
||||
|
||||
Returns informations about ALL branches, IndependantBranches Insensitive.
|
||||
Returns informations about ALL branches, IndependentBranches Insensitive.
|
||||
GetBranchInfo() returns the same information without the problems of this function
|
||||
(namespace collision, mainly).
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ sub GetBranches {
|
|||
|
||||
sub onlymine {
|
||||
return
|
||||
C4::Context->preference('IndependantBranches') &&
|
||||
C4::Context->preference('IndependentBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags} %2 != 1 &&
|
||||
C4::Context->userenv->{branch} ;
|
||||
|
|
|
|||
|
|
@ -887,7 +887,7 @@ sub CanBookBeIssued {
|
|||
$needsconfirmation{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'confirm' );
|
||||
$alerts{ITEM_LOST} = $code if ( C4::Context->preference("IssueLostItem") eq 'alert' );
|
||||
}
|
||||
if ( C4::Context->preference("IndependantBranches") ) {
|
||||
if ( C4::Context->preference("IndependentBranches") ) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ( ($userenv) && ( $userenv->{flags} % 2 != 1 ) ) {
|
||||
$issuingimpossible{ITEMNOTSAMEBRANCH} = 1
|
||||
|
|
|
|||
|
|
@ -1253,7 +1253,7 @@ sub GetItemsInfo {
|
|||
$data->{firstname} = $idata->{firstname};
|
||||
$data->{lastreneweddate} = $idata->{lastreneweddate};
|
||||
$datedue = $idata->{'date_due'};
|
||||
if (C4::Context->preference("IndependantBranches")){
|
||||
if (C4::Context->preference("IndependentBranches")){
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ( ($userenv) && ( $userenv->{flags} % 2 != 1 ) ) {
|
||||
$data->{'NOTSAMEBRANCH'} = 1 if ($idata->{'bcode'} ne $userenv->{branch});
|
||||
|
|
@ -2214,7 +2214,7 @@ sub DelItemCheck {
|
|||
$error = "book_on_loan"
|
||||
}
|
||||
elsif ( !( C4::Context->userenv->{flags} & 1 )
|
||||
and C4::Context->preference("IndependantBranches")
|
||||
and C4::Context->preference("IndependentBranches")
|
||||
and ( C4::Context->userenv->{branch} ne $item->{'homebranch'} ) )
|
||||
{
|
||||
$error = "not_same_branch";
|
||||
|
|
@ -2689,7 +2689,7 @@ sub PrepareItemrecordDisplay {
|
|||
# builds list, depending on authorised value...
|
||||
#---- branch
|
||||
if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
|
||||
if ( ( C4::Context->preference("IndependantBranches") )
|
||||
if ( ( C4::Context->preference("IndependentBranches") )
|
||||
&& ( C4::Context->userenv->{flags} % 2 != 1 ) ) {
|
||||
my $sth = $dbh->prepare( "SELECT branchcode,branchname FROM branches WHERE branchcode = ? ORDER BY branchname" );
|
||||
$sth->execute( C4::Context->userenv->{branch} );
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ sub getletter {
|
|||
|
||||
$branchcode ||= '';
|
||||
|
||||
if ( C4::Context->preference('IndependantBranches')
|
||||
if ( C4::Context->preference('IndependentBranches')
|
||||
and $branchcode
|
||||
and C4::Context->userenv ) {
|
||||
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ sub Search {
|
|||
# $showallbranches was not used at the time SearchMember() was mainstreamed into Search().
|
||||
# Mentioning for the reference
|
||||
|
||||
if ( C4::Context->preference("IndependantBranches") ) { # && !$showallbranches){
|
||||
if ( C4::Context->preference("IndependentBranches") ) { # && !$showallbranches){
|
||||
if ( my $userenv = C4::Context->userenv ) {
|
||||
my $branch = $userenv->{'branch'};
|
||||
if ( ($userenv->{flags} % 2 !=1) && $branch ){
|
||||
|
|
@ -2042,7 +2042,7 @@ sub GetBorrowersToExpunge {
|
|||
my $filterexpiry = $params->{'expired_before'};
|
||||
my $filtercategory = $params->{'category_code'};
|
||||
my $filterbranch = $params->{'branchcode'} ||
|
||||
((C4::Context->preference('IndependantBranches')
|
||||
((C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{flags} % 2 !=1
|
||||
&& C4::Context->userenv->{branch})
|
||||
|
|
@ -2108,7 +2108,7 @@ I<$result> is a ref to an array which all elements are a hasref.
|
|||
|
||||
sub GetBorrowersWhoHaveNeverBorrowed {
|
||||
my $filterbranch = shift ||
|
||||
((C4::Context->preference('IndependantBranches')
|
||||
((C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{flags} % 2 !=1
|
||||
&& C4::Context->userenv->{branch})
|
||||
|
|
@ -2158,7 +2158,7 @@ sub GetBorrowersWithIssuesHistoryOlderThan {
|
|||
my $dbh = C4::Context->dbh;
|
||||
my $date = shift ||POSIX::strftime("%Y-%m-%d",localtime());
|
||||
my $filterbranch = shift ||
|
||||
((C4::Context->preference('IndependantBranches')
|
||||
((C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{flags} % 2 !=1
|
||||
&& C4::Context->userenv->{branch})
|
||||
|
|
|
|||
|
|
@ -1419,7 +1419,7 @@ be the target of an item-level hold request.
|
|||
Note that IsAvailableForItemLevelRequest() does not
|
||||
check if the staff operator is authorized to place
|
||||
a request on the item - in particular,
|
||||
this routine does not check IndependantBranches
|
||||
this routine does not check IndependentBranches
|
||||
and canreservefromotherbranches.
|
||||
|
||||
=cut
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ sub GetSerialInformation {
|
|||
my $dbh = C4::Context->dbh;
|
||||
my $query = qq|
|
||||
SELECT serial.*, serial.notes as sernotes, serial.status as serstatus,subscription.*,subscription.subscriptionid as subsid |;
|
||||
if ( C4::Context->preference('IndependantBranches')
|
||||
if ( C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{'flags'} != 1
|
||||
&& C4::Context->userenv->{'branch'} ) {
|
||||
|
|
@ -321,7 +321,7 @@ sub GetSubscription {
|
|||
aqbooksellers.name AS aqbooksellername,
|
||||
biblio.title AS bibliotitle,
|
||||
subscription.biblionumber as bibnum);
|
||||
if ( C4::Context->preference('IndependantBranches')
|
||||
if ( C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{'flags'} != 1
|
||||
&& C4::Context->userenv->{'branch'} ) {
|
||||
|
|
@ -336,7 +336,7 @@ sub GetSubscription {
|
|||
WHERE subscription.subscriptionid = ?
|
||||
);
|
||||
|
||||
# if (C4::Context->preference('IndependantBranches') &&
|
||||
# if (C4::Context->preference('IndependentBranches') &&
|
||||
# C4::Context->userenv &&
|
||||
# C4::Context->userenv->{'flags'} != 1){
|
||||
# # $debug and warn "flags: ".C4::Context->userenv->{'flags'};
|
||||
|
|
@ -370,7 +370,7 @@ sub GetFullSubscription {
|
|||
biblio.title as bibliotitle,
|
||||
subscription.branchcode AS branchcode,
|
||||
subscription.subscriptionid AS subscriptionid |;
|
||||
if ( C4::Context->preference('IndependantBranches')
|
||||
if ( C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{'flags'} != 1
|
||||
&& C4::Context->userenv->{'branch'} ) {
|
||||
|
|
@ -490,7 +490,7 @@ sub GetSubscriptionsFromBiblionumber {
|
|||
$subs->{ "numberpattern" . $subs->{numberpattern} } = 1;
|
||||
$subs->{ "status" . $subs->{'status'} } = 1;
|
||||
$subs->{'cannotedit'} =
|
||||
( C4::Context->preference('IndependantBranches')
|
||||
( C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{flags} % 2 != 1
|
||||
&& C4::Context->userenv->{branch}
|
||||
|
|
@ -530,7 +530,7 @@ sub GetFullSubscriptionsFromBiblionumber {
|
|||
biblio.title as bibliotitle,
|
||||
subscription.branchcode AS branchcode,
|
||||
subscription.subscriptionid AS subscriptionid|;
|
||||
if ( C4::Context->preference('IndependantBranches')
|
||||
if ( C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{'flags'} != 1
|
||||
&& C4::Context->userenv->{'branch'} ) {
|
||||
|
|
@ -630,7 +630,7 @@ sub GetSubscriptions {
|
|||
|
||||
while ( my $line = $sth->fetchrow_hashref ) {
|
||||
$line->{'cannotedit'} =
|
||||
( C4::Context->preference('IndependantBranches')
|
||||
( C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& C4::Context->userenv->{flags} % 2 != 1
|
||||
&& C4::Context->userenv->{branch}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ sub SearchSuggestion {
|
|||
}
|
||||
|
||||
# filter on user branch
|
||||
if ( C4::Context->preference('IndependantBranches') ) {
|
||||
if ( C4::Context->preference('IndependentBranches') ) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ($userenv) {
|
||||
if ( ( $userenv->{flags} % 2 ) != 1 && !$suggestion->{branchcode} )
|
||||
|
|
@ -339,7 +339,7 @@ sub GetSuggestionByStatus {
|
|||
};
|
||||
|
||||
# filter on branch
|
||||
if ( C4::Context->preference("IndependantBranches") || $branchcode ) {
|
||||
if ( C4::Context->preference("IndependentBranches") || $branchcode ) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ($userenv) {
|
||||
unless ( $userenv->{flags} % 2 == 1 ) {
|
||||
|
|
@ -389,7 +389,7 @@ sub CountSuggestion {
|
|||
my $dbh = C4::Context->dbh;
|
||||
my $sth;
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ( C4::Context->preference("IndependantBranches")
|
||||
if ( C4::Context->preference("IndependentBranches")
|
||||
&& $userenv->{flags} % 2 != 1 )
|
||||
{
|
||||
my $query = q{
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ if ( $op eq 'delete_confirm' ) {
|
|||
$template->param( NO_BOOKSELLER => 1 );
|
||||
} elsif ( $op eq 'del_basket') {
|
||||
$template->param( delete_confirm => 1 );
|
||||
if ( C4::Context->preference("IndependantBranches") ) {
|
||||
if ( C4::Context->preference("IndependentBranches") ) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
unless ( $userenv->{flags} == 1 ) {
|
||||
my $validtest = ( $basket->{creationdate} eq '' )
|
||||
|
|
@ -192,7 +192,7 @@ if ( $op eq 'delete_confirm' ) {
|
|||
print $query->redirect('/cgi-bin/koha/acqui/basket.pl?basketno='.$basket->{'basketno'})
|
||||
} else {
|
||||
# get librarian branch...
|
||||
if ( C4::Context->preference("IndependantBranches") ) {
|
||||
if ( C4::Context->preference("IndependentBranches") ) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
unless ( $userenv->{flags} == 1 ) {
|
||||
my $validtest = ( $basket->{creationdate} eq '' )
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ for my $curr ( @rates ) {
|
|||
}
|
||||
|
||||
# build branches list
|
||||
my $onlymine=C4::Context->preference('IndependantBranches') &&
|
||||
my $onlymine=C4::Context->preference('IndependentBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags}!=1 &&
|
||||
C4::Context->userenv->{branch};
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ foreach my $item (@items){
|
|||
$item->{status_advisory} = 1;
|
||||
}
|
||||
|
||||
if (C4::Context->preference("IndependantBranches")) {
|
||||
if (C4::Context->preference("IndependentBranches")) {
|
||||
#verifying rights
|
||||
my $userenv = C4::Context->userenv();
|
||||
unless (($userenv->{'flags'} == 1) or ($userenv->{'branch'} eq $item->{'homebranch'})) {
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ sub build_authorized_values_list {
|
|||
#---- branch
|
||||
if ( $tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) {
|
||||
#Use GetBranches($onlymine)
|
||||
my $onlymine=C4::Context->preference('IndependantBranches') &&
|
||||
my $onlymine=C4::Context->preference('IndependentBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags} % 2 == 0 &&
|
||||
C4::Context->userenv->{branch};
|
||||
|
|
|
|||
|
|
@ -689,7 +689,7 @@ foreach my $field (@fields) {
|
|||
|| $subfieldvalue;
|
||||
}
|
||||
|
||||
if (($field->tag eq $branchtagfield) && ($subfieldcode eq $branchtagsubfield) && C4::Context->preference("IndependantBranches")) {
|
||||
if (($field->tag eq $branchtagfield) && ($subfieldcode eq $branchtagsubfield) && C4::Context->preference("IndependentBranches")) {
|
||||
#verifying rights
|
||||
my $userenv = C4::Context->userenv();
|
||||
unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $subfieldvalue))){
|
||||
|
|
@ -750,7 +750,7 @@ my $i=0;
|
|||
|
||||
my $pref_itemcallnumber = C4::Context->preference('itemcallnumber');
|
||||
|
||||
my $onlymine = C4::Context->preference('IndependantBranches') &&
|
||||
my $onlymine = C4::Context->preference('IndependentBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags}!=1 &&
|
||||
C4::Context->userenv->{branch};
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ my $fa = getframeworkinfo('FA');
|
|||
$template->param( fast_cataloging => 1 ) if (defined $fa);
|
||||
|
||||
# Checking if the transfer page needs to be displayed
|
||||
$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependantBranches") == 0) );
|
||||
$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependentBranches") == 0) );
|
||||
|
||||
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ while (my ($itemtype, $description) =$req->fetchrow) {
|
|||
itemtypename => $description,
|
||||
};
|
||||
}
|
||||
my $onlymine=C4::Context->preference('IndependantBranches') &&
|
||||
my $onlymine=C4::Context->preference('IndependentBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags} % 2 !=1 &&
|
||||
C4::Context->userenv->{branch};
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ if ( $run_report ) {
|
|||
# multiple patrons have a hold on an item
|
||||
|
||||
|
||||
if (C4::Context->preference('IndependantBranches')){
|
||||
if (C4::Context->preference('IndependentBranches')){
|
||||
$strsth .= " AND items.holdingbranch=? ";
|
||||
push @query_params, C4::Context->userenv->{'branch'};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ my $strsth =
|
|||
$sqldatewhere
|
||||
";
|
||||
|
||||
if (C4::Context->preference('IndependantBranches')){
|
||||
if (C4::Context->preference('IndependentBranches')){
|
||||
$strsth .= " AND items.holdingbranch=? ";
|
||||
push @query_params, C4::Context->userenv->{'branch'};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if ($item) {
|
|||
push @cancel_result, $res if $res;
|
||||
}
|
||||
|
||||
if ( C4::Context->preference('IndependantBranches') ) {
|
||||
if ( C4::Context->preference('IndependentBranches') ) {
|
||||
undef $all_branches;
|
||||
} else {
|
||||
$template->param( all_branches_link => $input->url . '?allbranches=1' )
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
|
|||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WaitingNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependantBranches',0,'If ON, increases security between libraries',NULL,'YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependentBranches',0,'If ON, increases security between libraries',NULL,'YesNo');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetBiblioDefaultView','normal','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','normal|marc|isbd|labeled_marc','Choice');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('intranetcolorstylesheet','','Define the color stylesheet to use in the Staff Client','50','free');
|
||||
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetmainUserblock','','Add a block of HTML that will display on the intranet home page','70|10','Textarea');
|
||||
|
|
|
|||
|
|
@ -6935,6 +6935,13 @@ INSERT INTO permissions (module_bit, code, description) VALUES
|
|||
SetVersion($DBversion);
|
||||
}
|
||||
|
||||
$DBversion = "3.11.00.XXX";
|
||||
if ( CheckVersion($DBversion) ) {
|
||||
$dbh->do("UPDATE systempreferences SET variable = 'IndependentBranches' WHERE variable = 'IndependantBranches'");
|
||||
print "Upgrade to $DBversion done (Bug 10080 - Change system pref IndependantBranches to IndependentBranches)\n";
|
||||
SetVersion ($DBversion);
|
||||
}
|
||||
|
||||
=head1 FUNCTIONS
|
||||
|
||||
=head2 TableExists($table)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="drop3">
|
||||
[% IF ( IndependantBranches ) %]
|
||||
[% IF ( IndependentBranches ) %]
|
||||
[% IF ( CAN_user_management || CAN_user_editcatalogue_edit_catalogue ) %]
|
||||
<li>
|
||||
<a class="toplinks" href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ Administration:
|
|||
tmp: as temporary files.
|
||||
memcached: in a memcached server.
|
||||
-
|
||||
- pref: IndependantBranches
|
||||
- pref: IndependentBranches
|
||||
default: 0
|
||||
choices:
|
||||
yes: Prevent
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
</p>
|
||||
|
||||
[% IF ( AutoLocation ) %][% ELSE %]
|
||||
[% IF ( IndependantBranches ) %][% ELSE %]
|
||||
[% IF ( IndependentBranches ) %][% ELSE %]
|
||||
<p><label for="branch">Library:</label>
|
||||
<select name="branch" id="branch" class="input" tabindex="3">
|
||||
<option value="">My library</option>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
[% IF ( display_transfer ) %]
|
||||
<li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfer</a></li>
|
||||
[% END %]
|
||||
[% IF ( AutoLocation ) %][% ELSE %][% IF ( IndependantBranches ) %][% ELSE %]<li><a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a></li>[% END %][% END %]
|
||||
[% IF ( AutoLocation ) %][% ELSE %][% IF ( IndependentBranches ) %][% ELSE %]<li><a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a></li>[% END %][% END %]
|
||||
[% IF ( fast_cataloging ) %]
|
||||
[% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
|
||||
<li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA">Fast cataloging</a></li>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ $template->param(
|
|||
);
|
||||
|
||||
my $branch =
|
||||
C4::Context->preference("IndependantBranches")
|
||||
C4::Context->preference("IndependentBranches")
|
||||
&& !$flags->{'superlibrarian'}
|
||||
? C4::Context->userenv()->{'branch'}
|
||||
: undef;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ if ($bor->{category_type} eq "S") {
|
|||
}
|
||||
}
|
||||
|
||||
if (C4::Context->preference("IndependantBranches")) {
|
||||
if (C4::Context->preference("IndependentBranches")) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
if (($userenv->{flags} % 2 != 1) && $bor->{'branchcode'}){
|
||||
unless ($userenv->{branch} eq $bor->{'branchcode'}){
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ if ($op eq 'save' || $op eq 'insert'){
|
|||
$newdata{'surname'} = uc($newdata{'surname'});
|
||||
}
|
||||
|
||||
if (C4::Context->preference("IndependantBranches")) {
|
||||
if (C4::Context->preference("IndependentBranches")) {
|
||||
if ($userenv && $userenv->{flags} % 2 != 1){
|
||||
$debug and print STDERR " $newdata{'branchcode'} : ".$userenv->{flags}.":".$userenv->{branch};
|
||||
unless (!$newdata{'branchcode'} || $userenv->{branch} eq $newdata{'branchcode'}){
|
||||
|
|
@ -422,7 +422,7 @@ if ($nok or !$nodouble){
|
|||
$template->param( step_1 => 1,step_2 => 1,step_3 => 1, step_4 => 1, step_5 => 1, step_6 => 1);
|
||||
}
|
||||
}
|
||||
if (C4::Context->preference("IndependantBranches")) {
|
||||
if (C4::Context->preference("IndependentBranches")) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
if ($userenv->{flags} % 2 != 1 && $data{'branchcode'}){
|
||||
unless ($userenv->{branch} eq $data{'branchcode'}){
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
|
|||
);
|
||||
|
||||
my $branch =
|
||||
C4::Context->preference("IndependantBranches")
|
||||
C4::Context->preference("IndependentBranches")
|
||||
&& !$flags->{'superlibrarian'}
|
||||
? C4::Context->userenv()->{'branch'}
|
||||
: undef;
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ $bor{'borrowernumber'} = $borrowernumber;
|
|||
|
||||
# Converts the branchcode to the branch name
|
||||
my $samebranch;
|
||||
if ( C4::Context->preference("IndependantBranches") ) {
|
||||
if ( C4::Context->preference("IndependentBranches") ) {
|
||||
my $userenv = C4::Context->userenv;
|
||||
unless ( $userenv->{flags} % 2 == 1 ) {
|
||||
$samebranch = ( $data->{'branchcode'} eq $userenv->{branch} );
|
||||
|
|
@ -338,7 +338,7 @@ my $candeleteuser;
|
|||
my $userenv = C4::Context->userenv;
|
||||
if($userenv->{flags} % 2 == 1){
|
||||
$candeleteuser = 1;
|
||||
}elsif ( C4::Context->preference("IndependantBranches") ) {
|
||||
}elsif ( C4::Context->preference("IndependentBranches") ) {
|
||||
$candeleteuser = ( $data->{'branchcode'} eq $userenv->{branch} );
|
||||
}else{
|
||||
if( C4::Auth::getuserflags( $userenv->{flags},$userenv->{number})->{borrowers} ) {
|
||||
|
|
|
|||
|
|
@ -426,7 +426,7 @@ foreach my $biblionumber (@biblionumbers) {
|
|||
|
||||
# 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("IndependentBranches") ) {
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ if (defined $member) {
|
|||
|
||||
my ($count,$results);
|
||||
|
||||
if (C4::Context->preference("IndependantBranches")){
|
||||
if (C4::Context->preference("IndependentBranches")){
|
||||
if (C4::Context->userenv && C4::Context->userenv->{flags} % 2 !=1 && C4::Context->userenv->{'branch'}){
|
||||
$$patron{branchcode}=C4::Context->userenv->{'branch'};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ if ($op eq 'modify' || $op eq 'dup' || $op eq 'modsubscription') {
|
|||
}
|
||||
}
|
||||
|
||||
my $onlymine=C4::Context->preference('IndependantBranches') &&
|
||||
my $onlymine=C4::Context->preference('IndependentBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags} % 2 !=1 &&
|
||||
C4::Context->userenv->{branch};
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ $template->param(
|
|||
routing => C4::Context->preference("RoutingSerials"),
|
||||
totalissues => $totalissues,
|
||||
hemisphere => $hemisphere,
|
||||
cannotedit =>(C4::Context->preference('IndependantBranches') &&
|
||||
cannotedit =>(C4::Context->preference('IndependentBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags} % 2 !=1 &&
|
||||
C4::Context->userenv->{branch} && $subs->{branchcode} &&
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ if(defined($returnsuggested) and $returnsuggested ne "noone")
|
|||
|
||||
#branch display management
|
||||
my $branchfilter = ($displayby ne "branchcode") ? $input->param('branchcode') : '';
|
||||
my $onlymine=C4::Context->preference('IndependantBranches') &&
|
||||
my $onlymine=C4::Context->preference('IndependentBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags}!=1 &&
|
||||
C4::Context->userenv->{branch};
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ my $PHONE = "555-12123";
|
|||
# XXX should be randomised and checked against the database
|
||||
my $IMPOSSIBLE_CARDNUMBER = "XYZZZ999";
|
||||
|
||||
my $INDEPENDENT_BRANCHES_PREF = 'IndependantBranches';
|
||||
my $INDEPENDENT_BRANCHES_PREF = 'IndependentBranches';
|
||||
|
||||
# XXX make a non-commit transaction and rollback rather than insert/delete
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ sub enable_independant_branches {
|
|||
);
|
||||
|
||||
# set a preference. There's surely a method for this, but I can't find it.
|
||||
my $retval = C4::Context->dbh->do( q(update systempreferences set value = '1' where variable = 'IndependantBranches') );
|
||||
my $retval = C4::Context->dbh->do( q(update systempreferences set value = '1' where variable = 'IndependentBranches') );
|
||||
ok( $retval, 'set the preference' );
|
||||
|
||||
ok( C4::Context->userenv, 'usernev' );
|
||||
|
|
@ -133,7 +133,7 @@ sub enable_independant_branches {
|
|||
sub disable_independant_branches {
|
||||
my $self = shift;
|
||||
|
||||
my $retval = C4::Context->dbh->do( q(update systempreferences set value = '0' where variable = 'IndependantBranches') );
|
||||
my $retval = C4::Context->dbh->do( q(update systempreferences set value = '0' where variable = 'IndependentBranches') );
|
||||
ok( $retval, 'set the preference back' );
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ sub one_order : Test( 55 ) {
|
|||
is( $total_qtyreceived, 0, 'total_qtyreceived searched by from_date' );
|
||||
}
|
||||
|
||||
# set up some things necessary to make GetHistory use the IndependantBranches
|
||||
# set up some things necessary to make GetHistory use the IndependentBranches
|
||||
$self->enable_independant_branches();
|
||||
|
||||
# just search by title here, we need to search by something.
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ sub one_order : Test( 29 ) {
|
|||
or diag( Data::Dumper->Dump( [ \@orders ], [ 'orders' ] ) );
|
||||
}
|
||||
|
||||
# set up some things necessary to make GetLateOrders use the IndependantBranches
|
||||
# set up some things necessary to make GetLateOrders use the IndependentBranches
|
||||
$self->enable_independant_branches();
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ foreach my $tag (sort keys %{$tagslib}) {
|
|||
$value =~ s/DD/$day/g;
|
||||
}
|
||||
$subfield_data{visibility} = "display:none;" if (($tagslib->{$tag}->{$subfield}->{hidden} > 4) || ($tagslib->{$tag}->{$subfield}->{hidden} < -4));
|
||||
# testing branch value if IndependantBranches.
|
||||
# testing branch value if IndependentBranches.
|
||||
|
||||
my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" );
|
||||
my $attributes = qq($attributes_no_value value="$value" );
|
||||
|
|
@ -492,7 +492,7 @@ sub BuildItemsData{
|
|||
foreach my $field (grep {$_->tag() eq $itemtagfield} $itemmarc->fields()) {
|
||||
# loop through each subfield
|
||||
my $itembranchcode=$field->subfield($branchtagsubfield);
|
||||
if ($itembranchcode && C4::Context->preference("IndependantBranches")) {
|
||||
if ($itembranchcode && C4::Context->preference("IndependentBranches")) {
|
||||
#verifying rights
|
||||
my $userenv = C4::Context->userenv();
|
||||
unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $itembranchcode))){
|
||||
|
|
|
|||
|
|
@ -118,13 +118,13 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
|
|||
);
|
||||
|
||||
my $limit_ind_branch =
|
||||
( C4::Context->preference('IndependantBranches')
|
||||
( C4::Context->preference('IndependentBranches')
|
||||
&& C4::Context->userenv
|
||||
&& !( C4::Context->userenv->{flags} & 1 )
|
||||
&& C4::Context->userenv->{branch} ) ? 1 : 0;
|
||||
|
||||
my $branch = $query->param("branch") || '';
|
||||
if ( C4::Context->preference("IndependantBranches")
|
||||
if ( C4::Context->preference("IndependentBranches")
|
||||
&& C4::Context->userenv
|
||||
&& !( C4::Context->userenv->{flags} & 1 ) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ $keydate =~ s/-/\//g;
|
|||
|
||||
my $branch= $input->param('branch') || C4::Context->userenv->{'branch'};
|
||||
# Set all the branches.
|
||||
my $onlymine=(C4::Context->preference('IndependantBranches') &&
|
||||
my $onlymine=(C4::Context->preference('IndependentBranches') &&
|
||||
C4::Context->userenv &&
|
||||
C4::Context->userenv->{flags} % 2 !=1 &&
|
||||
C4::Context->userenv->{branch}?1:0);
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user
|
|||
}
|
||||
);
|
||||
|
||||
our $my_branch = C4::Context->preference("IndependantBranches") && !$staffflags->{'superlibrarian'}
|
||||
our $my_branch = C4::Context->preference("IndependentBranches") && !$staffflags->{'superlibrarian'}
|
||||
? C4::Context->userenv()->{'branch'}
|
||||
: undef;
|
||||
# we show only the TMPL_VAR names $op
|
||||
|
|
|
|||
Loading…
Reference in New Issue