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';
51require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
52require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
56$objectdesc =
GETPOST(
'objectdesc',
'alphanohtml', 0,
null,
null, 1);
57$htmlname =
GETPOST(
'htmlname',
'aZ09');
60$objectfield =
GETPOST(
'objectfield',
'alpha');
62if (empty($htmlname)) {
66if (!empty($objectfield)) {
70 $tmparray = explode(
':', $objectfield);
74 $objectforfieldstmp = fetchObjectByElement(0, strtolower($tmparray[0]));
77 if (preg_match(
'/^options_(.*)$/', $tmparray[1], $reg)) {
81 $extrafields->fetch_name_optionals_label($objectforfieldstmp->table_element);
83 if (!empty($extrafields->attributes[$objectforfieldstmp->table_element][
'type'][$key]) && $extrafields->attributes[$objectforfieldstmp->table_element][
'type'][$key] ==
'link') {
84 if (!empty($extrafields->attributes[$objectforfieldstmp->table_element][
'param'][$key][
'options'])) {
85 $tmpextrafields = array_keys($extrafields->attributes[$objectforfieldstmp->table_element][
'param'][$key][
'options']);
86 $objectdesc = $tmpextrafields[0];
91 $objectdesc = $objectforfieldstmp->fields[$tmparray[1]][
'type'];
92 $objectdesc = preg_replace(
'/^integer[^:]*:/',
'', $objectdesc);
103 $InfoFieldList = explode(
":", $objectdesc, 4);
104 $vartmp = (empty($InfoFieldList[3]) ?
'' : $InfoFieldList[3]);
106 if (preg_match(
'/^.*:(\w*)$/', $vartmp, $reg)) {
107 $InfoFieldList[4] = $reg[1];
109 $InfoFieldList[3] = preg_replace(
'/:\w*$/',
'', $vartmp);
111 $classname = $InfoFieldList[0];
113 if (!empty($InfoFieldList[1])) {
118 $filter = empty($InfoFieldList[3]) ?
'' : $InfoFieldList[3];
119 $sortfield = empty($InfoFieldList[4]) ?
'' : $InfoFieldList[4];
122 $objecttmp = fetchObjectByElement(0, strtolower($InfoFieldList[0]));
125 if (
getDolGlobalString(
"MAIN_ALLOW_UNSECURED_FALLBACK_FOR_SELECTOBJECT") && empty($objecttmp) && !empty($classpath) && preg_match(
'/\.class\.php$/', $classpath)) {
128 if ($classname && class_exists($classname)) {
129 $objecttmp =
new $classname(
$db);
135$sharedentities =
getEntity(strtolower($objecttmp->element));
137$filter = str_replace(
138 array(
'__ENTITY__',
'__SHARED_ENTITIES__',
'__USER_ID__',
'$ID$'),
139 array((
string)
$conf->entity, $sharedentities, (
string) $user->id, (
string) $id),
153$searchkey = ((
$id &&
GETPOST((
string) $id,
'alpha')) ?
GETPOST((
string)
$id,
'alpha') : (($htmlname &&
GETPOST($htmlname,
'alpha')) ?
GETPOST($htmlname,
'alpha') :
''));
156$allowModules = [
'bom'];
157if ($objecttmp !==
null && !empty($objecttmp->module) && !in_array($objecttmp->module, $allowModules)) {
158 restrictedArea($user, $objecttmp->module, $id, $objecttmp->table_element, $objecttmp->element);
160 restrictedArea($user, $objecttmp !==
null ? $objecttmp->element :
'unknownobject',
$id);
170top_httphead($outjson ?
'application/json' :
'text/html');
174$arrayresult = ($objecttmp ===
null) ? [] : $form->selectForFormsList($objecttmp, (
string) $htmlname, 0, 0, $searchkey,
'',
'',
'', 0, 1, 0,
'', $filter);
179 print json_encode($arrayresult);
$id
Support class for third parties, contacts, members, users or resources.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_sanitizePathName($str, $newstr='_', $unaccent=0, $allowdash=0)
Clean a string to use it as a path name.
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.
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.