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

(-)a/installer/data/mysql/atomicupdate/bug_37661-EnableBooking_syspref.pl (+17 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "37661",
6
    description => "Add a way to enable/disable bookings",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        $dbh->do(
12
            q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('EnableBooking','1',NULL,'If enabled, activate every functionalities related with Bookings module','YesNo')}
13
        );
14
15
        say_success( $out, "Added new system preference 'EnableBooking'" );
16
    },
17
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 246-251 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
246
('EmailPurchaseSuggestions','0','0|EmailAddressForSuggestions|BranchEmailAddress|KohaAdminEmailAddress','Choose email address that new purchase suggestions will be sent to: ','Choice'),
246
('EmailPurchaseSuggestions','0','0|EmailAddressForSuggestions|BranchEmailAddress|KohaAdminEmailAddress','Choose email address that new purchase suggestions will be sent to: ','Choice'),
247
('EmailSMSSendDriverFromAddress', '', '', 'Email SMS send driver from address override', 'Free'),
247
('EmailSMSSendDriverFromAddress', '', '', 'Email SMS send driver from address override', 'Free'),
248
('EnableAdvancedCatalogingEditor','0','','Enable the Rancor advanced cataloging editor','YesNo'),
248
('EnableAdvancedCatalogingEditor','0','','Enable the Rancor advanced cataloging editor','YesNo'),
249
('EnableBooking','1',NULL,'If enabled, activate every functionnalities related with Bookings module','YesNo'),
249
('EnableBorrowerFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'),
250
('EnableBorrowerFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'),
250
('EnableExpiredPasswordReset', '0', NULL, 'Enable ability for patrons with expired password to reset their password directly', 'YesNo'),
251
('EnableExpiredPasswordReset', '0', NULL, 'Enable ability for patrons with expired password to reset their password directly', 'YesNo'),
251
('EnableItemGroupHolds','0','','Enable item groups holds feature','YesNo'),
252
('EnableItemGroupHolds','0','','Enable item groups holds feature','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (-1 / +1 lines)
Lines 50-56 Link Here
50
            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio_object_id | url  %]">Items</a>
50
            <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio_object_id | url  %]">Items</a>
51
        </li>
51
        </li>
52
52
53
        [% IF ( CAN_user_circulate_manage_bookings && biblio.items.filter_by_bookable.count ) %]
53
        [% IF ( Koha.Preference('EnableBooking') && CAN_user_circulate_manage_bookings && biblio.items.filter_by_bookable.count ) %]
54
        [%- IF ( bookingsview ) -%]
54
        [%- IF ( bookingsview ) -%]
55
        <li class="active">
55
        <li class="active">
56
        [%- ELSE -%]
