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-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 721-914 function checkMultiHold() { Link Here
721
722
722
                [% FOREACH biblioloo IN biblioloop %]
723
                [% FOREACH biblioloo IN biblioloop %]
723
                    [% IF ( biblioloo.reserveloop ) %]
724
                    [% IF ( biblioloo.reserveloop ) %]
724
                        <table>
725
                        [% IF ( multi_hold ) %]
725
                            [% IF ( multi_hold ) %]
726
                            <h3>
726
                                <caption><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]">[% biblioloo.title |html %]</a></caption>
727
                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.biblionumber %]">
727
                            [% END %]
728
                                    [% biblioloo.title | html %]
728
729
                                </a>
729
                            <tr>
730
                            </h3>
730
                                [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
731
                        [% END %]
731
                                    <th>Priority</th>
732
                                    <th>&nbsp;</th>
733
                                [% ELSE %]
734
                                    <th>Delete?</th>
735
                                [% END %]
736
                                <th>Patron</th>
737
                                <th>Notes</th>
738
                                <th>Date</th>
739
                                <th>Expiration</th>
740
                                <th>Pickup library</th>
741
                                <th>Details</th>
742
                                [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
743
                                    <th><img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Toggle set to lowest priority" /></th>
744
                                [% END %]
745
                                <th>&nbsp;</th>
746
                                [% IF SuspendHoldsIntranet %]<th>&nbsp;</th><!-- Suspend Holds Column Header -->[% END %]
747
                            </tr>
748
749
                            [% FOREACH reserveloo IN biblioloo.reserveloop %]
750
                                <tr>
751
                                    <td>
752
                                        <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" />
753
                                        <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernumber %]" />
754
                                        <input type="hidden" name="biblionumber" value="[% reserveloo.biblionumber %]" />
755
                                        <select name="rank-request">
756
                                            [% IF ( reserveloo.found ) %]
757
                                                [% IF ( reserveloo.intransit ) %]
758
                                                    <option value="T" selected="selected">In transit</option>
759
                                                [% ELSE %]
760
                                                    <option value="W" selected="selected">Waiting</option>
761
                                                [% END %]
762
                                            [% END %]
763
764
                                            [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
765
                                                [% FOREACH optionloo IN reserveloo.optionloop %]
766
                                                    [% IF ( optionloo.selected ) %]
767
                                                        <option value="[% optionloo.num %]" selected="selected">[% optionloo.num %]</option>
768
                                                    [% ELSE %]
769
                                                        <option value="[% optionloo.num %]">[% optionloo.num %]</option>
770
                                                    [% END %]
771
                                                [% END %]
772
                                            [% ELSIF !reserveloo.found %]
773
                                                <option value="[% reserveloo.priority %]" selected="selected">[% reserveloo.priority %]</option>
774
                                            [% END %]
775
732
776
                                            <option value="del">del</option>
733
                        [% IF Koha.Preference('HoldsSplitQueue') == 'branch' %]
777
                                        </select>
734
                            [% SET branchcodes = [] %]
778
                                    </td>
779
735
780
                                    [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
736
                            [% FOREACH h IN biblioloo.reserveloop %]
781
                                        <td style="white-space:nowrap;">
737
                                [% branchcodes.push( h.branchcode ) %]
782
                                            <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 %]">
738
                            [% END %]
783
                                                <img src="[% interface %]/[% theme %]/img/go-up.png" alt="Go up" />
739
                            [% branchcodes = branchcodes.unique %]
784
                                            </a>
785
740
786
                                            <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 %]">
741
                            [% FOREACH b IN branchcodes.sort %]
787
                                                <img src="[% interface %]/[% theme %]/img/go-top.png" alt="Go top" />
742
                                [% SET holds_by_branch = [] %]
788
                                            </a>
743
                                [% FOREACH h IN biblioloo.reserveloop %]
744
                                    [% IF h.branchcode == b %]
745
                                        [% holds_by_branch.push( h ) %]
746
                                    [% END %]
747
                                [% END %]
748
                                <fieldset>
749
                                    <legend>[% Branches.GetName( b ) %]</legend>
750
                                    [% INCLUDE holds_table.inc holds=holds_by_branch %]
751
                                </fieldset>
752
                            [% END %]
753
                        [% ELSIF Koha.Preference('HoldsSplitQueue') == 'itemtype' %]
754
                            [% SET itemtypes = [] %]
789
755
790
                                            <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 %]">
756
                            [% FOREACH h IN biblioloo.reserveloop %]
791
                                                <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Go bottom" />
757
                                [% itemtypes.push( h.itemtype ) %]
792
                                            </a>
758
                            [% END %]
