Ajout du wysiwyg pour le mailing
This commit is contained in:
parent
ff79933df2
commit
c57c870e5a
@ -35,22 +35,28 @@ $langs->load("fckeditor");
|
|||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
// Constante et traduction de la description du module
|
||||||
|
$modules = array(
|
||||||
|
'PRODUCTDESC'=>'FCKeditorForProductDescription',
|
||||||
|
'MAILING'=>'FCKeditorForMailing',
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach($modules as $const => $desc)
|
||||||
if ($_GET["action"] == 'activate_productdesc')
|
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_PRODUCTDESC", "1");
|
if ($_GET["action"] == 'activate_'.strtolower($const))
|
||||||
|
{
|
||||||
|
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1");
|
||||||
Header("Location: fckeditor.php");
|
Header("Location: fckeditor.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
else if ($_GET["action"] == 'disable_productdesc')
|
else if ($_GET["action"] == 'disable_'.strtolower($const))
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, "FCKEDITOR_ENABLE_PRODUCTDESC");
|
dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const);
|
||||||
Header("Location: fckeditor.php");
|
Header("Location: fckeditor.php");
|
||||||
exit;
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Affiche page
|
* Affiche page
|
||||||
*/
|
*/
|
||||||
@ -79,41 +85,45 @@ dolibarr_fiche_head($head, $hselected, $langs->trans("ModuleSetup"));
|
|||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
// Module Propale
|
|
||||||
$var=!$var;
|
|
||||||
print "<form method=\"post\" action=\"fckeditor.php\">";
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>'.$langs->trans("ActivateFCKeditor").'</td>';
|
print '<td>'.$langs->trans("ActivateFCKeditor").'</td>';
|
||||||
print '<td align="center" width="20"> </td>';
|
print '<td align="center" width="20"> </td>';
|
||||||
print '<td align="center" width="100">'.$langs->trans("Action").'</td>';
|
print '<td align="center" width="100">'.$langs->trans("Action").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"productdesc\">";
|
|
||||||
print "<tr ".$bc[$var].">";
|
|
||||||
print '<td>'.$langs->trans("FCKeditorForProductDescription").'</td>';
|
|
||||||
print '<td align="center" width="20">';
|
|
||||||
|
|
||||||
if($conf->global->FCKEDITOR_ENABLE_PRODUCTDESC == 1)
|
// Modules
|
||||||
|
foreach($modules as $const => $desc)
|
||||||
{
|
{
|
||||||
print img_tick();
|
$var=!$var;
|
||||||
|
print "<form method=\"post\" action=\"fckeditor.php\">";
|
||||||
|
print '<input type="hidden" name="action" value="'.strtolower($const).'">';
|
||||||
|
print '<tr ".$bc[$var].">';
|
||||||
|
print '<td>'.$langs->trans($desc).'</td>';
|
||||||
|
print '<td align="center" width="20">';
|
||||||
|
|
||||||
|
if($conf->global->FCKEDITOR_ENABLE_.$const == 1)
|
||||||
|
{
|
||||||
|
print img_tick();
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="center" width="100">';
|
||||||
|
|
||||||
|
if($conf->global->FCKEDITOR_ENABLE_.$const == 0)
|
||||||
|
{
|
||||||
|
print '<a href="fckeditor.php?action=activate_'.strtolower($const).'">'.$langs->trans("Activate").'</a>';
|
||||||
|
}
|
||||||
|
else if($conf->global->FCKEDITOR_ENABLE_.$cont == 1)
|
||||||
|
{
|
||||||
|
print '<a href="fckeditor.php?action=disable_'.strtolower($const).'">'.$langs->trans("Disable").'</a>';
|
||||||
|
}
|
||||||
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</td>';
|
print "</td>";
|
||||||
print '<td align="center" width="100">';
|
print '</tr>';
|
||||||
|
print '</table>';
|
||||||
if($conf->global->FCKEDITOR_ENABLE_PRODUCTDESC == 0)
|
|
||||||
{
|
|
||||||
print '<a href="fckeditor.php?action=activate_productdesc">'.$langs->trans("Activate").'</a>';
|
|
||||||
}
|
|
||||||
else if($conf->global->FCKEDITOR_ENABLE_PRODUCTDESC == 1)
|
|
||||||
{
|
|
||||||
print '<a href="fckeditor.php?action=disable_productdesc">'.$langs->trans("Disable").'</a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print "</td>";
|
|
||||||
print '</tr>';
|
|
||||||
print '</table>';
|
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|||||||
@ -244,7 +244,19 @@ if ($_GET["action"] == 'create')
|
|||||||
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
|
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
|
||||||
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';
|
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';
|
||||||
print '</i></td>';
|
print '</i></td>';
|
||||||
print '<td><textarea cols="70" rows="10" name="body"></textarea></td></tr>';
|
print '<td>';
|
||||||
|
// éditeur wysiwyg
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/includes/fckeditor/fckeditor.php");
|
||||||
|
$oFCKeditor = new FCKeditor('body');
|
||||||
|
$oFCKeditor->Create() ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea cols="70" rows="10" name="body"></textarea>';
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></td></tr>';
|
print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("CreateMailing").'"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -430,8 +442,21 @@ else
|
|||||||
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
|
print '__LASTNAME__ = '.$langs->trans("Lastname").'<br>';
|
||||||
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';
|
print '__FIRSTNAME__ = '.$langs->trans("Firstname").'<br>';
|
||||||
print '</i></td>';
|
print '</i></td>';
|
||||||
print '<td colspan="3"><textarea name="body" cols=70 rows=10>';
|
print '<td colspan="3">';
|
||||||
print $mil->body.'</textarea></td></tr>';
|
// éditeur wysiwyg
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/includes/fckeditor/fckeditor.php");
|
||||||
|
$oFCKeditor = new FCKeditor('body');
|
||||||
|
$oFCKeditor->Value = $mil->body;
|
||||||
|
$oFCKeditor->Create() ;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea name="body" cols=70 rows=10>';
|
||||||
|
print $mil->body.'</textarea>';
|
||||||
|
}
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user