28if (!defined(
'NOTOKENRENEWAL')) {
29 define(
'NOTOKENRENEWAL', 1);
31if (!defined(
'NOREQUIREMENU')) {
32 define(
'NOREQUIREMENU',
'1');
34if (!defined(
'NOREQUIREHTML')) {
35 define(
'NOREQUIREHTML',
'1');
37if (!defined(
'NOREQUIREAJAX')) {
38 define(
'NOREQUIREAJAX',
'1');
40if (!defined(
'NOREQUIRESOC')) {
41 define(
'NOREQUIRESOC',
'1');
45require
'../../main.inc.php';
46require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
55$htmlname =
GETPOST(
'htmlname',
'aZ09');
56$filter =
GETPOST(
'filter',
'alpha');
58$action =
GETPOST(
'action',
'aZ09');
60$excludeids =
GETPOST(
'excludeids',
'intcomma');
70if ($user->socid > 0) {
72 $socid = $user->socid;
86if (!empty($action) && $action ==
'fetch' && !empty($id) && $user->hasRight(
'societe',
'lire')) {
87 require_once DOL_DOCUMENT_ROOT.
'/societe/class/societe.class.php';
97 $outjson = array(
'ref' => $outref,
'name' => $outname,
'desc' => $outdesc,
'type' => $outtype);
100 echo json_encode($outjson);
102 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
104 if (empty($htmlname)) {
111 $match = preg_grep(
'/('.preg_quote($htmlname,
'/').
'[0-9]+)/', array_keys($_GET));
114 $id = (!empty($match[0]) ? $match[0] :
'');
117 $searchkey = ((
$id &&
GETPOST($id,
'alpha')) ?
GETPOST($id,
'alpha') : (($htmlname &&
GETPOST($htmlname,
'alpha')) ?
GETPOST($htmlname,
'alpha') :
''));
122 if (empty($form) || !is_object($form)) {
123 $form =
new Form($db);
126 if (!empty($excludeids)) {
127 $excludeids = explode(
',', $excludeids);
129 $excludeids = array();
136 $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0,
null, $searchkey, $outjson, 0,
'minwidth100',
'',
false, $excludeids, $showcode);
139 print json_encode($arrayresult);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage third parties objects (customers, suppliers, prospects...)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.