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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 240-245 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
240
('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'),
240
('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'),
241
('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','70|10','A user-defined block of HTML  in the main content area of the opac main page','Textarea'),
241
('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','70|10','A user-defined block of HTML  in the main content area of the opac main page','Textarea'),
242
('OpacMainUserBlockMobile','',NULL,'Show the following HTML in its own column on the main page of the OPAC (mobile version):','free'),
242
('OpacMainUserBlockMobile','',NULL,'Show the following HTML in its own column on the main page of the OPAC (mobile version):','free'),
243
('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'),
243
('OPACMobileUserCSS','',NULL,'Include the following CSS for the mobile view on all pages in the OPAC:','free'),
244
('OPACMobileUserCSS','',NULL,'Include the following CSS for the mobile view on all pages in the OPAC:','free'),
244
('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my reading history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','Textarea'),
245
('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my reading history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','Textarea'),
245
('OpacNav','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
246
('OpacNav','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'),
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 7974-7979 if(CheckVersion($DBversion)) { Link Here
7974
    SetVersion($DBversion);
7974
    SetVersion($DBversion);
7975
}
7975
}
7976
7976
7977
$DBversion = "3.15.00.XXX";
7978
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
7979
    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer')");
7980
    print "Upgrade to $DBversion done (Bug 11256: Add system preference OpacMaxItemsToDisplay)\n";
7981
    SetVersion($DBversion);
7982
}
7983
7977
=head1 FUNCTIONS
7984
=head1 FUNCTIONS
7978
7985
7979
=head2 TableExists($table)
7986
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 286-291 OPAC: Link Here
286
                  yes: Show
286
                  yes: Show
287
                  no: Don't show
287
                  no: Don't show
288
            - "the name of the staff member who managed a suggestion in OPAC."
288
            - "the name of the staff member who managed a suggestion in OPAC."
289
        -
290
            - Display
291
            - pref: OpacMaxItemsToDisplay
292
              class: integer
293
            - items on the biblio detail page (if the biblio has more items, a link allow to display all items).
294
289
    Features:
295
    Features:
290
        -
296
        -
291
            - pref: opacuserlogin
297
            - pref: opacuserlogin
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-13 / +7 lines)
Lines 938-944 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
938
938
939
<ul>   
939
<ul>   
940
    [% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %]
940
    [% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %]
941
        <a href="#holdings">[% IF SeparateHoldings %][% LoginBranchname %] holdings[% ELSE %]Holdings[% END %] ( [% itemloop.size || 0 %] )</a>
941
        <a href="#holdings">[% IF SeparateHoldings %][% LoginBranchname %] holdings[% ELSE %]Holdings[% END %][% UNLESS too_many_items %]  ( [% itemloop.size || 0 %] )[% END %]</a>
942
    </li>
942
    </li>
943
    [% IF (SeparateHoldings) %]
943
    [% IF (SeparateHoldings) %]
944
        <li><a href="#otherholdings">Other holdings ( [% otheritemloop.size || 0 %] )</a></li>
944
        <li><a href="#otherholdings">Other holdings ( [% otheritemloop.size || 0 %] )</a></li>
Lines 1038-1049 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1038
1038
1039
1039
1040
<div id="holdings">
1040
<div id="holdings">
1041
[% IF ( itemloop.size ) %]
1041
[% IF too_many_items %]
1042
    [% IF ( lotsofholdingsitems ) %]
1042
    <p>This record has many physical items ([% items_count %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1">Click here to view them all.</a></p>
1043
        <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1#holdings">Click here to view them all.</a></p>
1043
[% ELSIF ( itemloop.size ) %]
1044
    [% ELSE %]
1044
    [% INCLUDE items_table items=itemloop tab="holdings" %]
1045
        [% INCLUDE items_table items=itemloop tab="holdings" %]
1046
    [% END %]
1047
    [% IF holds_count.defined || priority %]
1045
    [% IF holds_count.defined || priority %]
1048
    <div id="bib_holds">
1046
    <div id="bib_holds">
1049
        [% IF holds_count.defined %]
1047
        [% IF holds_count.defined %]
Lines 1075-1086 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1075
1073
1076
[% IF (SeparateHoldings) %]
1074
[% IF (SeparateHoldings) %]
1077
    <div id="otherholdings">
1075
    <div id="otherholdings">
1078
        [% IF (otheritemloop.size) %]
1076
        [% IF otheritemloop.size %]
1079
            [% IF lotsofothersholdingsitems %]
1077
            [% INCLUDE items_table items=otheritemloop tab="otherholdings" %]
1080
                <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1#otherholdings">Click here to view them all.</a></p>
1081
            [% ELSE %]
1082
                [% INCLUDE items_table items=otheritemloop tab="otherholdings" %]
1083
            [% END %]
1084
        [% ELSE %]
1078
        [% ELSE %]
1085
            No other items.
1079
            No other items.
1086
        [% END %]
1080
        [% END %]
(-)a/opac/opac-detail.pl (-13 / +10 lines)
Lines 561-567 if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) { Link Here
561
    $template->param(SeparateHoldings => 1);
561
    $template->param(SeparateHoldings => 1);
562
}
562
}
563
my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
563
my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
564
for my $itm (@items) {
564
my $viewallitems = $query->param('viewallitems');
565
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 50;
566
if ( not $viewallitems and @items > $max_items_to_display ) {
567
    $template->param(
568
        too_many_items => 1,
569
        items_count => scalar( @items ),
570
    );
571
} else {
572
  for my $itm (@items) {
565
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
573
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
566
    $itm->{priority} = $priority{ $itm->{itemnumber} };
574
    $itm->{priority} = $priority{ $itm->{itemnumber} };
567
    $norequests = 0
575
    $norequests = 0
Lines 616-621 for my $itm (@items) { Link Here
616
    } else {
624
    } else {
617
        push @itemloop, $itm;
625
        push @itemloop, $itm;
618
    }
626
    }
627
  }
619
}
628
}
620
629
621
# Display only one tab if one items list is empty
630
# Display only one tab if one items list is empty
Lines 626-642 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { Link Here
626
    }
635
    }
627
}
636
}
628
637
629
# If there is a lot of items, and the user has not decided
630
# to view them all yet, we first warn him
631
# TODO: The limit of 50 could be a syspref
632
my $viewallitems = $query->param('viewallitems');
633
if (scalar(@itemloop) >= 50 && !$viewallitems) {
634
    $template->param('lotsofholdingsitems' => 1);
635
}
636
if (scalar(@otheritemloop) >= 50 && !$viewallitems) {
637
    $template->param('lotsofothersholdingsitems' => 1);
638
}
639
640
## get notes and subjects from MARC record
638
## get notes and subjects from MARC record
641
my $dbh              = C4::Context->dbh;
639
my $dbh              = C4::Context->dbh;
642
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
640
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
643
- 

Return to bug 11256