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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/curbside_pickups.tt (-152 / +131 lines)
Lines 148-198 Link Here
148
                [% SET staged_and_ready = curbside_pickups.filter_by_staged_and_ready %]
148
                [% SET staged_and_ready = curbside_pickups.filter_by_staged_and_ready %]
149
                [% SET patron_outside = curbside_pickups.filter_by_patron_outside %]
149
                [% SET patron_outside = curbside_pickups.filter_by_patron_outside %]
150
                [% SET delivered_today = curbside_pickups.filter_by_delivered %]
150
                [% SET delivered_today = curbside_pickups.filter_by_delivered %]
151
                <div id="pickup-tabs" class="toptabs">
151
152
                    <ul class="nav nav-tabs" role="tablist">
152
                [% SET to_be_staged_active = 0 %]
153
                        [% IF !tab OR tab == 'to-be-staged' %]
153
                [% SET staged_and_ready_active = 0 %]
154
                        <li role="presentation" class="active">
154
                [% SET patron_is_outside_active = 0 %]
155
                        [% ELSE %]
155
                [% SET delivered_today_active = 0 %]
156
                        <li role="presentation">
156
                [% SET schedule_pickup_active = 0 %]
157
                        [% END %]
157
158
                            <a id="to-be-staged-tab"      href="#to-be-staged" role="tab" data-bs-toggle="tab">To be staged ([% to_be_staged.count | html %])</a>
158
                [% SWITCH tab -%]
159
                        </li>
159
                [%   CASE "to-be-staged" -%]
160
                        [% IF tab == 'staged-and-ready' %]
160
                       [% to_be_staged_active = 1 %]
161
                        <li role="presentation" class="active">
161
                [%   CASE "staged-and-ready" -%]
162
                        [% ELSE %]
162
                       [% staged_and_ready_active = 1 %]
163
                        <li role="presentation">
163
                [%   CASE "patron-is-outside" -%]
164
                       [% patron_is_outside_active = 1 %]
165
                [%   CASE "delivered-today" -%]
166
                       [% delivered_today_active = 1 %]
167
                [%   CASE "schedule-pickup" -%]
168
                       [% schedule_pickup_active = 1 %]
