Bugzilla – Attachment 10552 Details for
Bug 8332
Add relationships to auth_finder for authority links
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8332: Add relationships to auth_finder for authority links
Bug-8332-Add-relationships-to-authfinder-for-autho.patch (text/plain), 9.42 KB, created by
Jared Camins-Esakov
on 2012-06-28 22:56:11 UTC
(
hide
)
Description:
Bug 8332: Add relationships to auth_finder for authority links
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-06-28 22:56:11 UTC
Size:
9.42 KB
patch
obsolete
>From 6ae3d4a8be975f4ba32325e98fa38af11fe7c104 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Thu, 28 Jun 2012 18:25:55 -0400 >Subject: [PATCH] Bug 8332: Add relationships to auth_finder for authority links >Content-Type: text/plain; charset="UTF-8" > >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. >--- > authorities/auth_finder.pl | 4 +++ > authorities/blinddetail-biblio-search.pl | 3 ++ > .../prog/en/includes/auth-finder-search.inc | 28 +++++++++++++++++++- > .../intranet-tmpl/prog/en/includes/form-blocks.inc | 5 +++ > .../prog/en/modules/authorities/authorities.tt | 2 +- > .../modules/authorities/searchresultlist-auth.tt | 16 ++++++++++- > 6 files changed, 54 insertions(+), 4 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 a3821ee..8182299 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 7de7db3..4aa2093 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 a6d55df..598a51d 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' %] > <script type="text/javascript"> > //<![CDATA[ > >@@ -90,10 +91,12 @@ $(document).ready(function(){ > > > <form name="f" method="get" action="auth_finder.pl"> >+ <input type="hidden" name="source" value="[% source %]" /> > <input type="hidden" name="op" value="do_search" /> > <input type="hidden" name="type" value="intranet" /> > <input type="hidden" name="index" value="[% index %]" /> >- <fieldset class="rows"><ol><li> >+ <fieldset class="rows"><legend>Search options</legend> >+ <ol><li> > <span class="label">Authority type</span> > [% authtypecode %] > <input type="hidden" name="authtypecode" value="[% authtypecode %]" /> >@@ -159,5 +162,28 @@ $(document).ready(function(){ > <option value="HeadingDsc">Heading descendant</option> > </select> > </li></ol></fieldset> >+ [% IF source == 'auth' %] >+ <fieldset class="rows"><legend>Relationship information</legend> >+ <ol> >+ <li> >+ <label for="relationship">Special relationship: </label> >+ <select name="relationship" id="relationship"> >+ [% selected=relationship %] >+ [% PROCESS selectoption value='' text='None specified' %] >+ [% PROCESS selectoption value='a' text='a - Earlier heading' %] >+ [% PROCESS selectoption value='b' text='b - Later heading' %] >+ [% PROCESS selectoption value='d' text='d - Acronym' %] >+ [% PROCESS selectoption value='f' text='f - Musical composition' %] >+ [% PROCESS selectoption value='g' text='g - Broader term' %] >+ [% PROCESS selectoption value='h' text='h - Narrower term' %] >+ [% PROCESS selectoption value='i' text='i - Reference instruction phrase in subfield $i' %] >+ [% PROCESS selectoption value='n' text='n - Not applicable' %] >+ [% PROCESS selectoption value='r' text='r - Relationship designation in $i or $4' %] >+ [% PROCESS selectoption value='t' text='t - Immediate parent body' %] >+ </select> >+ </li> >+ </ol> >+ </fieldset> >+ [% END %] > <fieldset class="action"> <input type="submit" value="Start search" class="submit" /> <a class="cancel close" href="#">Cancel</a></fieldset> > </form> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/form-blocks.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/form-blocks.inc >new file mode 100644 >index 0000000..4999eec >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/form-blocks.inc >@@ -0,0 +1,5 @@ >+[% BLOCK selectoption %] >+ [% IF value == selected %]<option value='[% value %]' selected='selected'>[% text %]</option> >+ [% ELSE %]<option value='[% value %]'>[% text %]</option> >+ [% END %] >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >index e684179..246b205 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >@@ -153,7 +153,7 @@ function openAuth(tagsubfieldid,authtype) { > } > } > } >- newin=window.open("../authorities/auth_finder.pl?authtypecode="+ authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes'); >+ newin=window.open("../authorities/auth_finder.pl?source=auth&authtypecode="+ authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes'); > } > > function AddField(field,cntrepeatfield) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >index 2881710..f013675 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >@@ -11,6 +11,18 @@ function jumpfull(page) > { > window.open(page,'','fullscreen,scrollbars'); > } >+ >+function doauth(authid, index, repet) >+{ >+[% IF source == 'auth' %] >+ var e = document.getElementById("relationship"); >+ var relationship = e.options[e.selectedIndex].value; >+ >+ jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship); >+[% ELSE %] >+ jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet); >+[% END %] >+} > </script> > </head> > <body id="auth_searchresultlist_auth" class="auth"> >@@ -73,10 +85,10 @@ function jumpfull(page) > <td> > [% IF resul.repets %] > [% FOREACH repet IN resul.repets %] >- <a href="javascript:jumpfull('blinddetail-biblio-search.pl?authid=[% resul.authid %]&index=[% repet.index %]&s;repet=[% repet.repet %]')" title="[% repet.value %]">[% repet.repet %]</a> >+ <a href="javascript:doauth('[% resul.authid %]', '[% repet.index %]', '[% repet.repet %]')" title="[% repet.value %]">[% repet.repet %]</a> > [% END %] > [% ELSE %] >- <a href="javascript:jumpfull('blinddetail-biblio-search.pl?authid=[% resul.authid %]&index=[% index %]')">choose</a> >+ <a href="javascript:doauth('[% resul.authid %]', '[% index %]', '')">choose</a> > [% END %] > </td> > <td><a href="authorities.pl?authid=[% resul.authid %]">Edit authority</a></td> >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8332
:
10552
|
10724
|
11254
|
11700
|
11702