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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-3 / +5 lines)
Lines 221-227 Link Here
221
        var table_settings = [% TablesSettings.GetTableSettings( "serials", "claims", "claimst", "json" ) | $raw %];
221
        var table_settings = [% TablesSettings.GetTableSettings( "serials", "claims", "claimst", "json" ) | $raw %];
222
        const vendor_id = "[% supplierid | html %]";
222
        const vendor_id = "[% supplierid | html %]";
223
    </script>
223
    </script>
224
225
    <script>
224
    <script>
226
        var sTable;
225
        var sTable;
227
        $(document).ready(function () {
226
        $(document).ready(function () {
Lines 231-238 Link Here
231
                    autowidth: false,
230
                    autowidth: false,
232
                    order: [[7, "asc"]],
231
                    order: [[7, "asc"]],
233
                    paging: false,
232
                    paging: false,
234
                    orderCellsTop: true
233
                    orderCellsTop: true,
235
                }, table_settings, 1);
234
                },
235
                table_settings,
236
                1
237
            );
236
238
237
            // Checkboxes : Select All / None
239
            // Checkboxes : Select All / None
238
            $("span.checkall").html('<input type="checkbox" name="CheckAll"> ' + _("Check all") + "</input>");
240
            $("span.checkall").html('<input type="checkbox" name="CheckAll"> ' + _("Check all") + "</input>");
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt (-20 / +19 lines)
Lines 345-353 Link Here
345
        function deleteIssues(subscriptionid) {
345
        function deleteIssues(subscriptionid) {
346
            var serialschecked = $("form[name='edition'] input[name='serialid']:checked");
346
            var serialschecked = $("form[name='edition'] input[name='serialid']:checked");
347
            if (serialschecked.length > 0) {
347
            if (serialschecked.length > 0) {
348
                var location = 'serials-collection.pl?subscriptionid='+subscriptionid+'&op=delete_confirm';
348
                var location = "serials-collection.pl?subscriptionid=" + subscriptionid + "&op=delete_confirm";
349
                for (i=0; i < serialschecked.length; i++) {
349
                for (i = 0; i < serialschecked.length; i++) {
350
                    location += '&serialid=' + serialschecked[i].value;
350
                    location += "&serialid=" + serialschecked[i].value;
351
                }
351
                }
352
                document.location = location;
352
                document.location = location;
353
            } else {
353
            } else {
Lines 355-362 Link Here
355
            }
355
            }
356
        }
356
        }