56
        [%- ELSE -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (-1 / +1 lines)
Lines 273-279 Link Here
273
    [% END %]
273
    [% END %]
274
[% END %]
274
[% END %]
275
275
276
[% IF ( CAN_user_circulate_manage_bookings && biblio.items.filter_by_bookable.count ) %]
276
[% IF ( Koha.Preference('EnableBooking') && CAN_user_circulate_manage_bookings && biblio.items.filter_by_bookable.count ) %]
277
<div class="btn-group"><button id="placbooking" class="btn btn-default" data-bs-toggle="modal" data-bs-target="#placeBookingModal" data-biblionumber="[% biblionumber | html %]"><i class="fa fa-calendar"></i> Place booking</button></div>
277
<div class="btn-group"><button id="placbooking" class="btn btn-default" data-bs-toggle="modal" data-bs-target="#placeBookingModal" data-biblionumber="[% biblionumber | html %]"><i class="fa fa-calendar"></i> Place booking</button></div>
278
[% END %]
278
[% END %]
279
279
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc (+4 lines)
Lines 23-33 Link Here
23
            [% WRAPPER tab_item tabname= "holds" %]
23
            [% WRAPPER tab_item tabname= "holds" %]
24
                <span>Holds</span> ([% holds_count || 0 | html %])
24
                <span>Holds</span> ([% holds_count || 0 | html %])
25
            [% END %]
25
            [% END %]
26
            [% IF Koha.Preference('EnableBooking') %]
26
            [% WRAPPER tab_item tabname="bookings" %]
27
            [% WRAPPER tab_item tabname="bookings" %]
27
                [% SET bookings_count = patron.bookings.filter_by_active.count %]
28
                [% SET bookings_count = patron.bookings.filter_by_active.count %]
28
                [% SET expired_bookings_count = patron.bookings.count - bookings_count %]
29
                [% SET expired_bookings_count = patron.bookings.count - bookings_count %]
29
                <span class="bookings_count">Bookings ([% bookings_count || 0 | html %])</span>
30
                <span class="bookings_count">Bookings ([% bookings_count || 0 | html %])</span>
30
            [% END %]
31
            [% END %]
32
        	[% END %]
31
        [% END %]
33
        [% END %]
32
34
33
        [% IF Koha.Preference('UseRecalls') %]
35
        [% IF Koha.Preference('UseRecalls') %]
Lines 215-220 Link Here
215
                [% END %]
217
                [% END %]
216
            [% END # /tab_panel#holds %]
218
            [% END # /tab_panel#holds %]
217
219
220
            [% IF Koha.Preference('EnableBooking') %]
218
            [% WRAPPER tab_panel tabname="bookings" %]
221
            [% WRAPPER tab_panel tabname="bookings" %]
219
                [% IF ( bookings_count ) %]
222
                [% IF ( bookings_count ) %]
220
                    <fieldset class="action filters" style="cursor:pointer;">
223
                    <fieldset class="action filters" style="cursor:pointer;">
Lines 230-235 Link Here
230
                    <p>Patron has nothing booked.</p>
233
                    <p>Patron has nothing booked.</p>
231
                [% END %]
234
                [% END %]
232
            [% END %]
235
            [% END %]
236
        	[% END %]
233
        [% END %]
237
        [% END %]
234
238
235
        [% IF Koha.Preference('UseRecalls') %]
239
        [% IF Koha.Preference('UseRecalls') %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+8 lines)
Lines 1515-1517 Circulation: Link Here
1515
                  1: Enable
1515
                  1: Enable
1516
                  0: Disable
1516
                  0: Disable
1517
            - "the curbside pickup module."
1517
            - "the curbside pickup module."
1518
1519
    Booking module:
1520
        -
1521
            - pref: EnableBooking
1522
              choices:
1523
                  1: Enable
1524
                  0: Disable
1525
            - "the booking module."
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt (-3 / +7 lines)
Lines 91-100 Link Here
91
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
91
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
92
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
92
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
93
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
93
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
94
    [% INCLUDE 'calendar.inc' %]
95
    [% INCLUDE 'select2.inc' %]
96
    [% Asset.js("js/catalog.js") | $raw %]
94
    [% Asset.js("js/catalog.js") | $raw %]
97
    [% Asset.js("js/modals/place_booking.js") | $raw %]
95
96
    [% IF Koha.Preference('EnableBooking') %]
97
        [% INCLUDE 'calendar.inc' %]
98
        [% INCLUDE 'select2.inc' %]
99
        [% Asset.js("js/modals/place_booking.js") | $raw %]
100
    [% END %]
101
98
    [% Asset.js("js/browser.js") | $raw %]
102
    [% Asset.js("js/browser.js") | $raw %]
99
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
103
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
100
        <script>
104
        <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt (-3 / +7 lines)
Lines 217-226 Link Here
217
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
217
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
218
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
218
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
219
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
219
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
220
    [% INCLUDE 'calendar.inc' %]
221
    [% INCLUDE 'select2.inc' %]
222
    [% Asset.js("js/catalog.js") | $raw %]
220
    [% Asset.js("js/catalog.js") | $raw %]
223
    [% Asset.js("js/modals/place_booking.js") | $raw %]
221
222
    [% IF Koha.Preference('EnableBooking') %]
223
        [% INCLUDE 'calendar.inc' %]
224
        [% INCLUDE 'select2.inc' %]
225
        [% Asset.js("js/modals/place_booking.js") | $raw %]
226
    [% END %]
227
224
    [% Asset.js("js/browser.js") | $raw %]
228
    [% Asset.js("js/browser.js") | $raw %]
225
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
229
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
226
        <script>
230
        <script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-3 / +8 lines)
Lines 1210-1219 Link Here
1210
    [% END %]
1210
    [% END %]
1211
1211
1212
[% MACRO jsinclude BLOCK %]
1212
[% MACRO jsinclude BLOCK %]
1213
    [% INCLUDE 'calendar.inc' %]
1214
    [% INCLUDE 'catalog-strings.inc' %]
1213
    [% INCLUDE 'catalog-strings.inc' %]
1215
    [% INCLUDE 'select2.inc' %]
1214
    [% IF Koha.Preference('EnableBooking') %]
1216
    [% INCLUDE 'js-date-format.inc' %]
1215
        [% INCLUDE 'calendar.inc' %]
1216
        [% INCLUDE 'select2.inc' %]
1217
        [% INCLUDE 'js-date-format.inc' %]
1218
    [% END %]
1217
    [% Asset.js("js/catalog.js") | $raw %]
1219
    [% Asset.js("js/catalog.js") | $raw %]
1218
    [% Asset.js("js/recalls.js") | $raw %]
1220
    [% Asset.js("js/recalls.js") | $raw %]
1219
    [% Asset.js("js/coce.js") | $raw %]
1221
    [% Asset.js("js/coce.js") | $raw %]
Lines 1671-1677 Link Here
1671
    [% INCLUDE 'js-patron-format.inc' %]
1673
    [% INCLUDE 'js-patron-format.inc' %]
1672
    [% INCLUDE 'js-biblio-format.inc' %]
1674
    [% INCLUDE 'js-biblio-format.inc' %]
1673
    [% Asset.js("js/browser.js") | $raw %]
1675
    [% Asset.js("js/browser.js") | $raw %]
1676
1677
    [% IF Koha.Preference('EnableBooking') %]
1674
    [% Asset.js("js/modals/place_booking.js") | $raw %]
1678
    [% Asset.js("js/modals/place_booking.js") | $raw %]
1679
    [% END %]
1675
    <script>
1680
    <script>
1676
        var browser;
1681
        var browser;
1677
        browser = KOHA.browser("[% searchid | html %]", parseInt(biblionumber, 10));
1682
        browser = KOHA.browser("[% searchid | html %]", parseInt(biblionumber, 10));
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt (-3 / +7 lines)
Lines 145-154 Link Here
145
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
145
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
146
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
146
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
147
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
147
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
148
    [% INCLUDE 'calendar.inc' %]
149
    [% INCLUDE 'select2.inc' %]
150
    [% Asset.js("js/catalog.js") | $raw %]
148
    [% Asset.js("js/catalog.js") | $raw %]
151
    [% Asset.js("js/modals/place_booking.js") | $raw %]
149
150
    [% IF Koha.Preference('EnableBooking') %]
151
        [% INCLUDE 'calendar.inc' %]
152
        [% INCLUDE 'select2.inc' %]
153
        [% Asset.js("js/modals/place_booking.js") | $raw %]
154
    [% END %]
155
152
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
156
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
153
        <script>
157
        <script>
154
            /* Set a variable needed by add_catalog_concern.js */
158
            /* Set a variable needed by add_catalog_concern.js */
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt (-3 / +7 lines)
Lines 105-115 Link Here
105
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
105
    [% Asset.js("lib/dayjs/plugin/isSameOrBefore.js") | $raw %]
106
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
106
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
107
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
107
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
108
    [% INCLUDE 'calendar.inc' %]
109
    [% INCLUDE 'select2.inc' %]
110
    [% Asset.js("js/catalog.js") | $raw %]
108
    [% Asset.js("js/catalog.js") | $raw %]
111
    [% Asset.js("js/modals/place_booking.js") | $raw %]
112
    [% Asset.js("js/browser.js") | $raw %]
109
    [% Asset.js("js/browser.js") | $raw %]
110
111
    [% IF Koha.Preference('EnableBooking') %]
112
        [% INCLUDE 'calendar.inc' %]
113
        [% INCLUDE 'select2.inc' %]
114
        [% Asset.js("js/modals/place_booking.js") | $raw %]
115
    [% END %]
116
113
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
117
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
114
        <script>
118
        <script>
115
            /* Set a variable needed by add_catalog_concern.js */
119
            /* Set a variable needed by add_catalog_concern.js */
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-3 / +10 lines)
Lines 342-347 Link Here
342
                                                <input type="submit" name="submit" class="btn btn-primary btn-xs" value="Update" />
342
                                                <input type="submit" name="submit" class="btn btn-primary btn-xs" value="Update" />
343
                                            </form>
343
                                            </form>
344
                                        </li>
344
                                        </li>
345
346
                                        [% IF Koha.Preference('EnableBooking') %]
345
                                        <li class="bookable">
347
                                        <li class="bookable">
346
                                            <span class="label">
348
                                            <span class="label">
347
                                                Bookable:
349
                                                Bookable:
Lines 375-380 Link Here
375
                                            [% END %]
377
                                            [% END %]
376
                                            <span class="hint"> Item type bookable: [% IF ITEM_DAT.effective_itemtype.bookable == 1 %]Yes[% ELSE %]No[% END %]</span>
378
                                            <span class="hint"> Item type bookable: [% IF ITEM_DAT.effective_itemtype.bookable == 1 %]Yes[% ELSE %]No[% END %]</span>
377
                                        </li>
379
                                        </li>
380
                                        [% END %]
378
381
379
                                    </ol> <!-- /.bibliodetails -->
382
                                    </ol> <!-- /.bibliodetails -->
380
                                    </div> <!-- /.rows -->
383
                                    </div> <!-- /.rows -->
Lines 527-538 Link Here
527
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
530
    <script>dayjs.extend(window.dayjs_plugin_isSameOrAfter)</script>
528
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
531
    <script>dayjs.extend(window.dayjs_plugin_isSameOrBefore)</script>
529
    [% INCLUDE 'js-patron-format.inc' %]
532
    [% INCLUDE 'js-patron-format.inc' %]
530
    [% INCLUDE 'calendar.inc' %]
531
    [% INCLUDE 'select2.inc' %]
532
    [% Asset.js("js/catalog.js") | $raw %]
533
    [% Asset.js("js/catalog.js") | $raw %]
533
    [% Asset.js("js/modals/place_booking.js") | $raw %]
534
    [% Asset.js("js/browser.js") | $raw %]
534
    [% Asset.js("js/browser.js") | $raw %]
535
    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
535
    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
536
537
    [% IF Koha.Preference('EnableBooking') %]
538
        [% INCLUDE 'calendar.inc' %]
539
        [% INCLUDE 'select2.inc' %]
540
        [% Asset.js("js/modals/place_booking.js") | $raw %]
541
    [% END %]
542
536
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
543
    [% IF ( Koha.Preference('CatalogConcerns') ) %]
537
        <script>
544
        <script>
538
            /* Set a variable needed by add_catalog_concern.js */
545
            /* Set a variable needed by add_catalog_concern.js */
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt (-1 / +3 lines)
Lines 78-84 Link Here
78
                    </div>
78
                    </div>
79
79
80
                    <div class="col-12 col-sm-4">
80
                    <div class="col-12 col-sm-4">
81
                        <h3>Holds and bookings</h3>
81
                        <h3>Holds [% IF Koha.Preference('EnableBooking') %]and bookings[% END %]</h3>
82
82
83
                        <ul class="buttons-list">
83
                        <ul class="buttons-list">
84
                            <li>
84
                            <li>
Lines 98-106 Link Here
98
                            <li>
98
                            <li>
99
                                <a class="circ-button" href="/cgi-bin/koha/circ/reserveratios.pl"><i class="fa-solid fa-chart-line"></i> Hold ratios</a>
99
                                <a class="circ-button" href="/cgi-bin/koha/circ/reserveratios.pl"><i class="fa-solid fa-chart-line"></i> Hold ratios</a>
100
                            </li>
100
                            </li>
101
                            [% IF Koha.Preference('EnableBooking') %]
101
                            <li>
102
                            <li>
102
                                <a class="circ-button" href="/cgi-bin/koha/circ/pendingbookings.pl"><i class="fa-solid fa-calendar-days"></i> Bookings to collect</a>
103
                                <a class="circ-button" href="/cgi-bin/koha/circ/pendingbookings.pl"><i class="fa-solid fa-calendar-days"></i> Bookings to collect</a>
103
                            </li>
104
                            </li>
105
                            [% END %]
104
                        </ul>
106
                        </ul>
105
107
106
                        [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
108
                        [% IF Koha.Preference('UseRecalls') and CAN_user_recalls %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-4 / +7 lines)
Lines 739-745 Link Here
739
            [% INCLUDE 'modals/resolve_return_claim.inc' %]
739
            [% INCLUDE 'modals/resolve_return_claim.inc' %]
740
        [% END %]
740
        [% END %]
741
741
742
        [% INCLUDE modals/cancel_booking.inc %]
742
        [% IF Koha.Preference('EnableBooking') %]
743
            [% INCLUDE modals/cancel_booking.inc %]
744
        [% END %]
743
745
744
[% MACRO jsinclude BLOCK %]
746
[% MACRO jsinclude BLOCK %]
745
    [% INCLUDE 'datatables.inc' %]
747
    [% INCLUDE 'datatables.inc' %]
Lines 774-780 Link Here
774
    [% END %]
776
    [% END %]
775
    [% Asset.js("js/holds.js") | $raw %]
777
    [% Asset.js("js/holds.js") | $raw %]
776
    [% INCLUDE 'calendar.inc' %]
778
    [% INCLUDE 'calendar.inc' %]
777
    [% Asset.js("js/cancel_booking_modal.js") | $raw %]
779
    [% IF Koha.Preference('EnableBooking') %]
780
        [% Asset.js("js/cancel_booking_modal.js") | $raw %]
781
        [% Asset.js("js/tables/bookings.js") | $raw %]
782
    [% END %]
778
    [% Asset.js("js/combobox.js") | $raw %]
783
    [% Asset.js("js/combobox.js") | $raw %]
779
    [% INCLUDE 'js-biblio-format.inc' %]
784
    [% INCLUDE 'js-biblio-format.inc' %]
780
    [% INCLUDE 'str/members-menu.inc' %]
785
    [% INCLUDE 'str/members-menu.inc' %]
Lines 843-849 Link Here
843
        });
848
        });
844
    </script>
849
    </script>
845
    [% Asset.js("js/checkouts.js") | $raw %]
850
    [% Asset.js("js/checkouts.js") | $raw %]
846
    [% Asset.js("js/tables/bookings.js") | $raw %]
847
[% END %]
851
[% END %]
848
852
849
[% INCLUDE 'intranet-bottom.inc' %]
853
[% INCLUDE 'intranet-bottom.inc' %]
850
- 

Return to bug 37661