Work on task #10579 : Simplify code using editor
This commit is contained in:
parent
abd19f59ba
commit
f5dd8f1da1
@ -51,7 +51,6 @@ if ($_POST["action"] == 'update' || $_POST["action"] == 'add')
|
|||||||
if (in_array($const,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $value=$_POST["constvalue".$const];
|
if (in_array($const,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $value=$_POST["constvalue".$const];
|
||||||
$type=$_POST["consttype"];
|
$type=$_POST["consttype"];
|
||||||
$constnote=isset($_POST["constnote"])?$_POST["constnote"]:'';
|
$constnote=isset($_POST["constnote"])?$_POST["constnote"]:'';
|
||||||
|
|
||||||
$result=dolibarr_set_const($db,$const,$value,$typeconst[$type],0,$constnote,$conf->entity);
|
$result=dolibarr_set_const($db,$const,$value,$typeconst[$type],0,$constnote,$conf->entity);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -370,20 +369,10 @@ function form_constantes($tableau)
|
|||||||
print '<input type="hidden" name="consttype" value="texte">';
|
print '<input type="hidden" name="consttype" value="texte">';
|
||||||
}
|
}
|
||||||
else if (in_array($const,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL')))
|
else if (in_array($const,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL')))
|
||||||
{
|
|
||||||
// Editor wysiwyg
|
|
||||||
if ($conf->fckeditor->enabled)
|
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
$doleditor=new DolEditor('constvalue'.$const,$obj->value,160,'dolibarr_notes','',false,false);
|
$doleditor=new DolEditor('constvalue'.$const,$obj->value,160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60);
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<textarea class="flat" name="constvalue'.$const.'" cols="60" rows="5" wrap="soft">';
|
|
||||||
print dol_htmlentitiesbr_decode($obj->value);
|
|
||||||
print '</textarea>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input type="hidden" name="consttype" value="texte">';
|
print '<input type="hidden" name="consttype" value="texte">';
|
||||||
|
|||||||
@ -1514,6 +1514,7 @@ class CommonObject
|
|||||||
}
|
}
|
||||||
if ($_GET["action"] == 'editline')
|
if ($_GET["action"] == 'editline')
|
||||||
{
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
// editeur wysiwyg
|
// editeur wysiwyg
|
||||||
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS)
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user