diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 2268687fff7..bd7893c3246 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -941,7 +941,14 @@ else if (($object->statut == 0 || $object->statut == 1) && $user->rights->mailing->creer) { - print ''.$langs->trans("EditWithEditor").''; + if (! empty($conf->fckeditor->enabled) && ! empty($conf->global->FCKEDITOR_ENABLE_MAILING)) + { + print ''.$langs->trans("EditWithEditor").''; + } + else + { + print ''.$langs->trans("EditWithTextEditor").''; + } if (! empty($conf->use_javascript_ajax)) print ''.$langs->trans("EditHTMLSource").''; } @@ -1103,7 +1110,7 @@ else $readonly=1; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('bodyemail',$object->body,'',600,'dolibarr_mailings','',false,true,empty($conf->global->FCKEDITOR_ENABLE_MAILING)?0:1,20,120,$readonly); + $doleditor=new DolEditor('bodyemail',$object->body,'',600,'dolibarr_mailings','',false,true,empty($conf->global->FCKEDITOR_ENABLE_MAILING)?0:1,20,'90%',$readonly); $doleditor->Create(); } else print dol_htmlentitiesbr($object->body); diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 918956d7b32..723ae0d47b1 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -170,7 +170,8 @@ class DolEditor if (in_array($this->tool,array('textarea','ckeditor'))) { $found=1; - //$out.= ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0cbb7c22d9c..f24cf0338c5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -259,14 +259,18 @@ function dol_shutdown() * @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails) * @param mixed $options Options to pass to filter_var when $check is set to 'custom'. * @return string|string[] Value found (string or array), or '' if check fails - * - * @TODO Set default value for check to alpha. Check all WYSIWYG edition (email and description...) is still ok with rich text. */ -function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) +function GETPOST($paramname, $check='alpha', $method=0, $filter=NULL, $options=NULL) { global $mysoc,$user,$conf; if (empty($paramname)) return 'BadFirstParameterForGETPOST'; + if (empty($check)) + { + dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING); + // Enable this line to know who call the GETPOST with '' $check parameter. + //var_dump(debug_backtrace()[0]); + } if (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; @@ -420,15 +424,6 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) } - if (empty($check) && ! empty($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL >= 2) - { - dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param not defined, when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING); - // Enable this line to know who call the GETPOST with empty $check parameter. - //var_dump(debug_backtrace()[0]); - } - - if (! empty($check)) - { // Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters) // Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ... // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text. @@ -518,7 +513,6 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) $out=filter_var($out, $filter, $options); break; } - } // Code for search criteria persistence. // Save data into session if key start with 'search_' or is 'smonth', 'syear', 'month', 'year' diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index e7171fb94b1..0cea69200dc 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -714,6 +714,7 @@ CreateDraft=Create draft SetToDraft=Back to draft ClickToEdit=Click to edit EditWithEditor=Edit with CKEditor +EditWithTextEditor=Edit with Text editor EditHTMLSource=Edit HTML Source ObjectDeleted=Object %s deleted ByCountry=By country