169
                [%   CASE # default case -%]
170
                        [% to_be_staged_active = 1 %]
171
                [% END -%]
172
173
                [% WRAPPER tabs id= "pickup-tabs" %]
174
                    [% WRAPPER tabs_nav %]
175
                        [% WRAPPER tab_item tabname= "to-be-staged" bt_active= to_be_staged_active %]
176
                            <span>To be staged ([% to_be_staged.count | html %])</span>
164
                        [% END %]
177
                        [% END %]
165
                            <a id="staged-and-ready-tab"  href="#staged-and-ready" role="tab" data-bs-toggle="tab">Staged & ready ([% staged_and_ready.count | html %])</a>
178
                        [% WRAPPER tab_item tabname= "staged-and-ready" bt_active = staged_and_ready_active %]
166
                        </li>
179
                            <span>Staged & ready ([% staged_and_ready.count | html %])</span>
167
                        [% IF tab == 'patron-is-outside' %]
168
                        <li role="presentation" class="active">
169
                        [% ELSE %]
170
                        <li role="presentation">
171
                        [% END %]
180
                        [% END %]
172
                            <a id="patron-is-outside-tab" href="#patron-is-outside" role="tab" data-bs-toggle="tab">Patron is outside ([% patron_outside.count | html %])</a>
181
                        [% WRAPPER tab_item tabname= "patron-is-outside" bt_active = patron_is_outside_active %]
173
                        </li>
182
                            <span>Patron is outside ([% patron_outside.count | html %])</span>
174
                        [% IF tab == 'delivered-today' %]
175
                        <li role="presentation" class="active">
176
                        [% ELSE %]
177
                        <li role="presentation">
178
                        [% END %]
183
                        [% END %]
179
                            <a id="delivered-today-tab"   href="#delivered-today" role="tab" data-bs-toggle="tab">Delivered today ([% delivered_today.count | html %])</a>
184
                        [% WRAPPER tab_item tabname= "delivered-today" bt_active = delivered_today_active %]
180
                        </li>
185
                            <span>Delivered today ([% delivered_today.count | html %])</span>
181
                        [% IF tab == 'schedule-pickup' %]
182
                        <li role="presentation" class="active">
183
                        [% ELSE %]
184
                        <li role="presentation">
185
                        [% END %]
186
                        [% END %]
186
                            <a id="schedule-pickup-tab"   href="#schedule-pickup" role="tab" data-bs-toggle="tab">Schedule pickup</a>
187
                        [% WRAPPER tab_item tabname= "schedule-pickup" bt_active = schedule_pickup_active %]
187
                        </li>
188
                            <span>Schedule pickup</span>
188
                    </ul>
189
190
                    <div class="tab-content">
191
                        [% IF !tab OR tab == 'to-be-staged' %]
192
                        <div id="to-be-staged" role="tabpanel" class="tab-pane active">
193
                        [% ELSE %]
194
                        <div id="to-be-staged" role="tabpanel" class="tab-pane">
195
                        [% END %]
189
                        [% END %]
190
                    [% END # /WRAPPER tabs_nav %]
191
192
                    [% WRAPPER tab_panels %]
193
                        [% WRAPPER tab_panel tabname="to-be-staged" bt_active= to_be_staged_active %]
196
                            [% IF to_be_staged.count %]
194
                            [% IF to_be_staged.count %]
197
                                <table class="table table-striped">
195
                                <table class="table table-striped">
198
                                    <thead>
196
                                    <thead>
Lines 241-255 Link Here
241
                                    </tbody>
239
                                    </tbody>
242
                                </table>
240
                                </table>
243
                            [% ELSE %]
241
                            [% ELSE %]
244
                                <span>There are no pickups to be staged.</span>
242
                                <div class="alert alert-info">There are no pickups to be staged.</div>
245
                            [% END %]
243
                            [% END %]
246
                        </div>
244
                        [% END # /tab_panel %]
247
245
                        [% WRAPPER tab_panel tabname="staged-and-ready" bt_active = staged_and_ready_active %]
248
                        [% IF tab == "staged-and-ready" %]
249
                        <div id="staged-and-ready" role="tabpanel" class="tab-pane active">
250
                        [% ELSE %]
251
                        <div id="staged-and-ready" role="tabpanel" class="tab-pane">
252
                        [% END %]
253
                            [% IF staged_and_ready.count %]
246
                            [% IF staged_and_ready.count %]
254
                                <table class="table table-striped">
247
                                <table class="table table-striped">
255
                                    <thead>
248
                                    <thead>
Lines 312-326 Link Here
312
                                    </tbody>
305
                                    </tbody>
313
                                </table>
306
                                </table>
314
                            [% ELSE %]
307
                            [% ELSE %]
315
                                <span>There are no pickups staged and ready.</span>
308
                                <div class="alert alert-info">There are no pickups staged and ready.</div>
316
                            [% END %]
309
                            [% END %]
317
                        </div>
310
                        [% END # /tab_panel %]
318
311
                        [% WRAPPER tab_panel tabname="patron-is-outside" bt_active = patron_is_outside_active %]
319
                        [% IF tab == "patron-is-outside" %]
320
                        <div id="patron-is-outside" role="tabpanel" class="tab-pane active">
321
                        [% ELSE %]
322
                        <div id="patron-is-outside" role="tabpanel" class="tab-pane">
323
                        [% END %]
324
                            [% IF patron_outside.count %]
312
                            [% IF patron_outside.count %]
325
                                <table class="table table-striped">
313
                                <table class="table table-striped">
326
                                    <thead>
314
                                    <thead>
Lines 383-397 Link Here
383
                                    </tbody>
371
                                    </tbody>
384
                                </table>
372
                                </table>
385
                            [% ELSE %]
373
                            [% ELSE %]
386
                                <span>There are no patrons waiting outside.</span>
374
                                <div class="alert alert-info">There are no patrons waiting outside.</div>
387
                            [% END %]
375
                            [% END %]
388
                        </div>
376
                        [% END # /tab_panel %]
389
377
                        [% WRAPPER tab_panel tabname="delivered-today" bt_active = delivered_today_active %]
390
                        [% IF tab == "delivered-today" %]
391
                        <div id="delivered-today" role="tabpanel" class="tab-pane active">
392
                        [% ELSE %]
393
                        <div id="delivered-today" role="tabpanel" class="tab-pane">
394
                        [% END %]
395
                            [% IF delivered_today.count %]
378
                            [% IF delivered_today.count %]
396
                                <table class="table table-striped">
379
                                <table class="table table-striped">
397
                                    <thead>
380
                                    <thead>
Lines 410-507 Link Here
410
                                                        [% PROCESS patron_info %]
393
                                                        [% PROCESS patron_info %]
411
                                                    </td>
394
                                                    </td>
412
                                                    <td>
395
                                                    <td>
413
                                                    [% FOREACH c IN cp.checkouts %]
396
                                                        [% FOREACH c IN cp.checkouts %]
414
                                                        [% IF date.format(c.issuedate, format = '%Y-%m-%d') == today_iso %]
397
                                                            [% IF date.format(c.issuedate, format = '%Y-%m-%d') == today_iso %]
415
                                                            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% c.item.biblionumber | uri %]">[% c.item.biblio.title | html %]</a> ([% c.item.biblio.author | html %], <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% c.itemnumber | html %]&biblionumber=[% c.item.biblionumber | html %]#item[% c.itemnumber | html %]">[% c.item.barcode | html %]</a>)<br/>
398
                                                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% c.item.biblionumber | uri %]">[% c.item.biblio.title | html %]</a> ([% c.item.biblio.author | html %], <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% c.itemnumber | html %]&biblionumber=[% c.item.biblionumber | html %]#item[% c.itemnumber | html %]">[% c.item.barcode | html %]</a>)<br/>
399
                                                            [% END %]
416
                                                        [% END %]
400
                                                        [% END %]
417
                                                    [% END %]
401
                                                    </td>
418
                                                </td>
402
                                                </tr>
419
                                            </tr>
403
                                            [% END %]
420
                                        [% END %]
404
                                        [% END %]
421
                                    [% END %]
405
                                    </tbody>
422
                                </tbody>
406
                                </table>
423
                            </table>
407
                            [% ELSE %]
424
                        [% ELSE %]
408
                                <div class="alert alert-info">There have not been any deliveries today.</div>
425
                            <span>No pickups have been delivered today.</span>
409
                            [% END # /IF delivered_today.count %]
426
                        [% END %]
410
                        [% END # /tab_panel %]
427
                    </div>
411
                        [% WRAPPER tab_panel tabname="schedule-pickup" bt_active = schedule_pickup_active %]
428
412
                            [% IF !patron || ( patron && existing_curbside_pickups.count >= 1 ) %]
429
                    [% IF tab == "schedule-pickup" %]
413
                                [% IF existing_curbside_pickups.count >= 1 %]
430
                    <div id="schedule-pickup" role="tabpanel" class="tab-pane active">
414
                                    <div class="alert alert-warning">
431
                    [% ELSE %]
415
                                        [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %]) already has a scheduled pickup for this library.
432
                    <div id="schedule-pickup" role="tabpanel" class="tab-pane">
416
                                    </div>
433
                    [% END %]
417
                                [% END %]
434
                        [% IF !patron || ( patron && existing_curbside_pickups.count >= 1 ) %]
418
                                <div class="col-10 col-sm-4 form-group">
435
                            [% IF existing_curbside_pickups.count >= 1 %]
419
                                    <div class="input-group-addon">
436
                                <div class="alert alert-warning">
420
                                        <label for="find-patron" class="form-label">Search a patron</label>
437
                                    [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %]) already has a scheduled pickup for this library.
421
                                    </div>
438
                                </div>
422
                                    <div>
439
                            [% END %]
423
                                        <input autocomplete="off" id="find-patron" class="form-control" type="text" style="" class="noEnterSubmit" placeholder="Enter patron card number or name"/>
440
                            <div class="form-group">
424
                                    </div>
441
                                <label class="sr-only" for="input-patron-cardnumber">Card number</label>
442
                                <div class="input-group">
443
                                    <div class="input-group-addon">Search a patron</div>
444
                                    <input autocomplete="off" id="find-patron" class="form-control noEnterSubmit" type="text" style="width:25%" placeholder="Enter patron card number or name"//>
445
                                </div>
425
                                </div>
446
                            </div>
447
                        [% ELSE %]
448
                            [% SET waiting_holds = patron.holds.search( found => 'W', branchcode => Branches.GetLoggedInBranchcode ) %]
449
                            [% IF !policy.enable_waiting_holds_only || waiting_holds.count > 0 %]
450
                                <form id="create-pickup" method="post">
451
                                    [% INCLUDE 'csrf-token.inc' %]
452
                                    <fieldset class="rows" style="float: none;">
453
                                        <input type="hidden" name="borrowernumber" value="[% patron.id | html %]"/>
454
                                        <input type="hidden" name="op" value="cud-create-pickup"/>
455
                                        <input type="hidden" name="tab" value="schedule-pickup"/>
456
                                        <ol>
457
                                            <li>
458
                                                <label>Patron: </label>
459
                                                <span>[% INCLUDE 'patron-title.inc' patron=patron %]</span>
460
                                                <a title="Search for another patron" href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=schedule-pickup"><i class="fa fa-search"></i></a>
461
                                            </li>
462
463
                                            <li>
464
                                                <label>Items ready for pickup: </label>
465
                                                <fieldset>
466
                                                    <ul>
467
                                                        [% IF waiting_holds.count %]
468
                                                            [% FOREACH h IN waiting_holds %]
469
                                                                <li>
470
                                                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% h.biblionumber | uri %]">[% h.biblio.title | html %]</a> ([% h.biblio.author | html %], <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% h.itemnumber | html %]&biblionumber=[% h.biblionumber | html %]#item[% h.itemnumber | html %]">[% h.item.barcode | html %]</a>)
