Improving output:

Should be a good start point for choosing what to display.
This commit is contained in:
hdl 2005-05-02 15:39:24 +00:00
parent 9a840ad27a
commit 43b137f10e
2 changed files with 66 additions and 19 deletions

View file

@ -66,23 +66,7 @@ a.catalogue:hover {
<!-- TMPL_IF Name=result --> <!-- TMPL_IF Name=result -->
<div class="bloc100"> <div class="bloc100">
<h2 class="catalogue">Dictionary Search results</h2> <h2 class="catalogue">Dictionary Search results</h2>
<div id="resultlist"> <!-- TMPL_IF NAME="authresult" -->
<table>
<tr>
<th colspan="2">Authorities</th>
</tr>
<tr>
<th class="authority">Summary</th>
<th class="authority">Used</th>
</tr>
<!-- TMPL_LOOP NAME="authresult" -->
<tr>
<td><!-- TMPL_VAR NAME="summary" --></td>
<td><!-- TMPL_VAR NAME="used" --> times</td>
</tr>
<!-- /TMPL_LOOP -->
</table>
</div>
<div id="resultnumber"> <div id="resultnumber">
<p><!-- TMPL_IF NAME="displayprev" --> <p><!-- TMPL_IF NAME="displayprev" -->
<a class="resultnumber" href="dictionary.pl?startfrom=<!-- TMPL_VAR NAME="startfromprev" -->&amp;marclist=<!-- TMPL_VAR NAME="marclist" ESCAPE=URL-->&amp;search=<!-- TMPL_VAR NAME="search" ESCAPE=URL-->&amp;resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&amp;type=intranet&amp;op=do_search">&lt;&lt;Previous</a> <a class="resultnumber" href="dictionary.pl?startfrom=<!-- TMPL_VAR NAME="startfromprev" -->&amp;marclist=<!-- TMPL_VAR NAME="marclist" ESCAPE=URL-->&amp;search=<!-- TMPL_VAR NAME="search" ESCAPE=URL-->&amp;resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&amp;type=intranet&amp;op=do_search">&lt;&lt;Previous</a>
@ -98,6 +82,35 @@ a.catalogue:hover {
<a class="resultnumber" href="dictionary.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&amp;marclist=<!-- TMPL_VAR NAME="marclist" -->&amp;search=<!-- TMPL_VAR NAME="search" -->&amp;resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&amp;type=intranet&amp;op=do_search">Next&gt;&gt;</a> <a class="resultnumber" href="dictionary.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&amp;marclist=<!-- TMPL_VAR NAME="marclist" -->&amp;search=<!-- TMPL_VAR NAME="search" -->&amp;resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&amp;type=intranet&amp;op=do_search">Next&gt;&gt;</a>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
</p> </p>
<p class="resultcount">
<!-- TMPL_IF NAME="nbresults" -->
Results <!-- TMPL_VAR NAME="from" --> to <!-- TMPL_VAR NAME="to" --> of <!-- TMPL_VAR NAME="nbresults" --><!-- TMPL_ELSE -->No results found.
<!-- /TMPL_IF -->
</p>
</div>
<div id="resultlist">
<table>
<tr>
<th colspan="2" class="authority">Authorities</th>
</tr>
<tr>
<th class="authority">Summary</th>
<th class="authority">Used</th>
</tr>
<!-- TMPL_LOOP NAME="authresult" -->
<tr>
<td><!-- TMPL_VAR NAME="summary" --></td>
<td>
<a href="../search.marc/search.pl?type=intranet&amp;op=do_search&amp;marclist=<!-- TMPL_VAR NAME="biblio_fields" -->&amp;operator==&amp;value=<!-- TMPL_VAR NAME="authid" -->&amp;and_or=and&amp;excluding=" class="button authority"><!-- TMPL_VAR NAME="used" --> biblio(s)
</td>
</tr>
<!-- /TMPL_LOOP -->
</table>
</div>
<!-- TMPL_ELSE -->
<h3 class="authority">No results in Authorities</h3>
<!-- /TMPL_IF -->
<div id="resultnumber">
<p class="resultcount"> <p class="resultcount">
<!-- TMPL_IF NAME="total" --> <!-- TMPL_IF NAME="total" -->
Results <!-- TMPL_VAR NAME="from" --> to <!-- TMPL_VAR NAME="to" --> of <!-- TMPL_VAR NAME="total" --><!-- TMPL_ELSE -->No results found. Results <!-- TMPL_VAR NAME="from" --> to <!-- TMPL_VAR NAME="to" --> of <!-- TMPL_VAR NAME="total" --><!-- TMPL_ELSE -->No results found.
@ -157,6 +170,25 @@ a.catalogue:hover {
</td> </td>
</tr> </tr>
<!-- /TMPL_LOOP --> <!-- /TMPL_LOOP -->
<!-- TMPL_LOOP NAME="catresult" -->
<tr>
<td<!-- TMPL_IF NAME="even" --> class="hilighted"<!-- /TMPL_IF -->>
<!-- TMPL_IF name="MARC_ON" -->
<a class="transparent resultlist" href="search.pl?type=<!-- TMPL_VAR NAME="type" ESCAPE="URL" -->&amp;marclist=<!-- TMPL_VAR NAME="marclist" ESCAPE="URL" -->&amp;operator=contains&amp;op=do_search&amp;and_or=and&amp;value='<!-- TMPL_VAR Name=value ESCAPE="URL" -->'&amp;excluding="><!-- TMPL_VAR NAME="value" --></a>
<!-- TMPL_ELSE -->
<a class="transparent resultlist" href="search.pl?bib=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="value" --></a> <!-- /TMPL_IF -->
</td>
<td align="center" <!-- TMPL_IF NAME="even" --> class="hilighted"<!-- /TMPL_IF -->>
<!-- TMPL_VAR NAME="count" -->
</td>
<td <!-- TMPL_IF NAME="even" -->class="hilighted"<!-- /TMPL_IF -->>
&nbsp;
</td>
<td <!-- TMPL_IF NAME="even" -->class="hilighted"<!-- /TMPL_IF -->>
&nbsp;
</td>
</tr>
<!-- /TMPL_LOOP -->
</table> </table>
</div> </div>
<div id="resultnumber"> <div id="resultnumber">

View file

@ -92,6 +92,20 @@ if ($op eq "do_search") {
my ($results,$total) = catalogsearch($dbh,\@tags ,\@and_or, my ($results,$total) = catalogsearch($dbh,\@tags ,\@and_or,
\@excluding, \@operator, \@value, \@excluding, \@operator, \@value,
$startfrom*$resultsperpage, $resultsperpage,$orderby); $startfrom*$resultsperpage, $resultsperpage,$orderby);
my %seen = ();
foreach my $item (@$results) {
my $display;
$display="author" if ($field=~/author/);
$display="title" if ($field=~/title/);
$display="subject" if ($field=~/subject/);
$display="publishercode" if ($field=~/publisher/);
$seen{$item->{$display}}++;
}
my @catresults;
foreach my $name (keys %seen){
push @catresults, { value => $name , count => $seen{$name}}
}
my $strsth="Select distinct authtypecode from marc_subfield_structure where "; my $strsth="Select distinct authtypecode from marc_subfield_structure where ";
my $strtagfields="tagfield in ("; my $strtagfields="tagfield in (";
@ -172,6 +186,7 @@ if ($op eq "do_search") {
$to = (($startfrom+1)*$resultsperpage); $to = (($startfrom+1)*$resultsperpage);
} }
$template->param(result => $results, $template->param(result => $results,
catresult=> \@catresults,
search => $search[0], search => $search[0],
marclist =>$field, marclist =>$field,
authresult => \@authresults, authresult => \@authresults,