diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 161c258fc77..5024e021ffb 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -119,19 +119,11 @@ if ($id) print ''; if ($action == 'edit' && $user->rights->adherent->creer) { - print ""; + print ""; print "id."\">"; - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MEMBER) - { - // Editeur wysiwyg - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('note',$adh->note,280,'dolibarr_notes','In',true); - $doleditor->Create(); - } - else - { - print ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('note',$adh->note,280,'dolibarr_notes','',true,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MEMBER,10,80); + $doleditor->Create(); } else { diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index f344d4dd0a8..bc9d24a7928 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -228,18 +228,9 @@ if ($_GET["action"] == 'create') print ""; print ''.$langs->trans("WelcomeEMail").''; - if ($conf->fckeditor->enabled) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('mail_valid',$adht->mail_valid,280,'dolibarr_notes','',false); - $doleditor->Create(); - } - else - { - print ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('mail_valid',$adht->mail_valid,280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90); + $doleditor->Create(); print ''; print "\n"; @@ -616,18 +607,9 @@ if ($rowid > 0) print ""; print ''.$langs->trans("WelcomeEMail").''; - if ($conf->fckeditor->enabled) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('mail_valid',$adht->mail_valid,280,'dolibarr_notes','',false); - $doleditor->Create(); - } - else - { - print ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('mail_valid',$adht->mail_valid,280,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,15,90); + $doleditor->Create(); print ""; print '    '; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index a8c9afdd085..4c8a745e0ed 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -258,33 +258,18 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit // Message on login page $var=!$var; print ''.$langs->trans("MessageLogin").''; - if ($conf->fckeditor->enabled) - { - // Editeur wysiwyg - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('main_home',$conf->global->MAIN_HOME,158,'dolibarr_notes','In',false); - $doleditor->Create(); - } - else - { - print ''; - } + // Editeur wysiwyg + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('main_home',$conf->global->MAIN_HOME,158,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,ROWS_5,90); + $doleditor->Create(); print ''; // Message of the day on home page $var=!$var; print ''.$langs->trans("MessageOfDay").''; - if ($conf->fckeditor->enabled) - { - // Editeur wysiwyg - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,158,'dolibarr_notes','In',false); - $doleditor->Create(); - } - else - { - print ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,158,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,ROWS_5,90); + $doleditor->Create(); print ''; /* diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 7ccc2b70156..d430fdeb132 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -134,20 +134,9 @@ print ''; print ''; print ''.$langs->trans("Description").''; print ''; - -if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) -{ - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('description',$categorie->description,200,'dolibarr_notes'); - $doleditor->Create(); -} -else -{ - print ''; -} - +require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); +$doleditor=new DolEditor('description',$categorie->description,200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,ROWS_6,50); +$doleditor->Create(); print ''; print ''; print '
'; diff --git a/htdocs/categories/fiche.php b/htdocs/categories/fiche.php index b0fe9088b61..cdd083b5422 100644 --- a/htdocs/categories/fiche.php +++ b/htdocs/categories/fiche.php @@ -231,20 +231,9 @@ if ($user->rights->categorie->creer) print ''.$langs->trans("Ref").''; print''; print ''.$langs->trans("Description").''; - - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('description',$categorie->description,200,'dolibarr_notes'); - $doleditor->Create(); - } - else - { - print ''; - } - + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('description',$categorie->description,200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC,ROWS_6,50); + $doleditor->Create(); print ''; print ''.$langs->trans ("AddIn").''; diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 58bd6018f5f..18c4f12ac27 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -579,17 +579,9 @@ if (GETPOST('action') == 'create') // Note print ''.$langs->trans("Note").''; - if ($conf->fckeditor->enabled) - { - // Editeur wysiwyg - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('note',($_POST["note"]?$_POST["note"]:$actioncomm->note),280,'dolibarr_notes','In',true); - $doleditor->Create(); - } - else - { - print ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('note',($_POST["note"]?$_POST["note"]:$actioncomm->note),280,'dolibarr_notes','In',true,$conf->fckeditor->enabled,ROWS_7,90); + $doleditor->Create(); print ''; print ''; @@ -762,18 +754,10 @@ if ($_GET["id"]) // Note print ''.$langs->trans("Note").''; - if ($conf->fckeditor->enabled) - { - // Editeur wysiwyg - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('note',$act->note,240,'dolibarr_notes','In',true); - $doleditor->Create(); - } - else - { - print ''; - } - + // Editeur wysiwyg + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('note',$act->note,240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90); + $doleditor->Create(); print ''; print ''; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index e4453520060..4aaadcfb9ba 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -625,16 +625,9 @@ if ($_GET["action"] == 'create') print ''; print ''; // Editeur wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('body',$_POST['body'],320,'dolibarr_mailings','',true,true); - $doleditor->Create(); - } - else - { - print ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('body',$_POST['body'],320,'dolibarr_mailings','',true,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING,20,70); + $doleditor->Create(); print ''; print ''; @@ -1014,17 +1007,9 @@ else print ''; print ''; // Editeur wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('body',$mil->body,320,'dolibarr_mailings','',true,true); - $doleditor->Create(); - } - else - { - print ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('body',$mil->body,320,'dolibarr_mailings','',true,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_MAILING,20,70); + $doleditor->Create(); print ''; print ''; diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 37e14695111..17f65bf9571 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -274,18 +274,9 @@ if ($_REQUEST["action"] == 'create') print ''.$langs->trans("Comment").''; print ''; // Editor wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('account_comment',$account->comment,200,'dolibarr_notes','',false); - $doleditor->Create(); - } - else - { - print ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('account_comment',$account->comment,200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70); + $doleditor->Create(); print ''; // Sold @@ -567,17 +558,9 @@ else print ''.$langs->trans("Comment").''; print ''; // Editor wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),200,'dolibarr_notes','',false); - $doleditor->Create(); - } - else - { - print ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('account_comment',(isset($_POST["account_comment"])?$_POST["account_comment"]:$account->comment),200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE,10,70); + $doleditor->Create(); print ''; print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index a6eb0799a1a..c2f91d6a73e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -2922,20 +2922,10 @@ else } // Description - Editor wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('desc',$objp->description,164,'dolibarr_details'); - $doleditor->Create(); - } - else - { - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - print ''; - } + $nbrows=ROWS_2; + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('desc',$objp->description,164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); print ''; // VAT diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1d8a389b7f0..ef3b3612fd5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1324,7 +1324,7 @@ class CommonObject /** * Return HTML with selected object line * @param line Selected object line - * TODO mettre le html dans un template + * TODO Move this into a html class, not a business class */ function printLine($line,$var=true,$num=0,$i=0,$dateSelector=0) { @@ -1514,20 +1514,12 @@ class CommonObject } if ($_GET["action"] == 'editline') { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); // editeur wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('desc',$line->description,164,'dolibarr_details'); - $doleditor->Create(); - } - else - { - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - print ''; - } + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('desc',$line->description,164,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); } print ''; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index c8e68ed4dc2..84f5ab76ad5 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -485,20 +485,10 @@ class FormMail } else { - if ($this->withfckeditor) - { - // Editeur wysiwyg - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('message',$defaultmessage,280,'dolibarr_notes','In',true); - $doleditor->Create(); - } - else - { - print ''; - } - + // Editeur wysiwyg + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $doleditor=new DolEditor('message',$defaultmessage,280,'dolibarr_notes','In',true,false,$this->withfckeditor,8,72); + $doleditor->Create(); } print "\n"; } diff --git a/htdocs/core/tpl/addfreeproductform.tpl.php b/htdocs/core/tpl/addfreeproductform.tpl.php index 6bf76c1f932..c4475aa3b35 100644 --- a/htdocs/core/tpl/addfreeproductform.tpl.php +++ b/htdocs/core/tpl/addfreeproductform.tpl.php @@ -47,18 +47,11 @@ if ($conf->global->PRODUIT_USE_MARKUP) $colspan = 'colspan="2"'; if ($conf->product->enabled && $conf->service->enabled) echo '
'; // Editor wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],100,'dolibarr_details'); - $doleditor->Create(); - } - else - { - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - echo ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + $doleditor=new DolEditor('dp_desc',$_POST["dp_desc"],100,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); ?> diff --git a/htdocs/core/tpl/addpredefinedproductform.tpl.php b/htdocs/core/tpl/addpredefinedproductform.tpl.php index fbbe6ad7592..c28a87664aa 100644 --- a/htdocs/core/tpl/addpredefinedproductform.tpl.php +++ b/htdocs/core/tpl/addpredefinedproductform.tpl.php @@ -60,18 +60,11 @@ $colspan = 'colspan="3"'; if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '
'; // Editor wysiwyg - if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS) - { - require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('np_desc',$_POST["np_desc"],100,'dolibarr_details'); - $doleditor->Create(); - } - else - { - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - echo ''; - } + require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + $doleditor=new DolEditor('np_desc',$_POST["np_desc"],100,'dolibarr_details','',false,true,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS,$nbrows,70); + $doleditor->Create(); ?>