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

(-)a/admin/systempreferences.pl (-1 / +1 lines)
Lines 348-354 $tabsysprefs{OPACViewOthersSuggestions} = "OPAC"; Link Here
348
$tabsysprefs{URLLinkText}                = "OPAC";
348
$tabsysprefs{URLLinkText}                = "OPAC";
349
$tabsysprefs{OPACSearchForTitleIn}       = "OPAC";
349
$tabsysprefs{OPACSearchForTitleIn}       = "OPAC";
350
$tabsysprefs{OPACShelfBrowser}           = "OPAC";
350
$tabsysprefs{OPACShelfBrowser}           = "OPAC";
351
$tabsysprefs{OPACDisplayRequestPriority} = "OPAC";
351
$tabsysprefs{OPACShowHoldQueueDetails}   = "OPAC";
352
$tabsysprefs{OPACAllowHoldDateInFuture}  = "OPAC";
352
$tabsysprefs{OPACAllowHoldDateInFuture}  = "OPAC";
353
$tabsysprefs{OPACPatronDetails}  = "OPAC";
353
$tabsysprefs{OPACPatronDetails}  = "OPAC";
354
$tabsysprefs{OPACFinesTab}  = "OPAC";
354
$tabsysprefs{OPACFinesTab}  = "OPAC";
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 233-239 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES Link Here
233
INSERT INTO `systempreferences` (variable,value,options,explanation,type)  VALUES ('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\'  in \'FR\' or \'360,000.00\'  in \'US\'.','Choice');
233
INSERT INTO `systempreferences` (variable,value,options,explanation,type)  VALUES ('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\'  in \'FR\' or \'360,000.00\'  in \'US\'.','Choice');
234
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice');
234
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice');
235
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo');
235
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo');
236
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OPACDisplayRequestPriority','0','','Show patrons the priority level on holds in the OPAC','YesNo');
236
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OPACShowHoldQueueDetails','none','none|priority|holds|holds_priority','Show holds details in OPAC','Choice');
237
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'UseBranchTransferLimits', '0', '', 'If ON, Koha will will use the rules defined in branch_transfer_limits to decide if an item transfer should be allowed.', 'YesNo');
237
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'UseBranchTransferLimits', '0', '', 'If ON, Koha will will use the rules defined in branch_transfer_limits to decide if an item transfer should be allowed.', 'YesNo');
238
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldPolicyOverride', '0', 'Allow staff to override hold policies when placing holds',NULL,'YesNo');
238
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldPolicyOverride', '0', 'Allow staff to override hold policies when placing holds',NULL,'YesNo');
239
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'BranchTransferLimitsType', 'ccode', 'itemtype|ccode', 'When using branch transfer limits, choose whether to limit by itemtype or collection code.', 'Choice');
239
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'BranchTransferLimitsType', 'ccode', 'itemtype|ccode', 'When using branch transfer limits, choose whether to limit by itemtype or collection code.', 'Choice');
(-)a/installer/data/mysql/updatedatabase.pl (+15 lines)
Lines 5199-5204 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5199
}
5199
}
5200
5200
5201
5201
5202
5203
5204
$DBversion = "3.07.00.XXX";
5205
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5206
    $dbh->do("UPDATE systempreferences SET
5207
                variable = 'OPACShowHoldQueueDetails',
5208
                value = CASE value WHEN '1' THEN 'priority' ELSE 'none' END,
5209
                options = 'none|priority|holds|holds_priority',
5210
                explanation = 'Show holds details in OPAC',
5211
                type = 'Choice'
5212
              WHERE variable = 'OPACDisplayRequestPriority'");
5213
    print "Upgrade to $DBversion done (Changed system preference OPACDisplayRequestPriority -> OPACShowHoldQueueDetails)\n";
5214
    SetVersion($DBversion);
5215
}
5216
5202
=head1 FUNCTIONS
5217
=head1 FUNCTIONS
5203
5218
5204
=head2 TableExists($table)
5219
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-4 / +6 lines)
Lines 79-89 OPAC: Link Here
79
                  no: "Don't include"
79
                  no: "Don't include"
80
            - "COinS / OpenURL / Z39.88 in OPAC search results.  <br/>Warning: Enabling this feature will slow OPAC search response times."
80
            - "COinS / OpenURL / Z39.88 in OPAC search results.  <br/>Warning: Enabling this feature will slow OPAC search response times."
