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 4-9 Link Here
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
[% INCLUDE 'datatables.inc' %]
5
[% INCLUDE 'datatables.inc' %]
6
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
6
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
7
8
[% IF print %]
9
<script type="text/javascript">
10
    $( document ).ready(function() {
11
        window.print();
12
        setTimeout('window.close()', 1);
13
    });
14
</script>
15
[% END %]
16
7
[% IF ( viewshelf ) %]
17
[% IF ( viewshelf ) %]
8
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
18
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
9
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
19
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
Lines 354-360 function placeHold () { Link Here
354
    [% SET new_direction = 'asc' %]
364
    [% SET new_direction = 'asc' %]
355
[% END %]
365
[% END %]
356
366
357
<div id="searchheader">
367
<div id="searchheader" class="noprint">
358
    [% IF ( itemsloop ) %]
368
    [% IF ( itemsloop ) %]
359
        <div id="selection_ops"><span class="checkall"></span> |
369
        <div id="selection_ops"><span class="checkall"></span> |
360
        <span class="clearall"></span>
370
        <span class="clearall"></span>
Lines 474-480 function placeHold () { Link Here
474
[% IF ( allowaddingitem ) %]
484
[% IF ( allowaddingitem ) %]
475
<div class="yui-g">
485
<div class="yui-g">
476
<form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
486
<form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
477
 <fieldset class="brief">
487
 <fieldset class="brief noprint">
478
    <legend>Add an item to <i>[% shelfname | html %]</i></legend>
488
    <legend>Add an item to <i>[% shelfname | html %]</i></legend>
479
        <ol>
489
        <ol>
480
            <li>
490
            <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