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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-23 / +23 lines)
Lines 132-138 Link Here
132
        const analyze = [% analyze ? 1 : 0 | html %];
132
        const analyze = [% analyze ? 1 : 0 | html %];
133
        const hidden_count = [% hidden_count ? 1 : 0 | html %];
133
        const hidden_count = [% hidden_count ? 1 : 0 | html %];
134
        const bundlesEnabled = [% bundlesEnabled ? 1 : 0 | html %];
134
        const bundlesEnabled = [% bundlesEnabled ? 1 : 0 | html %];
135
        addPrefs({
135
        Koha.addPrefs({
136
            LocalCoverImages: [% Koha.Preference('LocalCoverImages') ? 1 : 0 | html %],
136
            LocalCoverImages: [% Koha.Preference('LocalCoverImages') ? 1 : 0 | html %],
137
            OPACLocalCoverImages: [% Koha.Preference('OPACLocalCoverImages') ? 1 : 0 | html %],
137
            OPACLocalCoverImages: [% Koha.Preference('OPACLocalCoverImages') ? 1 : 0 | html %],
138
            EnableItemGroups: [% Koha.Preference('EnableItemGroups') ? 1 : 0 | html %],
138
            EnableItemGroups: [% Koha.Preference('EnableItemGroups') ? 1 : 0 | html %],
Lines 148-154 Link Here
148
            canreservefromotherbranches: [% Koha.Preference('canreservefromotherbranches') ? 1 : 0 | html %],
148
            canreservefromotherbranches: [% Koha.Preference('canreservefromotherbranches') ? 1 : 0 | html %],
149
            SpineLabelShowPrintOnBibDetails: [% Koha.Preference('SpineLabelShowPrintOnBibDetails') ? 1 : 0 | html %],
149
            SpineLabelShowPrintOnBibDetails: [% Koha.Preference('SpineLabelShowPrintOnBibDetails') ? 1 : 0 | html %],
150
        });
150
        });
151
        addPermissions({
151
        Koha.addPermissions({
152
            CAN_user_editcatalogue_edit_items: [% CAN_user_editcatalogue_edit_items ? 1 : 0 | html %],
152
            CAN_user_editcatalogue_edit_items: [% CAN_user_editcatalogue_edit_items ? 1 : 0 | html %],
153
        });
153
        });
154
        const logged_in_branchcode = '[% Branches.GetLoggedInBranchcode() | html %]';
154
        const logged_in_branchcode = '[% Branches.GetLoggedInBranchcode() | html %]';
Lines 306-332 Link Here
306
        // Do we need separate/new endpoints or do we hack the somewhere client-side?
306
        // Do we need separate/new endpoints or do we hack the somewhere client-side?
307
        let item_table_url = `/api/v1/biblios/${biblionumber}/items?`;
307
        let item_table_url = `/api/v1/biblios/${biblionumber}/items?`;
308
        let embed = ["+strings,_status,home_library,holding_library,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"];
308
        let embed = ["+strings,_status,home_library,holding_library,checkout,checkout.patron,transfer,transfer+strings,first_hold,first_hold+strings,first_hold.patron,first_hold.desk"];
309
        if (prefs.LocalCoverImages) {
309
        if (Koha.prefs.LocalCoverImages) {
310
            embed.push("cover_image_ids");
310
            embed.push("cover_image_ids");
311
        }
311
        }
312
        if (prefs.EnableItemGroups) {
312
        if (Koha.prefs.EnableItemGroups) {
313
            embed.push("item_group_item.item_group.description");
313
            embed.push("item_group_item.item_group.description");
314
        }
314
        }
315
        if (is_serial) {
315
        if (is_serial) {
316
            embed.push("serial_item.serial");
316
            embed.push("serial_item.serial");
317
        }
317
        }
318
        if (prefs.UseRecalls) {
318
        if (Koha.prefs.UseRecalls) {
319
            embed.push("recall", "recall+strings", "recall.patron");
319
            embed.push("recall", "recall+strings", "recall.patron");
320
        }
320
        }
321
        embed.push("in_bundle", "bundle_host", "bundle_host.biblio", "bundle_items_lost+count", "bundle_items_not_lost+count");
321
        embed.push("in_bundle", "bundle_host", "bundle_host.biblio", "bundle_items_lost+count", "bundle_items_not_lost+count");
322
        if (prefs.UseCourseReserves) {
322
        if (Koha.prefs.UseCourseReserves) {
323
            embed.push("course_item.course_reserves.course");
323
            embed.push("course_item.course_reserves.course");
324
        }
324
        }
325
        if (prefs.ClaimReturnedLostValue) {
325
        if (Koha.prefs.ClaimReturnedLostValue) {
326
            embed.push("return_claims");
326
            embed.push("return_claims");
327
        }
327
        }
328
328
329
        if (prefs.EasyAnalyticalRecords) {
329
        if (Koha.prefs.EasyAnalyticalRecords) {
330
            // For host records
330
            // For host records
331
            embed.push("biblio.title");
331
            embed.push("biblio.title");
332
        }
332
        }
Lines 350-357 Link Here
350
                user_colvis[tab_id] = user_colvis_bak;
350
                user_colvis[tab_id] = user_colvis_bak;
351
            }
351
            }
352
            let default_filters = {};
352
            let default_filters = {};
353
            if (prefs.SeparateHoldings) {
353
            if (Koha.prefs.SeparateHoldings) {
354
                let branch = prefs.SeparateHoldingsBranch == "homebranch" ? "me.home_library_id" : "me.holding_library_id";
354
                let branch = Koha.prefs.SeparateHoldingsBranch == "homebranch" ? "me.home_library_id" : "me.holding_library_id";
355
                if (tab_id == "holdings") {
355
                if (tab_id == "holdings") {
356
                    default_filters[branch] = logged_in_branchcode;
356
                    default_filters[branch] = logged_in_branchcode;
357
                } else {
357
                } else {
Lines 387-393 Link Here
387
                        }
387
                        }
388
                    },
388
                    },
389
                },
389
                },
390
                ...(prefs.LocalCoverImages
390
                ...(Koha.prefs.LocalCoverImages
391
                    ? [
391
                    ? [
392
                          {
392
                          {
393
                              data: "",
393
                              data: "",
Lines 419-425 Link Here
419
                          },
419
                          },
420
                      ]
420
                      ]
421
                    : []),
421
                    : []),
422
                ...(prefs.item_level_itypes
422
                ...(Koha.prefs.item_level_itypes
423
                    ? [
423
                    ? [
424
                          {
424
                          {
425
                              data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype
425
                              data: "me.item_type_id", // FIXME Cannot filter by biblioitem.itemtype
Lines 431-437 Link Here
431
                              render: function (data, type, row, meta) {
431
                              render: function (data, type, row, meta) {
432
                                  let node = "";
432
                                  let node = "";
433
                                  let item_type_description = row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id;
433
                                  let item_type_description = row._strings.item_type_id ? row._strings.item_type_id.str : row.item_type_id;
434
                                  if (prefs.noItemTypeImages) {
434
                                  if (Koha.prefs.noItemTypeImages) {
435
                                      let image_location = item_type_image_locations[row.item_type_id];
435
                                      let image_location = item_type_image_locations[row.item_type_id];
436
                                      node += image_location ? '<img class="itemtype-image" src="%s" alt="" /> '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description)) : "";
436
                                      node += image_location ? '<img class="itemtype-image" src="%s" alt="" /> '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description)) : "";
437
                                  }
437
                                  }
Lines 493-499 Link Here
493
                        return escape_str(row._strings.collection_code ? row._strings.collection_code.str : row.collection_code);
493
                        return escape_str(row._strings.collection_code ? row._strings.collection_code.str : row.collection_code);
494
                    },
494
                    },
495
                },
495
                },
496
                ...(prefs.EnableItemGroups
496
                ...(Koha.prefs.EnableItemGroups
497
                    ? [
497
                    ? [
498
                          {
498
                          {
499
                              data: "item_group_item.item_group.description",
499
                              data: "item_group_item.item_group.description",
Lines 539-545 Link Here
539
                        } else if (serial && serial.serialseq) {
539
                        } else if (serial && serial.serialseq) {
540
                            nodes += '<span class="serialseq">%s</span>'.format(escape_str(serial.serialseq));
540
                            nodes += '<span class="serialseq">%s</span>'.format(escape_str(serial.serialseq));
541
                        }
541
                        }
542
                        if (prefs.DisplayPublishedDate) {
542
                        if (Koha.prefs.DisplayPublishedDate) {
543
                            if (serial && serial.publisheddate) {
543
                            if (serial && serial.publisheddate) {
544
                                nodes += ' <span class="pubdate">(%s)</span>'.format($date(serial.publisheddate));
544
                                nodes += ' <span class="pubdate">(%s)</span>'.format($date(serial.publisheddate));
545
                            }
545
                            }
Lines 619-625 Link Here
619
                                    } else {
619
                                    } else {
620
                                        nodes += '<span class="waitingat">%s</span>'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date))));
620
                                        nodes += '<span class="waitingat">%s</span>'.format(_("Waiting at %s since %s.".format(row.first_hold._strings.pickup_library_id.str, $date(row.first_hold.waiting_date))));
621
                                    }
621
                                    }
622
                                    if (prefs.canreservefromotherbranches) {
622
                                    if (Koha.prefs.canreservefromotherbranches) {
623
                                        if (row.first_hold.waiting_date || row.first_hold.priority == 1) {
623
                                        if (row.first_hold.waiting_date || row.first_hold.priority == 1) {
624
                                            // Hacky for patron_to_html in case we simply want to display the patron's library name
624
                                            // Hacky for patron_to_html in case we simply want to display the patron's library name
625
                                            row.first_hold.patron.library = { name: libraries_names.get(row.first_hold.patron.library_id) };
625
                                            row.first_hold.patron.library = { name: libraries_names.get(row.first_hold.patron.library_id) };
Lines 633-639 Link Here
633
                                }
633
                                }
634
                            }
634
                            }