81
        -
81
        -
82
            - pref: OPACDisplayRequestPriority
82
            - pref: OPACShowHoldQueueDetails
83
              choices:
83
              choices:
84
                  yes: Show
84
                  none: "Don't show any hold details"
85
                  no: "Don't show"
85
                  priority: "Show priority level"
86
            - patrons the priority level of their holds in the OPAC.
86
                  holds: "Show holds"
87
                  holds_priority: "Show holds and their priority level"
88
            - to patrons in the OPAC.
87
        -
89
        -
88
            - pref: OPACShowCheckoutName
90
            - pref: OPACShowCheckoutName
89
              default: 0
91
              default: 0
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (+31 lines)
Lines 718-723 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
718
            <th id="item_status">Status</th>
718
            <th id="item_status">Status</th>
719
            [% IF ( itemdata_itemnotes ) %]<th id="item_notes">Notes</th>[% END %]
719
            [% IF ( itemdata_itemnotes ) %]<th id="item_notes">Notes</th>[% END %]
720
            <th id="item_datedue">Date due</th>
720
            <th id="item_datedue">Date due</th>
721
        [% IF holds_count.defined %]
722
            <th>Item holds</th>
723
        [% ELSIF show_priority %]
724
            <th>Item hold queue priority</th>
725
        [% END %]
721
        </tr></thead>
726
        </tr></thead>
722
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
727
	    <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
723
	    <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 %]
728
	    <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 742-751 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
742
		<td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
747
		<td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
743
		[% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %]
748
		[% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %]
744
		<td>[% ITEM_RESULT.datedue | $KohaDates %]</td>
749
		<td>[% ITEM_RESULT.datedue | $KohaDates %]</td>
750
        [% IF holds_count.defined || show_priority %]
751
		<td>
752
            [% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %]
753
            [% IF ITEM_RESULT.priority %]
754
                [% IF holds_count.defined %]
755
                (priority [% ITEM_RESULT.priority %])
756
                [% ELSE %]
757
                [% ITEM_RESULT.priority %]
758
                [% END %]
759
            [% END %]
760
                </td>
761
        [% END %]
745
	    </tr>
762
	    </tr>
746
	    [% END %]</tbody>
763
	    [% END %]</tbody>
747
	</table>
764
	</table>
748
    [% END %]
765
    [% END %]
766
    [% IF holds_count.defined || priority %]
767
	<div id="bib_holds">
768
        [% IF holds_count.defined %]
769
        Total holds: [% holds_count %]
770
        [% END %]
771
        [% IF priority %]
772
            [% IF holds_count.defined %]
773
            (priority [% priority %])
774
            [% ELSE %]
775
            Overall queue priority: [% priority %]
776
            [% END %]
777
        [% END %]
778
        </div>
779
    [% END %]
749
[% ELSE %]
780
[% ELSE %]
750
    [% IF ( ALTERNATEHOLDINGS ) %]
781
    [% IF ( ALTERNATEHOLDINGS ) %]
751
    [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
782
    [% FOREACH ALTERNATEHOLDING IN ALTERNATEHOLDINGS %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt (-13 / +21 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 && showpriority %]
246
                  <th>Holds and priority</th>
247
                  [% ELSIF showholds %]
248
                  <th>Holds</th>
249
                  [% ELSIF showpriority %]
246
                  <th>Priority</th>
250
                  <th>Priority</th>
247
                  [% END %]
251
                  [% END %]
248
		  [% IF ( reserve_in_future ) %]
252
		  [% IF ( reserve_in_future ) %]
Lines 297-315 Link Here
297
                        [% END %]
301
                        [% END %]
298
302
299
                    </td>
303
                    </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 ) %]
304
                    [% IF ( bibitemloo.holdable ) %]
307
                    [% IF ( showpriority ) %]
305
		    <!-- HOLDABLE -->
308
                    <td>
306
                        [% UNLESS ( item_level_itypes ) %]
309
                    [% bibitemloo.rank %] out of [% bibitemloo.reservecount %]
307
                        <td>
310
                    </td>[% END %][% END %]