471
                                                                </li>
472
                                                            [% END %]
473
                                                        [% ELSE %]
474
                                                            <li>There are no waiting holds for this patron at this library.</li>
475
                                                        [% END %]
476
                                                    </ul>
477
                                                </fieldset>
478
                                            </li>
479
480
                                            <li>
481
                                                <label for="pickup_date">Pickup date: </label>
482
                                                <input id="pickup_date" name="pickup_date" required="required" class="flatpickr" data-flatpickr-futureinclusive="true" />
483
                                            </li>
484
485
                                            <li id="pickup-times" class="radio"></li>
486
487
                                            <li>
488
                                                <label for="notes">Notes: </label>
489
                                                <input id="notes" name="notes" type="text" />
490
                                            </li>
491
                                        </ol>
492
                                    </fieldset>
493
494
                                    <fieldset class="action">
495
                                        <input type="submit" id="schedule-pickup-button" class="btn btn-primary" value="Submit" />
496
                                    </fieldset>
497
                                </form>
498
                            [% ELSE %]
426
                            [% ELSE %]
499
                                <div class="alert alert-warning">The patron does not have waitings holds.</div>
427
                                [% SET waiting_holds = patron.holds.search( found => 'W', branchcode => Branches.GetLoggedInBranchcode ) %]
