From 485d57885a9db3135503bce4941e7aab913241e6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 19 Apr 2013 10:33:15 -0400 Subject: [PATCH] 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 --- C4/Acquisition.pm | 10 +++++----- C4/Auth.pm | 6 +++--- C4/Boolean.pm | 2 +- C4/Branch.pm | 4 ++-- C4/Circulation.pm | 2 +- C4/Items.pm | 6 +++--- C4/Letters.pm | 2 +- C4/Members.pm | 8 ++++---- C4/Reserves.pm | 2 +- C4/Serials.pm | 14 +++++++------- C4/Suggestions.pm | 6 +++--- acqui/basket.pl | 4 ++-- acqui/neworderempty.pl | 2 +- catalogue/moredetail.pl | 2 +- cataloguing/addbiblio.pl | 2 +- cataloguing/additem.pl | 4 ++-- circ/circulation-home.pl | 2 +- circ/overdue.pl | 2 +- circ/pendingreserves.pl | 2 +- circ/reserveratios.pl | 2 +- circ/waitingreserves.pl | 2 +- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 7 +++++++ .../intranet-tmpl/prog/en/includes/header.inc | 2 +- .../prog/en/modules/admin/preferences/admin.pref | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 2 +- .../prog/en/modules/circ/circulation-home.tt | 2 +- mainpage.pl | 2 +- members/deletemem.pl | 2 +- members/memberentry.pl | 4 ++-- members/members-update.pl | 2 +- members/moremember.pl | 4 ++-- misc/release_notes/release_notes_30004.txt | 2 +- misc/release_notes/release_notes_3_10_0.txt | 2 +- .../po/am-Ethi-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/am-Ethi-pref.po | 6 +++--- .../po/ar-Arab-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/ar-Arab-pref.po | 6 +++--- .../po/az-AZ-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/az-AZ-pref.po | 6 +++--- misc/translator/po/ben-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/ben-pref.po | 6 +++--- .../po/bg-Cyrl-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/bg-Cyrl-pref.po | 6 +++--- .../po/ca-VA-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/ca-VA-pref.po | 6 +++--- .../po/cs-CZ-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/cs-CZ-pref.po | 6 +++--- .../po/da-DK-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/da-DK-pref.po | 6 +++--- .../po/de-DE-i-staff-t-prog-v-3006000.po | 6 +++--- misc/translator/po/de-DE-pref.po | 6 +++--- .../po/el-GR-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/el-GR-pref.po | 6 +++--- .../po/en-GB-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/en-GB-pref.po | 6 +++--- .../po/en-NZ-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/en-NZ-pref.po | 6 +++--- .../po/es-ES-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/es-ES-pref.po | 6 +++--- misc/translator/po/eu-pref.po | 6 +++--- misc/translator/po/fa-Arab-pref.po | 6 +++--- .../po/fi-FI-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/fi-FI-pref.po | 6 +++--- .../po/fr-CA-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/fr-CA-pref.po | 6 +++--- .../po/fr-FR-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/fr-FR-pref.po | 6 +++--- misc/translator/po/gl-pref.po | 6 +++--- misc/translator/po/he-Hebr-pref.po | 6 +++--- misc/translator/po/hi-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/hi-pref.po | 6 +++--- .../po/hr-HR-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/hr-HR-pref.po | 6 +++--- .../po/hu-HU-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/hu-HU-pref.po | 6 +++--- .../po/hy-Armn-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/hy-Armn-pref.po | 6 +++--- .../po/id-ID-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/id-ID-pref.po | 6 +++--- misc/translator/po/is-IS-pref.po | 12 ++++++------ .../po/it-IT-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/it-IT-pref.po | 6 +++--- misc/translator/po/ja-Jpan-JP-pref.po | 6 +++--- misc/translator/po/ko-Kore-KP-pref.po | 6 +++--- .../po/lo-Laoo-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/lo-Laoo-pref.po | 6 +++--- misc/translator/po/mi-NZ-pref.po | 6 +++--- misc/translator/po/mon-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/mon-pref.po | 6 +++--- misc/translator/po/mr-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/mr-pref.po | 6 +++--- .../po/ms-MY-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/ms-MY-pref.po | 6 +++--- .../po/nb-NO-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/nb-NO-pref.po | 8 ++++---- .../po/ne-NE-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/ne-NE-pref.po | 6 +++--- .../po/nl-BE-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/nl-BE-pref.po | 6 +++--- .../po/nl-NL-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/nl-NL-pref.po | 6 +++--- .../po/nn-NO-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/nn-NO-pref.po | 6 +++--- misc/translator/po/pbr-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/pbr-pref.po | 6 +++--- .../po/pl-PL-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/pl-PL-pref.po | 6 +++--- misc/translator/po/prs-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/prs-pref.po | 6 +++--- .../po/pt-BR-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/pt-BR-pref.po | 12 ++++++------ .../po/pt-PT-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/pt-PT-pref.po | 12 ++++++------ .../po/ro-RO-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/ro-RO-pref.po | 12 ++++++------ .../po/ru-RU-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/ru-RU-pref.po | 6 +++--- .../po/sd-PK-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/sd-PK-pref.po | 6 +++--- .../po/sk-SK-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/sk-SK-pref.po | 6 +++--- .../po/sl-SI-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/sl-SI-pref.po | 6 +++--- .../po/sq-AL-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/sq-AL-pref.po | 6 +++--- .../po/sr-Cyrl-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/sr-Cyrl-pref.po | 6 +++--- .../po/sv-SE-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/sv-SE-pref.po | 6 +++--- .../po/ta-LK-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/ta-LK-pref.po | 6 +++--- misc/translator/po/tet-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/tet-pref.po | 6 +++--- .../po/th-THA-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/th-THA-pref.po | 6 +++--- misc/translator/po/tl-PH-pref.po | 6 +++--- .../po/tr-TR-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/tr-TR-pref.po | 10 +++++----- .../po/uk-UA-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/uk-UA-pref.po | 6 +++--- .../po/ur-Arab-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/ur-Arab-pref.po | 6 +++--- .../po/vi-VN-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/vi-VN-pref.po | 6 +++--- .../po/zh-Hans-CN-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/zh-Hans-CN-pref.po | 6 +++--- .../po/zh-Hans-TW-i-staff-t-prog-v-3006000.po | 4 ++-- misc/translator/po/zh-Hans-TW-pref.po | 6 +++--- reserve/request.pl | 2 +- serials/member-search.pl | 2 +- serials/subscription-add.pl | 2 +- serials/subscription-detail.pl | 2 +- suggestion/suggestion.pl | 2 +- t/db_dependent/Members.t | 2 +- t/db_dependent/lib/KohaTest/Acquisition.pm | 4 ++-- .../lib/KohaTest/Acquisition/GetHistory.pm | 2 +- .../lib/KohaTest/Acquisition/GetLateOrders.pm | 2 +- tools/batchMod.pl | 4 ++-- tools/export.pl | 4 ++-- tools/holidays.pl | 2 +- tools/letter.pl | 2 +- 162 files changed, 388 insertions(+), 381 deletions(-) diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 77010c5..acb5cf5 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -867,7 +867,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 = '')"; @@ -1695,7 +1695,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 = ? @@ -1914,7 +1914,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 ? '; @@ -2023,7 +2023,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') "; @@ -2083,7 +2083,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 ='' ) "; diff --git a/C4/Auth.pm b/C4/Auth.pm index ca061b5..551a951 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -345,7 +345,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"), @@ -880,7 +880,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/){ @@ -1025,7 +1025,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"), diff --git a/C4/Boolean.pm b/C4/Boolean.pm index ca77452..1967bc7 100644 --- a/C4/Boolean.pm +++ b/C4/Boolean.pm @@ -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")) ) { ... } diff --git a/C4/Branch.pm b/C4/Branch.pm index 1509c13..5770f7b 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -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} ; diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 1de40e8..78cbeab 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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 diff --git a/C4/Items.pm b/C4/Items.pm index d9c31f9..18f9afc 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -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->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'}) ) { @@ -2690,7 +2690,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} ); diff --git a/C4/Letters.pm b/C4/Letters.pm index b8e2722..0868e1b 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -123,7 +123,7 @@ sub getletter { $branchcode ||= ''; - if ( C4::Context->preference('IndependantBranches') + if ( C4::Context->preference('IndependentBranches') and $branchcode and C4::Context->userenv ) { diff --git a/C4/Members.pm b/C4/Members.pm index 6a30c44..3221f53 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -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}) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index c8b0cdd..5ff12e4 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -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 diff --git a/C4/Serials.pm b/C4/Serials.pm index e2748ff..76d3fc7 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -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} diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index c55968a..bf7878b 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -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{ diff --git a/acqui/basket.pl b/acqui/basket.pl index f203af2..7eff6e4 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -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 '' ) diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 33b061d..ce96ff3 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -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}; diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 55e8273..f0cfb13 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -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'})) { diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 3314f1a..79b0f65 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -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}; diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 7475103..a2eacef 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -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}; diff --git a/circ/circulation-home.pl b/circ/circulation-home.pl index 5eee81b..d4f5a2c 100755 --- a/circ/circulation-home.pl +++ b/circ/circulation-home.pl @@ -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; diff --git a/circ/overdue.pl b/circ/overdue.pl index 1e1bd6f..4343592 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -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}; diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index 31ecd85..9a60ec1 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -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'}; } diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl index 91d1f6a..29cd0b6 100755 --- a/circ/reserveratios.pl +++ b/circ/reserveratios.pl @@ -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'}; } diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 158b847..1ec6b2d 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -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' ) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 34e2ca0..9ef34b0 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -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'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 35f575a..12b39c0 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6834,6 +6834,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { 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) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 4a26d79..289f5b7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -61,7 +61,7 @@