30require_once
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/exports/class/export.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/modules/export/modules_export.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
38$langs->loadlangs(array(
'admin',
'exports',
'other',
'users',
'companies',
'projects',
'suppliers',
'products',
'bank',
'bills'));
47 'invoice_line' =>
'bill',
49 'order_line' =>
'order',
51 'propal_line' =>
'propal',
52 'intervention' =>
'intervention',
53 'inter_line' =>
'intervention',
55 'member_type' =>
'group',
56 'subscription' =>
'payment',
57 'payment' =>
'payment',
59 'tax_type' =>
'generic',
61 'account' =>
'account',
62 'product' =>
'product',
63 'virtualproduct' =>
'product',
64 'subproduct' =>
'product',
65 'product_supplier_ref' =>
'product',
67 'warehouse' =>
'stock',
69 'stockbatch' =>
'stock',
70 'category' =>
'category',
71 'securityevent' =>
'generic',
72 'shipment' =>
'sending',
73 'shipment_line' =>
'sending',
74 'reception' =>
'sending',
75 'reception_line' =>
'sending',
76 'expensereport' =>
'trip',
77 'expensereport_line' =>
'trip',
78 'holiday' =>
'holiday',
79 'contract_line' =>
'contract',
80 'translation' =>
'generic',
83 'conferenceorboothattendee' =>
'contact',
84 'inventory_line' =>
'inventory',
91 'company' =>
'Company',
92 'contact' =>
'Contact',
94 'invoice_line' =>
'InvoiceLine',
96 'order_line' =>
'OrderLine',
97 'propal' =>
'Proposal',
98 'propal_line' =>
'ProposalLine',
99 'intervention' =>
'Intervention',
100 'inter_line' =>
'InterLine',
101 'member' =>
'Member',
102 'member_type' =>
'MemberType',
103 'subscription' =>
'Subscription',
104 'tax' =>
'SocialContribution',
105 'tax_type' =>
'DictionarySocialContributions',
106 'account' =>
'BankTransactions',
107 'payment' =>
'Payment',
108 'product' =>
'Product',
109 'virtualproduct' =>
'AssociatedProducts',
110 'subproduct' =>
'SubProduct',
111 'product_supplier_ref' =>
'SupplierPrices',
112 'service' =>
'Service',
114 'movement' =>
'StockMovement',
116 'stockbatch' =>
'StockDetailPerBatch',
117 'warehouse' =>
'Warehouse',
118 'category' =>
'Category',
120 'trip' =>
'TripsAndExpenses',
121 'securityevent' =>
'SecurityEvent',
122 'shipment' =>
'Shipments',
123 'shipment_line' =>
'ShipmentLine',
124 'project' =>
'Projects',
125 'projecttask' =>
'Tasks',
126 'resource' =>
'Resource',
127 'task_time' =>
'TaskTimeSpent',
129 'expensereport' =>
'ExpenseReport',
130 'expensereport_line' =>
'ExpenseReportLine',
131 'holiday' =>
'TitreRequestCP',
132 'contract' =>
'Contract',
133 'contract_line' =>
'ContractLine',
134 'translation' =>
'Translation',
136 'bomline' =>
'BOMLine',
137 'mrp' =>
'ManufacturingOrder',
138 'mrp_line' =>
'ManufacturingOrderLine',
139 'conferenceorboothattendee' =>
'Attendee',
140 'inventory' =>
'Inventory',
141 'inventory_line' =>
'InventoryLine'
144$array_selected = isset($_SESSION[
"export_selected_fields"]) ? $_SESSION[
"export_selected_fields"] : array();
145$array_filtervalue = isset($_SESSION[
"export_filtered_fields"]) ? $_SESSION[
"export_filtered_fields"] : array();
146$datatoexport =
GETPOST(
"datatoexport",
"aZ09");
147$action =
GETPOST(
'action',
'aZ09');
148$confirm =
GETPOST(
'confirm',
'alpha');
150$export_name =
GETPOST(
"export_name",
"alphanohtml");
151$hexa =
GETPOST(
"hexa",
"alpha");
153$field =
GETPOST(
"field",
"alpha");
155$objexport =
new Export($db);
156$objexport->load_arrays($user, $datatoexport);
159$form =
new Form($db);
162$sqlusedforexport =
'';
165$upload_dir = $conf->export->dir_temp.
'/'.$user->id;
177if ($action ==
'selectfield' && $user->hasRight(
'export',
'creer')) {
178 $fieldsarray = $objexport->array_export_fields[0];
179 $fieldsentitiesarray = $objexport->array_export_entities[0];
180 $fieldsdependenciesarray = $objexport->array_export_dependencies[0];
182 if ($field ==
'all') {
183 foreach ($fieldsarray as $key => $val) {
184 if (!empty($array_selected[$key])) {
187 $array_selected[$key] = count($array_selected) + 1;
189 $_SESSION[
"export_selected_fields"] = $array_selected;
194 $array_selected[$field] = count($array_selected) + 1;
199 $listofdependencies = array();
200 if (!empty($fieldsentitiesarray[$field]) && !empty($fieldsdependenciesarray[$fieldsentitiesarray[$field]])) {
202 $tmp = $fieldsdependenciesarray[$fieldsentitiesarray[$field]];
203 if (is_array($tmp)) {
204 $listofdependencies = $tmp;
206 $listofdependencies = array($tmp);
208 } elseif (!empty($field) && !empty($fieldsdependenciesarray[$field])) {
210 $tmp = $fieldsdependenciesarray[$field];
211 if (is_array($tmp)) {
212 $listofdependencies = $tmp;
214 $listofdependencies = array($tmp);
218 if (count($listofdependencies)) {
219 foreach ($listofdependencies as $fieldid) {
220 if (empty($array_selected[$fieldid])) {
221 $array_selected[$fieldid] = count($array_selected) + 1;
222 $warnings[] = $langs->trans(
"ExportFieldAutomaticallyAdded", $langs->transnoentitiesnoconv($fieldsarray[$fieldid]));
227 $_SESSION[
"export_selected_fields"] = $array_selected;
232if ($action ==
'unselectfield' && $user->hasRight(
'export',
'creer')) {
233 if (
GETPOST(
"field") ==
'all') {
234 $array_selected = array();
235 $_SESSION[
"export_selected_fields"] = $array_selected;
237 unset($array_selected[
GETPOST(
"field")]);
239 asort($array_selected);
241 $array_selected_save = $array_selected;
242 foreach ($array_selected as $code => $value) {
244 $array_selected[$code] = $i;
247 $_SESSION[
"export_selected_fields"] = $array_selected;
252if (($action ==
'downfield' || $action ==
'upfield') && $user->hasRight(
'export',
'creer')) {
253 $pos = $array_selected[
GETPOST(
"field")];
254 if ($action ==
'downfield') {
257 if ($action ==
'upfield') {
262 foreach ($array_selected as $code => $value) {
263 if ($value == $newpos) {
270 $array_selected[
GETPOST(
"field")] = $newpos;
271 $array_selected[$newcode] = $pos;
272 $_SESSION[
"export_selected_fields"] = $array_selected;
276if ($step == 1 || $action ==
'cleanselect') {
277 $_SESSION[
"export_selected_fields"] = array();
278 $_SESSION[
"export_filtered_fields"] = array();
279 $array_selected = array();
280 $array_filtervalue = array();
283if ($action ==
'builddoc' && $user->hasRight(
'export',
'lire')) {
285 if (empty($objexport->array_export_perms[0])) {
289 $separator =
GETPOST(
'delimiter',
'alpha');
290 $max_execution_time_for_importexport =
getDolGlobalInt(
'EXPORT_MAX_EXECUTION_TIME', 300);
291 $max_time = @ini_get(
"max_execution_time");
292 if ($max_time && $max_time < $max_execution_time_for_importexport) {
293 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.");
294 @ini_set(
"max_execution_time", $max_execution_time_for_importexport);
298 $result = $objexport->build_file($user,
GETPOST(
'model',
'alpha'), $datatoexport, $array_selected, $array_filtervalue,
'', $separator);
301 $sqlusedforexport = $objexport->sqlusedforexport;
304 $sqlusedforexport = $objexport->sqlusedforexport;
309if ($step == 5 && $action ==
'confirm_deletefile' && $confirm ==
'yes' && $user->hasRight(
'export',
'lire')) {
311 if (empty($objexport->array_export_perms[0])) {
315 $file = $upload_dir.
"/".
GETPOST(
'file');
323 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport);
327if ($action ==
'deleteprof' && $user->hasRight(
'export',
'lire')) {
329 if (empty($objexport->array_export_perms[0])) {
335 $result = $objexport->delete($user);
340if ($action ==
'add_export_model' && $user->hasRight(
'export',
'lire')) {
342 if (empty($objexport->array_export_perms[0])) {
347 asort($array_selected);
351 foreach ($array_selected as $key => $val) {
358 $hexafiltervalue =
'';
359 if (!empty($array_filtervalue) && is_array($array_filtervalue)) {
360 foreach ($array_filtervalue as $key => $val) {
361 if ($hexafiltervalue) {
362 $hexafiltervalue .=
',';
364 $hexafiltervalue .= $key.
'='.$val;
368 $objexport->model_name = $export_name;
369 $objexport->datatoexport = $datatoexport;
370 $objexport->hexa = $hexa;
371 $objexport->hexafiltervalue = $hexafiltervalue;
372 $objexport->fk_user = (
GETPOST(
'visibility',
'aZ09') ==
'all' ? 0 : $user->id);
374 $result = $objexport->create($user);
376 setEventMessages($langs->trans(
"ExportModelSaved", $objexport->model_name),
null,
'mesgs');
378 $langs->load(
"errors");
379 if ($objexport->errno ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
380 setEventMessages($langs->trans(
"ErrorExportDuplicateProfil"),
null,
'errors');
386 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ExportModelName")),
null,
'errors');
391if ($step == 2 && $action ==
'select_model' && $user->hasRight(
'export',
'lire')) {
392 $_SESSION[
"export_selected_fields"] = array();
393 $_SESSION[
"export_filtered_fields"] = array();
395 $array_selected = array();
396 $array_filtervalue = array();
398 $result = $objexport->fetch($exportmodelid);
400 $fieldsarray = preg_split(
"/,(?! [^(]*\))/", $objexport->hexa);
402 foreach ($fieldsarray as $val) {
403 $array_selected[$val] = $i;
406 $_SESSION[
"export_selected_fields"] = $array_selected;
408 $fieldsarrayvalue = explode(
',', $objexport->hexafiltervalue);
410 foreach ($fieldsarrayvalue as $val) {
411 $tmp = explode(
'=', $val);
412 $array_filtervalue[$tmp[0]] = $tmp[1];
415 $_SESSION[
"export_filtered_fields"] = $array_filtervalue;
420if ($step == 4 && $action ==
'submitFormField' && $user->hasRight(
'export',
'lire')) {
422 if (empty($objexport->array_export_perms[0])) {
427 if (is_array($objexport->array_export_TypeFields[0])) {
428 $_SESSION[
"export_filtered_fields"] = array();
429 foreach ($objexport->array_export_TypeFields[0] as $code => $type) {
430 $newcode = (string) preg_replace(
'/\./',
'_', $code);
432 $check =
'alphanohtml';
433 $filterqualified = 1;
434 if (!GETPOSTISSET($newcode) ||
GETPOST($newcode, $check) ==
'') {
435 $filterqualified = 0;
436 } elseif (preg_match(
'/^List/', $type) && (is_numeric(
GETPOST($newcode, $check)) &&
GETPOST($newcode, $check) <= 0)) {
437 $filterqualified = 0;
439 if ($filterqualified) {
440 $objexport->array_export_FilterValue[0][$code] =
GETPOST($newcode, $check);
443 $array_filtervalue = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] :
'');
444 $_SESSION[
"export_filtered_fields"] = $array_filtervalue;
453if ($step == 1 || !$datatoexport) {
454 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step1');
458 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
459 $head[$h][1] = $langs->trans(
"Step").
" 1";
460 $hselected = (string) $h;
465 print
'<div class="opacitymedium">'.$langs->trans(
"SelectExportDataSet").
'</div><br>';
468 print
'<div class="div-table-responsive-no-min">';
469 print
'<table class="noborder centpercent">';
470 print
'<tr class="liste_titre">';
471 print
'<td>'.$langs->trans(
"Module").
'</td>';
472 print
'<td>'.$langs->trans(
"ExportableDatas").
'</td>';
473 print
'<td> </td>';
476 if (count($objexport->array_export_module)) {
477 asort($objexport->array_export_code_for_sort);
480 foreach ($objexport->array_export_code_for_sort as $key => $value) {
481 print
'<tr class="oddeven"><td nospan="nospan">';
483 print $objexport->array_export_module[$key]->getName();
485 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[$key]);
486 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
487 $label = $objexport->array_export_label[$key];
489 print
img_object($objexport->array_export_module[$key]->getName(), $entityicon).
' ';
491 print
'</td><td class="right">';
492 if ($objexport->array_export_perms[$key]) {
493 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>';
495 print
'<span class="opacitymedium">'.$langs->trans(
"NotEnoughPermissions").
'</span>';
500 print
'<tr><td class="oddeven" colspan="3">'.$langs->trans(
"NoExportableData").
'</td></tr>';
508if ($step == 2 && $datatoexport) {
510 if (empty($objexport->array_export_perms[0])) {
514 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step2');
518 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
519 $head[$h][1] = $langs->trans(
"Step").
" 1";
522 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
523 $head[$h][1] = $langs->trans(
"Step").
" 2";
524 $hselected = (string) $h;
529 print
'<div class="fichecenter">';
530 print
'<div class="underbanner clearboth"></div>';
532 print
'<table class="border tableforfield centpercent">';
535 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
537 print $objexport->array_export_module[0]->getName();
541 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
543 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
544 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
545 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
546 print $objexport->array_export_label[0];
557 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
558 print
'<input type="hidden" name="token" value="'.newToken().
'">';
559 print
'<input type="hidden" name="action" value="select_model">';
560 print
'<input type="hidden" name="step" value="2">';
561 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
562 print
'<div class="valignmiddle marginbottomonly">';
563 print
'<span class="opacitymedium">'.$langs->trans(
"SelectExportFields").
'</span> ';
564 $htmlother->select_export_model($exportmodelid,
'exportmodelid', $datatoexport, 1, $user->id);
566 print
'<input type="submit" class="button small" value="'.$langs->trans(
"Select").
'">';
571 print
'<div class="div-table-responsive-no-min">';
572 print
'<table class="noborder centpercent">';
573 print
'<tr class="liste_titre">';
574 print
'<td>'.$langs->trans(
"Object").
'</td>';
575 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
576 print
'<td width="100" class="center">';
579 if (!$user->hasRight(
'export',
'creer')) {
580 $morecss =
' disabled';
581 $moretitle = $langs->trans(
"NotAllowed");
583 print
'<a class="liste_titre commonlink'.$morecss;
584 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>";
586 print
'<a class="liste_titre commonlink'.$morecss;
587 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>";
589 print
'<td width="44%">'.$langs->trans(
"ExportedFields").
'</td>';
593 $fieldsarray = $objexport->array_export_fields[0];
595 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
607 foreach ($fieldsarray as $code => $label) {
608 print
'<tr class="oddeven">';
612 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
613 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
614 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
616 print
'<td class="nowrap">';
620 $tmparray = explode(
':', $entityicon);
621 if (count($tmparray) >= 2) {
622 $entityicon = $tmparray[0];
623 $entitylang = $tmparray[1];
625 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
628 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
629 $tmplabelarray = explode(
':', $label);
630 if (!empty($tmplabelarray[1])) {
631 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
633 $text .= $langs->trans($label);
635 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
638 $htmltext =
'<b>'.$langs->trans(
"Name").
":</b> ".$text.
'<br>';
639 if (!empty($objexport->array_export_special[0][$code])) {
640 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
642 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
644 if (!empty($objexport->array_export_examplevalues[0][$code])) {
645 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
647 if (!empty($objexport->array_export_TypeFields[0][$code])) {
648 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
650 if (!empty($objexport->array_export_help[0][$code])) {
651 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
654 if (isset($array_selected[$code]) && $array_selected[$code]) {
656 print
'<td> </td>';
657 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>';
660 print $form->textwithpicto($text, $htmltext);
667 print $form->textwithpicto($text, $htmltext);
670 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>';
671 print
'<td> </td>';
683 print
'<div class="tabsAction tabsActionNoBottom">';
685 if (count($array_selected)) {
687 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
688 print
'<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
690 print
'<a class="butAction" href="export.php?step=4&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
693 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"SelectAtLeastOneField")).
'">'.$langs->trans(
"NextStep").
'</a>';
699if ($step == 3 && $datatoexport) {
700 if (count($array_selected) < 1) {
702 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
707 if (empty($objexport->array_export_perms[0])) {
711 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step3');
715 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
716 $head[$h][1] = $langs->trans(
"Step").
" 1";
719 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
720 $head[$h][1] = $langs->trans(
"Step").
" 2";
723 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
724 $head[$h][1] = $langs->trans(
"Step").
" 3";
725 $hselected = (string) $h;
730 print
'<div class="fichecenter">';
731 print
'<div class="underbanner clearboth"></div>';
732 print
'<table width="100%" class="border tableforfield">';
735 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
738 print $objexport->array_export_module[0]->getName();
742 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
744 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
745 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
746 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
747 print $objexport->array_export_label[0];
751 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
753 foreach ($array_selected as $code => $value) {
754 if (isset($objexport->array_export_fields[0][$code])) {
755 $list .= (!empty($list) ?
', ' :
'');
757 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
758 if (!empty($tmplabelarray[1])) {
759 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
761 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
765 print
'<td>'.$list.
'</td></tr>';
773 print
'<span class="opacitymedium">'.$langs->trans(
"SelectFilterFields").
'</span><br><br>';
777 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?step=4&action=submitFormField&datatoexport='.$datatoexport.
'" name="FilterField" method="post">';
778 print
'<input type="hidden" name="token" value="'.newToken().
'">';
780 print
'<div class="div-table-responsive-no-min">';
782 print
'<table class="noborder centpercent">';
783 print
'<tr class="liste_titre">';
784 print
'<td>'.$langs->trans(
"Entities").
'</td>';
787 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
788 print
'<td width="25%">'.$langs->trans(
"FilteredFieldsValues").
'</td>';
792 $fieldsarray = $objexport->array_export_fields[0];
794 $Typefieldsarray = $objexport->array_export_TypeFields[0];
796 $ValueFiltersarray = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] :
'');
798 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
802 foreach ($fieldsarray as $code => $label) {
803 print
'<tr class="oddeven">';
806 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
807 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
808 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
810 print
'<td class="nowrap">';
812 $tmparray = explode(
':', $entityicon);
813 if (count($tmparray) >= 2) {
814 $entityicon = $tmparray[0];
815 $entitylang = $tmparray[1];
817 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
821 $labelName = (!empty($fieldsarray[$code]) ? $fieldsarray[$code] :
'');
822 $ValueFilter = (!empty($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
824 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
825 $tmplabelarray = explode(
':', $label);
826 if (!empty($tmplabelarray[1])) {
827 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
829 $text .= $langs->trans($label);
831 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
834 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
835 if (!empty($objexport->array_export_special[0][$code])) {
836 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
838 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
840 if (!empty($objexport->array_export_examplevalues[0][$code])) {
841 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
843 if (!empty($objexport->array_export_TypeFields[0][$code])) {
844 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
846 if (!empty($objexport->array_export_help[0][$code])) {
847 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
851 print $form->textwithpicto($text, $htmltext);
856 if (!empty($Typefieldsarray[$code])) {
857 $szInfoFiltre = $objexport->genDocFilter($Typefieldsarray[$code]);
859 $tmp = $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
860 print $form->textwithpicto($tmp, $szInfoFiltre);
862 print $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
878 print
'<div class="tabsAction tabsActionNoBottom">';
880 print
'<a class="butAction" href="javascript:FilterField.submit();">'.$langs->trans(
"NextStep").
'</a>';
884if ($step == 4 && $datatoexport) {
885 if (count($array_selected) < 1) {
887 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
892 if (empty($objexport->array_export_perms[0])) {
896 asort($array_selected);
898 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step4');
903 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
904 $head[$h][1] = $langs->trans(
"Step").
" 1";
907 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
908 $head[$h][1] = $langs->trans(
"Step").
" 2";
912 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
913 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
914 $head[$h][1] = $langs->trans(
"Step").
" 3";
919 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
920 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
921 $hselected = (string) $h;
926 print
'<div class="fichecenter">';
927 print
'<div class="underbanner clearboth"></div>';
928 print
'<table width="100%" class="border tableforfield">';
931 print
'<tr><td class="titlefield tableforfield">'.$langs->trans(
"Module").
'</td>';
934 print $objexport->array_export_module[0]->getName();
938 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
940 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
941 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
942 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
943 print $objexport->array_export_label[0];
947 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
949 foreach ($array_selected as $code => $value) {
950 if (isset($objexport->array_export_fields[0][$code])) {
951 $list .= (!empty($list) ?
', ' :
'');
953 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
954 if (!empty($tmplabelarray[1])) {
955 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
957 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
961 print
'<td>'.$list.
'</td>';
965 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
966 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
968 if (!empty($array_filtervalue)) {
969 foreach ($array_filtervalue as $code => $value) {
970 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
976 if (isset($objexport->array_export_fields[0][$code])) {
977 $list .= ($list ?
', ' :
'');
978 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
979 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
981 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
986 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
996 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
998 print
'<div class="marginbottomonly"><span class="opacitymedium">'.$langs->trans(
"ChooseFieldsOrdersAndTitle").
'</span></div>';
1000 print
'<div class="div-table-responsive-no-min">';
1001 print
'<table class="noborder centpercent">';
1002 print
'<tr class="liste_titre">';
1003 print
'<td>'.$langs->trans(
"Entities").
'</td>';
1004 print
'<td>'.$langs->trans(
"ExportedFields").
'</td>';
1005 print
'<td class="right" colspan="2">'.$langs->trans(
"Position").
'</td>';
1010 foreach ($array_selected as $code => $value) {
1011 if (!isset($objexport->array_export_fields[0][$code])) {
1015 print
'<tr class="oddeven">';
1017 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
1018 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1019 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
1021 print
'<td class="nowrap">';
1023 $tmparray = explode(
':', $entityicon);
1024 if (count($tmparray) >= 2) {
1025 $entityicon = $tmparray[0];
1026 $entitylang = $tmparray[1];
1028 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
1031 $labelName = $objexport->array_export_fields[0][$code];
1033 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
1034 $tmplabelarray = explode(
':', $labelName);
1035 if (!empty($tmplabelarray[1])) {
1036 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1038 $text .= $langs->trans($labelName);
1040 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
1043 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
1044 if (!empty($objexport->array_export_special[0][$code])) {
1045 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
1047 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
1049 if (!empty($objexport->array_export_examplevalues[0][$code])) {
1050 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
1052 if (!empty($objexport->array_export_TypeFields[0][$code])) {
1053 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
1055 if (!empty($objexport->array_export_help[0][$code])) {
1056 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
1060 print $form->textwithpicto($text, $htmltext);
1064 print
'<td class="right" width="100">';
1066 print
'</td><td class="center nowraponall" width="40">';
1067 if ($value < count($array_selected)) {
1068 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=downfield&field='.$code.
'">'.
img_down().
'</a>';
1071 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=upfield&field='.$code.
'">'.
img_up().
'</a>';
1089 print
'<div class="tabsAction">';
1091 if (count($array_selected)) {
1092 print
'<a class="butAction" href="export.php?step='.($step + 1).
'&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
1099 if (count($array_selected)) {
1102 print
'<div class="marginbottomonly">';
1103 print
'<span class="opacitymedium">'.$langs->trans(
"SaveExportModel").
'</span>';
1106 print
'<form class="nocellnopadd" action="export.php" method="post">';
1107 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1108 print
'<input type="hidden" name="action" value="add_export_model">';
1109 print
'<input type="hidden" name="step" value="'.$step.
'">';
1110 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
1111 print
'<input type="hidden" name="hexa" value="'.$hexa.
'">';
1113 print
'<div class="div-table-responsive-no-min">';
1114 print
'<table class="noborder centpercent">';
1115 print
'<tr class="liste_titre">';
1116 print
'<td>'.$langs->trans(
"ExportModelName").
'</td>';
1117 print
'<td>'.$langs->trans(
"Visibility").
'</td>';
1121 print
'<tr class="oddeven">';
1122 print
'<td><input name="export_name" value=""></td>';
1124 $arrayvisibility = array(
'private' => $langs->trans(
"Private"),
'all' => $langs->trans(
"Everybody"));
1125 print $form->selectarray(
'visibility', $arrayvisibility,
'private');
1127 print
'<td class="right">';
1128 print
'<input type="submit" class="button reposition button-save small" value="'.$langs->trans(
"Save").
'">';
1131 $tmpuser =
new User($db);
1134 $sql =
"SELECT rowid, label, fk_user, entity";
1135 $sql .=
" FROM ".MAIN_DB_PREFIX.
"export_model";
1136 $sql .=
" WHERE type = '".$db->escape($datatoexport).
"'";
1138 $sql .=
" AND fk_user IN (0, ".((int) $user->id).
")";
1140 $sql .=
" ORDER BY rowid";
1141 $resql = $db->query($sql);
1143 $num = $db->num_rows($resql);
1146 $obj = $db->fetch_object($resql);
1148 print
'<tr class="oddeven"><td>';
1152 if (empty($obj->fk_user)) {
1153 print $langs->trans(
"Everybody");
1155 $tmpuser->fetch($obj->fk_user);
1156 print $tmpuser->getNomUrl(1);
1159 print
'<td class="right">';
1160 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=deleteprof&token='.
newToken().
'&id='.$obj->rowid.
'">';
1177if ($step == 5 && $datatoexport) {
1178 if (count($array_selected) < 1) {
1180 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
1185 if (empty($objexport->array_export_perms[0])) {
1189 asort($array_selected);
1191 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step5');
1196 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
1197 $head[$h][1] = $langs->trans(
"Step").
" 1";
1200 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
1201 $head[$h][1] = $langs->trans(
"Step").
" 2";
1205 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1206 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
1207 $head[$h][1] = $langs->trans(
"Step").
" 3";
1212 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
1213 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
1216 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=5&datatoexport='.$datatoexport;
1217 $head[$h][1] = $langs->trans(
"Step").
" ".(4 + $stepoffset);
1218 $hselected = (string) $h;
1226 if ($action ==
'remove_file') {
1227 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?step=5&datatoexport='.$datatoexport.
'&file='.urlencode(
GETPOST(
"file")), $langs->trans(
'DeleteFile'), $langs->trans(
'ConfirmDeleteFile'),
'confirm_deletefile',
'', 0, 1);
1230 print
'<div class="fichecenter">';
1231 print
'<div class="underbanner clearboth"></div>';
1233 print
'<table class="border tableforfield centpercent">';
1236 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
1239 print $objexport->array_export_module[0]->getName();
1243 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
1245 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
1246 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1247 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
1248 print $objexport->array_export_label[0];
1252 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
1254 foreach ($array_selected as $code => $label) {
1255 if (isset($objexport->array_export_fields[0][$code])) {
1256 $list .= (!empty($list) ?
', ' :
'');
1258 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
1259 if (!empty($tmplabelarray[1])) {
1260 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1262 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
1266 print
'<td>'.$list.
'</td></tr>';
1269 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1270 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
1272 if (!empty($array_filtervalue)) {
1273 foreach ($array_filtervalue as $code => $value) {
1274 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
1280 if (isset($objexport->array_export_fields[0][$code])) {
1281 $list .= ($list ?
', ' :
'');
1282 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
1283 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
1285 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
1290 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
1300 $htmltabloflibs =
'<!-- Table with available export formats --><br>';
1301 $htmltabloflibs .=
'<table class="noborder centpercent nomarginbottom">';
1302 $htmltabloflibs .=
'<tr class="liste_titre">';
1303 $htmltabloflibs .=
'<td>'.$langs->trans(
"AvailableFormats").
'</td>';
1304 $htmltabloflibs .=
'<td>'.$langs->trans(
"LibraryUsed").
'</td>';
1305 $htmltabloflibs .=
'<td class="right">'.$langs->trans(
"LibraryVersion").
'</td>';
1306 $htmltabloflibs .=
'</tr>'.
"\n";
1308 $liste = $objmodelexport->listOfAvailableExportFormat($db);
1310 foreach ($listeall as $key => $val) {
1311 if (preg_match(
'/__\(Disabled\)__/', $listeall[$key])) {
1312 $listeall[$key] = preg_replace(
'/__\(Disabled\)__/',
'('.$langs->transnoentitiesnoconv(
"Disabled").
')', $listeall[$key]);
1313 unset($liste[$key]);
1316 $htmltabloflibs .=
'<tr class="oddeven">';
1317 $htmltabloflibs .=
'<td>'.img_picto_common($key, $objmodelexport->getPictoForKey($key)).
' ';
1318 $text = $objmodelexport->getDriverDescForKey($key);
1319 $label = $listeall[$key];
1321 $htmltabloflibs .= $form->textwithpicto($label, $text).
'</td>';
1322 $htmltabloflibs .=
'<td>'.$objmodelexport->getLibLabelForKey($key).
'</td>';
1323 $htmltabloflibs .=
'<td class="right">'.$objmodelexport->getLibVersionForKey($key).
'</td>';
1324 $htmltabloflibs .=
'</tr>'.
"\n";
1326 $htmltabloflibs .=
'</table><br>';
1328 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NowClickToGenerateToBuildExportFile"), $htmltabloflibs, 1,
'help',
'', 0, 2,
'helphonformat').
'</span>';
1335 if ($sqlusedforexport && $user->admin) {
1336 print
info_admin($langs->trans(
"SQLUsedForExport").
':<br> '.$sqlusedforexport, 0, 0,
'1',
'',
'TechnicalInformation');
1340 if (!is_dir($conf->export->dir_temp)) {
1346 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',
'',
'',
'');
1365 $alias = preg_replace(
'/\.(.*)$/i',
'', $code);
1366 $regexstring =
'/([a-zA-Z_]+) as '.preg_quote($alias).
'[, \)]/i';
1368 $newsql = $sqlmaxforexport;
1369 $newsql = preg_replace(
'/^(.*) FROM /i',
'', $newsql);
1370 $newsql = preg_replace(
'/WHERE (.*)$/i',
'', $newsql);
1372 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
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 a 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.