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

(-)a/C4/Reserves.pm (-14 / +11 lines)
Lines 1177-1183 sub _get_itype { Link Here
1177
1177
1178
=head2 AlterPriority
1178
=head2 AlterPriority
1179
1179
1180
  AlterPriority( $where, $reserve_id );
1180
  AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority );
1181
1181
1182
This function changes a reserve's priority up, down, to the top, or to the bottom.
1182
This function changes a reserve's priority up, down, to the top, or to the bottom.
1183
Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was placed
1183
Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was placed
Lines 1185-1191 Input: $where is 'up', 'down', 'top' or 'bottom'. Biblionumber, Date reserve was Link Here
1185
=cut
1185
=cut
1186
1186
1187
sub AlterPriority {
1187
sub AlterPriority {
1188
    my ( $where, $reserve_id ) = @_;
1188
    my ( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ) = @_;
1189
1189
1190
    my $hold = Koha::Holds->find( $reserve_id );
1190
    my $hold = Koha::Holds->find( $reserve_id );
1191
    return unless $hold;
1191
    return unless $hold;
Lines 1195-1215 sub AlterPriority { Link Here
1195
        return;
1195
        return;
1196
    }
1196
    }
1197
1197
1198
    if ( $where eq 'up' || $where eq 'down' ) {
1198
    if ( $where eq 'up' ) {
1199
1199
      return unless $prev_priority;
1200
      my $priority = $hold->priority;
1200
      _FixPriority({ reserve_id => $reserve_id, rank => $prev_priority })
1201
      $priority = $where eq 'up' ? $priority - 1 : $priority + 1;
1201
    } elsif ( $where eq 'down' ) {
1202
      _FixPriority({ reserve_id => $reserve_id, rank => $priority })
1202
      return unless $next_priority;
1203
1203
      _FixPriority({ reserve_id => $reserve_id, rank => $next_priority })
1204
    } elsif ( $where eq 'top' ) {
1204
    } elsif ( $where eq 'top' ) {
1205
1205
      _FixPriority({ reserve_id => $reserve_id, rank => $first_priority })
1206
      _FixPriority({ reserve_id => $reserve_id, rank => '1' })
1207
1208
    } elsif ( $where eq 'bottom' ) {
1206
    } elsif ( $where eq 'bottom' ) {
1209
1207
      _FixPriority({ reserve_id => $reserve_id, rank => $last_priority });
1210
      _FixPriority({ reserve_id => $reserve_id, rank => '999999' });
1211
1212
    }
1208
    }
1209
1213
    # FIXME Should return the new priority
1210
    # FIXME Should return the new priority
1214
}
1211
}
1215
1212
(-)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 192-197 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
192
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
192
('HoldFeeMode','not_always','any_time_is_placed|not_always|any_time_is_collected','Set the hold fee mode','Choice'),
193
('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'),
193
('HoldsLog','0',NULL,'If ON, log create/cancel/suspend/resume actions on holds.','YesNo'),
194
('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'),
194
('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'),
195
('HoldsSplitQueue','nothing','nothing|branch|itemtype|branch_itemtype','In the staff client, split the holds view by the given criteria','Choice'),
195
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
196
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
196
('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'),
197
('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'),
197
('HouseboundModule',0,'','If ON, enable housebound module functionality.','YesNo'),
198
('HouseboundModule',0,'','If ON, enable housebound module functionality.','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css (+8 lines)
Lines 368-373 fieldset { Link Here
368
    border-radius:5px;
368
    border-radius:5px;
369
}
369
}
370
370
371
fieldset.standard {
372
    background-color:#f4f8f9 !important;
373
}
374
375
fieldset.contrast {
376
    background-color:#F3F3F3 !important;
377
}
378
371
fieldset.lastchecked {
379
fieldset.lastchecked {
372
    margin-bottom : 0;
380
    margin-bottom : 0;
373
    border-bottom-width: 0;
381
    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 506-511 Circulation: Link Here
506
                  no: "Don't cumulate"
506
                  no: "Don't cumulate"
507
            - the restriction periods.
507
            - the restriction periods.
508
    Holds Policy:
508
    Holds Policy:
509
        -
510
            - In the staff client, split the holds queue into separate tables by
511
            - pref: HoldsSplitQueue
512
              choices:
513
                  nothing: nothing
514
                  branch: "pickup library"
515
                  itemtype: "hold itemtype"
516
                  branch_itemtype: "pickup library & itemtype"
517
        -
518
            - If the holds queue is split, show librarians
519
            - pref: HoldsSplitQueueNumbering
520
              choices:
521
                  actual: "the actual priority, which may be out of order"
522
                  virtual: "'virtual' priorities, where each group is numbered separately"
509
        -
523
        -
510
            - pref: AllowHoldItemTypeSelection
524
            - pref: AllowHoldItemTypeSelection
511
              choices:
525
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-172 / +85 lines)
Lines 1-4 Link Here
1
[% USE Asset %]
1
[% USE Asset %]
2
[% USE Dumper %]
2
[% USE Koha %]
3
[% USE Koha %]
3
[% USE KohaDates %]
4
[% USE KohaDates %]
4
[% USE Branches %]
5
[% USE Branches %]
Lines 727-920 function checkMultiHold() { Link Here
727
728
728
                [% FOREACH biblioloo IN biblioloop %]
729
                [% FOREACH biblioloo IN biblioloop %]
729
                    [% IF ( biblioloo.reserveloop ) %]
730
                    [% IF ( biblioloo.reserveloop ) %]
730
                        <table>
731
                        [% IF ( multi_hold ) %]
731
                            [% IF ( multi_hold ) %]
732
                            <h3>
732
                                <caption><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]">[% biblioloo.title |html %]</a></caption>
733
                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">
733
                            [% END %]
734
                                    [% biblioloo.title | html %]
734
735
                                </a>
735
                            <tr>
736
                            </h3>
736
                                [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
737
                        [% END %]
737
                                    <th>Priority</th>
738
                                    <th>&nbsp;</th>
739
                                [% ELSE %]
740
                                    <th>Delete?</th>
741
                                [% END %]
742
                                <th>Patron</th>
743
                                <th>Notes</th>
744
                                <th>Date</th>
745
                                <th>Expiration</th>
746
                                <th>Pickup library</th>
747
                                <th>Details</th>
748
                                [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
749
                                    <th><img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Toggle set to lowest priority" /></th>
750
                                [% END %]
751
                                <th>&nbsp;</th>
752
                                [% IF SuspendHoldsIntranet %]<th>&nbsp;</th><!-- Suspend Holds Column Header -->[% END %]
753
                            </tr>
754
755
                            [% FOREACH reserveloo IN biblioloo.reserveloop %]
756
                                <tr>
757
                                    <td>
758
                                        <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" />
759
                                        <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernumber %]" />
760
                                        <input type="hidden" name="biblionumber" value="[% reserveloo.biblionumber %]" />
761
                                        <select name="rank-request">
762
                                            [% IF ( reserveloo.found ) %]
763
                                                [% IF ( reserveloo.intransit ) %]
764
                                                    <option value="T" selected="selected">In transit</option>
765
                                                [% ELSE %]
766
                                                    <option value="W" selected="selected">Waiting</option>
767
                                                [% END %]
768
                                            [% END %]
769
770
                                            [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
771
                                                [% FOREACH optionloo IN reserveloo.optionloop %]
772
                                                    [% IF ( optionloo.selected ) %]
773
                                                        <option value="[% optionloo.num %]" selected="selected">[% optionloo.num %]</option>
774
                                                    [% ELSE %]
775
                                                        <option value="[% optionloo.num %]">[% optionloo.num %]</option>
776
                                                    [% END %]
777
                                                [% END %]
778
                                            [% ELSIF !reserveloo.found %]
779
                                                <option value="[% reserveloo.priority %]" selected="selected">[% reserveloo.priority %]</option>
780
                                            [% END %]
781
738
782
                                            <option value="del">del</option>
739
                        [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
783
                                        </select>
740
                            [% SET branchcodes = [] %]
784
                                    </td>
785
741
786
                                    [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
742
                            [% FOREACH h IN biblioloo.reserveloop %]
787
                                        <td style="white-space:nowrap;">
743
                                [% branchcodes.push( h.branchcode ) %]
788
                                            <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 %]">
744
                            [% END %]
789
                                                <img src="[% interface %]/[% theme %]/img/go-up.png" alt="Go up" />
745
                            [% branchcodes = branchcodes.unique %]
790
                                            </a>
791
746
792
                                            <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 %]">
747
                            [% FOREACH b IN branchcodes.sort %]
793
                                                <img src="[% interface %]/[% theme %]/img/go-top.png" alt="Go top" />
748
                                [% SET holds_by_branch = [] %]
794
                                            </a>
749
                                [% FOREACH h IN biblioloo.reserveloop %]
750
                                    [% IF h.branchcode == b %]
751
                                        [% holds_by_branch.push( h ) %]
752
                                    [% END %]
753
                                [% END %]
754
                                <fieldset>
755
                                    <legend>[% Branches.GetName( b ) %]</legend>
756
                                    [% INCLUDE holds_table.inc holds=holds_by_branch %]
757
                                </fieldset>
758
                            [% END %]
759
                        [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
760
                            [% SET itemtypes = [] %]
795
761
796
                                            <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 %]">
762
                            [% FOREACH h IN biblioloo.reserveloop %]
797
                                                <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Go bottom" />
763
                                [% itemtypes.push( h.itemtype ) %]
798
                                            </a>
764
                            [% END %]
765
                            [% itemtypes = itemtypes.unique %]
799
766
800
                                            <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 %]">
767
                            [% FOREACH i IN itemtypes.sort %]
801
                                                <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Go down" />
768
                                [% SET holds_by_itemtype = [] %]
802
                                            </a>
769
                                [% FOREACH h IN biblioloo.reserveloop %]
803
                                        </td>
770
                                    [% IF h.itemtype == i %]
771
                                        [% holds_by_itemtype.push( h ) %]
804
                                    [% END %]
772
                                    [% END %]
773
                                [% END %]
805
774
806
                                    <td>
775
                                <fieldset>
807
                                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber %]" >
776
                                    [% IF i %]
808
                                            [% IF ( reserveloo.hidename ) %]
777
                                        <legend>[% ItemTypes.GetDescription( i ) %]</legend>
809
                                                [% reserveloo.cardnumber (reserveloo.borrowernumber) %]
778
                                    [% ELSE %]
810
                                            [% ELSE %]
779
                                        <legend>Any item type</legend>
811
                                                [% reserveloo.firstname %] [% reserveloo.surname %]
780
                                    [% END %]
812
                                            [% END %]
781
                                    [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
813
                                        </a>
782
                                </fieldset>
814
                                    </td>
783
                            [% END %]
815
784
                        [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
816
                                    <td>[% reserveloo.notes %]</td>
785
                            [% SET branchcodes = [] %]
817
                                    <td>[% reserveloo.date %]</td>
818
                                    <td>[% reserveloo.expirationdate %]</td>
819
820
                                    <td>
821
                                        [% IF ( reserveloo.found ) %]
822
                                            [% IF ( reserveloo.atdestination ) %]
823
                                                [% IF ( reserveloo.found ) %]
824
                                                    Item waiting at <b> [% reserveloo.wbrname %]</b> <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" /> since [% reserveloo.waiting_date | $KohaDates %]
825
                                                [% ELSE %]
826
                                                    Waiting to be pulled <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" />
827
                                                [% END %]
828
                                            [% ELSE %]
829
                                                Item being transferred to <b> [% reserveloo.wbrname %]</b> <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" />
830
                                            [% END %]
831
                                        [% ELSE %]
832
                                            [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
833
                                                [% Branches.GetName(reserveloo.branchcode) %] <input type="hidden" name="pickup" value="[% reserveloo.branchcode %]" />
834
                                            [% ELSE %]
835
                                                <select name="pickup">
836
                                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => reserveloo.branchcode ) %]
837
                                                </select>
838
                                            [% END %]
839
                                        [% END %]
840
                                    </td>
841
842
                                    <td>
843
                                        [% IF ( reserveloo.found ) %]
844
                                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]">
845
                                                [% IF ( reserveloo.barcodenumber ) %]
846
                                                    [% reserveloo.barcodenumber %]
847
                                                    <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" />
848
                                                [% ELSE %]
849
                                                    No barcode
850
                                                [% END %]
851
                                            </a>
852
                                        [% ELSE %]
853
                                            [% IF ( reserveloo.item_level_hold ) %]
854
                                                <i>
855
                                                    Only item
856
                                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]">