357
357
358
        $(document).ready(function() {
358
        $(document).ready(function () {
359
            if( $("#subscription_years .tab-pane.active").length < 1 ){
359
            if ($("#subscription_years .tab-pane.active").length < 1) {
360
                $("#subscription_years a:first").tab("show");
360
                $("#subscription_years a:first").tab("show");
361
            }
361
            }
362
            $(".subscription-year-table").kohaTable({
362
            $(".subscription-year-table").kohaTable({
Lines 368-409 Link Here
368
                searching: false,
368
                searching: false,
369
            });
369
            });
370
370
371
            $(".CheckAll").on("click", function(e){
371
            $(".CheckAll").on("click", function (e) {
372
                e.preventDefault();
372
                e.preventDefault();
373
                var years = $(this).data("year");
373
                var years = $(this).data("year");
374
                $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", true );
374
                $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", true);
375
            });
375
            });
376
376
377
            $(".CheckNone").on("click", function(e){
377
            $(".CheckNone").on("click", function (e) {
378
                e.preventDefault();
378
                e.preventDefault();
379
                var years = $(this).data("year");
379
                var years = $(this).data("year");
380
                $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", false );
380
                $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", false);
381
            });
381
            });
382
382
383
            $(".generatenext").on("click", function(e){
383
            $(".generatenext").on("click", function (e) {
384
                e.preventDefault();
384
                e.preventDefault();
385
                var subscriptionid = $(this).data("subscriptionid");
385
                var subscriptionid = $(this).data("subscriptionid");
386
                generateNext( subscriptionid );
386
                generateNext(subscriptionid);
387
            });
387
            });
388
388
389
            $(".subscription_renew").on("click", function(e){
389
            $(".subscription_renew").on("click", function (e) {
390
                e.preventDefault();
390
                e.preventDefault();
391
                var subscriptionid = $(this).data("subscriptionid");
391
                var subscriptionid = $(this).data("subscriptionid");
392
                popup( subscriptionid );
392
                popup(subscriptionid);
393
            });
393
            });
394
394
395
            $(".print_list").on("click", function(e){
395
            $(".print_list").on("click", function (e) {
396
                e.preventDefault();
396
                e.preventDefault();
397
                var url = $(this).attr("href");
397
                var url = $(this).attr("href");
398
                window.open( url,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
398
                window.open(url, "PrintSlip", "width=500,height=500,toolbar=no,scrollbars=yes");
399
            });
399
            });
400
400
401
            $('#multi_receiving').on('show', function () {
401
            $("#multi_receiving").on("show", function () {
402
               $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
402
                $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
403
            });
403
            });
404
404
405
            $("form[name='edition']").on('submit', function(e){
405
            $("form[name='edition']").on("submit", function (e) {
406
                if ( $(this).find("input[name='serialid']:checked").size() == 0 ) {
406
                if ($(this).find("input[name='serialid']:checked").size() == 0) {
407
                    e.preventDefault();
407
                    e.preventDefault();
408
                    alert(_("You must select at least one serial to edit"));
408
                    alert(_("You must select at least one serial to edit"));
409
                    return 0;
409
                    return 0;
Lines 412-418 Link Here
412
            });
412
            });
413
        });
413
        });
414
    </script>
414
    </script>
415
416
    <script>
415
    <script>
417
        $(document).ready(function() {
416
        $(document).ready(function() {
418
            $(".delete-issues").on("click", function(e){
417
            $(".delete-issues").on("click", function(e){
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt (-27 / +34 lines)
Lines 287-361 Link Here
287
    </script>
287
    </script>
288
    [% Asset.js("js/serials-toolbar.js") | $raw %]
288
    [% Asset.js("js/serials-toolbar.js") | $raw %]
289
    <script>
289
    <script>
290
        function itemSelectionBuildEditLink( tab ) {
290
        function itemSelectionBuildEditLink(tab) {
291
            var subscription_ids = new Array();
291
            var subscription_ids = new Array();
292
            $( "input:checkbox." + tab + ":checked" ).each(function() {
292
            $("input:checkbox." + tab + ":checked").each(function () {
293
                subscription_ids.push( $(this).val() );
293
                subscription_ids.push($(this).val());
294
            });
294
            });
295
295
296
            if (subscription_ids.length > 0) {
296
            if (subscription_ids.length > 0) {
297
                var url = edit_action_link;
297
                var url = edit_action_link;
298
                url += '&subscriptionid=' + subscription_ids.join('&subscriptionid=');
298
                url += "&subscriptionid=" + subscription_ids.join("&subscriptionid=");
299
                location.href = url;
299
                location.href = url;
300
            } else {
300
            } else {
301
                return false;
301
                return false;
302
            }
302
            }
303
        }
303
        }
304
304
305
        function enableCheckboxActions( tab ){
305
        function enableCheckboxActions(tab) {
306
            // Enable/disable controls if checkboxes are checked
306
            // Enable/disable controls if checkboxes are checked
307
            var checked_count = $("input:checkbox." + tab + ":checked").length;
307
            var checked_count = $("input:checkbox." + tab + ":checked").length;
308
            if( checked_count > 0 ){
308
            if (checked_count > 0) {
309
                $(".itemselection_actions." + tab ).show();
309
                $(".itemselection_actions." + tab).show();
310
            } else {
310
            } else {
311
                $(".itemselection_actions." + tab ).hide();
311
                $(".itemselection_actions." + tab).hide();
312
            }
312
            }
313
        }
313
        }
314
314
315
        $(document).ready(function() {
315
        $(document).ready(function () {
316
            var osrlt = $("#opened_panel table").kohaTable({
316
            var osrlt = $("#opened_panel table").kohaTable(
317
                pagingType: "full",
317
                {
318
                order: [[2, "asc"]],
318
                    pagingType: "full",
319
            }, null, true);
319
                    order: [[2, "asc"]],
320
                },
321
                null,
322
                true
323
            );
320
324
321
            var csrlt = $("#closed_panel table").kohaTable({
325
            var csrlt = $("#closed_panel table").kohaTable(
322
                // FIXME sort function of additional_fields!
326
                {
323
                order: [[2, "asc"]],
327
                    // FIXME sort function of additional_fields!
324
                pagingType: "full",
328
                    order: [[2, "asc"]],
325
            }, null, true);
329
                    pagingType: "full",
330
                },
331
                null,
332
                true
333
            );
326
334
327
            var manarlt = $("#mana_results_datatable").kohaTable({
335
            var manarlt = $("#mana_results_datatable").kohaTable({
328
                pagingType: "full",
336
                pagingType: "full",
329
            });
337
            });
330
338
331
            $("#reopensub").click(function(){
339
            $("#reopensub").click(function () {
332
                return confirm(_("Are you sure you want to reopen this subscription?"));
340
                return confirm(_("Are you sure you want to reopen this subscription?"));
333
            });
341
            });
334
342
335
            $('.select-all, .clear-all').on('click', function(e) {
343
            $(".select-all, .clear-all").on("click", function (e) {
336
                e.preventDefault();
344
                e.preventDefault();
337
                var tab = $(this).data("tab");
345
                var tab = $(this).data("tab");
338
                var checkboxes = $("input:checkbox." + tab );
346
                var checkboxes = $("input:checkbox." + tab);
339
                checkboxes.prop('checked', $(this).hasClass('select-all')).change();
347
                checkboxes.prop("checked", $(this).hasClass("select-all")).change();
340
                enableCheckboxActions(tab);
348
                enableCheckboxActions(tab);
341
            });
349
            });
342
350
343
            enableCheckboxActions("opened");
351
            enableCheckboxActions("opened");
344
            enableCheckboxActions("closed");
352
            enableCheckboxActions("closed");
345
353
346
            $("input[name='subscriptionid'][type='checkbox']").change(function() {
354
            $("input[name='subscriptionid'][type='checkbox']").change(function () {
347
                var tab = $(this).attr("class");
355
                var tab = $(this).attr("class");
348
                enableCheckboxActions( tab );
356
                enableCheckboxActions(tab);
349
            });
357
            });
350
358
351
            $(".itemselection_action_modify").on("click", function(e){
359
            $(".itemselection_action_modify").on("click", function (e) {
352
                e.preventDefault();
360
                e.preventDefault();
353
                var tab = $(this).data("tab");
361
                var tab = $(this).data("tab");
354
                itemSelectionBuildEditLink( tab );
362
                itemSelectionBuildEditLink(tab);
355
            });
363
            });
356
        });
364
        });
357
    </script>
365
    </script>
358
359
    [% IF ( mana ) %]
366
    [% IF ( mana ) %]
360
        <script>
367
        <script>
361
            $(document).ready(function() {
368
            $(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt (-2 lines)
Lines 454-466 Link Here
454
    [% Asset.js("js/mana.js") | $raw %]
454
    [% Asset.js("js/mana.js") | $raw %]
455
    [% INCLUDE 'datatables.inc' %]
455
    [% INCLUDE 'datatables.inc' %]
456
    [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
456
    [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
457
458
    <script>
457
    <script>
459
        var table_settings = [% TablesSettings.GetTableSettings( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
458
        var table_settings = [% TablesSettings.GetTableSettings( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
460
        const has_orders = [% orders_grouped.size ? 1 : 0 | html %];
459
        const has_orders = [% orders_grouped.size ? 1 : 0 | html %];
461
        const print_routing_list_issue = "[% print_routing_list_issue | uri %]";
460
        const print_routing_list_issue = "[% print_routing_list_issue | uri %]";
462
    </script>
461
    </script>
463
464
    <script>
462
    <script>
465
        // the english words used in display purposes
463
        // the english words used in display purposes
466
        var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose hemisphere:"),_("Northern"),_("Southern",
464
        var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose hemisphere:"),_("Northern"),_("Southern",
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-numberpatterns.tt (-27 / +44 lines)
Lines 337-372 Link Here
337
                var firstacquidate = $("#firstacquidate").val();
337
                var firstacquidate = $("#firstacquidate").val();
338
                var error = 0;
338
                var error = 0;
339
                var error_msg = "";
339
                var error_msg = "";
340
                if(frequencyid == undefined || frequencyid == "") {
340
                if (frequencyid == undefined || frequencyid == "") {
341
                    error_msg += _("- Frequency is not defined") + "\n";
341
                    error_msg += _("- Frequency is not defined") + "\n";
342
                    error ++;
342
                    error++;
343
                }
343
                }
344
                if(firstacquidate == undefined || firstacquidate == "") {
344
                if (firstacquidate == undefined || firstacquidate == "") {
345
                    error_msg += _("- First publication date is not defined") + "\n";
345
                    error_msg += _("- First publication date is not defined") + "\n";
346
                    error ++;
346
                    error++;
347
                }
347
                }
348
348
349
                if(error){
349
                if (error) {
350
                    alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n"
350
                    alert(_("Cannot test prediction pattern for the following reason(s):") + "\n\n" + error_msg);
351
                        + error_msg);
352
                    return false;
351
                    return false;
353
                }
352
                }
354
353
355
                var ajaxData = {
354
                var ajaxData = {
356
                    'custompattern': true,
355
                    custompattern: true,
357
                };
356
                };
358
                var ajaxParams = [
357
                var ajaxParams = [
359
                    'firstacquidate', 'subtype', 'sublength', 'frequency', 'numberingmethod',
358
                    "firstacquidate",
360
                    'lastvalue1', 'lastvalue2', 'lastvalue3', 'add1', 'add2', 'add3',
359
                    "subtype",
361
                    'every1', 'every2', 'every3', 'innerloop1', 'innerloop2', 'innerloop3',
360
                    "sublength",
362
                    'setto1', 'setto2', 'setto3', 'numbering1', 'numbering2', 'numbering3',
361
                    "frequency",
363
                    'whenmorethan1', 'whenmorethan2', 'whenmorethan3', 'locale'
362
                    "numberingmethod",
363
                    "lastvalue1",
364
                    "lastvalue2",
365
                    "lastvalue3",
366
                    "add1",
367
                    "add2",
368
                    "add3",
369
                    "every1",
370
                    "every2",
371
                    "every3",
372
                    "innerloop1",
373
                    "innerloop2",
374
                    "innerloop3",
375
                    "setto1",
376
                    "setto2",
377
                    "setto3",
378
                    "numbering1",
379
                    "numbering2",
380
                    "numbering3",
381
                    "whenmorethan1",
382
                    "whenmorethan2",
383
                    "whenmorethan3",
384
                    "locale",
364
                ];
385
                ];
365
                for(i in ajaxParams) {
386
                for (i in ajaxParams) {
366
                    var param = ajaxParams[i];
387
                    var param = ajaxParams[i];
367
                    var value = $("#"+param).val();
388
                    var value = $("#" + param).val();
368
                    if(value.length > 0)
389
                    if (value.length > 0) ajaxData[param] = value;
369
                        ajaxData[param] = value;
370
                }
390
                }
371
391
372
                $.ajax({
392
                $.ajax({
Lines 374-387 Link Here
374
                    data: ajaxData,
394
                    data: ajaxData,
375
                    async: false,
395
                    async: false,
376
                    dataType: "text",
396
                    dataType: "text",
377
                    success: function(data) {
397
                    success: function (data) {
378
                        $("#predictionpattern").html(data);
398
                        $("#predictionpattern").html(data);
379
                    }
399
                    },
380
                });
400
                });
381
            }
401
            }
382
        </script>
402
        </script>
383
    [% END %]
403
    [% END %]
384
385
    <script>
404
    <script>
386
        function show_blocking_subs() {
405
        function show_blocking_subs() {
387
            $("#blocking_subs").show();
406
            $("#blocking_subs").show();
Lines 391-411 Link Here
391
            return confirm(_("Are you sure you want to delete this numbering pattern?"));
410
            return confirm(_("Are you sure you want to delete this numbering pattern?"));
392
        }
411
        }
393
412
394
        $(document).ready(function(){
413
        $(document).ready(function () {
395
396
            $("#numberpatternst").kohaTable({
414
            $("#numberpatternst").kohaTable({
397
                pagingType: "full",
415
                pagingType: "full",
398
            });
416
            });
399
417
400
            $(".delete_pattern").on("click",function(){
418
            $(".delete_pattern").on("click", function () {
401
                return confirmDelete();
419
                return confirmDelete();
402
            });
420
            });
403
            $("#show_blocking_subs").on("click",function(e){
421
            $("#show_blocking_subs").on("click", function (e) {
404
                e.preventDefault();
422
                e.preventDefault();
405
                $("#blocking_subs").show();
423
                $("#blocking_subs").show();
406
            });
424
            });
407
            $("#test_pattern").on("click",function(){
425
            $("#test_pattern").on("click", function () {
408
                 testPattern();
426
                testPattern();
409
            });
427
            });
410
        });
428
        });
411
    </script>
429
    </script>
412
- 

Return to bug 41578