koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/value_builder unimarc_field_4XX.pl,1.1,1.2


From: Henri-Damien LAURENT
Subject: [Koha-cvs] CVS: koha/value_builder unimarc_field_4XX.pl,1.1,1.2
Date: Wed, 16 Mar 2005 08:24:41 -0800

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

Modified Files:
        unimarc_field_4XX.pl 
Log Message:
Automatic input filling for 4XX Unimarc fields on plugin selections 

Index: unimarc_field_4XX.pl
===================================================================
RCS file: /cvsroot/koha/koha/value_builder/unimarc_field_4XX.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** unimarc_field_4XX.pl        12 Mar 2005 16:45:50 -0000      1.1
--- unimarc_field_4XX.pl        16 Mar 2005 16:24:38 -0000      1.2
***************
*** 29,35 ****
--- 29,37 ----
  use C4::Database;
  use C4::Biblio;
+ #use C4::SimpleMarc;
  use C4::SearchMarc;
  use C4::Acquisition;
  use C4::Koha;
+ use MARC::Record;
  
  sub plugin_parameters {
***************
*** 78,82 ****
        my $searchdesc;
        
!       if ($op eq "do_search") {
                my @marclist = $query->param('marclist');
                my @and_or = $query->param('and_or');
--- 80,212 ----
        my $searchdesc;
        
!       if ($op eq "fillinput"){
!               my $bibnum = $query->param('bibnum');
!               my $index = $query->param('index');
!               my $marcrecord;
! # open template
!               ($template, $loggedinuser, $cookie)= 
get_template_and_user({template_name => "value_builder/unimarc_field_4XX.tmpl",
!                            query => $query,
!                            type => "intranet",
!                            authnotrequired => 0,
!                            flagsrequired => {catalogue => 1},
!                            debug => 1,
!                           });
!               #get bibid
!               my $bibid;
!               my $req= $dbh->prepare("SELECT distinctrow bibid,biblionumber 
FROM `marc_biblio` WHERE biblionumber= ?");
!               $req->execute($bibnum);
!               ($bibid,$bibnum) = $req->fetchrow;
!               warn "bibid :".$bibid;
!               #get marc record
!               $marcrecord = MARCgetbiblio($dbh,$bibid);
!               warn "record : ".$marcrecord->as_formatted;
! #             my @loop_data =();
! #             my $tag;
! #             my @loop_data =();
! #             my @subfields_data;
!               
!               my $subfield_value_9=$bibid;
!               my $subfield_value_0=$marcrecord->field('001');
!               my $subfield_value_a;
!               if ($marcrecord->field('200')){
!                       
$subfield_value_a=$marcrecord->field('200')->subfield("f");
!               } elsif ($marcrecord->field('700')){
!                       
$subfield_value_a=$marcrecord->field('700')->subfield("a");
!               } elsif ($marcrecord->field('701')){
!                       
$subfield_value_a=$marcrecord->field('701')->subfield("a");
!               }
!               my $subfield_value_c = $marcrecord->field('210')->subfield("d") 
if ($marcrecord->field('210'));
!               my $subfield_value_d;
!               if ($marcrecord->field('100')){
!                       my $publicationdate;
!                       warn "date de publication 
1".substr($marcrecord->field('100')->subfield("a"),9,4)."   date de publication 
2 ".substr($marcrecord->field('100')->subfield("a"),12,4);
!                       $publicationdate = 
substr($marcrecord->field('100')->subfield("a"),9,4);
!                       if 
(substr($marcrecord->field('100')->subfield("a"),12,4)>$publicationdate){
!                       
$publicationdate=substr($marcrecord->field('100')->subfield("a"),12,4);
!                       }
!                       $subfield_value_d=$publicationdate;
!               }
!               my $subfield_value_e= $marcrecord->field('205')->subfield("a") 
if ($marcrecord->field('205'));
!               
!               my $subfield_value_h; 
!               if (($marcrecord->field('200')) && 
($marcrecord->field('200')->subfield("h"))){
!                       $subfield_value_h = 
$marcrecord->field('200')->subfield("h") ;
!               } elsif (($marcrecord->field('225')) && 
($marcrecord->field('225')->subfield("h"))) {
!                       $subfield_value_h = 
$marcrecord->field('225')->subfield("h") ;
!               } elsif (($marcrecord->field('500')) && 
($marcrecord->field('500')->subfield("h"))) {
!                       $subfield_value_h = 
$marcrecord->field('500')->subfield("h") ;
!               }
!               
!               my $subfield_value_i;
!               if (($marcrecord->field('200')) && 
($marcrecord->field('200')->subfield("i"))){
!                       $subfield_value_i = 
$marcrecord->field('200')->subfield("i") ;
!               } elsif (($marcrecord->field('225')) && 
($marcrecord->field('225')->subfield("i"))) {
!                       $subfield_value_i = 
$marcrecord->field('225')->subfield("i") ;
!               } elsif (($marcrecord->field('500')) && 
($marcrecord->field('500')->subfield("i"))) {
!                       $subfield_value_i = 
$marcrecord->field('500')->subfield("i") ;
!               }
! 
!               my $subfield_value_p = $marcrecord->field('215')->subfield("a") 
if ($marcrecord->field('215'));
!               
!               my $subfield_value_t;
!               if (($marcrecord->field('200')) && 
($marcrecord->field('200')->subfield("a"))){
!                       $subfield_value_t = 
$marcrecord->field('200')->subfield("a") ;
!               } elsif (($marcrecord->field('225')) && 
($marcrecord->field('225')->subfield("a"))) {
!                       $subfield_value_t = 
$marcrecord->field('225')->subfield("a") ;
!               } elsif (($marcrecord->field('500')) && 
($marcrecord->field('500')->subfield("a"))) {
!                       $subfield_value_t = 
$marcrecord->field('500')->subfield("a") ;
!               }
!               
!               my $subfield_value_u = $marcrecord->field('856')->subfield("p") 
if ($marcrecord->field('856'));
!               
!               my $subfield_value_v;
!               if (($marcrecord->field('225')) && 
($marcrecord->field('225')->subfield("v"))){
!                       $subfield_value_v = 
$marcrecord->field('225')->subfield("v") ;
!               } elsif (($marcrecord->field('200')) && 
($marcrecord->field('200')->subfield("h"))) {
!                       $subfield_value_v = 
$marcrecord->field('200')->subfield("h") ;
!               }
!               my $subfield_value_x = $marcrecord->field('011')->subfield("a") 
if ($marcrecord->field('011') and not 
(($marcrecord->field('011')->subfield("y")) or 
($marcrecord->field('011')->subfield("z"))));
!               my $subfield_value_y = $marcrecord->field('013')->subfield("a") 
if ($marcrecord->field('013'));
!               if ($marcrecord->field('010')){
!                       my $subfield_value_y = 
$marcrecord->field('010')->subfield("a");
!               }
! #             my @subf;
! #             #=(a,c,d,e,h,i,p,t,u,v,x,y,0,9);
! #                     # loop through each subfield
! #             for my $i (0..$#subf) {
! #                     $subf[$i][0] = "@" unless $subf[$i][0];
! #                     my %subfield_data;
! #                     $subfield_data{marc_value}=$subf[$i][1];
! #                     $subfield_data{marc_subfield}=$subf[$i][0];
! #                     $subfield_data{marc_tag}="";#$field->tag();
! #                     push(@subfields_data, \%subfield_data);
! #             }
! #             if ($#subfields_data>=0) {
! #                     my %tag_data;
! #                     $tag_data{tag}="";#$field->tag().' -'. "";
! #                     $tag_data{subfield} = address@hidden;
! #                     push (@loop_data, \%tag_data);
! #             }
! #             $template->param("0XX" =>address@hidden);
!               $template->param(fillinput => 1,
!                                               index => 
$query->param('index')."",
!                                               bibid=>$bibid?$bibid:"",
!                                               
subfield_value_9=>$subfield_value_9,
!                                               
subfield_value_0=>$subfield_value_0,
!                                               
subfield_value_a=>$subfield_value_a,
!                                               
subfield_value_c=>$subfield_value_c,
!                                               
subfield_value_d=>$subfield_value_d,
!                                               
subfield_value_e=>$subfield_value_e,
!                                               
subfield_value_h=>$subfield_value_h,
!                                               
subfield_value_i=>$subfield_value_i,
!                                               
subfield_value_p=>$subfield_value_p,
!                                               
subfield_value_t=>$subfield_value_t,
!                                               
subfield_value_u=>$subfield_value_u,
!                                               
subfield_value_v=>$subfield_value_v,
!                                               
subfield_value_x=>$subfield_value_x,
!                                               
subfield_value_y=>$subfield_value_y,
!                                               );
! ###############################################################       
!       }elsif ($op eq "do_search") {
                my @marclist = $query->param('marclist');
                my @and_or = $query->param('and_or');
***************
*** 115,120 ****
                                                                                
        address@hidden, address@hidden, address@hidden,
                                                                                
        $startfrom*$resultsperpage, $resultsperpage,$orderby, $desc_or_asc);
!               warn " biblio count : ".$total;
!               warn " biblio count : ".$total;
                
                ($template, $loggedinuser, $cookie)
--- 245,249 ----
                                                                                
        address@hidden, address@hidden, address@hidden,
                                                                                
        $startfrom*$resultsperpage, $resultsperpage,$orderby, $desc_or_asc);
! #             warn " biblio count : ".$total;
                
                ($template, $loggedinuser, $cookie)
***************
*** 260,263 ****
--- 389,393 ----
                                                CGIbranch => $CGIbranch,
                                                CGIPublisher => $CGIpublisher,
+                                               index=>$query->param('index'),
                                                Search =>1,
                );




reply via email to

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