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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-2 / +48 lines)
Lines 930-936 Link Here
930
                                [% IF ( template_id ) %]
930
                                [% IF ( template_id ) %]
931
                                    <input type="hidden" name="template" value="[% template_id | html %]" />
931
                                    <input type="hidden" name="template" value="[% template_id | html %]" />
932
                                [% END %]
932
                                [% END %]
933
                                <button type="submit" class="btn btn-primary">Run the report</button>
933
                                <button type="submit" class="btn btn-primary"><i class="fa fa-play"></i> Run the report</button>
934
                            </fieldset>
934
                            </fieldset>
935
                        </form>
935
                        </form>
936
                    [% END # / IF ( auth_val_error ) %]
936
                    [% END # / IF ( auth_val_error ) %]
Lines 2005-2010 Link Here
2005
            }
2005
            }
2006
        }
2006
        }
2007
2007
2008
        const toggleReportRunButton = (element => {
2009
            if ($(element).attr('disabled') === undefined) {
2010
                $(element).attr('disabled', 'disabled');
2011
                $(element).addClass('disabled');
2012
                $(element).find('i.fa-play').first().replaceWith('<i class=\"fa fa-spinner fa-spin\" style=\"--fa-animation-duration: 2s;\"></i>');
2013
            } else {
2014
                $(element).removeAttr('disabled');
2015
                $(element).removeClass('disabled');
2016
                $(element).find('i.fa-spinner').first().replaceWith('<i class=\"fa fa-play\"></i>');
2017
            }
2018
        });
2019
2008
        $(document).ready(function(){
2020
        $(document).ready(function(){
2009
2021
2010
            var activeTab = localStorage.getItem("sql_reports_activetab");
2022
            var activeTab = localStorage.getItem("sql_reports_activetab");
Lines 2480-2485 Link Here
2480
                selectField.style.minWidth = '320px';
2492
                selectField.style.minWidth = '320px';
2481
                $(selectField).select2();
2493
                $(selectField).select2();
2482
            });
2494
            });
2495
2496
            $('a[href*="/cgi-bin/koha/reports/guided_reports.pl"]').each((idx, element) => {
2497
                const params = new URLSearchParams($(element).attr('href'));
2498
                const op = params.get('op');
2499
2500
                if (op !== 'run') {
2501
                    return;
2502
                }
2503
2504
                $(element).on('click', event => {
2505
                    event.preventDefault();
2506
                    const href = $(element).attr('href');
2507
2508
                    toggleReportRunButton(element);
2509
                    setTimeout(() => {
2510
                        toggleReportRunButton(element);
2511
                    }, 120000);
2512
2513
                    window.location.href = href;
2514
                    return false;
2515
                });
2516
            });
2517
2518
            $('#report_param_form').on('submit', event => {
2519
                const button = $('button[type="submit"]');
2520
2521
                if (button.length < 1) {
2522
                    return;
2523
                }
2524
2525
                toggleReportRunButton(button);
2526
                setTimeout(() => {
2527
                    toggleReportRunButton(button);
2528
                }, 120000);
2529
            });
2483
        });
2530
        });
2484
2531
2485
        $("#toggle_auto_links").on("click", function(e){
2532
        $("#toggle_auto_links").on("click", function(e){
2486
- 

Return to bug 40896