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

(-)a/circ/pendingreserves.pl (-17 / +19 lines)
Lines 222-231 my $patrons_count = { Link Here
222
    }
222
    }
223
};
223
};
224
224
225
# make final reserves hash and fill with info
225
# make final holds_info array and fill with info
226
my $reserves;
226
my @holds_info;
227
foreach my $bibnum ( @biblionumbers ){
227
foreach my $bibnum ( @biblionumbers ){
228
228
229
    my $hold_info;
229
    my $items = $all_items->{$bibnum};
230
    my $items = $all_items->{$bibnum};
230
231
231
    # get available item types for each biblio
232
    # get available item types for each biblio
Lines 240-278 foreach my $bibnum ( @biblionumbers ){ Link Here
240
            }
241
            }
241
        )->get_column('itemtype');
242
        )->get_column('itemtype');
242
    }
243
    }
243
    $reserves->{$bibnum}->{itemtypes} = \@res_itemtypes;
244
    $hold_info->{itemtypes} = \@res_itemtypes;
244
245
245
    # get available locations for each biblio
246
    # get available locations for each biblio
246
    $reserves->{$bibnum}->{locations} = [ uniq map { defined $_->location ? $_->location : () } @$items ];
247
    $hold_info->{locations} = [ uniq map { defined $_->location ? $_->location : () } @$items ];
247
248
248
    # get available callnumbers for each biblio
249
    # get available callnumbers for each biblio
249
    $reserves->{$bibnum}->{callnumbers} = [ uniq map { defined $_->itemcallnumber ? $_->itemcallnumber : () } @$items ];
250
    $hold_info->{callnumbers} = [ uniq map { defined $_->itemcallnumber ? $_->itemcallnumber : () } @$items ];
250
251
251
    # get available enumchrons for each biblio
252
    # get available enumchrons for each biblio
252
    $reserves->{$bibnum}->{enumchrons} = [ uniq map { defined $_->enumchron ? $_->enumchron : () } @$items ];
253
    $hold_info->{enumchrons} = [ uniq map { defined $_->enumchron ? $_->enumchron : () } @$items ];
253
254
254
    # get available copynumbers for each biblio
255
    # get available copynumbers for each biblio
255
    $reserves->{$bibnum}->{copynumbers} = [ uniq map { defined $_->copynumber ? $_->copynumber : () } @$items ];
256
    $hold_info->{copynumbers} = [ uniq map { defined $_->copynumber ? $_->copynumber : () } @$items ];
256
257
257
    # get available barcodes for each biblio
258
    # get available barcodes for each biblio
258
    $reserves->{$bibnum}->{barcodes} = [ uniq map { defined $_->barcode ? $_->barcode : () } @$items ];
259
    $hold_info->{barcodes} = [ uniq map { defined $_->barcode ? $_->barcode : () } @$items ];
259
260
260
    # get available holding branches for each biblio
261
    # get available holding branches for each biblio
261
    $reserves->{$bibnum}->{holdingbranches} = [ uniq map { defined $_->holdingbranch ? $_->holdingbranch : () } @$items ];
262
    $hold_info->{holdingbranches} = [ uniq map { defined $_->holdingbranch ? $_->holdingbranch : () } @$items ];
262
263
263
    # items available
264
    # items available
264
    my $items_count = scalar @$items;
265
    my $items_count = scalar @$items;
265
    $reserves->{$bibnum}->{items_count} = $items_count;
266
    $hold_info->{items_count} = $items_count;
266
267
267
    # patrons with holds
268
    # patrons with holds
268
    $hold_info->{patrons_count} = $patrons_count->{$bibnum};
269
    $hold_info->{patrons_count} = $patrons_count->{$bibnum};
269
270
270
    my $pull_count = $items_count <= $patrons_count->{$bibnum} ? $items_count : $patrons_count->{$bibnum};
271
    my $pull_count = $items_count <= $patrons_count->{$bibnum} ? $items_count : $patrons_count->{$bibnum};
271
    if ( $pull_count == 0 ) {
272
    if ( $pull_count == 0 ) {
272
        delete($reserves->{$bibnum});
273
        next;
273
        next;
274
    }
274
    }
