From f644f69456ae54104ac2cd069f8aaaa399130eb6 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 9 Jan 2012 18:09:56 +0100 Subject: [PATCH] Unser eigenes "check all checkboxes" durch unsere eigene jQuery-Variante ersetzen --- js/checkbox_utils.js | 15 --------------- templates/webpages/dunning/show_invoices.html | 12 ++++++++---- 2 files changed, 8 insertions(+), 19 deletions(-) delete mode 100644 js/checkbox_utils.js diff --git a/js/checkbox_utils.js b/js/checkbox_utils.js deleted file mode 100644 index b5d4e61d7..000000000 --- a/js/checkbox_utils.js +++ /dev/null @@ -1,15 +0,0 @@ -function checkbox_check_all(cb_name, prefix, start, end) { - var i; - - var control = document.getElementsByName(cb_name)[0]; - if (!control) - return; - - var checked = control.checked; - - for (i = start; i <= end; i++) { - control = document.getElementsByName(prefix + i)[0]; - if (control) - control.checked = checked; - } -} diff --git a/templates/webpages/dunning/show_invoices.html b/templates/webpages/dunning/show_invoices.html index db6b1adfd..cd8c43422 100644 --- a/templates/webpages/dunning/show_invoices.html +++ b/templates/webpages/dunning/show_invoices.html @@ -1,6 +1,10 @@ [%- USE T8 %] -[% USE HTML %] - +[% USE HTML %] +[% USE L %] +[% L.javascript_tag('jquery.checkall') %] +[% SET all_active = 1 %][% FOREACH row = DUNNINGS %][% IF !row.active %][% SET all_active = 0 %][% LAST %][% END %][% END %] +[% SET all_email = 1 %][% FOREACH row = DUNNINGS %][% IF !row.email %][% SET all_email = 0 %][% LAST %][% END %][% END %] + @@ -14,12 +18,12 @@ [% 'Current / Next Level' | $T8 %] - + [% L.checkbox_tag('selectall_active', checkall='INPUT[name*=active_]', checked=all_active) %] - + [% L.checkbox_tag('selectall_email', checkall='INPUT[name*=email_]', checked=all_email) %] -- 2.20.1