857
                                                        [% IF ( reserveloo.barcodenumber ) %]
858
                                                            [% reserveloo.barcodenumber %]
859
                                                            <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" />
860
                                                        [% ELSE %]
861
                                                            No barcode
862
                                                        [% END %]
863
                                                    </a>
864
                                                </i>
865
                                            [% ELSE %]
866
                                                [% IF reserveloo.itemtype %]
867
                                                    <i>Next available [% ItemTypes.GetDescription( reserveloo.itemtype ) %] item</i>
868
                                                [% ELSE %]
869
                                                    <i>Next available</i>
870
                                                [% END %]
871
786
872
                                                <input type="hidden" name="itemnumber" value="" />
787
                            [% FOREACH h IN biblioloo.reserveloop %]
873
                                            [% END %]
788
                                [% branchcodes.push( h.branchcode ) %]
789
                            [% END %]
790
                            [% branchcodes = branchcodes.unique %]
791
792
                            [% FOREACH b IN branchcodes.sort %]
793
                                <fieldset class="contrast">
794
                                    <legend>[% Branches.GetName( b ) %]</legend>
795
                                    [% SET holds_by_branch = [] %]
796
                                    [% FOREACH h IN biblioloo.reserveloop %]
797
                                        [% IF h.branchcode == b %]
