[Koha-patches] [PATCH] [SIGNED-OFF] Bug 5930 : improving/modifying authority display on OPAC
Julian Maurice
julian.maurice at biblibre.com
Tue Mar 22 15:58:01 CET 2011
From: Paul Poulain <paul.poulain at biblibre.com>
- changing some terms that are unclear for a patron
- removing tag & subfields values & indicators
- removing UNIMARC coded fields
- changing the search page (removing options useless for a patron)
Signed-off-by: Julian Maurice <julian.maurice at biblibre.com>
---
koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 2 +-
.../prog/en/modules/opac-authorities-home.tmpl | 35 +++-----------------
.../prog/en/modules/opac-authoritiesdetail.tmpl | 16 ++++-----
opac/opac-authoritiesdetail.pl | 5 +++
4 files changed, 18 insertions(+), 40 deletions(-)
diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
index 310e7b8..3a3d4b9 100644
--- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
+++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
@@ -110,7 +110,7 @@
<div id="moresearches">
<a href="/cgi-bin/koha/opac-search.pl">Advanced Search</a>
<!-- TMPL_IF NAME="OpacBrowser" --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by Hierarchy</a><!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="OpacAuthorities" --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Browse by Subject</a><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="OpacAuthorities" --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Browse by author or subject</a><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="TagsEnabled" --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag Cloud</a><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="OpacCloud" --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject Cloud</a><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="OpacTopissue" --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-topissues.pl">Most Popular</a><!-- /TMPL_IF -->
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authorities-home.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authorities-home.tmpl
index 91a1412..8c11df2 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authorities-home.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authorities-home.tmpl
@@ -1,4 +1,4 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog › Authority Search
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog › Browse by author or subject
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
</head>
<body id="opac-authorities">
@@ -13,7 +13,7 @@
<input type="hidden" name="op" value="do_search" />
<input type="hidden" name="type" value="opac" />
<fieldset class="rows">
-<legend>Authority search</legend>
+ <legend>Browse by author or subject</legend>
<ol>
<li><label for="authtypecode">Search: : </label> <select name="authtypecode" id="authtypecode">
<!-- TMPL_LOOP NAME="authtypesloop" -->
@@ -21,32 +21,7 @@
<!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="value" -->"> <!-- TMPL_VAR NAME="authtypetext" --></option>
<!-- /TMPL_IF -->
<!-- /TMPL_LOOP -->
- </select></li> <li>
- <label for="operatora">Main entry ($a only): </label>
- <select name="operatora" id="operatora">
- <option value="contains">contains</option>
- <option value="start">starts with</option>
- <option value="is">is exactly</option>
</select>
- <input type="text" name="valuea" id="mainentrya_value" value="<!-- TMPL_VAR NAME="value" -->" />
- <input type="hidden" name="marclista" value="mainmainentry" />
- <input type="hidden" name="and_ora" value="and" />
- <input type="hidden" name="excludinga" value="" />
- </li>
- <li>
- <label for="operatorb">Main entry: </label>
- <select name="operatorb" id="operatorb">
- <option value="contains">contains</option>
- <option value="start">starts with</option>
- <option value="is">is exactly</option>
- </select>
- <input type="text" name="valueb" id="mainentry_value" value="<!-- TMPL_VAR NAME="value" -->" />
- <input type="hidden" name="marclistb" value="mainentry" />
- <input type="hidden" name="and_orb" value="and" />
- <input type="hidden" name="excludingb" value="" />
- </li>
- <li>
- <label for="anywhere">Anywhere: </label>
<select name="operatorc" id="anywhere">
<option value="contains">contains</option>
<option value="start">starts with</option>
@@ -54,7 +29,7 @@
</select>
<input type="text" name="valuec" id="anywhere_value" value="<!-- TMPL_VAR NAME="value" -->" />
<input type="hidden" name="marclistc" value="" />
- <input type="hidden" name="and_orc" value="and" />
+ <input type="hidden" name="and_ora" value="and" />
<input type="hidden" name="excludingc" value="" />
</li>
<li><label for="orderby">Order by: </label><select name="orderby" id="orderby">
@@ -71,8 +46,8 @@
</div>
</div>
</div>
-
-</div><!-- TMPL_IF NAME="OpacNav" -->
+</div>
+<!-- TMPL_IF NAME="OpacNav" -->
<div class="yui-b">
<div id="leftmenus" class="container">
<!--TMPL_INCLUDE NAME="navigation.inc" -->
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiesdetail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiesdetail.tmpl
index def5362..b6ef2ef 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiesdetail.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiesdetail.tmpl
@@ -1,4 +1,4 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog › Advanced Search
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog › Entry
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_IF Name="displayhierarchy"-->
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/hierarchy.css">
@@ -60,18 +60,16 @@ function showChildren(mynumber) {
<!--/TMPL_LOOP-->
</div>
<!-- /TMPL_IF -->
-<h1>Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)</h1>
+<h1>Entry <!-- TMPL_VAR name="authtypetext" --></h1>
<p>Used in <a href="opac-search.pl?type=opac&q=<!-- TMPL_VAR NAME="authid" -->&idx=an"><!-- TMPL_VAR name="count" --> records</a></p>
-<table><!-- TMPL_LOOP name="0XX" -->
- <tr><td colspan="3" class="marctag"><b><!-- TMPL_VAR name="tag" --></b></td></tr>
+ <!-- TMPL_LOOP name="0XX" -->
+ <p><b><!-- TMPL_VAR name="tag" --></b></p>
+ <ul>
<!-- TMPL_LOOP name="subfield" -->
- <tr><td class="marcsubfieldletter" ><!-- TMPL_VAR name="marc_subfield" --></td>
- <td class="marcsubfieldname" ><!-- TMPL_VAR name="marc_lib" --></td>
- <td class="subfieldvalue" ><!-- TMPL_VAR name="marc_value" --></td>
- </tr>
+ <p><b><!-- TMPL_VAR name="marc_lib" -->:</b> <!-- TMPL_VAR name="marc_value" --></p>
<!-- /TMPL_LOOP -->
+ </ul>
<!-- /TMPL_LOOP -->
-</table>
</div>
</div>
diff --git a/opac/opac-authoritiesdetail.pl b/opac/opac-authoritiesdetail.pl
index 7e06310..066a821 100755
--- a/opac/opac-authoritiesdetail.pl
+++ b/opac/opac-authoritiesdetail.pl
@@ -120,6 +120,9 @@ my @fields = $record->fields();
foreach my $field (@fields) {
my @subfields_data;
+ # skip UNIMARC fields <200, they are useless for a patron
+ next if C4::Context->preference('MarcFlavour') eq 'UNIMARC' && $field->tag() <200;
+
# if tag <10, there's no subfield, use the "@" trick
if ( $field->tag() < 10 ) {
next if ( $tagslib->{ $field->tag() }->{'@'}->{hidden} );
@@ -137,6 +140,8 @@ foreach my $field (@fields) {
for my $i ( 0 .. $#subf ) {
$subf[$i][0] = "@" unless $subf[$i][0];
next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{hidden} );
+ # skip useless subfields (for patrons)
+ next if $subf[$i][0] =~ /7|8|9/;
my %subfield_data;
$subfield_data{marc_lib} =
$tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
--
1.7.4.1
More information about the Koha-patches
mailing list