Bugzilla – Attachment 12308 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), 12.37 KB, created by
Mason James
on 2012-09-18 13:08:49 UTC
(
hide
)
Description:
Bug 5888: opac-detail subject/author links improvements
Filename:
MIME Type:
Creator:
Mason James
Created:
2012-09-18 13:08:49 UTC
Size:
12.37 KB
patch
obsolete
>From e5b58d30ebc9f86c432a40e24e64b958333f129f Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 13 Aug 2012 15:52:10 -0400 >Subject: [PATCH] Bug 5888: opac-detail subject/author links improvements >Content-Type: text/plain; charset="utf-8" >http://koha-community.org > >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. > >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> >--- > koha-tmpl/opac-tmpl/prog/en/css/opac.css | 30 ++++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 182 +++++++++++++++++++- > 2 files changed, 204 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >index 8214bb4..0842301 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css >+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >@@ -2154,6 +2154,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 5ca3105..d336c61 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -292,6 +292,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> >+ > [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<style type="text/css"> > #addtagl { display: none; } > </style>[% END %][% END %][% END %] >@@ -359,15 +455,48 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > </span> > > [% IF ( MARCAUTHORS ) %] >- <span class="results_summary"><span class="label">Additional authors:</span> >+ <span class="results_summary"> >+ <span class="label">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 %] >- [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] >- [% MARCAUTHOR_SUBFIELDS_LOO.separator %] >- <a title="â¡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]" >- 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 %] >+ [% authorsloop = loop %] >+ [% FOREACH SUBFIELD IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] >+ <a title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" >+ onclick="showAuthors(this, [% authorsloop.count %]); return false;" >+ href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link IN SUBFIELD.link_loop %][% link.operator |url %][% link.limit |url %]:[% link.link |url %][% END %]">[% SUBFIELD.value %]</a> >+ [% UNLESS (loop.last) %][% SUBFIELD.separator %][% END %] >+ [% END %] > [% IF (MARCAUTHOR.authoritylink) %] >- <a class='authlink' href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"></a> >+ <a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"></a> > [% END %] > [% UNLESS ( loop.last ) %]|[% END %] > [% END %] >@@ -426,6 +555,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 %] >@@ -433,7 +599,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <a title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN SUBFIELD.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]" onclick="showSubjects(this, [% subjectsloop.count %], [% loop.count %]); return false;">[% SUBFIELD.value %]</a> > [% END %] > [% IF (MARCSUBJCT.authoritylink) %] >- <a class="authlink" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCSUBJCT.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png" /></a> >+ <a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCSUBJCT.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png" /></a> > [% END %] > [% UNLESS ( loop.last ) %] | [% END %] > [% END %] >-- >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 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