798
                                            [% holds_by_branch.push( h ) %]
874
                                        [% END %]
799
                                        [% END %]
875
                                    </td>
876
877
                                    [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
878
                                        <td>
879
                                            <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 %]">
880
                                                [% IF ( reserveloo.lowestPriority ) %]
881
                                                    <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Unset lowest priority" />
882
                                                [% ELSE %]
883
                                                    <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Set to lowest priority" />
884
                                                [% END %]
885
                                            </a>
886
                                        </td>
887
                                    [% END %]
800
                                    [% END %]
888
801
889
                                    <td>
802
                                    [% SET itemtypes = [] %]
890
                                        <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 %]">
803
                                    [% FOREACH h IN holds_by_branch %]
891
                                            <img src="[% interface %]/[% theme %]/img/x.png" alt="Cancel" />
804
                                        [% itemtypes.push( h.itemtype ) %]
892
                                        </a>
805
                                    [% END %]
893
                                    </td>
806
                                    [% itemtypes = itemtypes.unique %]
894
895
                                    [% IF SuspendHoldsIntranet %]
896
                                        <td>
897
                                            [% UNLESS ( reserveloo.found ) %]
898
                                                <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()" />
899
900
                                                [% IF AutoResumeSuspendedHolds %]
901
                                                    <label for="suspend_until_[% reserveloo.reserve_id %]">[% IF ( reserveloo.suspend ) %] on [% ELSE %] until [% END %]</label>
