Bug 3347: Inconsistencies with public and private list tables in opac-shelves.tmpl.
This patch fixes inconsistencies with the public and private list tables in opac-shelves.tmpl. It adds a "new list" link to the public list view, and it adds a "sort by" column. This patch also removes the toggle variables from the tables in opac-shelves.tmpl and Page.pm, and uses the template __odd__ variable for table highlighting if javascript is turned off. Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
parent
b28fad3308
commit
1a8aac38b6
2 changed files with 9 additions and 12 deletions
|
@ -183,9 +183,6 @@ SWITCH: {
|
|||
push @paramsloop, {display => 'privateshelves'} if $category == 1;
|
||||
$showadd = 1;
|
||||
my $i = 0;
|
||||
foreach (grep {$i++ % 2} @$items) { # every other item
|
||||
$_->{toggle} = 1;
|
||||
}
|
||||
my $manageshelf = ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' );
|
||||
$template->param(
|
||||
shelfname => $shelflist->{$shelfnumber}->{'shelfname'} || $privshelflist->{$shelfnumber}->{'shelfname'},
|
||||
|
@ -286,10 +283,8 @@ foreach my $element (sort { lc($shelflist->{$a}->{'shelfname'}) cmp lc($shelflis
|
|||
$shelflist->{$element}->{ownername} = defined($member) ? $member->{firstname} . " " . $member->{surname} : '';
|
||||
$numberCanManage++ if $canmanage; # possibly outmoded
|
||||
if ($shelflist->{$element}->{'category'} eq '1') {
|
||||
(scalar(@shelveslooppriv) % 2) and $shelflist->{$element}->{toggle} = 1;
|
||||
push (@shelveslooppriv, $shelflist->{$element});
|
||||
} else {
|
||||
(scalar(@shelvesloop) % 2) and $shelflist->{$element}->{toggle} = 1;
|
||||
push (@shelvesloop, $shelflist->{$element});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -210,11 +210,11 @@ $(document).ready(function(){
|
|||
</tr></thead>
|
||||
<tbody>
|
||||
<!-- TMPL_LOOP NAME="itemsloop" -->
|
||||
<!-- TMPL_IF NAME="toggle" -->
|
||||
<!-- TMPL_UNLESS NAME="__odd__" -->
|
||||
<tr class="highlight">
|
||||
<!-- TMPL_ELSE -->
|
||||
<tr>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_UNLESS -->
|
||||
<!-- TMPL_IF NAME="manageshelf" -->
|
||||
<td><input type="checkbox" name="REM-<!-- TMPL_VAR NAME="biblionumber" -->"
|
||||
value="<!-- TMPL_VAR NAME="biblionumber">" /></td>
|
||||
|
@ -333,11 +333,11 @@ $(document).ready(function(){
|
|||
<th> </th>
|
||||
</tr>
|
||||
<!-- TMPL_LOOP NAME="shelveslooppriv" -->
|
||||
<!-- TMPL_IF NAME="toggle" -->
|
||||
<!-- TMPL_UNLESS NAME="__odd__" -->
|
||||
<tr class="highlight">
|
||||
<!--TMPL_ELSE-->
|
||||
<tr>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_UNLESS -->
|
||||
<td><a href="opac-shelves.pl?display=privateshelves&viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html" --></a></td>
|
||||
<td><!-- TMPL_VAR NAME="count" --> item(s)</td>
|
||||
<td><!-- TMPL_VAR NAME="sortfield" --></td>
|
||||
|
@ -386,23 +386,25 @@ $(document).ready(function(){
|
|||
<!-- TMPL_ELSE -->
|
||||
<div id="publicshelves" class="tab-container" style="display:none;">
|
||||
<!-- /TMPL_IF -->
|
||||
|
||||
<a class="newshelf" href="/cgi-bin/koha/opac-shelves.pl?shelves=1">New List</a>
|
||||
<!-- TMPL_IF NAME="shelvesloop" -->
|
||||
<!-- TMPL_VAR name='pagination_bar'-->
|
||||
<table>
|
||||
<tr>
|
||||
<th>List Name</th>
|
||||
<th>Contents</th>
|
||||
<th>Sort by</th>
|
||||
<th>Type</th><th> </th>
|
||||
</tr>
|
||||
<!-- TMPL_LOOP NAME="shelvesloop" -->
|
||||
<!-- TMPL_IF NAME="toggle" -->
|
||||
<!-- TMPL_UNLESS NAME="__odd__" -->
|
||||
<tr class="highlight">
|
||||
<!--TMPL_ELSE-->
|
||||
<tr>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_UNLESS -->
|
||||
<td><a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html" --></a></td>
|
||||
<td><!-- TMPL_VAR NAME="count" --> item(s)</td>
|
||||
<td><!-- TMPL_VAR NAME="sortfield" --></td>
|
||||
<td>
|
||||
<!-- TMPL_IF NAME="viewcategory1" -->Private<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF NAME="viewcategory2" -->Public<!-- /TMPL_IF -->
|
||||
|
|
Loading…
Reference in a new issue