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');
39 include
'../../main.inc.php';
42 $element =
GETPOST(
'element',
'alpha');
43 $htmlelement =
GETPOST(
'htmlelement',
'alpha');
44 $type =
GETPOST(
'type',
'alpha');
52 print
'<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER[
"PHP_SELF"]).
'?'.
dol_escape_htmltag($_SERVER[
"QUERY_STRING"]).
' -->'.
"\n";
54 if (!empty($id) && !empty($element) && !empty($htmlelement) && !empty($type)) {
55 $value =
GETPOST(
'value',
'alpha');
58 dol_syslog(
"AjaxSetExtraParameters id=".$id.
" element=".$element.
" htmlelement=".$htmlelement.
" type=".$type.
" value=".$value, LOG_DEBUG);
60 $classpath = $subelement = $element;
63 if ($element ==
'order' || $element ==
'commande') {
64 $classpath = $subelement =
'commande';
65 } elseif ($element ==
'propal') {
66 $classpath =
'comm/propal';
67 $subelement =
'propal';
68 } elseif ($element ==
'facture') {
69 $classpath =
'compta/facture';
70 $subelement =
'facture';
71 } elseif ($element ==
'contract') {
72 $classpath = $subelement =
'contrat';
73 } elseif ($element ==
'shipping') {
74 $classpath = $subelement =
'expedition';
75 } elseif ($element ==
'deplacement') {
76 $classpath =
'compta/deplacement';
77 $subelement =
'deplacement';
78 } elseif ($element ==
'order_supplier') {
80 $subelement =
'fournisseur.commande';
81 } elseif ($element ==
'invoice_supplier') {
83 $subelement =
'fournisseur.facture';
88 if ($element ==
'order_supplier') {
89 $classname =
'CommandeFournisseur';
90 } elseif ($element ==
'invoice_supplier') {
91 $classname =
'FactureFournisseur';
93 $classname = ucfirst($subelement);
96 $object =
new $classname($db);
99 $params[$htmlelement] = array($type => $value);
100 $object->extraparams = array_merge($object->extraparams, $params);
102 $result = $object->setExtraParameters();
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(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.