koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/admin auth_subfields_structure.pl,1.2,1.3 auth_tag_


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/admin auth_subfields_structure.pl,1.2,1.3 auth_tag_structure.pl,1.1,1.2 authtypes.pl,1.2,1.3 marc_subfields_structure.pl,1.23,1.24
Date: Thu, 10 Jun 2004 01:58:36 -0700

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

Modified Files:
        auth_subfields_structure.pl auth_tag_structure.pl authtypes.pl 
        marc_subfields_structure.pl 
Log Message:
MARC authority management (continued)

Index: auth_subfields_structure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/auth_subfields_structure.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** auth_subfields_structure.pl 3 Jun 2004 10:01:28 -0000       1.2
--- auth_subfields_structure.pl 10 Jun 2004 08:58:34 -0000      1.3
***************
*** 120,128 ****
                }
                $row_data{tab} = CGI::scrolling_list(-name=>'tab',
!                                       
-values=>['-1','0','1','2','3','4','5','6','7','8','9'],
!                                       -labels => {'-1' 
=>'ignore','0'=>'0','1'=>'1',
!                                                                       '2' 
=>'2','3'=>'3','4'=>'4',
!                                                                       '5' 
=>'5','6'=>'6','7'=>'7',
!                                                                       '8' 
=>'8','9'=>'9',
                                                                        },
                                        -default=>$data->{'tab'},
--- 120,125 ----
                }
                $row_data{tab} = CGI::scrolling_list(-name=>'tab',
!                                       -values=>['-1','0'],
!                                       -labels => {'-1' =>'No 
(ignore)','0'=>'yes'
                                                                        },
                                        -default=>$data->{'tab'},
***************
*** 156,164 ****
                my %row_data;  # get a fresh hash for the row data
                $row_data{tab} = CGI::scrolling_list(-name=>'tab',
!                                       
-values=>['-1','0','1','2','3','4','5','6','7','8','9'],
!                                       -labels => {'-1' 
=>'ignore','0'=>'0','1'=>'1',
!                                                                       '2' 
=>'2','3'=>'3','4'=>'4',
!                                                                       '5' 
=>'5','6'=>'6','7'=>'7',
!                                                                       '8' 
=>'8','9'=>'9',
                                                                        },
                                        -default=>"",
--- 153,158 ----
                my %row_data;  # get a fresh hash for the row data
                $row_data{tab} = CGI::scrolling_list(-name=>'tab',
!                                       -values=>['-1','0'],
!                                       -labels => {'-1' =>'no 
(ignore)','0'=>'yes',
                                                                        },
                                        -default=>"",

Index: auth_tag_structure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/auth_tag_structure.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** auth_tag_structure.pl       28 May 2004 08:23:03 -0000      1.1
--- auth_tag_structure.pl       10 Jun 2004 08:58:34 -0000      1.2
***************
*** 287,295 ****
        }
  
!       $sth = $dbh->prepare("select 
authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder,seealso
 from auth_subfield_structure where authtypecode=?");
        $sth->execute($oldauthtype);
!       $sth_insert = $dbh->prepare("insert into auth_subfield_structure 
(authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder,seealso)
 values (?,?,?,?,?,?,?,?,?,?,?,?,?)");
!       while ( my ($authtypecode, $tagfield, $tagsubfield, $liblibrarian, 
$libopac, $repeatable, $mandatory, $kohafield, $tab, $authorised_value, 
$thesaurus_category, $value_builder, $seealso) = $sth->fetchrow) {
!               $sth_insert->execute($newauthtype, $tagfield, $tagsubfield, 
$liblibrarian, $libopac, $repeatable, $mandatory, $kohafield, $tab, 
$authorised_value, $thesaurus_category, $value_builder, $seealso);
        }
  }
--- 287,295 ----
        }
  
!       $sth = $dbh->prepare("select 
authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,tab,authorised_value,seealso
 from auth_subfield_structure where authtypecode=?");
        $sth->execute($oldauthtype);
!       $sth_insert = $dbh->prepare("insert into auth_subfield_structure 
(authtypecode,tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,tab,authorised_value,value_builder,seealso)
 values (?,?,?,?,?,?,?,?,?,?,?)");
!       while ( my ($authtypecode, $tagfield, $tagsubfield, $liblibrarian, 
$libopac, $repeatable, $mandatory, $tab, $authorised_value, 
$thesaurus_category, $seealso) = $sth->fetchrow) {
!               $sth_insert->execute($newauthtype, $tagfield, $tagsubfield, 
$liblibrarian, $libopac, $repeatable, $mandatory, $tab, $authorised_value, 
$thesaurus_category, $seealso);
        }
  }

Index: authtypes.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/authtypes.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** authtypes.pl        3 Jun 2004 10:01:28 -0000       1.2
--- authtypes.pl        10 Jun 2004 08:58:34 -0000      1.3
***************
*** 80,91 ****
        if ($authtypecode) {
                my $dbh = C4::Context->dbh;
!               my $sth=$dbh->prepare("select 
authtypecode,authtypetext,auth_tag_to_report from auth_types where 
authtypecode=?");
                $sth->execute($authtypecode);
                $data=$sth->fetchrow_hashref;
                $sth->finish;
        }
        $template->param(authtypecode => $authtypecode,
                                                        authtypetext => 
$data->{'authtypetext'},
                                                        auth_tag_to_report => 
$data->{'auth_tag_to_report'},
                                                        );
  ;
--- 80,93 ----
        if ($authtypecode) {
                my $dbh = C4::Context->dbh;
!               my $sth=$dbh->prepare("select * from auth_types where 
authtypecode=?");
                $sth->execute($authtypecode);
                $data=$sth->fetchrow_hashref;
                $sth->finish;
        }
+       warn "=> $data->{'authtypetext'} : ".$data->{'summary'};
        $template->param(authtypecode => $authtypecode,
                                                        authtypetext => 
$data->{'authtypetext'},
                                                        auth_tag_to_report => 
$data->{'auth_tag_to_report'},
+                                                       summary => 
$data->{'summary'},
                                                        );
  ;
***************
*** 95,100 ****
  } elsif ($op eq 'add_validate') {
        my $dbh = C4::Context->dbh;
!       my $sth=$dbh->prepare("replace auth_types 
(authtypecode,authtypetext,auth_tag_to_report) values (?,?,?)");
!       
$sth->execute($input->param('authtypecode'),$input->param('authtypetext'),$input->param('auth_tag_to_report'));
        $sth->finish;
        print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=authtypes.pl\"></html>";
--- 97,102 ----
  } elsif ($op eq 'add_validate') {
        my $dbh = C4::Context->dbh;
!       my $sth=$dbh->prepare("replace auth_types 
(authtypecode,authtypetext,auth_tag_to_report,summary) values (?,?,?,?)");
!       
$sth->execute($input->param('authtypecode'),$input->param('authtypetext'),$input->param('auth_tag_to_report'),$input->param('summary'));
        $sth->finish;
        print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; 
URL=authtypes.pl\"></html>";
***************
*** 115,119 ****
        }
  
!       my $sth=$dbh->prepare("select authtypecode,authtypetext from auth_types 
where authtypecode=?");
        $sth->execute($authtypecode);
        my $data=$sth->fetchrow_hashref;
--- 117,121 ----
        }
  
!       my $sth=$dbh->prepare("select * from auth_types where authtypecode=?");
        $sth->execute($authtypecode);
        my $data=$sth->fetchrow_hashref;
***************
*** 122,125 ****
--- 124,128 ----
        $template->param(authtypecode => $authtypecode,
                                                        authtypetext => 
$data->{'authtypetext'},
+                                                       summary => 
$data->{'summary'},
                                                        total => $total);
                                                                                
                        # END $OP eq DELETE_CONFIRM
***************
*** 156,159 ****
--- 159,163 ----
                $row_data{authtypetext} = $results->[$i]{'authtypetext'};
                $row_data{auth_tag_to_report} = 
$results->[$i]{'auth_tag_to_report'};
+               $row_data{summary} = $results->[$i]{'summary'};
                push(@loop_data, \%row_data);
        }

Index: marc_subfields_structure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/marc_subfields_structure.pl,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** marc_subfields_structure.pl 3 Jun 2004 10:01:28 -0000       1.23
--- marc_subfields_structure.pl 10 Jun 2004 08:58:34 -0000      1.24
***************
*** 122,131 ****
        # build thesaurus categories list
        $sth2->finish;
!       $sth2 = $dbh->prepare("select distinct category from bibliothesaurus");
        $sth2->execute;
!       my @thesaurus_category;
!       push @thesaurus_category,"";
!       while ((my $category) = $sth2->fetchrow_array) {
!               push @thesaurus_category, $category;
        }
        # build value_builder list
--- 122,131 ----
        # build thesaurus categories list
        $sth2->finish;
!       $sth2 = $dbh->prepare("select authtypecode from auth_types");
        $sth2->execute;
!       my @authtypes;
!       push @authtypes,"";
!       while ((my $authtypecode) = $sth2->fetchrow_array) {
!               push @authtypes, $authtypecode;
        }
        # build value_builder list
***************
*** 185,191 ****
                                        -multiple=>0,
                                        );
!               $row_data{thesaurus_category}  = 
CGI::scrolling_list(-name=>'thesaurus_category',
!                                       -values=> address@hidden,
!                                       -default=>$data->{'thesaurus_category'},
                                        -size=>1,
                                        -multiple=>0,
--- 185,191 ----
                                        -multiple=>0,
                                        );
!               $row_data{authtypes}  = 
CGI::scrolling_list(-name=>'authtypecode',
!                                       -values=> address@hidden,
!                                       -default=>$data->{'authtypecode'},
                                        -size=>1,
                                        -multiple=>0,
***************
*** 232,237 ****
                                        -multiple=>0,
                                        );
!               $row_data{thesaurus_category}  = 
CGI::scrolling_list(-name=>'thesaurus_category',
!                                       -values=> address@hidden,
                                        -size=>1,
                                        -multiple=>0,
--- 232,237 ----
                                        -multiple=>0,
                                        );
!               $row_data{authtypes}  = 
CGI::scrolling_list(-name=>'authtypecode',
!                                       -values=> address@hidden,
                                        -size=>1,
                                        -multiple=>0,
***************
*** 254,258 ****
        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,hidden,isurl,frameworkcode)
                                                                        values 
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
        my @tagsubfield = $input->param('tagsubfield');
--- 254,258 ----
        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,authtypecode,value_builder,hidden,isurl,frameworkcode)
                                                                        values 
(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
        my @tagsubfield = $input->param('tagsubfield');
***************
*** 263,267 ****
        my @seealso             = $input->param('seealso');
        my @authorised_values   = $input->param('authorised_value');
!       my @thesaurus_category  = $input->param('thesaurus_category');
        my @value_builder       =$input->param('value_builder');
        for (my $i=0; $i<= $#tagsubfield ; $i++) {
--- 263,267 ----
        my @seealso             = $input->param('seealso');
        my @authorised_values   = $input->param('authorised_value');
!       my @authtypecodes       = $input->param('authtypecode');
        my @value_builder       =$input->param('value_builder');
        for (my $i=0; $i<= $#tagsubfield ; $i++) {
***************
*** 277,281 ****
                my $seealso                             =$seealso[$i];
                my $authorised_value            =$authorised_values[$i];
!               my $thesaurus_category          =$thesaurus_category[$i];
                my $value_builder=$value_builder[$i];
                my $hidden = $input->param("hidden$i")?1:0;
--- 277,281 ----
                my $seealso                             =$seealso[$i];
                my $authorised_value            =$authorised_values[$i];
!               my $authtypecode                =$authtypecodes[$i];
                my $value_builder=$value_builder[$i];
                my $hidden = $input->param("hidden$i")?1:0;
***************
*** 293,297 ****
                                                                        
$seealso,
                                                                        
$authorised_value,
!                                                                       
$thesaurus_category,
                                                                        
$value_builder,
                                                                        $hidden,
--- 293,297 ----
                                                                        
$seealso,
                                                                        
$authorised_value,
!                                                                       
$authtypecode,
                                                                        
$value_builder,
                                                                        $hidden,
***************
*** 358,362 ****
                $row_data{seealso} = $results->[$i]{'seealso'};
                $row_data{authorised_value} = 
$results->[$i]{'authorised_value'};
!               $row_data{thesaurus_category}   = 
$results->[$i]{'thesaurus_category'};
                $row_data{value_builder}        = 
$results->[$i]{'value_builder'};
                $row_data{hidden}       = $results->[$i]{'hidden'};
--- 358,362 ----
                $row_data{seealso} = $results->[$i]{'seealso'};
                $row_data{authorised_value} = 
$results->[$i]{'authorised_value'};
!               $row_data{authtypecode} = $results->[$i]{'authtypecode'};
                $row_data{value_builder}        = 
$results->[$i]{'value_builder'};
                $row_data{hidden}       = $results->[$i]{'hidden'};




reply via email to

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