428
                                [% IF !policy.enable_waiting_holds_only || waiting_holds.count > 0 %]
429
                                    <form id="create-pickup" method="post">
430
                                        [% INCLUDE 'csrf-token.inc' %]
431
                                        <fieldset class="rows" style="float: none;">
432
                                            <input type="hidden" name="borrowernumber" value="[% patron.id | html %]"/>
433
                                            <input type="hidden" name="op" value="cud-create-pickup"/>
434
                                            <input type="hidden" name="tab" value="schedule-pickup"/>
435
                                            <ol>
436
                                                <li>
437
                                                    <label>Patron: </label>
438
                                                    <span>[% INCLUDE 'patron-title.inc' patron=patron %]</span>
439
                                                    <a title="Search for another patron" href="/cgi-bin/koha/circ/curbside_pickups.pl?tab=schedule-pickup"><i class="fa fa-search"></i></a>
440
                                                </li>
441
442
                                                <li>
443
                                                    <label>Items ready for pickup: </label>
444
                                                    <fieldset>
445
                                                        <ul>
446
                                                            [% IF waiting_holds.count %]
447
                                                                [% FOREACH h IN waiting_holds %]
448
                                                                    <li>
449
                                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% h.biblionumber | uri %]">[% h.biblio.title | html %]</a> ([% h.biblio.author | html %], <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% h.itemnumber | html %]&biblionumber=[% h.biblionumber | html %]#item[% h.itemnumber | html %]">[% h.item.barcode | html %]</a>)
450
                                                                    </li>
451
                                                                [% END %]
452
                                                            [% ELSE %]
453
                                                                <li>There are no waiting holds for this patron at this library.</li>
454
                                                            [% END %]
455
                                                        </ul>
456
                                                    </fieldset>
457
                                                </li>
458
459
                                                <li>
460
                                                    <label for="pickup_date">Pickup date: </label>
461
                                                    <input id="pickup_date" name="pickup_date" required="required" class="flatpickr" data-flatpickr-futureinclusive="true" />
462
                                                </li>
463
464
                                                <li id="pickup-times" class="radio"></li>
465
466
                                                <li>
467
                                                    <label for="notes">Notes: </label>
468
                                                    <input id="notes" name="notes" type="text" />
469
                                                </li>
470
                                            </ol>
471
                                        </fieldset>
472
473
                                        <fieldset class="action">
474
                                            <input type="submit" id="schedule-pickup-button" class="btn btn-primary" value="Submit" />
475
                                        </fieldset>
476
                                    </form>
477
                                [% ELSE %]
478
                                    <div class="alert alert-warning">The patron does not have waitings holds.</div>
479
                                [% END %]
500
                            [% END %]
480
                            [% END %]
501
                        [% END %]
481
                        [% END # /tab_panel %]
502
                    </div>
482
                    [% END # /WRAPPER tab_panels %]
503
                </div>
483
                [% END # /WRAPPER tabs %]
504
                </div>
484
505
                [% IF Koha.Preference('CircSidebar') %]
485
                [% IF Koha.Preference('CircSidebar') %]
506
                    </div> <!-- /.col-md-10.order-md-2 -->
486
                    </div> <!-- /.col-md-10.order-md-2 -->
507
                        <div class="col-md-2 order-sm-2 order-md-1">
487
                        <div class="col-md-2 order-sm-2 order-md-1">
508
- 

Return to bug 37761