MT 1801 : Opac shelves and basket are displayed the same way

This patch also fixes broken location display in both shelves and basket.
This commit is contained in:
Matthias Meusburger 2009-12-03 11:58:44 +01:00 committed by Henri-Damien LAURENT
parent f0aee34d3f
commit 6281ed6b91
4 changed files with 35 additions and 27 deletions

View file

@ -191,6 +191,11 @@ SWITCH: {
$this_item->{'imageurl'} = getitemtypeinfo($this_item->{'itemtype'})->{'imageurl'};
$this_item->{'coins'} = GetCOinSBiblio($this_item->{'biblionumber'});
$this_item->{'subtitle'} = C4::Biblio::get_koha_field_from_marc('bibliosubtitle', 'subtitle', $record, '');
# Getting items infos for location display
my @items_infos = &GetItemsInfo($this_item->{'biblionumber'}, $type);
$this_item->{'ITEM_RESULTS'} = \@items_infos;
}
push @paramsloop, {display => 'privateshelves'} if $category == 1;
$showadd = 1;

View file

@ -295,7 +295,7 @@ function tagAdded() {
<th scope="row">Location(s)</th>
<td><!-- TMPL_IF NAME="ITEM_RESULTS" --><!-- TMPL_LOOP NAME="ITEM_RESULTS" -->
<p>
<!-- TMPL_VAR NAME="branchname" --> <!-- TMPL_VAR NAME="location_description" -->
<!-- TMPL_VAR NAME="branchname" --><!-- TMPL_IF NAME="location" -->, <!-- TMPL_VAR NAME="location" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="itemcallnumber" -->
(<!-- TMPL_VAR NAME="itemcallnumber" -->)
<!-- /TMPL_IF -->
@ -333,7 +333,8 @@ function tagAdded() {
<thead><tr>
<th>&nbsp;</th>
<th>Title</th>
<th>Item Type</th>
<th>Author</th>
<th>Year</th>
<th>Location</th>
</tr></thead>
@ -347,27 +348,25 @@ function tagAdded() {
<input type="checkbox" value="<!-- TMPL_VAR NAME="biblionumber" -->" name="bib<!-- TMPL_VAR NAME="biblionumber" -->" id="bib<!-- TMPL_VAR NAME="biblionumber" -->" onclick="selRecord(value,checked);" />
</td> <!-- /TMPL_UNLESS -->
<td><a href="#" onclick="openBiblio('<!-- TMPL_VAR name="dest" -->',<!-- TMPL_VAR name="biblionumber" -->)">
<td>
<a href="#" onclick="openBiblio('<!-- TMPL_VAR name="dest" -->',<!-- TMPL_VAR name="biblionumber" -->)">
<!-- TMPL_VAR NAME="title" escape="html" -->
</a>
<!-- TMPL_VAR NAME="author" -->
<p><!-- TMPL_IF name="publishercode" -->- <!-- TMPL_VAR name="publishercode" -->
<!-- TMPL_IF name="place" --> <!-- TMPL_VAR name="place" --><!-- /TMPL_IF --><!-- /TMPL_IF -->
<!-- TMPL_IF name="pages" --> - <!-- TMPL_VAR name="pages" --><!-- TMPL_IF name="size" --> <!-- TMPL_VAR name="size" -->
<!-- /TMPL_IF -->
<!-- /TMPL_IF --></p>
<!-- TMPL_IF name="notes" -->
<p><!-- TMPL_VAR name="notes" --></p>
<!-- /TMPL_IF -->
<!-- COinS / OpenURL -->
<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=<!-- TMPL_VAR NAME="author" -->&amp;rft.btitle=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->&amp;rft.date=<!-- TMPL_VAR NAME="publicationyear" -->&amp;rft.tpages=<!-- TMPL_VAR NAME="size" -->&amp;rft.isbn=<!-- TMPL_VAR NAME="isbn" ESCAPE="url" -->&amp;rft.aucorp=&amp;rft.place=<!-- TMPL_VAR NAME="place" -->&amp;rft.pub=<!-- TMPL_VAR NAME="publisher" ESCAPE="url" -->&amp;rft.edition=<!-- TMPL_VAR NAME="edition" -->&amp;rft.series=<!-- TMPL_VAR NAME="series" -->&amp;rft.genre="></span>
<div id="newtag<!-- TMPL_VAR NAME="biblionumber">_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>
</td>
<td><!-- TMPL_VAR name="description" --></td>
</a>
<!-- COinS / OpenURL -->
<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=<!-- TMPL_VAR NAME="author" -->&amp;rft.btitle=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->&amp;rft.date=<!-- TMPL_VAR NAME="publicationyear" -->&amp;rft.tpages=<!-- TMPL_VAR NAME="size" -->&amp;rft.isbn=<!-- TMPL_VAR NAME="isbn" ESCAPE="url" -->&amp;rft.aucorp=&amp;rft.place=<!-- TMPL_VAR NAME="place" -->&amp;rft.pub=<!-- TMPL_VAR NAME="publisher" ESCAPE="url" -->&amp;rft.edition=<!-- TMPL_VAR NAME="edition" -->&amp;rft.series=<!-- TMPL_VAR NAME="series" -->&amp;rft.genre="></span>
<div id="newtag<!-- TMPL_VAR NAME="biblionumber">_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>
</td>
<td><!-- TMPL_VAR NAME="author" --></td>
<td>
<!-- TMPL_IF NAME="publicationyear" -->
<!-- TMPL_VAR NAME="publicationyear" -->
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="copyrightdate" -->
<!-- /TMPL_IF -->
</td>
<td><!-- TMPL_IF NAME="ITEM_RESULTS" --><!-- TMPL_LOOP NAME="ITEM_RESULTS" -->
<p>
<!-- TMPL_VAR NAME="branchname" --> <!-- TMPL_VAR NAME="location_description" -->
<!-- TMPL_VAR NAME="branchname" --><!-- TMPL_IF NAME="location" -->, <!-- TMPL_VAR NAME="location" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="itemcallnumber" -->
(<!-- TMPL_VAR NAME="itemcallnumber" -->)
<!-- /TMPL_IF -->

View file

@ -247,6 +247,7 @@ $(function() {
<th>Title</th>
<th>Author</th>
<th>Year</th>
<th>Location</th>
</tr></thead>
<tbody>
<!-- TMPL_LOOP NAME="itemsloop" -->
@ -278,6 +279,16 @@ $(function() {
<!-- TMPL_VAR NAME="copyrightdate" -->
<!-- /TMPL_IF -->
</td>
<td>
<!-- TMPL_IF NAME="ITEM_RESULTS" --><!-- TMPL_LOOP NAME="ITEM_RESULTS" -->
<p>
<!-- TMPL_VAR NAME="branchname" --><!-- TMPL_IF NAME="location" -->, <!-- TMPL_VAR NAME="location" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="itemcallnumber" -->
(<!-- TMPL_VAR NAME="itemcallnumber" -->)
<!-- /TMPL_IF -->
</p>
<!-- /TMPL_LOOP --><!-- TMPL_ELSE -->This record has no items.<!-- /TMPL_IF -->
</td>
</tr>
<!-- /TMPL_LOOP --><!-- /itemsloop -->
</tbody>

View file

@ -73,15 +73,8 @@ foreach my $biblionumber ( @bibs ) {
if($dat->{'author'} || @$marcauthorsarray) {
$hasauthors = 1;
}
my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
my $collections = GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
for my $itm (@items) {
if ($itm->{'location'}){
$itm->{'location_description'} = $shelflocations->{$itm->{'location'} };
}
}
# COinS format FIXME: for books Only
my $coins_format;
my $fmt = substr $record->leader(), 6,2;