X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=C4%2FBranch.pm;h=7bd03264b7228a12d7a5683802265452d346ae8a;hb=refs%2Fheads%2Fffzg-1059-zebra_spine_label;hp=db7a87f2ffa88f5395145617277ca65cfe2f0b47;hpb=2ba1ba0cfc2ec5583995774f34617abd4cab3fc5;p=koha.git diff --git a/C4/Branch.pm b/C4/Branch.pm index db7a87f2ff..7bd03264b7 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -20,7 +20,6 @@ use strict; #use warnings; FIXME - Bug 2505 require Exporter; use C4::Context; -use C4::Koha; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @@ -160,7 +159,7 @@ sub GetBranchesLoop (;$$) { # since this is what most pages want anyway my $onlymine = @_ ? shift : onlymine(); my $branches = GetBranches($onlymine); my @loop; - foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { + foreach ( sort { uc($branches->{$a}->{branchname}) cmp uc($branches->{$b}->{branchname}) } keys %$branches ) { push @loop, { value => $_, selected => ($_ eq $branch) ? 1 : 0, @@ -203,17 +202,18 @@ sub ModBranch { my $query = " INSERT INTO branches (branchcode,branchname,branchaddress1, - branchaddress2,branchaddress3,branchzip,branchcity, + branchaddress2,branchaddress3,branchzip,branchcity,branchstate, branchcountry,branchphone,branchfax,branchemail, branchurl,branchip,branchprinter,branchnotes) - VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) + VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) "; my $sth = $dbh->prepare($query); $sth->execute( $data->{'branchcode'}, $data->{'branchname'}, $data->{'branchaddress1'}, $data->{'branchaddress2'}, $data->{'branchaddress3'}, $data->{'branchzip'}, - $data->{'branchcity'}, $data->{'branchcountry'}, + $data->{'branchcity'}, $data->{'branchstate'}, + $data->{'branchcountry'}, $data->{'branchphone'}, $data->{'branchfax'}, $data->{'branchemail'}, $data->{'branchurl'}, $data->{'branchip'}, $data->{'branchprinter'}, @@ -225,7 +225,7 @@ sub ModBranch { UPDATE branches SET branchname=?,branchaddress1=?, branchaddress2=?,branchaddress3=?,branchzip=?, - branchcity=?,branchcountry=?,branchphone=?, + branchcity=?,branchstate=?,branchcountry=?,branchphone=?, branchfax=?,branchemail=?,branchurl=?,branchip=?, branchprinter=?,branchnotes=? WHERE branchcode=? @@ -235,7 +235,8 @@ sub ModBranch { $data->{'branchname'}, $data->{'branchaddress1'}, $data->{'branchaddress2'}, $data->{'branchaddress3'}, $data->{'branchzip'}, - $data->{'branchcity'}, $data->{'branchcountry'}, + $data->{'branchcity'}, $data->{'branchstate'}, + $data->{'branchcountry'}, $data->{'branchphone'}, $data->{'branchfax'}, $data->{'branchemail'}, $data->{'branchurl'}, $data->{'branchip'}, $data->{'branchprinter'}, @@ -406,34 +407,6 @@ sub GetBranchDetail { return $sth->fetchrow_hashref(); } -=head2 get_branchinfos_of - - my $branchinfos_of = get_branchinfos_of(@branchcodes); - -Associates a list of branchcodes to the information of the branch, taken in -branches table. - -Returns a href where keys are branchcodes and values are href where keys are -branch information key. - - print 'branchname is ', $branchinfos_of->{$code}->{branchname}; - -=cut - -sub get_branchinfos_of { - my @branchcodes = @_; - - my $query = ' - SELECT branchcode, - branchname - FROM branches - WHERE branchcode IN (' - . join( ',', map( { "'" . $_ . "'" } @branchcodes ) ) . ') -'; - return C4::Koha::get_infos_of( $query, 'branchcode' ); -} - - =head2 GetBranchesInCategory my $branches = GetBranchesInCategory($categorycode);