28require_once
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/exports/class/export.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/modules/export/modules_export.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
36$langs->loadlangs(array(
'admin',
'exports',
'other',
'users',
'companies',
'projects',
'suppliers',
'products',
'bank',
'bills'));
45 'invoice_line' =>
'bill',
47 'order_line' =>
'order',
49 'propal_line' =>
'propal',
50 'intervention' =>
'intervention',
51 'inter_line' =>
'intervention',
53 'member_type' =>
'group',
54 'subscription' =>
'payment',
55 'payment' =>
'payment',
57 'tax_type' =>
'generic',
59 'account' =>
'account',
60 'product' =>
'product',
61 'virtualproduct' =>
'product',
62 'subproduct' =>
'product',
63 'product_supplier_ref' =>
'product',
65 'warehouse' =>
'stock',
67 'stockbatch' =>
'stock',
68 'category' =>
'category',
69 'securityevent' =>
'generic',
70 'shipment' =>
'sending',
71 'shipment_line' =>
'sending',
72 'reception' =>
'sending',
73 'reception_line' =>
'sending',
74 'expensereport' =>
'trip',
75 'expensereport_line' =>
'trip',
76 'holiday' =>
'holiday',
77 'contract_line' =>
'contract',
78 'translation' =>
'generic',
81 'conferenceorboothattendee' =>
'contact',
82 'inventory_line' =>
'inventory',
88 'company' =>
'Company',
89 'contact' =>
'Contact',
91 'invoice_line' =>
'InvoiceLine',
93 'order_line' =>
'OrderLine',
94 'propal' =>
'Proposal',
95 'propal_line' =>
'ProposalLine',
96 'intervention' =>
'Intervention',
97 'inter_line' =>
'InterLine',
99 'member_type' =>
'MemberType',
100 'subscription' =>
'Subscription',
101 'tax' =>
'SocialContribution',
102 'tax_type' =>
'DictionarySocialContributions',
103 'account' =>
'BankTransactions',
104 'payment' =>
'Payment',
105 'product' =>
'Product',
106 'virtualproduct' =>
'AssociatedProducts',
107 'subproduct' =>
'SubProduct',
108 'product_supplier_ref' =>
'SupplierPrices',
109 'service' =>
'Service',
111 'movement' =>
'StockMovement',
113 'stockbatch' =>
'StockDetailPerBatch',
114 'warehouse' =>
'Warehouse',
115 'category' =>
'Category',
117 'trip' =>
'TripsAndExpenses',
118 'securityevent' =>
'SecurityEvent',
119 'shipment' =>
'Shipments',
120 'shipment_line' =>
'ShipmentLine',
121 'project' =>
'Projects',
122 'projecttask' =>
'Tasks',
123 'resource' =>
'Resource',
124 'task_time' =>
'TaskTimeSpent',
126 'expensereport' =>
'ExpenseReport',
127 'expensereport_line' =>
'ExpenseReportLine',
128 'holiday' =>
'TitreRequestCP',
129 'contract' =>
'Contract',
130 'contract_line' =>
'ContractLine',
131 'translation' =>
'Translation',
133 'bomline' =>
'BOMLine',
134 'mrp' =>
'ManufacturingOrder',
135 'conferenceorboothattendee' =>
'Attendee',
136 'inventory' =>
'Inventory',
137 'inventory_line' =>
'InventoryLine'
140$array_selected = isset($_SESSION[
"export_selected_fields"]) ? $_SESSION[
"export_selected_fields"] : array();
141$array_filtervalue = isset($_SESSION[
"export_filtered_fields"]) ? $_SESSION[
"export_filtered_fields"] : array();
142$datatoexport =
GETPOST(
"datatoexport",
"aZ09");
143$action =
GETPOST(
'action',
'aZ09');
144$confirm =
GETPOST(
'confirm',
'alpha');
146$export_name =
GETPOST(
"export_name",
"alphanohtml");
147$hexa =
GETPOST(
"hexa",
"alpha");
149$field =
GETPOST(
"field",
"alpha");
151$objexport =
new Export($db);
152$objexport->load_arrays($user, $datatoexport);
155$form =
new Form($db);
158$sqlusedforexport =
'';
161$upload_dir = $conf->export->dir_temp.
'/'.$user->id;
173if ($action ==
'selectfield') {
174 $fieldsarray = $objexport->array_export_fields[0];
175 $fieldsentitiesarray = $objexport->array_export_entities[0];
176 $fieldsdependenciesarray = $objexport->array_export_dependencies[0];
178 if ($field ==
'all') {
179 foreach ($fieldsarray as $key => $val) {
180 if (!empty($array_selected[$key])) {
183 $array_selected[$key] = count($array_selected) + 1;
185 $_SESSION[
"export_selected_fields"] = $array_selected;
190 $array_selected[$field] = count($array_selected) + 1;
195 $listofdependencies = array();
196 if (!empty($fieldsentitiesarray[$field]) && !empty($fieldsdependenciesarray[$fieldsentitiesarray[$field]])) {
198 $tmp = $fieldsdependenciesarray[$fieldsentitiesarray[$field]];
199 if (is_array($tmp)) {
200 $listofdependencies = $tmp;
202 $listofdependencies = array($tmp);
204 } elseif (!empty($field) && !empty($fieldsdependenciesarray[$field])) {
206 $tmp = $fieldsdependenciesarray[$field];
207 if (is_array($tmp)) {
208 $listofdependencies = $tmp;
210 $listofdependencies = array($tmp);
214 if (count($listofdependencies)) {
215 foreach ($listofdependencies as $fieldid) {
216 if (empty($array_selected[$fieldid])) {
217 $array_selected[$fieldid] = count($array_selected) + 1;
218 $warnings[] = $langs->trans(
"ExportFieldAutomaticallyAdded", $langs->transnoentitiesnoconv($fieldsarray[$fieldid]));
223 $_SESSION[
"export_selected_fields"] = $array_selected;
228if ($action ==
'unselectfield') {
229 if (
GETPOST(
"field") ==
'all') {
230 $array_selected = array();
231 $_SESSION[
"export_selected_fields"] = $array_selected;
233 unset($array_selected[
GETPOST(
"field")]);
235 asort($array_selected);
237 $array_selected_save = $array_selected;
238 foreach ($array_selected as $code => $value) {
240 $array_selected[$code] = $i;
243 $_SESSION[
"export_selected_fields"] = $array_selected;
247if ($action ==
'downfield' || $action ==
'upfield') {
248 $pos = $array_selected[
GETPOST(
"field")];
249 if ($action ==
'downfield') {
252 if ($action ==
'upfield') {
257 foreach ($array_selected as $code => $value) {
258 if ($value == $newpos) {
265 $array_selected[
GETPOST(
"field")] = $newpos;
266 $array_selected[$newcode] = $pos;
267 $_SESSION[
"export_selected_fields"] = $array_selected;
271if ($step == 1 || $action ==
'cleanselect') {
272 $_SESSION[
"export_selected_fields"] = array();
273 $_SESSION[
"export_filtered_fields"] = array();
274 $array_selected = array();
275 $array_filtervalue = array();
278if ($action ==
'builddoc') {
280 if (empty($objexport->array_export_perms[0])) {
284 $separator =
GETPOST(
'delimiter',
'alpha');
285 $max_execution_time_for_importexport =
getDolGlobalInt(
'EXPORT_MAX_EXECUTION_TIME', 300);
286 $max_time = @ini_get(
"max_execution_time");
287 if ($max_time && $max_time < $max_execution_time_for_importexport) {
288 dol_syslog(
"max_execution_time=".$max_time.
" is lower than max_execution_time_for_importexport=".$max_execution_time_for_importexport.
". We try to increase it dynamically.");
289 @ini_set(
"max_execution_time", $max_execution_time_for_importexport);
293 $result = $objexport->build_file($user,
GETPOST(
'model',
'alpha'), $datatoexport, $array_selected, $array_filtervalue,
'', $separator);
296 $sqlusedforexport = $objexport->sqlusedforexport;
299 $sqlusedforexport = $objexport->sqlusedforexport;
304if ($step == 5 && $action ==
'confirm_deletefile' && $confirm ==
'yes') {
306 if (empty($objexport->array_export_perms[0])) {
310 $file = $upload_dir.
"/".
GETPOST(
'file');
318 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport);
322if ($action ==
'deleteprof') {
324 if (empty($objexport->array_export_perms[0])) {
330 $result = $objexport->delete($user);
335if ($action ==
'add_export_model') {
337 if (empty($objexport->array_export_perms[0])) {
342 asort($array_selected);
346 foreach ($array_selected as $key => $val) {
353 $hexafiltervalue =
'';
354 if (!empty($array_filtervalue) && is_array($array_filtervalue)) {
355 foreach ($array_filtervalue as $key => $val) {
356 if ($hexafiltervalue) {
357 $hexafiltervalue .=
',';
359 $hexafiltervalue .= $key.
'='.$val;
363 $objexport->model_name = $export_name;
364 $objexport->datatoexport = $datatoexport;
365 $objexport->hexa = $hexa;
366 $objexport->hexafiltervalue = $hexafiltervalue;
367 $objexport->fk_user = (
GETPOST(
'visibility',
'aZ09') ==
'all' ? 0 : $user->id);
369 $result = $objexport->create($user);
371 setEventMessages($langs->trans(
"ExportModelSaved", $objexport->model_name),
null,
'mesgs');
373 $langs->load(
"errors");
374 if ($objexport->errno ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
375 setEventMessages($langs->trans(
"ErrorExportDuplicateProfil"),
null,
'errors');
381 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ExportModelName")),
null,
'errors');
386if ($step == 2 && $action ==
'select_model') {
387 $_SESSION[
"export_selected_fields"] = array();
388 $_SESSION[
"export_filtered_fields"] = array();
390 $array_selected = array();
391 $array_filtervalue = array();
393 $result = $objexport->fetch($exportmodelid);
395 $fieldsarray = preg_split(
"/,(?! [^(]*\))/", $objexport->hexa);
397 foreach ($fieldsarray as $val) {
398 $array_selected[$val] = $i;
401 $_SESSION[
"export_selected_fields"] = $array_selected;
403 $fieldsarrayvalue = explode(
',', $objexport->hexafiltervalue);
405 foreach ($fieldsarrayvalue as $val) {
406 $tmp = explode(
'=', $val);
407 $array_filtervalue[$tmp[0]] = $tmp[1];
410 $_SESSION[
"export_filtered_fields"] = $array_filtervalue;
415if ($step == 4 && $action ==
'submitFormField') {
417 if (empty($objexport->array_export_perms[0])) {
422 if (is_array($objexport->array_export_TypeFields[0])) {
423 $_SESSION[
"export_filtered_fields"] = array();
424 foreach ($objexport->array_export_TypeFields[0] as $code => $type) {
425 $newcode = (string) preg_replace(
'/\./',
'_', $code);
427 $check =
'alphanohtml';
428 $filterqualified = 1;
429 if (!GETPOSTISSET($newcode) ||
GETPOST($newcode, $check) ==
'') {
430 $filterqualified = 0;
431 } elseif (preg_match(
'/^List/', $type) && (is_numeric(
GETPOST($newcode, $check)) &&
GETPOST($newcode, $check) <= 0)) {
432 $filterqualified = 0;
434 if ($filterqualified) {
435 $objexport->array_export_FilterValue[0][$code] =
GETPOST($newcode, $check);
438 $array_filtervalue = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] :
'');
439 $_SESSION[
"export_filtered_fields"] = $array_filtervalue;
448if ($step == 1 || !$datatoexport) {
449 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step1');
453 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
454 $head[$h][1] = $langs->trans(
"Step").
" 1";
460 print
'<div class="opacitymedium">'.$langs->trans(
"SelectExportDataSet").
'</div><br>';
463 print
'<div class="div-table-responsive-no-min">';
464 print
'<table class="noborder centpercent">';
465 print
'<tr class="liste_titre">';
466 print
'<td>'.$langs->trans(
"Module").
'</td>';
467 print
'<td>'.$langs->trans(
"ExportableDatas").
'</td>';
468 print
'<td> </td>';
471 if (count($objexport->array_export_module)) {
472 asort($objexport->array_export_code_for_sort);
475 foreach ($objexport->array_export_code_for_sort as $key => $value) {
476 print
'<tr class="oddeven"><td nospan="nospan">';
478 print $objexport->array_export_module[$key]->getName();
480 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[$key]);
481 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
482 $label = $objexport->array_export_label[$key];
484 print
img_object($objexport->array_export_module[$key]->getName(), $entityicon).
' ';
486 print
'</td><td class="right">';
487 if ($objexport->array_export_perms[$key]) {
488 print
'<a href="'.DOL_URL_ROOT.
'/exports/export.php?step=2&module_position='.$objexport->array_export_module[$key]->module_position.
'&datatoexport='.$objexport->array_export_code[$key].
'">'.
img_picto($langs->trans(
"NewExport"),
'next',
'class="fa-15"').
'</a>';
490 print
'<span class="opacitymedium">'.$langs->trans(
"NotEnoughPermissions").
'</span>';
495 print
'<tr><td class="oddeven" colspan="3">'.$langs->trans(
"NoExportableData").
'</td></tr>';
503if ($step == 2 && $datatoexport) {
505 if (empty($objexport->array_export_perms[0])) {
509 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step2');
513 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
514 $head[$h][1] = $langs->trans(
"Step").
" 1";
517 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
518 $head[$h][1] = $langs->trans(
"Step").
" 2";
524 print
'<div class="fichecenter">';
525 print
'<div class="underbanner clearboth"></div>';
527 print
'<table class="border tableforfield centpercent">';
530 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
532 print $objexport->array_export_module[0]->getName();
536 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
538 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
539 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
540 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
541 print $objexport->array_export_label[0];
552 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
553 print
'<input type="hidden" name="token" value="'.newToken().
'">';
554 print
'<input type="hidden" name="action" value="select_model">';
555 print
'<input type="hidden" name="step" value="2">';
556 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
557 print
'<div class="valignmiddle marginbottomonly">';
558 print
'<span class="opacitymedium">'.$langs->trans(
"SelectExportFields").
'</span> ';
559 $htmlother->select_export_model($exportmodelid,
'exportmodelid', $datatoexport, 1, $user->id);
561 print
'<input type="submit" class="button small" value="'.$langs->trans(
"Select").
'">';
566 print
'<div class="div-table-responsive-no-min">';
567 print
'<table class="noborder centpercent">';
568 print
'<tr class="liste_titre">';
569 print
'<td>'.$langs->trans(
"Object").
'</td>';
570 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
571 print
'<td width="100" class="center">';
574 if (!$user->hasRight(
'export',
'creer')) {
575 $morecss =
' disabled';
576 $moretitle = $langs->trans(
"NotAllowed");
578 print
'<a class="liste_titre commonlink'.$morecss;
579 print
'" title="'.$langs->trans(
"All").($moretitle ?
' - '.$moretitle :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
'?step=2&datatoexport='.urlencode($datatoexport).
'&action=selectfield&field=all&token='.
newToken().
'">'.$langs->trans(
"All").
"</a>";
581 print
'<a class="liste_titre commonlink'.$morecss;
582 print
'" title="'.$langs->trans(
"None").($moretitle ?
' - '.$moretitle :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
'?step=2&datatoexport='.urlencode($datatoexport).
'&action=unselectfield&field=all&token='.
newToken().
'">'.$langs->trans(
"None").
"</a>";
584 print
'<td width="44%">'.$langs->trans(
"ExportedFields").
'</td>';
588 $fieldsarray = $objexport->array_export_fields[0];
590 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
602 foreach ($fieldsarray as $code => $label) {
603 print
'<tr class="oddeven">';
607 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
608 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
609 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
611 print
'<td class="nowrap">';
615 $tmparray = explode(
':', $entityicon);
616 if (count($tmparray) >= 2) {
617 $entityicon = $tmparray[0];
618 $entitylang = $tmparray[1];
620 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
623 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
624 $tmplabelarray = explode(
':', $label);
625 if (!empty($tmplabelarray[1])) {
626 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
628 $text .= $langs->trans($label);
630 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
633 $htmltext =
'<b>'.$langs->trans(
"Name").
":</b> ".$text.
'<br>';
634 if (!empty($objexport->array_export_special[0][$code])) {
635 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
637 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
639 if (!empty($objexport->array_export_examplevalues[0][$code])) {
640 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
642 if (!empty($objexport->array_export_TypeFields[0][$code])) {
643 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
645 if (!empty($objexport->array_export_help[0][$code])) {
646 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
649 if (isset($array_selected[$code]) && $array_selected[$code]) {
651 print
'<td> </td>';
652 print
'<td class="center"><a class="reposition'.$morecss.
'" href="'.$_SERVER[
"PHP_SELF"].
'?step=2&datatoexport='.urlencode($datatoexport).
'&action=unselectfield&token='.
newToken().
'&field='.urlencode($code).
'">'.
img_left($moretitle, 0,
'style="max-width: 20px"').
'</a></td>';
655 print $form->textwithpicto($text, $htmltext);
662 print $form->textwithpicto($text, $htmltext);
665 print
'<td class="center"><a class="reposition'.$morecss.
'" href="'.$_SERVER[
"PHP_SELF"].
'?step=2&datatoexport='.urlencode($datatoexport).
'&action=selectfield&token='.
newToken().
'&field='.urlencode($code).
'">'.
img_right($moretitle, 0,
'style="max-width: 20px"').
'</a></td>';
666 print
'<td> </td>';
678 print
'<div class="tabsAction tabsActionNoBottom">';
680 if (count($array_selected)) {
682 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
683 print
'<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
685 print
'<a class="butAction" href="export.php?step=4&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
688 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"SelectAtLeastOneField")).
'">'.$langs->trans(
"NextStep").
'</a>';
694if ($step == 3 && $datatoexport) {
695 if (count($array_selected) < 1) {
697 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
702 if (empty($objexport->array_export_perms[0])) {
706 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step3');
710 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
711 $head[$h][1] = $langs->trans(
"Step").
" 1";
714 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
715 $head[$h][1] = $langs->trans(
"Step").
" 2";
718 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
719 $head[$h][1] = $langs->trans(
"Step").
" 3";
725 print
'<div class="fichecenter">';
726 print
'<div class="underbanner clearboth"></div>';
727 print
'<table width="100%" class="border tableforfield">';
730 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
733 print $objexport->array_export_module[0]->getName();
737 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
739 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
740 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
741 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
742 print $objexport->array_export_label[0];
746 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
748 foreach ($array_selected as $code => $value) {
749 if (isset($objexport->array_export_fields[0][$code])) {
750 $list .= (!empty($list) ?
', ' :
'');
752 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
753 if (!empty($tmplabelarray[1])) {
754 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
756 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
760 print
'<td>'.$list.
'</td></tr>';
768 print
'<span class="opacitymedium">'.$langs->trans(
"SelectFilterFields").
'</span><br><br>';
772 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?step=4&action=submitFormField&datatoexport='.$datatoexport.
'" name="FilterField" method="post">';
773 print
'<input type="hidden" name="token" value="'.newToken().
'">';
775 print
'<div class="div-table-responsive-no-min">';
777 print
'<table class="noborder centpercent">';
778 print
'<tr class="liste_titre">';
779 print
'<td>'.$langs->trans(
"Entities").
'</td>';
782 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
783 print
'<td width="25%">'.$langs->trans(
"FilteredFieldsValues").
'</td>';
787 $fieldsarray = $objexport->array_export_fields[0];
789 $Typefieldsarray = $objexport->array_export_TypeFields[0];
791 $ValueFiltersarray = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] :
'');
793 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
797 foreach ($fieldsarray as $code => $label) {
798 print
'<tr class="oddeven">';
801 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
802 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
803 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
805 print
'<td class="nowrap">';
807 $tmparray = explode(
':', $entityicon);
808 if (count($tmparray) >= 2) {
809 $entityicon = $tmparray[0];
810 $entitylang = $tmparray[1];
812 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
816 $labelName = (!empty($fieldsarray[$code]) ? $fieldsarray[$code] :
'');
817 $ValueFilter = (!empty($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
819 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
820 $tmplabelarray = explode(
':', $label);
821 if (!empty($tmplabelarray[1])) {
822 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
824 $text .= $langs->trans($label);
826 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
829 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
830 if (!empty($objexport->array_export_special[0][$code])) {
831 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
833 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
835 if (!empty($objexport->array_export_examplevalues[0][$code])) {
836 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
838 if (!empty($objexport->array_export_TypeFields[0][$code])) {
839 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
841 if (!empty($objexport->array_export_help[0][$code])) {
842 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
846 print $form->textwithpicto($text, $htmltext);
851 if (!empty($Typefieldsarray[$code])) {
852 $szInfoFiltre = $objexport->genDocFilter($Typefieldsarray[$code]);
854 $tmp = $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
855 print $form->textwithpicto($tmp, $szInfoFiltre);
857 print $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
873 print
'<div class="tabsAction tabsActionNoBottom">';
875 print
'<a class="butAction" href="javascript:FilterField.submit();">'.$langs->trans(
"NextStep").
'</a>';
879if ($step == 4 && $datatoexport) {
880 if (count($array_selected) < 1) {
882 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
887 if (empty($objexport->array_export_perms[0])) {
891 asort($array_selected);
893 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step4');
898 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
899 $head[$h][1] = $langs->trans(
"Step").
" 1";
902 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
903 $head[$h][1] = $langs->trans(
"Step").
" 2";
907 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
908 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
909 $head[$h][1] = $langs->trans(
"Step").
" 3";
914 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
915 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
921 print
'<div class="fichecenter">';
922 print
'<div class="underbanner clearboth"></div>';
923 print
'<table width="100%" class="border tableforfield">';
926 print
'<tr><td class="titlefield tableforfield">'.$langs->trans(
"Module").
'</td>';
929 print $objexport->array_export_module[0]->getName();
933 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
935 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
936 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
937 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
938 print $objexport->array_export_label[0];
942 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
944 foreach ($array_selected as $code => $value) {
945 if (isset($objexport->array_export_fields[0][$code])) {
946 $list .= (!empty($list) ?
', ' :
'');
948 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
949 if (!empty($tmplabelarray[1])) {
950 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
952 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
956 print
'<td>'.$list.
'</td>';
960 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
961 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
963 if (!empty($array_filtervalue)) {
964 foreach ($array_filtervalue as $code => $value) {
965 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
971 if (isset($objexport->array_export_fields[0][$code])) {
972 $list .= ($list ?
', ' :
'');
973 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
974 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
976 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
981 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
991 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
993 print
'<div class="marginbottomonly"><span class="opacitymedium">'.$langs->trans(
"ChooseFieldsOrdersAndTitle").
'</span></div>';
995 print
'<div class="div-table-responsive-no-min">';
996 print
'<table class="noborder centpercent">';
997 print
'<tr class="liste_titre">';
998 print
'<td>'.$langs->trans(
"Entities").
'</td>';
999 print
'<td>'.$langs->trans(
"ExportedFields").
'</td>';
1000 print
'<td class="right" colspan="2">'.$langs->trans(
"Position").
'</td>';
1005 foreach ($array_selected as $code => $value) {
1006 if (!isset($objexport->array_export_fields[0][$code])) {
1010 print
'<tr class="oddeven">';
1012 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
1013 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1014 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
1016 print
'<td class="nowrap">';
1018 $tmparray = explode(
':', $entityicon);
1019 if (count($tmparray) >= 2) {
1020 $entityicon = $tmparray[0];
1021 $entitylang = $tmparray[1];
1023 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
1026 $labelName = $objexport->array_export_fields[0][$code];
1028 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
1029 $tmplabelarray = explode(
':', $labelName);
1030 if (!empty($tmplabelarray[1])) {
1031 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1033 $text .= $langs->trans($labelName);
1035 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
1038 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
1039 if (!empty($objexport->array_export_special[0][$code])) {
1040 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
1042 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
1044 if (!empty($objexport->array_export_examplevalues[0][$code])) {
1045 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
1047 if (!empty($objexport->array_export_TypeFields[0][$code])) {
1048 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
1050 if (!empty($objexport->array_export_help[0][$code])) {
1051 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
1055 print $form->textwithpicto($text, $htmltext);
1059 print
'<td class="right" width="100">';
1061 print
'</td><td class="center nowraponall" width="40">';
1062 if ($value < count($array_selected)) {
1063 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=downfield&field='.$code.
'">'.
img_down().
'</a>';
1066 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=upfield&field='.$code.
'">'.
img_up().
'</a>';
1084 print
'<div class="tabsAction">';
1086 if (count($array_selected)) {
1087 print
'<a class="butAction" href="export.php?step='.($step + 1).
'&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
1094 if (count($array_selected)) {
1097 print
'<div class="marginbottomonly">';
1098 print
'<span class="opacitymedium">'.$langs->trans(
"SaveExportModel").
'</span>';
1101 print
'<form class="nocellnopadd" action="export.php" method="post">';
1102 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1103 print
'<input type="hidden" name="action" value="add_export_model">';
1104 print
'<input type="hidden" name="step" value="'.$step.
'">';
1105 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
1106 print
'<input type="hidden" name="hexa" value="'.$hexa.
'">';
1108 print
'<div class="div-table-responsive-no-min">';
1109 print
'<table class="noborder centpercent">';
1110 print
'<tr class="liste_titre">';
1111 print
'<td>'.$langs->trans(
"ExportModelName").
'</td>';
1112 print
'<td>'.$langs->trans(
"Visibility").
'</td>';
1116 print
'<tr class="oddeven">';
1117 print
'<td><input name="export_name" value=""></td>';
1119 $arrayvisibility = array(
'private' => $langs->trans(
"Private"),
'all' => $langs->trans(
"Everybody"));
1120 print $form->selectarray(
'visibility', $arrayvisibility,
'private');
1122 print
'<td class="right">';
1123 print
'<input type="submit" class="button reposition button-save small" value="'.$langs->trans(
"Save").
'">';
1126 $tmpuser =
new User($db);
1129 $sql =
"SELECT rowid, label, fk_user, entity";
1130 $sql .=
" FROM ".MAIN_DB_PREFIX.
"export_model";
1131 $sql .=
" WHERE type = '".$db->escape($datatoexport).
"'";
1133 $sql .=
" AND fk_user IN (0, ".((int) $user->id).
")";
1135 $sql .=
" ORDER BY rowid";
1136 $resql = $db->query($sql);
1138 $num = $db->num_rows($resql);
1141 $obj = $db->fetch_object($resql);
1143 print
'<tr class="oddeven"><td>';
1147 if (empty($obj->fk_user)) {
1148 print $langs->trans(
"Everybody");
1150 $tmpuser->fetch($obj->fk_user);
1151 print $tmpuser->getNomUrl(1);
1154 print
'<td class="right">';
1155 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=deleteprof&token='.
newToken().
'&id='.$obj->rowid.
'">';
1172if ($step == 5 && $datatoexport) {
1173 if (count($array_selected) < 1) {
1175 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
1180 if (empty($objexport->array_export_perms[0])) {
1184 asort($array_selected);
1186 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step5');
1191 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
1192 $head[$h][1] = $langs->trans(
"Step").
" 1";
1195 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
1196 $head[$h][1] = $langs->trans(
"Step").
" 2";
1200 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1201 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
1202 $head[$h][1] = $langs->trans(
"Step").
" 3";
1207 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
1208 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
1211 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=5&datatoexport='.$datatoexport;
1212 $head[$h][1] = $langs->trans(
"Step").
" ".(4 + $stepoffset);
1221 if ($action ==
'remove_file') {
1222 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?step=5&datatoexport='.$datatoexport.
'&file='.urlencode(
GETPOST(
"file")), $langs->trans(
'DeleteFile'), $langs->trans(
'ConfirmDeleteFile'),
'confirm_deletefile',
'', 0, 1);
1225 print
'<div class="fichecenter">';
1226 print
'<div class="underbanner clearboth"></div>';
1228 print
'<table class="border tableforfield centpercent">';
1231 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
1234 print $objexport->array_export_module[0]->getName();
1238 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
1240 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
1241 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1242 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
1243 print $objexport->array_export_label[0];
1247 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
1249 foreach ($array_selected as $code => $label) {
1250 if (isset($objexport->array_export_fields[0][$code])) {
1251 $list .= (!empty($list) ?
', ' :
'');
1253 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
1254 if (!empty($tmplabelarray[1])) {
1255 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1257 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
1261 print
'<td>'.$list.
'</td></tr>';
1264 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1265 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
1267 if (!empty($array_filtervalue)) {
1268 foreach ($array_filtervalue as $code => $value) {
1269 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
1275 if (isset($objexport->array_export_fields[0][$code])) {
1276 $list .= ($list ?
', ' :
'');
1277 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
1278 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
1280 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
1285 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
1295 $htmltabloflibs =
'<!-- Table with available export formats --><br>';
1296 $htmltabloflibs .=
'<table class="noborder centpercent nomarginbottom">';
1297 $htmltabloflibs .=
'<tr class="liste_titre">';
1298 $htmltabloflibs .=
'<td>'.$langs->trans(
"AvailableFormats").
'</td>';
1299 $htmltabloflibs .=
'<td>'.$langs->trans(
"LibraryUsed").
'</td>';
1300 $htmltabloflibs .=
'<td class="right">'.$langs->trans(
"LibraryVersion").
'</td>';
1301 $htmltabloflibs .=
'</tr>'.
"\n";
1303 $liste = $objmodelexport->listOfAvailableExportFormat($db);
1305 foreach ($listeall as $key => $val) {
1306 if (preg_match(
'/__\(Disabled\)__/', $listeall[$key])) {
1307 $listeall[$key] = preg_replace(
'/__\(Disabled\)__/',
'('.$langs->transnoentitiesnoconv(
"Disabled").
')', $listeall[$key]);
1308 unset($liste[$key]);
1311 $htmltabloflibs .=
'<tr class="oddeven">';
1312 $htmltabloflibs .=
'<td>'.img_picto_common($key, $objmodelexport->getPictoForKey($key)).
' ';
1313 $text = $objmodelexport->getDriverDescForKey($key);
1314 $label = $listeall[$key];
1316 $htmltabloflibs .= $form->textwithpicto($label, $text).
'</td>';
1317 $htmltabloflibs .=
'<td>'.$objmodelexport->getLibLabelForKey($key).
'</td>';
1318 $htmltabloflibs .=
'<td class="right">'.$objmodelexport->getLibVersionForKey($key).
'</td>';
1319 $htmltabloflibs .=
'</tr>'.
"\n";
1321 $htmltabloflibs .=
'</table><br>';
1323 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NowClickToGenerateToBuildExportFile"), $htmltabloflibs, 1,
'help',
'', 0, 2,
'helphonformat').
'</span>';
1330 if ($sqlusedforexport && $user->admin) {
1331 print
info_admin($langs->trans(
"SQLUsedForExport").
':<br> '.$sqlusedforexport, 0, 0, 1,
'',
'TechnicalInformation');
1335 if (!is_dir($conf->export->dir_temp)) {
1341 print $formfile->showdocuments(
'export',
'', $upload_dir, $_SERVER[
"PHP_SELF"].
'?step=5&datatoexport='.$datatoexport, $liste, 1, (
GETPOST(
'model') ?
GETPOST(
'model') :
'csv'), 1, 1, 0, 0, 0,
'',
'none',
'',
'',
'');
1360 $alias = preg_replace(
'/\.(.*)$/i',
'', $code);
1361 $regexstring =
'/([a-zA-Z_]+) as '.preg_quote($alias).
'[, \)]/i';
1363 $newsql = $sqlmaxforexport;
1364 $newsql = preg_replace(
'/^(.*) FROM /i',
'', $newsql);
1365 $newsql = preg_replace(
'/WHERE (.*)$/i',
'', $newsql);
1367 if (preg_match($regexstring, $newsql, $reg)) {
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Parent class for export modules.
Class to manage Dolibarr users.
getablenamefromfield($code, $sqlmaxforexport)
Return table name of an alias.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_right($titlealt='default', $selected=0, $moreatt='')
Show right arrow logo.
img_left($titlealt='default', $selected=0, $moreatt='')
Show left arrow logo.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_down($titlealt='default', $selected=0, $moreclass='')
Show down arrow logo.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
img_up($titlealt='default', $selected=0, $moreclass='')
Show top arrow logo.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.