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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 355-357 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
355
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OAI-PMH:AutoUpdateSets','0','Automatically update OAI sets when a bibliographic record is created or updated','','YesNo');
355
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OAI-PMH:AutoUpdateSets','0','Automatically update OAI sets when a bibliographic record is created or updated','','YesNo');
356
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAllowPublicListCreation',1,'If set, allows opac users to create public lists',NULL,'YesNo');
356
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAllowPublicListCreation',1,'If set, allows opac users to create public lists',NULL,'YesNo');
357
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAllowSharingPrivateLists',0,'If set, allows opac users to share private lists with other patrons',NULL,'YesNo');
357
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAllowSharingPrivateLists',0,'If set, allows opac users to share private lists with other patrons',NULL,'YesNo');
358
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACShowHoldsCount',0,'Show the total number of holds in the OPAC details',NULL,'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 5036-5041 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5036
    SetVersion($DBversion);
5036
    SetVersion($DBversion);
5037
}
5037
}
5038
5038
5039
$DBversion = "3.07.00.XXX";
5040
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5041
    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACShowHoldsCount',0,'Show the total number of holds in the OPAC details',NULL,'YesNo')");
5042
    print "Upgrade to $DBversion done (Added system preference OPACShowHoldsCount)\n";
5043
    SetVersion($DBversion);
5044
}
5045
5039
=head1 FUNCTIONS
5046
=head1 FUNCTIONS
5040
5047
5041
=head2 DropAllForeignKeys($table)
5048
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 343-348 OPAC: Link Here
343
                  no: "Don't allow"
343
                  no: "Don't allow"
344
            - patrons to place holds on specific items in the OPAC. If this is disabled, users can only put a hold on the next available item.
344
            - patrons to place holds on specific items in the OPAC. If this is disabled, users can only put a hold on the next available item.
345
        -
345
        -
346
            - pref: OPACShowHoldsCount
347
              choices:
348
                  yes: Show
349
                  no: "Don't show"
350
            - the total number of holds on the details page
351
        -
346
            - pref: OpacRenewalAllowed
352
            - pref: OpacRenewalAllowed
347
              choices:
353
              choices:
348
                  yes: Allow
354
                  yes: Allow
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (+9 lines)
Lines 599-604 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
599
		<th>Status</th>
599
		<th>Status</th>
600
		[% IF ( itemdata_itemnotes ) %]<th>Notes</th>[% END %]
600
		[% IF ( itemdata_itemnotes ) %]<th>Notes</th>[% END %]
601
		<th>Date Due</th>
601
		<th>Date Due</th>
602
        [% IF holds_count.defined %]
603
		<th>Holds</th>
604
        [% END %]
602
	    </tr></thead>
605
	    </tr></thead>
