From 94fd8108bd82da5640b8d7565c4cfc0f4e146874 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 29 Apr 2007 23:50:43 +0000 Subject: [PATCH] =?UTF-8?q?suppression=20des=20"print"=20dans=20les=20fonc?= =?UTF-8?q?tions=20select=5Fmonth=20et=20selectyesno=20afin=20de=20pouvoir?= =?UTF-8?q?=20r=E9cup=E9rer=20le=20r=E9sultat=20dans=20une=20variable.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/fiche.php | 4 ++-- htdocs/adherents/type.php | 8 +++---- htdocs/admin/adherent.php | 6 +++--- htdocs/admin/compta.php | 2 +- htdocs/admin/comptaexpert.php | 2 +- htdocs/admin/const.php | 2 +- htdocs/admin/dict.php | 4 ++-- htdocs/admin/ihm.php | 14 ++++++------ htdocs/admin/societe.php | 2 +- htdocs/compta/dons/fiche.php | 4 ++-- htdocs/html.form.class.php | 40 +++++++++++++++++++---------------- htdocs/soc.php | 8 +++---- htdocs/user/fiche.php | 4 ++-- 13 files changed, 52 insertions(+), 48 deletions(-) diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 24f0915cf86..0b1feaff879 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -613,7 +613,7 @@ if ($action == 'edit') // Profil public print "".$langs->trans("Public")."\n"; - $htmls->select_YesNo($adh->public,"public"); + print $htmls->select_YesNo($adh->public,"public"); print "\n"; // Attributs supplémentaires @@ -738,7 +738,7 @@ if ($action == 'create') // Profil public print "".$langs->trans("Public")."\n"; - $htmls->select_YesNo($adh->public,"public"); + print $htmls->select_YesNo($adh->public,"public"); print "\n"; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index f0f1e5a682a..ad914af650a 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -204,11 +204,11 @@ if ($_GET["action"] == 'create') print ''.$langs->trans("Label").''; print ''.$langs->trans("SubscriptionRequired").''; - $htmls->selectyesnonum("cotisation",1); + print $htmls->selectyesnonum("cotisation",1); print ''; print ''.$langs->trans("VoteAllowed").''; - $htmls->selectyesnonum("vote",0); + print $htmls->selectyesnonum("vote",0); print ''; print ''.$langs->trans("Comments").''; @@ -335,11 +335,11 @@ if ($rowid > 0) print ''.$langs->trans("Label").''; print ''.$langs->trans("SubscriptionRequired").''; - $htmls->selectyesnonum("cotisation",$adht->cotisation); + print $htmls->selectyesnonum("cotisation",$adht->cotisation); print ''; print ''.$langs->trans("VoteAllowed").''; - $htmls->selectyesnonum("vote",$adht->vote); + print $htmls->selectyesnonum("vote",$adht->vote); print ''; print ''.$langs->trans("Comments").''; diff --git a/htdocs/admin/adherent.php b/htdocs/admin/adherent.php index 086a0df1818..a7b10590091 100644 --- a/htdocs/admin/adherent.php +++ b/htdocs/admin/adherent.php @@ -129,7 +129,7 @@ print ''; print ''; print ''; print "".$langs->trans("AdherentMailRequired").''; -$form->selectyesnonum('constvalue',$conf->global->ADHERENT_MAIL_REQUIRED); +print $form->selectyesnonum('constvalue',$conf->global->ADHERENT_MAIL_REQUIRED); print ''; print ''; print "\n"; @@ -144,7 +144,7 @@ if ($conf->banque->enabled) print ''; print ''; print "".$langs->trans("AddSubscriptionIntoAccount").''; - $form->selectyesnonum('constvalue',$conf->global->ADHERENT_BANK_USE); + print $form->selectyesnonum('constvalue',$conf->global->ADHERENT_BANK_USE); print ''; print ''; print "\n"; @@ -297,7 +297,7 @@ function form_constantes($tableau){ print ''; if ($obj->type == 'yesno') { - $form->selectyesnonum('constvalue',$obj->value); + print $form->selectyesnonum('constvalue',$obj->value); print ''; $form->select_array('consttype',array('yesno','texte','chaine'),0); } diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 9d3bb889ffd..68bc1cf146b 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -133,7 +133,7 @@ if ($result) print ''; if ($obj->type == 'yesno') { - $form->selectyesnonum('constvalue',$obj->value); + print $form->selectyesnonum('constvalue',$obj->value); } elseif ($obj->type == 'texte') { diff --git a/htdocs/admin/comptaexpert.php b/htdocs/admin/comptaexpert.php index ff1bdde0896..9e8e74b015f 100644 --- a/htdocs/admin/comptaexpert.php +++ b/htdocs/admin/comptaexpert.php @@ -134,7 +134,7 @@ if ($result) print ''; if ($obj->type == 'yesno') { - $form->selectyesnonum('constvalue',$obj->value); + print $form->selectyesnonum('constvalue',$obj->value); } elseif ($obj->type == 'texte') { diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 54cf01106a6..fc69f0e882b 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -125,7 +125,7 @@ if ($result) print ''; if ($obj->type == 'yesno') { - $form->selectyesnonum('constvalue',$obj->value); + print $form->selectyesnonum('constvalue',$obj->value); print ''; $form->select_array('consttype',array('yesno','texte','chaine'),0); } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 56ca07501b0..1f38f520f2d 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -451,7 +451,7 @@ if ($_GET["id"]) } elseif ($fieldlist[$field] == 'recuperableonly') { print ''; - $html->selectyesno('recuperableonly','',1); + print $html->selectyesno('recuperableonly','',1); print ''; } elseif ($fieldlist[$field] == 'nbjour') { @@ -462,7 +462,7 @@ if ($_GET["id"]) } elseif ($fieldlist[$field] == 'fdm') { print ''; - $html->selectyesno('fdm','',1); + print $html->selectyesno('fdm','',1); print ''; } elseif ($fieldlist[$field] == 'taux') { diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 5bdec59c9eb..a24ac796b53 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -107,29 +107,29 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') $var=!$var; print ''.$langs->trans("EnableMultilangInterface").''; - $html->selectyesnonum('main_multilangs',$conf->global->MAIN_MULTILANGS); + print $html->selectyesnonum('main_multilangs',$conf->global->MAIN_MULTILANGS); print ''; $var=!$var; print ''.$langs->trans("ShowBugTrackLink").''; - $html->selectyesnonum('main_show_bugtrack_link',$conf->global->MAIN_SHOW_BUGTRACK_LINK); + print $html->selectyesnonum('main_show_bugtrack_link',$conf->global->MAIN_SHOW_BUGTRACK_LINK); print ''; $var=!$var; print ''.$langs->trans("ShowWorkBoard").''; - $html->selectyesnonum('main_show_workboard',$conf->global->MAIN_SHOW_WORKBOARD); + print $html->selectyesnonum('main_show_workboard',$conf->global->MAIN_SHOW_WORKBOARD); print ''; // Désactiver javascript $var=!$var; print ''.$langs->trans("DisableJavascript").''; - $html->selectyesnonum('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0); + print $html->selectyesnonum('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0); print ''; // Désactiver ajax $var=!$var; print ''.$langs->trans("DisableAjax").''; - $html->selectyesnonum('main_disable_ajax',isset($conf->global->MAIN_DISABLE_AJAX)?$conf->global->MAIN_DISABLE_AJAX:1); + print $html->selectyesnonum('main_disable_ajax',isset($conf->global->MAIN_DISABLE_AJAX)?$conf->global->MAIN_DISABLE_AJAX:1); print ''; // Désactiver le calendrier popup @@ -146,7 +146,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Activer onglet preview $var=!$var; print ''.$langs->trans("UsePreviewTabs").''; - $html->selectyesnonum('main_use_preview_tabs',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:1); + print $html->selectyesnonum('main_use_preview_tabs',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:1); print ''; print '
'; @@ -165,7 +165,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') { $var=!$var; print ''.$searchformtitle[$key].''; - $html->selectyesnonum($searchform[$key],$searchformconst[$key]); + print $html->selectyesnonum($searchform[$key],$searchformconst[$key]); print ''; } print ''; diff --git a/htdocs/admin/societe.php b/htdocs/admin/societe.php index 58e5fd5298c..fb4355e7a14 100644 --- a/htdocs/admin/societe.php +++ b/htdocs/admin/societe.php @@ -222,7 +222,7 @@ $var=!$var; print ''; print ''.$langs->trans("UseXXX")."\n"; print ''; -$form->selectyesnonum('constvalue',! $conf->global->XXX); +print $form->selectyesnonum('constvalue',! $conf->global->XXX); print ''; print ''.$langs->trans("XXXDesc").''; print ''; diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index 99c257d29f4..3cf4072b4a5 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -213,7 +213,7 @@ if ($_GET["action"] == 'create') print "".$langs->trans("PublicDonation").""; $html=new Form($db); - $html->selectyesno("public",1,1); + print $html->selectyesno("public",1,1); print "\n"; print "".''.$langs->trans("Company").''; @@ -293,7 +293,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit') print "".$langs->trans("PublicDonation").""; $html=new Form($db); - $html->selectyesno("public",1,1); + print $html->selectyesno("public",1,1); print ""; print "\n"; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 33f3c184437..122eea0c09d 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1200,7 +1200,7 @@ class Form function select_YesNo($selected='',$htmlname='yesno') { global $langs; - print ''; $options = array( '-1'=>' ', '0'=>$langs->trans("No"), @@ -1210,15 +1210,16 @@ class Form { if ($selected == $id) { - print ''; + $resultyesno .= ''; } - print ''; + $resultyesno .= ''; + return $resultyesno; } /** @@ -2626,18 +2627,19 @@ class Form $no="0"; } - print ''."\n"; if (("$value" == 'yes') || ($value == 1)) { - print ''."\n"; - print ''."\n"; + $resultyesno .= ''."\n"; + $resultyesno .= ''."\n"; } else { - print ''."\n"; - print ''."\n"; + $resultyesno .= ''."\n"; + $resultyesno .= ''."\n"; } - print ''."\n"; + $resultyesno .= ''."\n"; + return $resultyesno; } /** @@ -2647,7 +2649,8 @@ class Form */ function selectyesnonum($name,$value='') { - $this->selectyesno($name,$value,1); + $resultyesno = $this->selectyesno($name,$value,1); + return $resultyesno; } /** @@ -3071,24 +3074,25 @@ class Form 12=>"December" ); - print ''; if ($useempty) { - print ''; + $select_month .= ''; } foreach ($month as $key => $val) { if ($selected == $val) { - print '