suppression des "print" dans les fonctions select_month et selectyesno afin de pouvoir rcuprer le rsultat dans une variable.
This commit is contained in:
parent
dbbac6fc75
commit
94fd8108bd
@ -613,7 +613,7 @@ if ($action == 'edit')
|
||||
|
||||
// Profil public
|
||||
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
|
||||
$htmls->select_YesNo($adh->public,"public");
|
||||
print $htmls->select_YesNo($adh->public,"public");
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Attributs supplémentaires
|
||||
@ -738,7 +738,7 @@ if ($action == 'create')
|
||||
|
||||
// Profil public
|
||||
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
|
||||
$htmls->select_YesNo($adh->public,"public");
|
||||
print $htmls->select_YesNo($adh->public,"public");
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
@ -204,11 +204,11 @@ if ($_GET["action"] == 'create')
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
$htmls->selectyesnonum("cotisation",1);
|
||||
print $htmls->selectyesnonum("cotisation",1);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
$htmls->selectyesnonum("vote",0);
|
||||
print $htmls->selectyesnonum("vote",0);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>';
|
||||
@ -335,11 +335,11 @@ if ($rowid > 0)
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.$adht->libelle.'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
$htmls->selectyesnonum("cotisation",$adht->cotisation);
|
||||
print $htmls->selectyesnonum("cotisation",$adht->cotisation);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
$htmls->selectyesnonum("vote",$adht->vote);
|
||||
print $htmls->selectyesnonum("vote",$adht->vote);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>';
|
||||
|
||||
@ -129,7 +129,7 @@ print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_MAIL_REQUIRED">';
|
||||
print "<tr $bc[$var] class=value><td>".$langs->trans("AdherentMailRequired").'</td><td>';
|
||||
$form->selectyesnonum('constvalue',$conf->global->ADHERENT_MAIL_REQUIRED);
|
||||
print $form->selectyesnonum('constvalue',$conf->global->ADHERENT_MAIL_REQUIRED);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td></tr>\n";
|
||||
@ -144,7 +144,7 @@ if ($conf->banque->enabled)
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
|
||||
print "<tr $bc[$var] class=value><td>".$langs->trans("AddSubscriptionIntoAccount").'</td><td>';
|
||||
$form->selectyesnonum('constvalue',$conf->global->ADHERENT_BANK_USE);
|
||||
print $form->selectyesnonum('constvalue',$conf->global->ADHERENT_BANK_USE);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print "</td></tr>\n";
|
||||
@ -297,7 +297,7 @@ function form_constantes($tableau){
|
||||
print '<td>';
|
||||
if ($obj->type == 'yesno')
|
||||
{
|
||||
$form->selectyesnonum('constvalue',$obj->value);
|
||||
print $form->selectyesnonum('constvalue',$obj->value);
|
||||
print '</td><td>';
|
||||
$form->select_array('consttype',array('yesno','texte','chaine'),0);
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ if ($result)
|
||||
print '<td>';
|
||||
if ($obj->type == 'yesno')
|
||||
{
|
||||
$form->selectyesnonum('constvalue',$obj->value);
|
||||
print $form->selectyesnonum('constvalue',$obj->value);
|
||||
}
|
||||
elseif ($obj->type == 'texte')
|
||||
{
|
||||
|
||||
@ -134,7 +134,7 @@ if ($result)
|
||||
print '<td>';
|
||||
if ($obj->type == 'yesno')
|
||||
{
|
||||
$form->selectyesnonum('constvalue',$obj->value);
|
||||
print $form->selectyesnonum('constvalue',$obj->value);
|
||||
}
|
||||
elseif ($obj->type == 'texte')
|
||||
{
|
||||
|
||||
@ -125,7 +125,7 @@ if ($result)
|
||||
print '<td>';
|
||||
if ($obj->type == 'yesno')
|
||||
{
|
||||
$form->selectyesnonum('constvalue',$obj->value);
|
||||
print $form->selectyesnonum('constvalue',$obj->value);
|
||||
print '</td><td>';
|
||||
$form->select_array('consttype',array('yesno','texte','chaine'),0);
|
||||
}
|
||||
|
||||
@ -451,7 +451,7 @@ if ($_GET["id"])
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'recuperableonly') {
|
||||
print '<td>';
|
||||
$html->selectyesno('recuperableonly','',1);
|
||||
print $html->selectyesno('recuperableonly','',1);
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'nbjour') {
|
||||
@ -462,7 +462,7 @@ if ($_GET["id"])
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'fdm') {
|
||||
print '<td>';
|
||||
$html->selectyesno('fdm','',1);
|
||||
print $html->selectyesno('fdm','',1);
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'taux') {
|
||||
|
||||
@ -107,29 +107,29 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
||||
$html->selectyesnonum('main_multilangs',$conf->global->MAIN_MULTILANGS);
|
||||
print $html->selectyesnonum('main_multilangs',$conf->global->MAIN_MULTILANGS);
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowWorkBoard").'</td><td>';
|
||||
$html->selectyesnonum('main_show_workboard',$conf->global->MAIN_SHOW_WORKBOARD);
|
||||
print $html->selectyesnonum('main_show_workboard',$conf->global->MAIN_SHOW_WORKBOARD);
|
||||
print '</td></tr>';
|
||||
|
||||
// Désactiver javascript
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
// Désactiver ajax
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableAjax").'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
// Désactiver le calendrier popup
|
||||
@ -146,7 +146,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
// Activer onglet preview
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
print '</table><br>';
|
||||
@ -165,7 +165,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td>';
|
||||
$html->selectyesnonum($searchform[$key],$searchformconst[$key]);
|
||||
print $html->selectyesnonum($searchform[$key],$searchformconst[$key]);
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -222,7 +222,7 @@ $var=!$var;
|
||||
print '<tr '.$bc[$var].' class="value">';
|
||||
print '<td nowrap="nowrap">'.$langs->trans("UseXXX")."</td>\n";
|
||||
print '<td>';
|
||||
$form->selectyesnonum('constvalue',! $conf->global->XXX);
|
||||
print $form->selectyesnonum('constvalue',! $conf->global->XXX);
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("XXXDesc").'</td>';
|
||||
print '<td align="right">';
|
||||
|
||||
@ -213,7 +213,7 @@ if ($_GET["action"] == 'create')
|
||||
|
||||
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
|
||||
$html=new Form($db);
|
||||
$html->selectyesno("public",1,1);
|
||||
print $html->selectyesno("public",1,1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40"></td></tr>';
|
||||
@ -293,7 +293,7 @@ if ($_GET["rowid"] && $_GET["action"] == 'edit')
|
||||
|
||||
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
|
||||
$html=new Form($db);
|
||||
$html->selectyesno("public",1,1);
|
||||
print $html->selectyesno("public",1,1);
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -1200,7 +1200,7 @@ class Form
|
||||
function select_YesNo($selected='',$htmlname='yesno')
|
||||
{
|
||||
global $langs;
|
||||
print '<select class="flat" name="'.$htmlname.'">';
|
||||
$resultyesno = '<select class="flat" name="'.$htmlname.'">';
|
||||
$options = array(
|
||||
'-1'=>' ',
|
||||
'0'=>$langs->trans("No"),
|
||||
@ -1210,15 +1210,16 @@ class Form
|
||||
{
|
||||
if ($selected == $id)
|
||||
{
|
||||
print '<option value="'.$id.'" selected="true">'.$value;
|
||||
$resultyesno .= '<option value="'.$id.'" selected="true">'.$value;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$id.'">'.$value;
|
||||
$resultyesno .= '<option value="'.$id.'">'.$value;
|
||||
}
|
||||
print '</option>';
|
||||
$resultyesno .= '</option>';
|
||||
}
|
||||
print '</select>';
|
||||
$resultyesno .= '</select>';
|
||||
return $resultyesno;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2626,18 +2627,19 @@ class Form
|
||||
$no="0";
|
||||
}
|
||||
|
||||
print '<select class="flat" name="'.$name.'">'."\n";
|
||||
$resultyesno = '<select class="flat" name="'.$name.'">'."\n";
|
||||
if (("$value" == 'yes') || ($value == 1))
|
||||
{
|
||||
print '<option value="'.$yes.'" selected="true">'.$langs->trans("yes").'</option>'."\n";
|
||||
print '<option value="'.$no.'">'.$langs->trans("no").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$yes.'" selected="true">'.$langs->trans("yes").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'">'.$langs->trans("no").'</option>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option value="'.$yes.'">'.$langs->trans("yes").'</option>'."\n";
|
||||
print '<option value="'.$no.'" selected="true">'.$langs->trans("no").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$yes.'">'.$langs->trans("yes").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'" selected="true">'.$langs->trans("no").'</option>'."\n";
|
||||
}
|
||||
print '</select>'."\n";
|
||||
$resultyesno .= '</select>'."\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 '<select class="flat" name="'.$htmlname.'">';
|
||||
$select_month = '<select class="flat" name="'.$htmlname.'">';
|
||||
if ($useempty)
|
||||
{
|
||||
print '<option value="0"> </option>';
|
||||
$select_month .= '<option value="0"> </option>';
|
||||
}
|
||||
foreach ($month as $key => $val)
|
||||
{
|
||||
if ($selected == $val)
|
||||
{
|
||||
print '<option val="'.$key.'" selected="true">';
|
||||
$select_month .= '<option val="'.$key.'" selected="true">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<option val="'.$key.'">';
|
||||
$select_month .= '<option val="'.$key.'">';
|
||||
}
|
||||
print $langs->trans($val);
|
||||
$select_month .= $langs->trans($val);
|
||||
}
|
||||
print '</select>';
|
||||
$select_month .= '</select>';
|
||||
return $select_month;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -382,7 +382,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
|
||||
// Fournisseur
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('Supplier').'</td><td>';
|
||||
$form->selectyesnonum("fournisseur",$soc->fournisseur);
|
||||
print $form->selectyesnonum("fournisseur",$soc->fournisseur);
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('SupplierCode').'</td><td>';
|
||||
|
||||
@ -527,7 +527,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
|
||||
$html = new Form($db);
|
||||
print '<tr><td>'.$langs->trans('VATIsUsed').'</td>';
|
||||
print '<td>';
|
||||
$html->select_YesNo("1",'assujtva_value'); // Assujeti par défaut en creation
|
||||
print $html->select_YesNo("1",'assujtva_value'); // Assujeti par défaut en creation
|
||||
print '</td>';
|
||||
|
||||
// Code TVA intra
|
||||
@ -710,7 +710,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
||||
// Fournisseur
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('Supplier').'</td><td>';
|
||||
$form->selectyesnonum("fournisseur",$soc->fournisseur);
|
||||
print $form->selectyesnonum("fournisseur",$soc->fournisseur);
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('SupplierCode').'</td><td>';
|
||||
|
||||
@ -818,7 +818,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
||||
|
||||
// Assujeti TVA
|
||||
print '<tr><td>'.$langs->trans('VATIsUsed').'</td><td>';
|
||||
$form->select_YesNo($soc->tva_assuj,'assujtva_value');
|
||||
print $form->select_YesNo($soc->tva_assuj,'assujtva_value');
|
||||
print '</td>';
|
||||
|
||||
// Code TVA intra
|
||||
|
||||
@ -572,7 +572,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("Administrator").'</td>';
|
||||
print '<td>';
|
||||
$form->selectyesnonum('admin',0);
|
||||
print $form->selectyesnonum('admin',0);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
@ -1193,7 +1193,7 @@ else
|
||||
print '<td>';
|
||||
if ($user->admin)
|
||||
{
|
||||
$form->selectyesnonum('admin',$fuser->admin);
|
||||
print $form->selectyesnonum('admin',$fuser->admin);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user