24 if (!defined(
'NOTOKENRENEWAL')) {
25 define(
'NOTOKENRENEWAL',
'1');
27 if (!defined(
'NOREQUIREMENU')) {
28 define(
'NOREQUIREMENU',
'1');
30 if (!defined(
'NOREQUIREHTML')) {
31 define(
'NOREQUIREHTML',
'1');
33 if (!defined(
'NOREQUIREAJAX')) {
34 define(
'NOREQUIREAJAX',
'1');
36 if (!defined(
'NOREQUIRESOC')) {
37 define(
'NOREQUIRESOC',
'1');
39 if (!defined(
'NOREQUIRETRAN')) {
40 define(
'NOREQUIRETRAN',
'1');
44 require
'../../main.inc.php';
45 require_once DOL_DOCUMENT_ROOT.
'/core/class/genericobject.class.php';
47 $action =
GETPOST(
'action',
'aZ09');
49 $value =
GETPOST(
'value',
'int');
50 $field =
GETPOST(
'field',
'alpha');
51 $element =
GETPOST(
'element',
'alpha');
56 $tablename = $element;
57 if ($tablename ==
'websitepage') {
58 $tablename =
'website_page';
61 $object->table_element = $tablename;
63 $object->fields[$field] = array(
'type' => $format,
'enabled' => 1);
66 if (!empty($user->socid)) {
67 $socid = $user->socid;
73 if (in_array($field, array(
'status'))) {
75 } elseif ($element ==
'product' && in_array($field, array(
'tosell',
'tobuy',
'tobatch'))) {
76 restrictedArea($user,
'produit|service', $id,
'product&product',
'',
'',
'rowid');
88 print
'<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER[
"PHP_SELF"]).
'?'.
dol_escape_htmltag($_SERVER[
"QUERY_STRING"]).
' -->'.
"\n";
91 if (($action ==
'set') && !empty($id)) {
92 $triggerkey = strtoupper($element).
'_UPDATE';
94 if ($triggerkey ==
'SOCIETE_UPDATE') {
95 $triggerkey =
'COMPANY_MODIFY';
97 if ($triggerkey ==
'PRODUCT_UPDATE') {
98 $triggerkey =
'PRODUCT_MODIFY';
101 $object->setValueFrom($field, $value, $tablename, $id, $format,
'', $user, $triggerkey);
Class of a generic business object.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
httponly_accessforbidden($message=1, $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.