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';
46$langs->loadlangs(array(
'admin',
'exports',
'other',
'users',
'companies',
'projects',
'suppliers',
'products',
'bank',
'bills'));
55 'invoice_line' =>
'bill',
57 'order_line' =>
'order',
59 'propal_line' =>
'propal',
60 'intervention' =>
'intervention',
61 'inter_line' =>
'intervention',
63 'member_type' =>
'group',
64 'subscription' =>
'payment',
65 'payment' =>
'payment',
67 'tax_type' =>
'generic',
69 'account' =>
'account',
70 'product' =>
'product',
71 'virtualproduct' =>
'product',
72 'subproduct' =>
'product',
73 'product_supplier_ref' =>
'product',
75 'warehouse' =>
'stock',
77 'stockbatch' =>
'stock',
78 'category' =>
'category',
79 'securityevent' =>
'generic',
80 'shipment' =>
'sending',
81 'shipment_line' =>
'sending',
82 'reception' =>
'sending',
83 'reception_line' =>
'sending',
84 'expensereport' =>
'trip',
85 'expensereport_line' =>
'trip',
86 'holiday' =>
'holiday',
87 'contract_line' =>
'contract',
88 'translation' =>
'generic',
91 'conferenceorboothattendee' =>
'contact',
92 'inventory_line' =>
'inventory',
99 'company' =>
'Company',
100 'contact' =>
'Contact',
102 'invoice_line' =>
'InvoiceLine',
104 'order_line' =>
'OrderLine',
105 'propal' =>
'Proposal',
106 'propal_line' =>
'ProposalLine',
107 'intervention' =>
'Intervention',
108 'inter_line' =>
'InterLine',
109 'member' =>
'Member',
110 'member_type' =>
'MemberType',
111 'subscription' =>
'Subscription',
112 'tax' =>
'SocialContribution',
113 'tax_type' =>
'DictionarySocialContributions',
114 'account' =>
'BankTransactions',
115 'payment' =>
'Payment',
116 'product' =>
'Product',
117 'virtualproduct' =>
'AssociatedProducts',
118 'subproduct' =>
'SubProduct',
119 'product_supplier_ref' =>
'SupplierPrices',
120 'service' =>
'Service',
122 'movement' =>
'StockMovement',
124 'stockbatch' =>
'StockDetailPerBatch',
125 'warehouse' =>
'Warehouse',
126 'category' =>
'Category',
128 'trip' =>
'TripsAndExpenses',
129 'securityevent' =>
'SecurityEvent',
130 'shipment' =>
'Shipments',
131 'shipment_line' =>
'ShipmentLine',
132 'project' =>
'Projects',
133 'projecttask' =>
'Tasks',
134 'resource' =>
'Resource',
135 'task_time' =>
'TaskTimeSpent',
137 'expensereport' =>
'ExpenseReport',
138 'expensereport_line' =>
'ExpenseReportLine',
139 'holiday' =>
'TitreRequestCP',
140 'contract' =>
'Contract',
141 'contract_line' =>
'ContractLine',
142 'translation' =>
'Translation',
144 'bomline' =>
'BOMLine',
145 'mrp' =>
'ManufacturingOrder',
146 'mrp_line' =>
'ManufacturingOrderLine',
147 'conferenceorboothattendee' =>
'Attendee',
148 'inventory' =>
'Inventory',
149 'inventory_line' =>
'InventoryLine'
152$array_selected = isset($_SESSION[
"export_selected_fields"]) ? $_SESSION[
"export_selected_fields"] : array();
153$array_filtervalue = isset($_SESSION[
"export_filtered_fields"]) ? $_SESSION[
"export_filtered_fields"] : array();
154$datatoexport =
GETPOST(
"datatoexport",
"aZ09");
155$action =
GETPOST(
'action',
'aZ09');
156$confirm =
GETPOST(
'confirm',
'alpha');
158$export_name =
GETPOST(
"export_name",
"alphanohtml");
159$hexa =
GETPOST(
"hexa",
"alpha");
161$field =
GETPOST(
"field",
"alpha");
163$objexport =
new Export($db);
164$objexport->load_arrays($user, $datatoexport);
167$form =
new Form($db);
170$sqlusedforexport =
'';
173$upload_dir =
$conf->export->dir_temp.
'/'.$user->id;
185if ($action ==
'selectfield' && $user->hasRight(
'export',
'creer')) {
186 $fieldsarray = $objexport->array_export_fields[0];
187 $fieldsentitiesarray = $objexport->array_export_entities[0];
188 $fieldsdependenciesarray = $objexport->array_export_dependencies[0];
190 if ($field ==
'all') {
191 foreach ($fieldsarray as $key => $val) {
192 if (!empty($array_selected[$key])) {
195 $array_selected[$key] = count($array_selected) + 1;
197 $_SESSION[
"export_selected_fields"] = $array_selected;
202 $array_selected[$field] = count($array_selected) + 1;
207 $listofdependencies = array();
208 if (!empty($fieldsentitiesarray[$field]) && !empty($fieldsdependenciesarray[$fieldsentitiesarray[$field]])) {
210 $tmp = $fieldsdependenciesarray[$fieldsentitiesarray[$field]];
211 if (is_array($tmp)) {
212 $listofdependencies = $tmp;
214 $listofdependencies = array($tmp);
216 } elseif (!empty($field) && !empty($fieldsdependenciesarray[$field])) {
218 $tmp = $fieldsdependenciesarray[$field];
219 if (is_array($tmp)) {
220 $listofdependencies = $tmp;
222 $listofdependencies = array($tmp);
226 if (count($listofdependencies)) {
227 foreach ($listofdependencies as $fieldid) {
228 if (empty($array_selected[$fieldid])) {
229 $array_selected[$fieldid] = count($array_selected) + 1;
230 $warnings[] = $langs->trans(
"ExportFieldAutomaticallyAdded", $langs->transnoentitiesnoconv($fieldsarray[$fieldid]));
235 $_SESSION[
"export_selected_fields"] = $array_selected;
240if ($action ==
'unselectfield' && $user->hasRight(
'export',
'creer')) {
241 if (
GETPOST(
"field") ==
'all') {
242 $array_selected = array();
243 $_SESSION[
"export_selected_fields"] = $array_selected;
245 unset($array_selected[
GETPOST(
"field")]);
247 asort($array_selected);
249 $array_selected_save = $array_selected;
250 foreach ($array_selected as $code => $value) {
252 $array_selected[$code] = $i;
255 $_SESSION[
"export_selected_fields"] = $array_selected;
260if (($action ==
'downfield' || $action ==
'upfield') && $user->hasRight(
'export',
'creer')) {
261 $pos = $array_selected[
GETPOST(
"field")];
262 if ($action ==
'downfield') {
265 if ($action ==
'upfield') {
270 foreach ($array_selected as $code => $value) {
271 if ($value == $newpos) {
278 $array_selected[
GETPOST(
"field")] = $newpos;
279 $array_selected[$newcode] = $pos;
280 $_SESSION[
"export_selected_fields"] = $array_selected;
284if ($step == 1 || $action ==
'cleanselect') {
285 $_SESSION[
"export_selected_fields"] = array();
286 $_SESSION[
"export_filtered_fields"] = array();
287 $array_selected = array();
288 $array_filtervalue = array();
291if ($action ==
'builddoc' && $user->hasRight(
'export',
'lire')) {
293 if (empty($objexport->array_export_perms[0])) {
297 $separator =
GETPOST(
'delimiter',
'alpha');
298 $max_execution_time_for_importexport =
getDolGlobalInt(
'EXPORT_MAX_EXECUTION_TIME', 300);
299 $max_time = @ini_get(
"max_execution_time");
300 if ($max_time && $max_time < $max_execution_time_for_importexport) {
301 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.");
302 @ini_set(
"max_execution_time", $max_execution_time_for_importexport);
306 $result = $objexport->build_file($user,
GETPOST(
'model',
'alpha'), $datatoexport, $array_selected, $array_filtervalue,
'', $separator);
309 $sqlusedforexport = $objexport->sqlusedforexport;
312 $sqlusedforexport = $objexport->sqlusedforexport;
317if ($step == 5 && $action ==
'confirm_deletefile' && $confirm ==
'yes' && $user->hasRight(
'export',
'lire')) {
319 if (empty($objexport->array_export_perms[0])) {
323 $file = $upload_dir.
"/".
GETPOST(
'file');
331 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport);
335if ($action ==
'deleteprof' && $user->hasRight(
'export',
'lire')) {
337 if (empty($objexport->array_export_perms[0])) {
343 $result = $objexport->delete($user);
348if ($action ==
'add_export_model' && $user->hasRight(
'export',
'lire')) {
350 if (empty($objexport->array_export_perms[0])) {
355 asort($array_selected);
359 foreach ($array_selected as $key => $val) {
366 $hexafiltervalue =
'';
367 if (!empty($array_filtervalue) && is_array($array_filtervalue)) {
368 foreach ($array_filtervalue as $key => $val) {
369 if ($hexafiltervalue) {
370 $hexafiltervalue .=
',';
372 $hexafiltervalue .= $key.
'='.$val;
376 $objexport->model_name = $export_name;
377 $objexport->datatoexport = $datatoexport;
378 $objexport->hexa = $hexa;
379 $objexport->hexafiltervalue = $hexafiltervalue;
380 $objexport->fk_user = (
GETPOST(
'visibility',
'aZ09') ==
'all' ? 0 : $user->id);
382 $result = $objexport->create($user);
384 setEventMessages($langs->trans(
"ExportModelSaved", $objexport->model_name),
null,
'mesgs');
386 $langs->load(
"errors");
387 if ($objexport->errno ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
388 setEventMessages($langs->trans(
"ErrorExportDuplicateProfil"),
null,
'errors');
394 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ExportModelName")),
null,
'errors');
399if ($step == 2 && $action ==
'select_model' && $user->hasRight(
'export',
'lire')) {
400 $_SESSION[
"export_selected_fields"] = array();
401 $_SESSION[
"export_filtered_fields"] = array();
403 $array_selected = array();
404 $array_filtervalue = array();
406 $result = $objexport->fetch($exportmodelid);
408 $fieldsarray = preg_split(
"/,(?! [^(]*\))/", $objexport->hexa);
410 foreach ($fieldsarray as $val) {
411 $array_selected[$val] = $i;
414 $_SESSION[
"export_selected_fields"] = $array_selected;
416 $fieldsarrayvalue = explode(
',', $objexport->hexafiltervalue);
418 foreach ($fieldsarrayvalue as $val) {
419 $tmp = explode(
'=', $val);
420 $array_filtervalue[$tmp[0]] = $tmp[1];
423 $_SESSION[
"export_filtered_fields"] = $array_filtervalue;
428if ($step == 4 && $action ==
'submitFormField' && $user->hasRight(
'export',
'lire')) {
430 if (empty($objexport->array_export_perms[0])) {
435 if (is_array($objexport->array_export_TypeFields[0])) {
436 $_SESSION[
"export_filtered_fields"] = array();
437 foreach ($objexport->array_export_TypeFields[0] as $code => $type) {
438 $newcode = (string) preg_replace(
'/\./',
'_', $code);
440 $check =
'alphanohtml';
441 $filterqualified = 1;
442 if (!GETPOSTISSET($newcode) ||
GETPOST($newcode, $check) ==
'') {
443 $filterqualified = 0;
444 } elseif (preg_match(
'/^List/', $type) && (is_numeric(
GETPOST($newcode, $check)) &&
GETPOST($newcode, $check) <= 0)) {
445 $filterqualified = 0;
447 if ($filterqualified) {
448 $objexport->array_export_FilterValue[0][$code] =
GETPOST($newcode, $check);
451 $array_filtervalue = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] :
'');
452 $_SESSION[
"export_filtered_fields"] = $array_filtervalue;
461if ($step == 1 || !$datatoexport) {
462 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step1');
466 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
467 $head[$h][1] = $langs->trans(
"Step").
" 1";
468 $hselected = (string) $h;
473 print
'<div class="opacitymedium">'.$langs->trans(
"SelectExportDataSet").
'</div><br>';
476 print
'<div class="div-table-responsive-no-min">';
477 print
'<table class="noborder centpercent nomarginbottom">';
478 print
'<tr class="liste_titre">';
479 print
'<td>'.$langs->trans(
"Module").
'</td>';
480 print
'<td>'.$langs->trans(
"ExportableDatas").
'</td>';
481 print
'<td> </td>';
484 if (count($objexport->array_export_module)) {
485 asort($objexport->array_export_code_for_sort);
488 foreach ($objexport->array_export_code_for_sort as $key => $value) {
489 $titleofmodule = $objexport->array_export_module[$key]->getName();
490 print
'<tr class="oddeven"><td class="tdoverflowmax200" title="'.dolPrintHTML($titleofmodule).
'">';
493 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[$key]);
494 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
495 $label = $objexport->array_export_label[$key];
496 print
'<div class="twolinesmax-normallineheight minwidth200onall">';
497 print
img_object($objexport->array_export_module[$key]->getName(), $entityicon,
'class="pictofixedwidth"');
500 print
'</td><td class="right">';
501 if ($objexport->array_export_perms[$key]) {
502 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>';
504 print
'<span class="opacitymedium">'.$langs->trans(
"NotEnoughPermissions").
'</span>';
509 print
'<tr><td class="oddeven" colspan="3">'.$langs->trans(
"NoExportableData").
'</td></tr>';
517if ($step == 2 && $datatoexport) {
519 if (empty($objexport->array_export_perms[0])) {
523 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step2');
527 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
528 $head[$h][1] = $langs->trans(
"Step").
" 1";
531 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
532 $head[$h][1] = $langs->trans(
"Step").
" 2";
533 $hselected = (string) $h;
538 print
'<div class="fichecenter">';
539 print
'<div class="underbanner clearboth"></div>';
541 print
'<table class="border tableforfield centpercent">';
544 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
546 print $objexport->array_export_module[0]->getName();
550 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
552 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
553 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
554 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
555 print $objexport->array_export_label[0];
566 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
567 print
'<input type="hidden" name="token" value="'.newToken().
'">';
568 print
'<input type="hidden" name="action" value="select_model">';
569 print
'<input type="hidden" name="step" value="2">';
570 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
571 print
'<div class="valignmiddle marginbottomonly">';
572 print
'<span class="opacitymedium">'.$langs->trans(
"SelectExportFields").
'</span> ';
573 $htmlother->select_export_model($exportmodelid,
'exportmodelid', $datatoexport, 1, $user->id);
575 print
'<input type="submit" class="button small" value="'.$langs->trans(
"Select").
'">';
580 print
'<div class="div-table-responsive-no-min">';
581 print
'<table class="noborder centpercent">';
582 print
'<tr class="liste_titre">';
583 print
'<td>'.$langs->trans(
"Object").
'</td>';
584 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
585 print
'<td width="100" class="center">';
588 if (!$user->hasRight(
'export',
'creer')) {
589 $morecss =
' disabled';
590 $moretitle = $langs->trans(
"NotAllowed");
592 print
'<a class="liste_titre commonlink'.$morecss;
593 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>";
595 print
'<a class="liste_titre commonlink'.$morecss;
596 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>";
598 print
'<td width="44%">'.$langs->trans(
"ExportedFields").
'</td>';
602 $fieldsarray = $objexport->array_export_fields[0];
604 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
616 foreach ($fieldsarray as $code => $label) {
617 print
'<tr class="oddeven">';
621 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
622 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
623 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
625 print
'<td class="nowrap">';
629 $tmparray = explode(
':', $entityicon);
630 if (count($tmparray) >= 2) {
631 $entityicon = $tmparray[0];
632 $entitylang = $tmparray[1];
634 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
637 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
638 $tmplabelarray = explode(
':', $label);
639 if (!empty($tmplabelarray[1])) {
640 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
642 $text .= $langs->trans($label);
644 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
647 $htmltext =
'<b>'.$langs->trans(
"Name").
":</b> ".$text.
'<br>';
648 if (!empty($objexport->array_export_special[0][$code])) {
649 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
651 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
653 if (!empty($objexport->array_export_examplevalues[0][$code])) {
654 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
656 if (!empty($objexport->array_export_TypeFields[0][$code])) {
657 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
659 if (!empty($objexport->array_export_help[0][$code])) {
660 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
663 if (isset($array_selected[$code]) && $array_selected[$code]) {
665 print
'<td> </td>';
666 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>';
669 print $form->textwithpicto($text, $htmltext);
676 print $form->textwithpicto($text, $htmltext);
679 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>';
680 print
'<td> </td>';
692 print
'<div class="tabsAction tabsActionNoBottom">';
694 if (count($array_selected)) {
696 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
697 print
'<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
699 print
'<a class="butAction" href="export.php?step=4&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
702 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"SelectAtLeastOneField")).
'">'.$langs->trans(
"NextStep").
'</a>';
708if ($step == 3 && $datatoexport) {
709 if (count($array_selected) < 1) {
711 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
716 if (empty($objexport->array_export_perms[0])) {
720 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step3');
724 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
725 $head[$h][1] = $langs->trans(
"Step").
" 1";
728 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
729 $head[$h][1] = $langs->trans(
"Step").
" 2";
732 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
733 $head[$h][1] = $langs->trans(
"Step").
" 3";
734 $hselected = (string) $h;
739 print
'<div class="fichecenter">';
740 print
'<div class="underbanner clearboth"></div>';
741 print
'<table class="border tableforfield centpercent">';
744 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
747 print $objexport->array_export_module[0]->getName();
751 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
753 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
754 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
755 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
756 print $objexport->array_export_label[0];
760 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
762 foreach ($array_selected as $code => $value) {
763 if (isset($objexport->array_export_fields[0][$code])) {
764 $list .= (!empty($list) ?
', ' :
'');
766 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
767 if (!empty($tmplabelarray[1])) {
768 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
770 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
774 print
'<td>'.$list.
'</td></tr>';
782 print
'<span class="opacitymedium">'.$langs->trans(
"SelectFilterFields").
'</span><br><br>';
786 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?step=4&action=submitFormField&datatoexport='.$datatoexport.
'" name="FilterField" method="post">';
787 print
'<input type="hidden" name="token" value="'.newToken().
'">';
789 print
'<div class="div-table-responsive-no-min">';
791 print
'<table class="noborder centpercent">';
792 print
'<tr class="liste_titre">';
793 print
'<td>'.$langs->trans(
"Entities").
'</td>';
796 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
797 print
'<td width="25%">'.$langs->trans(
"FilteredFieldsValues").
'</td>';
801 $fieldsarray = $objexport->array_export_fields[0];
803 $Typefieldsarray = $objexport->array_export_TypeFields[0];
805 $ValueFiltersarray = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] :
'');
807 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
811 foreach ($fieldsarray as $code => $label) {
812 print
'<tr class="oddeven">';
815 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
816 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
817 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
819 print
'<td class="nowrap">';
821 $tmparray = explode(
':', $entityicon);
822 if (count($tmparray) >= 2) {
823 $entityicon = $tmparray[0];
824 $entitylang = $tmparray[1];
826 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
830 $labelName = (!empty($fieldsarray[$code]) ? $fieldsarray[$code] :
'');
831 $ValueFilter = (!empty($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
833 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
834 $tmplabelarray = explode(
':', $label);
835 if (!empty($tmplabelarray[1])) {
836 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
838 $text .= $langs->trans($label);
840 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
843 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
844 if (!empty($objexport->array_export_special[0][$code])) {
845 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
847 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
849 if (!empty($objexport->array_export_examplevalues[0][$code])) {
850 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
852 if (!empty($objexport->array_export_TypeFields[0][$code])) {
853 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
855 if (!empty($objexport->array_export_help[0][$code])) {
856 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
860 print $form->textwithpicto($text, $htmltext);
865 if (!empty($Typefieldsarray[$code])) {
866 $szInfoFiltre = $objexport->genDocFilter($Typefieldsarray[$code]);
868 $tmp = $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
869 print $form->textwithpicto($tmp, $szInfoFiltre);
871 print $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
887 print
'<div class="tabsAction tabsActionNoBottom">';
889 print
'<a class="butAction" href="javascript:FilterField.submit();">'.$langs->trans(
"NextStep").
'</a>';
893if ($step == 4 && $datatoexport) {
894 if (count($array_selected) < 1) {
896 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
901 if (empty($objexport->array_export_perms[0])) {
905 asort($array_selected);
907 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step4');
912 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
913 $head[$h][1] = $langs->trans(
"Step").
" 1";
916 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
917 $head[$h][1] = $langs->trans(
"Step").
" 2";
921 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
922 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
923 $head[$h][1] = $langs->trans(
"Step").
" 3";
928 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
929 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
930 $hselected = (string) $h;
935 print
'<div class="fichecenter">';
936 print
'<div class="underbanner clearboth"></div>';
937 print
'<table width="100%" class="border tableforfield">';
940 print
'<tr><td class="titlefield tableforfield">'.$langs->trans(
"Module").
'</td>';
943 print $objexport->array_export_module[0]->getName();
947 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
949 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
950 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
951 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
952 print $objexport->array_export_label[0];
956 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
958 foreach ($array_selected as $code => $value) {
959 if (isset($objexport->array_export_fields[0][$code])) {
960 $list .= (!empty($list) ?
', ' :
'');
962 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
963 if (!empty($tmplabelarray[1])) {
964 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
966 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
970 print
'<td>'.$list.
'</td>';
974 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
975 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
977 if (!empty($array_filtervalue)) {
978 foreach ($array_filtervalue as $code => $value) {
979 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
985 if (isset($objexport->array_export_fields[0][$code])) {
986 $list .= ($list ?
', ' :
'');
987 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
988 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
990 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
995 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
1005 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
1007 print
'<div class="marginbottomonly"><span class="opacitymedium">'.$langs->trans(
"ChooseFieldsOrdersAndTitle").
'</span></div>';
1009 print
'<div class="div-table-responsive-no-min">';
1010 print
'<table class="noborder centpercent">';
1011 print
'<tr class="liste_titre">';
1012 print
'<td>'.$langs->trans(
"Entities").
'</td>';
1013 print
'<td>'.$langs->trans(
"ExportedFields").
'</td>';
1014 print
'<td class="right" colspan="2">'.$langs->trans(
"Position").
'</td>';
1019 foreach ($array_selected as $code => $value) {
1020 if (!isset($objexport->array_export_fields[0][$code])) {
1024 print
'<tr class="oddeven">';
1026 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
1027 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1028 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
1030 print
'<td class="nowrap">';
1032 $tmparray = explode(
':', $entityicon);
1033 if (count($tmparray) >= 2) {
1034 $entityicon = $tmparray[0];
1035 $entitylang = $tmparray[1];
1037 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
1040 $labelName = $objexport->array_export_fields[0][$code];
1042 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
1043 $tmplabelarray = explode(
':', $labelName);
1044 if (!empty($tmplabelarray[1])) {
1045 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1047 $text .= $langs->trans($labelName);
1049 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
1052 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
1053 if (!empty($objexport->array_export_special[0][$code])) {
1054 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
1056 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
1058 if (!empty($objexport->array_export_examplevalues[0][$code])) {
1059 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
1061 if (!empty($objexport->array_export_TypeFields[0][$code])) {
1062 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
1064 if (!empty($objexport->array_export_help[0][$code])) {
1065 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
1069 print $form->textwithpicto($text, $htmltext);
1073 print
'<td class="right" width="100">';
1075 print
'</td><td class="center nowraponall" width="40">';
1076 if ($value < count($array_selected)) {
1077 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=downfield&field='.$code.
'">'.
img_down().
'</a>';
1080 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=upfield&field='.$code.
'">'.
img_up().
'</a>';
1098 print
'<div class="tabsAction">';
1100 if (count($array_selected)) {
1101 print
'<a class="butAction" href="export.php?step='.($step + 1).
'&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
1108 if (count($array_selected)) {
1111 print
'<div class="marginbottomonly">';
1112 print
'<span class="opacitymedium">'.$langs->trans(
"SaveExportModel").
'</span>';
1115 print
'<form class="nocellnopadd" action="export.php" method="post">';
1116 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1117 print
'<input type="hidden" name="action" value="add_export_model">';
1118 print
'<input type="hidden" name="step" value="'.$step.
'">';
1119 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
1120 print
'<input type="hidden" name="hexa" value="'.$hexa.
'">';
1122 print
'<div class="div-table-responsive-no-min">';
1123 print
'<table class="noborder centpercent">';
1124 print
'<tr class="liste_titre">';
1125 print
'<td>'.$langs->trans(
"ExportModelName").
'</td>';
1126 print
'<td>'.$langs->trans(
"Visibility").
'</td>';
1130 print
'<tr class="oddeven">';
1131 print
'<td><input name="export_name" value=""></td>';
1133 $arrayvisibility = array(
'private' => $langs->trans(
"Private"),
'all' => $langs->trans(
"Everybody"));
1134 print $form->selectarray(
'visibility', $arrayvisibility,
'private');
1136 print
'<td class="right">';
1137 print
'<input type="submit" class="button reposition button-save small" value="'.$langs->trans(
"Save").
'">';
1140 $tmpuser =
new User($db);
1143 $sql =
"SELECT rowid, label, fk_user, entity";
1144 $sql .=
" FROM ".MAIN_DB_PREFIX.
"export_model";
1145 $sql .=
" WHERE type = '".$db->escape($datatoexport).
"'";
1147 $sql .=
" AND fk_user IN (0, ".((int) $user->id).
")";
1149 $sql .=
" ORDER BY rowid";
1150 $resql = $db->query($sql);
1152 $num = $db->num_rows($resql);
1155 $obj = $db->fetch_object($resql);
1157 print
'<tr class="oddeven"><td>';
1161 if (empty($obj->fk_user)) {
1162 print $langs->trans(
"Everybody");
1164 $tmpuser->fetch($obj->fk_user);
1165 print $tmpuser->getNomUrl(1);
1168 print
'<td class="right">';
1169 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=deleteprof&token='.
newToken().
'&id='.$obj->rowid.
'">';
1186if ($step == 5 && $datatoexport) {
1187 if (count($array_selected) < 1) {
1189 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
1194 if (empty($objexport->array_export_perms[0])) {
1198 asort($array_selected);
1200 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step5');
1205 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
1206 $head[$h][1] = $langs->trans(
"Step").
" 1";
1209 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
1210 $head[$h][1] = $langs->trans(
"Step").
" 2";
1214 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1215 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
1216 $head[$h][1] = $langs->trans(
"Step").
" 3";
1221 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
1222 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
1225 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=5&datatoexport='.$datatoexport;
1226 $head[$h][1] = $langs->trans(
"Step").
" ".(4 + $stepoffset);
1227 $hselected = (string) $h;
1235 if ($action ==
'remove_file') {
1236 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?step=5&datatoexport='.$datatoexport.
'&file='.urlencode(
GETPOST(
"file")), $langs->trans(
'DeleteFile'), $langs->trans(
'ConfirmDeleteFile'),
'confirm_deletefile',
'', 0, 1);
1239 print
'<div class="fichecenter">';
1240 print
'<div class="underbanner clearboth"></div>';
1242 print
'<table class="border tableforfield centpercent">';
1245 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
1248 print $objexport->array_export_module[0]->getName();
1252 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
1254 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
1255 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1256 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
1257 print $objexport->array_export_label[0];
1261 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
1263 foreach ($array_selected as $code => $label) {
1264 if (isset($objexport->array_export_fields[0][$code])) {
1265 $list .= (!empty($list) ?
', ' :
'');
1267 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
1268 if (!empty($tmplabelarray[1])) {
1269 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1271 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
1275 print
'<td>'.$list.
'</td></tr>';
1278 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1279 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
1281 if (!empty($array_filtervalue)) {
1282 foreach ($array_filtervalue as $code => $value) {
1283 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
1289 if (isset($objexport->array_export_fields[0][$code])) {
1290 $list .= ($list ?
', ' :
'');
1291 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
1292 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
1294 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
1299 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
1309 $htmltabloflibs =
'<!-- Table with available export formats --><br>';
1310 $htmltabloflibs .=
'<table class="noborder centpercent nomarginbottom">';
1311 $htmltabloflibs .=
'<tr class="liste_titre">';
1312 $htmltabloflibs .=
'<td>'.$langs->trans(
"AvailableFormats").
'</td>';
1313 $htmltabloflibs .=
'<td>'.$langs->trans(
"LibraryUsed").
'</td>';
1314 $htmltabloflibs .=
'<td class="right">'.$langs->trans(
"LibraryVersion").
'</td>';
1315 $htmltabloflibs .=
'</tr>'.
"\n";
1317 $liste = $objmodelexport->listOfAvailableExportFormat($db);
1319 foreach ($listeall as $key => $val) {
1320 if (preg_match(
'/__\(Disabled\)__/', $listeall[$key])) {
1321 $listeall[$key] = preg_replace(
'/__\(Disabled\)__/',
'('.$langs->transnoentitiesnoconv(
"Disabled").
')', $listeall[$key]);
1322 unset($liste[$key]);
1325 $htmltabloflibs .=
'<tr class="oddeven">';
1326 $htmltabloflibs .=
'<td>'.img_picto_common($key, $objmodelexport->getPictoForKey($key)).
' ';
1327 $text = $objmodelexport->getDriverDescForKey($key);
1328 $label = $listeall[$key];
1330 $htmltabloflibs .= $form->textwithpicto($label, $text).
'</td>';
1331 $htmltabloflibs .=
'<td>'.$objmodelexport->getLibLabelForKey($key).
'</td>';
1332 $htmltabloflibs .=
'<td class="right">'.$objmodelexport->getLibVersionForKey($key).
'</td>';
1333 $htmltabloflibs .=
'</tr>'.
"\n";
1335 $htmltabloflibs .=
'</table><br>';
1337 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NowClickToGenerateToBuildExportFile"), $htmltabloflibs, 1,
'help',
'', 0, 2,
'helphonformat').
'</span>';
1344 if ($sqlusedforexport && $user->admin) {
1345 print
info_admin($langs->trans(
"SQLUsedForExport").
':<br> '.$sqlusedforexport, 0, 0,
'1',
'',
'TechnicalInformation');
1349 if (!is_dir(
$conf->export->dir_temp)) {
1355 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',
'',
'',
'');
1374 $alias = preg_replace(
'/\.(.*)$/i',
'', $code);
1375 $regexstring =
'/([a-zA-Z_]+) as '.preg_quote($alias).
'[, \)]/i';
1377 $newsql = $sqlmaxforexport;
1378 $newsql = preg_replace(
'/^(.*) FROM /i',
'', $newsql);
1379 $newsql = preg_replace(
'/WHERE (.*)$/i',
'', $newsql);
1381 if (preg_match($regexstring, $newsql, $reg)) {
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
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)
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.