275
    $reserves->{$bibnum}->{pull_count} = $pull_count;
275
    $hold_info->{pull_count} = $pull_count;
276
276
277
    # get other relevant information
277
    # get other relevant information
278
    my $res_info = Koha::Holds->search(
278
    my $res_info = Koha::Holds->search(
Lines 282-298 foreach my $bibnum ( @biblionumbers ){ Link Here
282
          alias => 'reserve'
282
          alias => 'reserve'
283
        }
283
        }
284
    )->next; # get first item in results
284
    )->next; # get first item in results
285
    $reserves->{$bibnum}->{borrower} = $res_info->borrower;
285
    $hold_info->{patron} = $res_info->patron;
286
    $reserves->{$bibnum}->{item} = $res_info->item;
286
    $hold_info->{item}   = $res_info->item;
287
    $reserves->{$bibnum}->{biblio} = $res_info->biblio;
287
    $hold_info->{biblio} = $res_info->biblio;
288
    $reserves->{$bibnum}->{reserve} = $res_info;
288
    $hold_info->{hold}   = $res_info;
289
290
    push @holds_info, $hold_info;
289
}
291
}
290
292
291
$template->param(
293
$template->param(
292
    todaysdate          => $today,
294
    todaysdate          => $today,
293
    from                => $startdate,
295
    from                => $startdate,
294
    to                  => $enddate,
296
    to                  => $enddate,
295
    reserves            => $reserves,
297
    holds_info          => \@holds_info,
296
    "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
298
    "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
297
    HoldsToPullStartDate => C4::Context->preference('HoldsToPullStartDate') || PULL_INTERVAL,
299
    HoldsToPullStartDate => C4::Context->preference('HoldsToPullStartDate') || PULL_INTERVAL,
298
    HoldsToPullEndDate  => C4::Context->preference('ConfirmFutureHolds') || 0,
300
    HoldsToPullEndDate  => C4::Context->preference('ConfirmFutureHolds') || 0,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-31 / +34 lines)
Lines 47-53 Link Here
47
<h3>Reported on [% todaysdate | $KohaDates %]</h3>
47
<h3>Reported on [% todaysdate | $KohaDates %]</h3>
48
<p>The following holds have not been filled. Please retrieve them and check them in.</p>
48
<p>The following holds have not been filled. Please retrieve them and check them in.</p>
49
<div id="searchresults">
49
<div id="searchresults">
50
    [% IF ( reserves ) %]
50
    [% IF holds_info %]
51
    <table id="holdst">
51
    <table id="holdst">
52
    <thead>
52
    <thead>
53
        <tr>
53
        <tr>
Lines 68-87 Link Here
68
        </tr>
68
        </tr>
69
    </thead>
69
    </thead>
70
    <tbody>
70
    <tbody>
71
        [% FOREACH reserve IN reserves %]
71
        [% FOREACH hold_info IN holds_info %]
72
        <tr>
72
        <tr>
73
        [% IF ( reserve.value.borrower ) %]
73
        [% SET patron = hold_info.patron %]
74
            <td><p><strong>[% reserve.value.pull_count | html %]</strong></p></td>
74
        [% SET item = hold_info.item %]
75
            <td>[% reserve.value.items_count | html %]</td>
75
        [% SET hold = hold_info.hold %]
76
            <td>[% reserve.value.patrons_count | html %]</td>
76
        [% IF patron %]
77
            <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserve.value.borrower.borrowernumber | uri %]">[% reserve.value.borrower.firstname | html %] [% reserve.value.borrower.surname | html %]</a></td>
77
            [% SET biblio = hold_info.biblio %]
78
            <td><p><strong>[% hold_info.pull_count | html %]</strong></p></td>
79
            <td>[% hold_info.items_count | html %]</td>
80
            <td>[% hold_info.patrons_count | html %]</td>
81
            <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% patron.firstname | html %] [% patron.surname | html %]</a></td>
78
            <td>
82
            <td>
79
                <p>
83
                <p>
80
                    [% INCLUDE 'biblio-title.inc' biblio=reserve.value.biblio link = 1 %]
84
                    [% INCLUDE 'biblio-title.inc' biblio=biblio link = 1 %]
81
                </p>
