23 if (!defined(
'NOTOKENRENEWAL')) {
24 define(
'NOTOKENRENEWAL', 1);
26 if (!defined(
'NOREQUIREMENU')) {
27 define(
'NOREQUIREMENU',
'1');
29 if (!defined(
'NOREQUIREHTML')) {
30 define(
'NOREQUIREHTML',
'1');
32 if (!defined(
'NOREQUIREAJAX')) {
33 define(
'NOREQUIREAJAX',
'1');
35 if (!defined(
'NOREQUIRESOC')) {
36 define(
'NOREQUIRESOC',
'1');
40 require
'../../main.inc.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
43 $objectdesc =
GETPOST(
'objectdesc',
'alpha');
44 $htmlname =
GETPOST(
'htmlname',
'aZ09');
45 $outjson = (
GETPOST(
'outjson',
'int') ?
GETPOST(
'outjson',
'int') : 0);
47 $filter =
GETPOST(
'filter',
'alphanohtml');
49 if (empty($htmlname)) {
53 $InfoFieldList = explode(
":", $objectdesc);
54 $classname = $InfoFieldList[0];
55 $classpath = $InfoFieldList[1];
56 if (!empty($classpath)) {
58 if ($classname && class_exists($classname)) {
59 $objecttmp =
new $classname($db);
62 if (!is_object($objecttmp)) {
79 $searchkey = (($id &&
GETPOST($id,
'alpha')) ?
GETPOST($id,
'alpha') : (($htmlname &&
GETPOST($htmlname,
'alpha')) ?
GETPOST($htmlname,
'alpha') :
''));
96 top_httphead($outjson ?
'application/json' :
'text/html');
98 $arrayresult =
$form->selectForFormsList($objecttmp, $htmlname,
'', 0, $searchkey,
'',
'',
'', 0, 1, 0,
'', $filter);
103 print json_encode($arrayresult);
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
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.
httponly_accessforbidden($message=1, $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.