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
+------------
+
+* =>
+* =>
+
+
diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php
index 4c46ab43e23..61c2dca675b 100644
--- a/htdocs/core/ajax/saveinplace.php
+++ b/htdocs/core/ajax/saveinplace.php
@@ -94,8 +94,9 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
}
else $newelement = $element;
- $_POST['action']='update'; // Hack so restrictarea can test permission on write too
+ $_POST['action']='update'; // Hack so restrictarea will test permissions on write too
$feature = $newelement;
+ $feature2 = $subelement;
$object_id = $fk_element;
if ($feature == 'expedition' || $feature == 'shipping')
{
@@ -103,10 +104,18 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
$object_id = 0;
}
if ($feature == 'shipping') $feature = 'commande';
+ if ($feature == 'payment') { $feature = 'facture'; }
+ if ($feature == 'payment_supplier') { $feature = 'fournisseur'; $feature2 = 'facture'; }
//var_dump(GETPOST('action','aZ09'));
//var_dump($newelement.'-'.$subelement."-".$feature."-".$object_id);
- $check_access = restrictedArea($user, $feature, $object_id, '', $subelement);
+ $check_access = restrictedArea($user, $feature, $object_id, '', $feature2);
//var_dump($user->rights);
+ /*
+ 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))
+ */
if ($check_access)
{
diff --git a/htdocs/core/js/editinplace.js b/htdocs/core/js/editinplace.js
index 830aec5cd13..d1d4b6254ee 100644
--- a/htdocs/core/js/editinplace.js
+++ b/htdocs/core/js/editinplace.js
@@ -1,5 +1,5 @@
// Copyright (C) 2011-2014 Regis Houssin
-// Copyright (C) 2011 Laurent Destailleur
+// Copyright (C) 2011-2017 Laurent Destailleur
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,6 +26,50 @@ $(document).ready(function() {
var table_element = $('#jeditable_table_element').html();
var fk_element = $('#jeditable_fk_element').html();
+
+ if ($('.editval_string').length > 0) {
+ $('.editval_string').editable(urlSaveInPlace, {
+ type : 'text',
+ id : 'field',
+ width : withInPlace, /* Size of string area in px ? */
+ tooltip : tooltipInPlace,
+ placeholder : placeholderInPlace,
+ cancel : cancelInPlace,
+ submit : submitInPlace,
+ indicator : indicatorInPlace,
+ submitdata : function(result, settings) {
+ return getParameters(this, 'string');
+ },
+ callback : function(result, settings) {
+ getResult(this, result);
+ },
+ onreset : function(result, settings) {
+ getDefault(settings);
+ }
+ });
+ $('.editkey_string').hover(
+ function () {
+ console.log("We are hover (entry) an editkey_string");
+ $('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
+ },
+ function () {
+ console.log("We are no more hover an editkey_string");
+ $('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
+ }
+ );
+ $('.editkey_string').click(function() {
+ console.log("We click on the edit field");
+ $('#viewval_' + $(this).attr('id')).click();
+ $('#viewval_' + $(this).attr('id')).hide();
+ $('#editval_' + $(this).attr('id')).show().click();
+ });
+ $('.viewval_string.active').click(function() {
+ console.log("We click on the viewed value");
+ $('#viewval_' + $(this).attr('id').substr(8)).hide();
+ $('#editval_' + $(this).attr('id').substr(8)).show().click();
+ });
+ }
+
if ($('.editval_textarea').length > 0) {
$('.editval_textarea').editable(urlSaveInPlace, {
type : 'textarea',
@@ -127,49 +171,6 @@ $(document).ready(function() {
});
}
- if ($('.editval_string').length > 0) {
- $('.editval_string').editable(urlSaveInPlace, {
- type : 'text',
- id : 'field',
- width : withInPlace, /* Size of string area in px ? */
- tooltip : tooltipInPlace,
- placeholder : placeholderInPlace,
- cancel : cancelInPlace,
- submit : submitInPlace,
- indicator : indicatorInPlace,
- submitdata : function(result, settings) {
- return getParameters(this, 'string');
- },
- callback : function(result, settings) {
- getResult(this, result);
- },
- onreset : function(result, settings) {
- getDefault(settings);
- }
- });
- $('.editkey_string').hover(
- function () {
- console.log("We are hover (entry) an editkey_string");
- $('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
- },
- function () {
- console.log("We are no more hover an editkey_string");
- $('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
- }
- );
- $('.editkey_string').click(function() {
- $( '#viewval_' + $(this).attr('id') ).click();
- });
- $('.viewval_string.active').click(function() {
- $('#viewval_' + $(this).attr('id').substr(8)).hide();
- $('#editval_' + $(this).attr('id').substr(8)).show().click();
- });
- $('.editkey_string').click(function() {
- $('#viewval_' + $(this).attr('id')).hide();
- $('#editval_' + $(this).attr('id')).show().click();
- });
- }
-
if ($('.editval_numeric').length > 0) {
$('.editval_numeric').editable(urlSaveInPlace, {
type : 'text',
diff --git a/htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.js b/htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.js
index 003000ed8ea..b5560535aec 100644
--- a/htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.js
+++ b/htdocs/includes/jquery/plugins/jeditable/jquery.jeditable.js
@@ -424,7 +424,7 @@
});
/* otherwise use button with given string as text */
} else {
- var submit = $('');
+ var submit = $('');
submit.html(settings.submit);
}
$(this).append(submit);
@@ -435,7 +435,7 @@
var cancel = $(settings.cancel);
/* otherwise use button with given string as text */
} else {
- var cancel = $('');
+ var cancel = $('');
cancel.html(settings.cancel);
}
$(this).append(cancel);
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index cd5cb0ba296..4febe121156 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1244,7 +1244,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! defined('DISABLE_JQUERY_JEDITABLE'))
{
print ''."\n";
- print ''."\n";
+ print ''."\n";
print ''."\n";
print ''."\n";
print '