forked from Wavyzz/dolibarr
New: add possibility to force label of buttons and hide the second
button for dialog info only
This commit is contained in:
@@ -729,6 +729,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
|
|||||||
modal: true,
|
modal: true,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
|
id : yesButton,
|
||||||
text : yesButton,
|
text : yesButton,
|
||||||
click : function() {
|
click : function() {
|
||||||
if (action == "set") {
|
if (action == "set") {
|
||||||
@@ -748,6 +749,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
id : noButton,
|
||||||
text : noButton,
|
text : noButton,
|
||||||
click : function() {
|
click : function() {
|
||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
@@ -755,6 +757,10 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
// For information dialog box only, hide the noButton
|
||||||
|
if (boxConfirm.info) {
|
||||||
|
$("#" + noButton).button().hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -375,6 +375,11 @@ function ajax_constantonoff($code, $input=array(), $entity=false)
|
|||||||
// Set constant
|
// Set constant
|
||||||
$("#set_" + code).click(function() {
|
$("#set_" + code).click(function() {
|
||||||
if (input.alert && input.alert.set) {
|
if (input.alert && input.alert.set) {
|
||||||
|
// Posibility to force label of buttons
|
||||||
|
if (input.alert.set.yesButton)
|
||||||
|
yesButton = input.alert.set.yesButton;
|
||||||
|
if (input.alert.set.noButton)
|
||||||
|
noButton = input.alert.set.noButton;
|
||||||
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton);
|
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton);
|
||||||
} else {
|
} else {
|
||||||
setConstant(url, code, input, entity);
|
setConstant(url, code, input, entity);
|
||||||
@@ -384,6 +389,11 @@ function ajax_constantonoff($code, $input=array(), $entity=false)
|
|||||||
// Del constant
|
// Del constant
|
||||||
$("#del_" + code).click(function() {
|
$("#del_" + code).click(function() {
|
||||||
if (input.alert && input.alert.del) {
|
if (input.alert && input.alert.del) {
|
||||||
|
// Posibility to force label of buttons
|
||||||
|
if (input.alert.del.yesButton)
|
||||||
|
yesButton = input.alert.del.yesButton;
|
||||||
|
if (input.alert.del.noButton)
|
||||||
|
noButton = input.alert.del.noButton;
|
||||||
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton);
|
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton);
|
||||||
} else {
|
} else {
|
||||||
delConstant(url, code, input, entity);
|
delConstant(url, code, input, entity);
|
||||||
|
|||||||
Reference in New Issue
Block a user