Fix: convert lines delimiters
This commit is contained in:
parent
a7e45ae10d
commit
c6d703de54
@ -133,11 +133,11 @@ if ($action == 'delete')
|
|||||||
{
|
{
|
||||||
if (!empty($id))
|
if (!empty($id))
|
||||||
{
|
{
|
||||||
$classname = "MailingTargets";
|
$classname = "MailingTargets";
|
||||||
$obj = new $classname($db);
|
$obj = new $classname($db);
|
||||||
$obj->update_nb($id);
|
$obj->update_nb($id);
|
||||||
|
|
||||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -121,7 +121,7 @@ class Mailing extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
dol_syslog("Mailing::Create ".$this->error, LOG_ERR);
|
dol_syslog("Mailing::Create ".$this->error, LOG_ERR);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@ -41,11 +41,11 @@ $action=GETPOST('action','alpha');
|
|||||||
$confirm=GETPOST('confirm','alpha');
|
$confirm=GETPOST('confirm','alpha');
|
||||||
$urlfrom=GETPOST('urlfrom');
|
$urlfrom=GETPOST('urlfrom');
|
||||||
|
|
||||||
$mesg='';
|
$mesg='';
|
||||||
if (isset($_SESSION['DolMessage']))
|
if (isset($_SESSION['DolMessage']))
|
||||||
{
|
{
|
||||||
$mesg=$_SESSION['DolMessage'];
|
$mesg=$_SESSION['DolMessage'];
|
||||||
unset($_SESSION['DolMessage']);
|
unset($_SESSION['DolMessage']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$object=new Mailing($db);
|
$object=new Mailing($db);
|
||||||
@ -53,9 +53,9 @@ $result=$object->fetch($id);
|
|||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
||||||
$hookmanager=new HookManager($db);
|
$hookmanager=new HookManager($db);
|
||||||
$hookmanager->initHooks(array('mailingcard'));
|
$hookmanager->initHooks(array('mailingcard'));
|
||||||
|
|
||||||
// Tableau des substitutions possibles
|
// Tableau des substitutions possibles
|
||||||
@ -109,11 +109,11 @@ if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
// Action clone object
|
// Action clone object
|
||||||
@ -557,61 +557,61 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel"
|
|||||||
|
|
||||||
// Action confirmation validation
|
// Action confirmation validation
|
||||||
if ($action == 'confirm_valid' && $confirm == 'yes')
|
if ($action == 'confirm_valid' && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
if ($object->id > 0)
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
$object->valid($user);
|
$object->valid($user);
|
||||||
|
|
||||||
$_SESSION['DolMessage']='<div class="ok">'.$langs->trans("MailingSuccessfullyValidated").'</div>';
|
$_SESSION['DolMessage']='<div class="ok">'.$langs->trans("MailingSuccessfullyValidated").'</div>';
|
||||||
|
|
||||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resend
|
// Resend
|
||||||
if ($action == 'confirm_reset' && $confirm == 'yes')
|
if ($action == 'confirm_reset' && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
if ($object->id > 0)
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$result=$object->valid($user);
|
$result=$object->valid($user);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$result=$object->reset_targets_status($user);
|
$result=$object->reset_targets_status($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$db->commit();
|
$db->commit();
|
||||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mesg=$object->error;
|
$mesg=$object->error;
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action confirmation suppression
|
// Action confirmation suppression
|
||||||
if ($action == 'confirm_delete' && $confirm == 'yes')
|
if ($action == 'confirm_delete' && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
if ($object->delete($object->id))
|
if ($object->delete($object->id))
|
||||||
{
|
{
|
||||||
$url= (! empty($urlfrom) ? $urlfrom : 'liste.php');
|
$url= (! empty($urlfrom) ? $urlfrom : 'liste.php');
|
||||||
Header("Location: ".$url);
|
Header("Location: ".$url);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ if (! empty($_POST["cancel"]))
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label('mailing');
|
$extralabels=$extrafields->fetch_name_optionals_label('mailing');
|
||||||
|
|
||||||
$help_url='EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing';
|
$help_url='EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing';
|
||||||
@ -651,18 +651,18 @@ if ($action == 'create')
|
|||||||
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat" name="from" size="40" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
|
||||||
print '<tr><td width="25%">'.$langs->trans("MailErrorsTo").'</td><td><input class="flat" name="errorsto" size="40" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO)?$conf->global->MAILING_EMAIL_ERRORSTO:$conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
print '<tr><td width="25%">'.$langs->trans("MailErrorsTo").'</td><td><input class="flat" name="errorsto" size="40" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO)?$conf->global->MAILING_EMAIL_ERRORSTO:$conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
||||||
print '<tr><td>'.$label.'</td><td colspan="3">';
|
print '<tr><td>'.$label.'</td><td colspan="3">';
|
||||||
print $extrafields->showInputField($key,$value);
|
print $extrafields->showInputField($key,$value);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -809,18 +809,18 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
||||||
print '<tr><td>'.$label.'</td><td colspan="3">';
|
print '<tr><td>'.$label.'</td><td colspan="3">';
|
||||||
print $extrafields->showInputField($key,$value);
|
print $extrafields->showInputField($key,$value);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -861,11 +861,11 @@ else
|
|||||||
|
|
||||||
//print '<a class="butAction" href="fiche.php?action=test&id='.$object->id.'">'.$langs->trans("PreviewMailing").'</a>';
|
//print '<a class="butAction" href="fiche.php?action=test&id='.$object->id.'">'.$langs->trans("PreviewMailing").'</a>';
|
||||||
|
|
||||||
if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send)
|
if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send)
|
||||||
{
|
{
|
||||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("TestMailing").'</a>';
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("TestMailing").'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=test&id='.$object->id.'">'.$langs->trans("TestMailing").'</a>';
|
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=test&id='.$object->id.'">'.$langs->trans("TestMailing").'</a>';
|
||||||
}
|
}
|
||||||
@ -1043,18 +1043,18 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$parameters=array();
|
$parameters=array();
|
||||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
foreach($extrafields->attribute_label as $key=>$label)
|
foreach($extrafields->attribute_label as $key=>$label)
|
||||||
{
|
{
|
||||||
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
|
||||||
print '<tr><td>'.$label.'</td><td colspan="3">';
|
print '<tr><td>'.$label.'</td><td colspan="3">';
|
||||||
print $extrafields->showInputField($key,$value);
|
print $extrafields->showInputField($key,$value);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -1119,9 +1119,9 @@ else
|
|||||||
// Message
|
// Message
|
||||||
print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>';
|
print '<tr><td width="25%" valign="top">'.$langs->trans("MailMessage").'<br>';
|
||||||
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
print '<br><i>'.$langs->trans("CommonSubstitutions").':<br>';
|
||||||
foreach($object->substitutionarray as $key => $val)
|
foreach($object->substitutionarray as $key => $val)
|
||||||
{
|
{
|
||||||
print $key.' = '.$langs->trans($val).'<br>';
|
print $key.' = '.$langs->trans($val).'<br>';
|
||||||
}
|
}
|
||||||
print '</i></td>';
|
print '</i></td>';
|
||||||
print '<td colspan="3">';
|
print '<td colspan="3">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user