Bug 10080 - Change system pref IndependantBranches to IndependentBranches
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 15 May 2013 14:10:10 +0000 (10:10 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 22 May 2013 14:58:23 +0000 (07:58 -0700)
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>

45 files changed:
C4/Acquisition.pm
C4/Auth.pm
C4/Boolean.pm
C4/Branch.pm
C4/Circulation.pm
C4/Items.pm
C4/Letters.pm
C4/Members.pm
C4/Reserves.pm
C4/Serials.pm
C4/Suggestions.pm
acqui/basket.pl
acqui/neworderempty.pl
catalogue/moredetail.pl
cataloguing/addbiblio.pl
cataloguing/additem.pl
circ/circulation-home.pl
circ/overdue.pl
circ/pendingreserves.pl
circ/reserveratios.pl
circ/waitingreserves.pl
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt
mainpage.pl
members/deletemem.pl
members/memberentry.pl
members/members-update.pl
members/moremember.pl
reserve/request.pl
serials/member-search.pl
serials/subscription-add.pl
serials/subscription-detail.pl
suggestion/suggestion.pl
t/db_dependent/Members.t
t/db_dependent/lib/KohaTest/Acquisition.pm
t/db_dependent/lib/KohaTest/Acquisition/GetHistory.pm
t/db_dependent/lib/KohaTest/Acquisition/GetLateOrders.pm
tools/batchMod.pl
tools/export.pl
tools/holidays.pl
tools/letter.pl

index a570a73..02dfb28 100644 (file)
@@ -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 ='' ) ";
index ee18030..9dba387 100644 (file)
@@ -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"),
index ca77452..1967bc7 100644 (file)
@@ -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")) ) {
     ...
     }
 
index 1509c13..5770f7b 100644 (file)
@@ -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}                 ;
index 1de40e8..78cbeab 100644 (file)
@@ -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
index 2d2c62c..212a9d3 100644 (file)
@@ -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} );
index ff5b441..0349efe 100644 (file)
@@ -128,7 +128,7 @@ sub getletter {
 
     $branchcode ||= '';
 
-    if ( C4::Context->preference('IndependantBranches')
+    if ( C4::Context->preference('IndependentBranches')
             and $branchcode
             and C4::Context->userenv ) {
 
index 6a30c44..3221f53 100644 (file)
@@ -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})
index c8b0cdd..5ff12e4 100644 (file)
@@ -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
index e2748ff..76d3fc7 100644 (file)
@@ -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}
index c55968a..bf7878b 100644 (file)
@@ -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{
index f203af2..7eff6e4 100755 (executable)
@@ -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 '' )
index 33b061d..ce96ff3 100755 (executable)
@@ -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};
index 55e8273..f0cfb13 100755 (executable)
@@ -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'})) {
index fdbacd4..3a5b7c5 100755 (executable)
@@ -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};
index 7475103..a2eacef 100755 (executable)
@@ -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};
index 5eee81b..d4f5a2c 100755 (executable)
@@ -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;
index 1e1bd6f..4343592 100755 (executable)
@@ -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};
index 31ecd85..9a60ec1 100755 (executable)
@@ -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'};
     }
index 91d1f6a..29cd0b6 100755 (executable)
@@ -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'};
 }
index 158b847..1ec6b2d 100755 (executable)
@@ -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' )
index 126f40a..817b9f8 100644 (file)
@@ -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');
index 61c0de0..1de26a9 100755 (executable)
@@ -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)
index dd48044..194a0f9 100644 (file)
@@ -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>
index bb5c546..1215ac1 100644 (file)
@@ -64,7 +64,7 @@ Administration:
                   tmp: as temporary files.
                   memcached: in a memcached server.
         -
-            - pref: IndependantBranches
+            - pref: IndependentBranches
               default: 0
               choices:
                   yes: Prevent
index 4b547c9..c0b3f99 100644 (file)
@@ -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>
index f5e82b4..af533f4 100644 (file)
@@ -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>
index 9085630..4159618 100755 (executable)
@@ -51,7 +51,7 @@ $template->param(
 );
 
 my $branch =
-  C4::Context->preference("IndependantBranches")
+  C4::Context->preference("IndependentBranches")
   && !$flags->{'superlibrarian'}
   ? C4::Context->userenv()->{'branch'}
   : undef;
index 7a78ead..ef6ba01 100755 (executable)
@@ -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'}){
index f51e117..b7123f2 100755 (executable)
@@ -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'}){
index 334d83b..0b39552 100755 (executable)
@@ -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;
index 2e5c66a..1cd6c05 100755 (executable)
@@ -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} ) {
index 7f3f423..54f2755 100755 (executable)
@@ -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;
index ecbb94f..17c19d5 100755 (executable)
@@ -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'};
    }
index 10bccd1..1959b23 100755 (executable)
@@ -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};
index 8bfee43..fc57d89 100755 (executable)
@@ -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} &&
index b4f4d37..4788266 100755 (executable)
@@ -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};
index 58c0d37..634ac0c 100755 (executable)
@@ -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
 
index e7618c9..c859038 100644 (file)
@@ -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' );
 
     
index a2c0ed2..8191723 100644 (file)
@@ -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.
index a2f95ea..cc7fdaa 100644 (file)
@@ -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();    
 
     {
index e416d44..c299487 100755 (executable)
@@ -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))){
index d634419..0e05e3a 100755 (executable)
@@ -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 ) )
 {
index bb04988..38c889d 100755 (executable)
@@ -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);
index 68c6701..7582e66 100755 (executable)
@@ -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