Skip to content

Commit

Permalink
Fix: compatibility with edit in place
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Mar 23, 2012
1 parent d5aad28 commit 83272df
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions htdocs/comm/mailing/fiche.php
Expand Up @@ -404,19 +404,19 @@
}

// Action update description of emailing
if ($action == 'setdesc' || $action == 'setfrom' || $actino == 'setreplyto' || $action == 'seterrorsto')
if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyto' || $action == 'setemail_errorsto')
{
$object->fetch($id);

$upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id,2,0,1);

if ($action == 'setdesc') $object->titre = trim($_REQUEST["desc"]);
else if ($action == 'setfrom') $object->email_from = trim($_REQUEST["from"]);
else if ($action == 'setreplyto') $object->email_replyto = trim($_REQUEST["replyto"]);
else if ($action == 'seterrorsto') $object->email_errorsto = trim($_REQUEST["errorsto"]);
if ($action == 'settitre') $object->titre = trim(GETPOST('titre','alpha'));
else if ($action == 'setemail_from') $object->email_from = trim(GETPOST('email_from','alpha'));
else if ($action == 'setemail_replyto') $object->email_replyto = trim(GETPOST('email_replyto','alpha'));
else if ($action == 'setemail_errorsto') $object->email_errorsto = trim(GETPOST('email_errorsto','alpha'));

else if ($action == 'setdesc' && empty($object->titre)) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
else if ($action == 'setfrom' && empty($object->email_from)) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom"));
else if ($action == 'settitre' && empty($object->titre)) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailTitle"));
else if ($action == 'setfrom' && empty($object->email_from)) $message.=($message?'<br>':'').$langs->trans("ErrorFieldRequired",$langs->transnoentities("MailFrom"));

if (! $message)
{
Expand Down Expand Up @@ -697,18 +697,18 @@
print '</td></tr>';

// Description
print '<tr><td>'.$form->editfieldkey("MailTitle",'desc',$object->titre,$object,$user->rights->mailing->creer).'</td><td colspan="3">';
print $form->editfieldval("MailTitle",'desc',$object->titre,$object,$user->rights->mailing->creer);
print '<tr><td>'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
print '</td></tr>';

// From
print '<tr><td>'.$form->editfieldkey("MailFrom",'from',$object->email_from,$object,$user->rights->mailing->creer && $object->statut < 3,'email').'</td><td colspan="3">';
print $form->editfieldval("MailFrom",'from',$object->email_from,$object,$user->rights->mailing->creer && $object->statut < 3,'email');
print '<tr><td>'.$form->editfieldkey("MailFrom",'email_from',$object->email_from,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
print $form->editfieldval("MailFrom",'email_from',$object->email_from,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
print '</td></tr>';

// Errors to
print '<tr><td>'.$form->editfieldkey("MailErrorsTo",'errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'email').'</td><td colspan="3">';
print $form->editfieldval("MailErrorsTo",'errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'email');
print '<tr><td>'.$form->editfieldkey("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
print $form->editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
print '</td></tr>';

// Status
Expand Down

0 comments on commit 83272df

Please sign in to comment.