Improving output:
Should be a good start point for choosing what to display.
This commit is contained in:
parent
9a840ad27a
commit
43b137f10e
2 changed files with 66 additions and 19 deletions
|
@ -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" -->&marclist=<!-- TMPL_VAR NAME="marclist" ESCAPE=URL-->&search=<!-- TMPL_VAR NAME="search" ESCAPE=URL-->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search"><<Previous</a>
|
<a class="resultnumber" href="dictionary.pl?startfrom=<!-- TMPL_VAR NAME="startfromprev" -->&marclist=<!-- TMPL_VAR NAME="marclist" ESCAPE=URL-->&search=<!-- TMPL_VAR NAME="search" ESCAPE=URL-->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search"><<Previous</a>
|
||||||
|
@ -98,6 +82,35 @@ a.catalogue:hover {
|
||||||
<a class="resultnumber" href="dictionary.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&marclist=<!-- TMPL_VAR NAME="marclist" -->&search=<!-- TMPL_VAR NAME="search" -->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search">Next>></a>
|
<a class="resultnumber" href="dictionary.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&marclist=<!-- TMPL_VAR NAME="marclist" -->&search=<!-- TMPL_VAR NAME="search" -->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search">Next>></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&op=do_search&marclist=<!-- TMPL_VAR NAME="biblio_fields" -->&operator==&value=<!-- TMPL_VAR NAME="authid" -->&and_or=and&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" -->&marclist=<!-- TMPL_VAR NAME="marclist" ESCAPE="URL" -->&operator=contains&op=do_search&and_or=and&value='<!-- TMPL_VAR Name=value ESCAPE="URL" -->'&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 -->>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td <!-- TMPL_IF NAME="even" -->class="hilighted"<!-- /TMPL_IF -->>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<!-- /TMPL_LOOP -->
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div id="resultnumber">
|
<div id="resultnumber">
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue