From e24e3bb26622d95bfd1e3b986f78e1413159eac4 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Thu, 28 Jun 2012 18:25:55 -0400 Subject: [PATCH] Bug 8332: Add relationships to auth_finder for authority links MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In addition to the work in bug 8207 that enables auth_finder use, it would be very useful when creating authorities to have the auth_finder plugin automatically fill out the relationship information in $w (in MARC21). To test (note that you must either apply the patch for bug 8207 or manually add a thesaurus to a 5xx linking field in one of the authority type frameworks): 1. Create a new authority record. 2. Go to the 5xx tab. 3. Click the authority control plugin ellipsis. 4. Do a search for an authority. 5. Select a relationship type. 6. Note that after you choose an authority, that the $w control field is automatically populated with the relationship type. Signed-off-by: Frédéric Demians After applying patch for bug 8207, I had been able to follow the test plan step by step, and get the expected result. Signed-off-by: Jared Camins-Esakov Rebased on master 1 August 2012 --- authorities/auth_finder.pl | 4 ++ authorities/blinddetail-biblio-search.pl | 3 ++ .../prog/en/includes/auth-finder-search.inc | 40 +++++++++++++++---- .../prog/en/includes/form-blocks.inc | 5 +++ .../en/modules/authorities/authorities.tt | 2 +- .../authorities/searchresultlist-auth.tt | 16 +++++++- 6 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/form-blocks.inc diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl index a3821ee74a..8182299685 100755 --- a/authorities/auth_finder.pl +++ b/authorities/auth_finder.pl @@ -35,6 +35,7 @@ my $authtypecode = $query->param('authtypecode'); my $index = $query->param('index'); my $tagid = $query->param('tagid'); my $resultstring = $query->param('result'); +my $relationship = $query->param('relationship'); my $dbh = C4::Context->dbh; my $startfrom = $query->param('startfrom'); @@ -192,6 +193,9 @@ $template->param( authtypecode => $authtypecode, ); +$template->{VARS}->{source} = $query->param('source') || ''; +$template->{VARS}->{relationship} = $query->param('relationship') || ''; + # Print the page output_html_with_http_headers $query, $cookie, $template->output; diff --git a/authorities/blinddetail-biblio-search.pl b/authorities/blinddetail-biblio-search.pl index 7de7db3095..4aa2093ef9 100755 --- a/authorities/blinddetail-biblio-search.pl +++ b/authorities/blinddetail-biblio-search.pl @@ -54,6 +54,7 @@ my $dbh = C4::Context->dbh; my $authid = $query->param('authid'); my $index = $query->param('index'); my $tagid = $query->param('tagid'); +my $relationship = $query->param('relationship'); my $authtypecode = &GetAuthTypeCode($authid); my $tagslib = &GetTagsLabels( 1, $authtypecode ); @@ -95,6 +96,8 @@ if ($authid) { my $letter = $_ || '@'; push( @subfield_loop, {marc_subfield => $letter, marc_values => $subfields{$_}} ); } + + push( @subfield_loop, { marc_subfield => 'w', marc_values => $relationship } ) if ( $relationship ); } else { # authid is empty => the user want to empty the entry. diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc index fe22d6b09d..4114dfca7e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc @@ -1,3 +1,4 @@ +[% PROCESS 'form-blocks.inc' %] @@ -63,10 +75,10 @@ function jumpfull(page) [% IF resul.repets %] [% FOREACH repet IN resul.repets %] - [% repet.repet %] + [% repet.repet %] [% END %] [% ELSE %] - Choose + choose [% END %] Edit authority -- 2.39.5