$toggle="white";
}
$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',
+ -values=>['-1','0'],
+ -labels => {'-1' =>'No (ignore)','0'=>'yes'
},
-default=>$data->{'tab'},
-size=>1,
for (my $i=1;$i<=$more_subfields;$i++) {
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',
+ -values=>['-1','0'],
+ -labels => {'-1' =>'no (ignore)','0'=>'yes',
},
-default=>"",
-size=>1,
$sth_insert->execute($tagfield,$liblibrarian,$libopac,$repeatable,$mandatory,$authorised_value,$newauthtype);
}
- $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 = $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,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);
+ $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);
}
}
my $data;
if ($authtypecode) {
my $dbh = C4::Context->dbh;
- my $sth=$dbh->prepare("select authtypecode,authtypetext,auth_tag_to_report from auth_types where authtypecode=?");
+ 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'},
);
;
# END $OP eq ADD_FORM
# 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 auth_types (authtypecode,authtypetext,auth_tag_to_report) values (?,?,?)");
- $sth->execute($input->param('authtypecode'),$input->param('authtypetext'),$input->param('auth_tag_to_report'));
+ 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>";
exit;
$sth->finish;
}
- my $sth=$dbh->prepare("select authtypecode,authtypetext from auth_types where authtypecode=?");
+ my $sth=$dbh->prepare("select * from auth_types where authtypecode=?");
$sth->execute($authtypecode);
my $data=$sth->fetchrow_hashref;
$sth->finish;
$template->param(authtypecode => $authtypecode,
authtypetext => $data->{'authtypetext'},
+ summary => $data->{'summary'},
total => $total);
# END $OP eq DELETE_CONFIRM
################## DELETE_CONFIRMED ##################################
$row_data{authtypecode} = $results->[$i]{'authtypecode'};
$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);
}
$template->param(loop => \@loop_data);
push (@authorised_values,"itemtypes");
# build thesaurus categories list
$sth2->finish;
- $sth2 = $dbh->prepare("select distinct category from bibliothesaurus");
+ $sth2 = $dbh->prepare("select authtypecode from auth_types");
$sth2->execute;
- my @thesaurus_category;
- push @thesaurus_category,"";
- while ((my $category) = $sth2->fetchrow_array) {
- push @thesaurus_category, $category;
+ my @authtypes;
+ push @authtypes,"";
+ while ((my $authtypecode) = $sth2->fetchrow_array) {
+ push @authtypes, $authtypecode;
}
# build value_builder list
my @value_builder=('');
-size=>1,
-multiple=>0,
);
- $row_data{thesaurus_category} = CGI::scrolling_list(-name=>'thesaurus_category',
- -values=> \@thesaurus_category,
- -default=>$data->{'thesaurus_category'},
+ $row_data{authtypes} = CGI::scrolling_list(-name=>'authtypecode',
+ -values=> \@authtypes,
+ -default=>$data->{'authtypecode'},
-size=>1,
-multiple=>0,
);
-size=>1,
-multiple=>0,
);
- $row_data{thesaurus_category} = CGI::scrolling_list(-name=>'thesaurus_category',
- -values=> \@thesaurus_category,
+ $row_data{authtypes} = CGI::scrolling_list(-name=>'authtypecode',
+ -values=> \@authtypes,
-size=>1,
-multiple=>0,
);
} elsif ($op eq 'add_validate') {
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)
+ 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');
my @liblibrarian = $input->param('liblibrarian');
my @tab = $input->param('tab');
my @seealso = $input->param('seealso');
my @authorised_values = $input->param('authorised_value');
- my @thesaurus_category = $input->param('thesaurus_category');
+ my @authtypecodes = $input->param('authtypecode');
my @value_builder =$input->param('value_builder');
for (my $i=0; $i<= $#tagsubfield ; $i++) {
my $tagfield =$input->param('tagfield');
my $tab =$tab[$i];
my $seealso =$seealso[$i];
my $authorised_value =$authorised_values[$i];
- my $thesaurus_category =$thesaurus_category[$i];
+ my $authtypecode =$authtypecodes[$i];
my $value_builder=$value_builder[$i];
my $hidden = $input->param("hidden$i")?1:0;
my $isurl = $input->param("isurl$i")?1:0;
$tab,
$seealso,
$authorised_value,
- $thesaurus_category,
+ $authtypecode,
$value_builder,
$hidden,
$isurl,
$row_data{tab} = $results->[$i]{'tab'};
$row_data{seealso} = $results->[$i]{'seealso'};
$row_data{authorised_value} = $results->[$i]{'authorised_value'};
- $row_data{thesaurus_category} = $results->[$i]{'thesaurus_category'};
+ $row_data{authtypecode} = $results->[$i]{'authtypecode'};
$row_data{value_builder} = $results->[$i]{'value_builder'};
$row_data{hidden} = $results->[$i]{'hidden'};
$row_data{isurl} = $results->[$i]{'isurl'};