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

(-)a/C4/VirtualShelves/Page.pm (-10 / +20 lines)
Lines 76-86 sub shelfpage { Link Here
76
    my ( $shelflimit, $shelfoffset, $shelveslimit, $shelvesoffset );
76
    my ( $shelflimit, $shelfoffset, $shelveslimit, $shelvesoffset );
77
    my $marcflavour = C4::Context->preference("marcflavour");
77
    my $marcflavour = C4::Context->preference("marcflavour");
78
78
79
    $shelflimit = ( $type eq 'opac' ? C4::Context->preference('OPACnumSearchResults') : C4::Context->preference('numSearchResults') );
79
    unless ( $query->param('print') ) {
80
    $shelflimit = $shelflimit || ShelvesMax('MGRPAGE');
80
        $shelflimit =
81
    $shelfoffset   = ( $itemoff - 1 ) * $shelflimit;     # Sets the offset to begin retrieving items at
81
          ( $type eq 'opac'
82
    $shelveslimit  = $shelflimit;                        # Limits number of shelves returned for a given query (row_count)
82
            ? C4::Context->preference('OPACnumSearchResults')
83
    $shelvesoffset = ( $shelfoff - 1 ) * $shelflimit;    # Sets the offset to begin retrieving shelves at (offset)
83
            : C4::Context->preference('numSearchResults') );
84
        $shelflimit = $shelflimit || ShelvesMax('MGRPAGE');
85
        $shelfoffset = ( $itemoff - 1 ) * $shelflimit;    # Sets the offset to begin retrieving items at
86
        $shelveslimit = $shelflimit;    # Limits number of shelves returned for a given query (row_count)
87
        $shelvesoffset = ( $shelfoff - 1 ) * $shelflimit;    # Sets the offset to begin retrieving shelves at (offset)
88
    }
89
84
                                                # getting the Shelves list
90
                                                # getting the Shelves list
85
    my $category = ( ( $displaymode eq 'privateshelves' ) ? 1 : 2 );
91
    my $category = ( ( $displaymode eq 'privateshelves' ) ? 1 : 2 );
86
    my $shelflist = GetShelves( $category, $shelveslimit, $shelvesoffset, $loggedinuser );
92
    my $shelflist = GetShelves( $category, $shelveslimit, $shelvesoffset, $loggedinuser );
Lines 459-470 sub shelfpage { Link Here
459
        $qhash{$_} = $query->param($_) if $query->param($_);
465
        $qhash{$_} = $query->param($_) if $query->param($_);
460
    }
466
    }
461
    ( scalar keys %qhash ) and $url .= '?' . join '&', map { "$_=$qhash{$_}" } keys %qhash;
467
    ( scalar keys %qhash ) and $url .= '?' . join '&', map { "$_=$qhash{$_}" } keys %qhash;
462
    if ( $shelfnumber && $totitems ) {
468
463
        $template->param(  pagination_bar => pagination_bar( $url, ( int( $totitems / $shelflimit ) ) + ( ( $totitems % $shelflimit ) > 0 ? 1 : 0 ), $itemoff, "itemoff" )  );
469
    unless ( $query->param('print')) {
464
    } elsif ( $totshelves ) {
470
        if ( $shelfnumber && $totitems ) {
465
        $template->param(
471
            $template->param(  pagination_bar => pagination_bar( $url, ( int( $totitems / $shelflimit ) ) + ( ( $totitems % $shelflimit ) > 0 ? 1 : 0 ), $itemoff, "itemoff" )  );
466
             pagination_bar => pagination_bar( $url, ( int( $totshelves / $shelveslimit ) ) + ( ( $totshelves % $shelveslimit ) > 0 ? 1 : 0 ), $shelfoff, "shelfoff" )  );
472
        } elsif ( $totshelves ) {
473
            $template->param(
474
                 pagination_bar => pagination_bar( $url, ( int( $totshelves / $shelveslimit ) ) + ( ( $totshelves % $shelveslimit ) > 0 ? 1 : 0 ), $shelfoff, "shelfoff" )  );
475
        }
467
    }
476
    }
