From d8de85f788b3c9e6d95bbce62ee588467bd9b662 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 13 Jan 2025 09:41:41 +0100 Subject: [PATCH] QUAL remove unused jQuery-Jeditable --- COPYRIGHT | 1 - htdocs/comm/card.php | 3 +- htdocs/core/ajax/loadinplace.php | 8 +- htdocs/core/ajax/saveinplace.php | 8 +- htdocs/core/class/html.form.class.php | 4 +- htdocs/fourn/card.php | 3 +- .../jeditable/jquery.jeditable.ckeditor.js | 70 --- .../plugins/jeditable/jquery.jeditable.js | 543 ------------------ .../plugins/jeditable/jquery.jeditable.min.js | 38 -- .../jquery.jeditable.ui-autocomplete.js | 9 - .../jquery.jeditable.ui-datepicker.js | 17 - htdocs/main.inc.php | 4 +- htdocs/theme/eldy/global.inc.php | 2 +- htdocs/theme/md/style.css.php | 4 +- 14 files changed, 19 insertions(+), 695 deletions(-) delete mode 100644 htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js delete mode 100644 htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.js delete mode 100644 htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.min.js delete mode 100644 htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.ui-autocomplete.js delete mode 100644 htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.ui-datepicker.js diff --git a/COPYRIGHT b/COPYRIGHT index e979d87fcf3..32b5f0ffd22 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -62,7 +62,6 @@ jQuery select2 4.0.13 GPL and Apache License Yes jQuery blockUI 2.70.0 GPL and MIT License Yes JS library plugin blockUI (to use ajax popups) jQuery Colorpicker 1.1 MIT License Yes JS library for color picker for a defined list of colors jQuery JCrop 0.9.8 GPL and MIT License Yes JS library plugin Crop (to crop images) -jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place) jQuery jNotify 1.1.00 Apache License 2.0 Yes JS library plugin jNotify (to use ajax popups) jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for filetree diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index d9c5a933554..4bc3b62475a 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -561,7 +561,8 @@ if ($object->id > 0) { print ''; print $form->editfieldkey("OutstandingBill", 'outstanding_limit', $object->outstanding_limit, $object, $user->hasRight('societe', 'creer')); print ''; - $limit_field_type = (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE')) ? 'numeric' : 'amount'; + //$limit_field_type = (getDolGlobalString('MAIN_USE_EDIT_IN_PLACE')) ? 'numeric' : 'amount'; // TODO deprecated ? + $limit_field_type = 'amount'; print $form->editfieldval("OutstandingBill", 'outstanding_limit', $object->outstanding_limit, $object, $user->hasRight('societe', 'creer'), $limit_field_type, ($object->outstanding_limit != '' ? price($object->outstanding_limit) : '')); print ''; print ''; diff --git a/htdocs/core/ajax/loadinplace.php b/htdocs/core/ajax/loadinplace.php index 2b1c1f34666..c068602a72d 100644 --- a/htdocs/core/ajax/loadinplace.php +++ b/htdocs/core/ajax/loadinplace.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2025 Regis Houssin * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * @@ -19,7 +19,7 @@ /** * \file htdocs/core/ajax/loadinplace.php - * \brief File to load field value. used only when option "Edit In Place" is set (MAIN_USE_JQUERY_JEDITABLE). + * \brief File to load field value. used only when option "Edit In Place" is set (MAIN_USE_EDIT_IN_PLACE). */ if (!defined('NOTOKENRENEWAL')) { @@ -77,8 +77,8 @@ if (!$result) { httponly_accessforbidden('Not allowed by restrictArea'); } -if (!getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE')) { - httponly_accessforbidden('Can be used only when option MAIN_USE_JQUERY_JEDITABLE is set'); +if (!getDolGlobalString('MAIN_USE_EDIT_IN_PLACE')) { + httponly_accessforbidden('Can be used only when option MAIN_USE_EDIT_IN_PLACE is set'); } diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index 9d94c28aac1..a26b6f3f4a9 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2011-2025 Regis Houssin * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France * @@ -19,7 +19,7 @@ /** * \file htdocs/core/ajax/saveinplace.php - * \brief File to load field value. used only when option "Edit In Place" is set (MAIN_USE_JQUERY_JEDITABLE). + * \brief File to load field value. used only when option "Edit In Place" is set (MAIN_USE_EDIT_IN_PLACE). */ if (!defined('NOTOKENRENEWAL')) { @@ -89,8 +89,8 @@ if (!$result) { httponly_accessforbidden('Not allowed by restrictArea'); } -if (!getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE')) { - httponly_accessforbidden('Can be used only when option MAIN_USE_JQUERY_JEDITABLE is set'); +if (!getDolGlobalString('MAIN_USE_EDIT_IN_PLACE')) { + httponly_accessforbidden('Can be used only when option MAIN_USE_EDIT_IN_PLACE is set'); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 29de7398bac..c4aa8f7e8f4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -120,7 +120,7 @@ class Form $ret = ''; // TODO change for compatibility - if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;/', $typeofdata)) { + if (getDolGlobalString('MAIN_USE_EDIT_IN_PLACE') && !preg_match('/^select;/', $typeofdata)) { if (!empty($perm)) { $tmp = explode(':', $typeofdata); $ret .= '
'; @@ -246,7 +246,7 @@ class Form } // When option to edit inline is activated - if (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE') && !preg_match('/^select;|day|datepicker|dayhour|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select + if (getDolGlobalString('MAIN_USE_EDIT_IN_PLACE') && !preg_match('/^select;|day|datepicker|dayhour|datehourpicker/', $typeofdata)) { // TODO add jquery timepicker and support select $ret .= $this->editInPlace($object, $value, $htmlname, ($perm ? 1 : 0), $typeofdata, $editvalue, $extObject, $custommsg); } else { if ($editaction == '') { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 026901afa32..3bf4775be7f 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -448,7 +448,8 @@ if ($object->id > 0) { print ''; print $form->editfieldkey("OrderMinAmount", 'supplier_order_min_amount', $object->supplier_order_min_amount, $object, $user->hasRight("societe", "creer")); print ''; - $limit_field_type = (getDolGlobalString('MAIN_USE_JQUERY_JEDITABLE')) ? 'numeric' : 'amount'; + //$limit_field_type = (getDolGlobalString('MAIN_USE_EDIT_IN_PLACE')) ? 'numeric' : 'amount'; // TODO deprecated ? + $limit_field_type = 'amount'; print $form->editfieldval("OrderMinAmount", 'supplier_order_min_amount', $object->supplier_order_min_amount, $object, $user->hasRight("societe", "creer"), $limit_field_type, ($object->supplier_order_min_amount != '' ? price($object->supplier_order_min_amount) : '')); print ''; print ''; diff --git a/htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js b/htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js deleted file mode 100644 index 3682d4fe14e..00000000000 --- a/htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.ckeditor.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * CKEditor input for Jeditable - * - * Adapted from Wysiwyg input for Jeditable by Mike Tuupola - * http://www.appelsiini.net/2008/9/wysiwyg-for-jeditable - * - * Copyright (c) 2009 Jeremy Bell - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/mit-license.php - * - * Depends on CKEditor: - * http://ckeditor/ - * - */ - -(function($) { - $.generateId = function() { - return arguments.callee.prefix + arguments.callee.count++; - }; - $.generateId.prefix = 'jq$'; - $.generateId.count = 0; - - $.fn.generateId = function() { - return this.each(function() { - this.id = $.generateId(); - }); - }; -})(jQuery); - -(function($) { -$.editable.addInputType('ckeditor', { - /* Use default textarea instead of writing code here again. */ - //element : $.editable.types.textarea.element, - element : function(settings, original) { - /* Hide textarea to avoid flicker. */ - var textarea = $('