308
                            [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
311
		    [% IF ( reserve_in_future ) %]
309
                            [% bibitemloo.description %]
312
		    [% IF ( bibitemloo.holdable ) %]<td>
310
                        </td>
311
                        [% END %]
312
                        [% IF showholds || showpriority %]
313
                        <td>
314
                        [% IF showpriority %] [% bibitemloo.rank %] [% END ]
315
                        [% IF showholds && showpriority %] out of [% END %]
316
                        [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
317
                        </td>
318
                        [% END %]
319
		        [% IF ( reserve_in_future ) %]
320
                        <td>
313
              <input name="reserve_date_[% bibitemloo.biblionumber %]" id="reserve_date_[% bibitemloo.biblionumber %]" size="10">
321
              <input name="reserve_date_[% bibitemloo.biblionumber %]" id="reserve_date_[% bibitemloo.biblionumber %]" size="10">
314
              <script language="JavaScript" type="text/javascript">
322
              <script language="JavaScript" type="text/javascript">
315
              //<![CDATA[
323
              //<![CDATA[
(-)a/opac/opac-detail.pl (+24 lines)
Lines 486-495 if ($dat->{'count'} >= 50 && !$viewallitems) { Link Here
486
486
487
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
487
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
488
488
489
my (%item_reserves, %priority);
490
my ($show_holds_count, $show_priority);
491
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
492
    m/holds/o and $show_holds_count = 1;
493
    m/priority/ and $show_priority = 1;
494
}
495
my $has_hold;
496
if ( $show_holds_count || $show_priority) {
497
    my ($reserve_count,$reserves) = GetReservesFromBiblionumber($biblionumber);
498
    $template->param( holds_count  => $reserve_count ) if $show_holds_count;
499
    foreach (@$reserves) {
500
        $item_reserves{ $_->{itemnumber} }++ if $_->{itemnumber};
501
        if ($show_priority && $_->{borrowernumber} == $borrowernumber) {
502
            $has_hold = 1;
503
            $_->{itemnumber} 
504
                ? ($priority{ $_->{itemnumber} } = $_->{priority})
505
                : ($template->param( priority => $_->{priority} ));
506
        }
507
    }
508
}
509
$template->param( show_priority => $has_hold ) ;
510
489
my $norequests = 1;
511
my $norequests = 1;
490
my $branches = GetBranches();
512
my $branches = GetBranches();
491
my %itemfields;
513
my %itemfields;
492
for my $itm (@items) {
514
for my $itm (@items) {
515
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
516
    $itm->{priority} = $priority{ $itm->{itemnumber} };
493
    $norequests = 0
517
    $norequests = 0
494
       if ( (not $itm->{'wthdrawn'} )
518
       if ( (not $itm->{'wthdrawn'} )
495
         && (not $itm->{'itemlost'} )
519
         && (not $itm->{'itemlost'} )
(-)a/opac/opac-reserve.pl (-27 / +33 lines)
Lines 47-53 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
47
        debug           => 1,
47
        debug           => 1,
48
    }
48
    }
49
);
49
);
50
my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0;
50
51
my ($show_holds_count, $show_priority);
52
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
53
    m/holds/o and $show_holds_count = 1;
54
    m/priority/ and $show_priority = 1;
55
}
56
51
sub get_out ($$$) {
57
sub get_out ($$$) {
52
	output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output;
58
	output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output;
53
	exit;
59
	exit;
Lines 113-124 $template->param( choose_branch => $OPACChooseBranch); Link Here
113
#
119
#
114
#
120
#
115
121
116
# Hash of biblionumber to biblio/biblioitems record.
122
my %biblioDataHash; # Hash of biblionumber to biblio/biblioitems record.
117
my %biblioDataHash;
123
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) {
124
foreach my $biblioNumber (@biblionumbers) {
123
125
124
    my $biblioData = GetBiblioData($biblioNumber);
126
    my $biblioData = GetBiblioData($biblioNumber);
Lines 128-160 foreach my $biblioNumber (@biblionumbers) { Link Here
128
130
129
    my $marcrecord= GetMarcBiblio($biblioNumber);
131
    my $marcrecord= GetMarcBiblio($biblioNumber);
130
132
131
	# flag indicating existence of at least one item linked via a host record
133
    # flag indicating existence of at least one item linked via a host record
132
	my $hostitemsflag;
134
    my $hostitemsflag;
133
	# adding items linked via host biblios
135
    # adding items linked via host biblios
134
	my @hostitemInfos = GetHostItemsInfo($marcrecord);
136
    my @hostitemInfos = GetHostItemsInfo($marcrecord);
135
	if (@hostitemInfos){
137
    if (@hostitemInfos){
136
		$hostitemsflag =1;
138
        $hostitemsflag =1;
137
	        push (@itemInfos,@hostitemInfos);
139
        push (@itemInfos,@hostitemInfos);
138
	}
140
    }
139
140
141
141
142
    $biblioData->{itemInfos} = \@itemInfos;
142
    $biblioData->{itemInfos} = \@itemInfos;
143
    foreach my $itemInfo (@itemInfos) {
143
    foreach my $itemInfo (@itemInfos) {
144
        $itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo;
144
        $itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo;
145
    }
145
    }
146
146
147
    # Compute the priority rank.
147
    if ($show_holds_count) {
148
    my ( $rank, $reserves ) = GetReservesFromBiblionumber($biblioNumber,1);
148
        # Compute the priority rank.
149
    $biblioData->{reservecount} = $rank;
149
        my ( $rank, $reserves ) = GetReservesFromBiblionumber($biblioNumber,1);
150
    foreach my $res (@$reserves) {
150
        $biblioData->{reservecount} = 1; # new reserve
151
        my $found = $res->{'found'};
151
        foreach my $res (@$reserves) {
152
        if ( $found && ($found eq 'W') ) {
152
            my $found = $res->{'found'};
153
            $rank--;
153
            if ( $found && ($found eq 'W') ) {
154
                $rank--;
155
            }
156
            else {
157
                $biblioData->{reservecount}++;
158
            }
154
        }
159
        }
160
        $rank++;
161
        $biblioData->{rank} = $rank;
155
    }
162
    }
156
    $rank++;
157
    $biblioData->{rank} = $rank;
158
}
163
}
159
164
160
#
165
#
Lines 528-534 $template->param(itemtable_colspan => $itemTableColspan); Link Here
528
533
529
# display infos
534
# display infos
530
$template->param(bibitemloop => $biblioLoop);
535
$template->param(bibitemloop => $biblioLoop);
531
$template->param( showpriority=>1 ) if $OPACDisplayRequestPriority;
536
$template->param( showholds=>$show_holds_count);
537
$template->param( showpriority=>$show_priority);
532
# can set reserve date in future
538
# can set reserve date in future
533
if (
539
if (
534
    C4::Context->preference( 'AllowHoldDateInFuture' ) &&
540
    C4::Context->preference( 'AllowHoldDateInFuture' ) &&
(-)a/opac/opac-user.pl (-5 / +7 lines)
Lines 65-71 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
65
    }
65
    }
66
);
66
);
67
67
68
my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0;
68
my $show_priority;
69
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
70
    m/priority/ and $show_priority = 1;
71
}
69
my $patronupdate = $query->param('patronupdate');
72
my $patronupdate = $query->param('patronupdate');
70
my $canrenew = 1;
73
my $canrenew = 1;
71
74
Lines 260-267 foreach my $res (@reserves) { Link Here
260
    $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
263
    $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'};
261
    my $biblioData = GetBiblioData($res->{'biblionumber'});
264
    my $biblioData = GetBiblioData($res->{'biblionumber'});
262
    $res->{'reserves_title'} = $biblioData->{'title'};
265
    $res->{'reserves_title'} = $biblioData->{'title'};
263
    if ($OPACDisplayRequestPriority) {
266
    if ($show_priority) {
264
        $res->{'priority'} = '' if $res->{'priority'} eq '0';
267
        $res->{'priority'} ||= '';
265
    }
268
    }
266
    $res->{'suspend_until'} = C4::Dates->new( $res->{'suspend_until'}, "iso")->output("syspref") if ( $res->{'suspend_until'} );
269
    $res->{'suspend_until'} = C4::Dates->new( $res->{'suspend_until'}, "iso")->output("syspref") if ( $res->{'suspend_until'} );
267
}
270
}
Lines 271-277 foreach my $res (@reserves) { Link Here
271
274
272
$template->param( RESERVES       => \@reserves );
275
$template->param( RESERVES       => \@reserves );
273
$template->param( reserves_count => $#reserves+1 );
276
$template->param( reserves_count => $#reserves+1 );
274
$template->param( showpriority=>1 ) if $OPACDisplayRequestPriority;
277
$template->param( showpriority=>$show_priority );
275
278
276
my @waiting;
279
my @waiting;
277
my $wcount = 0;
280
my $wcount = 0;
278
- 

Return to bug 7398