85
                </p>
82
                [% IF ( reserve.value.biblio.author ) %]<p> by [% reserve.value.biblio.author | html %]</p>[% END %]
86
                [% IF ( biblio.author ) %]<p> by [% biblio.author | html %]</p>[% END %]
83
                [% IF ( reserve.value.biblio.biblioitem.editionstatement ) %]<p>[% reserve.value.biblio.biblioitem.editionstatement | html %]</p>[% END %]
87
                [% IF ( biblio.biblioitem.editionstatement ) %]<p>[% biblio.biblioitem.editionstatement | html %]</p>[% END %]
84
                [% IF ( reserve.value.biblio.biblioitem.publicationyear ) %]<p>[% reserve.value.biblio.biblioitem.publicationyear | html %]</p>[% END %]
88
                [% IF ( biblio.biblioitem.publicationyear ) %]<p>[% biblio.biblioitem.publicationyear | html %]</p>[% END %]
85
            </td>
89
            </td>
86
        [% ELSE %]
90
        [% ELSE %]
87
            <td>"</td>
91
            <td>"</td>
Lines 91-114 Link Here
91
            <td>"</td>
95
            <td>"</td>
92
        [% END %]
96
        [% END %]
93
        <td>
97
        <td>
94
            [% IF ( reserve.value.holdingbranches.size ) %]
98
            [% IF ( hold_info.holdingbranches.size ) %]
95
            <ul>
99
            <ul>
96
                [% FOREACH holdingbranch IN reserve.value.holdingbranches %]
100
                [% FOREACH holdingbranch IN hold_info.holdingbranches %]
97
                    <li>[% Branches.GetName ( holdingbranch ) | html %]</li>
101
                    <li>[% Branches.GetName ( holdingbranch ) | html %]</li>
98
                [% END %]
102
                [% END %]
99
            </ul>
103
            </ul>
100
            [% END %]
104
            [% END %]
101
        </td>
105
        </td>
102
        <td>
106
        <td>
103
            [% IF ( reserve.value.barcodes.size ) %]
107
            [% IF ( hold_info.barcodes.size ) %]
104
                [% SET barcode = reserve.value.barcodes.first %]
108
                [% SET barcode = hold_info.barcodes.first %]
105
                [% IF ( reserve.value.itemnumber ) %]Only [% barcode | html %][% ELSE %][% barcode | html %] or any available.[% END %]
109
                [% IF ( hold_info.itemnumber ) %]Only [% barcode | html %][% ELSE %][% barcode | html %] or any available.[% END %]
106
            [% END %]
110
            [% END %]
107
        </td>
111
        </td>
108
        <td>
112
        <td>
109
            [% IF ( reserve.value.callnumbers.size ) %]
113
            [% IF ( hold_info.callnumbers.size ) %]
110
                <ul>
114
                <ul>
111
                    [% FOREACH callnumber IN reserve.value.callnumbers %]
115
                    [% FOREACH callnumber IN hold_info.callnumbers %]
112
                        <li>
116
                        <li>
113
                            [% callnumber | html %]
117
                            [% callnumber | html %]
114
                        </li>
118
                        </li>
Lines 117-125 Link Here
117
            [% END %]
121
            [% END %]
118
        </td>
122
        </td>
119
        <td>
123
        <td>
120
            [% IF ( reserve.value.copynumbers.size ) %]
124
            [% IF ( hold_info.copynumbers.size ) %]
121
                <ul>
125
                <ul>
122
                    [% FOREACH copyno IN reserve.value.copynumbers %]
126
                    [% FOREACH copyno IN hold_info.copynumbers %]
123
                        <li>
127
                        <li>
124
                            [% copyno | html %]
128
                            [% copyno | html %]
125
                        </li>
129
                        </li>
Lines 128-136 Link Here
128
            [% END %]
132
            [% END %]
129
        </td>
133
        </td>
130
        <td>
134
        <td>
131
            [% IF ( reserve.value.enumchrons.size ) %]
135
            [% IF ( hold_info.enumchrons.size ) %]
132
                <ul>
136
                <ul>
133
                    [% FOREACH enumchron IN reserve.value.enumchrons %]
