23 if (!defined(
'NOTOKENRENEWAL')) {
24 define(
'NOTOKENRENEWAL',
'1');
26 if (!defined(
'NOREQUIREMENU')) {
27 define(
'NOREQUIREMENU',
'1');
29 if (!defined(
'NOREQUIREHTML')) {
30 define(
'NOREQUIREHTML',
'1');
32 if (!defined(
'NOREQUIREAJAX')) {
33 define(
'NOREQUIREAJAX',
'1');
35 if (!defined(
'NOREQUIRESOC')) {
36 define(
'NOREQUIRESOC',
'1');
38 if (!defined(
'NOREQUIRETRAN')) {
39 define(
'NOREQUIRETRAN',
'1');
42 require
'../../main.inc.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/class/genericobject.class.php';
45 $action =
GETPOST(
'action',
'aZ09');
47 $value =
GETPOST(
'value',
'int');
48 $field =
GETPOST(
'field',
'alpha');
49 $element =
GETPOST(
'element',
'alpha');
54 $tablename = $element;
55 if ($tablename ==
'websitepage') {
56 $tablename =
'website_page';
59 $object->table_element = $tablename;
61 $object->fields[$field] = array(
'type' => $format,
'enabled' => 1);
64 if (!empty($user->socid)) {
65 $socid = $user->socid;
68 if (in_array($field, array(
'status'))) {
70 } elseif ($element ==
'product' && in_array($field, array(
'tosell',
'tobuy',
'tobatch'))) {
71 restrictedArea($user,
'produit|service', $id,
'product&product',
'',
'',
'rowid');
73 accessforbidden(
"Bad value for combination of parameters element/field.", 0, 0, 1);
84 print
'<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER[
"PHP_SELF"]).
'?'.
dol_escape_htmltag($_SERVER[
"QUERY_STRING"]).
' -->'.
"\n";
87 if (($action ==
'set') && !empty($id)) {
88 $triggerkey = strtoupper($element).
'_UPDATE';
90 if ($triggerkey ==
'SOCIETE_UPDATE') {
91 $triggerkey =
'COMPANY_MODIFY';
93 if ($triggerkey ==
'PRODUCT_UPDATE') {
94 $triggerkey =
'PRODUCT_MODIFY';
97 $object->setValueFrom($field, $value, $tablename, $id, $format,
'', $user, $triggerkey);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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...
if(!defined('NOREQUIREMENU')) 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 Calling this function terminate execution ...
restrictedArea($user, $features, $objectid=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.
Class of a generic business object.