FIX compatibility if javascript not actived
This commit is contained in:
parent
aafecb6d2b
commit
50fe00ecd8
@ -81,6 +81,27 @@ if ($action == 'updateMask') {
|
|||||||
dolibarr_del_const($db, 'TICKET_ADDON_PDF', $conf->entity);
|
dolibarr_del_const($db, 'TICKET_ADDON_PDF', $conf->entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||||
|
$code = $reg[1];
|
||||||
|
$value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1;
|
||||||
|
if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
|
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||||
|
$code = $reg[1];
|
||||||
|
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
} elseif ($action == 'setdoc') {
|
} elseif ($action == 'setdoc') {
|
||||||
// Set default model
|
// Set default model
|
||||||
if (dolibarr_set_const($db, "TICKET_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
|
if (dolibarr_set_const($db, "TICKET_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
|
||||||
@ -100,16 +121,25 @@ if ($action == 'updateMask') {
|
|||||||
|
|
||||||
dolibarr_set_const($db, "TICKET_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "TICKET_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||||
} elseif ($action == 'setvarworkflow') {
|
} elseif ($action == 'setvarworkflow') {
|
||||||
$param_auto_read = GETPOST('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'alpha');
|
// For compatibility when javascript is not enabled
|
||||||
$res = dolibarr_set_const($db, 'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', $param_auto_read, 'chaine', 0, '', $conf->entity);
|
if (empty($conf->use_javascript_ajax)) {
|
||||||
if (!($res > 0)) {
|
$param_auto_read = GETPOST('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'alpha');
|
||||||
$error++;
|
$res = dolibarr_set_const($db, 'TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', $param_auto_read, 'chaine', 0, '', $conf->entity);
|
||||||
}
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
$param_auto_assign = GETPOST('TICKET_AUTO_ASSIGN_USER_CREATE', 'alpha');
|
$param_auto_assign = GETPOST('TICKET_AUTO_ASSIGN_USER_CREATE', 'alpha');
|
||||||
$res = dolibarr_set_const($db, 'TICKET_AUTO_ASSIGN_USER_CREATE', $param_auto_assign, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_AUTO_ASSIGN_USER_CREATE', $param_auto_assign, 'chaine', 0, '', $conf->entity);
|
||||||
if (!($res > 0)) {
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$param_auto_notify_close = GETPOST('TICKET_NOTIFY_AT_CLOSING', 'alpha');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_NOTIFY_AT_CLOSING', $param_auto_notify_close, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
|
$param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
|
||||||
@ -137,12 +167,6 @@ if ($action == 'updateMask') {
|
|||||||
if (!($res > 0)) {
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$param_auto_notify_close = GETPOST('TICKET_NOTIFY_AT_CLOSING', 'alpha');
|
|
||||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFY_AT_CLOSING', $param_auto_notify_close, 'chaine', 0, '', $conf->entity);
|
|
||||||
if (!($res > 0)) {
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
} elseif ($action == 'setvar') {
|
} elseif ($action == 'setvar') {
|
||||||
include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
include_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
||||||
|
|
||||||
@ -191,7 +215,8 @@ if ($action == 'updateMask') {
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
// For compatibility when javascript is not enabled
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($conf->use_javascript_ajax)) {
|
||||||
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
||||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
|
||||||
if (!($res > 0)) {
|
if (!($res > 0)) {
|
||||||
|
|||||||
@ -150,24 +150,30 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') {
|
|||||||
$error++;
|
$error++;
|
||||||
$errors[] = $db->lasterror();
|
$errors[] = $db->lasterror();
|
||||||
}
|
}
|
||||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
|
||||||
$code = $reg[1];
|
|
||||||
$value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1;
|
|
||||||
|
|
||||||
if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
// For compatibility when javascript is not enabled
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($conf->use_javascript_ajax)) {
|
||||||
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
||||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
|
||||||
if (!($res > 0)) {
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
$errors[] = $db->lasterror();
|
$errors[] = $db->lasterror();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||||
|
$code = $reg[1];
|
||||||
|
$value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1;
|
||||||
|
if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && $conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
|
$param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||||
if (!($res > 0)) {
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
$errors[] = $db->lasterror();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
if ($code == 'TICKET_EMAIL_MUST_EXISTS') {
|
if ($code == 'TICKET_EMAIL_MUST_EXISTS') {
|
||||||
$res = dolibarr_del_const($db, 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST', $conf->entity);
|
$res = dolibarr_del_const($db, 'TICKET_CREATE_THIRD_PARTY_WITH_CONTACT_IF_NOT_EXIST', $conf->entity);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user