603
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
606
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
604
	    <tr>[% IF ( item_level_itypes ) %]<td>[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
607
	    <tr>[% IF ( item_level_itypes ) %]<td>[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
Lines 623-632 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
623
		<td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
626
		<td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
624
		[% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %]
627
		[% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %]
625
		<td>[% ITEM_RESULT.datedue %]</td>
628
		<td>[% ITEM_RESULT.datedue %]</td>
629
        [% IF holds_count.defined %]
630
		<td>[% ITEM_RESULT.holds_count %]</td>
631
        [% END %]
626
	    </tr>
632
	    </tr>
627
	    [% END %]</tbody>
633
	    [% END %]</tbody>
628
	</table>
634
	</table>
629
    [% END %]
635
    [% END %]
636
    [% IF holds_count.defined %]
637
	<div id="bib_holds">Holds: [% holds_count %]</div>
638
    [% END %]
630
[% ELSE %]
639
[% ELSE %]
631
    [% IF ( ALTERNATEHOLDINGS ) %]
640
    [% IF ( ALTERNATEHOLDINGS ) %]
632
    [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
641
    [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt (-24 / +22 lines)
Lines 242-248 Link Here
242
                  [% UNLESS ( item_level_itypes ) %]
242
                  [% UNLESS ( item_level_itypes ) %]
243
                    <th>Item Type</th>
243
                    <th>Item Type</th>
244
                  [% END %]
244
                  [% END %]
245
                  [% IF ( showpriority ) %]
245
                  [% IF ( showholds ) %]
246
                  <th>Priority</th>
246
                  <th>Priority</th>
247
                  [% END %]
247
                  [% END %]
248
		  [% IF ( reserve_in_future ) %]
248
		  [% IF ( reserve_in_future ) %]
Lines 297-315 Link Here
297
                        [% END %]
297
                        [% END %]
298
298
299
                    </td>
299
                    </td>
300
                    [% IF ( bibitemloo.holdable ) %][% UNLESS ( item_level_itypes ) %]
301
                                          <td>
302
                                            [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
303
                                [% bibitemloo.description %]
304
                                          </td>
305
                                        [% END %][% END %]
306
                    [% IF ( bibitemloo.holdable ) %]
300
                    [% IF ( bibitemloo.holdable ) %]
307
                    [% IF ( showpriority ) %]
301
		    <!-- HOLDABLE -->
308
                    <td>
302
                        [% UNLESS ( item_level_itypes ) %]
309
                    [% bibitemloo.rank %] out of [% bibitemloo.reservecount %]
303
                        <td>
310
                    </td>[% END %][% END %]
304
                            [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
311
		    [% IF ( reserve_in_future ) %]
305
                            [% bibitemloo.description %]
312
		    [% IF ( bibitemloo.holdable ) %]<td>
306
                        </td>
307
                        [% END %]
308
                        [% IF showholds %]
309
                        <td>
310
                        [% IF ( showpriority ) %] [% bibitemloo.rank %] out of [% END %][% bibitemloo.reservecount %]
311
                        </td>
312
                        [% END %]
313
		        [% IF ( reserve_in_future ) %]
314
                        <td>
313
              <input name="reserve_date_[% bibitemloo.biblionumber %]" id="reserve_date_[% bibitemloo.biblionumber %]" size="10">
315
              <input name="reserve_date_[% bibitemloo.biblionumber %]" id="reserve_date_[% bibitemloo.biblionumber %]" size="10">
314
              <script language="JavaScript" type="text/javascript">
316
              <script language="JavaScript" type="text/javascript">
315
              //<![CDATA[
317
              //<![CDATA[
Lines 348-357 Link Here
348
              </script>
350
              </script>
349
      <p style="margin:.3em 2em;">
351
      <p style="margin:.3em 2em;">
350
      <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('reserve_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
352
      <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('reserve_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
351
                </td>[% END %]
353
                        </td>
352
354
                        [% END %]
353
		    [% END %]
355
	                <td>
354
	[% IF ( bibitemloo.holdable ) %]<td>
355
        <input name="expiration_date_[% bibitemloo.biblionumber %]" id="expiration_date_[% bibitemloo.biblionumber %]" size="10" readonly="readonly" />
356
        <input name="expiration_date_[% bibitemloo.biblionumber %]" id="expiration_date_[% bibitemloo.biblionumber %]" size="10" readonly="readonly" />
356
        <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarExpirationDate_[% bibitemloo.biblionumber %]" style="cursor: pointer;" />
357
        <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarExpirationDate_[% bibitemloo.biblionumber %]" style="cursor: pointer;" />
357
        <script language="JavaScript" type="text/javascript">
358
        <script language="JavaScript" type="text/javascript">
Lines 381-393 Link Here
381
        </script>
382
        </script>
382
      <p style="margin:.3em 2em;">
383
      <p style="margin:.3em 2em;">
383
      <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
384
      <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p>
384
    </td>[% END %]
385
                        </td>
385
386
		        [% IF ( OPACItemHolds ) %]
386
                    [% IF ( bibitemloo.holdable ) %]
387
		        <!-- ITEM HOLDS -->
387
		    <!-- HOLD ABLE -->
388
                        <td class="place_on_type" style="display:none">
388
		    [% IF ( OPACItemHolds ) %]
389
		    <!-- ITEM HOLDS -->
390
                                          <td class="place_on_type" style="display:none">
391
                                            <ul>
389
                                            <ul>
392
                                                <li>
390
                                                <li>
393
                                                  [% UNLESS ( bibitemloo.holdable ) %]
391
                                                  [% UNLESS ( bibitemloo.holdable ) %]
(-)a/opac/opac-detail.pl (+10 lines)
Lines 480-489 if ($dat->{'count'} >= 50 && !$viewallitems) { Link Here
480
480
481
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
481
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
482
482
483
my %item_reserves;
484
if ( C4::Context->preference("OPACShowHoldsCount") ) {
485
    my ($reserve_count,$reserves) = GetReservesFromBiblionumber($biblionumber);
486
    $template->param( holds_count  => $reserve_count );
487
    foreach (@$reserves) {
488
        $item_reserves{ $_->{itemnumber} }++ if $_->{itemnumber};
489
    }
490
}
491
483
my $norequests = 1;
492
my $norequests = 1;
484
my $branches = GetBranches();
493
my $branches = GetBranches();
485
my %itemfields;
494
my %itemfields;
486
for my $itm (@items) {
495
for my $itm (@items) {
496
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
487
    $norequests = 0
497
    $norequests = 0
488
       if ( (not $itm->{'wthdrawn'} )
498
       if ( (not $itm->{'wthdrawn'} )
489
         && (not $itm->{'itemlost'} )
499
         && (not $itm->{'itemlost'} )
(-)a/opac/opac-reserve.pl (-27 / +25 lines)
Lines 48-53 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
48
    }
48
    }
49
);
49
);
50
my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0;
50
my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0;
51
my $show_holds_count = C4::Context->preference("OPACShowHoldsCount");
52
51
sub get_out ($$$) {
53
sub get_out ($$$) {
52
	output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output;
54
	output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output;
53
	exit;
55
	exit;
Lines 113-124 $template->param( choose_branch => $OPACChooseBranch); Link Here
113
#
115
#
114
#
116
#
115
117
116
# Hash of biblionumber to biblio/biblioitems record.
118
my %biblioDataHash; # Hash of biblionumber to biblio/biblioitems record.
117
my %biblioDataHash;
119
my %itemInfoHash; # Hash of itemnumber to item info.
118
119
# Hash of itemnumber to item info.
120
my %itemInfoHash;
121
122
foreach my $biblioNumber (@biblionumbers) {
120
foreach my $biblioNumber (@biblionumbers) {
123
121
124
    my $biblioData = GetBiblioData($biblioNumber);
122
    my $biblioData = GetBiblioData($biblioNumber);
Lines 128-160 foreach my $biblioNumber (@biblionumbers) { Link Here
128
126
129
    my $marcrecord= GetMarcBiblio($biblioNumber);
127
    my $marcrecord= GetMarcBiblio($biblioNumber);
130
128
131
	# flag indicating existence of at least one item linked via a host record
129
    # flag indicating existence of at least one item linked via a host record
132
	my $hostitemsflag;
130
    my $hostitemsflag;
133
	# adding items linked via host biblios
131
    # adding items linked via host biblios
134
	my @hostitemInfos = GetHostItemsInfo($marcrecord);
132
    my @hostitemInfos = GetHostItemsInfo($marcrecord);
135
	if (@hostitemInfos){
133
    if (@hostitemInfos){
136
		$hostitemsflag =1;
134
        $hostitemsflag =1;
137
	        push (@itemInfos,@hostitemInfos);
135
        push (@itemInfos,@hostitemInfos);
138
	}
136
    }
139
140
141
137
142
    $biblioData->{itemInfos} = \@itemInfos;
138
    $biblioData->{itemInfos} = \@itemInfos;
143
    foreach my $itemInfo (@itemInfos) {
139
    foreach my $itemInfo (@itemInfos) {
144
        $itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo;
140
        $itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo;
145
    }
141
    }
146
142
147
    # Compute the priority rank.
143
    if ($show_holds_count) {
148
    my ( $rank, $reserves ) = GetReservesFromBiblionumber($biblioNumber,1);
144
        # Compute the priority rank.
149
    $biblioData->{reservecount} = $rank;
145
        my ( $rank, $reserves ) = GetReservesFromBiblionumber($biblioNumber,1);
150
    foreach my $res (@$reserves) {
146
        $biblioData->{reservecount} = $rank;
151
        my $found = $res->{'found'};
147
        foreach my $res (@$reserves) {
152
        if ( $found && ($found eq 'W') ) {
148
            my $found = $res->{'found'};
153
            $rank--;
149
            if ( $found && ($found eq 'W') ) {
150
                $rank--;
151
            }
154
        }
152
        }
153
        $rank++;
154
        $biblioData->{rank} = $rank;
155
    }
155
    }
156
    $rank++;
157
    $biblioData->{rank} = $rank;
158
}
156
}
159
157
160
#
158
#
Lines 528-534 $template->param(itemtable_colspan => $itemTableColspan); Link Here
528
526
529
# display infos
527
# display infos
530
$template->param(bibitemloop => $biblioLoop);
528
$template->param(bibitemloop => $biblioLoop);
531
$template->param( showpriority=>1 ) if $OPACDisplayRequestPriority;
529
$template->param( showpriority=>$OPACDisplayRequestPriority);
530
$template->param( showholds=>$show_holds_count);
532
# can set reserve date in future
531
# can set reserve date in future
533
if (
532
if (
534
    C4::Context->preference( 'AllowHoldDateInFuture' ) &&
533
    C4::Context->preference( 'AllowHoldDateInFuture' ) &&
535
- 

Return to bug 7398