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">';
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 print
'<tr class="oddeven"><td nospan="nospan">';
491 print $objexport->array_export_module[$key]->getName();
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];
497 print
img_object($objexport->array_export_module[$key]->getName(), $entityicon).
' ';
499 print
'</td><td class="right">';
500 if ($objexport->array_export_perms[$key]) {
501 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>';
503 print
'<span class="opacitymedium">'.$langs->trans(
"NotEnoughPermissions").
'</span>';
508 print
'<tr><td class="oddeven" colspan="3">'.$langs->trans(
"NoExportableData").
'</td></tr>';
516if ($step == 2 && $datatoexport) {
518 if (empty($objexport->array_export_perms[0])) {
522 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step2');
526 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
527 $head[$h][1] = $langs->trans(
"Step").
" 1";
530 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
531 $head[$h][1] = $langs->trans(
"Step").
" 2";
532 $hselected = (string) $h;
537 print
'<div class="fichecenter">';
538 print
'<div class="underbanner clearboth"></div>';
540 print
'<table class="border tableforfield centpercent">';
543 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
545 print $objexport->array_export_module[0]->getName();
549 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
551 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
552 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
553 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
554 print $objexport->array_export_label[0];
565 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
566 print
'<input type="hidden" name="token" value="'.newToken().
'">';
567 print
'<input type="hidden" name="action" value="select_model">';
568 print
'<input type="hidden" name="step" value="2">';
569 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
570 print
'<div class="valignmiddle marginbottomonly">';
571 print
'<span class="opacitymedium">'.$langs->trans(
"SelectExportFields").
'</span> ';
572 $htmlother->select_export_model($exportmodelid,
'exportmodelid', $datatoexport, 1, $user->id);
574 print
'<input type="submit" class="button small" value="'.$langs->trans(
"Select").
'">';
579 print
'<div class="div-table-responsive-no-min">';
580 print
'<table class="noborder centpercent">';
581 print
'<tr class="liste_titre">';
582 print
'<td>'.$langs->trans(
"Object").
'</td>';
583 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
584 print
'<td width="100" class="center">';
587 if (!$user->hasRight(
'export',
'creer')) {
588 $morecss =
' disabled';
589 $moretitle = $langs->trans(
"NotAllowed");
591 print
'<a class="liste_titre commonlink'.$morecss;
592 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>";
594 print
'<a class="liste_titre commonlink'.$morecss;
595 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>";
597 print
'<td width="44%">'.$langs->trans(
"ExportedFields").
'</td>';
601 $fieldsarray = $objexport->array_export_fields[0];
603 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
615 foreach ($fieldsarray as $code => $label) {
616 print
'<tr class="oddeven">';
620 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
621 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
622 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
624 print
'<td class="nowrap">';
628 $tmparray = explode(
':', $entityicon);
629 if (count($tmparray) >= 2) {
630 $entityicon = $tmparray[0];
631 $entitylang = $tmparray[1];
633 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
636 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
637 $tmplabelarray = explode(
':', $label);
638 if (!empty($tmplabelarray[1])) {
639 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
641 $text .= $langs->trans($label);
643 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
646 $htmltext =
'<b>'.$langs->trans(
"Name").
":</b> ".$text.
'<br>';
647 if (!empty($objexport->array_export_special[0][$code])) {
648 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
650 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
652 if (!empty($objexport->array_export_examplevalues[0][$code])) {
653 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
655 if (!empty($objexport->array_export_TypeFields[0][$code])) {
656 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
658 if (!empty($objexport->array_export_help[0][$code])) {
659 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
662 if (isset($array_selected[$code]) && $array_selected[$code]) {
664 print
'<td> </td>';
665 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>';
668 print $form->textwithpicto($text, $htmltext);
675 print $form->textwithpicto($text, $htmltext);
678 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>';
679 print
'<td> </td>';
691 print
'<div class="tabsAction tabsActionNoBottom">';
693 if (count($array_selected)) {
695 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
696 print
'<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
698 print
'<a class="butAction" href="export.php?step=4&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
701 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"SelectAtLeastOneField")).
'">'.$langs->trans(
"NextStep").
'</a>';
707if ($step == 3 && $datatoexport) {
708 if (count($array_selected) < 1) {
710 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
715 if (empty($objexport->array_export_perms[0])) {
719 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step3');
723 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
724 $head[$h][1] = $langs->trans(
"Step").
" 1";
727 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
728 $head[$h][1] = $langs->trans(
"Step").
" 2";
731 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
732 $head[$h][1] = $langs->trans(
"Step").
" 3";
733 $hselected = (string) $h;
738 print
'<div class="fichecenter">';
739 print
'<div class="underbanner clearboth"></div>';
740 print
'<table class="border tableforfield centpercent">';
743 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
746 print $objexport->array_export_module[0]->getName();
750 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
752 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
753 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
754 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
755 print $objexport->array_export_label[0];
759 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
761 foreach ($array_selected as $code => $value) {
762 if (isset($objexport->array_export_fields[0][$code])) {
763 $list .= (!empty($list) ?
', ' :
'');
765 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
766 if (!empty($tmplabelarray[1])) {
767 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
769 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
773 print
'<td>'.$list.
'</td></tr>';
781 print
'<span class="opacitymedium">'.$langs->trans(
"SelectFilterFields").
'</span><br><br>';
785 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?step=4&action=submitFormField&datatoexport='.$datatoexport.
'" name="FilterField" method="post">';
786 print
'<input type="hidden" name="token" value="'.newToken().
'">';
788 print
'<div class="div-table-responsive-no-min">';
790 print
'<table class="noborder centpercent">';
791 print
'<tr class="liste_titre">';
792 print
'<td>'.$langs->trans(
"Entities").
'</td>';
795 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
796 print
'<td width="25%">'.$langs->trans(
"FilteredFieldsValues").
'</td>';
800 $fieldsarray = $objexport->array_export_fields[0];
802 $Typefieldsarray = $objexport->array_export_TypeFields[0];
804 $ValueFiltersarray = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] :
'');
806 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
810 foreach ($fieldsarray as $code => $label) {
811 print
'<tr class="oddeven">';
814 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
815 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
816 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
818 print
'<td class="nowrap">';
820 $tmparray = explode(
':', $entityicon);
821 if (count($tmparray) >= 2) {
822 $entityicon = $tmparray[0];
823 $entitylang = $tmparray[1];
825 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
829 $labelName = (!empty($fieldsarray[$code]) ? $fieldsarray[$code] :
'');
830 $ValueFilter = (!empty($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
832 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
833 $tmplabelarray = explode(
':', $label);
834 if (!empty($tmplabelarray[1])) {
835 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
837 $text .= $langs->trans($label);
839 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
842 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
843 if (!empty($objexport->array_export_special[0][$code])) {
844 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
846 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
848 if (!empty($objexport->array_export_examplevalues[0][$code])) {
849 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
851 if (!empty($objexport->array_export_TypeFields[0][$code])) {
852 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
854 if (!empty($objexport->array_export_help[0][$code])) {
855 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
859 print $form->textwithpicto($text, $htmltext);
864 if (!empty($Typefieldsarray[$code])) {
865 $szInfoFiltre = $objexport->genDocFilter($Typefieldsarray[$code]);
867 $tmp = $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
868 print $form->textwithpicto($tmp, $szInfoFiltre);
870 print $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
886 print
'<div class="tabsAction tabsActionNoBottom">';
888 print
'<a class="butAction" href="javascript:FilterField.submit();">'.$langs->trans(
"NextStep").
'</a>';
892if ($step == 4 && $datatoexport) {
893 if (count($array_selected) < 1) {
895 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
900 if (empty($objexport->array_export_perms[0])) {
904 asort($array_selected);
906 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step4');
911 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
912 $head[$h][1] = $langs->trans(
"Step").
" 1";
915 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
916 $head[$h][1] = $langs->trans(
"Step").
" 2";
920 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
921 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
922 $head[$h][1] = $langs->trans(
"Step").
" 3";
927 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
928 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
929 $hselected = (string) $h;
934 print
'<div class="fichecenter">';
935 print
'<div class="underbanner clearboth"></div>';
936 print
'<table width="100%" class="border tableforfield">';
939 print
'<tr><td class="titlefield tableforfield">'.$langs->trans(
"Module").
'</td>';
942 print $objexport->array_export_module[0]->getName();
946 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
948 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
949 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
950 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
951 print $objexport->array_export_label[0];
955 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
957 foreach ($array_selected as $code => $value) {
958 if (isset($objexport->array_export_fields[0][$code])) {
959 $list .= (!empty($list) ?
', ' :
'');
961 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
962 if (!empty($tmplabelarray[1])) {
963 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
965 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
969 print
'<td>'.$list.
'</td>';
973 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
974 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
976 if (!empty($array_filtervalue)) {
977 foreach ($array_filtervalue as $code => $value) {
978 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
984 if (isset($objexport->array_export_fields[0][$code])) {
985 $list .= ($list ?
', ' :
'');
986 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
987 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
989 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
994 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
1004 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
1006 print
'<div class="marginbottomonly"><span class="opacitymedium">'.$langs->trans(
"ChooseFieldsOrdersAndTitle").
'</span></div>';
1008 print
'<div class="div-table-responsive-no-min">';
1009 print
'<table class="noborder centpercent">';
1010 print
'<tr class="liste_titre">';
1011 print
'<td>'.$langs->trans(
"Entities").
'</td>';
1012 print
'<td>'.$langs->trans(
"ExportedFields").
'</td>';
1013 print
'<td class="right" colspan="2">'.$langs->trans(
"Position").
'</td>';
1018 foreach ($array_selected as $code => $value) {
1019 if (!isset($objexport->array_export_fields[0][$code])) {
1023 print
'<tr class="oddeven">';
1025 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
1026 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1027 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
1029 print
'<td class="nowrap">';
1031 $tmparray = explode(
':', $entityicon);
1032 if (count($tmparray) >= 2) {
1033 $entityicon = $tmparray[0];
1034 $entitylang = $tmparray[1];
1036 print
img_object(
'', $entityicon).
' '.$langs->trans($entitylang);
1039 $labelName = $objexport->array_export_fields[0][$code];
1041 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
1042 $tmplabelarray = explode(
':', $labelName);
1043 if (!empty($tmplabelarray[1])) {
1044 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1046 $text .= $langs->trans($labelName);
1048 $text .=(empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
1051 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
1052 if (!empty($objexport->array_export_special[0][$code])) {
1053 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ".$objexport->array_export_special[0][$code].
"<br>";
1055 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
1057 if (!empty($objexport->array_export_examplevalues[0][$code])) {
1058 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
1060 if (!empty($objexport->array_export_TypeFields[0][$code])) {
1061 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
1063 if (!empty($objexport->array_export_help[0][$code])) {
1064 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
1068 print $form->textwithpicto($text, $htmltext);
1072 print
'<td class="right" width="100">';
1074 print
'</td><td class="center nowraponall" width="40">';
1075 if ($value < count($array_selected)) {
1076 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=downfield&field='.$code.
'">'.
img_down().
'</a>';
1079 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=upfield&field='.$code.
'">'.
img_up().
'</a>';
1097 print
'<div class="tabsAction">';
1099 if (count($array_selected)) {
1100 print
'<a class="butAction" href="export.php?step='.($step + 1).
'&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
1107 if (count($array_selected)) {
1110 print
'<div class="marginbottomonly">';
1111 print
'<span class="opacitymedium">'.$langs->trans(
"SaveExportModel").
'</span>';
1114 print
'<form class="nocellnopadd" action="export.php" method="post">';
1115 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1116 print
'<input type="hidden" name="action" value="add_export_model">';
1117 print
'<input type="hidden" name="step" value="'.$step.
'">';
1118 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
1119 print
'<input type="hidden" name="hexa" value="'.$hexa.
'">';
1121 print
'<div class="div-table-responsive-no-min">';
1122 print
'<table class="noborder centpercent">';
1123 print
'<tr class="liste_titre">';
1124 print
'<td>'.$langs->trans(
"ExportModelName").
'</td>';
1125 print
'<td>'.$langs->trans(
"Visibility").
'</td>';
1129 print
'<tr class="oddeven">';
1130 print
'<td><input name="export_name" value=""></td>';
1132 $arrayvisibility = array(
'private' => $langs->trans(
"Private"),
'all' => $langs->trans(
"Everybody"));
1133 print $form->selectarray(
'visibility', $arrayvisibility,
'private');
1135 print
'<td class="right">';
1136 print
'<input type="submit" class="button reposition button-save small" value="'.$langs->trans(
"Save").
'">';
1139 $tmpuser =
new User($db);
1142 $sql =
"SELECT rowid, label, fk_user, entity";
1143 $sql .=
" FROM ".MAIN_DB_PREFIX.
"export_model";
1144 $sql .=
" WHERE type = '".$db->escape($datatoexport).
"'";
1146 $sql .=
" AND fk_user IN (0, ".((int) $user->id).
")";
1148 $sql .=
" ORDER BY rowid";
1149 $resql = $db->query($sql);
1151 $num = $db->num_rows($resql);
1154 $obj = $db->fetch_object($resql);
1156 print
'<tr class="oddeven"><td>';
1160 if (empty($obj->fk_user)) {
1161 print $langs->trans(
"Everybody");
1163 $tmpuser->fetch($obj->fk_user);
1164 print $tmpuser->getNomUrl(1);
1167 print
'<td class="right">';
1168 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=deleteprof&token='.
newToken().
'&id='.$obj->rowid.
'">';
1185if ($step == 5 && $datatoexport) {
1186 if (count($array_selected) < 1) {
1188 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
1193 if (empty($objexport->array_export_perms[0])) {
1197 asort($array_selected);
1199 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step5');
1204 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
1205 $head[$h][1] = $langs->trans(
"Step").
" 1";
1208 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
1209 $head[$h][1] = $langs->trans(
"Step").
" 2";
1213 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1214 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
1215 $head[$h][1] = $langs->trans(
"Step").
" 3";
1220 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
1221 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
1224 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=5&datatoexport='.$datatoexport;
1225 $head[$h][1] = $langs->trans(
"Step").
" ".(4 + $stepoffset);
1226 $hselected = (string) $h;
1234 if ($action ==
'remove_file') {
1235 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?step=5&datatoexport='.$datatoexport.
'&file='.urlencode(
GETPOST(
"file")), $langs->trans(
'DeleteFile'), $langs->trans(
'ConfirmDeleteFile'),
'confirm_deletefile',
'', 0, 1);
1238 print
'<div class="fichecenter">';
1239 print
'<div class="underbanner clearboth"></div>';
1241 print
'<table class="border tableforfield centpercent">';
1244 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
1247 print $objexport->array_export_module[0]->getName();
1251 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
1253 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
1254 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1255 print
img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
1256 print $objexport->array_export_label[0];
1260 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
1262 foreach ($array_selected as $code => $label) {
1263 if (isset($objexport->array_export_fields[0][$code])) {
1264 $list .= (!empty($list) ?
', ' :
'');
1266 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
1267 if (!empty($tmplabelarray[1])) {
1268 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1270 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
1274 print
'<td>'.$list.
'</td></tr>';
1277 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1278 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
1280 if (!empty($array_filtervalue)) {
1281 foreach ($array_filtervalue as $code => $value) {
1282 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
1288 if (isset($objexport->array_export_fields[0][$code])) {
1289 $list .= ($list ?
', ' :
'');
1290 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
1291 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
1293 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
1298 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
1308 $htmltabloflibs =
'<!-- Table with available export formats --><br>';
1309 $htmltabloflibs .=
'<table class="noborder centpercent nomarginbottom">';
1310 $htmltabloflibs .=
'<tr class="liste_titre">';
1311 $htmltabloflibs .=
'<td>'.$langs->trans(
"AvailableFormats").
'</td>';
1312 $htmltabloflibs .=
'<td>'.$langs->trans(
"LibraryUsed").
'</td>';
1313 $htmltabloflibs .=
'<td class="right">'.$langs->trans(
"LibraryVersion").
'</td>';
1314 $htmltabloflibs .=
'</tr>'.
"\n";
1316 $liste = $objmodelexport->listOfAvailableExportFormat($db);
1318 foreach ($listeall as $key => $val) {
1319 if (preg_match(
'/__\(Disabled\)__/', $listeall[$key])) {
1320 $listeall[$key] = preg_replace(
'/__\(Disabled\)__/',
'('.$langs->transnoentitiesnoconv(
"Disabled").
')', $listeall[$key]);
1321 unset($liste[$key]);
1324 $htmltabloflibs .=
'<tr class="oddeven">';
1325 $htmltabloflibs .=
'<td>'.img_picto_common($key, $objmodelexport->getPictoForKey($key)).
' ';
1326 $text = $objmodelexport->getDriverDescForKey($key);
1327 $label = $listeall[$key];
1329 $htmltabloflibs .= $form->textwithpicto($label, $text).
'</td>';
1330 $htmltabloflibs .=
'<td>'.$objmodelexport->getLibLabelForKey($key).
'</td>';
1331 $htmltabloflibs .=
'<td class="right">'.$objmodelexport->getLibVersionForKey($key).
'</td>';
1332 $htmltabloflibs .=
'</tr>'.
"\n";
1334 $htmltabloflibs .=
'</table><br>';
1336 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NowClickToGenerateToBuildExportFile"), $htmltabloflibs, 1,
'help',
'', 0, 2,
'helphonformat').
'</span>';
1343 if ($sqlusedforexport && $user->admin) {
1344 print
info_admin($langs->trans(
"SQLUsedForExport").
':<br> '.$sqlusedforexport, 0, 0,
'1',
'',
'TechnicalInformation');
1348 if (!is_dir(
$conf->export->dir_temp)) {
1354 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',
'',
'',
'');
1373 $alias = preg_replace(
'/\.(.*)$/i',
'', $code);
1374 $regexstring =
'/([a-zA-Z_]+) as '.preg_quote($alias).
'[, \)]/i';
1376 $newsql = $sqlmaxforexport;
1377 $newsql = preg_replace(
'/^(.*) FROM /i',
'', $newsql);
1378 $newsql = preg_replace(
'/WHERE (.*)$/i',
'', $newsql);
1380 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)
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.