From ab558ee5fae5fbbaa92452160e80d8664e83453a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 14 Dec 2017 09:49:55 +0100 Subject: [PATCH 01/20] Update product.php --- htdocs/product/admin/product.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 2757234251d..69355a7f1e8 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -56,7 +56,6 @@ $select_pricing_rules=array( ); if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { - $langs->load("admin"); $select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY'] = $langs->trans('PriceByQuantity').' ('.$langs->trans("VersionExperimental").')'; // TODO If this is enabled, price must be hidden when price by qty is enabled, also price for quantity must be used when adding product into order/propal/invoice $select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY&PRODUIT_MULTIPRICES'] = $langs->trans('MultiPricesAbility') . '+' . $langs->trans('PriceByQuantity').' ('.$langs->trans("VersionExperimental").')'; } From 28214598943d0bbb46013fb661448954e5a584d0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 20 Dec 2017 11:36:51 +0100 Subject: [PATCH 02/20] Fix: avoid php warning --- htdocs/compta/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 7a494113090..fc65c6f05c3 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -102,7 +102,7 @@ if (empty($reshook)) $tmpinvoice=new Facture($db); foreach ($_POST as $key => $value) { - if (substr($key,0,7) == 'amount_') + if (substr($key,0,7) == 'amount_' && GETPOST($key) != '') { $cursorfacid = substr($key,7); $amounts[$cursorfacid] = price2num(trim(GETPOST($key))); From b1f98b5903cdc46a83345420963ef0ac6c483835 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Dec 2017 12:45:38 +0100 Subject: [PATCH 03/20] Fix inline edit --- htdocs/core/ajax/saveinplace.php | 19 +++++++++++++++---- htdocs/expedition/card.php | 14 +++++++------- htdocs/theme/eldy/style.css.php | 5 ++++- htdocs/theme/md/style.css.php | 4 +++- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php index eb04379a778..4c46ab43e23 100644 --- a/htdocs/core/ajax/saveinplace.php +++ b/htdocs/core/ajax/saveinplace.php @@ -94,10 +94,21 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($ } else $newelement = $element; - if (! empty($user->rights->$newelement->creer) || ! empty($user->rights->$newelement->create) || ! empty($user->rights->$newelement->write) - || (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write))) - || ($element == 'payment' && $user->rights->facture->paiement) - || ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer)) + $_POST['action']='update'; // Hack so restrictarea can test permission on write too + $feature = $newelement; + $object_id = $fk_element; + if ($feature == 'expedition' || $feature == 'shipping') + { + $feature = 'commande'; + $object_id = 0; + } + if ($feature == 'shipping') $feature = 'commande'; + //var_dump(GETPOST('action','aZ09')); + //var_dump($newelement.'-'.$subelement."-".$feature."-".$object_id); + $check_access = restrictedArea($user, $feature, $object_id, '', $subelement); + //var_dump($user->rights); + + if ($check_access) { // Clean parameters $newvalue = trim($value); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 81b6ed455a7..15caab8a1ee 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -127,7 +127,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once - // Set incoterm + // Reopen if ($action == 'reopen' && $user->rights->expedition->creer) { $object->fetch($id); @@ -503,8 +503,8 @@ if (empty($reshook)) } } - // Action update description of emailing - else if ($action == 'settrackingnumber' || $action == 'settrackingurl' + // Action update + else if ($action == 'settracking_number' || $action == 'settracking_url' || $action == 'settrueWeight' || $action == 'settrueWidth' || $action == 'settrueHeight' @@ -513,8 +513,8 @@ if (empty($reshook)) { $error=0; - if ($action == 'settrackingnumber') $object->tracking_number = trim(GETPOST('trackingnumber','alpha')); - if ($action == 'settrackingurl') $object->tracking_url = trim(GETPOST('trackingurl','int')); + if ($action == 'settracking_number') $object->tracking_number = trim(GETPOST('tracking_number','alpha')); + if ($action == 'settracking_url') $object->tracking_url = trim(GETPOST('tracking_url','int')); if ($action == 'settrueWeight') { $object->trueWeight = trim(GETPOST('trueWeight','int')); $object->weight_units = GETPOST('weight_units','int'); @@ -1692,8 +1692,8 @@ else if ($id || $ref) print ''; // Tracking Number - print ''.$form->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).''; - print $form->editfieldval("TrackingNumber",'trackingnumber',$object->tracking_url,$object,$user->rights->expedition->creer,'string',$object->tracking_number); + print ''.$form->editfieldkey("TrackingNumber",'tracking_number',$object->tracking_number,$object,$user->rights->expedition->creer).''; + print $form->editfieldval("TrackingNumber",'tracking_number',$object->tracking_url,$object,$user->rights->expedition->creer,'string',$object->tracking_number); print ''; // Incoterms diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index e809f800bb5..7f294d78e4e 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -3472,17 +3472,20 @@ td.gtaskname { /* ============================================================================== */ -/* jQuery - jeditable */ +/* jQuery - jeditable for inline edit */ /* ============================================================================== */ .editkey_textarea, .editkey_ckeditor, .editkey_string, .editkey_email, .editkey_numeric, .editkey_select, .editkey_autocomplete { background: url() right top no-repeat; cursor: pointer; + margin-right: 3px; } .editkey_datepicker { background: url() right center no-repeat; + margin-right: 3px; cursor: pointer; + margin-right: 3px; } .editval_textarea.active:hover, .editval_ckeditor.active:hover, .editval_string.active:hover, .editval_email.active:hover, .editval_numeric.active:hover, .editval_select.active:hover, .editval_autocomplete.active:hover, .editval_datepicker.active:hover { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index f4966a105b7..5a56d027b15 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3542,17 +3542,19 @@ td.gtaskname { /* ============================================================================== */ -/* jQuery - jeditable */ +/* jQuery - jeditable for inline edit */ /* ============================================================================== */ .editkey_textarea, .editkey_ckeditor, .editkey_string, .editkey_email, .editkey_numeric, .editkey_select, .editkey_autocomplete { background: url() right top no-repeat; cursor: pointer; + margin-right: 3px; } .editkey_datepicker { background: url() right center no-repeat; cursor: pointer; + margin-right: 3px; } .editval_textarea.active:hover, .editval_ckeditor.active:hover, .editval_string.active:hover, .editval_email.active:hover, .editval_numeric.active:hover, .editval_select.active:hover, .editval_autocomplete.active:hover, .editval_datepicker.active:hover { From ca8ae3c7230aea9f8414e50f6a2b437f01b39bd8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 20 Dec 2017 13:17:21 +0100 Subject: [PATCH 04/20] Fix option MAIN_USE_JQUERY_JEDITABLE --- dev/dolibarr_changes.txt | 10 ++- htdocs/core/ajax/saveinplace.php | 13 ++- htdocs/core/js/editinplace.js | 89 ++++++++++--------- .../plugins/jeditable/jquery.jeditable.js | 4 +- htdocs/main.inc.php | 2 +- 5 files changed, 68 insertions(+), 50 deletions(-) diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 0570525cdad..53f58c6790e 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -123,4 +123,12 @@ PARSEDOWN else $len = strlen($line); $shortage = 4 - $len % 4; - + + +JEDITABLE.JS +------------ + +*