koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/admin marc_subfields_structure.pl,1.20,1.21 marctag


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/admin marc_subfields_structure.pl,1.20,1.21 marctagstructure.pl,1.20,1.21
Date: Tue, 18 May 2004 08:22:48 -0700

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

Modified Files:
        marc_subfields_structure.pl marctagstructure.pl 
Log Message:
framework management : 1 MARC framework for each itemtype


Index: marc_subfields_structure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/marc_subfields_structure.pl,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** marc_subfields_structure.pl 28 Mar 2004 08:42:20 -0000      1.20
--- marc_subfields_structure.pl 18 May 2004 15:22:45 -0000      1.21
***************
*** 29,46 ****
  
  sub StringSearch  {
!       my ($env,$searchstring,$type)address@hidden;
        my $dbh = C4::Context->dbh;
        $searchstring=~ s/\'/\\\'/g;
        my @data=split(' ',$searchstring);
        my address@hidden;
!       my $sth=$dbh->prepare("Select 
tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder
 from marc_subfield_structure where (tagfield like ?) order by tagfield");
!       $sth->execute("$searchstring%");
        my @results;
        my $cnt=0;
        while (my $data=$sth->fetchrow_hashref){
!       push(@results,$data);
!       $cnt ++;
        }
-       #  $sth->execute;
        $sth->finish;
        $dbh->disconnect;
--- 29,45 ----
  
  sub StringSearch  {
!       my ($env,$searchstring,$itemtype)address@hidden;
        my $dbh = C4::Context->dbh;
        $searchstring=~ s/\'/\\\'/g;
        my @data=split(' ',$searchstring);
        my address@hidden;
!       my $sth=$dbh->prepare("Select 
tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder
 from marc_subfield_structure where (tagfield like ? and itemtype=?) order by 
tagfield");
!       $sth->execute("$searchstring%",$itemtype);
        my @results;
        my $cnt=0;
        while (my $data=$sth->fetchrow_hashref){
!               push(@results,$data);
!               $cnt ++;
        }
        $sth->finish;
        $dbh->disconnect;
***************
*** 51,54 ****
--- 50,54 ----
  my $tagfield=$input->param('tagfield');
  my $tagsubfield=$input->param('tagsubfield');
+ my $itemtype=$input->param('itemtype');
  my $pkfield="tagfield";
  my $offset=$input->param('offset');
***************
*** 70,77 ****
--- 70,79 ----
  $template->param(script_name => $script_name,
                                                tagfield =>$tagfield,
+                                               itemtype => $itemtype,
                                                $op              => 1); # we 
show only the TMPL_VAR names $op
  } else {
  $template->param(script_name => $script_name,
                                                tagfield =>$tagfield,
+                                               itemtype => $itemtype,
                                                else              => 1); # we 
show only the TMPL_VAR names $op
  }
***************
*** 138,143 ****
  
        # build values list
!       my $sth=$dbh->prepare("select 
tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder
 from marc_subfield_structure where tagfield=?"); # and 
tagsubfield='$tagsubfield'");
!       $sth->execute($tagfield);
        my @loop_data = ();
        my $toggle="white";
--- 140,145 ----
  
        # build values list
!       my $sth=$dbh->prepare("select 
tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder
 from marc_subfield_structure where tagfield=? and itemtype=?"); # and 
tagsubfield='$tagsubfield'");
!       $sth->execute($tagfield,$itemtype);
        my @loop_data = ();
        my $toggle="white";
***************
*** 248,253 ****
        my $dbh = C4::Context->dbh;
        $template->param(tagfield => "$input->param('tagfield')");
!       my $sth=$dbh->prepare("replace marc_subfield_structure 
(tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder)
!                                                                       values 
(?,?,?,?,?,?,?,?,?,?,?,?)");
        my @tagsubfield = $input->param('tagsubfield');
        my @liblibrarian        = $input->param('liblibrarian');
--- 250,255 ----
        my $dbh = C4::Context->dbh;
        $template->param(tagfield => "$input->param('tagfield')");
!       my $sth=$dbh->prepare("replace marc_subfield_structure 
(tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder,itemtype)
!                                                                       values 
(?,?,?,?,?,?,?,?,?,?,?,?,?)");
        my @tagsubfield = $input->param('tagsubfield');
        my @liblibrarian        = $input->param('liblibrarian');
***************
*** 286,295 ****
                                                                        
$authorised_value,
                                                                        
$thesaurus_category,
!                                                                       
$value_builder);
                        }
                }
        }
        $sth->finish;
!       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=marc_subfields_structure.pl?tagfield=$tagfield\"></html>";
        exit;
  
--- 288,297 ----
                                                                        
$authorised_value,
                                                                        
$thesaurus_category,
!                                                                       
$value_builder,$itemtype);
                        }
                }
        }
        $sth->finish;
