From: Moritz Bunkus Date: Wed, 2 May 2007 10:44:00 +0000 (+0000) Subject: Checkboxen bei Mahnungen eingebaut, um die ganze Liste an- oder abzuwählen. X-Git-Tag: release-2.4.3^2~413 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=cd3dc84b8687e1571c7012d91a5138b9444c246c;p=kivitendo-erp.git Checkboxen bei Mahnungen eingebaut, um die ganze Liste an- oder abzuwählen. --- diff --git a/bin/mozilla/dn.pl b/bin/mozilla/dn.pl index 293f07640..844abf5b5 100644 --- a/bin/mozilla/dn.pl +++ b/bin/mozilla/dn.pl @@ -382,7 +382,10 @@ sub show_invoices { $form->{nextsub} = "save_dunning"; - + + $form->{jsscript} = 1; + $form->{javascript} .= qq||; + $form->{callback} = "$form->{script}?action=show_invoices&login=$form->{login}&password=$form->{password}&customer=$form->{customer}&invnumber=$form->{invnumber}&ordnumber=$form->{ordnumber}&paymentuntil=$form->{paymentuntil}&groupinvoices=$form->{groupinvoices}&minamount=$form->{minamount}&dunning_level=$form->{dunning_level}¬es=$form->{notes}" unless $form->{callback}; @@ -395,11 +398,17 @@ sub show_invoices { . qq||; $column_header{active} = qq|| - . $locale->text('Active?') + . NTI($cgi->checkbox('-name' => 'selectall_active', + '-label' => $locale->text('Active?'), + '-checked' => 1, + '-onclick' => "checkbox_check_all('selectall_active', 'active_', 1, " . scalar(@{ $form->{DUNNINGS} }) . ")")) . qq||; $column_header{email} = qq|| - . $locale->text('eMail?') + . NTI($cgi->checkbox('-name' => 'selectall_email', + '-label' => $locale->text('eMail?'), + '-checked' => 0, + '-onclick' => "checkbox_check_all('selectall_email', 'email_', 1, " . scalar(@{ $form->{DUNNINGS} }) . ")")) . qq||; $column_header{customername} = qq|| diff --git a/js/checkbox_utils.js b/js/checkbox_utils.js new file mode 100644 index 000000000..b5d4e61d7 --- /dev/null +++ b/js/checkbox_utils.js @@ -0,0 +1,15 @@ +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; + } +}