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 959-965 Link Here
959
                                [% IF ( template_id ) %]
959
                                [% IF ( template_id ) %]
960
                                    <input type="hidden" name="template" value="[% template_id | html %]" />
960
                                    <input type="hidden" name="template" value="[% template_id | html %]" />
961
                                [% END %]
961
                                [% END %]
962
                                <button type="submit" class="btn btn-primary">Run the report</button>
962
                                <button type="submit" class="btn btn-primary"><i class="fa fa-play"></i> Run the report</button>
963
                            </fieldset>
963
                            </fieldset>
964
                        </form>
964
                        </form>
965
                    [% END # / IF ( auth_val_error ) %]
965
                    [% END # / IF ( auth_val_error ) %]
Lines 2036-2041 Link Here
2036
            }
2036
            }
2037
        }
2037
        }
2038
2038
2039
        const toggleReportRunButton = (element => {
2040
            if ($(element).attr('disabled') === undefined) {
2041
                $(element).attr('disabled', 'disabled');
2042
                $(element).addClass('disabled');
2043
                $(element).find('i.fa-play').first().replaceWith('<i class=\"fa fa-spinner fa-spin\" style=\"--fa-animation-duration: 2s;\"></i>');
2044
            } else {
2045
                $(element).removeAttr('disabled');
2046
                $(element).removeClass('disabled');
2047
                $(element).find('i.fa-spinner').first().replaceWith('<i class=\"fa fa-play\"></i>');
2048
            }
2049
        });
2050
2039
        $(document).ready(function(){
2051
        $(document).ready(function(){
2040
2052
2041
            var activeTab = localStorage.getItem("sql_reports_activetab");
2053
            var activeTab = localStorage.getItem("sql_reports_activetab");
Lines 2511-2516 Link Here
2511
                selectField.style.minWidth = '320px';
2523
                selectField.style.minWidth = '320px';
2512
                $(selectField).select2();
2524
                $(selectField).select2();
2513
            });
2525
            });
2526
2527
            $('a[href*="/cgi-bin/koha/reports/guided_reports.pl"]').each((idx, element) => {
2528
                const params = new URLSearchParams($(element).attr('href'));
2529
                const op = params.get('op');
2530
2531
                if (op !== 'run') {
2532
                    return;
2533
                }
2534
2535
                $(element).on('click', event => {
2536
                    event.preventDefault();
2537
                    const href = $(element).attr('href');
2538
2539
                    toggleReportRunButton(element);
2540
                    setTimeout(() => {
2541
                        toggleReportRunButton(element);
2542
                    }, 120000);
2543
2544
                    window.location.href = href;
2545
                    return false;
2546
                });
2547
            });
2548
2549
            $('#report_param_form').on('submit', event => {
2550
                const button = $('button[type="submit"]');
2551
2552
                if (button.length < 1) {
2553
                    return;
2554
                }
2555
2556
                toggleReportRunButton(button);
2557
                setTimeout(() => {
2558
                    toggleReportRunButton(button);
2559
                }, 120000);
2560
            });
2514
        });
2561
        });
2515
2562
2516
        $("#toggle_auto_links").on("click", function(e){
2563
        $("#toggle_auto_links").on("click", function(e){
2517
- 

Return to bug 40896