25 if (!defined(
'NOTOKENRENEWAL')) {
26 define(
'NOTOKENRENEWAL', 1);
28 if (!defined(
'NOREQUIREMENU')) {
29 define(
'NOREQUIREMENU',
'1');
31 if (!defined(
'NOREQUIREHTML')) {
32 define(
'NOREQUIREHTML',
'1');
34 if (!defined(
'NOREQUIREAJAX')) {
35 define(
'NOREQUIREAJAX',
'1');
37 if (!defined(
'NOREQUIRESOC')) {
38 define(
'NOREQUIRESOC',
'1');
40 if (!defined(
'NOCSRFCHECK')) {
41 define(
'NOCSRFCHECK',
'1');
44 require
'../../main.inc.php';
45 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
47 $htmlname =
GETPOST(
'htmlname',
'aZ09');
48 $filter =
GETPOST(
'filter',
'alpha');
49 $outjson = (
GETPOST(
'outjson',
'int') ?
GETPOST(
'outjson',
'int') : 0);
50 $action =
GETPOST(
'action',
'aZ09');
52 $excludeids =
GETPOST(
'excludeids',
'intcomma');
62 if ($user->socid > 0) {
64 $socid = $user->socid;
77 if (!empty($action) && $action ==
'fetch' && !empty($id)) {
78 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
82 if ($object->id > 0) {
83 $outref = $object->ref;
84 $outname = $object->name;
86 $outtype = $object->type;
88 $outjson = array(
'ref' => $outref,
'name' => $outname,
'desc' => $outdesc,
'type' => $outtype);
91 echo json_encode($outjson);
93 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
95 $langs->load(
"companies");
99 if (empty($htmlname)) {
106 $match = preg_grep(
'/('.preg_quote($htmlname,
'/').
'[0-9]+)/', array_keys($_GET));
109 $id = (!empty($match[0]) ? $match[0] :
'');
112 $searchkey = (($id &&
GETPOST($id,
'alpha')) ?
GETPOST($id,
'alpha') : (($htmlname &&
GETPOST($htmlname,
'alpha')) ?
GETPOST($htmlname,
'alpha') :
''));
121 if (!empty($excludeids)) {
122 $excludeids = explode(
',', $excludeids);
124 $excludeids = array();
127 $arrayresult =
$form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson, 0,
'minwidth100',
'',
false, $excludeids, $showcode);
132 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($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
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...)
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
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.