New stuff for authorities
This commit is contained in:
parent
5ab2065109
commit
4a8ae6a31b
|
|
@ -197,6 +197,7 @@ if ($op eq 'add_form') {
|
|||
$row_data{hidden} = CGI::checkbox("hidden$i",$data->{'hidden'}?'checked':'',1,'');
|
||||
$row_data{isurl} = CGI::checkbox("isurl$i",$data->{'isurl'}?'checked':'',1,'');
|
||||
$row_data{bgcolor} = $toggle;
|
||||
$row_data{link} = CGI::escapeHTML($data->{'link'});
|
||||
push(@loop_data, \%row_data);
|
||||
$i++;
|
||||
}
|
||||
|
|
@ -238,6 +239,7 @@ if ($op eq 'add_form') {
|
|||
-size=>1,
|
||||
-multiple=>0,
|
||||
);
|
||||
$row_data{link} = CGI::escapeHTML($data->{'link'});
|
||||
$row_data{bgcolor} = $toggle;
|
||||
push(@loop_data, \%row_data);
|
||||
}
|
||||
|
|
@ -255,8 +257,8 @@ if ($op eq 'add_form') {
|
|||
} 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,authtypecode,value_builder,hidden,isurl,frameworkcode)
|
||||
values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
||||
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, link)
|
||||
values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
||||
my @tagsubfield = $input->param('tagsubfield');
|
||||
my @liblibrarian = $input->param('liblibrarian');
|
||||
my @libopac = $input->param('libopac');
|
||||
|
|
@ -266,6 +268,7 @@ if ($op eq 'add_form') {
|
|||
my @authorised_values = $input->param('authorised_value');
|
||||
my @authtypecodes = $input->param('authtypecode');
|
||||
my @value_builder =$input->param('value_builder');
|
||||
my @link =$input->param('link');
|
||||
for (my $i=0; $i<= $#tagsubfield ; $i++) {
|
||||
my $tagfield =$input->param('tagfield');
|
||||
my $tagsubfield =$tagsubfield[$i];
|
||||
|
|
@ -282,6 +285,7 @@ if ($op eq 'add_form') {
|
|||
my $value_builder=$value_builder[$i];
|
||||
my $hidden = $input->param("hidden$i")?1:0;
|
||||
my $isurl = $input->param("isurl$i")?1:0;
|
||||
my $link = $link[$i];
|
||||
if ($liblibrarian) {
|
||||
unless (C4::Context->config('demo') eq 1) {
|
||||
$sth->execute ($tagfield,
|
||||
|
|
@ -299,7 +303,9 @@ if ($op eq 'add_form') {
|
|||
$hidden,
|
||||
$isurl,
|
||||
$frameworkcode,
|
||||
);
|
||||
|
||||
$link,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ use C4::Koha; # XXX subfield_is_koha_internal_p
|
|||
my $query=new CGI;
|
||||
my $op = $query->param('op');
|
||||
my $authtypecode = $query->param('authtypecode');
|
||||
warn "La authtypecode = $authtypecode\n";
|
||||
my $dbh = C4::Context->dbh;
|
||||
|
||||
my $startfrom=$query->param('startfrom');
|
||||
my $authid=$query->param('authid');
|
||||
$startfrom=0 if(!defined $startfrom);
|
||||
my ($template, $loggedinuser, $cookie);
|
||||
my $resultsperpage;
|
||||
|
|
@ -65,8 +65,6 @@ if ($op eq "do_search") {
|
|||
$resultsperpage= $query->param('resultsperpage');
|
||||
$resultsperpage = 19 if(!defined $resultsperpage);
|
||||
my @tags;
|
||||
warn "a ce pont labas dbh ($dbh), tags(\@tags), and_or (\@and_or), excluding (\@excluding), operator (\@operator), value (\@value), resultsperpage $resultsperpage, $startfrom, [$authtypecode]";
|
||||
|
||||
my ($results,$total) = authoritysearch($dbh, \@tags,\@and_or,
|
||||
\@excluding, \@operator, \@value,
|
||||
$startfrom*$resultsperpage, $resultsperpage,$authtypecode);
|
||||
|
|
@ -144,8 +142,8 @@ if ($op eq "do_search") {
|
|||
|
||||
} elsif ($op eq "delete") {
|
||||
|
||||
warn "Ici effacement\n";
|
||||
|
||||
&AUTHdelauthority($dbh,$authid, 1);
|
||||
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "authorities/authorities-home.tmpl",
|
||||
query => $query,
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
<label> </label><label>Auth value:</label> <!-- TMPL_VAR name="authorised_value" -->
|
||||
or thesaurus: <!-- TMPL_VAR name="authtypes" -->
|
||||
or plugin: <!-- TMPL_VAR name="value_builder" -->
|
||||
or link: <input type=text name="link" value="<!-- TMPL_VAR name="link" -->" size=10 maxlength=5> (exemple :200b)
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
Loading…
Reference in New Issue