koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha C4/Bull.pm bull/statecollection.pl [rel_2_2]


From: Robert Lyon
Subject: [Koha-cvs] koha C4/Bull.pm bull/statecollection.pl [rel_2_2]
Date: Mon, 04 Dec 2006 05:27:27 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Robert Lyon <bob_lyon>  06/12/04 05:27:27

Modified files:
        C4             : Bull.pm 
        bull           : statecollection.pl 

Log message:
        Updating statecollection to do a check for certain koh2marc links to 
see if they exist

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Bull.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.6.2.38&r2=1.6.2.39
http://cvs.savannah.gnu.org/viewcvs/koha/bull/statecollection.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.3.2.21&r2=1.3.2.22

Patches:
Index: C4/Bull.pm
===================================================================
RCS file: /sources/koha/koha/C4/Attic/Bull.pm,v
retrieving revision 1.6.2.38
retrieving revision 1.6.2.39
diff -u -b -r1.6.2.38 -r1.6.2.39
--- C4/Bull.pm  28 Nov 2006 01:34:47 -0000      1.6.2.38
+++ C4/Bull.pm  4 Dec 2006 05:27:27 -0000       1.6.2.39
@@ -56,7 +56,8 @@
                        &getSupplierListWithLateIssues &GetLateIssues 
&GetMissingIssues
                         &getroutinglist &delroutingmember &addroutingmember 
&reorder_members
                         &check_routing &getsupplierbyserialid &updateClaim 
&removeMissingIssue &abouttoexpire
-                        &old_getserials &old_newsubscription 
&old_modsubscription &old_serialchangestatus);
+                        &old_getserials &old_newsubscription 
&old_modsubscription &old_serialchangestatus
+                        &is_able_to_receive);
 
 # for removing the missing issue sequence from the box on check-in page
 sub removeMissingIssue {
@@ -695,6 +696,36 @@
   VALUES (?,?,?,?,?,?)");
        
$sth->execute($serialseq,$subscriptionid,$biblionumber,$status,$publisheddate, 
$planneddate);
 }
+=head2 is_able_to_receive
+
+   is_able_to_receive();
+   contains an array of kohafields to check
+   my @fields = 
('items.dateaccessioned','items.notforloan','items.location','items.itemnotes',
+                 
'items.itemcallnumber','items.holdingbranch','items.homebranch','items.barcode');
+   returns nothing or an array indicating which koha2marklins are not set for 
the serialsitemize subroutine
+=cut
+
+sub is_able_to_receive {
+        my @fields = 
('items.dateaccessioned','items.notforloan','items.location','items.itemnotes','items.itemcallnumber','items.holdingbranch','items.homebranch','items.barcode');
+        my @errors;
+        for(my $i=0;$i<@fields;$i++){
+           my $dbh= C4::Context->dbh;
+           my $sth=$dbh->prepare("SELECT tagfield,tagsubfield
+                                   FROM marc_subfield_structure
+                                   WHERE kohafield = ?");
+            $sth->execute($fields[$i]);
+            my $data=$sth->fetchrow_hashref;
+            if($data->{'tagfield'} && $data->{'tagsubfield'}){
+               # is ok
+           } else {
+               my %line;
+               $line{"errorline"} = $fields[$i];
+               push @errors,\%line;
+           }
+            $sth->finish;
+        }
+        return @errors;
+}
 
 =head2 serialsitemize
 

Index: bull/statecollection.pl
===================================================================
RCS file: /sources/koha/koha/bull/Attic/statecollection.pl,v
retrieving revision 1.3.2.21
retrieving revision 1.3.2.22
diff -u -b -r1.3.2.21 -r1.3.2.22
--- bull/statecollection.pl     24 Nov 2006 00:23:22 -0000      1.3.2.21
+++ bull/statecollection.pl     4 Dec 2006 05:27:27 -0000       1.3.2.22
@@ -204,11 +204,13 @@
        
$template->param(branchloop=>[],itemstatusloop=>[],itemlocationloop=>[]) ;
 }
 
+my @parameter_check = is_able_to_receive();
 
 $template->param(
                         user => $auser,    
                        serialslist => address@hidden,
                         count => $count,    
+                        parameter_check => address@hidden,    
                        biblionumber => $subscription->{biblionumber},
                        histstartdate => 
format_date($solhistory->{'histstartdate'}),
                        enddate => format_date($solhistory->{'enddate'}),




reply via email to

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