25if (!defined(
'NOTOKENRENEWAL')) {
26 define(
'NOTOKENRENEWAL', 1);
28if (!defined(
'NOREQUIREMENU')) {
29 define(
'NOREQUIREMENU',
'1');
31if (!defined(
'NOREQUIREHTML')) {
32 define(
'NOREQUIREHTML',
'1');
34if (!defined(
'NOREQUIREAJAX')) {
35 define(
'NOREQUIREAJAX',
'1');
37if (!defined(
'NOREQUIRESOC')) {
38 define(
'NOREQUIRESOC',
'1');
40if (!defined(
'NOCSRFCHECK')) {
41 define(
'NOCSRFCHECK',
'1');
43if (!defined(
'NOREQUIREHTML')) {
44 define(
'NOREQUIREHTML',
'1');
48include
'../../main.inc.php';
59$objectType =
GETPOST(
'objectType',
'aZ09');
60$objectId =
GETPOST(
'objectId',
'aZ09');
61$field =
GETPOST(
'field',
'aZ09');
62$value =
GETPOST(
'value',
'alpha');
66if (is_numeric($objectId)) {
67 $objectId = (int) $objectId;
69 $element_ref = $objectId;
75if (!$user->hasRight($module,
$object->element,
'write') && !$user->hasRight($module,
'write')) {
83dol_syslog(
"Call ajax core/ajax/updateextrafield.php");
88if (
$object->id > 0 && $field && isset($value)) {
90 $extrafields->fetch_name_optionals_label(
$object->table_element);
95 $object->array_options[
'options_'.$field] = $value;
96 if ($object instanceof
Societe) {
99 $result =
$object->update($user);
103 print json_encode([
'status' =>
'error',
'message' =>
'Error updating '. $field]);
105 print json_encode([
'status' =>
'success',
'message' => $field .
' updated successfully']);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage third parties objects (customers, suppliers, prospects...)
getElementProperties($elementType)
Get an array with properties of an element.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
fetchObjectByElement($element_id, $element_type, $element_ref='', $useCache=0, $maxCacheByType=10)
Fetch an object from its id and element_type Inclusion of classes is automatic.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.