!       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=marc_subfields_structure.pl?tagfield=$tagfield&itemtype=$itemtype\"></html>";
        exit;
  
***************
*** 299,303 ****
  } elsif ($op eq 'delete_confirm') {
        my $dbh = C4::Context->dbh;
!       my $sth=$dbh->prepare("select 
tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder
 from marc_subfield_structure where tagfield=? and tagsubfield=?");
        $sth->execute($tagfield,$tagsubfield);
        my $data=$sth->fetchrow_hashref;
--- 301,305 ----
  } elsif ($op eq 'delete_confirm') {
        my $dbh = C4::Context->dbh;
!       my $sth=$dbh->prepare("select 
tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder
 from marc_subfield_structure where tagfield=? and tagsubfield=? and 
itemtype=?");
        $sth->execute($tagfield,$tagsubfield);
        my $data=$sth->fetchrow_hashref;
***************
*** 308,311 ****
--- 310,314 ----
                                                        tagfield      
=>$tagfield,
                                                        tagsubfield => 
$tagsubfield,
+                                                       itemtype => $itemtype,
                                                        );
                                                                                
                        # END $OP eq DELETE_CONFIRM
***************
*** 315,323 ****
        my $dbh = C4::Context->dbh;
        unless (C4::Context->config('demo') eq 1) {
!               my $sth=$dbh->prepare("delete from marc_subfield_structure 
where tagfield=? and tagsubfield=?");
!               $sth->execute($tagfield,$tagsubfield);
                $sth->finish;
        }
!       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=marc_subfields_structure.pl?tagfield=$tagfield\"></html>";
        exit;
        $template->param(tagfield => $tagfield);
--- 318,326 ----
        my $dbh = C4::Context->dbh;
        unless (C4::Context->config('demo') eq 1) {
!               my $sth=$dbh->prepare("delete from marc_subfield_structure 
where tagfield=? and tagsubfield=? and itemtype=?");
!               $sth->execute($tagfield,$tagsubfield,$itemtype);
                $sth->finish;
        }
!       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=marc_subfields_structure.pl?tagfield=$tagfield&itemtype=$itemtype\"></html>";
        exit;
        $template->param(tagfield => $tagfield);
***************
*** 326,330 ****
  } else { # DEFAULT
        my $env;
!       my ($count,$results)=StringSearch($env,$tagfield,'web');
        my $toggle="white";
        my @loop_data = ();
--- 329,333 ----
  } else { # DEFAULT
        my $env;
!       my ($count,$results)=StringSearch($env,$tagfield,$itemtype);
        my $toggle="white";
        my @loop_data = ();
***************
*** 347,356 ****
                $row_data{thesaurus_category}   = 
$results->[$i]{'thesaurus_category'};
                $row_data{value_builder}        = 
$results->[$i]{'value_builder'};
!               $row_data{delete} = 
"$script_name?op=delete_confirm&amp;tagfield=$tagfield&amp;tagsubfield=".$results->[$i]{'tagsubfield'};
                $row_data{bgcolor} = $toggle;
                push(@loop_data, \%row_data);
        }
        $template->param(loop => address@hidden);
!       $template->param(edit => "<a 
href=\"$script_name?op=add_form&amp;tagfield=$tagfield\">");
        if ($offset>0) {
                my $prevpage = $offset-$pagesize;
--- 350,359 ----
                $row_data{thesaurus_category}   = 
$results->[$i]{'thesaurus_category'};
                $row_data{value_builder}        = 
$results->[$i]{'value_builder'};
!               $row_data{delete} = 
"$script_name?op=delete_confirm&amp;tagfield=$tagfield&amp;tagsubfield=".$results->[$i]{'tagsubfield'}."&itemtype=$itemtype";
                $row_data{bgcolor} = $toggle;
                push(@loop_data, \%row_data);
        }
        $template->param(loop => address@hidden);
!       $template->param(edit => "<a 
href=\"$script_name?op=add_form&amp;tagfield=$tagfield&itemtype=$itemtype\">");
        if ($offset>0) {
                my $prevpage = $offset-$pagesize;

Index: marctagstructure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/marctagstructure.pl,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** marctagstructure.pl 11 Mar 2004 05:42:56 -0000      1.20
--- marctagstructure.pl 18 May 2004 15:22:45 -0000      1.21
***************
*** 22,25 ****
--- 22,26 ----
  use CGI;
  use C4::Auth;
+ use C4::Koha;
  use C4::Context;
  use C4::Output;
***************
*** 29,57 ****
  use HTML::Template;
  
! sub StringSearch  {
!       my ($env,$searchstring,$type)address@hidden;
!       my $dbh = C4::Context->dbh;
!       $searchstring=~ s/\'/\\\'/g;
!       my @data=split(' ',$searchstring);
!       my address@hidden;
!       my $sth=$dbh->prepare("Select 
tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from 
marc_tag_structure where (tagfield >= ?) order by tagfield");
!       $sth->execute($data[0]);
!       my @results;
!       while (my $data=$sth->fetchrow_hashref){
!       push(@results,$data);
!       }
!       #  $sth->execute;
!       $sth->finish;
!       return (scalar(@results),address@hidden);
! }
! 
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
  $searchfield=0 unless $searchfield;
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/marctagstructure.pl";
  
  my $dbh = C4::Context->dbh;
  
  my ($template, $loggedinuser, $cookie)
      = get_template_and_user({template_name => 
"parameters/marctagstructure.tmpl",
--- 30,53 ----
  use HTML::Template;
  
! # retrieve parameters
  my $input = new CGI;
+ my $itemtype = $input->param('itemtype'); # set to select framework
+ $itemtype="" unless $itemtype;
+ my $existingitemtype = $input->param('existingitemtype'); # set when we have 
to create a new framework (in itemtype) by copying an old one (in 
existingitemtype)
+ $existingitemtype = "" unless $existingitemtype;
+ my $itemtypeinfo = getitemtypeinfo($itemtype);
  my $searchfield=$input->param('searchfield');
  $searchfield=0 unless $searchfield;
+ $searchfield=~ s/\,//g;
+ 
  my $offset=$input->param('offset');
+ my $op = $input->param('op');
+ my $pagesize=20;
+ 
  my $script_name="/cgi-bin/koha/admin/marctagstructure.pl";
  
  my $dbh = C4::Context->dbh;
  
+ # open template
  my ($template, $loggedinuser, $cookie)
      = get_template_and_user({template_name => 
"parameters/marctagstructure.tmpl",
***************
*** 62,69 ****
                             debug => 1,
                             });
- my $pagesize=20;
- my $op = $input->param('op');
- $searchfield=~ s/\,//g;
  
  if ($op) {
  $template->param(script_name => $script_name,
--- 58,89 ----
                             debug => 1,
                             });
  
+ # get itemtype list
+ my $itemtypes = getitemtypes;
+ my @itemtypesloop;
+ foreach my $thisitemtype (keys %$itemtypes) {
+       my $selected = 1 if $thisitemtype eq $itemtype;
+       my %row =(value => $thisitemtype,
+                               selected => $selected,
+                               description => 
$itemtypes->{$thisitemtype}->{'description'},
+                       );
+       push @itemtypesloop, \%row;
+ }
+ 
+ # check that itemtype framework is defined in marc_tag_structure
+ my $sth=$dbh->prepare("select count(*) from marc_tag_structure where 
itemtype=?");
+ $sth->execute($itemtype);
+ my ($itemtypeexist) = $sth->fetchrow;
+ if ($itemtypeexist) {
+ } else {
+       # if itemtype does not exists, then OP must be changed to "create 
itemtype" if we are not on the way to create it
+       # (op = itemtyp_create_confirm)
+       if ($op eq "itemtype_create_confirm") {
+               duplicate_framework($itemtype, $existingitemtype);
+       } else {
+               $op = "itemtype_create";
+       }
+ }
+ $template->param(itemtypeloop => address@hidden);
  if ($op) {
  $template->param(script_name => $script_name,
***************
*** 74,77 ****
--- 94,98 ----
  }
  
+ 
  ################## ADD_FORM ##################################
  # called by default. Used to create form to add or  modify a record
***************
*** 80,85 ****
        my $data;
        if ($searchfield) {
!               my $sth=$dbh->prepare("select 
tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from 
marc_tag_structure where tagfield=?");
!               $sth->execute($searchfield);
                $data=$sth->fetchrow_hashref;
                $sth->finish;
--- 101,106 ----
        my $data;
        if ($searchfield) {
!               $sth=$dbh->prepare("select 
tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from 
marc_tag_structure where tagfield=? and itemtype=?");
!               $sth->execute($searchfield,$itemtype);
                $data=$sth->fetchrow_hashref;
                $sth->finish;
***************
*** 114,117 ****
--- 135,139 ----
                                                        mandatory => 
CGI::checkbox('mandatory',$data->{'mandatory'}?'checked':'',1,''),
                                                        authorised_value => 
$authorised_value,
+                                                       itemtype => $itemtype,
                                                        );
                                                                                
                        # END $OP eq ADD_FORM
***************
*** 119,124 ****
  # called by add_form, used to insert/modify data in DB
  } elsif ($op eq 'add_validate') {
!       my $dbh = C4::Context->dbh;
!       my $sth=$dbh->prepare("replace marc_tag_structure 
(tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value) values 
(?,?,?,?,?,?)");
        my $tagfield       =$input->param('tagfield');
        my $liblibrarian  = $input->param('liblibrarian');
--- 141,145 ----
  # called by add_form, used to insert/modify data in DB
  } elsif ($op eq 'add_validate') {
!       $sth=$dbh->prepare("replace marc_tag_structure 
(tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value,itemtype) 
values (?,?,?,?,?,?,?)");
        my $tagfield       =$input->param('tagfield');
        my $liblibrarian  = $input->param('liblibrarian');
***************
*** 133,141 ****
                                                        $repeatable?1:0,
                                                        $mandatory?1:0,
!                                                       $authorised_value
                                                        );
        }
        $sth->finish;
!       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=marctagstructure.pl?tagfield=$tagfield\"></html>";
        exit;
                                                                                
                        # END $OP eq ADD_VALIDATE
--- 154,163 ----
                                                        $repeatable?1:0,
                                                        $mandatory?1:0,
!                                                       $authorised_value,
!                                                       $itemtype
                                                        );
        }
        $sth->finish;
!       print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=marctagstructure.pl?tagfield=$tagfield&itemtype=$itemtype\"></html>";
        exit;
                                                                                
                        # END $OP eq ADD_VALIDATE
***************
*** 143,148 ****
  # called by default form, used to confirm deletion of data in DB
  } elsif ($op eq 'delete_confirm') {
!       my $dbh = C4::Context->dbh;
!       my $sth=$dbh->prepare("select 
tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from 
marc_tag_structure where tagfield=?");
        $sth->execute($searchfield);
        my $data=$sth->fetchrow_hashref;
--- 165,169 ----
  # called by default form, used to confirm deletion of data in DB
  } elsif ($op eq 'delete_confirm') {
!       $sth=$dbh->prepare("select 
tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from 
marc_tag_structure where tagfield=?");
        $sth->execute($searchfield);
        my $data=$sth->fetchrow_hashref;
***************
*** 155,159 ****
  # called by delete_confirm, used to effectively confirm deletion of data in DB
  } elsif ($op eq 'delete_confirmed') {
-       my $dbh = C4::Context->dbh;
        unless (C4::Context->config('demo') eq 1) {
                $dbh->do("delete from marc_tag_structure where 
tagfield='$searchfield'");
--- 176,179 ----
***************
*** 161,171 ****
        }
                                                                                
                        # END $OP eq DELETE_CONFIRMED
  ################## DEFAULT ##################################
  } else { # DEFAULT
        if  ($searchfield ne '') {
!                $template->param(searchfield => "<p>You Searched for 
<strong>$searchfield<strong></p>");
        }
        my $env;
!       my ($count,$results)=StringSearch($env,$searchfield,'web');
        my $toggle="white";
        my @loop_data = ();
--- 181,210 ----
        }
                                                                                
                        # END $OP eq DELETE_CONFIRMED
+ ################## ITEMTYPE_CREATE ##################################
+ # called automatically if an unexisting itemtype is selected
+ } elsif ($op eq 'itemtype_create') {
+       $sth = $dbh->prepare("select 
count(*),marc_tag_structure.itemtype,description from 
marc_tag_structure,itemtypes where 
itemtypes.itemtype=marc_tag_structure.itemtype group by 
marc_tag_structure.itemtype");
+       $sth->execute;
+       my @existingitemtypeloop;
+       while (my ($tot,$thisitemtype,$description) = $sth->fetchrow) {
+               if ($tot>0) {
+                       my %line = ( value => $thisitemtype,
+                                               description => $description,
+                                       );
+                       push @existingitemtypeloop,\%line;
+               }
+       }
+       $template->param(existingitemtypeloop => address@hidden,
+                                       itemtype => $itemtype,
+                                       ITdescription => 
$itemtypeinfo->{description},
+                                       );
  ################## DEFAULT ##################################
  } else { # DEFAULT
+       # here, $op can be unset or set to "itemtype_create_confirm".
        if  ($searchfield ne '') {
!                $template->param(searchfield => $searchfield);
        }
        my $env;
!       my ($count,$results)=StringSearch($env,$searchfield,$itemtype);
        my $toggle="white";
        my @loop_data = ();
***************
*** 182,188 ****
                $row_data{mandatory} = $results->[$i]{'mandatory'};
                $row_data{authorised_value} = 
$results->[$i]{'authorised_value'};
!               $row_data{subfield_link} 
="marc_subfields_structure.pl?tagfield=".$results->[$i]{'tagfield'};
!               $row_data{edit} = 
"$script_name?op=add_form&amp;searchfield=".$results->[$i]{'tagfield'};
!               $row_data{delete} = 
"$script_name?op=delete_confirm&amp;searchfield=".$results->[$i]{'tagfield'};
                $row_data{bgcolor} = $toggle;
                push(@loop_data, \%row_data);
--- 221,227 ----
                $row_data{mandatory} = $results->[$i]{'mandatory'};
                $row_data{authorised_value} = 
$results->[$i]{'authorised_value'};
!               $row_data{subfield_link} 
="marc_subfields_structure.pl?tagfield=".$results->[$i]{'tagfield'}."&itemtype=".$itemtype;
!               $row_data{edit} = 
"$script_name?op=add_form&amp;searchfield=".$results->[$i]{'tagfield'}."&itemtype=".$itemtype;
!               $row_data{delete} = 
"$script_name?op=delete_confirm&amp;searchfield=".$results->[$i]{'tagfield'}."&itemtype=".$itemtype;
                $row_data{bgcolor} = $toggle;
                push(@loop_data, \%row_data);
***************
*** 195,198 ****
--- 234,238 ----
                                                searchfield => $searchfield,
                                                script_name => $script_name,
+                                               itemtype => $itemtype,
                 );
        }
***************
*** 202,205 ****
--- 242,246 ----
                                                searchfield => $searchfield,
                                                script_name => $script_name,
+                                               itemtype => $itemtype,
                );
        }
***************
*** 208,209 ****
--- 249,292 ----
  $template->param(loggeninuser => $loggedinuser);
  output_html_with_http_headers $input, $cookie, $template->output;
+ 
+ 
+ #
+ # the sub used for searches
+ #
+ sub StringSearch  {
+       my ($env,$searchstring,$itemtype)address@hidden;
+       my $dbh = C4::Context->dbh;
+       $searchstring=~ s/\'/\\\'/g;
+       my @data=split(' ',$searchstring);
+       my address@hidden;
+       my $sth=$dbh->prepare("Select 
tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from 
marc_tag_structure where (tagfield >= ? and itemtype=?) order by tagfield");
+       $sth->execute($data[0], $itemtype);
+       my @results;
+       while (my $data=$sth->fetchrow_hashref){
+       push(@results,$data);
+       }
+       #  $sth->execute;
+       $sth->finish;
+       return (scalar(@results),address@hidden);
+ }
+ 
+ #
+ # the sub used to duplicate a framework from an existing one in MARC 
parameters tables.
+ #
+ sub duplicate_framework {
+       my ($newitemtype,$olditemtype) = @_;
+       my $sth = $dbh->prepare("select 
tagfield,liblibrarian,libopac,repeatable,mandatory,authorised_value from 
marc_tag_structure where itemtype=?");
+       $sth->execute($olditemtype);
+       my $sth_insert = $dbh->prepare("insert into marc_tag_structure 
(tagfield, liblibrarian, libopac, repeatable, mandatory, authorised_value, 
itemtype) values (?,?,?,?,?,?,?)");
+       while ( my 
($tagfield,$liblibrarian,$libopac,$repeatable,$mandatory,$authorised_value) = 
$sth->fetchrow) {
+               
$sth_insert->execute($tagfield,$liblibrarian,$libopac,$repeatable,$mandatory,$authorised_value,$newitemtype);
+       }
+ 
+       $sth = $dbh->prepare("select 
itemtype,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder,seealso
 from marc_subfield_structure where itemtype=?");
+       $sth->execute($olditemtype);
+       $sth_insert = $dbh->prepare("insert into marc_subfield_structure 
(itemtype,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder,seealso)
 values (?,?,?,?,?,?,?,?,?,?,?,?,?)");
+       while ( my ($itemtype, $tagfield, $tagsubfield, $liblibrarian, 
$libopac, $repeatable, $mandatory, $kohafield, $tab, $authorised_value, 
$thesaurus_category, $value_builder, $seealso) = $sth->fetchrow) {
+               $sth_insert->execute($newitemtype, $tagfield, $tagsubfield, 
$liblibrarian, $libopac, $repeatable, $mandatory, $kohafield, $tab, 
$authorised_value, $thesaurus_category, $value_builder, $seealso);
+       }
+ }
+ 




reply via email to

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