diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index b29cce1a663..d353040f25f 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -752,6 +752,7 @@ return [ 'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredMethod'], 'htdocs/core/modules/oauth/google_oauthcallback.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanTypeArraySuspiciousNullable', 'PhanUndeclaredMethod'], 'htdocs/core/modules/oauth/microsoft_oauthcallback.php' => ['PhanUndeclaredMethod'], + 'htdocs/core/modules/oauth/microsoft2_oauthcallback.php' => ['PhanUndeclaredMethod'], 'htdocs/core/modules/oauth/stripelive_oauthcallback.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/modules/oauth/stripetest_oauthcallback.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanUndeclaredGlobalVariable'], 'htdocs/core/modules/payment/mod_payment_ant.php' => ['PhanTypeMismatchArgumentProbablyReal'], diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 4dd37b89e24..b219d0ae92f 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -226,7 +226,7 @@ if ($action == 'edit') { print '
| '.$langs->trans('Label').' | |||
| '.$langs->trans('Description').' | '; - $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor') && getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print ' | ||
| '.$langs->trans("Description").' | '; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, '90%'); + $doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor') && getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, '90%'); $doleditor->Create(); print ' | ||
| '.$langs->trans('Description').' | '; - $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor') && getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print ' | ||
| '.$langs->trans('Label').' | '; print '|||
| '.$langs->trans('Description').' | '; - $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor') && getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print ' | '; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ? GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_4, '90%'); + $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ? GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor') && getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_4, '90%'); $doleditor->Create(); print ' | '; @@ -1063,7 +1063,7 @@ if ($action == 'create') { print ''; // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ? GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_4, '95%'); + $doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ? GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor') && getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_4, '95%'); $doleditor->Create(); print ' | '; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 77d0cf4ff30..6f08301d5a9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7445,7 +7445,7 @@ abstract class CommonObject } elseif (preg_match('/^html/', (string) $type)) { if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); + $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, '90%'); $out = (string) $doleditor->Create(1, '', true, '', '', $moreparam, $morecss); } else { $out = ''; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index eb33dc672be..a4f0689d687 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -53,21 +53,21 @@ class DolEditor /** * Create an object to build an HTML area to edit a large string content * - * @param string $htmlname HTML name of WYSIWYG field - * @param string $content Content of WYSIWYG field - * @param int|string $width Width in pixel of edit area (auto by default) - * @param int $height Height in pixel of edit area (200px by default) - * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly'). - * @param string $toolbarlocation Deprecated. Not used - * @param boolean $toolbarstartexpanded Bar is visible or not at start - * @param boolean|int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. - * @param boolean|string $okforextendededitor True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. - * Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". - * @param int $rows Size of rows for textarea tool - * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') - * @param int $readonly 0=Read/Edit, 1=Read only - * @param array $poscursor Array for initial cursor position array('x'=>x, 'y'=>y). - * array('find'=> 'word') can be used to go to line were the word has been found + * @param string $htmlname HTML name of WYSIWYG field + * @param string $content Content of WYSIWYG field + * @param int|string $width Width in pixel of edit area (auto by default) + * @param int $height Height in pixel of edit area (200px by default) + * @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes[_encoded]', 'dolibarr_details[_encoded]'=the less featured, 'dolibarr_mailings[_encoded]', 'dolibarr_readonly'). + * @param string $toolbarlocation Deprecated. Not used + * @param boolean $toolbarstartexpanded Bar is visible or not at start + * @param boolean|int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content. + * @param boolean|int|string $okforextendededitor 1 or True=Allow usage of extended editor tool if qualified (like ckeditor). If 'textarea', force use of simple textarea. If 'ace', force use of Ace. + * Warning: If you use 'ace', don't forget to also include ace.js in page header. Also, the button "save" must have class="buttonforacesave". + * @param int $rows Size of rows for textarea tool + * @param string $cols Size of cols for textarea tool (textarea number of cols '70' or percent 'x%') + * @param int $readonly 0=Read/Edit, 1=Read only + * @param array $poscursor Array for initial cursor position array('x'=>x, 'y'=>y). + * array('find'=> 'word') can be used to go to line were the word has been found */ public function __construct($htmlname, $content, $width = '', $height = 200, $toolbarname = 'Basic', $toolbarlocation = 'In', $toolbarstartexpanded = false, $uselocalbrowser = 1, $okforextendededitor = true, $rows = 0, $cols = '', $readonly = 0, $poscursor = array()) { @@ -90,7 +90,7 @@ class DolEditor $this->readonly = $readonly; // Check if extended editor is ok. If not we force textarea - if ((!isModEnabled('fckeditor') && $okforextendededitor != 'ace') || empty($okforextendededitor)) { + if ((!isModEnabled('fckeditor') && $okforextendededitor !== 'ace') || empty($okforextendededitor)) { $this->tool = 'textarea'; } if ($okforextendededitor === 'ace') { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 8222022389f..059826a1c80 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1220,7 +1220,7 @@ class ExtraFields } elseif ($type == 'html') { if (!preg_match('/search_/', $keyprefix)) { // If keyprefix is search_ or search_options_, we must just use a simple text field require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, '90%'); + $doleditor = new DolEditor($keyprefix.$key.$keysuffix, $value, '', 200, 'dolibarr_notes', 'In', false, false, isModEnabled('fckeditor') && getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, '90%'); $out = (string) $doleditor->Create(1); } else { $out = ''; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index f6d04ccb8be..344d12be76e 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -876,7 +876,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { // Description print '
| '.$langs->trans("Description").' | '; print ''; - $doleditor = new DolEditor('description', GETPOST("description", 'restricthtml'), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $doleditor = new DolEditor('description', GETPOST("description", 'restricthtml'), '', 90, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor') && getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print ' | ||
| '.$langs->trans("Ref").' | '; - print ''; + print ' | '; print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); print ' | |
| '.$langs->trans("Description").' | '; print ''; - $doleditor = new DolEditor('description', $object->description, '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $doleditor = new DolEditor('description', $object->description, '', 90, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor') && getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); $doleditor->Create(); print ' | ||
| '.$langs->trans("Project").' | '; + print ' | ||
| '.$langs->trans("Project").' | '; print $projectstatic->getNomUrl(1); print ' | '.$langs->trans("ThirdParty").' | '; + print ' | '.$langs->trans("ThirdParty").' | '; if ($projectstatic->thirdparty->id) { print $projectstatic->thirdparty->getNomUrl(1); } else { @@ -511,7 +511,8 @@ if ($id > 0 || !empty($ref)) { // Task parent print ' |
| '.$langs->trans("ChildOfProjectTask").' | '; - $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id); + print img_picto('', 'projecttask'); + $formother->selectProjectTasks($object->fk_task_parent, $projectstatic->id, 'task_parent', ($user->admin ? 0 : 1), 0, 0, 0, $object->id, '', 'minwidth100 widthcentpercentminusxx maxwidth500'); print ' | ||
| '.$langs->trans("Description").' | '; print ''; // WYSIWYG editor include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $cked_enabled = (getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE') ? $conf->global->FCKEDITOR_ENABLE_SOCIETE : 0); $nbrows = getDolGlobalInt('MAIN_INPUT_DESC_HEIGHT', 0); - $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, $cked_enabled, $nbrows); + $doleditor = new DolEditor('description', $object->description, '', 80, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), $nbrows, '90%'); print $doleditor->Create(); + print ' | ||
| '.$langs->trans("Budget").' | '; - print ''; + print ' | '; print ' | '; - print ''; + print ''; print " | "; } print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6ffdac0cdfe..9fe180f2758 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1,6 +1,6 @@ +/* Copyright (C) 2004-2017 Laurent Destailleur