Fix: duplicate end tag and rename form parts

This commit is contained in:
Regis Houssin 2012-03-28 16:03:04 +02:00
parent 892a8d258e
commit d8d9062606
3 changed files with 5 additions and 7 deletions

View File

@ -49,8 +49,8 @@ $action = GETPOST("action");
// Action mise a jour ou ajout d'une constante // Action mise a jour ou ajout d'une constante
if ($action == 'update' || $action == 'add') if ($action == 'update' || $action == 'add')
{ {
$constname=GETPOST("constname"); $constname=GETPOST('constname','alpha');
$constvalue=GETPOST("constvalue"); $constvalue=(GETPOST('constvalue_'.$constname,'alpha') ? GETPOST('constvalue_'.$constname,'alpha') : GETPOST('constvalue','alpha'));
if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue=''; if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue='';
if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice
@ -59,9 +59,8 @@ if ($action == 'update' || $action == 'add')
else $constvalue=1; else $constvalue=1;
} }
if (in_array($constname,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $constvalue=$_POST["constvalue".$constname]; $consttype=GETPOST('consttype','alpha');
$consttype=$_POST["consttype"]; $constnote=GETPOST('constnote','alpha');
$constnote=GETPOST("constnote");
$res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity);
if (! $res > 0) $error++; if (! $res > 0) $error++;

View File

@ -125,7 +125,6 @@ print $langs->trans("EnablePublicSubscriptionForm");
print '</td><td width="60" align="right">'; print '</td><td width="60" align="right">';
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",$conf->global->MEMBER_ENABLE_PUBLIC,1); print $form->selectyesno("MEMBER_ENABLE_PUBLIC",$conf->global->MEMBER_ENABLE_PUBLIC,1);
print "</td></tr>\n"; print "</td></tr>\n";
print '</form>';
// Type // Type
/*$var=! $var; /*$var=! $var;

View File

@ -1090,7 +1090,7 @@ function form_constantes($tableau)
else if (in_array($const,array('ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) else if (in_array($const,array('ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL')))
{ {
require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php");
$doleditor=new DolEditor('constvalue'.$const,$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60); $doleditor=new DolEditor('constvalue_'.$const,$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60);
$doleditor->Create(); $doleditor->Create();
print '</td><td>'; print '</td><td>';