635
635
636
                            if (prefs.UseRecalls) {
636
                            if (Koha.prefs.UseRecalls) {
637
                                if (row.recall && row.item_id === row.recall.item_id) {
637
                                if (row.recall && row.item_id === row.recall.item_id) {
638
                                    if (row.recall.waiting_date) {
638
                                    if (row.recall.waiting_date) {
639
                                        nodes += '<span class="holding_status recallwaiting">%s</span>'.format(
639
                                        nodes += '<span class="holding_status recallwaiting">%s</span>'.format(
Lines 806-812 Link Here
806
                        return escape_str(row.internal_notes);
806
                        return escape_str(row.internal_notes);
807
                    },
807
                    },
808
                },
808
                },
809
                ...(prefs.EasyAnalyticalRecords
809
                ...(Koha.prefs.EasyAnalyticalRecords
810
                    ? [
810
                    ? [
811
                          {
811
                          {
812
                              data: "biblio.title",
812
                              data: "biblio.title",
Lines 840-846 Link Here
840
                          },
840
                          },
841
                      ]
841
                      ]
842
                    : []),
842
                    : []),
843
                ...(prefs.UseCourseReserves
843
                ...(Koha.prefs.UseCourseReserves
844
                    ? [
844
                    ? [
845
                          {
845
                          {
846
                              data: "course_item.course_reserves.course.course_name",
846
                              data: "course_item.course_reserves.course.course_name",
Lines 868-874 Link Here
868
                          },
868
                          },
869
                      ]
869
                      ]
870
                    : []),
870
                    : []),
871
                ...(prefs.SpineLabelShowPrintOnBibDetails
871
                ...(Koha.prefs.SpineLabelShowPrintOnBibDetails
872
                    ? [
872
                    ? [
873
                          {
873
                          {
874
                              data: "",
874
                              data: "",
Lines 880-892 Link Here
880
                          },
880
                          },
881
                      ]
881
                      ]
882
                    : []),
882
                    : []),
883
                ...(permissions.CAN_user_editcatalogue_edit_items
883
                ...(Koha.permissions.CAN_user_editcatalogue_edit_items
884
                    ? [
884
                    ? [
885
                          {
885
                          {
886
                              data: function (row, type, val, meta) {
886
                              data: function (row, type, val, meta) {
887
                                  let nodes = "";
887
                                  let nodes = "";
888
                                  if (can_edit_items_from.includes(row.home_library_id) || !can_edit_items_from.length) {
888
                                  if (can_edit_items_from.includes(row.home_library_id) || !can_edit_items_from.length) {
889
                                      if (prefs.LocalCoverImages || prefs.OPACLocalCoverImages) {
889
                                      if (Koha.prefs.LocalCoverImages || prefs.OPACLocalCoverImages) {
890
                                          nodes += '<div class="btn-group dropup">';
890
                                          nodes += '<div class="btn-group dropup">';
891
                                          nodes +=
891
                                          nodes +=
892
                                              ' <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=%s&itemnumber=%s#edititem"><i class="fa-solid fa-pencil"></i> %s</a><a class="btn btn-default btn-xs dropdown-toggle" data-bs-toggle="dropdown"><span class="caret"></span></a>'.format(
892
                                              ' <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=%s&itemnumber=%s#edititem"><i class="fa-solid fa-pencil"></i> %s</a><a class="btn btn-default btn-xs dropdown-toggle" data-bs-toggle="dropdown"><span class="caret"></span></a>'.format(
Lines 963-969 Link Here
963
                            container.find(".bottom.pager").remove();
963
                            container.find(".bottom.pager").remove();
964
                        }
964
                        }
965
965
966
                        if (prefs.SpineLabelShowPrintOnBibDetails) {
966
                        if (Koha.prefs.SpineLabelShowPrintOnBibDetails) {
967
                            $(".print-label").on("click", function (e) {
967
                            $(".print-label").on("click", function (e) {
968
                                e.preventDefault();
968
                                e.preventDefault();
969
                                link = $(this).attr("href");
969
                                link = $(this).attr("href");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt (-2 / +2 lines)
Lines 577-583 Link Here
577
    [% INCLUDE 'datatables.inc' %]
577
    [% INCLUDE 'datatables.inc' %]
578
    [% Asset.js("js/modals/edifact-modal.js") | $raw %]
578
    [% Asset.js("js/modals/edifact-modal.js") | $raw %]
579
    <script>
579
    <script>
580
        addPrefs({
580
        Koha.addPrefs({
581
            AcqEnableFiles: [% Koha.Preference('AcqEnableFiles') ? 1 : 0 | html %],
581
            AcqEnableFiles: [% Koha.Preference('AcqEnableFiles') ? 1 : 0 | html %],
582
        });
582
        });
583
        const invoiceincgst = [% invoiceincgst ? 1 : 0 | html %];
583
        const invoiceincgst = [% invoiceincgst ? 1 : 0 | html %];
Lines 603-609 Link Here
603
                searching: false,
603
                searching: false,
604
                dom: "t",
604
                dom: "t",
605
            });
605
            });
606
            if (prefs.AcqEnableFiles && has_files) {
606
            if (Koha.prefs.AcqEnableFiles && has_files) {
607
                $("#invoice_files_table").kohaTable({
607
                $("#invoice_files_table").kohaTable({
608
                    info: false,
608
                    info: false,
609
                    paging: false,
609
                    paging: false,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-9 / +9 lines)
Lines 460-470 Link Here
460
        var invoice_id = "[% invoiceid | html %]";
460
        var invoice_id = "[% invoiceid | html %]";
461
        const multiple_orders = "[% multiple_orders | html %]";
461
        const multiple_orders = "[% multiple_orders | html %]";
462
        const only_one_order = [% only_one_order ? 1 : 0 | html %];
462
        const only_one_order = [% only_one_order ? 1 : 0 | html %];
463
        addPrefs({
463
        Koha.addPrefs({
464
            AcqCreateItem: [% Koha.Preference('AcqCreateItem') ? 1 : 0 | html %],
464
            AcqCreateItem: [% Koha.Preference('AcqCreateItem') ? 1 : 0 | html %],
465
            UniqueItemFields: [% Koha.Preference('UniqueItemFields') ? 1 : 0 | html %],
465
            UniqueItemFields: [% Koha.Preference('UniqueItemFields') ? 1 : 0 | html %],
466
        });
466
        });
467
        addPermissions({
467
        Koha.addPermissions({
468
            CAN_user_acquisition: [% CAN_user_acquisition ? 1 : 0 | html %],
468
            CAN_user_acquisition: [% CAN_user_acquisition ? 1 : 0 | html %],
469
        });
469
        });
470
    </script>
470
    </script>
Lines 726-732 Link Here
726
                params["quantity"] = row.quantity;
726
                params["quantity"] = row.quantity;
727
                params["quantityrec"] = row.quantity_received;
727
                params["quantityrec"] = row.quantity_received;
728
                params["origquantityrec"] = origrec;
728
                params["origquantityrec"] = origrec;
729
                var effective_create_items = row.basket.create_items || prefs.AcqCreateItem;
729
                var effective_create_items = row.basket.create_items || Koha.prefs.AcqCreateItem;
730
                params["tax_rate"] = effective_create_items == "receiving" ? row.tax_rate_on_receiving : row.tax_rate_on_ordering;
730
                params["tax_rate"] = effective_create_items == "receiving" ? row.tax_rate_on_receiving : row.tax_rate_on_ordering;
731
                params["replacementprice"] = row.replacement_price;
731
                params["replacementprice"] = row.replacement_price;
732
                params["unitprice"] = invoiceincgst == "1" ? row.unit_price_tax_included || row.ecost_tax_included : row.unit_price_tax_excluded || row.ecost_tax_excluded;
732
                params["unitprice"] = invoiceincgst == "1" ? row.unit_price_tax_included || row.ecost_tax_included : row.unit_price_tax_excluded || row.ecost_tax_excluded;
Lines 924-930 Link Here
924
                if (val === null) $(this).val($("option:first-child", this).attr("value"));
924
                if (val === null) $(this).val($("option:first-child", this).attr("value"));
925
                val = $(this).val();
925
                val = $(this).val();
926
                var row = $("#order_edit").data("row");
926
                var row = $("#order_edit").data("row");
927
                var effective_create_items = row.basket.create_items || prefs.AcqCreateItem;
927
                var effective_create_items = row.basket.create_items || Koha.prefs.AcqCreateItem;
928
                if (effective_create_items == "receiving") {
928
                if (effective_create_items == "receiving") {
929
                    row.tax_rate_on_receiving = val;
929
                    row.tax_rate_on_receiving = val;
930
                } else {
930
                } else {
Lines 1051-1057 Link Here
1051
                            orderable: false,
1051
                            orderable: false,
1052
                            data: function (row, type, val, meta) {
1052
                            data: function (row, type, val, meta) {
1053
                                if (row.invoice) {
1053
                                if (row.invoice) {
1054
                                    if (permissions.CAN_user_acquisition) {
1054
                                    if (Koha.permissions.CAN_user_acquisition) {
1055
                                        return '<a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=' + row.invoice_id + '" title="Invoice detail page">' + row.invoice.invoice_number + "</a>";
1055
                                        return '<a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=' + row.invoice_id + '" title="Invoice detail page">' + row.invoice.invoice_number + "</a>";
1056
                                    }
1056
                                    }
1057
                                    return row.invoice.invoice_number;
1057
                                    return row.invoice.invoice_number;
Lines 1123-1129 Link Here
1123
            var set_editor = function () {
1123
            var set_editor = function () {
1124
                var modal = $("#order_edit");
1124
                var modal = $("#order_edit");
1125
                var row = modal.data("row");
1125
                var row = modal.data("row");
1126
                var effective_create_items = row.basket.create_items || prefs.AcqCreateItem;
1126
                var effective_create_items = row.basket.create_items || Koha.prefs.AcqCreateItem;
1127
                var origrec = $("#order_edit").data("origrec") || {};
1127
                var origrec = $("#order_edit").data("origrec") || {};
1128
                if (!origrec.hasOwnProperty(row.order_id)) {
1128
                if (!origrec.hasOwnProperty(row.order_id)) {
1129
                    origrec[row.order_id] = row.quantity_received;
1129
                    origrec[row.order_id] = row.quantity_received;
Lines 1262-1268 Link Here
1262
                        $("#acq-create-ordering").hide();
1262
                        $("#acq-create-ordering").hide();
1263
                        if (row.items && row.items.length) {
1263
                        if (row.items && row.items.length) {
1264
                            row.items.forEach(function (item, index) {
1264
                            row.items.forEach(function (item, index) {
1265
                                cloneItemBlock(index, prefs.UniqueItemFields, function (block_id) {
1265
                                cloneItemBlock(index, Koha.prefs.UniqueItemFields, function (block_id) {
1266
                                    var block = $("#" + block_id).hide();
1266
                                    var block = $("#" + block_id).hide();
1267
                                    Object.keys(item).forEach(function (key) {
1267
                                    Object.keys(item).forEach(function (key) {
1268
                                        block
1268
                                        block
Lines 1271-1284 Link Here
1271
                                            .find("*[name=field_value]")
1271
                                            .find("*[name=field_value]")
1272
                                            .val(item[key].field_value);
1272
                                            .val(item[key].field_value);
1273
                                    });
1273
                                    });
1274
                                    addItemInList(block_id, prefs.UniqueItemFields);
1274
                                    addItemInList(block_id, Koha.prefs.UniqueItemFields);
1275
                                    block.find("input[name='buttonPlus']").val(window.MSG_ADDITEM_JS_UPDATEITEM);
1275
                                    block.find("input[name='buttonPlus']").val(window.MSG_ADDITEM_JS_UPDATEITEM);
1276
                                    block.find("input[name='buttonPlusMulti']").remove();
1276
                                    block.find("input[name='buttonPlusMulti']").remove();
1277
                                    block.find("input[name='multiValue']").remove();
1277
                                    block.find("input[name='multiValue']").remove();
1278
                                });
1278
                                });
1279
                            });
1279
                            });
1280
                        }
1280
                        }
1281
                        cloneItemBlock((row.items && row.items.length) || 0, prefs.UniqueItemFields);
1281
                        cloneItemBlock((row.items && row.items.length) || 0, Koha.prefs.UniqueItemFields);
1282
                    } else if (effective_create_items == "ordering") {
1282
                    } else if (effective_create_items == "ordering") {
1283
                        $("#acq-create-receiving").hide();
1283
                        $("#acq-create-receiving").hide();
1284
                        $("#acq-create-ordering").show();
1284
                        $("#acq-create-ordering").show();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt (-3 / +3 lines)
Lines 356-367 Link Here
356
        }
356
        }
357
    </style>
357
    </style>
358
    <script>
358
    <script>
359
        addPrefs({
359
        Koha.addPrefs({
360
            marcflavour: "[% Koha.Preference('marcflavour') | html %]",
360
            marcflavour: "[% Koha.Preference('marcflavour') | html %]",
361
        });
361
        });
362
362
363
        let summary_fields = "biblio.title:biblio.author:biblio.isbn:biblio.publisher:me.internal_note:me.vendor_note";
363
        let summary_fields = "biblio.title:biblio.author:biblio.isbn:biblio.publisher:me.internal_note:me.vendor_note";
364
        if (prefs.marcflavour == 'UNIMARC'){
364
        if (Koha.prefs.marcflavour == 'UNIMARC'){
365
            summary_fields += ":biblio.ean";
365
            summary_fields += ":biblio.ean";
366
        }
366
        }
367
        const vendor_id = [% booksellerid | html %];
367
        const vendor_id = [% booksellerid | html %];
Lines 471-477 Link Here
471
                                    result += _(" by ") + escape_str(row.biblio.author);
471
                                    result += _(" by ") + escape_str(row.biblio.author);
472
                                if ( row.biblio.isbn != null )
472
                                if ( row.biblio.isbn != null )
473
                                    result += " &ndash; " + escape_str(row.biblio.isbn);
473
                                    result += " &ndash; " + escape_str(row.biblio.isbn);
474
                                if (prefs.marcflavour == 'UNIMARC' && row.biblio.ean != null ) {
474
                                if (Koha.prefs.marcflavour == 'UNIMARC' && row.biblio.ean != null ) {
475
                                        result += " &ndash; EAN:" + escape_str(row.biblio.ean);
475
                                        result += " &ndash; EAN:" + escape_str(row.biblio.ean);
476
                                        }
476
                                        }
477
                                if ( row.biblio.publisher != null ) {
477
                                if ( row.biblio.publisher != null ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt (-3 / +3 lines)
Lines 72-78 Link Here
72
        var bookings_table;
72
        var bookings_table;
73
        var timeline;
73
        var timeline;
74
        let biblionumber = "[% biblionumber | uri %]";
74
        let biblionumber = "[% biblionumber | uri %]";
75
        addPermissions({
75
        Koha.addPermissions({
76
            CAN_user_circulate_manage_bookings: [% CAN_user_circulate_manage_bookings ? 1 : 0 | html %],
76
            CAN_user_circulate_manage_bookings: [% CAN_user_circulate_manage_bookings ? 1 : 0 | html %],
77
        });
77
        });
78
    </script>
78
    </script>
Lines 121-127 Link Here
121
                            end: dayjs(booking.end_date).toDate(),
121
                            end: dayjs(booking.end_date).toDate(),
122
                            content: !isActive ? `<s>${patronContent}</s>` : patronContent,
122
                            content: !isActive ? `<s>${patronContent}</s>` : patronContent,
123
                            className: booking.status === "cancelled" ? "cancelled" : "",
123
                            className: booking.status === "cancelled" ? "cancelled" : "",
124
                            ...(permissions.CAN_user_circulate_manage_bookings ? { editable: !["cancelled", "completed"].includes(booking.status) ? { remove: true, updateTime: true } : false } : { editable: false }),
124
                            ...(Koha.permissions.CAN_user_circulate_manage_bookings ? { editable: !["cancelled", "completed"].includes(booking.status) ? { remove: true, updateTime: true } : false } : { editable: false }),
125
                            type: "range",
125
                            type: "range",
126
                            group: booking.item_id ?? 0,
126
                            group: booking.item_id ?? 0,
127
                        });
127
                        });
Lines 371-377 Link Here
371
                            render: function (data, type, row, meta) {
371
                            render: function (data, type, row, meta) {
372
                                let result = "";
372
                                let result = "";
373
                                const is_readonly = ["cancelled", "completed"].includes(row.status);
373
                                const is_readonly = ["cancelled", "completed"].includes(row.status);
374
                                if (permissions.CAN_user_circulate_manage_bookings && !is_readonly) {
374
                                if (Koha.permissions.CAN_user_circulate_manage_bookings && !is_readonly) {
375
                                    result += `
375
                                    result += `
376
                                <button type="button" class="btn btn-default btn-xs edit-action"
376
                                <button type="button" class="btn btn-default btn-xs edit-action"
377
                                    data-bs-toggle="modal"
377
                                    data-bs-toggle="modal"
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-6 / +6 lines)
Lines 1757-1769 Link Here
1757
            var bundle_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','bundle_tables','json') | $raw %];
1757
            var bundle_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','bundle_tables','json') | $raw %];
1758
        [% END %]
1758
        [% END %]
1759
1759
1760
        addPrefs({
1760
        Koha.addPrefs({
1761
            AlwaysShowHoldingsTableFilters: [% Koha.Preference('AlwaysShowHoldingsTableFilters') ? 1 : 0 | html %],
1761
            AlwaysShowHoldingsTableFilters: [% Koha.Preference('AlwaysShowHoldingsTableFilters') ? 1 : 0 | html %],
1762
            bundlesEnabled: [% Koha.Preference('bundlesEnabled') ? 1 : 0 | html %],
1762
            bundlesEnabled: [% Koha.Preference('bundlesEnabled') ? 1 : 0 | html %],
1763
            BundleLostValue: "[% Koha.Preference('BundleLostValue') | html %]",
1763
            BundleLostValue: "[% Koha.Preference('BundleLostValue') | html %]",
1764
        });
1764
        });
1765
1765
1766
        addPermissions({
1766
        Koha.addPermissions({
1767
            CAN_user_editcatalogue_manage_item_groups: [% CAN_user_editcatalogue_manage_item_groups ? 1 : 0 | html %],
1767
            CAN_user_editcatalogue_manage_item_groups: [% CAN_user_editcatalogue_manage_item_groups ? 1 : 0 | html %],
1768
        });
1768
        });
1769
    </script>
1769
    </script>
Lines 1772-1784 Link Here
1772
        items_tab_ids.forEach(function (tab_id, index) {
1772
        items_tab_ids.forEach(function (tab_id, index) {
1773
            // Early return if the tab is not shown (ie. no table)
1773
            // Early return if the tab is not shown (ie. no table)
1774
            if (!$("#%s_table".format(tab_id)).length) return;
1774
            if (!$("#%s_table".format(tab_id)).length) return;
1775
            if (prefs.AlwaysShowHoldingsTableFilters) {
1775
            if (Koha.prefs.AlwaysShowHoldingsTableFilters) {
1776
                build_items_table(tab_id, true, {}, build_items_table_drawncallback);
1776
                build_items_table(tab_id, true, {}, build_items_table_drawncallback);
1777
            } else {
1777
            } else {
1778
                build_items_table(tab_id, false, {}, build_items_table_drawncallback);
1778
                build_items_table(tab_id, false, {}, build_items_table_drawncallback);
1779
            }
1779
            }
1780
1780
1781
            if (prefs.bundlesEnabled) {
1781
            if (Koha.prefs.bundlesEnabled) {
1782
                // Add event listener for opening and closing bundle details
1782
                // Add event listener for opening and closing bundle details
1783
                $("#" + tab_id + "_table tbody").on("click", "button.details-control", function () {
1783
                $("#" + tab_id + "_table tbody").on("click", "button.details-control", function () {
1784
                    var button = $(this);
1784
                    var button = $(this);
Lines 1884-1890 Link Here
1884
                                searchable: false,
1884
                                searchable: false,
1885
                                orderable: false,
1885
                                orderable: false,
1886
                                render: function (data, type, row, meta) {
1886
                                render: function (data, type, row, meta) {
1887
                                    if (row.lost_status == prefs.BundleLostValue) {
1887
                                    if (row.lost_status == Koha.prefs.BundleLostValue) {
1888
                                        let out = '<span class="lost">' + _("Last seen") + ": " + $date(row.last_seen_date) + "</span>";
1888
                                        let out = '<span class="lost">' + _("Last seen") + ": " + $date(row.last_seen_date) + "</span>";
1889
                                        if (row.return_claim) {
1889
                                        if (row.return_claim) {
1890
                                            out = out + '<span class="claims_return">' + _("Claims returned by") + ": " + $patron_to_html(row.return_claim.patron, { display_cardnumber: false, url: true }) + "</span>";
1890
                                            out = out + '<span class="claims_return">' + _("Claims returned by") + ": " + $patron_to_html(row.return_claim.patron, { display_cardnumber: false, url: true }) + "</span>";
Lines 2203-2209 Link Here
2203
                        },
2203
                        },
2204
                        {
2204
                        {
2205
                            data: function (oObj) {
2205
                            data: function (oObj) {
2206
                                if (permissions.CAN_user_editcatalogue_manage_item_groups) {
2206
                                if (Koha.permissions.CAN_user_editcatalogue_manage_item_groups) {
2207
                                    return (
2207
                                    return (
2208
                                        `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
2208
                                        `<button class='item-group-edit btn btn-default btn-xs' data-item-group-id='${oObj.item_group_id}'>
2209
                                    <i class="fa-solid fa-pencil" aria-hidden="true"></i> ${_("Edit")}
2209
                                    <i class="fa-solid fa-pencil" aria-hidden="true"></i> ${_("Edit")}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt (-4 / +4 lines)
Lines 390-396 Link Here
390
    <script>
390
    <script>
391
        var authorised_values = [% authorised_values_json | $raw %];
391
        var authorised_values = [% authorised_values_json | $raw %];
392
        var table_settings = [% TablesSettings.GetTableSettings( 'catalogue', 'itemsearch', 'results', 'json' ) | $raw %];
392
        var table_settings = [% TablesSettings.GetTableSettings( 'catalogue', 'itemsearch', 'results', 'json' ) | $raw %];
393
        addPermissions({
393
        Koha.addPermissions({
394
            CAN_user_tools_items_batchmod: [% CAN_user_tools_items_batchmod ? 1 : 0 | html %],
394
            CAN_user_tools_items_batchmod: [% CAN_user_tools_items_batchmod ? 1 : 0 | html %],
395
            CAN_user_tools_items_batchdel: [% CAN_user_tools_items_batchdel ? 1 : 0 | html %],
395
            CAN_user_tools_items_batchdel: [% CAN_user_tools_items_batchdel ? 1 : 0 | html %],
396
        });
396
        });
Lines 642-655 Link Here
642
                "</a></li>" +
642
                "</a></li>" +
643
                "            </ul>" +
643
                "            </ul>" +
644
                "        </div>";
644
                "        </div>";
645
            if (permissions.CAN_user_tools_items_batchmod || permissions.CAN_user_tools_items_batchdel) {
645
            if (Koha.permissions.CAN_user_tools_items_batchmod || Koha.permissions.CAN_user_tools_items_batchdel) {
646
                table +=
646
                table +=
647
                    "" +
647
                    "" +
648
                    '        <div class="btn-group"><button class="btn btn-default btn-sm dropdown-toggle disabled" disabled="disabled" type="button" id="batch_mod_menu"data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> ' +
648
                    '        <div class="btn-group"><button class="btn btn-default btn-sm dropdown-toggle disabled" disabled="disabled" type="button" id="batch_mod_menu"data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> ' +
649
                    _("Batch operations") +
649
                    _("Batch operations") +
650
                    " </button>" +
650
                    " </button>" +
651
                    '            <ul class="dropdown-menu" aria-labelledby="batch_mod_menu">';
651
                    '            <ul class="dropdown-menu" aria-labelledby="batch_mod_menu">';
652
                if (permissions.CAN_user_tools_items_batchmod) {
652
                if (Koha.permissions.CAN_user_tools_items_batchmod) {
653
                    table +=
653
                    table +=
654
                        "" +
654
                        "" +
655
                        '                <li> <a class="dropdown-item batch_op send_to_item_mod" href="#" data-submit="batch_item_modification" data-bs-toggle="tooltip" data-bs-placement="right" title="' +
655
                        '                <li> <a class="dropdown-item batch_op send_to_item_mod" href="#" data-submit="batch_item_modification" data-bs-toggle="tooltip" data-bs-placement="right" title="' +
Lines 658-664 Link Here
658
                        _("Batch item modification") +
658
                        _("Batch item modification") +
659
                        "</a> </li>";
659
                        "</a> </li>";
660
                }
660
                }
661
                if (permissions.CAN_user_tools_items_batchdel) {
661
                if (Koha.permissions.CAN_user_tools_items_batchdel) {
662
                    table +=
662
                    table +=
663
                        "" +
663
                        "" +
664
                        '                <li> <a class="dropdown-item batch_op send_to_item_del"" href="#" data-submit="batch_item_deletion" data-bs-toggle="tooltip" data-bs-placement="right" title="' +
664
                        '                <li> <a class="dropdown-item batch_op send_to_item_del"" href="#" data-submit="batch_item_deletion" data-bs-toggle="tooltip" data-bs-placement="right" title="' +
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +2 lines)
Lines 1517-1523 Link Here
1517
        const overduecharges = [% overduecharges ? 1 : 0 | html %];
1517
        const overduecharges = [% overduecharges ? 1 : 0 | html %];
1518
        const was_transferred = [% transfer ? 1 : 0 | html %];
1518
        const was_transferred = [% transfer ? 1 : 0 | html %];
1519
1519
1520
        addPrefs({
1520
        Koha.addPrefs({
1521
            TransfersBlockCirc: [% Koha.Preference('TransfersBlockCirc') ? 1 : 0 | html %],
1521
            TransfersBlockCirc: [% Koha.Preference('TransfersBlockCirc') ? 1 : 0 | html %],
1522
            AutomaticConfirmTransfer: [% Koha.Preference('AutomaticConfirmTransfer') ? 1 : 0 | html %],
1522
            AutomaticConfirmTransfer: [% Koha.Preference('AutomaticConfirmTransfer') ? 1 : 0 | html %],
1523
        });
1523
        });
Lines 1770-1776 Link Here
1770
                ],
1770
                ],
1771
            });
1771
            });
1772
1772
1773
            if (!prefs.TransfersBlockCirc && prefs.AutomaticConfirmTransfer) {
1773
            if (!Koha.prefs.TransfersBlockCirc && Koha.prefs.AutomaticConfirmTransfer) {
1774
                $("#wrong-transfer-modal").on("hidden.bs.modal", function () {
1774
                $("#wrong-transfer-modal").on("hidden.bs.modal", function () {
1775
                    $("#wrongtransferform").submit();
1775
                    $("#wrongtransferform").submit();
1776
                });
1776
                });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (-2 / +2 lines)
Lines 518-524 Link Here
518
                        Edit request
518
                        Edit request
519
                    </a>
519
                    </a>
520
                    [% FOREACH action IN request.available_actions %]
520
                    [% FOREACH action IN request.available_actions %]
521
                        [% needs_prefs = action.needs_prefs.size ? action.needs_prefs : [] %]
521
                        [% needs_prefs = action.needs_Koha.prefs.size ? action.needs_prefs : [] %]
522
                        [% needs_perms = action.needs_perms.size ? action.needs_perms : [] %]
522
                        [% needs_perms = action.needs_perms.size ? action.needs_perms : [] %]
523
                        [% needs_all = action.needs_all.size ? action.needs_all : [] %]
523
                        [% needs_all = action.needs_all.size ? action.needs_all : [] %]
524
                        [% has_prefs_count = 0 %]
524
                        [% has_prefs_count = 0 %]
Lines 540-546 Link Here
540
                                [% has_all_count = has_all_count + 1 %]
540
                                [% has_all_count = has_all_count + 1 %]
541
                            [% END %]
541
                            [% END %]
542
                        [% END %]
542
                        [% END %]
543
                        [% NEXT IF has_prefs_count < needs_prefs.size || has_perms_count < needs_perms.size || has_all_count < needs_all.size %]
543
                        [% NEXT IF has_prefs_count < needs_Koha.prefs.size || has_perms_count < needs_perms.size || has_all_count < needs_all.size %]
544
                        [% IF action.method == 'migrate' %]
544
                        [% IF action.method == 'migrate' %]
545
                            [% IF Koha.Preference('AutoILLBackendPriority') && backends.size > 1 %]
545
                            [% IF Koha.Preference('AutoILLBackendPriority') && backends.size > 1 %]
546
                                <a
546
                                <a
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-2 / +2 lines)
Lines 579-585 Link Here
579
    [% Asset.js("js/members-menu.js") | $raw %]
579
    [% Asset.js("js/members-menu.js") | $raw %]
580
    <script>
580
    <script>
581
        var table_settings = [% TablesSettings.GetTableSettings('members', 'fines', 'account-fines', 'json') | $raw %];
581
        var table_settings = [% TablesSettings.GetTableSettings('members', 'fines', 'account-fines', 'json') | $raw %];
582
        addPrefs({
582
        Koha.addPrefs({
583
            FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
583
            FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
584
        });
584
        });
585
        const change_given = "[% change_given | html %]";
585
        const change_given = "[% change_given | html %]";
Lines 587-593 Link Here
587
    </script>
587
    </script>
588
    <script>
588
    <script>
589
        $(document).ready(function () {
589
        $(document).ready(function () {
590
            if (payment_id && prefs.FinePaymentAutoPopup) {
590
            if (payment_id && Koha.prefs.FinePaymentAutoPopup) {
591
                window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&change_given=${change_given}&accountlines_id=${payment_id}`, "_blank");
591
                window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&change_given=${change_given}&accountlines_id=${payment_id}`, "_blank");
592
            }
592
            }
593
593
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (-2 / +2 lines)
Lines 239-245 Link Here
239
        const change_given = "[% change_given | html %]";
239
        const change_given = "[% change_given | html %]";
240
        const total = "[% total | $Price %]";
240
        const total = "[% total | $Price %]";
241
        const patron_id = "[% patron.borrowernumber | html %]";
241
        const patron_id = "[% patron.borrowernumber | html %]";
242
        addPrefs({
242
        Koha.addPrefs({
243
            FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
243
            FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
244
        });
244
        });
245
    </script>
245
    </script>
Lines 254-260 Link Here
254
            }
254
            }
255
        }
255
        }
256
        $(document).ready(function () {
256
        $(document).ready(function () {
257
            if (payment_id && prefs.FinePaymentAutoPopup) {
257
            if (payment_id && Koha.prefs.FinePaymentAutoPopup) {
258
                window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=${payment_id}&change_given=${change_given}&borrowernumber=${patron_id}`, "_blank");
258
                window.open(`/cgi-bin/koha/members/printfeercpt.pl?action=print&accountlines_id=${payment_id}&change_given=${change_given}&borrowernumber=${patron_id}`, "_blank");
259
            }
259
            }
260
260
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/patron-lists-tab.tt (-2 / +2 lines)
Lines 123-129 Link Here
123
<script>
123
<script>
124
    const patron_id = "[% borrowernumber | html %]";
124
    const patron_id = "[% borrowernumber | html %]";
125
    const cardnumber = "[% cardnumber | html %]";
125
    const cardnumber = "[% cardnumber | html %]";
126
    addPermissions({
126
    Koha.addPermissions({
127
        CAN_user_tools_manage_patron_lists: [% CAN_user_tools_manage_patron_lists ? 1 : 0 | html %],
127
        CAN_user_tools_manage_patron_lists: [% CAN_user_tools_manage_patron_lists ? 1 : 0 | html %],
128
    });
128
    });
129
</script>
129
</script>
Lines 134-140 Link Here
134
    $("#table_listnopatron").kohaTable(patron_lists_dt_params);
134
    $("#table_listnopatron").kohaTable(patron_lists_dt_params);
135
    $("#table_inlists").kohaTable(patron_lists_dt_params);
135
    $("#table_inlists").kohaTable(patron_lists_dt_params);
136
136
137
    if (permissions.CAN_user_tools_manage_patron_lists){
137
    if (Koha.permissions.CAN_user_tools_manage_patron_lists){
138
        function addToList() {
138
        function addToList() {
139
            var list_id = $("#add_to_patron_list_id_select").val();
139
            var list_id = $("#add_to_patron_list_id_select").val();
140
            $('#pat_lists_panel').text(_("Loading..."));
140
            $('#pat_lists_panel').text(_("Loading..."));
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt (-5 / +5 lines)
Lines 177-183 Link Here
177
    [% Asset.js("js/tools-menu.js") | $raw %]
177
    [% Asset.js("js/tools-menu.js") | $raw %]
178
    <script>
178
    <script>
179
        const batch_id = "[% batch_id | html %]";
179
        const batch_id = "[% batch_id | html %]";
180
        addPrefs({
180
        Koha.addPrefs({
181
            PatronsPerPage: "[% Koha.Preference('PatronsPerPage') | html %]",
181
            PatronsPerPage: "[% Koha.Preference('PatronsPerPage') | html %]",
182
        });
182
        });
183
        const has_entries = [% table_loop ? 1 : 0 | html %];
183
        const has_entries = [% table_loop ? 1 : 0 | html %];
Lines 299-310 Link Here
299
            var aLengthMenu = [10, 20, 50, 100, -1];
299
            var aLengthMenu = [10, 20, 50, 100, -1];
300
            var aLengthMenuLabel = [10, 20, 50, 100, _("All")];
300
            var aLengthMenuLabel = [10, 20, 50, 100, _("All")];
301
            for ( var i = 0; i < aLengthMenu.length; i++ ) {
301
            for ( var i = 0; i < aLengthMenu.length; i++ ) {
302
                if ( aLengthMenu[i] == prefs.PatronsPerPage ) {
302
                if ( aLengthMenu[i] == Koha.prefs.PatronsPerPage ) {
303
                    break;
303
                    break;
304
                }
304
                }
305
                if ( aLengthMenu[i] > prefs.PatronsPerPage || aLengthMenu[i] == -1 ) {
305
                if ( aLengthMenu[i] > Koha.prefs.PatronsPerPage || aLengthMenu[i] == -1 ) {
306
                    aLengthMenu.splice(i, 0, prefs.PatronsPerPage);
306
                    aLengthMenu.splice(i, 0, Koha.prefs.PatronsPerPage);
307
                    aLengthMenuLabel.splice(i, 0, prefs.PatronsPerPage);
307
                    aLengthMenuLabel.splice(i, 0, Koha.prefs.PatronsPerPage);
308
                    break;
308
                    break;
309
                }
309
                }
310
            }
310
            }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt (-2 / +2 lines)
Lines 254-260 Link Here
254
        const payment_id = "[% payment_id | html %]";
254
        const payment_id = "[% payment_id | html %]";
255
        const tendered = "[% tendered | html %]";
255
        const tendered = "[% tendered | html %]";
256
        const change = "[% change | html %]";
256
        const change = "[% change | html %]";
257
        addPrefs({
257
        Koha.addPrefs({
258
            FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
258
            FinePaymentAutoPopup: [% Koha.Preference('FinePaymentAutoPopup') ? 1 : 0 | html %],
259
        });
259
        });
260
    </script>
260
    </script>
Lines 526-532 Link Here
526
                }
526
                }
527
            });
527
            });
528
528
529
            if (payment_id && prefs.FinePaymentAutoPopup) {
529
            if (payment_id && Koha.prefs.FinePaymentAutoPopup) {
530
                $("#printReceipt").click(function () {
530
                $("#printReceipt").click(function () {
531
                    var win = window.open(`/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=${payment_id}&tendered=${tendered}&change=${change}`, "_blank");
531
                    var win = window.open(`/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=${payment_id}&tendered=${tendered}&change=${change}`, "_blank");
532
                    win.focus();
532
                    win.focus();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-3 / +3 lines)
Lines 1592-1598 Link Here
1592
1592
1593
        const active_tab = [% clubs ? 1 : 0 | html %];
1593
        const active_tab = [% clubs ? 1 : 0 | html %];
1594
1594
1595
        addPrefs({
1595
        Koha.addPrefs({
1596
            UseBranchTransferLimits: [% Koha.Preference('UseBranchTransferLimits') ? 1 : 0 | html %],
1596
            UseBranchTransferLimits: [% Koha.Preference('UseBranchTransferLimits') ? 1 : 0 | html %],
1597
            EnableItemGroupHolds: [% Koha.Preference('EnableItemGroupHolds') ? 1 : 0 | html %],
1597
            EnableItemGroupHolds: [% Koha.Preference('EnableItemGroupHolds') ? 1 : 0 | html %],
1598
        });
1598
        });
Lines 1656-1662 Link Here
1656
                ToggleHoldsToPlace();
1656
                ToggleHoldsToPlace();
1657
            });
1657
            });
1658
1658
1659
            if (prefs.UseBranchTransferLimits) {
1659
            if (Koha.prefs.UseBranchTransferLimits) {
1660
                $("#pickup,#pickup-next-avail,#pickup-item-group").on("change", function () {
1660
                $("#pickup,#pickup-next-avail,#pickup-item-group").on("change", function () {
1661
                    var pickup = $(this).val();
1661
                    var pickup = $(this).val();
1662
                    var url = "?pickup=" + pickup;
1662
                    var url = "?pickup=" + pickup;
Lines 1980-1986 Link Here
1980
                patron_autocomplete($(".search_patron_filter"), { "link-to": "reserve", "url-params": url_biblio_params });
1980
                patron_autocomplete($(".search_patron_filter"), { "link-to": "reserve", "url-params": url_biblio_params });
1981
            }
1981
            }
1982
1982
1983
            if (prefs.EnableItemGroupHolds) {
1983
            if (Koha.prefs.EnableItemGroupHolds) {
1984
                $(':radio[name="item_group_id"]').change(function () {
1984
                $(':radio[name="item_group_id"]').change(function () {
1985
                    $('input[name="checkitem"]').prop("checked", false);
1985
                    $('input[name="checkitem"]').prop("checked", false);
1986
                });
1986
                });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (-4 / +4 lines)
Lines 1323-1329 Link Here
1323
            const has_suggestions = [% suggestions.size ? 1 : 0 | html %];
1323
            const has_suggestions = [% suggestions.size ? 1 : 0 | html %];
1324
            let suggestionData = [% To.json(suggestions) | $raw %];
1324
            let suggestionData = [% To.json(suggestions) | $raw %];
1325
            var suggestions_table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1325
            var suggestions_table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'suggestions', 'suggestions', 'json' ) | $raw %]
1326
            addPermissions({
1326
            Koha.addPermissions({
1327
                CAN_user_suggestions_suggestions_manage: [% CAN_user_suggestions_suggestions_manage ? 1 : 0 | html %],
1327
                CAN_user_suggestions_suggestions_manage: [% CAN_user_suggestions_suggestions_manage ? 1 : 0 | html %],
1328
                CAN_user_suggestions_suggestions_delete: [% CAN_user_suggestions_suggestions_delete ? 1 : 0 | html %],
1328
                CAN_user_suggestions_suggestions_delete: [% CAN_user_suggestions_suggestions_delete ? 1 : 0 | html %],
1329
            });
1329
            });
Lines 1517-1523 Link Here
1517
                                        searchable: false,
1517
                                        searchable: false,
1518
                                        orderable: false,
1518
                                        orderable: false,
1519
                                        render: function (data, type, row, meta) {
1519
                                        render: function (data, type, row, meta) {
1520
                                            if (permissions.CAN_user_suggestions_suggestions_manage) {
1520
                                            if (Koha.permissions.CAN_user_suggestions_suggestions_manage) {
1521
                                                let node = '<div class="btn-group dropup">';
1521
                                                let node = '<div class="btn-group dropup">';
1522
                                                node += '<a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=%s&amp;op=edit_form"><i class="fa-solid fa-pencil" aria-hidden="true"></i> %s</a>'.format(
1522
                                                node += '<a class="btn btn-default btn-xs" role="button" href="suggestion.pl?suggestionid=%s&amp;op=edit_form"><i class="fa-solid fa-pencil" aria-hidden="true"></i> %s</a>'.format(
1523
                                                    row.suggestion_id,
1523
                                                    row.suggestion_id,
Lines 1525-1531 Link Here
1525
                                                );
1525
                                                );
1526
                                                node += '<a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_%s" role="button" data-bs-toggle="dropdown" href="#"><b class="caret"></b></a>'.format(row.suggestion_id);
1526
                                                node += '<a class="btn btn-default btn-xs dropdown-toggle" id="more_actions_%s" role="button" data-bs-toggle="dropdown" href="#"><b class="caret"></b></a>'.format(row.suggestion_id);
1527
                                                node += '<ul class="dropdown-menu" role="menu" aria-labelledby="more_actions_%s">'.format(row.suggestion_id);
1527
                                                node += '<ul class="dropdown-menu" role="menu" aria-labelledby="more_actions_%s">'.format(row.suggestion_id);
1528
                                                if (permissions.CAN_user_suggestions_suggestions_delete) {
1528
                                                if (Koha.permissions.CAN_user_suggestions_suggestions_delete) {
1529
                                                    node += '<li><a href="#" data-op="cud-delete" data-suggestionid="%s" class="dropdown-item trigger_action">%s</a></li>'.format(row.suggestion_id, _("Delete"));
1529
                                                    node += '<li><a href="#" data-op="cud-delete" data-suggestionid="%s" class="dropdown-item trigger_action">%s</a></li>'.format(row.suggestion_id, _("Delete"));
1530
                                                }
1530
                                                }
1531
                                                if (!row.archived) {
1531
                                                if (!row.archived) {
Lines 1535-1541 Link Here
1535
                                                }
1535
                                                }
1536
                                                node += "</ul></div>";
1536
                                                node += "</ul></div>";
1537
                                                return node;
1537
                                                return node;
1538
                                            } else if (permissions.CAN_user_suggestions_suggestions_delete) {
1538
                                            } else if (Koha.permissions.CAN_user_suggestions_suggestions_delete) {
1539
                                                return '<button data-op="cud-delete" data-suggestionid="%s" class="btn btn-xs btn-default trigger_action"><i class="fa fa-trash-can"></i> %s</button>'.format(row.suggestion_id, _("Delete"));
1539
                                                return '<button data-op="cud-delete" data-suggestionid="%s" class="btn btn-xs btn-default trigger_action"><i class="fa fa-trash-can"></i> %s</button>'.format(row.suggestion_id, _("Delete"));
1540
                                            }
1540
                                            }
1541
                                        },
1541
                                        },
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt (-1 / +1 lines)
Lines 462-468 Link Here
462
        const theme = "[% theme | html %]";
462
        const theme = "[% theme | html %]";
463
        const import_batch_id = "[% import_batch_id | html %]";
463
        const import_batch_id = "[% import_batch_id | html %]";
464
        const record_type = "[% record_type | html %]";
464
        const record_type = "[% record_type | html %]";
465
        addPermissions({
465
        Koha.addPermissions({
466
            CAN_user_editcatalogue_edit_catalogue: [% CAN_user_editcatalogue_edit_catalogue ? 1 : 0 | html %],
466
            CAN_user_editcatalogue_edit_catalogue: [% CAN_user_editcatalogue_edit_catalogue ? 1 : 0 | html %],
467
        });
467
        });
468
    </script>
468
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt (-3 / +3 lines)
Lines 494-500 Link Here
494
494
495
        const has_patrons = [% borrowers ? 1 : 0 | html %]
495
        const has_patrons = [% borrowers ? 1 : 0 | html %]
496
        const op = "[% op | html %]";
496
        const op = "[% op | html %]";
497
        addPermissions({
497
        Koha.addPermissions({
498
            CanUpdatePasswordExpiration: [% CanUpdatePasswordExpiration ? 1 : 0 | html %],
498
            CanUpdatePasswordExpiration: [% CanUpdatePasswordExpiration ? 1 : 0 | html %],
499
            CanUpdateProtectPatron: [% CanUpdateProtectPatron ? 1 : 0 | html %],
499
            CanUpdateProtectPatron: [% CanUpdateProtectPatron ? 1 : 0 | html %],
500
        });
500
        });
Lines 526-532 Link Here
526
                    selections_column.is_hidden = 1;
526
                    selections_column.is_hidden = 1;
527
                }
527
                }
528
528
529
                if (!permissions.CanUpdatePasswordExpiration) {
529
                if (!Koha.permissions.CanUpdatePasswordExpiration) {
530
                    let password_expiration_date_column = table_settings.columns.find(c => c.columnname == "batch_patron_edit_password_expiration_date");
530
                    let password_expiration_date_column = table_settings.columns.find(c => c.columnname == "batch_patron_edit_password_expiration_date");
531
                    password_expiration_date_column.is_hidden = 1;
531
                    password_expiration_date_column.is_hidden = 1;
532
                    password_expiration_date_column.cannot_be_modified = 1;
532
                    password_expiration_date_column.cannot_be_modified = 1;
Lines 534-540 Link Here
534
                    password_expiration_date_column.force_visibility = 1;
534
                    password_expiration_date_column.force_visibility = 1;
535
                }
535
                }
536
536
537
                if (!permissions.CanUpdateProtectPatron) {
537
                if (!Koha.permissions.CanUpdateProtectPatron) {
538
                    let protected_column = table_settings.columns.find(c => c.columnname == "batch_patron_edit_protected");
538
                    let protected_column = table_settings.columns.find(c => c.columnname == "batch_patron_edit_protected");
539
                    protected_column.is_hidden = 1;
539
                    protected_column.is_hidden = 1;
540
                    protected_column.cannot_be_modified = 1;
540
                    protected_column.cannot_be_modified = 1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt (-2 / +2 lines)
Lines 370-376 Link Here
370
            table_settings['columns'].splice(5, 1);
370
            table_settings['columns'].splice(5, 1);
371
        }
371
        }
372
372
373
        addPrefs({
373
        Koha.addPrefs({
374
            OPACBaseURL: "[% Koha.Preference('OPACBaseURL') | html %]",
374
            OPACBaseURL: "[% Koha.Preference('OPACBaseURL') | html %]",
375
        });
375
        });
376
        const msg_alert = "[% msg | html %]";
376
        const msg_alert = "[% msg | html %]";
Lines 490-496 Link Here
490
            }
490
            }
491
        }
491
        }
492
        function Choose(hashval) {
492
        function Choose(hashval) {
493
            var res = prefs.OPACBaseURL;
493
            var res = Koha.prefs.OPACBaseURL;
494
            res = res.replace(/\/$/, "");
494
            res = res.replace(/\/$/, "");
495
            res = res + "/cgi-bin/koha/opac-retrieve-file.pl?id=" + hashval;
495
            res = res + "/cgi-bin/koha/opac-retrieve-file.pl?id=" + hashval;
496
            var index = plugin_index;
496
            var index = plugin_index;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-3 / +3 lines)
Lines 718-734 Link Here
718
718
719
    [% IF shelf AND op == 'view' %]
719
    [% IF shelf AND op == 'view' %]
720
        <script>
720
        <script>
721
            addPrefs({
721
            Koha.addPrefs({
722
                intranetbookbag: [% Koha.Preference("intranetbookbag") ? 1 : 0 | html %],
722
                intranetbookbag: [% Koha.Preference("intranetbookbag") ? 1 : 0 | html %],
723
                virtualshelves: [% Koha.Preference("virtualshelves") ? 1 : 0 | html %],
723
                virtualshelves: [% Koha.Preference("virtualshelves") ? 1 : 0 | html %],
724
            });
724
            });
725
725
726
            function build_dropdown(){
726
            function build_dropdown(){
727
                var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
727
                var param1 = "| <label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
728
                if (prefs.intranetbookbag){
728
                if (Koha.prefs.intranetbookbag){
729
                     param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
729
                     param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>";
730
                }
730
                }
731
                if (prefs.virtualshelves){
731
                if (Koha.prefs.virtualshelves){
732
                    [% IF add_to_some_private_shelves.count %]
732
                    [% IF add_to_some_private_shelves.count %]
733
                        param1 += "<optgroup label=\""+_("Your lists:")+"\">";
733
                        param1 += "<optgroup label=\""+_("Your lists:")+"\">";
734
                        [% SET number_of_private_shelves = 0 %]
734
                        [% SET number_of_private_shelves = 0 %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/stores.js (-7 / +5 lines)
Lines 1-19 Link Here
1
(function () {
1
(function () {
2
    const permissions = (window.permissions = window.permissions || {});
2
    const app = (window.Koha ??= {});
3
3
4
    window.addPermissions = function (perms) {
4
    const permissions = (app.permissions ??= {});
5
    app.addPermissions = function (perms) {
5
        for (const key in perms) {
6
        for (const key in perms) {
6
            if (Object.prototype.hasOwnProperty.call(perms, key)) {
7
            if (Object.prototype.hasOwnProperty.call(perms, key)) {
7
                permissions[key] = perms[key];
8
                permissions[key] = perms[key];
8
            }
9
            }
9
        }
10
        }
10
    };
11
    };
11
})();
12
13
(function () {
14
    const prefs = (window.prefs = window.prefs || {});
15
12
16
    window.addPrefs = function (sysprefs) {
13
    const prefs = (app.prefs = app.prefs || {});
14
    app.addPrefs = function (sysprefs) {
17
        for (const key in sysprefs) {
15
        for (const key in sysprefs) {
18
            if (Object.prototype.hasOwnProperty.call(sysprefs, key)) {
16
            if (Object.prototype.hasOwnProperty.call(sysprefs, key)) {
19
                prefs[key] = sysprefs[key];
17
                prefs[key] = sysprefs[key];
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-28 / +28 lines)
Lines 1645-1651 Link Here
1645
    [% END %]
1645
    [% END %]
1646
    <script>
1646
    <script>
1647
        const interface = "[% interface | html %]";
1647
        const interface = "[% interface | html %]";
1648
        addPrefs({
1648
        Koha.addPrefs({
1649
            OpacHighlightedWords: "[% Koha.Preference('OpacHighlightedWords') | html %]",
1649
            OpacHighlightedWords: "[% Koha.Preference('OpacHighlightedWords') | html %]",
1650
            NotHighlightedWords: "[% Koha.Preference('NotHighlightedWords') | html %]",
1650
            NotHighlightedWords: "[% Koha.Preference('NotHighlightedWords') | html %]",
1651
            GoogleJackets: [% Koha.Preference('GoogleJackets') ? 1 : 0 | html %],
1651
            GoogleJackets: [% Koha.Preference('GoogleJackets') ? 1 : 0 | html %],
Lines 1705-1711 Link Here
1705
        });
1705
        });
1706
        window.emojiPicker.discover();
1706
        window.emojiPicker.discover();
1707
1707
1708
        if (prefs.OpacHighlightedWords){
1708
        if (Koha.prefs.OpacHighlightedWords){
1709
            var q_array = new Array();  // holds search terms if available
1709
            var q_array = new Array();  // holds search terms if available
1710
1710
1711
            function highlightOff() {
1711
            function highlightOff() {
Lines 1718-1724 Link Here
1718
                    if ( q_array[x].length > 0 ) {
1718
                    if ( q_array[x].length > 0 ) {
1719
                        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
1719
                        q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1");
1720
                        q_array[x] = q_array[x].toLowerCase();
1720
                        q_array[x] = q_array[x].toLowerCase();
1721
                        var myStopwords = prefs.NotHighlightedWords.toLowerCase().split('|');
1721
                        var myStopwords = Koha.prefs.NotHighlightedWords.toLowerCase().split('|');
1722
                        if( $.inArray(q_array[x], myStopwords) == -1 ) {
1722
                        if( $.inArray(q_array[x], myStopwords) == -1 ) {
1723
                            $("#marcnotes").highlight(q_array[x]);
1723
                            $("#marcnotes").highlight(q_array[x]);
1724
                            $(".title").highlight(q_array[x]);
1724
                            $(".title").highlight(q_array[x]);
Lines 1871-1889 Link Here
1871
            var loaded = 1;
1871
            var loaded = 1;
1872
            counter_wait++;
1872
            counter_wait++;
1873
1873
1874
            if (prefs.GoogleJackets){
1874
            if (Koha.prefs.GoogleJackets){
1875
                if ( loaded ) {
1875
                if ( loaded ) {
1876
                    loaded = KOHA.Google.done;
1876
                    loaded = KOHA.Google.done;
1877
                }
1877
                }
1878
            }
1878
            }
1879
1879
1880
            if (prefs.OpenLibraryCovers){
1880
            if (Koha.prefs.OpenLibraryCovers){
1881
                if ( loaded ) {
1881
                if ( loaded ) {
1882
                    loaded = KOHA.OpenLibrary.done;
1882
                    loaded = KOHA.OpenLibrary.done;
1883
                }
1883
                }
1884
            }
1884
            }
1885
1885
1886
            if (prefs.OpacCoce && prefs.CoceProviders){
1886
            if (Koha.prefs.OpacCoce && Koha.prefs.CoceProviders){
1887
                if ( loaded ) {
1887
                if ( loaded ) {
1888
                    loaded = KOHA.coce.done;
1888
                    loaded = KOHA.coce.done;
1889
                }
1889
                }
Lines 1905-1911 Link Here
1905
1905
1906
        $(document).ready(function() {
1906
        $(document).ready(function() {
1907
1907
1908
            if (prefs.OPACDetailQRCode){
1908
            if (Koha.prefs.OPACDetailQRCode){
1909
1909
1910
                var link_canonical = document.querySelector("link[rel=canonical]");
1910
                var link_canonical = document.querySelector("link[rel=canonical]");
1911
1911
Lines 1953-1959 Link Here
1953
                }
1953
                }
1954
            }
1954
            }
1955
1955
1956
            if (prefs.OpacBrowseResults && busc){
1956
            if (Koha.prefs.OpacBrowseResults && busc){
1957
                $(".l_Results").show();
1957
                $(".l_Results").show();
1958
                $("#a_listResults").on("click", function(e){
1958
                $("#a_listResults").on("click", function(e){
1959
                    e.preventDefault();
1959
                    e.preventDefault();
Lines 2004-2010 Link Here
2004
                dTables.DataTable().responsive.recalc();
2004
                dTables.DataTable().responsive.recalc();
2005
            } );
2005
            } );
2006
2006
2007
            if (prefs.TagsInputEnabled && loggedinusername){
2007
            if (Koha.prefs.TagsInputEnabled && loggedinusername){
2008
                    $(".tag_add").click(function(){
2008
                    $(".tag_add").click(function(){
2009
                        var thisid = $(this).attr("id");
2009
                        var thisid = $(this).attr("id");
2010
                        thisid = thisid.replace("tag_add","");
2010
                        thisid = thisid.replace("tag_add","");
Lines 2036-2042 Link Here
2036
            }
2036
            }
2037
2037
2038
            if (query_desc !==""){
2038
            if (query_desc !==""){
2039
                if (prefs.OpacHighlightedWords){
2039
                if (Koha.prefs.OpacHighlightedWords){
2040
                    var query_desc_replaced = query_desc.replace("'", "\'").replace('\n', '\\n').replace('\r', '\\r');
2040
                    var query_desc_replaced = query_desc.replace("'", "\'").replace('\n', '\\n').replace('\r', '\\r');
2041
                    q_array = query_desc_replaced.split(" ");
2041
                    q_array = query_desc_replaced.split(" ");
2042
                    q_array = q_array.filter(function(n){ return n }); // Remove empty strings
2042
                    q_array = q_array.filter(function(n){ return n }); // Remove empty strings
Lines 2046-2064 Link Here
2046
                }
2046
                }
2047
            }
2047
            }
2048
2048
2049
            if (prefs.GoogleJackets){
2049
            if (Koha.prefs.GoogleJackets){
2050
                KOHA.Google.GetCoverFromIsbn(prefs.OPACURLOpenInNewWindow);
2050
                KOHA.Google.GetCoverFromIsbn(Koha.prefs.OPACURLOpenInNewWindow);
2051
            }
2051
            }
2052
2052
2053
            if (prefs.OpacCoce && prefs.CoceProviders){
2053
            if (Koha.prefs.OpacCoce && Koha.prefs.CoceProviders){
2054
                KOHA.coce.getURL(prefs.CoceHost, prefs.CoceProviders, $('#biblio-cover-slider') );
2054
                KOHA.coce.getURL(Koha.prefs.CoceHost, Koha.prefs.CoceProviders, $('#biblio-cover-slider') );
2055
            }
2055
            }
2056
2056
2057
            if (prefs.OpenLibraryCovers){
2057
            if (Koha.prefs.OpenLibraryCovers){
2058
                KOHA.OpenLibrary.GetCoverFromIsbn();
2058
                KOHA.OpenLibrary.GetCoverFromIsbn();
2059
            }
2059
            }
2060
2060
2061
            if (prefs.OPACShelfBrowser){
2061
            if (Koha.prefs.OPACShelfBrowser){
2062
                // Focus on shelf browser if present
2062
                // Focus on shelf browser if present
2063
                var shelfbrowser = $("#shelfbrowser");
2063
                var shelfbrowser = $("#shelfbrowser");
2064
                if (shelfbrowser.length > 0) {
2064
                if (shelfbrowser.length > 0) {
Lines 2084-2096 Link Here
2084
                            },
2084
                            },
2085
                            success: function(data){
2085
                            success: function(data){
2086
                                $("#shelfbrowser").replaceWith(data);
2086
                                $("#shelfbrowser").replaceWith(data);
2087
                                if (prefs.GoogleJackets){
2087
                                if (Koha.prefs.GoogleJackets){
2088
                                    KOHA.Google.GetCoverFromIsbn(prefs.OPACURLOpenInNewWindow);
2088
                                    KOHA.Google.GetCoverFromIsbn(Koha.prefs.OPACURLOpenInNewWindow);
2089
                                }
2089
                                }
2090
                                if (prefs.OpacCoce && prefs.CoceProviders){
2090
                                if (Koha.prefs.OpacCoce && Koha.prefs.CoceProviders){
2091
                                    KOHA.coce.getURL(prefs.CoceHost, prefs.CoceProviders, $("#bibliodescriptions"));
2091
                                    KOHA.coce.getURL(Koha.prefs.CoceHost, Koha.prefs.CoceProviders, $("#bibliodescriptions"));
2092
                                }
2092
                                }
2093
                                if (prefs.OpenLibraryCovers){
2093
                                if (Koha.prefs.OpenLibraryCovers){
2094
                                    KOHA.OpenLibrary.GetCoverFromIsbn();
2094
                                    KOHA.OpenLibrary.GetCoverFromIsbn();
2095
                                }
2095
                                }
2096
                                if (OPACLocalCoverImages){
2096
                                if (OPACLocalCoverImages){
Lines 2109-2124 Link Here
2109
                            },
2109
                            },
2110
                            success: function(data){
2110
                            success: function(data){
2111
                                $("#shelfbrowser").replaceWith(data);
2111
                                $("#shelfbrowser").replaceWith(data);
2112
                                if (prefs.GoogleJackets){
2112
                                if (Koha.prefs.GoogleJackets){
2113
                                    KOHA.Google.GetCoverFromIsbn(prefs.OPACURLOpenInNewWindow);
2113
                                    KOHA.Google.GetCoverFromIsbn(Koha.prefs.OPACURLOpenInNewWindow);
2114
                                }
2114
                                }
2115
                                if (prefs.OpacCoce && prefs.CoceProviders){
2115
                                if (Koha.prefs.OpacCoce && Koha.prefs.CoceProviders){
2116
                                    KOHA.coce.getURL(prefs.CoceHost, prefs.CoceProviders, $("#bibliodescriptions"));
2116
                                    KOHA.coce.getURL(Koha.prefs.CoceHost, Koha.prefs.CoceProviders, $("#bibliodescriptions"));
2117
                                }
2117
                                }
2118
                                if (prefs.OpenLibraryCovers){
2118
                                if (Koha.prefs.OpenLibraryCovers){
2119
                                    KOHA.OpenLibrary.GetCoverFromIsbn();
2119
                                    KOHA.OpenLibrary.GetCoverFromIsbn();
2120
                                }
2120
                                }
2121
                                if (prefs.OPACLocalCoverImages){
2121
                                if (Koha.prefs.OPACLocalCoverImages){
2122
                                    KOHA.LocalCover.GetCoverFromBibnumber(true);
2122
                                    KOHA.LocalCover.GetCoverFromBibnumber(true);
2123
                                }
2123
                                }
2124
                            }
2124
                            }
Lines 2134-2140 Link Here
2134
        });
2134
        });
2135
2135
2136
        $(document).ready(function() {
2136
        $(document).ready(function() {
2137
            if( prefs.OPACPopupAuthorsSearch ){
2137
            if( Koha.prefs.OPACPopupAuthorsSearch ){
2138
                var terms = {
2138
                var terms = {
2139
                    contributors : {
2139
                    contributors : {
2140
                        "label" : "author",
2140
                        "label" : "author",
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-2 / +2 lines)
Lines 362-368 Link Here
362
[% BLOCK jsinclude %]
362
[% BLOCK jsinclude %]
363
    [% INCLUDE 'datatables.inc' %]
363
    [% INCLUDE 'datatables.inc' %]
364
    <script>
364
    <script>
365
        addPrefs({
365
        Koha.addPrefs({
366
            PhoneNotification: [% Koha.Preference('PhoneNotification') ? 1 : 0 | html %],
366
            PhoneNotification: [% Koha.Preference('PhoneNotification') ? 1 : 0 | html %],
367
            TalkingTechItivaPhoneNotification: [% Koha.Preference('TalkingTechItivaPhoneNotification') ? 1 : 0 | html %],
367
            TalkingTechItivaPhoneNotification: [% Koha.Preference('TalkingTechItivaPhoneNotification') ? 1 : 0 | html %],
368
        });
368
        });
Lines 370-376 Link Here
370
    <script>
370
    <script>
371
        $(document).ready(function () {
371
        $(document).ready(function () {
372
            function toggle_digest(id) {
372
            function toggle_digest(id) {
373
                let phone_checked = prefs.TalkingTechItivaPhoneNotification ? false : prefs.PhoneNotification ? $("#phone" + id).prop("checked") : false;
373
                let phone_checked = Koha.prefs.TalkingTechItivaPhoneNotification ? false : Koha.prefs.PhoneNotification ? $("#phone" + id).prop("checked") : false;
374
374
375
                if ($("#email" + id).prop("checked") || $("#sms" + id).prop("checked") || phone_checked) {
375
                if ($("#email" + id).prop("checked") || $("#sms" + id).prop("checked") || phone_checked) {
376
                    $("#digest" + id)
376
                    $("#digest" + id)
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt (-2 / +2 lines)
Lines 229-241 Link Here
229
[% BLOCK jsinclude %]
229
[% BLOCK jsinclude %]
230
    [% INCLUDE 'datatables.inc' %]
230
    [% INCLUDE 'datatables.inc' %]
231
    <script>
231
    <script>
232
        addPrefs({
232
        Koha.addPrefs({
233
            GoogleJackets: [% Koha.Preference('GoogleJackets') ? 1 : 0 | html %],
233
            GoogleJackets: [% Koha.Preference('GoogleJackets') ? 1 : 0 | html %],
234
        });
234
        });
235
    </script>
235
    </script>
236
    <script>
236
    <script>
237
        $(document).ready(function () {
237
        $(document).ready(function () {
238
            if (prefs.GoogleJackets) {
238
            if (Koha.prefs.GoogleJackets) {
239
                KOHA.Google.GetCoverFromIsbn();
239
                KOHA.Google.GetCoverFromIsbn();
240
            }
240
            }
241
            $("#order").change(function () {
241
            $("#order").change(function () {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-5 / +5 lines)
Lines 1053-1059 Link Here
1053
    <script>
1053
    <script>
1054
        const tab = "[% tab | html %]";
1054
        const tab = "[% tab | html %]";
1055
        const logged_in_user_borrowernumber = "[% borrowernumber | html %]";
1055
        const logged_in_user_borrowernumber = "[% borrowernumber | html %]";
1056
        addPrefs({
1056
        Koha.addPrefs({
1057
            OpacRenewalAllowed: [% Koha.Preference('OpacRenewalAllowed') ? 1 : 0 | html %],
1057
            OpacRenewalAllowed: [% Koha.Preference('OpacRenewalAllowed') ? 1 : 0 | html %],
1058
            GoogleJackets: [% Koha.Preference('GoogleJackets') ? 1 : 0 | html %],
1058
            GoogleJackets: [% Koha.Preference('GoogleJackets') ? 1 : 0 | html %],
1059
            AllowCheckoutNotes: [% Koha.Preference('AllowCheckoutNotes') ? 1 : 0 | html %],
1059
            AllowCheckoutNotes: [% Koha.Preference('AllowCheckoutNotes') ? 1 : 0 | html %],
Lines 1068-1074 Link Here
1068
        function tableInit(tableId) {
1068
        function tableInit(tableId) {
1069
            if (tableId == "checkoutst") {
1069
            if (tableId == "checkoutst") {
1070
                $(".dt-buttons").append('<button type="button" class="dt-button buttons-ical" id="buttons-ics">iCal</button> ');
1070
                $(".dt-buttons").append('<button type="button" class="dt-button buttons-ical" id="buttons-ics">iCal</button> ');
1071
                if (prefs.OpacRenewalAllowed && can_renew && !is_debarred) {
1071
                if (Koha.prefs.OpacRenewalAllowed && can_renew && !is_debarred) {
1072
                    $(".dt-buttons").append(
1072
                    $(".dt-buttons").append(
1073
                        '<button id="renewselected_link" class="dt-button buttons-renew"><i class="fa fa-check" aria-hidden="true"></i> ' +
1073
                        '<button id="renewselected_link" class="dt-button buttons-renew"><i class="fa fa-check" aria-hidden="true"></i> ' +
1074
                            _("Renew selected") +
1074
                            _("Renew selected") +
Lines 1254-1263 Link Here
1254
                location.href = "/cgi-bin/koha/opac-ics.pl";
1254
                location.href = "/cgi-bin/koha/opac-ics.pl";
1255
            });
1255
            });
1256
1256
1257
            if (prefs.GoogleJackets) {
1257
            if (Koha.prefs.GoogleJackets) {
1258
                KOHA.Google.GetCoverFromIsbn();
1258
                KOHA.Google.GetCoverFromIsbn();
1259
            }
1259
            }
1260
            if (prefs.OpacRenewalAllowed && can_renew && !is_debarred) {
1260
            if (Koha.prefs.OpacRenewalAllowed && can_renew && !is_debarred) {
1261
                $("#renewselected").submit(function () {
1261
                $("#renewselected").submit(function () {
1262
                    valid = false;
1262
                    valid = false;
1263
                    $("input[type=checkbox]").each(function () {
1263
                    $("input[type=checkbox]").each(function () {
Lines 1280-1286 Link Here
1280
                });
1280
                });
1281
            }
1281
            }
1282
1282
1283
            if (prefs.AllowCheckoutNotes) {
1283
            if (Koha.prefs.AllowCheckoutNotes) {
1284
                /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */
1284
                /* If JS enabled, show button, otherwise show link to redirect to a page where note can be submitted */
1285
                $(".nonjs_submitnote").hide();
1285
                $(".nonjs_submitnote").hide();
1286
1286
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt (-3 / +3 lines)
Lines 406-412 Link Here
406
    [% BLOCK jsinclude %]
406
    [% BLOCK jsinclude %]
407
        [% INCLUDE 'datatables.inc' %]
407
        [% INCLUDE 'datatables.inc' %]
408
        <script>
408
        <script>
409
            addPrefs({
409
            Koha.addPrefs({
410
                SelfCheckTimeout: "[% Koha.Preference('SelfCheckTimeout') | html %]",
410
                SelfCheckTimeout: "[% Koha.Preference('SelfCheckTimeout') | html %]",
411
                SelfCheckReceiptPrompt: [% Koha.Preference('SelfCheckReceiptPrompt') ? 1 : 0 | html %],
411
                SelfCheckReceiptPrompt: [% Koha.Preference('SelfCheckReceiptPrompt') ? 1 : 0 | html %],
412
            });
412
            });
Lines 445-451 Link Here
445
            function sco_init() {
445
            function sco_init() {
446
                mainTimeout = setTimeout(function () {
446
                mainTimeout = setTimeout(function () {
447
                    location.href = "/cgi-bin/koha/sco/sco-main.pl?op=logout";
447
                    location.href = "/cgi-bin/koha/sco/sco-main.pl?op=logout";
448
                }, prefs.SelfCheckTimeout);
448
                }, Koha.prefs.SelfCheckTimeout);
449
            }
449
            }
450
            function dofocus() {
450
            function dofocus() {
451
                // named function req'd for body onload event by some FF and IE7 security models
451
                // named function req'd for body onload event by some FF and IE7 security models
Lines 518-524 Link Here
518
                $("#logout_form").on("click", function (e) {
518
                $("#logout_form").on("click", function (e) {
519
                    e.preventDefault(e);
519
                    e.preventDefault(e);
520
                    clearTimeout(mainTimeout);
520
                    clearTimeout(mainTimeout);
521
                    if (prefs.SelfCheckReceiptPrompt) {
521
                    if (Koha.prefs.SelfCheckReceiptPrompt) {
522
                        confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), function (result) {
522
                        confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), function (result) {
523
                            if (result) {
523
                            if (result) {
524
                                var win = window.open("/cgi-bin/koha/sco/printslip.pl?print=qslip");
524
                                var win = window.open("/cgi-bin/koha/sco/printslip.pl?print=qslip");
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/stores.js (-8 / +5 lines)
Lines 1-19 Link Here
1
(function () {
1
(function () {
2
    const permissions = (window.permissions = window.permissions || {});
2
    const app = (window.Koha ??= {});
3
3
4
    window.addPermissions = function (perms) {
4
    const permissions = (app.permissions ??= {});
5
    app.addPermissions = function (perms) {
5
        for (const key in perms) {
6
        for (const key in perms) {
6
            if (Object.prototype.hasOwnProperty.call(perms, key)) {
7
            if (Object.prototype.hasOwnProperty.call(perms, key)) {
7
                permissions[key] = perms[key];
8
                permissions[key] = perms[key];
8
            }
9
            }
9
        }
10
        }
10
    };
11
    };
11
})();
12
13
(function () {
14
    const prefs = (window.prefs = window.prefs || {});
15
12
16
    window.addPrefs = function (sysprefs) {
13
    const prefs = (app.prefs = app.prefs || {});
14
    app.addPrefs = function (sysprefs) {
17
        for (const key in sysprefs) {
15
        for (const key in sysprefs) {
18
            if (Object.prototype.hasOwnProperty.call(sysprefs, key)) {
16
            if (Object.prototype.hasOwnProperty.call(sysprefs, key)) {
19
                prefs[key] = sysprefs[key];
17
                prefs[key] = sysprefs[key];
20
- 

Return to bug 41653