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 '
'; + echo ''; echo HtmlInput::hidden("sa","l"); echo HtmlInput::hidden("p_action","ach"); echo dossier::hidden(); @@ -310,7 +310,7 @@ if ( $def == 2 ) { list($count,$html)= $Ledger->list_operation($sql,$offset,1); echo $html; echo $bar; - echo '

'.HtmlInput::submit('paid',_('Mise à jour paiement')).'

'; + echo '

'.HtmlInput::submit('paid',_('Mise à jour paiement')).IButton::select_checkbox('fpaida').IButton::unselect_checkbox('fpaida').'

'; echo '
'; @@ -357,7 +357,7 @@ if ( $def==3 ) { $bar=jrn_navigation_bar($offset,$max_line,$step,$page); - echo '
'; + echo ''; echo HtmlInput::hidden("sa","lnp"); echo HtmlInput::hidden("p_action","ach"); echo dossier::hidden(); @@ -366,7 +366,7 @@ if ( $def==3 ) { echo $html; echo $bar; - echo '

'.HtmlInput::submit('paid',_('Mise à jour paiement')).'

'; + echo '

'.HtmlInput::submit('paid',_('Mise à jour paiement')).IButton::select_checkbox('fpaida').IButton::unselect_checkbox('fpaida').'

'; 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 ''; echo HtmlInput::hidden("sa","l"); echo HtmlInput::hidden("p_action","ven"); echo dossier::hidden(); @@ -327,8 +327,8 @@ if ( $def == 2 ) { list($count,$html)= $Ledger->list_operation($sql,$offset,1); echo $html; echo $bar; - echo '

'.HtmlInput::submit('paid',_('Mise à jour paiement')).'

'; - + echo '

'.HtmlInput::submit('paid',_('Mise à jour paiement')).IButton::select_checkbox('fpaidv').IButton::unselect_checkbox('fpaidv').'

'; + echo IButton::select_checkbox('fpaid'); echo ''; echo ''; @@ -377,7 +377,7 @@ if ( $def==3 ) { $bar=jrn_navigation_bar($offset,$max_line,$step,$page); - echo ''; + echo ''; echo HtmlInput::hidden("sa","lnp"); echo HtmlInput::hidden("p_action","ven"); echo dossier::hidden(); @@ -386,7 +386,7 @@ if ( $def==3 ) { echo $html; echo $bar; - echo '

'.HtmlInput::submit('paid',_('Mise à jour paiement')).'

'; + echo '

'.HtmlInput::submit('paid',_('Mise à jour paiement')).IButton::select_checkbox('fpaidv').IButton::unselect_checkbox('fpaidv').'

'; echo ''; echo '';