Bugzilla – Attachment 11254 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), 11.53 KB, created by
Jared Camins-Esakov
on 2012-08-01 13:12:00 UTC
(
hide
)
Description:
Bug 8332: Add relationships to auth_finder for authority links
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-08-01 13:12:00 UTC
Size:
11.53 KB
patch
obsolete
>From a06ad10fe1836ff6f15026b2b8c3b7cc8fe96d7c 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 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit >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. > >Signed-off-by: Frédéric Demians <f.demians@tamil.fr> > >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 <jcamins@cpbibliography.com> >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 ++++++++++++++++--- > .../en/includes/authorities-search-results.inc | 2 +- > .../intranet-tmpl/prog/en/includes/form-blocks.inc | 5 ++ > .../prog/en/modules/authorities/authorities.tt | 2 +- > .../modules/authorities/searchresultlist-auth.tt | 16 +++++++- > 7 files changed, 61 insertions(+), 11 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 fe22d6b..4114dfc 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[ > >@@ -100,10 +101,12 @@ function finderjumpfull(page) > > > <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 %]" /> >@@ -169,10 +172,33 @@ function finderjumpfull(page) > <option value="HeadingDsc">Heading descendant</option> > </select> > </li></ol></fieldset> >- <fieldset class="action"> <input type="submit" value="Start search" class="submit" id="search" /> <a id="cancel" class="cancel close" href="#">Cancel</a> >- <span id="authfinderops"> >- <a href="javascript:finderjumpfull('blinddetail-biblio-search.pl?authid=0&index=[% index %]')" id="clear" class="button">Clear field</a> >- <a href="javascript:finderjumpfull('authorities.pl?index=[% index %]&authtypecode=[% authtypecode %]')" id="createnew" class="button">Create new</a> >- </span> >- </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" id="search" /> <a id="cancel" class="cancel close" href="#">Cancel</a> >+ <span id="authfinderops"> >+ <a href="javascript:finderjumpfull('blinddetail-biblio-search.pl?authid=0&index=[% index %]')" id="clear" class="button">Clear field</a> >+ <a href="javascript:finderjumpfull('authorities.pl?index=[% index %]&authtypecode=[% authtypecode %]')" id="createnew" class="button">Create new</a> >+ </span> >+ </fieldset> > </form> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc >index 92314b1..3defe48 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc >@@ -30,7 +30,7 @@ > [% IF ( summary.summary ) %][% summary.summary %]:[% END %] > [% UNLESS ( summary.summaryonly ) %] > [% FOREACH authorize IN summary.authorized %] >- <span class="authorizedheading">[% authorize %]</span> >+ <span class="authorizedheading">[% authorize.heading %]</span> > [% END %] > [% IF ( marcflavour == 'UNIMARC' ) %] > [% FOREACH note IN summary.notes %] >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 352d518..d0c4329 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 8008930..415185a 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"> >@@ -63,10 +75,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