koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/C4 Koha.pm,1.18,1.19


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/C4 Koha.pm,1.18,1.19
Date: Fri, 28 May 2004 01:26:59 -0700

Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30324/C4

Modified Files:
        Koha.pm 
Log Message:
adding authtype management (MARC authority types)

Index: Koha.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Koha.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** Koha.pm     18 May 2004 15:23:49 -0000      1.18
--- Koha.pm     28 May 2004 08:26:57 -0000      1.19
***************
*** 59,62 ****
--- 59,63 ----
                        &getprinters &getprinter
                        &getitemtypes &getitemtypeinfo
+                       &getauthtypes
                        $DEBUG);
  
***************
*** 222,226 ****
  }
  
! =head2 itemtypes
  
    $itemtypes = &getitemtypes();
--- 223,227 ----
  }
  
! =head2 getitemtypes
  
    $itemtypes = &getitemtypes();
***************
*** 272,277 ****
  }
  
  
! =head2 itemtypes
  
    $itemtype = &getitemtype($itemtype);
--- 273,327 ----
  }
  
+ =head2 getauthtypes
  
!   $authtypes = &getauthtypes();
! 
! Returns information about existing authtypes.
! 
! build a HTML select with the following code :
! 
! =head3 in PERL SCRIPT
! 
! my $authtypes = getauthtypes;
! my @authtypesloop;
! foreach my $thisauthtype (keys %$authtypes) {
!       my $selected = 1 if $thisauthtype eq $authtype;
!       my %row =(value => $thisauthtype,
!                               selected => $selected,
!                               authtypetext => 
$authtypes->{$thisauthtype}->{'authtypetext'},
!                       );
!       push @authtypesloop, \%row;
! }
! $template->param(itemtypeloop => address@hidden);
! 
! =head3 in TEMPLATE
! 
! <form action='<!-- TMPL_VAR name="script_name" -->' method=post>
!       <select name="authtype">
!       <!-- TMPL_LOOP name="authtypeloop" -->
!               <option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF 
name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="authtypetext" 
--></option>
!       <!-- /TMPL_LOOP -->
!       </select>
!       <input type=text name=searchfield value="<!-- TMPL_VAR 
name="searchfield" -->">
!       <input type="submit" value="OK" class="button">
! </form>
! 
! 
! =cut
! 
! sub getauthtypes {
! # returns a reference to a hash of references to authtypes...
!       my %authtypes;
!       my $dbh = C4::Context->dbh;
!       my $sth=$dbh->prepare("select * from auth_types order by authtypetext");
!       $sth->execute;
!       while (my $IT=$sth->fetchrow_hashref) {
!                       $authtypes{$IT->{'authtypecode'}}=$IT;
!       }
!       return (\%authtypes);
! }
! 
! 
! =head2 getitemtypeinfo
  
    $itemtype = &getitemtype($itemtype);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]