| 
      
            Lines 21-26
          use strict;
      
      
        Link Here
      
     | 
  
        
          | 21 | 
          require Exporter;  | 
          21 | 
          require Exporter;  | 
        
        
          | 22 | 
          use C4::Context;  | 
          22 | 
          use C4::Context;  | 
        
        
          | 23 | 
           | 
          23 | 
           | 
        
            
               | 
               | 
              24 | 
              use Koha::BusinessLogic::Branch;  | 
            
            
              | 25 | 
               | 
            
        
          | 24 | 
          use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);  | 
          26 | 
          use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);  | 
        
        
          | 25 | 
           | 
          27 | 
           | 
        
        
          | 26 | 
          BEGIN { | 
          28 | 
          BEGIN { | 
        
  
    | 
      
            Lines 177-189
          sub GetBranchesLoop {  # since this is what most pages want anyway
      
      
        Link Here
      
     | 
  
        
          | 177 | 
           | 
          179 | 
           | 
        
        
          | 178 | 
          sub GetBranchName { | 
          180 | 
          sub GetBranchName { | 
        
        
          | 179 | 
              my ($branchcode) = @_;  | 
          181 | 
              my ($branchcode) = @_;  | 
        
          
            
              | 180 | 
                  my $dbh = C4::Context->dbh;  | 
              182 | 
                  return "" unless $branchcode; #FIXME ? sometimes GetBranchName is called without branchcode, we must return immediatly to avoid an arror in ->first->branchname  | 
            
            
              | 181 | 
                  my $sth;  | 
              183 | 
                  return Koha::BusinessLogic::Branch->read({'branchcode' => $branchcode})->first->branchname; | 
            
            
              | 182 | 
                  $sth = $dbh->prepare("Select branchname from branches where branchcode=?"); | 
               | 
               | 
            
            
              | 183 | 
                  $sth->execute($branchcode);  | 
            
            
              | 184 | 
                  my $branchname = $sth->fetchrow_array;  | 
            
            
              | 185 | 
                  $sth->finish;  | 
            
            
              | 186 | 
                  return ($branchname);  | 
            
        
          | 187 | 
          }  | 
          184 | 
          }  | 
        
        
          | 188 | 
           | 
          185 | 
           | 
        
        
          | 189 | 
          =head2 ModBranch  | 
          186 | 
          =head2 ModBranch  | 
        
            
              | 190 | 
              -   | 
               | 
               |