mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
FIX avoid undefined url and missing token
This commit is contained in:
@@ -529,6 +529,7 @@ function hideMessage(fieldId,message) {
|
|||||||
* @param string token Token
|
* @param string token Token
|
||||||
*/
|
*/
|
||||||
function setConstant(url, code, input, entity, strict, forcereload, userid, token) {
|
function setConstant(url, code, input, entity, strict, forcereload, userid, token) {
|
||||||
|
var $url = url; /* avoid undefined url */
|
||||||
$.post( url, {
|
$.post( url, {
|
||||||
action: "set",
|
action: "set",
|
||||||
name: code,
|
name: code,
|
||||||
@@ -573,11 +574,12 @@ function setConstant(url, code, input, entity, strict, forcereload, userid, toke
|
|||||||
$.each(data, function(key, value) {
|
$.each(data, function(key, value) {
|
||||||
$("#set_" + key).hide();
|
$("#set_" + key).hide();
|
||||||
$("#del_" + key).show();
|
$("#del_" + key).show();
|
||||||
$.get( url, {
|
$.post( $url, {
|
||||||
action: "set",
|
action: "set",
|
||||||
name: key,
|
name: key,
|
||||||
value: value,
|
value: value,
|
||||||
entity: entity
|
entity: entity,
|
||||||
|
token: token
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -602,6 +604,7 @@ function setConstant(url, code, input, entity, strict, forcereload, userid, toke
|
|||||||
* @param string token Token
|
* @param string token Token
|
||||||
*/
|
*/
|
||||||
function delConstant(url, code, input, entity, strict, forcereload, userid, token) {
|
function delConstant(url, code, input, entity, strict, forcereload, userid, token) {
|
||||||
|
var $url = url; /* avoid undefined url */
|
||||||
$.post( url, {
|
$.post( url, {
|
||||||
action: "del",
|
action: "del",
|
||||||
name: code,
|
name: code,
|
||||||
@@ -643,10 +646,11 @@ function delConstant(url, code, input, entity, strict, forcereload, userid, toke
|
|||||||
$.each(data, function(key, value) {
|
$.each(data, function(key, value) {
|
||||||
$("#del_" + value).hide();
|
$("#del_" + value).hide();
|
||||||
$("#set_" + value).show();
|
$("#set_" + value).show();
|
||||||
$.get( url, {
|
$.get( $url, {
|
||||||
action: "del",
|
action: "del",
|
||||||
name: value,
|
name: value,
|
||||||
entity: entity
|
entity: entity,
|
||||||
|
token: token
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user