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

(-)a/acqui/neworderbiblio.pl (-1 / +7 lines)
Lines 144-149 foreach my $r (@{$budgets}) { Link Here
144
    last;
144
    last;
145
}
145
}
146
146
147
my $pagination = {
148
    base_url     => "/cgi-bin/koha/acqui/neworderbiblio.pl?q=$query&booksellerid=$booksellerid&basketno=$basketno&page=",
149
    pages        => getnbpages( $total_hits, $results_per_page ),
150
    current_page => $page,
151
};
152
147
$template->param(
153
$template->param(
148
    has_budgets          => $has_budgets,
154
    has_budgets          => $has_budgets,
149
    basketno             => $basketno,
155
    basketno             => $basketno,
Lines 152-158 $template->param( Link Here
152
    resultsloop          => \@results,
158
    resultsloop          => \@results,
153
    total                => $total_hits,
159
    total                => $total_hits,
154
    query                => $query,
160
    query                => $query,
155
    pagination_bar       => pagination_bar( "/cgi-bin/koha/acqui/neworderbiblio.pl?q=$query&booksellerid=$booksellerid&basketno=$basketno&", getnbpages( $total_hits, $results_per_page ), $page, 'page' ),
161
    pagination           => $pagination,
156
);
162
);
157
163
158
# BUILD THE TEMPLATE
164
# BUILD THE TEMPLATE
(-)a/authorities/authorities-home.pl (-4 / +7 lines)
Lines 175-185 if ( $op eq "do_search" ) { Link Here
175
175
176
    $template->param( result => $results ) if $results;
176
    $template->param( result => $results ) if $results;
177
177
178
    my $pagination = {
179
        base_url     => "$base_url&startfrom=",
180
        pages        => getnbpages( $total, $resultsperpage ),
181
        current_page => $startfrom,
182
    };
183
178
    $template->param(
184
    $template->param(
179
        pagination_bar => pagination_bar(
185
        pagination => $pagination,
180
            $base_url,  int( $total / $resultsperpage ) + 1,
181
            $startfrom, 'startfrom'
182
        ),
183
        total     => $total,
186
        total     => $total,
184
        from      => $from,
187
        from      => $from,
185
        to        => $to,
188
        to        => $to,
(-)a/catalogue/itemsearch.pl (-5 / +8 lines)
Lines 237-248 if (scalar keys %params > 0) { Link Here
237
            my @v = $cgi->multi_param($p);
237
            my @v = $cgi->multi_param($p);
238
            push @params, map { "$p=" . $_ } @v;
238
            push @params, map { "$p=" . $_ } @v;
239
        }
239
        }
240
        $url .= '?' . join ('&', @params);
240
        $url .= '?' . join ('&', @params) . "&page=";
241
        my $nb_pages = 1 + int($total_rows / $search_params->{rows});
242
        my $current_page = $search_params->{page};
243
        my $pagination_bar = pagination_bar($url, $nb_pages, $current_page, 'page');
244
241
245
        $template->param(pagination_bar => $pagination_bar);
242
        my $pagination = {
243
            base_url     => $url,
244
            pages        => getnbpages( $total_rows, $search_params->{rows} ),
245
            current_page => $search_params->{page},
246
        };
247
248
        $template->param(pagination => $pagination);
246
    }
249
    }
247
}
250
}
248
251
(-)a/cataloguing/addbooks.pl (-1 / +8 lines)
Lines 90-100 if ($query) { Link Here
90
    # SimpleSearch() give the results per page we want, so 0 offet here
90
    # SimpleSearch() give the results per page we want, so 0 offet here
91
    my $total = @{$marcresults};
91
    my $total = @{$marcresults};
92
    my @newresults = searchResults( 'intranet', $query, $total, $results_per_page, 0, 0, $marcresults );
92
    my @newresults = searchResults( 'intranet', $query, $total, $results_per_page, 0, 0, $marcresults );
93
94
    my $pagination = {
95
        base_url     => "/cgi-bin/koha/cataloguing/addbooks.pl?q=$query&page=",
96
        pages        => getnbpages( $total_hits, $results_per_page ),
97
        current_page => $page,
98
    };
99
93
    $template->param(
100
    $template->param(
94
        total          => $total_hits,
101
        total          => $total_hits,
95
        query          => $query,
102
        query          => $query,
96
        resultsloop    => \@newresults,
103
        resultsloop    => \@newresults,
97
        pagination_bar => pagination_bar( "/cgi-bin/koha/cataloguing/addbooks.pl?q=$query&", getnbpages( $total_hits, $results_per_page ), $page, 'page' ),
104
        pagination     => $pagination,
98
    );
105
    );
99
}
106
}
100
107
(-)a/cataloguing/value_builder/marc21_linking_section.pl (-8 lines)
Lines 274-287 my $launcher = sub { Link Here
274
        #           foreach my $sort (@sort_by){
274
        #           foreach my $sort (@sort_by){
275
        #             $link.="&sort_by=".$sort."&";
275
        #             $link.="&sort_by=".$sort."&";
276
        #           }
276
        #           }
277
        #           $template->param(
278
        #             pagination_bar => pagination_bar(
279
        #                     $link,
280
        #                     getnbpages($hits, $results_per_page),
281
        #                     $page,
282
        #                     'page'
283
        #             ),
284
        #           );
285
        $template->param(
277
        $template->param(
286
            result         => \@arrayresults,
278
            result         => \@arrayresults,
287
            index          => scalar $query->param('index') . "",
279
            index          => scalar $query->param('index') . "",
(-)a/cataloguing/value_builder/unimarc_field_210c.pl (-6 / +7 lines)
Lines 137-142 my ($input) = @_; Link Here
137
137
138
        $template->param(result => $results) if $results;
138
        $template->param(result => $results) if $results;
139
        $template->param('index' => scalar $query->param('index'));
139
        $template->param('index' => scalar $query->param('index'));
140
141
        my $pagination = {
142
            base_url     => "$link&startfrom=",
143
            pages        => getnbpages($total, $resultsperpage),
144
            current_page => $startfrom,
145
        };
140
        $template->param(startfrom=> $startfrom,
146
        $template->param(startfrom=> $startfrom,
141
                                displaynext=> $displaynext,
147
                                displaynext=> $displaynext,
142
                                displayprev=> $displayprev,
148
                                displayprev=> $displayprev,
Lines 149-160 my ($input) = @_; Link Here
149
                                numbers=>\@numbers,
155
                                numbers=>\@numbers,
150
                                authtypecode =>$authtypecode,
156
                                authtypecode =>$authtypecode,
151
                                resultstring =>$value[0],
157
                                resultstring =>$value[0],
152
                                pagination_bar => pagination_bar(
158
                                pagination => $pagination,
153
                                    $link,
154
                                    getnbpages($total, $resultsperpage),
155
                                    $startfrom,
156
                                    'startfrom'
157
                                ),
158
                                );
159
                                );
159
    } else {
160
    } else {
160
        ($template, $loggedinuser, $cookie)
161
        ($template, $loggedinuser, $cookie)
(-)a/cataloguing/value_builder/unimarc_field_4XX.pl (-8 lines)
Lines 476-489 sub plugin { Link Here
476
#           foreach my $sort (@sort_by){
476
#           foreach my $sort (@sort_by){
477
#             $link.="&sort_by=".$sort."&";
477
#             $link.="&sort_by=".$sort."&";
478
#           }
478
#           }
479
#           $template->param(
480
#             pagination_bar => pagination_bar(
481
#                     $link,
482
#                     getnbpages($hits, $results_per_page),
483
#                     $page,
484
#                     'page'
485
#             ),
486
#           );
487
        $template->param(
479
        $template->param(
488
            result         => \@arrayresults,
480
            result         => \@arrayresults,
489
            index          => scalar $query->param('index') . "",
481
            index          => scalar $query->param('index') . "",
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/pagination.inc (+62 lines)
Line 0 Link Here
1
[%
2
# this is template for generating pagination
3
# it needed an array named "pagination" with this structure:
4
#     pagination.pages => total number of pages
5
#     pagination.base_url => url with all needed parameters and with parameter specifiyng page at the end
6
#     pagination.current_page => number of current active page
7
%]
8
9
[% IF pagination && ( pagination.pages > 1 ) %]
10
11
<nav><ul class="pagination">
12
[% IF pagination.current_page != 1 %]
13
    <li><a href="[% pagination.base_url %][% pagination.current_page - 1 %]">&laquo; Previous</a></li>
14
[% END %]
15
16
[% IF pagination.pages > 8 %]
17
    [% start_page = pagination.current_page - 3 %]
18
    [% end_page = pagination.current_page + 4 %]
19
    [% IF start_page < 1 %]
20
       [% start_page = 1 %]
21
       [% end_page = 8 %]
22
    [% END %]
23
    [% IF end_page > pagination.pages %]
24
        [% start_page = pagination.pages - 7 %]
25
        [% end_page = pagination.pages %]
26
    [% END %]
27
[% ELSE %]
28
    [% start_page = 1 %]
29
    [% end_page = pagination.pages %]
30
[% END %]
31
32
[% IF start_page > 1 %]
33
    <li><a href="[% pagination.base_url %]1">1</a></li>
34
    [% IF start_page != 2 %]
35
      <li class="disabled"><span>&hellip;</span></li>
36
    [% END %]
37
[% END %]
38
39
[% page_number = start_page %]
40
[% WHILE page_number <= end_page %]
41
    [% IF page_number == pagination.current_page %]
42
        <li class="active"><a href="[% pagination.base_url %][% page_number %]">[% page_number %]</a></li>
43
    [% ELSE %]
44
        <li><a href="[% pagination.base_url %][% page_number %]">[% page_number %]</a></li>
45
    [% END %]
46
    [% page_number = page_number + 1  %]
47
[% END %]
48
49
[% IF end_page < pagination.pages %]
50
    [% IF end_page != pagination.pages - 1 %]
51
        <li class="disabled"><span>&hellip;</span></li>
52
    [% END %]
53
    <li><a href="[% pagination.base_url %][% pagination.pages %]">[% pagination.pages %]</a></li>
54
[% END %]
55
56
[% IF pagination.current_page != pagination.pages %]
57
    <li><a href="[% pagination.base_url %][% pagination.current_page + 1 %]">Next &raquo;</a></li>
58
[% END %]
59
60
</ul></nav>
61
62
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderbiblio.tt (-2 / +2 lines)
Lines 45-52 Link Here
45
45
46
46
47
[% IF ( total ) %]
47
[% IF ( total ) %]
48
<b>[% total %] results found </b> 
48
    <b>[% total %] results found </b>
49
<div class="pages">[% pagination_bar %]</div>
49
    [% INCLUDE 'pagination.inc' %]
50
[% ELSE %]
50
[% ELSE %]
51
<h3> No results found</h3>
51
<h3> No results found</h3>
52
<p>
52
<p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/matching-rules.tt (-2 lines)
Lines 632-639 function CheckRuleForm(f) { Link Here
632
  [% END %]
632
  [% END %]
633
</table>[% ELSE %]<p>There are no saved matching rules.</p>[% END %]
633
</table>[% ELSE %]<p>There are no saved matching rules.</p>[% END %]
634
634
635
<div class="pages">[% pagination_bar %]</div>
636
637
[% END %]
635
[% END %]
638
 [% IF ( matching_rule_form ) %]
636
 [% IF ( matching_rule_form ) %]
639
<div id="mp_template" class="matchgroup" style="display:none;">
637
<div id="mp_template" class="matchgroup" style="display:none;">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (-2 lines)
Lines 287-294 $(document).ready(function() { Link Here
287
  <p>There are no saved patron attribute types.</p>
287
  <p>There are no saved patron attribute types.</p>
288
[% END %]
288
[% END %]
289
289
290
<div class="pages">[% pagination_bar %]</div>
291
292
[% END %]
290
[% END %]
293
 
291
 
294
</div>
292
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-2 / +2 lines)
Lines 57-63 function searchauthority() { Link Here
57
57
58
<div id="merge_in_progress"></div>
58
<div id="merge_in_progress"></div>
59
[% IF ( total ) %]
59
[% IF ( total ) %]
60
<div class="pages">[% pagination_bar %]</div>
60
[% INCLUDE 'pagination.inc' %]
61
61
62
<p id="authorities_searchresultlist_current_page_info">
62
<p id="authorities_searchresultlist_current_page_info">
63
  Results [% from %] to [% to %] of [% total %]
63
  Results [% from %] to [% to %] of [% total %]
Lines 107-113 function searchauthority() { Link Here
107
  </table>
107
  </table>
108
</div>
108
</div>
109
109
110
<div class="pages">[% pagination_bar %]</div>
110
[% INCLUDE 'pagination.inc' %]
111
111
112
[% ELSE %]
112
[% ELSE %]
113
  No results found
113
  No results found
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt (-3 / +1 lines)
Lines 487-495 Link Here
487
            [% INCLUDE 'catalogue/itemsearch_items.inc' items = results %]
487
            [% INCLUDE 'catalogue/itemsearch_items.inc' items = results %]
488
          [% END %]
488
          [% END %]
489
489
490
          <div class="pages">
490
          [% INCLUDE 'pagination.inc' %]
491
            [% pagination_bar %]
492
          </div>
493
491
494
        [% END %]
492
        [% END %]
495
      </div>
493
      </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt (-1 / +1 lines)
Lines 134-140 Link Here
134
    [% total %] result(s) found in catalog,
134
    [% total %] result(s) found in catalog,
135
    <a href="#searchresult-breeding">[% breeding_count %] result(s) found in reservoir</a>
135
    <a href="#searchresult-breeding">[% breeding_count %] result(s) found in reservoir</a>
136
</div>
136
</div>
137
<div class="pages">[% pagination_bar %]</div>
137
[% INCLUDE 'pagination.inc' %]
138
<div class="searchresults">
138
<div class="searchresults">
139
    <table>
139
    <table>
140
        <tr>
140
        <tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c.tt (-6 / +4 lines)
Lines 40-48 Link Here
40
        </form>
40
        </form>
41
            [% IF ( total ) %]
41
            [% IF ( total ) %]
42
            <h3>Authority search results</h3>
42
            <h3>Authority search results</h3>
43
            <div class="pages">
43
            [% INCLUDE 'pagination.inc' %]
44
                          [% pagination_bar %]      
44
            [% END %]
45
                        </div>[% END %]
46
            <p>
45
            <p>
47
                [% IF ( total ) %]
46
                [% IF ( total ) %]
48
                    &nbsp;<b>Results [% from %] to [% to %] of [% total %]</b><br /><br />
47
                    &nbsp;<b>Results [% from %] to [% to %] of [% total %]</b><br /><br />
Lines 73-81 Link Here
73
        </div>
72
        </div>
74
[% END %]
73
[% END %]
75
74
76
            [% IF ( total ) %]<div class="pages">
75
            [% IF ( total ) %]
77
                          [% pagination_bar %]      
76
                [% INCLUDE 'pagination.inc' %]
78
                        </div>
79
            [% END %]
77
            [% END %]
80
<script type="text/javascript">
78
<script type="text/javascript">
81
//<![CDATA[
79
//<![CDATA[
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-1 / +2 lines)
Lines 847-853 canned reports and writing custom SQL reports.</p> Link Here
847
    </select>
847
    </select>
848
</form>
848
</form>
849
849
850
<div class="pages">[% pagination_bar %]</div>
850
[% INCLUDE 'pagination.inc' %]
851
851
[% UNLESS ( errors ) %]
852
[% UNLESS ( errors ) %]
852
<table>
853
<table>
853
<tr>[% FOREACH header_ro IN header_row %]<th>[% header_ro.cell %]</th>[% END %]</tr>
854
<tr>[% FOREACH header_ro IN header_row %]<th>[% header_ro.cell %]</th>[% END %]</tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reviews/reviewswaiting.tt (-1 / +3 lines)
Lines 59-65 Link Here
59
    </tr>
59
    </tr>
60
    [% END %]</tbody>
60
    [% END %]</tbody>
61
</table>
61
</table>
62
 <div class="pages">[% pagination_bar %]</div>
62
63
[% INCLUDE 'pagination.inc' %]
64
63
[% ELSE %]
65
[% ELSE %]
64
[% IF ( status ) %]<p><b>No comments have been approved.</b></p>[% ELSE %]<p><b>No comments to moderate.</b></p>[% END %]
66
[% IF ( status ) %]<p><b>No comments have been approved.</b></p>[% ELSE %]<p><b>No comments to moderate.</b></p>[% END %]
65
[% END %]
67
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt (-5 / +3 lines)
Lines 229-239 tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } Link Here
229
        [% END %]
229
        [% END %]
230
  </div>
230
  </div>
231
  [% END %]
231
  [% END %]
232
  [% IF ( pagination_bar ) %]
232
233
  <div class="pages" id="pagination_top">
233
  [% INCLUDE 'pagination.inc' %]
234
  	[% pagination_bar %]
234
235
  </div>
236
  [% END %]
237
  [% IF ( tagloop ) %]
235
  [% IF ( tagloop ) %]
238
  <p class="check"></p>
236
  <p class="check"></p>
239
  <table id="tagst">
237
  <table id="tagst">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-2 / +3 lines)
Lines 375-381 function placeHold () { Link Here
375
    [% IF itemsloop %]
375
    [% IF itemsloop %]
376
376
377
    <h3>Contents of <i>[% shelf.shelfname | html %]</i></h3>
377
    <h3>Contents of <i>[% shelf.shelfname | html %]</i></h3>
378
    <div class="pages">[% pagination_bar %]</div>
378
379
    <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post" class="checkboxed">
379
    <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post" class="checkboxed">
380
        <input type="hidden" name="op" value="remove_biblios" />
380
        <input type="hidden" name="op" value="remove_biblios" />
381
        <input type="hidden" name="referer" value="view" />
381
        <input type="hidden" name="referer" value="view" />
Lines 406-411 function placeHold () { Link Here
406
    [% END %]
406
    [% END %]
407
</div>
407
</div>
408
408
409
    [% INCLUDE 'pagination.inc' %]
409
    <table id="searchresults">
410
    <table id="searchresults">
410
            <tr>
411
            <tr>
411
                [% IF ( itemsloop ) %]<th class="checkall">&nbsp;</th>[% END %]
412
                [% IF ( itemsloop ) %]<th class="checkall">&nbsp;</th>[% END %]
Lines 489-495 function placeHold () { Link Here
489
			</tr>
490
			</tr>
490
		[% END %]<!-- /itemsloop -->
491
		[% END %]<!-- /itemsloop -->
491
    </table>
492
    </table>
492
    <div class="pages">[% pagination_bar %]</div>
493
    [% INCLUDE 'pagination.inc' %]
493
</form>
494
</form>
494
495
495
	[% END %]
496
	[% END %]
(-)a/reports/guided_reports.pl (-2 / +8 lines)
Lines 29-34 use C4::Auth qw/:DEFAULT get_session/; Link Here
29
use C4::Output;
29
use C4::Output;
30
use C4::Debug;
30
use C4::Debug;
31
use C4::Context;
31
use C4::Context;
32
use C4::Koha;
32
use Koha::Caches;
33
use Koha::Caches;
33
use C4::Log;
34
use C4::Log;
34
use Koha::DateUtils qw/dt_from_string output_pref/;
35
use Koha::DateUtils qw/dt_from_string output_pref/;
Lines 785-795 elsif ($phase eq 'Run this report'){ Link Here
785
                }
786
                }
786
            }
787
            }
787
788
788
            my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0);
789
            my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&amp;phase=Run%20this%20report&amp;limit=$limit";
789
            my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&amp;phase=Run%20this%20report&amp;limit=$limit";
790
            if (@sql_params) {
790
            if (@sql_params) {
791
                $url = join('&amp;sql_params=', $url, map { URI::Escape::uri_escape_utf8($_) } @sql_params);
791
                $url = join('&amp;sql_params=', $url, map { URI::Escape::uri_escape_utf8($_) } @sql_params);
792
            }
792
            }
793
794
            my $pagination = {
795
                base_url     => "$url&page=",
796
                pages        => getnbpages( $total, $limit ),
797
                current_page => $input->param('page'),
798
            };
793
            $template->param(
799
            $template->param(
794
                'results' => \@rows,
800
                'results' => \@rows,
795
                'sql'     => $sql,
801
                'sql'     => $sql,
Lines 799-805 elsif ($phase eq 'Run this report'){ Link Here
799
                'name'    => $name,
805
                'name'    => $name,
800
                'notes'   => $notes,
806
                'notes'   => $notes,
801
                'errors'  => defined($errors) ? [ $errors ] : undef,
807
                'errors'  => defined($errors) ? [ $errors ] : undef,
802
                'pagination_bar'  => pagination_bar($url, $totpages, $input->param('page')),
808
                'pagination'  => $pagination,
803
                'unlimited_total' => $total,
809
                'unlimited_total' => $total,
804
                'sql_params'      => \@sql_params,
810
                'sql_params'      => \@sql_params,
805
            );
811
            );
(-)a/reviews/reviewswaiting.pl (-1 / +8 lines)
Lines 23-28 use C4::Output; Link Here
23
use C4::Context;
23
use C4::Context;
24
use C4::Members;
24
use C4::Members;
25
use C4::Biblio;
25
use C4::Biblio;
26
use C4::Koha;
26
use Koha::Reviews;
27
use Koha::Reviews;
27
28
28
my $query = new CGI;
29
my $query = new CGI;
Lines 78-87 foreach ( @$reviews ) { Link Here
78
79
79
my $url = "/cgi-bin/koha/reviews/reviewswaiting.pl?status=$status";
80
my $url = "/cgi-bin/koha/reviews/reviewswaiting.pl?status=$status";
80
81
82
my $pagination = {
83
    base_url     => "$url&page=",
84
    pages        => getnbpages( $total, $count ),
85
    current_page => $page,
86
};
87
81
$template->param(
88
$template->param(
82
    status => $status,
89
    status => $status,
83
    reviews => $reviews,
90
    reviews => $reviews,
84
    pagination_bar => pagination_bar( $url, ( int( $total / $count ) ) + ( ( $total % $count ) > 0 ? 1 : 0 ), $page, "page" )
91
    pagination => $pagination,
85
);
92
);
86
93
87
output_html_with_http_headers $query, $cookie, $template->output;
94
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/tags/review.pl (-5 / +10 lines)
Lines 30-38 use C4::Auth qw(:DEFAULT check_cookie_auth); Link Here
30
use C4::Context;
30
use C4::Context;
31
use Koha::DateUtils;
31
use Koha::DateUtils;
32
# use C4::Koha;
32
# use C4::Koha;
33
use C4::Output qw(:html :ajax pagination_bar);
33
use C4::Output qw(:html :ajax);
34
use C4::Debug;
34
use C4::Debug;
35
use C4::Tags qw(get_tags get_approval_rows approval_counts whitelist blacklist is_approved);
35
use C4::Tags qw(get_tags get_approval_rows approval_counts whitelist blacklist is_approved);
36
use C4::Koha;
36
37
37
my $script_name = "/cgi-bin/koha/tags/review.pl";
38
my $script_name = "/cgi-bin/koha/tags/review.pl";
38
my $needed_flags = { tools => 'moderate_tags' };	# FIXME: replace when more specific permission is created.
39
my $needed_flags = { tools => 'moderate_tags' };	# FIXME: replace when more specific permission is created.
Lines 212-217 $qstring =~ s/^;+//; # remove leading delims Link Here
212
$qstring = "limit=$pagesize" . ($qstring ? '&amp;' . $qstring : '');
213
$qstring = "limit=$pagesize" . ($qstring ? '&amp;' . $qstring : '');
213
$debug and print STDERR "number of approval_rows: " . scalar(@$tagloop) . "rows\n";
214
$debug and print STDERR "number of approval_rows: " . scalar(@$tagloop) . "rows\n";
214
(scalar @errors) and $template->param(message_loop=>\@errors);
215
(scalar @errors) and $template->param(message_loop=>\@errors);
216
217
my $pagination = {
218
    base_url     => "$script_name?$qstring&amp;page=",
219
    pages        => getnbpages( $counts->{approved_total}, $pagesize),
220
    current_page => $page,
221
};
222
215
$template->param(
223
$template->param(
216
	offset => $offset,	# req'd for EXPR
224
	offset => $offset,	# req'd for EXPR
217
	op => $op,
225
	op => $op,
Lines 219-228 $template->param( Link Here
219
	script_name => $script_name,
227
	script_name => $script_name,
220
	approved => 0,		# dummy value (also EXPR)
228
	approved => 0,		# dummy value (also EXPR)
221
	tagloop => $tagloop,
229
	tagloop => $tagloop,
222
	pagination_bar => pagination_bar(
230
    pagination => $pagination,
223
		"$script_name?$qstring\&amp;",
224
		ceil($counts->{approved_total}/$pagesize),	# $page, 'page'
225
	)
226
);
231
);
227
232
228
output_html_with_http_headers $input, $cookie, $template->output;
233
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/virtualshelves/shelves.pl (-5 / +8 lines)
Lines 295-305 if ( $op eq 'view' ) { Link Here
295
            );
295
            );
296
            if ( $page ) {
296
            if ( $page ) {
297
                my $pager = $contents->pager;
297
                my $pager = $contents->pager;
298
299
                my $pagination = {
300
                    base_url     => "?op=view&shelfnumber=" . $shelf->shelfnumber . "&sortfield=$sortfield&direction=$direction&page=",
301
                    pages        => $pager->last_page - $pager->first_page + 1,
302
                    current_page => $page,
303
                };
304
298
                $template->param(
305
                $template->param(
299
                    pagination_bar => pagination_bar(
306
                    pagination => $pagination,
300
                        q||, $pager->last_page - $pager->first_page + 1,
301
                        $page, "page", { op => 'view', shelfnumber => $shelf->shelfnumber, sortfield => $sortfield, direction => $direction, }
302
                    ),
303
                );
307
                );
304
            }
308
            }
305
        } else {
309
        } else {
306
- 

Return to bug 18008