137
                    [% FOREACH enumchron IN hold_info.enumchrons %]
134
                        <li>
138
                        <li>
135
                            [% enumchron | html %]
139
                            [% enumchron | html %]
136
                        </li>
140
                        </li>
Lines 140-164 Link Here
140
        </td>
144
        </td>
141
        <td>
145
        <td>
142
            <ul>
146
            <ul>
143
            [% FOREACH type IN reserve.value.itemtypes %]
147
            [% FOREACH type IN hold_info.itemtypes %]
144
                <li>[% ItemTypes.GetDescription( type ) | html %]</li>
148
                <li>[% ItemTypes.GetDescription( type ) | html %]</li>
145
            [% END %]
149
            [% END %]
146
            </ul>
150
            </ul>
147
        </td>
151
        </td>
148
        <td>
152
        <td>
149
            <ul>
153
            <ul>
150
            [% FOREACH loc IN reserve.value.locations %]
154
            [% FOREACH loc IN hold_info.locations %]
151
                <li>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => loc ) | html %]</li>
155
                <li>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => loc ) | html %]</li>
152
            [% END %]
156
            [% END %]
153
            </ul>
157
            </ul>
154
        </td>
158
        </td>
155
        <td>
159
        <td>
156
            <span title="[% reserve.value.reserve.reservedate | html %]">[% reserve.value.reserve.reservedate | $KohaDates %] in [% Branches.GetName ( reserve.value.reserve.branchcode ) | html %]</span>
160
            <span title="[% hold.reservedate | html %]">[% hold.reservedate | $KohaDates %] in [% Branches.GetName ( hold.branchcode ) | html %]</span>
157
        </td>
161
        </td>
158
        <td>
162
        <td>
159
            <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
163
            <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
160
                <input type="hidden" name="op" value="cancel_reserve" />
164
                <input type="hidden" name="op" value="cancel_reserve" />
161
                <input type="hidden" name="reserve_id" value="[% reserve.value.reserve.reserve_id | html %]" />
165
                <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" />
162
166
163
                [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
167
                [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
164
                [% IF hold_cancellation %]
168
                [% IF hold_cancellation %]
Lines 173-189 Link Here
173
                    </div>
177
                    </div>
174
                [% END %]
178
                [% END %]
175
179
176
                [% IF reserve.value.item.holdingbranch != reserve.value.item.homebranch %]
180
                [% IF item.holdingbranch != item.homebranch %]
177
                    <input class="btn btn-default" type="submit" value="Cancel hold and return to : [% Branches.GetName( reserve.value.item.homebranch ) | html %]" />
181
                    <input class="btn btn-default" type="submit" value="Cancel hold and return to : [% Branches.GetName( item.homebranch ) | html %]" />
178
                [% ELSE %]
182
                [% ELSE %]
179
                    <input class="btn btn-default" type="submit" value="Cancel hold" />
183
                    <input class="btn btn-default" type="submit" value="Cancel hold" />
180
                [% END %]
184
                [% END %]
181
            </form>
185
            </form>
182
186
183
        [% IF Koha.Preference('CanMarkHoldsToPullAsLost') != 'do_not_allow' %]
187
        [% IF Koha.Preference('CanMarkHoldsToPullAsLost') != 'do_not_allow' %]
184
            [% IF reserve.value.reserve.itemnumber %]
188
            [% IF hold.itemnumber %]
185
                <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
189
                <form name="cancelReserve" action="/cgi-bin/koha/circ/pendingreserves.pl" method="post">
186
                    <input type="hidden" name="reserve_id" value="[% reserve.value.reserve.reserve_id | html %]" />
190
                    <input type="hidden" name="reserve_id" value="[% hold.reserve_id | html %]" />
187
                    [% IF Koha.Preference('CanMarkHoldsToPullAsLost') == 'allow' %]
191
                    [% IF Koha.Preference('CanMarkHoldsToPullAsLost') == 'allow' %]
188
                        <input type="hidden" name="op" value="mark_as_lost" />
192
                        <input type="hidden" name="op" value="mark_as_lost" />
189
                        <input type="submit" value="Mark item as lost" />
193
                        <input type="submit" value="Mark item as lost" />
190
- 

Return to bug 24488