902
                                                    <input name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" size="10" value="[% reserveloo.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" />
903
                                                    <a href='#' onclick="document.getElementById('suspend_until_[% reserveloo.reserve_id %]').value='';">Clear date</a>
904
                                                [% ELSE %]
905
                                                    <input type="hidden" name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" value=""/>
906
                                                [% END %]
907
807
808
                                    [% FOREACH i IN itemtypes.sort %]
809
                                        <fieldset class="standard">
810
                                            [% IF i %]
811
                                                <legend>[% ItemTypes.GetDescription( i ) %]</legend>
908
                                            [% ELSE %]
812
                                            [% ELSE %]
909
                                                <input type="hidden" name="suspend_until" value="" />
813
                                                <legend>Any item type</legend>
910
                                            [% END %]
814
                                            [% END %]
911
                                        </td>
912
                                    [% END # IF SuspendHoldsIntranet %]
913
815
914
                                </tr>
816
                                            [% SET holds_by_itemtype = [] %]
817
                                            [% FOREACH h IN holds_by_branch %]
818
                                                [% IF h.itemtype == i %]
819
                                                    [% holds_by_itemtype.push( h ) %]
820
                                                [% END %]
821
                                            [% END %]
822
                                            [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
823
                                        </fieldset>
824
                                    [% END %]
825
                                </fieldset>
826
                            [% END %]
827
                        [% ELSE %]
828
                            [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
829
                        [% END %]
915
830
916
                            [% END %] <!-- existing reserveloop -->
917
                        </table>
918
                    [% END %]<!-- /reserveloop -->
831
                    [% END %]<!-- /reserveloop -->
919
                [% END %]<!-- /biblioloop -->
832
                [% END %]<!-- /biblioloop -->
920
833
(-)a/reserve/request.pl (-3 / +7 lines)
Lines 85-93 my $action = $input->param('action'); Link Here
85
$action ||= q{};
85
$action ||= q{};
86
86
87
if ( $action eq 'move' ) {
87
if ( $action eq 'move' ) {
88
  my $where = $input->param('where');
88
  my $where          = $input->param('where');
89
  my $reserve_id = $input->param('reserve_id');
89
  my $reserve_id     = $input->param('reserve_id');
90
  AlterPriority( $where, $reserve_id );
90
  my $prev_priority  = $input->param('prev_priority');
91
  my $next_priority  = $input->param('next_priority');
92
  my $first_priority = $input->param('first_priority');
93
  my $last_priority  = $input->param('last_priority');
94
  AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority );
91
} elsif ( $action eq 'cancel' ) {
95
} elsif ( $action eq 'cancel' ) {
92
  my $reserve_id = $input->param('reserve_id');
96
  my $reserve_id = $input->param('reserve_id');
93
  my $hold = Koha::Holds->find( $reserve_id );
97
  my $hold = Koha::Holds->find( $reserve_id );
(-)a/t/db_dependent/Holds.t (-5 / +4 lines)
Lines 210-228 is( $holds->next->itemnumber, $itemnumber, "Test ModReserveMinusPriority()" ); Link Here
210
210
211
$holds = $biblio->holds;
211
$holds = $biblio->holds;
212
$hold = $holds->next;
212
$hold = $holds->next;
213
AlterPriority( 'top', $hold->reserve_id );
213
AlterPriority( 'top', $hold->reserve_id, undef, 2, 1, 6 );
214
$hold = Koha::Holds->find( $reserveid );
214
$hold = Koha::Holds->find( $reserveid );
215
is( $hold->priority, '1', "Test AlterPriority(), move to top" );
215
is( $hold->priority, '1', "Test AlterPriority(), move to top" );
216
216
217
AlterPriority( 'down', $hold->reserve_id );
217
AlterPriority( 'down', $hold->reserve_id, undef, 2, 1, 6 );
218
$hold = Koha::Holds->find( $reserveid );
218
$hold = Koha::Holds->find( $reserveid );
219
is( $hold->priority, '2', "Test AlterPriority(), move down" );
219
is( $hold->priority, '2', "Test AlterPriority(), move down" );
220
220
221
AlterPriority( 'up', $hold->reserve_id );
221
AlterPriority( 'up', $hold->reserve_id, 1, 3, 1, 6 );
222
$hold = Koha::Holds->find( $reserveid );
222
$hold = Koha::Holds->find( $reserveid );
223
is( $hold->priority, '1', "Test AlterPriority(), move up" );
223
is( $hold->priority, '1', "Test AlterPriority(), move up" );
224
224
225
AlterPriority( 'bottom', $hold->reserve_id );
225
AlterPriority( 'bottom', $hold->reserve_id, undef, 2, 1, 6 );
226
$hold = Koha::Holds->find( $reserveid );
226
$hold = Koha::Holds->find( $reserveid );
227
is( $hold->priority, '6', "Test AlterPriority(), move to bottom" );
227
is( $hold->priority, '6', "Test AlterPriority(), move to bottom" );
228
228
229
- 

Return to bug 19469