View | Details | Raw Unified | Return to bug 3229
Collapse All | Expand All

(-)a/C4/VirtualShelves/Page.pm (-1 / +12 lines)
Lines 170-175 SWITCH: { Link Here
170
        #check that the user can view the shelf
170
        #check that the user can view the shelf
171
		if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) {
171
		if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) {
172
			my $items;
172
			my $items;
173
			my $authorsort;
174
			my $copyrightsort;
175
	                my $sortfield = ($query->param('sortfield') ? $query->param('sortfield') : 'title');
176
			if ($sortfield eq 'author') {
177
				$authorsort = 'author';
178
			}
179
			if ($sortfield eq 'copyrightdate'){
180
				$copyrightsort = 'copyrightdate';
181
			}
173
			($items, $totitems) = GetShelfContents($shelfnumber, $shelflimit, $shelfoffset);
182
			($items, $totitems) = GetShelfContents($shelfnumber, $shelflimit, $shelfoffset);
174
			for my $this_item (@$items) {
183
			for my $this_item (@$items) {
175
				# the virtualshelfcontents table does not store these columns nor are they retrieved from the items
184
				# the virtualshelfcontents table does not store these columns nor are they retrieved from the items
Lines 188-193 SWITCH: { Link Here
188
				shelfname   => $shelflist->{$shelfnumber}->{'shelfname'} || $privshelflist->{$shelfnumber}->{'shelfname'},
197
				shelfname   => $shelflist->{$shelfnumber}->{'shelfname'} || $privshelflist->{$shelfnumber}->{'shelfname'},
189
				shelfnumber => $shelfnumber,
198
				shelfnumber => $shelfnumber,
190
				viewshelf   => $shelfnumber,
199
				viewshelf   => $shelfnumber,
200
				authorsort   => $authorsort,
201
				copyrightsort => $copyrightsort,
191
				manageshelf => $manageshelf,
202
				manageshelf => $manageshelf,
192
				itemsloop => $items,
203
				itemsloop => $items,
193
			);
204
			);
Lines 291-297 foreach my $element (sort { lc($shelflist->{$a}->{'shelfname'}) cmp lc($shelflis Link Here
291
302
292
my $url = $type eq 'opac' ? "/cgi-bin/koha/opac-shelves.pl" : "/cgi-bin/koha/virtualshelves/shelves.pl";
303
my $url = $type eq 'opac' ? "/cgi-bin/koha/opac-shelves.pl" : "/cgi-bin/koha/virtualshelves/shelves.pl";
293
my %qhash = ();
304
my %qhash = ();
294
foreach (qw(display viewshelf)) {
305
foreach (qw(display viewshelf sortfield)) {
295
    $qhash{$_} = $query->param($_) if $query->param($_);
306
    $qhash{$_} = $query->param($_) if $query->param($_);
296
}
307
}
297
(scalar keys %qhash) and $url .= '?' . join '&', map {"$_=$qhash{$_}"} keys %qhash;
308
(scalar keys %qhash) and $url .= '?' . join '&', map {"$_=$qhash{$_}"} keys %qhash;
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc (-2 / +2 lines)
Lines 103-109 Link Here
103
		<!-- TMPL_IF NAME="pubshelves" -->
103
		<!-- TMPL_IF NAME="pubshelves" -->
104
			<ul class="first-of-type">
104
			<ul class="first-of-type">
105
			<!-- TMPL_LOOP NAME="pubshelvesloop" -->
105
			<!-- TMPL_LOOP NAME="pubshelvesloop" -->
106
			<li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelfnumber" -->"><!-- TMPL_VAR NAME="shelfname"  ESCAPE="html" --></a></li>
106
			<li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelfnumber" -->&amp;sortfield=<!-- TMPL_VAR NAME="sortfield" -->"><!-- TMPL_VAR NAME="shelfname"  ESCAPE="html" --></a></li>
107
			<!-- /TMPL_LOOP -->
107
			<!-- /TMPL_LOOP -->
108
			</ul>   
108
			</ul>   
109
		<!-- TMPL_ELSE -->
109
		<!-- TMPL_ELSE -->
Lines 120-126 Link Here
120
		<!-- TMPL_IF NAME="barshelves" -->
120
		<!-- TMPL_IF NAME="barshelves" -->
121
			<ul class="first-of-type">
121
			<ul class="first-of-type">
122
			<!-- TMPL_LOOP NAME="barshelvesloop" -->
122
			<!-- TMPL_LOOP NAME="barshelvesloop" -->
123
			<li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelfnumber" -->"><!-- TMPL_VAR NAME="shelfname"  ESCAPE="html" --></a></li>
123
			<li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelfnumber" -->&amp;sortfield=<!-- TMPL_VAR NAME="sortfield" -->"><!-- TMPL_VAR NAME="shelfname"  ESCAPE="html" --></a></li>
124
			<!-- /TMPL_LOOP -->
124
			<!-- /TMPL_LOOP -->
125
			</ul>   
125
			</ul>   
126
		<!-- TMPL_ELSE -->
126
		<!-- TMPL_ELSE -->
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl (-3 / +14 lines)
Lines 77-86 $(function() { Link Here
77
    $("#listcontents").tablesorter({
77
    $("#listcontents").tablesorter({
78
        widgets : ['zebra'],
78
        widgets : ['zebra'],
79
        <!-- TMPL_IF NAME="manageshelf" -->
79
        <!-- TMPL_IF NAME="manageshelf" -->
80
          <!-- TMPL_IF NAME="authorsort" -->
81
          sortList: [[2,0]],
82
          <!-- TMPL_ELSIF NAME="copyrightsort" -->
83
          sortList: [[3,1]],
84
          <!-- TMPL_ELSE -->
80
          sortList: [[1,0]],
85
          sortList: [[1,0]],
86
          <!-- /TMPL_IF -->
81
          headers: { 0: { sorter: false },1:{sorter: 'articles'}
87
          headers: { 0: { sorter: false },1:{sorter: 'articles'}
82
        <!-- TMPL_ELSE -->
88
        <!-- TMPL_ELSE -->
89
          <!-- TMPL_IF NAME="authorsort" -->
90
          sortList: [[1,0]],
91
          <!-- TMPL_ELSIF NAME="copyrightsort" -->
92
          sortList: [[2,1]],
93
          <!-- TMPL_ELSE -->
83
          sortList: [[0,0]],
94
          sortList: [[0,0]],
95
          <!-- /TMPL_IF -->
84
          headers: { 0:{sorter:'articles'}
96
          headers: { 0:{sorter:'articles'}
85
        <!-- /TMPL_IF -->
97
        <!-- /TMPL_IF -->
86
        }
98
        }
Lines 338-344 $(document).ready(function(){ Link Here
338
                          <!--TMPL_ELSE-->
350
                          <!--TMPL_ELSE-->
339
                            <tr>
351
                            <tr>
340
                          <!-- /TMPL_UNLESS -->
352
                          <!-- /TMPL_UNLESS -->
341
                              <td><a href="opac-shelves.pl?display=privateshelves&amp;viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html"  --></a></td>
353
                              <td><a href="opac-shelves.pl?display=privateshelves&amp;viewshelf=<!-- TMPL_VAR NAME="shelf" -->&amp;sortfield=<!-- TMPL_VAR NAME="sortfield" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html"  --></a></td>
342
                              <td><!-- TMPL_VAR NAME="count" --> item(s)</td>
354
                              <td><!-- TMPL_VAR NAME="count" --> item(s)</td>
343
                              <td><!-- TMPL_VAR NAME="sortfield" --></td>
355
                              <td><!-- TMPL_VAR NAME="sortfield" --></td>
344
                              <td>
356
                              <td>
Lines 406-412 $(document).ready(function(){ Link Here
406
                      <!--TMPL_ELSE-->
418
                      <!--TMPL_ELSE-->
407
                        <tr>
419
                        <tr>
408
                      <!-- /TMPL_UNLESS -->
420
                      <!-- /TMPL_UNLESS -->
409
                          <td><a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html"  --></a></td>
421
                          <td><a href="opac-shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->&amp;sortfield=<!-- TMPL_VAR NAME="sortfield" -->"><!-- TMPL_VAR NAME="shelfname" ESCAPE="html"  --></a></td>
410
                          <td><!-- TMPL_VAR NAME="count" --> item(s)</td>
422
                          <td><!-- TMPL_VAR NAME="count" --> item(s)</td>
411
                          <td><!-- TMPL_VAR NAME="sortfield" --></td>
423
                          <td><!-- TMPL_VAR NAME="sortfield" --></td>
412
                          <td>
424
                          <td>
413
- 

Return to bug 3229