Qual: Uniformisation du code par suppression de la fonction selectyesnonum en doublon avec selectyesno.
This commit is contained in:
parent
55348c7381
commit
2eb5ff506d
@ -209,11 +209,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>';
|
||||
print $htmls->selectyesnonum("cotisation",1);
|
||||
print $htmls->selectyesno("cotisation",1,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
print $htmls->selectyesnonum("vote",0);
|
||||
print $htmls->selectyesno("vote",0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="top">'.$langs->trans("Comments").'</td><td>';
|
||||
@ -340,11 +340,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>';
|
||||
print $htmls->selectyesnonum("cotisation",$adht->cotisation);
|
||||
print $htmls->selectyesno("cotisation",$adht->cotisation,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
print $htmls->selectyesnonum("vote",$adht->vote);
|
||||
print $htmls->selectyesno("vote",$adht->vote,1);
|
||||
print '</td></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>';
|
||||
print $form->selectyesnonum('constvalue',$conf->global->ADHERENT_MAIL_REQUIRED);
|
||||
print $form->selectyesno('constvalue',$conf->global->ADHERENT_MAIL_REQUIRED,1);
|
||||
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>';
|
||||
print $form->selectyesnonum('constvalue',$conf->global->ADHERENT_BANK_USE);
|
||||
print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1);
|
||||
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')
|
||||
{
|
||||
print $form->selectyesnonum('constvalue',$obj->value);
|
||||
print $form->selectyesno('constvalue',$obj->value,1);
|
||||
print '</td><td>';
|
||||
$form->select_array('consttype',array('yesno','texte','chaine'),0);
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ if ($result)
|
||||
print '<td>';
|
||||
if ($obj->type == 'yesno')
|
||||
{
|
||||
print $form->selectyesnonum('constvalue',$obj->value);
|
||||
print $form->selectyesno('constvalue',$obj->value,1);
|
||||
}
|
||||
elseif ($obj->type == 'texte')
|
||||
{
|
||||
|
||||
@ -134,7 +134,7 @@ if ($result)
|
||||
print '<td>';
|
||||
if ($obj->type == 'yesno')
|
||||
{
|
||||
print $form->selectyesnonum('constvalue',$obj->value);
|
||||
print $form->selectyesno('constvalue',$obj->value,1);
|
||||
}
|
||||
elseif ($obj->type == 'texte')
|
||||
{
|
||||
|
||||
@ -125,7 +125,7 @@ if ($result)
|
||||
print '<td>';
|
||||
if ($obj->type == 'yesno')
|
||||
{
|
||||
print $form->selectyesnonum('constvalue',$obj->value);
|
||||
print $form->selectyesno('constvalue',$obj->value,1);
|
||||
print '</td><td>';
|
||||
$form->select_array('consttype',array('yesno','texte','chaine'),0);
|
||||
}
|
||||
|
||||
@ -108,29 +108,29 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
||||
print $html->selectyesnonum('main_multilangs',$conf->global->MAIN_MULTILANGS);
|
||||
print $html->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink").'</td><td>';
|
||||
print $html->selectyesnonum('main_show_bugtrack_link',$conf->global->MAIN_SHOW_BUGTRACK_LINK);
|
||||
print $html->selectyesno('main_show_bugtrack_link',$conf->global->MAIN_SHOW_BUGTRACK_LINK,1);
|
||||
print '</td></tr>';
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowWorkBoard").'</td><td>';
|
||||
print $html->selectyesnonum('main_show_workboard',$conf->global->MAIN_SHOW_WORKBOARD);
|
||||
print $html->selectyesno('main_show_workboard',$conf->global->MAIN_SHOW_WORKBOARD,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Désactiver javascript
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
|
||||
print $html->selectyesnonum('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0);
|
||||
print $html->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Désactiver ajax
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableAjax").'</td><td>';
|
||||
print $html->selectyesnonum('main_disable_ajax',isset($conf->global->MAIN_DISABLE_AJAX)?$conf->global->MAIN_DISABLE_AJAX:1);
|
||||
print $html->selectyesno('main_disable_ajax',isset($conf->global->MAIN_DISABLE_AJAX)?$conf->global->MAIN_DISABLE_AJAX:1,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Désactiver le calendrier popup
|
||||
@ -147,7 +147,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>';
|
||||
print $html->selectyesnonum('main_use_preview_tabs',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:1);
|
||||
print $html->selectyesno('main_use_preview_tabs',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:1,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table><br>';
|
||||
@ -166,7 +166,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit')
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td>';
|
||||
print $html->selectyesnonum($searchform[$key],$searchformconst[$key]);
|
||||
print $html->selectyesno($searchform[$key],$searchformconst[$key],1);
|
||||
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>';
|
||||
print $form->selectyesnonum('constvalue',! $conf->global->XXX);
|
||||
print $form->selectyesno('constvalue',! $conf->global->XXX,1);
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("XXXDesc").'</td>';
|
||||
print '<td align="right">';
|
||||
|
||||
@ -122,7 +122,7 @@ print $html->select_all_categories($categorie->type,$categorie->id_mere);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("ContentsVisibleByAll").'</td><td>';
|
||||
print $html->selectyesnonum("visible",$categorie->visible);
|
||||
print $html->selectyesno("visible",$categorie->visible,1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
|
||||
@ -166,7 +166,7 @@ if ($user->rights->categorie->creer)
|
||||
print $html->select_all_categories($_GET['type']);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans ("ContentsVisibleByAll").'</td><td>';
|
||||
print $html->selectyesnonum("visible", 1);
|
||||
print $html->selectyesno("visible", 1,1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td colspan="2" align="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("CreateThisCat").'" name="creation" id="creation"/>';
|
||||
|
||||
@ -2643,17 +2643,6 @@ class Form
|
||||
return $resultyesno;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Selection de oui/non en chiffre (renvoie 1/0)
|
||||
* \param name Nom du select
|
||||
* \param value Valeur présélectionnée
|
||||
*/
|
||||
function selectyesnonum($name,$value='')
|
||||
{
|
||||
$resultyesno = $this->selectyesno($name,$value,1);
|
||||
return $resultyesno;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Checkbox
|
||||
*
|
||||
|
||||
@ -103,7 +103,7 @@ function info()
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$texte.= '<input type="hidden" name="action" value="setNumRestart">';
|
||||
$texte.= '<td align="right">';
|
||||
$texte.= $form->selectyesnonum('numrestart',$conf->global->FACTURE_NUM_RESTART_BEGIN_YEAR);
|
||||
$texte.= $form->selectyesno('numrestart',$conf->global->FACTURE_NUM_RESTART_BEGIN_YEAR,1);
|
||||
$texte.= '</td><td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
||||
$texte.= '</tr></form>';
|
||||
|
||||
@ -112,7 +112,7 @@ function info()
|
||||
$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$texte.= '<input type="hidden" name="action" value="setNumWithInvoice">';
|
||||
$texte.= '<td align="right">';
|
||||
$texte.= $form->selectyesnonum('numwithinvoice',$conf->global->AVOIR_NUM_WITH_INVOICE);
|
||||
$texte.= $form->selectyesno('numwithinvoice',$conf->global->AVOIR_NUM_WITH_INVOICE,1);
|
||||
$texte.= '</td><td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
|
||||
$texte.= '</tr></form>';
|
||||
|
||||
|
||||
@ -382,7 +382,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
|
||||
// Fournisseur
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('Supplier').'</td><td>';
|
||||
print $form->selectyesnonum("fournisseur",$soc->fournisseur);
|
||||
print $form->selectyesno("fournisseur",$soc->fournisseur,1);
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('SupplierCode').'</td><td>';
|
||||
|
||||
@ -710,7 +710,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
||||
// Fournisseur
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('Supplier').'</td><td>';
|
||||
print $form->selectyesnonum("fournisseur",$soc->fournisseur);
|
||||
print $form->selectyesnonum("fournisseur",$soc->fournisseur,1);
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('SupplierCode').'</td><td>';
|
||||
|
||||
|
||||
@ -572,7 +572,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("Administrator").'</td>';
|
||||
print '<td>';
|
||||
print $form->selectyesnonum('admin',0);
|
||||
print $form->selectyesno('admin',0,1);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
@ -1193,7 +1193,7 @@ else
|
||||
print '<td>';
|
||||
if ($user->admin)
|
||||
{
|
||||
print $form->selectyesnonum('admin',$fuser->admin);
|
||||
print $form->selectyesno('admin',$fuser->admin,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user