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');
42 require
'../../main.inc.php';
43 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
45 $htmlname =
GETPOST(
'htmlname',
'aZ09');
46 $filter =
GETPOST(
'filter',
'alpha');
47 $outjson = (
GETPOST(
'outjson',
'int') ?
GETPOST(
'outjson',
'int') : 0);
48 $action =
GETPOST(
'action',
'aZ09');
50 $excludeids =
GETPOST(
'excludeids',
'intcomma');
60 if ($user->socid > 0) {
62 $socid = $user->socid;
75 if (!empty($action) && $action ==
'fetch' && !empty($id)) {
76 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
80 if ($object->id > 0) {
81 $outref = $object->ref;
82 $outname = $object->name;
84 $outtype = $object->type;
86 $outjson = array(
'ref' => $outref,
'name' => $outname,
'desc' => $outdesc,
'type' => $outtype);
89 echo json_encode($outjson);
91 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
93 $langs->load(
"companies");
97 if (empty($htmlname)) {
104 $match = preg_grep(
'/('.preg_quote($htmlname,
'/').
'[0-9]+)/', array_keys($_GET));
107 $id = (!empty($match[0]) ? $match[0] :
'');
110 $searchkey = (($id &&
GETPOST($id,
'alpha')) ?
GETPOST($id,
'alpha') : (($htmlname &&
GETPOST($htmlname,
'alpha')) ?
GETPOST($htmlname,
'alpha') :
''));
119 if (!empty($excludeids)) {
120 $excludeids = explode(
',', $excludeids);
122 $excludeids = array();
125 $arrayresult =
$form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0,
null, $searchkey, $outjson, 0,
'minwidth100',
'',
false, $excludeids, $showcode);
130 print json_encode($arrayresult);
Class to manage third parties objects (customers, suppliers, prospects...)
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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(!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.