25 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL', 1);
26 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
27 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
28 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
29 if (!defined(
'NOREQUIRESOC')) define(
'NOREQUIRESOC',
'1');
30 if (!defined(
'NOCSRFCHECK')) define(
'NOCSRFCHECK',
'1');
32 require
'../../main.inc.php';
34 $htmlname =
GETPOST(
'htmlname',
'alpha');
35 $filter =
GETPOST(
'filter',
'alpha');
36 $outjson = (
GETPOST(
'outjson',
'int') ?
GETPOST(
'outjson',
'int') : 0);
37 $action =
GETPOST(
'action',
'aZ09');
39 $showtype =
GETPOST(
'showtype',
'int');
51 if (!empty($action) && $action ==
'fetch' && !empty($id))
53 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
58 $ret = $object->fetch($id);
61 $outref = $object->ref;
62 $outname = $object->name;
64 $outtype = $object->type;
66 $outjson = array(
'ref' => $outref,
'name' => $outname,
'desc' => $outdesc,
'type' => $outtype);
69 echo json_encode($outjson);
71 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
73 $langs->load(
"companies");
77 if (empty($htmlname))
return;
79 $match = preg_grep(
'/('.$htmlname.
'[0-9]+)/', array_keys($_GET));
81 $id = (!empty($match[0]) ? $match[0] :
'');
84 $searchkey = (($id &&
GETPOST($id,
'alpha')) ?
GETPOST($id,
'alpha') : (($htmlname &&
GETPOST($htmlname,
'alpha')) ?
GETPOST($htmlname,
'alpha') :
''));
86 if (!$searchkey)
return;
88 if (!is_object($form)) $form =
new Form($db);
89 $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson);
93 if ($outjson)
print json_encode($arrayresult);
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.
Class to manage third parties objects (customers, suppliers, prospects...)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
print
Draft customers invoices.