477
468
    $template->param(
478
    $template->param(
469
        shelveslooppriv                                                    => \@shelveslooppriv,
479
        shelveslooppriv                                                    => \@shelveslooppriv,
470
        shelvesloop                                                        => \@shelvesloop,
480
        shelvesloop                                                        => \@shelvesloop,
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/print.css (-1 / +1 lines)
Lines 322-325 fieldset { Link Here
322
}
322
}
323
#cataloguing_additem_itemlist {
323
#cataloguing_additem_itemlist {
324
	overflow : visible !important;
324
	overflow : visible !important;
325
}
325
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc (-5 / +1 lines)
Lines 12-21 Link Here
12
            sendList();
12
            sendList();
13
            return false;
13
            return false;
14
        });
14
        });
15
        $("#printlist").click(function(){
16
            print();
17
            return false;
18
        });
19
        $("#deleteshelf").click(function(e){
15
        $("#deleteshelf").click(function(e){
20
            if(confirmDelete(_("Are you sure you want to delete this list?"))){
16
            if(confirmDelete(_("Are you sure you want to delete this list?"))){
21
                return true;
17
                return true;
Lines 60-65 Link Here
60
                </ul>
56
                </ul>
61
        </div>
57
        </div>
62
        <div class="btn-group"><a class="btn btn-small" href="#" id="sendlist"><i class="icon-envelope"></i> Send list</a></div>
58
        <div class="btn-group"><a class="btn btn-small" href="#" id="sendlist"><i class="icon-envelope"></i> Send list</a></div>
63
        <div class="btn-group"><a class="btn btn-small" id="printlist" href="#"><i class="icon-print"></i> Print list</a></div>
59
        <div class="btn-group"><a class="btn btn-small" id="printlist" target="_blank" href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&amp;print=1"><i class="icon-print"></i> Print list</a></div>
64
    [% END %]
60
    [% END %]
65
</div>
61
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-2 / +12 lines)
Lines 1-6 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; [% IF ( viewshelf ) %]Lists &rsaquo; Contents of [% shelfname | html %][% ELSE %]Lists[% END %][% IF ( shelves ) %] &rsaquo; Create new list[% END %][% IF ( edit ) %] &rsaquo; Edit list [% shelfname | html %][% END %]</title>
2
<title>Koha &rsaquo; [% IF ( viewshelf ) %]Lists &rsaquo; Contents of [% shelfname | html %][% ELSE %]Lists[% END %][% IF ( shelves ) %] &rsaquo; Create new list[% END %][% IF ( edit ) %] &rsaquo; Edit list [% shelfname | html %][% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'doc-head-close.inc' %]
4
5
[% IF print %]
6
<script type="text/javascript">
7
    $( document ).ready(function() {
8
        window.print();
9
        setTimeout('window.close()', 1);
10
    });
11
</script>
12
[% END %]
13
4
[% IF ( viewshelf ) %]
14
[% IF ( viewshelf ) %]
5
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
15
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
6
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
16
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
Lines 282-288 function placeHold () { Link Here
282
    [% SET new_direction = 'asc' %]
292
    [% SET new_direction = 'asc' %]
283
[% END %]
293
[% END %]
284
294
285
<div id="searchheader">
295
<div id="searchheader" class="noprint">
286
    [% IF ( itemsloop ) %]
296
    [% IF ( itemsloop ) %]
287
        <div id="selection_ops"><span class="checkall"></span> |
297
        <div id="selection_ops"><span class="checkall"></span> |
288
        <span class="clearall"></span>
298
        <span class="clearall"></span>
Lines 402-408 function placeHold () { Link Here
402
[% IF ( allowaddingitem ) %]
412
[% IF ( allowaddingitem ) %]
403
<div class="yui-g">
413
<div class="yui-g">
404
<form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
414
<form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
405
 <fieldset class="brief">
415
 <fieldset class="brief noprint">
406
    <legend>Add an item to <i>[% shelfname | html %]</i></legend>
416
    <legend>Add an item to <i>[% shelfname | html %]</i></legend>
407
        <ol>
417
        <ol>
408
            <li>
418
            <li>
(-)a/virtualshelves/shelves.pl (-1 / +1 lines)
Lines 35-38 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
35
        flagsrequired   => { catalogue => 1 },
35
        flagsrequired   => { catalogue => 1 },
36
    }
36
    }
37
);
37
);
38
$template->param( print => $query->param('print') );
38
shelfpage('intranet', $query, $template, $loggedinuser, $cookie);
39
shelfpage('intranet', $query, $template, $loggedinuser, $cookie);
39
- 

Return to bug 13986