diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt
index 16834e7837b..9e6ab3a8ddc 100644
--- a/dev/dolibarr_changes.txt
+++ b/dev/dolibarr_changes.txt
@@ -162,4 +162,11 @@ PARSEDOWN
if (function_exists('mb_strlen')) $len = mb_strlen($line, 'utf-8');
else $len = strlen($line);
$shortage = 4 - $len % 4;
-
\ No newline at end of file
+
+
+JEDITABLE.JS
+------------
+
+* =>
+* =>
+
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 3cccffa2518..98c06179368 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -2616,12 +2616,12 @@ if ($action == 'create')
print $desc;
print '
';
- print ' 0 ? 'checked':'').' /> ";
- print '
0 ? 'checked':'').' /> ";
+ print ' 0 ? 'checked':'').' /> ";
+ print '
0 ? 'checked':'').' /> ";
print '
';
- print '';
- }
+ print '';
+ }
}
else
{
diff --git a/htdocs/core/ajax/saveinplace.php b/htdocs/core/ajax/saveinplace.php
index eb04379a778..61c2dca675b 100644
--- a/htdocs/core/ajax/saveinplace.php
+++ b/htdocs/core/ajax/saveinplace.php
@@ -94,10 +94,30 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
}
else $newelement = $element;
+ $_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')
+ {
+ $feature = 'commande';
+ $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, '', $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))
+ || (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)
{
// Clean parameters
$newvalue = trim($value);
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/expedition/card.php b/htdocs/expedition/card.php
index 1318e3f2857..08f6c35404a 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -123,7 +123,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);
@@ -501,8 +501,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'
@@ -511,8 +511,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');
@@ -1989,8 +1989,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/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 6d71c35a4df..c0710841369 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1243,7 +1243,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 '