From robl@macwhiz.com Wed Aug 7 20:01:31 2002 From: Rob Levandowski To: koha-devel@lists.koha-community.org Subject: [Koha-devel] Pretty OPAC biblio record : patch Date: Wed, 07 Aug 2002 20:02:02 +0000 Message-ID: <21884D8A-AA7B-11D6-A7AD-003065C2053C@macwhiz.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0039777362696073027==" --===============0039777362696073027== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit When I started playing around with Koha 1.2.2, I found that the biblio record display in the OPAC catalogue search detail wasn't pretty or functional enough for me. Below are diffs for the changes I made to detail.pl. They make the following changes: * the Author becomes a link to search.pl with the appropriate argument. * the Additional Author field becomes an unordered list, with each name as a link to search.pl. A substitution removes any trailing qualifiers commonly used by the Library of Congress for motion picture authorship -- that is, if "BROOKS, MEL, DIRECTION, PRODUCTION, CAST" is an additional author on a movie, the titles are removed so the search is for "BROOKS, MEL." * the Subject field becomes an ordered list, with each subject as a link to search.pl. I'll probably modify this some more to recognize " -- " and the em dash (%97) as hierarchical separators, and divide up the link, so that "PROGRAMMING -- LANGUAGES" has two links: the word "programming" as a search for that word, and the word "languages" as a search for "programming -- languages." These diffs are against the version in intranet-cgi. That version can, of course, be used in the opac-cgi location too. 10a11 > use URI::Escape; 120a122,146 > } > if ($dat->{'author'} ne ''){ > print "Author: my $autlink=$dat->{'author'}; > $autlink =~ s/(, DIRECTION|, WRITING|, CAST|, PRODUCTION)//ig; > my $htautlink = uri_escape($autlink); > print "$htautlink\&type=opac\">$dat->{'author'}
"; > } > #Additional Author:
> if ($additional ne ''){ > my $adstr = $additional; > my @adar = split /\s*\|/, $adstr; > print "Additional Author"; > if(scalar @adar > 1){ print "s"; } > print ": "; 122,125c148 < if ($dat->{'author'} ne ''){ < print "Author: $dat->{'author'}
"; < } < #Additional Author:
--- > print "\n"; 130c153,166 < print "Subject: $dat->{'subject'}
"; --- > my $subj = $dat->{'subject'}; > $subj =~ s/^\s*\|\s*//; > my @subar = split /\|\s+/, $subj; > print "Subject:
    "; > my $subitem; > SUBLOOP: foreach $subitem (@subar) { > print "
  1. "; > print " $subitem =~ s/\s*$//; > my $htitem = uri_escape($subitem); > print "$htitem\&type=opac\">$subitem"; > } > print "
\n"; > -- Rob Levandowski robl@macwhiz.com --===============0039777362696073027==-- From chris@katipo.co.nz Wed Aug 7 20:28:27 2002 From: Chris Cormack To: koha-devel@lists.koha-community.org Subject: Re: [Koha-devel] Pretty OPAC biblio record : patch Date: Wed, 07 Aug 2002 20:29:02 +0000 Message-ID: <1028777296.11141.13.camel@orbweb.katipo.co.nz> In-Reply-To: <21884D8A-AA7B-11D6-A7AD-003065C2053C@macwhiz.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3085411405165465287==" --===============3085411405165465287== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Thu, 2002-08-08 at 15:01, Rob Levandowski wrote: > When I started playing around with Koha 1.2.2, I found that the biblio > record display in the OPAC catalogue search detail wasn't pretty or > functional enough for me. > > Below are diffs for the changes I made to detail.pl. They make the > following changes: > Excellent :) You might like to take a look at the latest 1.2.3 RC. The opac has been rewritten to use HTML::Template, which makes making the changes you have made much easier. If you get a chance can you take a look, and see what you think. Chris -- Chris Cormack chris@katipo.co.nz Programmer 025 500 789 Katipo Communications www.katipo.co.nz --===============3085411405165465287==--