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 349-357 Link Here
349
        function deleteIssues(subscriptionid) {
349
        function deleteIssues(subscriptionid) {
350
            var serialschecked = $("form[name='edition'] input[name='serialid']:checked");
350
            var serialschecked = $("form[name='edition'] input[name='serialid']:checked");
351
            if (serialschecked.length > 0) {
351
            if (serialschecked.length > 0) {
352
                var location = 'serials-collection.pl?subscriptionid='+subscriptionid+'&op=delete_confirm';
352
                var location = "serials-collection.pl?subscriptionid=" + subscriptionid + "&op=delete_confirm";
353
                for (i=0; i < serialschecked.length; i++) {
353
                for (i = 0; i < serialschecked.length; i++) {
354
                    location += '&serialid=' + serialschecked[i].value;
354
                    location += "&serialid=" + serialschecked[i].value;
355
                }
355
                }
356
                document.location = location;
356
                document.location = location;
357
            } else {
357
            } else {
Lines 359-366 Link Here
359
            }
359
            }
360
        }
360
        }
361
361
362
        $(document).ready(function() {
362
        $(document).ready(function () {
363
            if( $("#subscription_years .tab-pane.active").length < 1 ){
363
            if ($("#subscription_years .tab-pane.active").length < 1) {
364
                $("#subscription_years a:first").tab("show");
364
                $("#subscription_years a:first").tab("show");
365
            }
365
            }
366
            $(".subscription-year-table").kohaTable({
366
            $(".subscription-year-table").kohaTable({
Lines 372-413 Link Here
372
                searching: false,
372
                searching: false,
373
            });
373
            });
374
374
375
            $(".CheckAll").on("click", function(e){
375
            $(".CheckAll").on("click", function (e) {
376
                e.preventDefault();
376
                e.preventDefault();
377
                var years = $(this).data("year");
377
                var years = $(this).data("year");
378
                $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", true );
378
                $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", true);
379
            });
379
            });
380
380
381
            $(".CheckNone").on("click", function(e){
381
            $(".CheckNone").on("click", function (e) {
382
                e.preventDefault();
382
                e.preventDefault();
383
                var years = $(this).data("year");
383
                var years = $(this).data("year");
384
                $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", false );
384
                $("#subscription-year-" + years + "_panel" + " input:checkbox").prop("checked", false);
385
            });
385
            });
386
386
387
            $(".generatenext").on("click", function(e){
387
            $(".generatenext").on("click", function (e) {
388
                e.preventDefault();
388
                e.preventDefault();
389
                var subscriptionid = $(this).data("subscriptionid");
389
                var subscriptionid = $(this).data("subscriptionid");
390
                generateNext( subscriptionid );
390
                generateNext(subscriptionid);
391
            });
391
            });
392
392
393
            $(".subscription_renew").on("click", function(e){
393
            $(".subscription_renew").on("click", function (e) {
394
                e.preventDefault();
394
                e.preventDefault();
395
                var subscriptionid = $(this).data("subscriptionid");
395
                var subscriptionid = $(this).data("subscriptionid");
396
                popup( subscriptionid );
396
                popup(subscriptionid);
397
            });
397
            });
398
398
399
            $(".print_list").on("click", function(e){
399
            $(".print_list").on("click", function (e) {
400
                e.preventDefault();
400
                e.preventDefault();
401
                var url = $(this).attr("href");
401
                var url = $(this).attr("href");
402
                window.open( url,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
402
                window.open(url, "PrintSlip", "width=500,height=500,toolbar=no,scrollbars=yes");
403
            });
403
            });
404
404
405
            $('#multi_receiving').on('show', function () {
405
            $("#multi_receiving").on("show", function () {
406
               $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
406
                $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
407
            });
407
            });
408
408
409
            $("form[name='edition']").on('submit', function(e){
409
            $("form[name='edition']").on("submit", function (e) {
410
                if ( $(this).find("input[name='serialid']:checked").size() == 0 ) {
410
                if ($(this).find("input[name='serialid']:checked").size() == 0) {
411
                    e.preventDefault();
411
                    e.preventDefault();
412
                    alert(_("You must select at least one serial to edit"));
412
                    alert(_("You must select at least one serial to edit"));
413
                    return 0;
413
                    return 0;
Lines 416-422 Link Here
416
            });
416
            });
417
        });
417
        });
418
    </script>
418
    </script>
419
420
    <script>
419
    <script>
421
        $(document).ready(function() {
420
        $(document).ready(function() {
422
            $(".delete-issues").on("click", function(e){
421
            $(".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