From 82b69cde15b1f64f70df75bd5a74307e6dc247ae Mon Sep 17 00:00:00 2001
From: Dany De Bontridder
Date: Mon, 2 Aug 2010 11:51:54 +0000
Subject: [PATCH] To check or uncheck everything with one button in the
operation for paid and unpaid add new function to IButton move
toogle_checkbox to scripts.js
---
html/js/acc_ledger.js | 13 -------------
html/js/scripts.js | 39 ++++++++++++++++++++++++++++++++++++++
include/class_ibutton.php | 18 ++++++++++++++++++
include/compta_ach.inc.php | 8 ++++----
include/compta_fin.inc.php | 5 +----
include/compta_ven.inc.php | 10 +++++-----
6 files changed, 67 insertions(+), 26 deletions(-)
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index bb159f42c..724e13521 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -755,16 +755,3 @@ function op_save(obj) {
}
return false;
}
-/**
-* toggle all the checkbox in a given form
-* @param form_id id of the form
-*/
-function toggle_checkbox(form_id) {
- var form=g(form_id);
- for (var i=0;ilabel=_('Inverser la sélection');
+ $select_all->javascript="toggle_checkbox($p_form)";
+ return $select_all->input();
+ }
+ static function select_checkbox($p_form) {
+ $select_all=new IButton('select_all');
+ $select_all->label=_('Cocher tous');
+ $select_all->javascript="select_checkbox($p_form)";
+ return $select_all->input();
+ }
+ static function unselect_checkbox($p_form) {
+ $select_all=new IButton('select_all');
+ $select_all->label=_('Décocher tous');
+ $select_all->javascript="unselect_checkbox($p_form)";
+ return $select_all->input();
+ }
static public function test_me()
{
diff --git a/include/compta_ach.inc.php b/include/compta_ach.inc.php
index 54f6d23f4..8a1e7e08b 100644
--- a/include/compta_ach.inc.php
+++ b/include/compta_ach.inc.php
@@ -302,7 +302,7 @@ if ( $def == 2 ) {
$bar=jrn_navigation_bar($offset,$max_line,$step,$page);
- echo '';
@@ -357,7 +357,7 @@ if ( $def==3 ) {
$bar=jrn_navigation_bar($offset,$max_line,$step,$page);
- echo '';
echo '';
diff --git a/include/compta_fin.inc.php b/include/compta_fin.inc.php
index 1f76a22c1..a2c321e7b 100644
--- a/include/compta_fin.inc.php
+++ b/include/compta_fin.inc.php
@@ -338,10 +338,7 @@ if ($def==4) {
echo "Extrait / relevé :".$iextrait->input();
echo 'solde Début'.$nstart_extrait->input();
echo 'solde Fin'.$nend_extrait->input();
- $select_all=new IButton('select_all');
- $select_all->label='Inverser la sélection';
- $select_all->javascript="toggle_checkbox('rec1')";
- echo $select_all->input();
+ echo IButton::tooggle_checkbox('rec1');
echo '
';
echo '';
diff --git a/include/compta_ven.inc.php b/include/compta_ven.inc.php
index 1f5816b61..7ac766b79 100644
--- a/include/compta_ven.inc.php
+++ b/include/compta_ven.inc.php
@@ -319,7 +319,7 @@ if ( $def == 2 ) {
$bar=jrn_navigation_bar($offset,$max_line,$step,$page);
- echo '';
echo '';
@@ -377,7 +377,7 @@ if ( $def==3 ) {
$bar=jrn_navigation_bar($offset,$max_line,$step,$page);
- echo '';
echo '';