759
                            [% itemtypes = itemtypes.unique %]
793
760
794
                                            <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 %]">
761
                            [% FOREACH i IN itemtypes.sort %]
795
                                                <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Go down" />
762
                                [% SET holds_by_itemtype = [] %]
796
                                            </a>
763
                                [% FOREACH h IN biblioloo.reserveloop %]
797
                                        </td>
764
                                    [% IF h.itemtype == i %]
765
                                        [% holds_by_itemtype.push( h ) %]
798
                                    [% END %]
766
                                    [% END %]
767
                                [% END %]
799
768
800
                                    <td>
769
                                <fieldset>
801
                                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.borrowernumber %]" >
770
                                    [% IF i %]
802
                                            [% IF ( reserveloo.hidename ) %]
771
                                        <legend>[% ItemTypes.GetDescription( i ) %]</legend>
803
                                                [% reserveloo.cardnumber (reserveloo.borrowernumber) %]
772
                                    [% ELSE %]
804
                                            [% ELSE %]
773
                                        <legend>Any item type</legend>
805
                                                [% reserveloo.firstname %] [% reserveloo.surname %]
774
                                    [% END %]
806
                                            [% END %]
775
                                    [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
807
                                        </a>
776
                                </fieldset>
808
                                    </td>
777
                            [% END %]
809
778
                        [% ELSIF Koha.Preference('HoldsSplitQueue') == 'branch_itemtype' %]
810
                                    <td>[% reserveloo.notes %]</td>
779
                            [% SET branchcodes = [] %]
811
                                    <td>[% reserveloo.date %]</td>
812
                                    <td>[% reserveloo.expirationdate %]</td>
813
814
                                    <td>
815
                                        [% IF ( reserveloo.found ) %]
816
                                            [% IF ( reserveloo.atdestination ) %]
817
                                                [% IF ( reserveloo.found ) %]
818
                                                    Item waiting at <b> [% reserveloo.wbrname %]</b> <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" /> since [% reserveloo.waiting_date | $KohaDates %]
819
                                                [% ELSE %]
820
                                                    Waiting to be pulled <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" />
821
                                                [% END %]
822
                                            [% ELSE %]
823
                                                Item being transferred to <b> [% reserveloo.wbrname %]</b> <input type="hidden" name="pickup" value="[% reserveloo.wbrcode %]" />
824
                                            [% END %]
825
                                        [% ELSE %]
826
                                            [% IF Koha.Preference('IndependentBranches') && Branches.all().size == 1 %]
827
                                                [% Branches.GetName(reserveloo.branchcode) %] <input type="hidden" name="pickup" value="[% reserveloo.branchcode %]" />
828
                                            [% ELSE %]
829
                                                <select name="pickup">
830
                                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => reserveloo.branchcode ) %]
831
                                                </select>
832
                                            [% END %]
833
                                        [% END %]
834
                                    </td>
835
836
                                    <td>
837
                                        [% IF ( reserveloo.found ) %]
838
                                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]">
839
                                                [% IF ( reserveloo.barcodenumber ) %]
840
                                                    [% reserveloo.barcodenumber %]
841
                                                    <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" />
842
                                                [% ELSE %]
843
                                                    No barcode
844
                                                [% END %]
845
                                            </a>
846
                                        [% ELSE %]
847
                                            [% IF ( reserveloo.item_level_hold ) %]
848
                                                <i>
849
                                                    Only item
850
                                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% reserveloo.biblionumber %]">
851
                                                        [% IF ( reserveloo.barcodenumber ) %]
852
                                                            [% reserveloo.barcodenumber %]
853
                                                            <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" />
854
                                                        [% ELSE %]
855
                                                            No barcode
856
                                                        [% END %]
857
                                                    </a>
858
                                                </i>
859
                                            [% ELSE %]
860
                                                [% IF reserveloo.itemtype %]
861
                                                    <i>Next available [% ItemTypes.GetDescription( reserveloo.itemtype ) %] item</i>
862
                                                [% ELSE %]
863
                                                    <i>Next available</i>
864
                                                [% END %]
865
780
866
                                                <input type="hidden" name="itemnumber" value="" />
781
                            [% FOREACH h IN biblioloo.reserveloop %]
867
                                            [% END %]
782
                                [% branchcodes.push( h.branchcode ) %]
783
                            [% END %]
784
                            [% branchcodes = branchcodes.unique %]
785
786
                            [% FOREACH b IN branchcodes.sort %]
787
                                <fieldset class="contrast">
788
                                    <legend>[% Branches.GetName( b ) %]</legend>
789
                                    [% SET holds_by_branch = [] %]
