From 71817b0ab17f4b90a2dc5b16539f1b1fee80c450 Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 2 Jul 2003 12:49:43 +0000 Subject: [PATCH] fixing bug in thesaurus entry modification --- C4/Authorities.pm | 21 +++++++++++++++++-- admin/thesaurus.pl | 12 +++++++++-- .../default/en/parameters/thesaurus.tmpl | 14 ++++++++++--- .../default/fr/parameters/thesaurus.tmpl | 18 +++++++++++----- 4 files changed, 53 insertions(+), 12 deletions(-) diff --git a/C4/Authorities.pm b/C4/Authorities.pm index 0cca31c1a1..caad5626ae 100644 --- a/C4/Authorities.pm +++ b/C4/Authorities.pm @@ -51,8 +51,8 @@ It contains every functions to manage/find authorities. @EXPORT = qw( &newauthority &searchauthority &delauthority + &modauthority ); -# FIXME - This is never used =item newauthority @@ -133,6 +133,23 @@ sub newauthority { return $id; } +=item ModAuthority + + $id = &ModAuthority($dbh,$id,$freelib); + + modify a free lib + + C<$dbh> is a DBI::db handle for the Koha database. + C<$id> is the entry id + C<$freelib> is the new freelib + +=cut +sub modauthority { + my ($dbh,$id,$freelib) = @_; + my $sth = $dbh->prepare("update bibliothesaurus set freelib=? where id=?"); + $sth->execute($freelib,$id); +} + =item SearchAuthority $id = &SearchAuthority($dbh,$category,$branch,$searchstring,$type,$offset,$pagesize); @@ -161,7 +178,7 @@ sub searchauthority { $query .= " and match (category,freelib) AGAINST ('$searchstring')" if ($searchstring); # $query .= " and freelib like \"$searchstring%\"" if ($searchstring); $query .= " order by category,freelib limit $offset,".($pagesize*4); -# warn "q : $query"; + warn "q : $query"; my $sth=$dbh->prepare($query); $sth->execute; my @results; diff --git a/admin/thesaurus.pl b/admin/thesaurus.pl index d838c48ffc..3caaf3c7c2 100755 --- a/admin/thesaurus.pl +++ b/admin/thesaurus.pl @@ -33,7 +33,7 @@ $search_category=$input->param('category') unless $search_category; #my $toponly = $input->param('toponly'); my $branch = $input->param('branch'); my $searchstring = $input->param('searchstring'); -$searchstring=~ s/\,//g; +# $searchstring=~ s/\,//g; my $id = $input->param('id'); my $offset=$input->param('offset'); my $father=$input->param('father'); @@ -103,7 +103,7 @@ if ($op eq 'add_form') { $template->param(category => ""); } ################## ADD_VALIDATE ################################## -# called by add_form, used to insert/modify data in DB +# called by add_form, used to insert data in DB } elsif ($op eq 'add_validate') { my $dbh = C4::Context->dbh; my $freelib = $input->param('freelib'); @@ -111,6 +111,14 @@ if ($op eq 'add_form') { newauthority($dbh,$input->param('category'),$input->param('father')." ".$input->param('stdlib'), $freelib,'',1,''); print "Content-Type: text/html\n\n"; exit; +################## MOD_VALIDATE ################################## +# called by add_form, used to modify data in DB +} elsif ($op eq 'mod_validate') { + my $dbh = C4::Context->dbh; + my $freelib = $input->param('freelib'); + modauthority($dbh,$id,$freelib); + print "Content-Type: text/html\n\n"; + exit; ################## DELETE_CONFIRM ################################## # called by default form, used to confirm deletion of data in DB } elsif ($op eq 'delete_confirm') { diff --git a/koha-tmpl/intranet-tmpl/default/en/parameters/thesaurus.tmpl b/koha-tmpl/intranet-tmpl/default/en/parameters/thesaurus.tmpl index 7f2f3091c8..a4445d17ac 100644 --- a/koha-tmpl/intranet-tmpl/default/en/parameters/thesaurus.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/parameters/thesaurus.tmpl @@ -34,9 +34,13 @@ -

+

ModifyAdd

- + + + + + @@ -44,7 +48,11 @@ - + + + + + diff --git a/koha-tmpl/intranet-tmpl/default/fr/parameters/thesaurus.tmpl b/koha-tmpl/intranet-tmpl/default/fr/parameters/thesaurus.tmpl index bbc96b7f29..a9ce09ad51 100644 --- a/koha-tmpl/intranet-tmpl/default/fr/parameters/thesaurus.tmpl +++ b/koha-tmpl/intranet-tmpl/default/fr/parameters/thesaurus.tmpl @@ -34,9 +34,13 @@ -

+

ModificationAjout

- + + + + +
Category
Authority lib" maxlength="80" size="80">" >" maxlength="80" size="80">
Other lib
@@ -45,12 +49,16 @@ - - + + + + + + - + -- 2.39.5
autorité libForme d'autorité" >" maxlength="80" size="80">
Autre libAutre forme