26if (!defined(
'NOTOKENRENEWAL')) {
27 define(
'NOTOKENRENEWAL', 1);
29if (!defined(
'NOREQUIREMENU')) {
30 define(
'NOREQUIREMENU',
'1');
32if (!defined(
'NOREQUIREHTML')) {
33 define(
'NOREQUIREHTML',
'1');
35if (!defined(
'NOREQUIREAJAX')) {
36 define(
'NOREQUIREAJAX',
'1');
38if (!defined(
'NOREQUIRESOC')) {
39 define(
'NOREQUIRESOC',
'1');
43require
'../../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
46$htmlname =
GETPOST(
'htmlname',
'aZ09');
47$filter =
GETPOST(
'filter',
'alpha');
48$outjson = (
GETPOST(
'outjson',
'int') ?
GETPOST(
'outjson',
'int') : 0);
49$action =
GETPOST(
'action',
'aZ09');
51$excludeids =
GETPOST(
'excludeids',
'intcomma');
61if ($user->socid > 0) {
63 $socid = $user->socid;
78if (!empty($action) && $action ==
'fetch' && !empty($id)) {
79 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
83 if ($object->id > 0) {
84 $outref = $object->ref;
85 $outname = $object->name;
87 $outtype = $object->type;
89 $outjson = array(
'ref' => $outref,
'name' => $outname,
'desc' => $outdesc,
'type' => $outtype);
92 echo json_encode($outjson);
94 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
96 if (empty($htmlname)) {
103 $match = preg_grep(
'/('.preg_quote($htmlname,
'/').
'[0-9]+)/', array_keys($_GET));
106 $id = (!empty($match[0]) ? $match[0] :
'');
109 $searchkey = (($id &&
GETPOST($id,
'alpha')) ?
GETPOST($id,
'alpha') : (($htmlname &&
GETPOST($htmlname,
'alpha')) ?
GETPOST($htmlname,
'alpha') :
''));
114 if (empty($form) || !is_object($form)) {
115 $form =
new Form($db);
118 if (!empty($excludeids)) {
119 $excludeids = explode(
',', $excludeids);
121 $excludeids = array();
124 $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0,
null, $searchkey, $outjson, 0,
'minwidth100',
'',
false, $excludeids, $showcode);
127 print json_encode($arrayresult);
Class to manage third parties objects (customers, suppliers, prospects...)
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
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(!empty(GETPOST('seteventmessages', 'alpha'))) 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.