790
                                    [% FOREACH h IN biblioloo.reserveloop %]
791
                                        [% IF h.branchcode == b %]
792
                                            [% holds_by_branch.push( h ) %]
868
                                        [% END %]
793
                                        [% END %]
869
                                    </td>
870
871
                                    [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
872
                                        <td>
873
                                            <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 %]">
874
                                                [% IF ( reserveloo.lowestPriority ) %]
875
                                                    <img src="[% interface %]/[% theme %]/img/go-bottom.png" alt="Unset lowest priority" />
876
                                                [% ELSE %]
877
                                                    <img src="[% interface %]/[% theme %]/img/go-down.png" alt="Set to lowest priority" />
878
                                                [% END %]
879
                                            </a>
880
                                        </td>
881
                                    [% END %]
794
                                    [% END %]
882
795
883
                                    <td>
796
                                    [% SET itemtypes = [] %]
884
                                        <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 %]">
797
                                    [% FOREACH h IN holds_by_branch %]
885
                                            <img src="[% interface %]/[% theme %]/img/x.png" alt="Cancel" />
798
                                        [% itemtypes.push( h.itemtype ) %]
886
                                        </a>
799
                                    [% END %]
887
                                    </td>
800
                                    [% itemtypes = itemtypes.unique %]
888
889
                                    [% IF SuspendHoldsIntranet %]
890
                                        <td>
891
                                            [% UNLESS ( reserveloo.found ) %]
892
                                                <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()" />
893
894
                                                [% IF AutoResumeSuspendedHolds %]
895
                                                    <label for="suspend_until_[% reserveloo.reserve_id %]">[% IF ( reserveloo.suspend ) %] on [% ELSE %] until [% END %]</label>
896
                                                    <input name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" size="10" value="[% reserveloo.suspend_until | $KohaDates %]" class="datepicker suspend_until_datepicker" />
897
                                                    <a href='#' onclick="document.getElementById('suspend_until_[% reserveloo.reserve_id %]').value='';">Clear date</a>
898
                                                [% ELSE %]
899
                                                    <input type="hidden" name="suspend_until" id="suspend_until_[% reserveloo.reserve_id %]" value=""/>
900
                                                [% END %]
901
801
802
                                    [% FOREACH i IN itemtypes.sort %]
803
                                        <fieldset class="standard">
804
                                            [% IF i %]
805
                                                <legend>[% ItemTypes.GetDescription( i ) %]</legend>
902
                                            [% ELSE %]
806
                                            [% ELSE %]
903
                                                <input type="hidden" name="suspend_until" value="" />
807
                                                <legend>Any item type</legend>
904
                                            [% END %]
808
                                            [% END %]
905
                                        </td>
906
                                    [% END # IF SuspendHoldsIntranet %]
907
809
908
                                </tr>
810
                                            [% SET holds_by_itemtype = [] %]
811
                                            [% FOREACH h IN holds_by_branch %]
812
                                                [% IF h.itemtype == i %]
813
                                                    [% holds_by_itemtype.push( h ) %]
814
                                                [% END %]
815
                                            [% END %]
816
                                            [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
817
                                        </fieldset>
818
                                    [% END %]
819
                                </fieldset>
820
                            [% END %]
821
                        [% ELSE %]
822
                            [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
823
                        [% END %]
909
824
910
                            [% END %] <!-- existing reserveloop -->
911
                        </table>
912
                    [% END %]<!-- /reserveloop -->
825
                    [% END %]<!-- /reserveloop -->
913
                [% END %]<!-- /biblioloop -->
826
                [% END %]<!-- /biblioloop -->
914
827
(-)a/reserve/request.pl (-3 / +7 lines)
Lines 87-95 my $action = $input->param('action'); Link Here
87
$action ||= q{};
87
$action ||= q{};
88
88
89
if ( $action eq 'move' ) {
89
if ( $action eq 'move' ) {
90
  my $where = $input->param('where');
90
  my $where          = $input->param('where');
91
  my $reserve_id = $input->param('reserve_id');
91
  my $reserve_id     = $input->param('reserve_id');
92
  AlterPriority( $where, $reserve_id );
92
  my $prev_priority  = $input->param('prev_priority');
93
  my $next_priority  = $input->param('next_priority');
94
  my $first_priority = $input->param('first_priority');
95
  my $last_priority  = $input->param('last_priority');
96
  AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority );
93
} elsif ( $action eq 'cancel' ) {
97
} elsif ( $action eq 'cancel' ) {
94
  my $reserve_id = $input->param('reserve_id');
98
  my $reserve_id = $input->param('reserve_id');
95
  my $hold = Koha::Holds->find( $reserve_id );
99
  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