koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Koha.pm [dev_week]


From: Ryan Higgins
Subject: [Koha-cvs] koha/C4 Koha.pm [dev_week]
Date: Mon, 01 Jan 2007 02:14:33 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Ryan Higgins <rych>     07/01/01 02:14:33

Modified files:
        C4             : Koha.pm 

Log message:
        adding authorisedvalue routine

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Koha.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.22.2.4.2.8&r2=1.22.2.4.2.9

Patches:
Index: Koha.pm
===================================================================
RCS file: /sources/koha/koha/C4/Koha.pm,v
retrieving revision 1.22.2.4.2.8
retrieving revision 1.22.2.4.2.9
diff -u -b -r1.22.2.4.2.8 -r1.22.2.4.2.9
--- Koha.pm     4 Dec 2006 05:19:36 -0000       1.22.2.4.2.8
+++ Koha.pm     1 Jan 2007 02:14:33 -0000       1.22.2.4.2.9
@@ -63,6 +63,7 @@
                        &GetCcodes
                        &GetAuthItemlost
                        &GetAuthItembinding
+                       &getKohaAuthorisedValues
 
                        &getitemtypeinfo
                        &getframeworks &getframeworkinfo
@@ -782,7 +783,9 @@
         {
         link_value => 'branch',
         label_value => 'Branches',
+#        tags => ['959',],
         tags => ['952',],
+#        subfield => 'n',
         subfield => 'b',
         expanded => '1',
         },
@@ -1093,6 +1096,30 @@
     return @languages_options;
 }
 
+=head2 getKohaAuthorisedValues
+       
+       Takes $dbh , $kohafield as parameters.
+       returns hashref of authvalCode => liblibrarian
+       or undef if no authvals defined for kohafield.
+
+=cut
+
+sub getKohaAuthorisedValues {
+       my ($dbh, $kohafield) = @_;
+       my %values;
+    my   $sthnflstatus = $dbh->prepare('select authorised_value from 
marc_subfield_structure where kohafield=?');
+        $sthnflstatus->execute($kohafield);
+    my    $authorised_valuecode = $sthnflstatus->fetchrow;
+        if ($authorised_valuecode) {  
+            $sthnflstatus = $dbh->prepare("select authorised_value, lib from 
authorised_values where category=? ");
+            $sthnflstatus->execute($authorised_valuecode);
+            while ( my ($val, $lib) = $sthnflstatus->fetchrow_array ) { 
+                               $values{$val}= $lib;
+                       }
+               }
+       return \%values;
+}
+
 1;
 __END__
 




reply via email to

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