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

(-)a/C4/Reserves.pm (-14 / +11 lines)
Lines 1229-1235 sub _OnShelfHoldsAllowed { Link Here
1229
1229
1230
=head2 AlterPriority
1230
=head2 AlterPriority
1231
1231
1232
  AlterPriority( $where, $reserve_id );
1232
  AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority );
1233
1233
1234
This function changes a reserve's priority up, down, to the top, or to the bottom.
1234
This function changes a reserve's priority up, down, to the top, or to the bottom.
1235
Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was placed
1235
Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was placed
Lines 1237-1243 Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was Link Here
1237
=cut
1237
=cut
1238
1238
1239
sub AlterPriority {
1239
sub AlterPriority {
1240
    my ( $where, $reserve_id ) = @_;
1240
    my ( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ) = @_;
1241
1241
1242
    my $hold = Koha::Holds->find( $reserve_id );
1242
    my $hold = Koha::Holds->find( $reserve_id );
1243
    return unless $hold;
1243
    return unless $hold;
Lines 1247-1267 sub AlterPriority { Link Here
1247
        return;
1247
        return;
1248
    }
1248
    }
1249
1249
1250
    if ( $where eq 'up' || $where eq 'down' ) {
1250
    if ( $where eq 'up' ) {
1251
1251
      return unless $prev_priority;
1252
      my $priority = $hold->priority;
1252
      _FixPriority({ reserve_id => $reserve_id, rank => $prev_priority })
1253
      $priority = $where eq 'up' ? $priority - 1 : $priority + 1;
1253
    } elsif ( $where eq 'down' ) {
1254
      _FixPriority({ reserve_id => $reserve_id, rank => $priority })
1254
      return unless $next_priority;
1255
1255
      _FixPriority({ reserve_id => $reserve_id, rank => $next_priority })
1256
    } elsif ( $where eq 'top' ) {
1256
    } elsif ( $where eq 'top' ) {
1257
1257
      _FixPriority({ reserve_id => $reserve_id, rank => $first_priority })
1258
      _FixPriority({ reserve_id => $reserve_id, rank => '1' })
1259
1260
    } elsif ( $where eq 'bottom' ) {
1258
    } elsif ( $where eq 'bottom' ) {
1261
1259
      _FixPriority({ reserve_id => $reserve_id, rank => $last_priority });
1262
      _FixPriority({ reserve_id => $reserve_id, rank => '999999' });
1263
1264
    }
1260
    }
1261
1265
    # FIXME Should return the new priority
1262
    # FIXME Should return the new priority
1266
}
1263
}
1267
1264
(-)a/installer/data/mysql/atomicupdate/split_holds_queue.sql (+3 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('HoldsSplitQueue','nothing','nothing|branch|itemtype|branch_itemtype','In the staff client, split the holds view by the given criteria','Choice'),
3
('HoldsSplitQueueNumbering', 'actual', 'actual|virtual', 'If the holds queue is split, decide if the acual priorities should be displayed', 'Choice');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 189-194 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
189
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
189
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
190
('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'),
190
('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'),
191
('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'),
191
('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'),
192
('HoldsSplitQueue','nothing','nothing|branch|itemtype|branch_itemtype','In the staff client, split the holds view by the given criteria','Choice'),
192
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
193
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
193
('HomeOrHoldingBranch','holdingbranch','holdingbranch|homebranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','Choice'),
194
('HomeOrHoldingBranch','holdingbranch','holdingbranch|homebranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','Choice'),
194
('HouseboundModule',0,'','If ON, enable housebound module functionality.','YesNo'),
195
('HouseboundModule',0,'','If ON, enable housebound module functionality.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css (+8 lines)
Lines 360-365 fieldset { Link Here
360
    border-radius:5px;
360
    border-radius:5px;
361
}
361
}
362
362
363
fieldset.standard {
364
    background-color:#f4f8f9 !important;
365
}
366
367
fieldset.contrast {
368
    background-color:#F3F3F3 !important;
369
}
370
363
fieldset.lastchecked {
371
fieldset.lastchecked {
364
    margin-bottom : 0;
372
    margin-bottom : 0;
365
    border-bottom-width: 0;
373
    border-bottom-width: 0;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (+200 lines)
Line 0 Link Here
1
<table>
2
    <tr>
3
        [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
4
            <th>Priority</th>
5
            <th>&nbsp;</th>
6
        [% ELSE %]
7
            <th>Delete?</th>
8
        [% END %]
9
        <th>Patron</th>
10
        <th>Notes</th>
11
        <th>Date</th>
12
        <th>Expiration</th>
13
        <th>Pickup library</th>
14
        <th>Details</th>
15
        [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
16
            <th><img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Toggle set to lowest priority" /></th>
17
        [% END %]
18
        <th>&nbsp;</th>
19
        [% IF SuspendHoldsIntranet %]<th>&nbsp;</th><!-- Suspend Holds Column Header -->[% END %]
20
    </tr>
21
22
    [% FOREACH hold IN holds %]
23
        <tr>
24
            <td>
25
                <input type="hidden" name="reserve_id" value="[% hold.reserve_id %]" />
26
                <input type="hidden" name="borrowernumber" value="[% hold.borrowernumber %]" />
27
                <input type="hidden" name="biblionumber" value="[% hold.biblionumber %]" />
28
                <select name="rank-request">
29
                    [% IF ( hold.found ) %]
30
                        [% IF ( hold.intransit ) %]
31
                            <option value="T" selected="selected">In transit</option>
32
                        [% ELSE %]
33
                            <option value="W" selected="selected">Waiting</option>
34
                        [% END %]
35
                    [% END %]
36
37
                    [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
38
                        [% IF Koha.Preference('HoldsSplitQueueNumbering') == 'actual' %]
39
                            [% FOREACH optionloo IN hold.optionloop %]
40
                                [% IF ( optionloo.selected ) %]
41
                                    <option value="[% optionloo.num %]" selected="selected">[% optionloo.num %]</option>
42
                                [% ELSE %]
43
                                    <option value="[% optionloo.num %]">[% optionloo.num %]</option>
44
                                [% END %]
45
                            [% END %]
46
                        [% ELSE %]
47
                            [% FOREACH h IN holds %]
48
                                [% IF ( h.priority == hold.priority ) %]
49
                                    <option value="[% h.priority %]" selected="selected">[% loop.index + 1 %]</option>
50
                                [% ELSE %]
51
                                    <option value="[% h.priority %]">[% loop.index + 1 %]</option>
52
                                [% END %]
53
                            [% END %]
54
                        [% END %]
55
                    [% ELSIF !hold.found %]
56
                        <option value="[% hold.priority %]" selected="selected">[% hold.priority %]</option>
57
                    [% END %]
58
59
                    <option value="del">del</option>
60
                </select>
61
            </td>
62
63
            [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
64
                [% SET first_priority = holds.first.priority %]
65
                [% SET last_priority  = holds.last.priority %]
66
                [% SET prev_priority  = loop.prev.priority %]
67
                [% SET next_priority  = loop.next.priority %]
68
                [% holds.index %]
69
70
                <td style="white-space:nowrap;">
71
                    <a title="Move hold up" href="request.pl?action=move&amp;where=up&amp;first_priority=[% first_priority %]&amp;last_priority=[% last_priority %]&amp;prev_priority=[% prev_priority %]&amp;next_priority=[% next_priority %]&amp;borrowernumber=[% hold.borrowernumber %]&amp;biblionumber=[% hold.biblionumber %]&amp;reserve_id=[% hold.reserve_id %]&amp;date=[% hold.date %]">
72
                        <img src="[% interface %]/[% theme %]/img/go-up.png" alt="Go up" />
73
                    </a>
74
75
                    <a title="Move hold to top" href="request.pl?action=move&amp;where=top&amp;first_priority=[% first_priority %]&amp;last_priority=[% last_priority %]&amp;prev_priority=[% prev_priority %]&amp;next_priority=[% next_priority %]&amp;borrowernumber=[% hold.borrowernumber %]&amp;biblionumber=[% hold.biblionumber %]&amp;reserve_id=[% hold.reserve_id %]&amp;date=[% hold.date %]">
76
                        <img src="[% interface %]/[% theme %]/img/go-top.png" alt="Go top" />
77
                    </a>
78
79
                    <a title="Move hold to bottom" href="request.pl?action=move&amp;where=bottom&amp;first_priority=[% first_priority %]&amp;last_priority=[% last_priority %]&amp;prev_priority=[% prev_priority %]&amp;next_priority=[% next_priority %]&amp;borrowernumber=[% hold.borrowernumber %]&amp;biblionumber=[% hold.biblionumber %]&amp;reserve_id=[% hold.reserve_id %]&amp;date=[% hold.date %]">
80
                        <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Go bottom" />
81
                    </a>
82
83
                    <a title="Move hold down" href="request.pl?action=move&amp;where=down&amp;first_priority=[% first_priority %]&amp;last_priority=[% last_priority %]&amp;prev_priority=[% prev_priority %]&amp;next_priority=[% next_priority %]&amp;borrowernumber=[% hold.borrowernumber %]&amp;biblionumber=[% hold.biblionumber %]&amp;reserve_id=[% hold.reserve_id %]&amp;date=[% hold.date %]">
84
                        <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Go down" />
85
                    </a>
86
                </td>
87
            [% END %]
88
89
            <td>
90
                <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% hold.borrowernumber %]" >
91
                    [% IF ( hold.hidename ) %]
92
                        [% hold.cardnumber (hold.borrowernumber) %]
93
                    [% ELSE %]
94
                        [% hold.firstname %] [% hold.surname %]
95
                    [% END %]
96
                </a>
97
            </td>
98
99
            <td>[% hold.notes %]</td>
100
            <td>[% hold.date %]</td>
101
            <td>[% hold.expirationdate %]</td>
102
103
            <td>
104
                [% IF ( hold.found ) %]
105
                    [% IF ( hold.atdestination ) %]
106
                        [% IF ( hold.found ) %]
107
                            Item waiting at <b> [% hold.wbrname %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode %]" /> since [% hold.waiting_date | $KohaDates %]
108
                        [% ELSE %]
109
                            Waiting to be pulled <input type="hidden" name="pickup" value="[% hold.wbrcode %]" />
110
                        [% END %]
111
                    [% ELSE %]
112
                        Item being transferred to <b> [% hold.wbrname %]</b> <input type="hidden" name="pickup" value="[% hold.wbrcode %]" />
113
                    [% END %]
114
                [% ELSE %]
115
                    [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
116
                        [% Branches.GetName(hold.branchcode) %] <input type="hidden" name="pickup" value="[% hold.branchcode %]" />
117
                    [% ELSE %]
118
                        <select name="pickup">
119
                            [% PROCESS options_for_libraries libraries => Branches.all( selected => hold.branchcode ) %]
120
                        </select>
121
                    [% END %]
122
                [% END %]
123
            </td>
124
125
            <td>
126
                [% IF ( hold.found ) %]
127
                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber %]">
128
                        [% IF ( hold.barcodenumber ) %]
129
                            [% hold.barcodenumber %]
130
                            <input type="hidden" name="itemnumber" value="[% hold.itemnumber %]" />
131
                        [% ELSE %]
132
                            No barcode
133
                        [% END %]
134
                    </a>
135
                [% ELSE %]
136
                    [% IF ( hold.item_level_hold ) %]
137
                        <i>
138
                            Only item
139
                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% hold.biblionumber %]">
140
                                [% IF ( hold.barcodenumber ) %]
141
                                    [% hold.barcodenumber %]
142
                                    <input type="hidden" name="itemnumber" value="[% hold.itemnumber %]" />
143
                                [% ELSE %]
144
                                    No barcode
145
                                [% END %]
146
                            </a>
147
                        </i>
148
                    [% ELSE %]
149
                        [% IF hold.itemtype %]
150
                            <i>Next available [% ItemTypes.GetDescription( hold.itemtype ) %] item</i>
151
                        [% ELSE %]
152
                            <i>Next available</i>
153
                        [% END %]
154
155
                        <input type="hidden" name="itemnumber" value="" />
156
                    [% END %]
157
                [% END %]
158
            </td>
159
160
            [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
161
                <td>
162
                    <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&amp;borrowernumber=[% hold.borrowernumber %]&amp;biblionumber=[% hold.biblionumber %]&amp;reserve_id=[% hold.reserve_id %]&amp;date=[% hold.date %]">
163
                        [% IF ( hold.lowestPriority ) %]
164
                            <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Unset lowest priority" />
165
                        [% ELSE %]
166
                            <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Set to lowest priority" />
167
                        [% END %]
168
                    </a>
169
                </td>
170
            [% END %]
171
172
            <td>
173
                <a class="cancel-hold" title="Cancel hold" href="request.pl?action=cancel&amp;borrowernumber=[% hold.borrowernumber %]&amp;biblionumber=[% hold.biblionumber %]&amp;reserve_id=[% hold.reserve_id %]&amp;date=[% hold.date %]">
174
                    <img src="[% interface %]/[% theme %]/img/x.png" alt="Cancel" />
175
                </a>
176
            </td>
177
178
            [% IF SuspendHoldsIntranet %]
179
                <td>
180
                    [% UNLESS ( hold.found ) %]
181
                        <input type="button" value="[% IF ( hold.suspend ) %]Unsuspend[% ELSE %]Suspend[% END %]" onclick="window.location.href='request.pl?action=toggleSuspend&amp;reserve_id=[% hold.reserve_id %]&amp;borrowernumber=[% hold.borrowernumber %]&amp;biblionumber=[% hold.biblionumber %]&amp;date=[% hold.date %]&amp;suspend_until=' + $('#suspend_until_[% hold.reserve_id %]').val()" />
182
183
                        [% IF AutoResumeSuspendedHolds %]
184
                            <label for="suspend_until_[% hold.reserve_id %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
185
                            <input name="suspend_until" id="suspend_until_[% hold.reserve_id %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" />
186
                            <a href='#' onclick="document.getElementById('suspend_until_[% hold.reserve_id %]').value='';">Clear date</a>
187
                        [% ELSE %]
188
                            <input type="hidden" name="suspend_until" id="suspend_until_[% hold.reserve_id %]" value=""/>
189
                        [% END %]
190
191
                    [% ELSE %]
192
                        <input type="hidden" name="suspend_until" value="" />
193
                    [% END %]
194
                </td>
195
            [% END # IF SuspendHoldsIntranet %]
196
197
        </tr>
198
199
    [% END %]
200
</table>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+14 lines)
Lines 488-493 Circulation: Link Here
488
            - the restriction periods.
488
            - the restriction periods.
489
    Holds Policy:
489
    Holds Policy:
490
        -
490
        -
491
            - In the staff client, split the holds queue into separate tables by
492
            - pref: HoldsSplitQueue
493
              choices:
494
                  nothing: nothing
495
                  branch: "pickup library"
496
                  itemtype: "hold itemtype"
497
                  branch_itemtype: "pickup library & itemtype"
498
        -
499
            - If the holds queue is split, show librarians
500
            - pref: HoldsSplitQueueNumbering
501
              choices:
502
                  actual: "the actual priority, which may be out of order"
503
                  virtual: "'virtual' priorities, where each group is numbered separately"
504
        -
491
            - pref: AllowHoldItemTypeSelection
505
            - pref: AllowHoldItemTypeSelection
492
              choices:
506
              choices:
493
                  yes: Allow
507
                  yes: Allow
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-172 / +85 lines)
Lines 1-3 Link Here
1
[% USE Dumper %]
1
[% USE Koha %]
2
[% USE Koha %]
2
[% USE KohaDates %]
3
[% USE KohaDates %]
3
[% USE Branches %]
4
[% USE Branches %]
Lines 700-893 function checkMultiHold() { Link Here
700
701
701
                [% FOREACH biblioloo IN biblioloop %]
702
                [% FOREACH biblioloo IN biblioloop %]
702
                    [% IF ( biblioloo.reserveloop ) %]
703
                    [% IF ( biblioloo.reserveloop ) %]
703
                        <table>
704
                        [% IF ( multi_hold ) %]
704
                            [% IF ( multi_hold ) %]
705
                            <h3>
705
                                <caption><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]">[% biblioloo.title |html %]</a></caption>
706
                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">
706
                            [% END %]
707
                                    [% biblioloo.title | html %]
707
708
                                </a>
708
                            <tr>
709
                            </h3>
709
                                [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
710
                        [% END %]
710
                                    <th>Priority</th>
711
                                    <th>&nbsp;</th>
712
                                [% ELSE %]
713
                                    <th>Delete?</th>
714
                                [% END %]
715
                                <th>Patron</th>
716
                                <th>Notes</th>
717
                                <th>Date</th>
718
                                <th>Expiration</th>
719
                                <th>Pickup library</th>
720
                                <th>Details</th>
721
                                [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
722
                                    <th><img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Toggle set to lowest priority" /></th>
723
                                [% END %]
724
                                <th>&nbsp;</th>
725
                                [% IF SuspendHoldsIntranet %]<th>&nbsp;</th><!-- Suspend Holds Column Header -->[% END %]
726
                            </tr>
727
728
                            [% FOREACH reserveloo IN biblioloo.reserveloop %]
729
                                <tr>
730
                                    <td>
731
                                        <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" />
732
                                        <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernumber %]" />
733
                                        <input type="hidden" name="biblionumber" value="[% reserveloo.biblionumber %]" />
734
                                        <select name="rank-request">
735
                                            [% IF ( reserveloo.found ) %]
736
                                                [% IF ( reserveloo.intransit ) %]
737
                                                    <option value="T" selected="selected">In transit</option>
738
                                                [% ELSE %]
739
                                                    <option value="W" selected="selected">Waiting</option>
740
                                                [% END %]
741
                                            [% END %]
742
743
                                            [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
744
                                                [% FOREACH optionloo IN reserveloo.optionloop %]
745
                                                    [% IF ( optionloo.selected ) %]
746
                                                        <option value="[% optionloo.num %]" selected="selected">[% optionloo.num %]</option>
747
                                                    [% ELSE %]
748
                                                        <option value="[% optionloo.num %]">[% optionloo.num %]</option>
749
                                                    [% END %]
750
                                                [% END %]
751
                                            [% ELSIF !reserveloo.found %]
752
                                                <option value="[% reserveloo.priority %]" selected="selected">[% reserveloo.priority %]</option>
753
                                            [% END %]
754
711
755
                                            <option value="del">del</option>
712
                        [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
756
                                        </select>
713
                            [% SET branchcodes = [] %]
757
                                    </td>
758
714
759
                                    [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
715
                            [% FOREACH h IN biblioloo.reserveloop %]
760
                                        <td style="white-space:nowrap;">
716
                                [% branchcodes.push( h.branchcode ) %]
761
                                            <a title="Move hold up" href="request.pl?action=move&amp;where=up&amp;borrowernumber=[% reserveloo.borrowernumber %]&amp;biblionumber=[% reserveloo.biblionumber %]&amp;reserve_id=[% reserveloo.reserve_id %]&amp;date=[% reserveloo.date %]">
717
                            [% END %]
762
                                                <img src="[% interface %]/[% theme %]/img/go-up.png" alt="Go up" />
718
                            [% branchcodes = branchcodes.unique %]
763
                                            </a>
764
719
765
                                            <a title="Move hold to top" href="request.pl?action=move&amp;where=top&amp;borrowernumber=[% reserveloo.borrowernumber %]&amp;biblionumber=[% reserveloo.biblionumber %]&amp;reserve_id=[% reserveloo.reserve_id %]&amp;date=[% reserveloo.date %]">
720
                            [% FOREACH b IN branchcodes.sort %]
766
                                                <img src="[% interface %]/[% theme %]/img/go-top.png" alt="Go top" />
721
                                [% SET holds_by_branch = [] %]
767
                                            </a>
722
                                [% FOREACH h IN biblioloo.reserveloop %]
723
                                    [% IF h.branchcode == b %]
724
                                        [% holds_by_branch.push( h ) %]
725
                                    [% END %]
726
                                [% END %]
727
                                <fieldset>
728
                                    <legend>[% Branches.GetName( b ) %]</legend>
729
                                    [% INCLUDE holds_table.inc holds=holds_by_branch %]
730
                                </fieldset>
731
                            [% END %]
732
                        [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
733
                            [% SET itemtypes = [] %]
768
734
769
                                            <a title="Move hold to bottom" href="request.pl?action=move&amp;where=bottom&amp;borrowernumber=[% reserveloo.borrowernumber %]&amp;biblionumber=[% reserveloo.biblionumber %]&amp;reserve_id=[% reserveloo.reserve_id %]&amp;date=[% reserveloo.date %]">
735
                            [% FOREACH h IN biblioloo.reserveloop %]
770
                                                <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Go bottom" />
736
                                [% itemtypes.push( h.itemtype ) %]
771
                                            </a>
737
                            [% END %]
738
                            [% itemtypes = itemtypes.unique %]
772
739
773
                                            <a title="Move hold down" href="request.pl?action=move&amp;where=down&amp;borrowernumber=[% reserveloo.borrowernumber %]&amp;biblionumber=[% reserveloo.biblionumber %]&amp;reserve_id=[% reserveloo.reserve_id %]&amp;date=[% reserveloo.date %]">
740
                            [% FOREACH i IN itemtypes.sort %]
774
                                                <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Go down" />
741
                                [% SET holds_by_itemtype = [] %]
775
                                            </a>
742
                                [% FOREACH h IN biblioloo.reserveloop %]
776
                                        </td>
743
                                    [% IF h.itemtype == i %]
744
                                        [% holds_by_itemtype.push( h ) %]
777
                                    [% END %]
745
                                    [% END %]
746
                                [% END %]
778
747
779
                                    <td>
748
                                <fieldset>
780
                                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber %]" >
749
                                    [% IF i %]
781
                                            [% IF ( reserveloo.hidename ) %]
750
                                        <legend>[% ItemTypes.GetDescription( i ) %]</legend>
782
                                                [% reserveloo.cardnumber (reserveloo.borrowernumber) %]
751
                                    [% ELSE %]
783
                                            [% ELSE %]
752
                                        <legend>Any item type</legend>
784
                                                [% reserveloo.firstname %] [% reserveloo.surname %]
753
                                    [% END %]
785
                                            [% END %]
754
                                    [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
786
                                        </a>
755
                                </fieldset>
787
                                    </td>
756
                            [% END %]
788
757
                        [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
789
                                    <td>[% reserveloo.notes %]</td>
758
                            [% SET branchcodes = [] %]
790
                                    <td>[% reserveloo.date %]</td>
791
                                    <td>[% reserveloo.expirationdate %]</td>
792
793
                                    <td>
794
                                        [% IF ( reserveloo.found ) %]
795
                                            [% IF ( reserveloo.atdestination ) %]
796
                                                [% IF ( reserveloo.found ) %]
797
                                                    Item waiting at <b> [% reserveloo.wbrname %]</b> <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" /> since [% reserveloo.waiting_date | $KohaDates %]
798
                                                [% ELSE %]
799
                                                    Waiting to be pulled <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" />
800
                                                [% END %]
801
                                            [% ELSE %]
802
                                                Item being transferred to <b> [% reserveloo.wbrname %]</b> <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" />
803
                                            [% END %]
804
                                        [% ELSE %]
805
                                            [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
806
                                                [% Branches.GetName(reserveloo.branchcode) %] <input type="hidden" name="pickup" value="[% reserveloo.branchcode %]" />
807
                                            [% ELSE %]
808
                                                <select name="pickup">
809
                                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => reserveloo.branchcode ) %]
810
                                                </select>
811
                                            [% END %]
812
                                        [% END %]
813
                                    </td>
814
815
                                    <td>
816
                                        [% IF ( reserveloo.found ) %]
817
                                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]">
818
                                                [% IF ( reserveloo.barcodenumber ) %]
819
                                                    [% reserveloo.barcodenumber %]
820
                                                    <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" />
821
                                                [% ELSE %]
822
                                                    No barcode
823
                                                [% END %]
824
                                            </a>
825
                                        [% ELSE %]
826
                                            [% IF ( reserveloo.item_level_hold ) %]
827
                                                <i>
828
                                                    Only item
829
                                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]">
830
                                                        [% IF ( reserveloo.barcodenumber ) %]
831
                                                            [% reserveloo.barcodenumber %]
832
                                                            <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" />
833
                                                        [% ELSE %]
834
                                                            No barcode
835
                                                        [% END %]
836
                                                    </a>
837
                                                </i>
838
                                            [% ELSE %]
839
                                                [% IF reserveloo.itemtype %]
840
                                                    <i>Next available [% ItemTypes.GetDescription( reserveloo.itemtype ) %] item</i>
841
                                                [% ELSE %]
842
                                                    <i>Next available</i>
843
                                                [% END %]
844
759
845
                                                <input type="hidden" name="itemnumber" value="" />
760
                            [% FOREACH h IN biblioloo.reserveloop %]
846
                                            [% END %]
761
                                [% branchcodes.push( h.branchcode ) %]
762
                            [% END %]
763
                            [% branchcodes = branchcodes.unique %]
764
765
                            [% FOREACH b IN branchcodes.sort %]
766
                                <fieldset class="contrast">
767
                                    <legend>[% Branches.GetName( b ) %]</legend>
768
                                    [% SET holds_by_branch = [] %]
769
                                    [% FOREACH h IN biblioloo.reserveloop %]
770
                                        [% IF h.branchcode == b %]
771
                                            [% holds_by_branch.push( h ) %]
847
                                        [% END %]
772
                                        [% END %]
848
                                    </td>
849
850
                                    [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
851
                                        <td>
852
                                            <a title="Toggle lowest priority" href="request.pl?action=setLowestPriority&amp;borrowernumber=[% reserveloo.borrowernumber %]&amp;biblionumber=[% reserveloo.biblionumber %]&amp;reserve_id=[% reserveloo.reserve_id %]&amp;date=[% reserveloo.date %]">
853
                                                [% IF ( reserveloo.lowestPriority ) %]
854
                                                    <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Unset lowest priority" />
855
                                                [% ELSE %]
856
                                                    <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Set to lowest priority" />
857
                                                [% END %]
858
                                            </a>
859
                                        </td>
860
                                    [% END %]
773
                                    [% END %]
861
774
862
                                    <td>
775
                                    [% SET itemtypes = [] %]
863
                                        <a class="cancel-hold" title="Cancel hold" href="request.pl?action=cancel&amp;borrowernumber=[% reserveloo.borrowernumber %]&amp;biblionumber=[% reserveloo.biblionumber %]&amp;reserve_id=[% reserveloo.reserve_id %]&amp;date=[% reserveloo.date %]">
776
                                    [% FOREACH h IN holds_by_branch %]
864
                                            <img src="[% interface %]/[% theme %]/img/x.png" alt="Cancel" />
777
                                        [% itemtypes.push( h.itemtype ) %]
865
                                        </a>
778
                                    [% END %]
866
                                    </td>
779
                                    [% itemtypes = itemtypes.unique %]
867
868
                                    [% IF SuspendHoldsIntranet %]
869
                                        <td>
870
                                            [% UNLESS ( reserveloo.found ) %]
871
                                                <input type="button" value="[% IF ( reserveloo.suspend ) %]Unsuspend[% ELSE %]Suspend[% END %]" onclick="window.location.href='request.pl?action=toggleSuspend&amp;reserve_id=[% reserveloo.reserve_id %]&amp;borrowernumber=[% reserveloo.borrowernumber %]&amp;biblionumber=[% reserveloo.biblionumber %]&amp;date=[% reserveloo.date %]&amp;suspend_until=' + $('#suspend_until_[% reserveloo.reserve_id %]').val()" />
872
873
                                                [% IF AutoResumeSuspendedHolds %]
874
                                                    <label for="suspend_until_[% reserveloo.reserve_id %]">[% IF ( reserveloo.suspend ) %] on [% ELSE %] until [% END %]</label>
875
                                                    <input name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" size="10" value="[% reserveloo.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" />
876
                                                    <a href='#' onclick="document.getElementById('suspend_until_[% reserveloo.reserve_id %]').value='';">Clear date</a>
877
                                                [% ELSE %]
878
                                                    <input type="hidden" name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" value=""/>
879
                                                [% END %]
880
780
781
                                    [% FOREACH i IN itemtypes.sort %]
782
                                        <fieldset class="standard">
783
                                            [% IF i %]
784
                                                <legend>[% ItemTypes.GetDescription( i ) %]</legend>
881
                                            [% ELSE %]
785
                                            [% ELSE %]
882
                                                <input type="hidden" name="suspend_until" value="" />
786
                                                <legend>Any item type</legend>
883
                                            [% END %]
787
                                            [% END %]
884
                                        </td>
885
                                    [% END # IF SuspendHoldsIntranet %]
886
788
887
                                </tr>
789
                                            [% SET holds_by_itemtype = [] %]
790
                                            [% FOREACH h IN holds_by_branch %]
791
                                                [% IF h.itemtype == i %]
792
                                                    [% holds_by_itemtype.push( h ) %]
793
                                                [% END %]
794
                                            [% END %]
795
                                            [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
796
                                        </fieldset>
797
                                    [% END %]
798
                                </fieldset>
799
                            [% END %]
800
                        [% ELSE %]
801
                            [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
802
                        [% END %]
888
803
889
                            [% END %] <!-- existing reserveloop -->
890
                        </table>
891
                    [% END %]<!-- /reserveloop -->
804
                    [% END %]<!-- /reserveloop -->
892
                [% END %]<!-- /biblioloop -->
805
                [% END %]<!-- /biblioloop -->
893
806
(-)a/reserve/request.pl (-3 / +7 lines)
Lines 86-94 my $action = $input->param('action'); Link Here
86
$action ||= q{};
86
$action ||= q{};
87
87
88
if ( $action eq 'move' ) {
88
if ( $action eq 'move' ) {
89
  my $where = $input->param('where');
89
  my $where          = $input->param('where');
90
  my $reserve_id = $input->param('reserve_id');
90
  my $reserve_id     = $input->param('reserve_id');
91
  AlterPriority( $where, $reserve_id );
91
  my $prev_priority  = $input->param('prev_priority');
92
  my $next_priority  = $input->param('next_priority');
93
  my $first_priority = $input->param('first_priority');
94
  my $last_priority  = $input->param('last_priority');
95
  AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority );
92
} elsif ( $action eq 'cancel' ) {
96
} elsif ( $action eq 'cancel' ) {
93
  my $reserve_id = $input->param('reserve_id');
97
  my $reserve_id = $input->param('reserve_id');
94
  my $hold = Koha::Holds->find( $reserve_id );
98
  my $hold = Koha::Holds->find( $reserve_id );
(-)a/t/db_dependent/Holds.t (-5 / +4 lines)
Lines 201-219 is( $holds->next->itemnumber, $itemnumber, "Test ModReserveMinusPriority()" ); Link Here
201
201
202
$holds = $biblio->holds;
202
$holds = $biblio->holds;
203
$hold = $holds->next;
203
$hold = $holds->next;
204
AlterPriority( 'top', $hold->reserve_id );
204
AlterPriority( 'top', $hold->reserve_id, undef, 2, 1, 6 );
205
$hold = Koha::Holds->find( $reserveid );
205
$hold = Koha::Holds->find( $reserveid );
206
is( $hold->priority, '1', "Test AlterPriority(), move to top" );
206
is( $hold->priority, '1', "Test AlterPriority(), move to top" );
207
207
208
AlterPriority( 'down', $hold->reserve_id );
208
AlterPriority( 'down', $hold->reserve_id, undef, 2, 1, 6 );
209
$hold = Koha::Holds->find( $reserveid );
209
$hold = Koha::Holds->find( $reserveid );
210
is( $hold->priority, '2', "Test AlterPriority(), move down" );
210
is( $hold->priority, '2', "Test AlterPriority(), move down" );
211
211
212
AlterPriority( 'up', $hold->reserve_id );
212
AlterPriority( 'up', $hold->reserve_id, 1, 3, 1, 6 );
213
$hold = Koha::Holds->find( $reserveid );
213
$hold = Koha::Holds->find( $reserveid );
214
is( $hold->priority, '1', "Test AlterPriority(), move up" );
214
is( $hold->priority, '1', "Test AlterPriority(), move up" );
215
215
216
AlterPriority( 'bottom', $hold->reserve_id );
216
AlterPriority( 'bottom', $hold->reserve_id, undef, 2, 1, 6 );
217
$hold = Koha::Holds->find( $reserveid );
217
$hold = Koha::Holds->find( $reserveid );
218
is( $hold->priority, '6', "Test AlterPriority(), move to bottom" );
218
is( $hold->priority, '6', "Test AlterPriority(), move to bottom" );
219
219
220
- 

Return to bug 19469