Add user id into ajaxconst_onoff
This commit is contained in:
parent
c06655bc03
commit
f509c6a266
@ -524,8 +524,9 @@ function hideMessage(fieldId,message) {
|
||||
* @param int entity Entity
|
||||
* @param int strict Strict
|
||||
* @param int forcereload Force reload
|
||||
* @param int userid User id
|
||||
*/
|
||||
function setConstant(url, code, input, entity, strict, forcereload) {
|
||||
function setConstant(url, code, input, entity, strict, forcereload, userid) {
|
||||
$.get( url, {
|
||||
action: "set",
|
||||
name: code,
|
||||
@ -593,8 +594,9 @@ function setConstant(url, code, input, entity, strict, forcereload) {
|
||||
* @param int entity Entity
|
||||
* @param int strict Strict
|
||||
* @param int forcereload Force reload
|
||||
* @param int userid User id
|
||||
*/
|
||||
function delConstant(url, code, input, entity, strict, forcereload) {
|
||||
function delConstant(url, code, input, entity, strict, forcereload, userid) {
|
||||
$.get( url, {
|
||||
action: "del",
|
||||
name: code,
|
||||
@ -661,8 +663,9 @@ function delConstant(url, code, input, entity, strict, forcereload) {
|
||||
* @param int yesButton yesButton
|
||||
* @param int noButton noButton
|
||||
* @param int strict Strict
|
||||
* @param int userid User id
|
||||
*/
|
||||
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) {
|
||||
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict, userid) {
|
||||
var boxConfirm = box;
|
||||
$("#confirm_" + code)
|
||||
.attr("title", boxConfirm.title)
|
||||
@ -678,9 +681,9 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
|
||||
text : yesButton,
|
||||
click : function() {
|
||||
if (action == "set") {
|
||||
setConstant(url, code, input, entity, strict);
|
||||
setConstant(url, code, input, entity, strict, 0, userid);
|
||||
} else if (action == "del") {
|
||||
delConstant(url, code, input, entity, strict);
|
||||
delConstant(url, code, input, entity, strict, 0, userid);
|
||||
}
|
||||
// Close dialog
|
||||
$(this).dialog("close");
|
||||
|
||||
@ -485,7 +485,7 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
|
||||
*/
|
||||
function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $user;
|
||||
|
||||
$entity = ((isset($entity) && is_numeric($entity) && $entity >= 0) ? $entity : $conf->entity);
|
||||
|
||||
@ -504,6 +504,7 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
||||
var code = \''.$code.'\';
|
||||
var entity = \''.$entity.'\';
|
||||
var strict = \''.$strict.'\';
|
||||
var userid = \''.$user->id.'\';
|
||||
var yesButton = "'.dol_escape_js($langs->transnoentities("Yes")).'";
|
||||
var noButton = "'.dol_escape_js($langs->transnoentities("No")).'";
|
||||
|
||||
@ -512,9 +513,9 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
||||
if (input.alert && input.alert.set) {
|
||||
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, strict);
|
||||
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton, strict, userid);
|
||||
} else {
|
||||
setConstant(url, code, input, entity, 0, '.$forcereload.');
|
||||
setConstant(url, code, input, entity, 0, '.$forcereload.', userid);
|
||||
}
|
||||
});
|
||||
|
||||
@ -523,9 +524,9 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof
|
||||
if (input.alert && input.alert.del) {
|
||||
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, strict);
|
||||
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton, strict, userid);
|
||||
} else {
|
||||
delConstant(url, code, input, entity, 0, '.$forcereload.');
|
||||
delConstant(url, code, input, entity, 0, '.$forcereload.', userid);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -942,6 +942,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MAIN_OPTIMIZEFORTEXTBROWSER").'</td>';
|
||||
print '<td colspan="'.($colspan - 1).'">';
|
||||
//print ajax_constantonoff("MAIN_OPTIMIZEFORTEXTBROWSER", array(), null, 0, 0, 1, 0);
|
||||
if ($edit)
|
||||
{
|
||||
print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER, 1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user