Bugzilla – Attachment 15342 Details for
Bug 5888
opac-detail subject/author links improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5888: opac-detail subject/author links improvements
Bug-5888-opac-detail-subjectauthor-links-improveme.patch (text/plain), 10.33 KB, created by
Marcel de Rooy
on 2013-02-15 11:03:32 UTC
(
hide
)
Description:
Bug 5888: opac-detail subject/author links improvements
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2013-02-15 11:03:32 UTC
Size:
10.33 KB
patch
obsolete
>From 6cb1c71b2e468f854f829801e7475f6cba33592a Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 23 May 2012 11:00:17 +0200 >Subject: [PATCH] Bug 5888: opac-detail subject/author links improvements >Content-Type: text/plain; charset="utf-8" > >When the user clicks on a subject or an author, the list of subjects >(authors) is displayed and the user can choose more than 1 subject >(author) to search on. >Also added a link to opac-authoritiesdetail.pl when possible. > >Only affects 'Normal view'. Does not affect XSLT display. > >Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> >Split out of the original patch for bug 5888. The links to the >authority records are added by bug 8210. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > koha-tmpl/opac-tmpl/prog/en/css/opac.css | 30 ++++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 165 ++++++++++++++++++++ > 2 files changed, 195 insertions(+), 0 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >index cdf7a4d..cc6666e 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css >+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >@@ -2156,6 +2156,36 @@ a.p1:active { > div.ft { > clear : both; > } >+ >+.authorSearch { >+ position: absolute; >+ display: none; >+ z-index: 2; >+ background-color: white; >+ border: 1px solid black; >+ padding: 4px; >+} >+.authorSearch li { >+ list-style-type: none; >+} >+.authorSearch ul { >+ padding-left: 0px; >+} >+.subjectSearch { >+ position: absolute; >+ display: none; >+ z-index: 2; >+ background-color: white; >+ border: 1px solid black; >+ padding: 4px; >+} >+.subjectSearch li { >+ list-style-type: none; >+} >+.subjectSearch ul { >+ padding-left: 0px; >+} >+ > #basket td ul li { > font-size:90%; > list-style:disc outside url(data:image/gif;base64,R0lGODlhBQAHAJECAP///5zD6v///wAAACH5BAEAAAIALAAAAAAFAAcAAAIMjCUGkbvhFGQSmVAAADs=); >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >index 07d4f68..67dce17 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -369,6 +369,102 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > }); > //]]> > </script> >+ >+<script type="text/JavaScript" language="JavaScript"> >+//<![CDATA[ >+ function showAuthors(element, authornumber){ >+ // Hide subjects menu if displayed >+ hideMenu(".subjectSearch"); >+ >+ // Check checkbox related to the clicked link >+ $("#authorsList input[type='checkbox']").attr('checked', false); >+ $("#author_"+authornumber).attr('checked', true); >+ >+ makeAuthorRequest(); >+ >+ // Display menu >+ var left = element.offsetLeft || 0; >+ var top = element.offsetTop || 0; >+ $('.authorSearch').css('display', 'block'); >+ $('.authorSearch').css('left', left); >+ $('.authorSearch').css('top', top + 15); >+ } >+ >+ function hideMenu(elem) { >+ $(elem).css('display', 'none'); >+ } >+ >+ function checkAll(checkbox, elem) { >+ var check = $(checkbox).attr('checked') ? true : false; >+ $(elem).find("input[type='checkbox']").attr('checked', check); >+ elem == "#authorsList" ? makeAuthorRequest() : makeSubjectRequest(); >+ } >+ >+ function makeAuthorRequest(){ >+ var values = []; >+ >+ $("#authorsList").find("input[type='checkbox']:checked").each(function () { >+ values.push($(this).val()); >+ }); >+ >+ if (values.length > 0) { >+ var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and '); >+ $("#validAuthorSearch").attr("href", request); >+ } else { >+ $("#validAuthorSearch").removeAttr("href"); >+ } >+ >+ } >+ >+ //Subjects >+ function showSubjects(element, subjectnumber, subfieldnumber){ >+ // Hide author menu if displayed >+ hideMenu(".authorSearch"); >+ >+ // Check checkbox related to the clicked link >+ $("#subjectsList input[type='checkbox']").attr('checked', false); >+ $("#subject_"+subjectnumber+"_"+subfieldnumber).attr('checked', true); >+ >+ makeSubjectRequest(); >+ >+ // Display menu >+ var left = element.offsetLeft || 0; >+ var top = element.offsetTop || 0; >+ $('.subjectSearch').css('display', 'block'); >+ $('.subjectSearch').css('left', left); >+ $('.subjectSearch').css('top', top + 15); >+ } >+ >+ function makeSubjectRequest() { >+ var values = []; >+ $("#subjectsList > ul").each(function() { >+ var all_checked = true; >+ var local_values = []; >+ $(this).find('input[type="checkbox"]').each(function() { >+ if($(this).attr('checked')) { >+ local_values.push($(this).val()); >+ } else { >+ all_checked = false; >+ } >+ }); >+ var authid = $(this).attr('data-authid'); >+ if(all_checked && authid) { >+ values.push('an:' + authid); >+ } else { >+ values = values.concat(local_values); >+ } >+ }); >+ >+ if(values.length > 0) { >+ var request = "/cgi-bin/koha/opac-search.pl?q=" + values.join(' and '); >+ $("#validSubjectSearch").attr('href', request); >+ } else { >+ $("#validSubjectSearch").removeAttr("href"); >+ } >+ } >+//]]> >+</script> >+ > <style type="text/css"> > .branch-info-tooltip { > display: none; >@@ -434,10 +530,42 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > > [% IF ( MARCAUTHORS ) %] > <span class="results_summary"><span class="label">Additional authors:</span> >+ <div class="authorSearch" id="authorSearch"> >+ <span><b>Select the item(s) to search :</b></span> >+ <ul id="authorsList"> >+ <li><input type="checkbox" onchange="checkAll(this, '#authorsList')"> <b>all</b></li> >+ <li><hr /></li> >+ [% FOREACH MARCAUTHOR IN MARCAUTHORS %] >+ <li> >+ [% IF (MARCAUTHOR.authoritylink) %] >+ <input type="checkbox" name="checkbox" >+ id="author_[% loop.count %]" >+ onclick="makeAuthorRequest()" >+ value="an:[% MARCAUTHOR.authoritylink %]" /> >+ [% ELSE %] >+ <input type="checkbox" name="checkbox" >+ id="author_[% loop.count %]" >+ onclick="makeAuthorRequest()" >+ value="au,wrdl:[% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% SUBFIELD.value |url %][% UNLESS (loop.last) %]+[% END %][% END %]" /> >+ [% END %] >+ >+ [% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] >+ [% SUBFIELD.value %] >+ [% END %] >+ </li> >+ [% END %] >+ </ul> >+ <hr /> >+ <a href="#" onclick="hideMenu('.authorSearch'); return false">Cancel</a> >+ | >+ <a id="validAuthorSearch">Search</a> >+ </div> > [% FOREACH MARCAUTHOR IN MARCAUTHORS %] >+ [% authorsloop = loop %] > [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] > [% MARCAUTHOR_SUBFIELDS_LOO.separator %] > <a title="â¡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]" >+ onclick="showAuthors(this, [% authorsloop.count %]); return false;" > href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value %]</a> > [% END %] > [% IF (MARCAUTHOR.authoritylink) %] >@@ -500,6 +628,43 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > [% IF ( MARCSUBJCTS ) %] > <span class="results_summary"> > <span class="label">Subject(s):</span> >+ <div class="subjectSearch" > >+ <span><b>Select the item(s) to search :</b></span> >+ <div id="subjectsList"> >+ <input type="checkbox" id="all_subjects" >+ onchange="checkAll(this, '#subjectsList')" /> >+ <label for="all_subjects"> >+ <b>all</b> >+ </label> >+ <hr /> >+ [% FOREACH MARCSUBJCT IN MARCSUBJCTS %] >+ [% subjectsloop = loop %] >+ [% IF MARCSUBJCT.authoritylink %] >+ <ul id="subjectsList[% loop.count %]" >+ data-authid="[% MARCSUBJCT.authoritylink %]"> >+ [% ELSE %] >+ <ul id="subjectsList[% loop.count %]"> >+ [% END %] >+ [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] >+ <li> >+ <input type="checkbox" onclick="makeSubjectRequest()" >+ name="checkbox" >+ id="subject_[% subjectsloop.count %]_[% loop.count %]" >+ value="su,wrdl:[% SUBFIELD.value |url %]" /> >+ <label for="subject_[% subjectsloop.count %]_[% loop.count %]"> >+ [% SUBFIELD.value %] >+ </label> >+ </li> >+ [% END %] >+ </ul> >+ <hr /> >+ [% END %] >+ </div> >+ <a href="#" >+ onclick="hideMenu('.subjectSearch'); return false">Cancel</a> >+ | >+ <a id="validSubjectSearch">Search</a> >+ </div> > [% FOREACH MARCSUBJCT IN MARCSUBJCTS %] > [% subjectsloop = loop %] > [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] >-- >1.7.7.6
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 5888
:
3345
|
9738
|
9855
|
9856
|
11586
|
11592
|
12308
|
12343
|
12344
|
13631
|
13632
|
13973
|
13974
|
14140
|
14141
|
15230
|
15231
|
15341
| 15342 |
15343
|
15344
|
15345
|
15346
|
15347
|
15348