From 2c0f1340d576d62ac81ed0f928a1ba9791327029 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 Mar 2014 13:17:20 +0100 Subject: [PATCH] New: Update ckeditor to version 4 (part 2) --- ChangeLog | 3 ++- htdocs/admin/fckeditor.php | 13 +++++++++++-- htdocs/core/class/doleditor.class.php | 12 ++++++------ htdocs/main.inc.php | 3 ++- htdocs/theme/amarok/ckeditor/config.js | 4 ++-- htdocs/theme/auguria/ckeditor/config.js | 4 ++-- htdocs/theme/bureau2crea/ckeditor/config.js | 4 ++-- htdocs/theme/eldy/ckeditor/config.js | 4 ++-- 8 files changed, 29 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54161b2dd41..a6bfc660b7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.6 compared to 3.5.* ***** For users: +- New: Update ckeditor to version 4. - New: Add form search customer order on commercial main page. - New: Can input barcode during product creation step. - New: Add autonumbering of barcode value for products. @@ -29,7 +30,7 @@ For users: - New: Add option MAIN_FAVICON_URL - Fix: Project Task numbering rule customs rule works - New: Created {line_price_ht_locale}, {line_price_vat_locale} and {line_price_ttc_locale} ODT tags - + TODO - New: Predefined product and free product use same form. - New: [ task #926 ] Add extrafield feature on order lines. diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index e968798c9ce..841b52cec1a 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -32,6 +32,13 @@ $langs->load("admin"); $langs->load("fckeditor"); $action = GETPOST('action','alpha'); +// Possible modes are: +// dolibarr_details +// dolibarr_notes +// dolibarr_readonly +// dolibarr_mailings +// Full (not sure this one is used) +$mode=GETPOST('mode')?GETPOST('mode','alpha'):'dolibarr_notes'; if (!$user->admin) accessforbidden(); @@ -152,10 +159,12 @@ else print ''."\n"; print '
'."\n"; - print_fiche_titre($langs->trans("TestSubmitForm"),'',''); + print_fiche_titre($langs->trans("TestSubmitForm"),'(mode='.$mode.')',''); print '
'."\n"; + print ''; $uselocalbrowser=true; - $editor=new DolEditor('formtestfield',isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test','',200,'dolibarr_notes','In', true, $uselocalbrowser); + $readonly=($mode=='dolibarr_readonly'?1:0); + $editor=new DolEditor('formtestfield',isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test','',200,$mode,'In', true, $uselocalbrowser, 1, 120, 8, $readonly); $editor->Create(); print '

'."\n"; print '
'."\n"; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index f5b9062cee7..3bc599ed61f 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -146,7 +146,7 @@ class DolEditor */ function Create($noprint=0,$morejs='') { - global $conf; + global $conf,$langs; $found=0; $out=''; @@ -169,9 +169,7 @@ class DolEditor if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR','1'); //$skin='kama'; - //$skin='office2003'; - //$skin='v2'; - $skin='kama'; + $skin='moono'; // default with cdeditor 4 $htmlencode_force=preg_match('/_encoded$/',$this->toolbarname)?'true':'false'; @@ -190,6 +188,8 @@ class DolEditor width: '.($this->width ? '\''.$this->width.'\'' : '\'\'').', height: '.$this->height.', skin: \''.$skin.'\', + language: \''.$langs->defaultlang.'\', + textDirection: \''.$langs->trans("DIRECTION").'\', on : { instanceReady : function( ev ) @@ -215,13 +215,13 @@ class DolEditor //$out.= ' filebrowserImageUploadUrl : \''.DOL_URL_ROOT.'/includes/fckeditor/editor/filemanagerdol/connectors/php/upload.php?Type=Image\','; $out.= "\n"; // To use filemanager with ckfinder (Non free) and ckfinder directory is inside htdocs/includes -/* $out.= ' filebrowserBrowseUrl : \''.DOL_URL_ROOT.'/includes/ckfinder/ckfinder.html\', + /* $out.= ' filebrowserBrowseUrl : \''.DOL_URL_ROOT.'/includes/ckfinder/ckfinder.html\', filebrowserImageBrowseUrl : \''.DOL_URL_ROOT.'/includes/ckfinder/ckfinder.html?Type=Images\', filebrowserFlashBrowseUrl : \''.DOL_URL_ROOT.'/includes/ckfinder/ckfinder.html?Type=Flash\', filebrowserUploadUrl : \''.DOL_URL_ROOT.'/includes/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files\', filebrowserImageUploadUrl : \''.DOL_URL_ROOT.'/includes/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images\', filebrowserFlashUploadUrl : \''.DOL_URL_ROOT.'/includes/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash\','."\n"; -*/ + */ $out.= ' filebrowserWindowWidth : \'900\', filebrowserWindowHeight : \'500\', filebrowserImageWindowWidth : \'900\', diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index fe123ef5ce7..095b123b963 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1210,7 +1210,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n"; print ''."\n"; - print ''."\n"; + //print ''."\n"; + print ''."\n"; } // Global js function diff --git a/htdocs/theme/amarok/ckeditor/config.js b/htdocs/theme/amarok/ckeditor/config.js index 0f2dbb3fc6f..4243ac6e57e 100755 --- a/htdocs/theme/amarok/ckeditor/config.js +++ b/htdocs/theme/amarok/ckeditor/config.js @@ -54,7 +54,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Anchor','Image','Table','SpecialChar'] + ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'] ]; config.toolbar_dolibarr_notes = @@ -66,7 +66,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Image','Table','SpecialChar'] + ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'] ]; config.toolbar_dolibarr_details = diff --git a/htdocs/theme/auguria/ckeditor/config.js b/htdocs/theme/auguria/ckeditor/config.js index ed3e3d462b9..fd4a34b0453 100644 --- a/htdocs/theme/auguria/ckeditor/config.js +++ b/htdocs/theme/auguria/ckeditor/config.js @@ -54,7 +54,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent','CreateDiv'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Anchor','Image','Table','SpecialChar'] + ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'] ]; config.toolbar_dolibarr_notes = @@ -66,7 +66,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Image','Table','SpecialChar'] + ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'] ]; config.toolbar_dolibarr_details = diff --git a/htdocs/theme/bureau2crea/ckeditor/config.js b/htdocs/theme/bureau2crea/ckeditor/config.js index ed3e3d462b9..fd4a34b0453 100644 --- a/htdocs/theme/bureau2crea/ckeditor/config.js +++ b/htdocs/theme/bureau2crea/ckeditor/config.js @@ -54,7 +54,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent','CreateDiv'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Anchor','Image','Table','SpecialChar'] + ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'] ]; config.toolbar_dolibarr_notes = @@ -66,7 +66,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Image','Table','SpecialChar'] + ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'] ]; config.toolbar_dolibarr_details = diff --git a/htdocs/theme/eldy/ckeditor/config.js b/htdocs/theme/eldy/ckeditor/config.js index c1e456e4d32..150b75dbd54 100644 --- a/htdocs/theme/eldy/ckeditor/config.js +++ b/htdocs/theme/eldy/ckeditor/config.js @@ -55,7 +55,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent','CreateDiv'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Anchor','Image','Table','SpecialChar'] + ['Link','Unlink','Anchor','Image','Table','HorizontalRule','SpecialChar'] ]; // Used for notes fields @@ -68,7 +68,7 @@ CKEDITOR.editorConfig = function( config ) ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','TextColor','RemoveFormat'], ['NumberedList','BulletedList','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'], - ['Link','Unlink','Image','Table','SpecialChar'] + ['Link','Unlink','Image','Table','HorizontalRule','SpecialChar'] ]; // Used for details lines