30require_once
'../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/exports/class/export.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/modules/export/modules_export.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
45$langs->loadlangs(array(
'admin',
'exports',
'other',
'users',
'companies',
'projects',
'suppliers',
'products',
'bank',
'bills'));
54 'invoice_line' =>
'bill',
56 'order_line' =>
'order',
58 'propal_line' =>
'propal',
59 'intervention' =>
'intervention',
60 'inter_line' =>
'intervention',
62 'member_type' =>
'group',
63 'subscription' =>
'payment',
64 'payment' =>
'payment',
66 'tax_type' =>
'generic',
68 'account' =>
'account',
69 'product' =>
'product',
70 'productattribute' =>
'product',
71 'productattributevalue' =>
'product',
72 'productcombination' =>
'product',
73 'virtualproduct' =>
'product',
74 'subproduct' =>
'product',
75 'product_supplier_ref' =>
'product',
77 'warehouse' =>
'stock',
79 'stockbatch' =>
'stock',
80 'category' =>
'category',
81 'securityevent' =>
'generic',
82 'shipment' =>
'sending',
83 'shipment_line' =>
'sending',
84 'reception' =>
'sending',
85 'reception_line' =>
'sending',
86 'expensereport' =>
'trip',
87 'expensereport_line' =>
'trip',
88 'holiday' =>
'holiday',
89 'contract_line' =>
'contract',
90 'translation' =>
'generic',
93 'conferenceorboothattendee' =>
'contact',
94 'inventory_line' =>
'inventory',
96 'task_time' =>
'clock',
100$entitytolang = array(
102 'company' =>
'Company',
103 'contact' =>
'Contact',
105 'invoice_line' =>
'InvoiceLine',
107 'order_line' =>
'OrderLine',
108 'propal' =>
'Proposal',
109 'propal_line' =>
'ProposalLine',
110 'intervention' =>
'Intervention',
111 'inter_line' =>
'InterLine',
112 'member' =>
'Member',
113 'member_type' =>
'MemberType',
114 'subscription' =>
'Subscription',
115 'tax' =>
'SocialContribution',
116 'tax_type' =>
'DictionarySocialContributions',
117 'account' =>
'BankTransactions',
118 'payment' =>
'Payment',
119 'product' =>
'Product',
120 'productattribute' =>
'ProductAttribute',
121 'productattributevalue' =>
'ProductAttributeValue',
122 'productcombination' =>
'ProductCombination',
123 'virtualproduct' =>
'AssociatedProducts',
124 'subproduct' =>
'SubProduct',
125 'product_supplier_ref' =>
'SupplierPrices',
126 'service' =>
'Service',
128 'movement' =>
'StockMovement',
130 'stockbatch' =>
'StockDetailPerBatch',
131 'warehouse' =>
'Warehouse',
132 'category' =>
'Category',
134 'trip' =>
'TripsAndExpenses',
135 'securityevent' =>
'SecurityEvent',
136 'shipment' =>
'Shipments',
137 'shipment_line' =>
'ShipmentLine',
138 'project' =>
'Projects',
139 'projecttask' =>
'Tasks',
140 'resource' =>
'Resource',
141 'task_time' =>
'TaskTimeSpent',
143 'expensereport' =>
'ExpenseReport',
144 'expensereport_line' =>
'ExpenseReportLine',
145 'holiday' =>
'TitreRequestCP',
146 'contract' =>
'Contract',
147 'contract_line' =>
'ContractLine',
148 'translation' =>
'Translation',
150 'bomline' =>
'BOMLine',
151 'mrp' =>
'ManufacturingOrder',
152 'mrp_line' =>
'ManufacturingOrderLine',
153 'conferenceorbooth' =>
'ConferenceOrBooth',
154 'conferenceorboothattendee' =>
'Attendee',
155 'inventory' =>
'Inventory',
156 'inventory_line' =>
'InventoryLine'
160$array_selected = isset($_SESSION[
"export_selected_fields"]) ? $_SESSION[
"export_selected_fields"] : array();
161$array_filtervalue = isset($_SESSION[
"export_filtered_fields"]) ? $_SESSION[
"export_filtered_fields"] : array();
162$datatoexport =
GETPOST(
"datatoexport",
"aZ09");
163$action =
GETPOST(
'action',
'aZ09');
164$confirm =
GETPOST(
'confirm',
'alpha');
166$export_name =
GETPOST(
"export_name",
"alphanohtml");
167$hexa =
GETPOST(
"hexa",
"alpha");
169$field = (string)
GETPOST(
"field",
"alpha");
171$objexport =
new Export($db);
172$objexport->load_arrays($user, $datatoexport);
176$form =
new Form($db);
179$sqlusedforexport =
'';
182$upload_dir =
$conf->export->dir_temp.
'/'.$user->id;
194if ($action ==
'selectfield' && $user->hasRight(
'export',
'creer')) {
195 $fieldsarray = $objexport->array_export_fields[0];
196 $fieldsentitiesarray = $objexport->array_export_entities[0];
197 $fieldsdependenciesarray = $objexport->array_export_dependencies[0];
199 if ($field ==
'all') {
200 foreach ($fieldsarray as $key => $val) {
201 if (!empty($array_selected[$key])) {
204 $array_selected[$key] = count($array_selected) + 1;
206 $_SESSION[
"export_selected_fields"] = $array_selected;
211 $array_selected[$field] = count($array_selected) + 1;
216 $listofdependencies = array();
217 if (!empty($fieldsentitiesarray[$field]) && !empty($fieldsdependenciesarray[$fieldsentitiesarray[$field]])) {
219 $tmp = $fieldsdependenciesarray[$fieldsentitiesarray[$field]];
220 if (is_array($tmp)) {
221 $listofdependencies = $tmp;
223 $listofdependencies = array($tmp);
225 } elseif (!empty($field) && !empty($fieldsdependenciesarray[$field])) {
227 $tmp = $fieldsdependenciesarray[$field];
228 if (is_array($tmp)) {
229 $listofdependencies = $tmp;
231 $listofdependencies = array($tmp);
235 if (count($listofdependencies)) {
236 foreach ($listofdependencies as $fieldid) {
237 if (empty($array_selected[$fieldid])) {
238 $array_selected[$fieldid] = count($array_selected) + 1;
239 $warnings[] = $langs->trans(
"ExportFieldAutomaticallyAdded", $langs->transnoentitiesnoconv($fieldsarray[$fieldid]));
244 $_SESSION[
"export_selected_fields"] = $array_selected;
246 setEventMessages(
null, $warnings,
'warnings');
249if ($action ==
'unselectfield' && $user->hasRight(
'export',
'creer')) {
250 if (
GETPOST(
"field") ==
'all') {
251 $array_selected = array();
252 $_SESSION[
"export_selected_fields"] = $array_selected;
254 unset($array_selected[
GETPOST(
"field")]);
256 asort($array_selected);
258 $array_selected_save = $array_selected;
259 foreach ($array_selected as $code => $value) {
261 $array_selected[$code] = $i;
264 $_SESSION[
"export_selected_fields"] = $array_selected;
269if (($action ==
'downfield' || $action ==
'upfield') && $user->hasRight(
'export',
'creer')) {
270 $pos = $array_selected[
GETPOST(
"field")];
271 if ($action ==
'downfield') {
274 if ($action ==
'upfield') {
279 foreach ($array_selected as $code => $value) {
280 if ($value == $newpos) {
287 $array_selected[
GETPOST(
"field")] = $newpos;
288 $array_selected[$newcode] = $pos;
289 $_SESSION[
"export_selected_fields"] = $array_selected;
293if ($step == 1 || $action ==
'cleanselect') {
294 $_SESSION[
"export_selected_fields"] = array();
295 $_SESSION[
"export_filtered_fields"] = array();
296 $array_selected = array();
297 $array_filtervalue = array();
300if ($action ==
'builddoc' && $user->hasRight(
'export',
'lire')) {
302 if (empty($objexport->array_export_perms[0])) {
306 $separator =
GETPOST(
'delimiter',
'alpha');
307 $max_execution_time_for_importexport =
getDolGlobalInt(
'EXPORT_MAX_EXECUTION_TIME', 300);
308 $max_time = @ini_get(
"max_execution_time");
309 if ($max_time && $max_time < $max_execution_time_for_importexport) {
310 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.");
311 @ini_set(
"max_execution_time", $max_execution_time_for_importexport);
315 $result = $objexport->build_file($user,
GETPOST(
'model',
'alpha'), $datatoexport, $array_selected, $array_filtervalue,
'', $separator);
317 setEventMessages($objexport->error, $objexport->errors,
'errors');
318 $sqlusedforexport = $objexport->sqlusedforexport;
320 setEventMessages($langs->trans(
"FileSuccessfullyBuilt"),
null,
'mesgs');
321 $sqlusedforexport = $objexport->sqlusedforexport;
326if ($step == 5 && $action ==
'confirm_deletefile' && $confirm ==
'yes' && $user->hasRight(
'export',
'lire')) {
328 if (empty($objexport->array_export_perms[0])) {
332 $file = $upload_dir.
"/".
GETPOST(
'file');
336 setEventMessages($langs->trans(
"FileWasRemoved",
GETPOST(
'file')),
null,
'mesgs');
338 setEventMessages($langs->trans(
"ErrorFailToDeleteFile",
GETPOST(
'file')),
null,
'errors');
340 header(
'Location: '.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport);
344if ($action ==
'deleteprof' && $user->hasRight(
'export',
'lire')) {
346 if (empty($objexport->array_export_perms[0])) {
352 $result = $objexport->delete($user);
354 setEventMessages($objexport->error, $objexport->errors,
'errors');
360if ($action ==
'add_export_model' && $user->hasRight(
'export',
'lire')) {
362 if (empty($objexport->array_export_perms[0])) {
367 asort($array_selected);
371 foreach ($array_selected as $key => $val) {
378 $hexafiltervalue =
'';
379 if (!empty($array_filtervalue) && is_array($array_filtervalue)) {
380 foreach ($array_filtervalue as $key => $val) {
381 if ($hexafiltervalue) {
382 $hexafiltervalue .=
',';
384 $hexafiltervalue .= $key.
'='.$val;
388 $objexport->model_name = $export_name;
389 $objexport->datatoexport = $datatoexport;
390 $objexport->hexa = $hexa;
391 $objexport->hexafiltervalue = $hexafiltervalue;
392 $objexport->fk_user = (
GETPOST(
'visibility',
'aZ09') ==
'all' ? 0 : $user->id);
394 $result = $objexport->create($user);
396 setEventMessages($langs->trans(
"ExportModelSaved", $objexport->model_name),
null,
'mesgs');
398 $langs->load(
"errors");
399 if ($objexport->errno ==
'DB_ERROR_RECORD_ALREADY_EXISTS') {
400 setEventMessages($langs->trans(
"ErrorExportDuplicateProfil"),
null,
'errors');
402 setEventMessages($objexport->error, $objexport->errors,
'errors');
406 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"ExportModelName")),
null,
'errors');
411if ($step == 2 && $action ==
'select_model' && $user->hasRight(
'export',
'lire')) {
412 $_SESSION[
"export_selected_fields"] = array();
413 $_SESSION[
"export_filtered_fields"] = array();
415 $array_selected = array();
416 $array_filtervalue = array();
418 $result = $objexport->fetch($exportmodelid);
420 $fieldsarray = preg_split(
"/,(?! [^(]*\))/", $objexport->hexa);
422 foreach ($fieldsarray as $val) {
423 $array_selected[$val] = $i;
426 $_SESSION[
"export_selected_fields"] = $array_selected;
428 $fieldsarrayvalue = explode(
',', $objexport->hexafiltervalue);
430 foreach ($fieldsarrayvalue as $val) {
431 $tmp = explode(
'=', $val);
432 $array_filtervalue[$tmp[0]] = $tmp[1];
435 $_SESSION[
"export_filtered_fields"] = $array_filtervalue;
440if ($step == 4 && $action ==
'submitFormField' && $user->hasRight(
'export',
'lire')) {
442 if (empty($objexport->array_export_perms[0])) {
447 if (is_array($objexport->array_export_TypeFields[0])) {
448 $_SESSION[
"export_filtered_fields"] = array();
449 foreach ($objexport->array_export_TypeFields[0] as $code => $type) {
450 $newcode = (string) preg_replace(
'/\./',
'_', $code);
452 $check =
'alphanohtml';
453 $filterqualified = 1;
455 $filterqualified = 0;
456 } elseif (preg_match(
'/^List/', $type) && (is_numeric(
GETPOST($newcode, $check)) &&
GETPOST($newcode, $check) <= 0)) {
457 $filterqualified = 0;
459 if ($filterqualified) {
460 $objexport->array_export_FilterValue[0][$code] =
GETPOST($newcode, $check);
463 $array_filtervalue = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] :
'');
464 $_SESSION[
"export_filtered_fields"] = $array_filtervalue;
473if ($step == 1 || !$datatoexport) {
474 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step1');
478 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
479 $head[$h][1] = $langs->trans(
"Step").
" 1";
480 $hselected = (string) $h;
485 print
'<div class="opacitymedium">'.$langs->trans(
"SelectExportDataSet").
'</div>';
489 $nbmodulesnotautoenabled = count(
$conf->modules);
490 $listofmodulesautoenabled = array(
'user',
'agenda',
'fckeditor',
'export',
'import');
491 foreach ($listofmodulesautoenabled as $moduleautoenable) {
492 if (in_array($moduleautoenable,
$conf->modules)) {
493 $nbmodulesnotautoenabled--;
497 if ($user->admin && $nbmodulesnotautoenabled <
getDolGlobalInt(
'MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING', 1)) {
498 print
info_admin($langs->trans(
"WarningOnlyProfilesOfActivatedModules").
' '.$langs->trans(
"YouCanEnableModulesFrom"));
504 print
'<div class="div-table-responsive-no-min">';
505 print
'<table class="noborder centpercent nomarginbottom">';
506 print
'<tr class="liste_titre">';
507 print
'<td>'.$langs->trans(
"Module").
'</td>';
508 print
'<td>'.$langs->trans(
"ExportableDatas").
'</td>';
509 print
'<td> </td>';
512 if (count($objexport->array_export_module)) {
513 asort($objexport->array_export_code_for_sort);
516 foreach ($objexport->array_export_code_for_sort as $key => $value) {
517 $titleofmodule = $objexport->array_export_module[$key]->getName();
518 print
'<tr class="oddeven"><td class="tdoverflowmax200" title="'.dolPrintHTML($titleofmodule).
'">';
519 print dolPrintHTML($titleofmodule);
521 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[$key]);
522 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
523 $label = $objexport->array_export_label[$key];
524 print
'<div class="twolinesmax-normallineheight minwidth200onall">';
525 print img_object($objexport->array_export_module[$key]->getName(), $entityicon,
'class="pictofixedwidth"');
526 print dolPrintHTML($label);
528 print
'</td><td class="right">';
529 if ($objexport->array_export_perms[$key]) {
530 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>';
532 print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"NotAllowed"), $langs->trans(
"NotEnoughPermissions")).
'</span>';
537 print
'<tr><td class="oddeven" colspan="3">'.$langs->trans(
"NoExportableData").
'</td></tr>';
545if ($step == 2 && $datatoexport) {
547 if (empty($objexport->array_export_perms[0])) {
551 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step2');
555 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
556 $head[$h][1] = $langs->trans(
"Step").
" 1";
559 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
560 $head[$h][1] = $langs->trans(
"Step").
" 2";
561 $hselected = (string) $h;
567 print
'<div class="fichecenter">';
568 print
'<div class="underbanner clearboth"></div>';
570 print
'<table class="border tableforfield centpercent">';
573 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
575 print $objexport->array_export_module[0]->getName();
579 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
581 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
582 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
583 print img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
584 print $objexport->array_export_label[0];
595 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
596 print
'<input type="hidden" name="token" value="'.newToken().
'">';
597 print
'<input type="hidden" name="action" value="select_model">';
598 print
'<input type="hidden" name="step" value="2">';
599 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
600 print
'<div class="valignmiddle marginbottomonly">';
601 print
'<span class="opacitymedium">'.$langs->trans(
"SelectExportFields").
'</span> ';
602 $htmlother->select_export_model((
string) $exportmodelid,
'exportmodelid', $datatoexport, 1, $user->id);
604 print
'<input type="submit" name="applyprofile" id="applyprofile" class="button smallpaddingimp hidden" value="'.$langs->trans(
"Apply").
'">';
606 if (!empty(
$conf->use_javascript_ajax)) {
608 $(document).ready(function() {
610 $("#applyprofile").hide();
612 // follow change on list
613 $("#exportmodelid").change(function() {
614 console.log("We select a new profile");
615 if ($(this).val() && $(this).val() != "-1") {
616 $("#applyprofile").show();
618 $("#applyprofile").hide();
631 print
'<div class="div-table-responsive-no-min">';
632 print
'<table class="noborder centpercent">';
633 print
'<tr class="liste_titre">';
634 print
'<td>'.$langs->trans(
"Object").
'</td>';
635 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
636 print
'<td width="100" class="center">';
639 if (!$user->hasRight(
'export',
'creer')) {
640 $morecss =
' disabled';
641 $moretitle = $langs->trans(
"NotAllowed");
643 print
'<a class="liste_titre button small nopaddingimp '.$morecss;
644 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");
645 print
' '.img_right($moretitle, 0,
'style="max-width: 20px"');
648 print
'<a class="liste_titre button small nopaddingimp'.$morecss;
649 print
'" title="'.$langs->trans(
"None").($moretitle ?
' - '.$moretitle :
'').
'" href="'.$_SERVER[
"PHP_SELF"].
'?step=2&datatoexport='.urlencode($datatoexport).
'&action=unselectfield&field=all&token='.
newToken().
'">';
650 print
img_left($moretitle, 0,
'style="max-width: 20px"').
' ';
651 print $langs->trans(
"None").
"</a>";
653 print
'<td width="44%">'.$langs->trans(
"ExportedFields").
'</td>';
657 $fieldsarray = $objexport->array_export_fields[0];
659 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
671 foreach ($fieldsarray as $code => $label) {
672 print
'<tr class="oddeven">';
676 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
677 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
678 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
680 print
'<td class="nowraponall">';
684 $tmparray = explode(
':', $entityicon);
685 if (count($tmparray) >= 2) {
686 $entityicon = $tmparray[0];
687 $entitylang = $tmparray[1];
689 print img_object(
'', $entityicon).
' '.$langs->trans((
string) $entitylang);
692 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
693 $tmplabelarray = explode(
':', $label);
694 if (!empty($tmplabelarray[1])) {
695 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
697 $text .= $langs->trans($label);
699 $text .= (empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
702 $htmltext =
'<b>'.$langs->trans(
"Name").
":</b> ".$text.
'<br>';
703 if (!empty($objexport->array_export_special[0][$code])) {
704 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ";
705 if (isset($objexport->array_export_special[0][$code][
'method'])) {
706 $htmltext .= $objexport->array_export_special[0][$code][
'method'];
707 } elseif (!is_array($objexport->array_export_special[0][$code])) {
708 $htmltext .= $objexport->array_export_special[0][$code];
712 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
714 if (!empty($objexport->array_export_examplevalues[0][$code])) {
715 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
717 if (!empty($objexport->array_export_TypeFields[0][$code])) {
718 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
720 if (!empty($objexport->array_export_help[0][$code])) {
721 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
724 if (isset($array_selected[$code]) && $array_selected[$code]) {
726 print
'<td> </td>';
727 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>';
730 print $form->textwithpicto($text, $htmltext);
737 print $form->textwithpicto($text, $htmltext);
740 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>';
741 print
'<td> </td>';
753 print
'<div class="tabsAction tabsActionNoBottom">';
755 if (count($array_selected)) {
757 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
758 print
'<a class="butAction" href="export.php?step=3&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
760 print
'<a class="butAction" href="export.php?step=4&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
763 print
'<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans(
"SelectAtLeastOneField")).
'">'.$langs->trans(
"NextStep").
'</a>';
769if ($step == 3 && $datatoexport) {
770 if (count($array_selected) < 1) {
772 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
777 if (empty($objexport->array_export_perms[0])) {
781 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step3');
785 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
786 $head[$h][1] = $langs->trans(
"Step").
" 1";
789 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
790 $head[$h][1] = $langs->trans(
"Step").
" 2";
793 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
794 $head[$h][1] = $langs->trans(
"Step").
" 3";
795 $hselected = (string) $h;
800 print
'<div class="fichecenter">';
801 print
'<div class="underbanner clearboth"></div>';
802 print
'<table class="border tableforfield centpercent">';
805 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
808 print $objexport->array_export_module[0]->getName();
812 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
814 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
815 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
816 print img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
817 print $objexport->array_export_label[0];
821 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
823 foreach ($array_selected as $code => $value) {
824 if (isset($objexport->array_export_fields[0][$code])) {
825 $list .= (!empty($list) ?
', ' :
'');
827 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
828 if (!empty($tmplabelarray[1])) {
829 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
831 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
835 print
'<td><span class="small">'.$list.
'</span></td>';
844 print
'<span class="opacitymedium">'.$langs->trans(
"SelectFilterFields").
'...</span><br><br>';
848 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'?step=4&action=submitFormField&datatoexport='.$datatoexport.
'" name="FilterField" method="post">';
849 print
'<input type="hidden" name="token" value="'.newToken().
'">';
851 print
'<div class="div-table-responsive-no-min">';
853 print
'<table class="noborder centpercent">';
854 print
'<tr class="liste_titre">';
855 print
'<td>'.$langs->trans(
"Entities").
'</td>';
856 print
'<td>'.$langs->trans(
"ExportableFields").
'</td>';
857 print
'<td width="25%">'.$langs->trans(
"FilteredFieldsValues").
'</td>';
861 $fieldsarray = $objexport->array_export_fields[0];
863 $Typefieldsarray = $objexport->array_export_TypeFields[0];
865 $ValueFiltersarray = (!empty($objexport->array_export_FilterValue[0]) ? $objexport->array_export_FilterValue[0] :
'');
867 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
871 foreach ($fieldsarray as $code => $label) {
872 print
'<tr class="oddeven">';
875 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
876 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
877 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
879 print
'<td class="nowrap">';
881 $tmparray = explode(
':', $entityicon);
882 if (count($tmparray) >= 2) {
883 $entityicon = $tmparray[0];
884 $entitylang = $tmparray[1];
886 print img_object(
'', $entityicon).
' '.$langs->trans((
string) $entitylang);
890 $labelName = (!empty($fieldsarray[$code]) ? $fieldsarray[$code] :
'');
891 $ValueFilter = (!empty($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
893 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
894 $tmplabelarray = explode(
':', $label);
895 if (!empty($tmplabelarray[1])) {
896 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
898 $text .= $langs->trans($label);
900 $text .= (empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
903 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
904 if (!empty($objexport->array_export_special[0][$code])) {
905 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ";
906 if (isset($objexport->array_export_special[0][$code][
'method'])) {
907 $htmltext .= $objexport->array_export_special[0][$code][
'method'];
908 } elseif (!is_array($objexport->array_export_special[0][$code])) {
909 $htmltext .= $objexport->array_export_special[0][$code];
913 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
915 if (!empty($objexport->array_export_examplevalues[0][$code])) {
916 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
918 if (!empty($objexport->array_export_TypeFields[0][$code])) {
919 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
921 if (!empty($objexport->array_export_help[0][$code])) {
922 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
926 print $form->textwithpicto($text, $htmltext);
931 if (!empty($Typefieldsarray[$code])) {
932 $szInfoFiltre = $objexport->genDocFilter($Typefieldsarray[$code]);
934 $tmp = $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
935 print $form->textwithpicto($tmp, $szInfoFiltre);
937 print $objexport->build_filterField($Typefieldsarray[$code], $code, $ValueFilter);
953 print
'<div class="tabsAction tabsActionNoBottom">';
955 print
'<a class="butAction" href="javascript:FilterField.submit();">'.$langs->trans(
"NextStep").
'</a>';
959if ($step == 4 && $datatoexport) {
960 if (count($array_selected) < 1) {
962 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
967 if (empty($objexport->array_export_perms[0])) {
971 asort($array_selected);
973 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step4');
978 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
979 $head[$h][1] = $langs->trans(
"Step").
" 1";
982 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
983 $head[$h][1] = $langs->trans(
"Step").
" 2";
987 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
988 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
989 $head[$h][1] = $langs->trans(
"Step").
" 3";
994 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
995 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
996 $hselected = (string) $h;
999 $titleofmodule = $objexport->array_export_module[0]->getName();
1003 print
'<div class="fichecenter">';
1004 print
'<div class="underbanner clearboth"></div>';
1005 print
'<table width="100%" class="border tableforfield">';
1008 print
'<tr><td class="titlefield tableforfield">'.$langs->trans(
"Module").
'</td>';
1010 print dolPrintHTML($titleofmodule);
1014 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
1016 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
1017 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1018 print img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
1019 print $objexport->array_export_label[0];
1023 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
1025 foreach ($array_selected as $code => $value) {
1026 if (isset($objexport->array_export_fields[0][$code])) {
1027 $list .= (!empty($list) ?
', ' :
'');
1029 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
1030 if (!empty($tmplabelarray[1])) {
1031 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1033 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
1037 print
'<td><span class="small">'.$list.
'</span></td>';
1041 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1042 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
1044 if (!empty($array_filtervalue)) {
1045 foreach ($array_filtervalue as $code => $value) {
1046 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
1052 if (isset($objexport->array_export_fields[0][$code])) {
1053 $list .= ($list ?
', ' :
'');
1054 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
1055 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
1057 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
1062 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
1072 $sqlmaxforexport = $objexport->build_sql(0, array(), array());
1075 print
'<div class="marginbottomonly"><span class="opacitymedium">'.$langs->trans(
"ChooseFieldsOrdersAndTitle").
'</span></div>';
1077 print
'<div class="div-table-responsive-no-min">';
1078 print
'<table class="noborder centpercent">';
1079 print
'<tr class="liste_titre">';
1080 print
'<td>'.$langs->trans(
"Entities").
'</td>';
1081 print
'<td>'.$langs->trans(
"ExportedFields").
'</td>';
1082 print
'<td class="right" colspan="2">'.$langs->trans(
"Position").
'</td>';
1087 foreach ($array_selected as $code => $value) {
1088 if (!isset($objexport->array_export_fields[0][$code])) {
1092 print
'<tr class="oddeven">';
1094 $entity = (!empty($objexport->array_export_entities[0][$code]) ? $objexport->array_export_entities[0][$code] : $objexport->array_export_icon[0]);
1095 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1096 $entitylang = (!empty($entitytolang[$entity]) ? $entitytolang[$entity] : $entity);
1098 print
'<td class="nowrap">';
1100 $tmparray = explode(
':', $entityicon);
1101 if (count($tmparray) >= 2) {
1102 $entityicon = $tmparray[0];
1103 $entitylang = $tmparray[1];
1105 print img_object(
'', $entityicon).
' '.$langs->trans((
string) $entitylang);
1108 $labelName = $objexport->array_export_fields[0][$code];
1110 $text = (empty($objexport->array_export_special[0][$code]) ?
'' :
'<i>');
1111 $tmplabelarray = explode(
':', $labelName);
1112 if (!empty($tmplabelarray[1])) {
1113 $text .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1115 $text .= $langs->trans($labelName);
1117 $text .= (empty($objexport->array_export_special[0][$code]) ?
'' :
'</i>');
1120 $htmltext =
'<b>'.$langs->trans(
"Name").
':</b> '.$text.
'<br>';
1121 if (!empty($objexport->array_export_special[0][$code])) {
1122 $htmltext .=
'<b>'.$langs->trans(
"ComputedField").
" -> ".$langs->trans(
"Method").
" :</b> ";
1123 if (isset($objexport->array_export_special[0][$code][
'method'])) {
1124 $htmltext .= $objexport->array_export_special[0][$code][
'method'];
1125 } elseif (!is_array($objexport->array_export_special[0][$code])) {
1126 $htmltext .= $objexport->array_export_special[0][$code];
1128 $htmltext .=
"<br>";
1130 $htmltext .=
'<b>'.$langs->trans(
"Table").
" -> ".$langs->trans(
"Field").
":</b> ".$tablename.
" -> ".preg_replace(
'/^.*\./',
'', $code).
"<br>";
1132 if (!empty($objexport->array_export_examplevalues[0][$code])) {
1133 $htmltext .=
'<b>'.$langs->trans(
"SourceExample").
':</b> '.$objexport->array_export_examplevalues[0][$code].
'<br>';
1135 if (!empty($objexport->array_export_TypeFields[0][$code])) {
1136 $htmltext .=
'<b>'.$langs->trans(
"Type").
':</b> '.$objexport->array_export_TypeFields[0][$code].
'<br>';
1138 if (!empty($objexport->array_export_help[0][$code])) {
1139 $htmltext .=
'<b>'.$langs->trans(
"Help").
':</b> '.$langs->trans($objexport->array_export_help[0][$code]).
'<br>';
1143 print $form->textwithpicto($text, $htmltext);
1147 print
'<td class="right" width="100">';
1149 print
'</td><td class="center nowraponall" width="40">';
1150 if ($value < count($array_selected)) {
1151 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=downfield&token='.
newToken().
'&field='.$code.
'" class="paddingleft paddingright">'.
img_down().
'</a>';
1154 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=upfield&token='.
newToken().
'&field='.$code.
'" class="paddingleft paddingright">'.
img_up().
'</a>';
1172 print
'<div class="tabsAction">';
1174 if (count($array_selected)) {
1175 print
'<a class="butAction" href="export.php?step='.($step + 1).
'&datatoexport='.$datatoexport.
'">'.$langs->trans(
"NextStep").
'</a>';
1182 if (count($array_selected)) {
1185 print
'<div class="marginbottomonly">';
1186 print
'<span class="opacitymedium">'.$langs->trans(
"SaveExportModel").
'</span>';
1189 print
'<form class="nocellnopadd" action="export.php" method="post">';
1190 print
'<input type="hidden" name="token" value="'.newToken().
'">';
1191 print
'<input type="hidden" name="action" value="add_export_model">';
1192 print
'<input type="hidden" name="step" value="'.$step.
'">';
1193 print
'<input type="hidden" name="datatoexport" value="'.$datatoexport.
'">';
1194 print
'<input type="hidden" name="hexa" value="'.$hexa.
'">';
1195 print
'<input type="hidden" name="page_y" value="">';
1197 print
'<div class="div-table-responsive-no-min">';
1198 print
'<table class="noborder centpercent">';
1199 print
'<tr class="liste_titre">';
1200 print
'<td>'.$langs->trans(
"ExportModelName").
'</td>';
1201 print
'<td>'.$langs->trans(
"Visibility").
'</td>';
1205 $nameofexportprofile = str_replace(
' ',
'-', $langs->trans(
"ExportProfile").
' '.$titleofmodule.
' '.
dol_print_date(
dol_now(
'gmt'),
'dayxcard'));
1207 $nameofexportprofile = $export_name;
1211 print
'<tr class="oddeven">';
1212 print
'<td><input name="export_name" class="minwidth300" value="'.$nameofexportprofile.
'"></td>';
1214 $arrayvisibility = array(
'private' => $langs->trans(
"Private"),
'all' => $langs->trans(
"Everybody"));
1215 print $form->selectarray(
'visibility', $arrayvisibility,
'private');
1217 print
'<td class="right">';
1218 print
'<input type="submit" class="button reposition button-save smallpaddingimp" value="'.$langs->trans(
"Save").
'">';
1221 $tmpuser =
new User($db);
1224 $sql =
"SELECT rowid, label, fk_user, entity";
1225 $sql .=
" FROM ".MAIN_DB_PREFIX.
"export_model";
1226 $sql .=
" WHERE type = '".$db->escape($datatoexport).
"'";
1228 $sql .=
" AND fk_user IN (0, ".((int) $user->id).
")";
1230 $sql .=
" ORDER BY rowid";
1231 $resql = $db->query($sql);
1233 $num = $db->num_rows($resql);
1236 $obj = $db->fetch_object($resql);
1238 print
'<tr class="oddeven"><td>';
1242 if (empty($obj->fk_user)) {
1243 print $langs->trans(
"Everybody");
1245 $tmpuser->fetch($obj->fk_user);
1246 print $tmpuser->getNomUrl(-1);
1249 print
'<td class="right">';
1250 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?step='.$step.
'&datatoexport='.$datatoexport.
'&action=deleteprof&token='.
newToken().
'&id='.$obj->rowid.
'">';
1257 dol_print_error($db);
1267if ($step == 5 && $datatoexport) {
1268 if (count($array_selected) < 1) {
1270 header(
"Location: ".DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport);
1275 if (empty($objexport->array_export_perms[0])) {
1279 asort($array_selected);
1281 llxHeader(
'', $langs->trans(
"NewExport"),
'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones',
'', 0, 0,
'',
'',
'',
'mod-exports page-export action-step5');
1286 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=1';
1287 $head[$h][1] = $langs->trans(
"Step").
" 1";
1290 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=2&datatoexport='.$datatoexport;
1291 $head[$h][1] = $langs->trans(
"Step").
" 2";
1295 if ($usefilters && isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1296 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=3&datatoexport='.$datatoexport;
1297 $head[$h][1] = $langs->trans(
"Step").
" 3";
1302 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=4&datatoexport='.$datatoexport;
1303 $head[$h][1] = $langs->trans(
"Step").
" ".(3 + $stepoffset);
1306 $head[$h][0] = DOL_URL_ROOT.
'/exports/export.php?step=5&datatoexport='.$datatoexport;
1307 $head[$h][1] = $langs->trans(
"Step").
" ".(4 + $stepoffset);
1308 $hselected = (string) $h;
1316 if ($action ==
'remove_file') {
1317 print $form->formconfirm($_SERVER[
"PHP_SELF"].
'?step=5&datatoexport='.$datatoexport.
'&file='.urlencode(
GETPOST(
"file")), $langs->trans(
'DeleteFile'), $langs->trans(
'ConfirmDeleteFile'),
'confirm_deletefile',
'', 0, 1);
1320 print
'<div class="fichecenter">';
1321 print
'<div class="underbanner clearboth"></div>';
1323 print
'<table class="border tableforfield centpercent">';
1326 print
'<tr><td class="titlefield">'.$langs->trans(
"Module").
'</td>';
1329 print $objexport->array_export_module[0]->getName();
1333 print
'<tr><td>'.$langs->trans(
"DatasetToExport").
'</td>';
1335 $entity = preg_replace(
'/:.*$/',
'', $objexport->array_export_icon[0]);
1336 $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
1337 print img_object($objexport->array_export_module[0]->getName(), $entityicon).
' ';
1338 print $objexport->array_export_label[0];
1342 print
'<tr><td>'.$langs->trans(
"ExportedFields").
'</td>';
1344 foreach ($array_selected as $code => $value) {
1345 if (isset($objexport->array_export_fields[0][$code])) {
1346 $list .= (!empty($list) ?
', ' :
'');
1348 $tmplabelarray = explode(
':', $objexport->array_export_fields[0][$code]);
1349 if (!empty($tmplabelarray[1])) {
1350 $list .= $langs->trans($tmplabelarray[0]).
' - '.$langs->trans($tmplabelarray[1]);
1352 $list .= $langs->trans($objexport->array_export_fields[0][$code]);
1356 print
'<td><span class="small">'.$list.
'</span></td>';
1360 if (isset($objexport->array_export_TypeFields[0]) && is_array($objexport->array_export_TypeFields[0])) {
1361 print
'<tr><td>'.$langs->trans(
"FilteredFields").
'</td>';
1363 if (!empty($array_filtervalue)) {
1364 foreach ($array_filtervalue as $code => $value) {
1365 if (preg_match(
'/^FormSelect:/', $objexport->array_export_TypeFields[0][$code])) {
1371 if (isset($objexport->array_export_fields[0][$code])) {
1372 $list .= ($list ?
', ' :
'');
1373 if (isset($array_filtervalue[$code]) && preg_match(
'/^\s*[<>]/', $array_filtervalue[$code])) {
1374 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
'</span>'.(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'');
1376 $list .=
'<span class="opacitymedium">'.$langs->trans($objexport->array_export_fields[0][$code]).
"</span>='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] :
'').
"'";
1381 print
'<td>'.(!empty($list) ? $list :
'<span class="opacitymedium">'.$langs->trans(
"None").
'</span>').
'</td>';
1391 $htmltabloflibs =
'<!-- Table with available export formats --><br>';
1392 $htmltabloflibs .=
'<table class="noborder centpercent nomarginbottom">';
1393 $htmltabloflibs .=
'<tr class="liste_titre">';
1394 $htmltabloflibs .=
'<td>'.$langs->trans(
"AvailableFormats").
'</td>';
1395 $htmltabloflibs .=
'<td>'.$langs->trans(
"LibraryUsed").
'</td>';
1396 $htmltabloflibs .=
'<td class="right">'.$langs->trans(
"LibraryVersion").
'</td>';
1397 $htmltabloflibs .=
'</tr>'.
"\n";
1399 $liste = $objmodelexport->listOfAvailableExportFormat($db);
1401 foreach ($listeall as $key => $val) {
1402 if (preg_match(
'/__\(Disabled\)__/', $listeall[$key])) {
1403 $listeall[$key] = preg_replace(
'/__\(Disabled\)__/',
'('.$langs->transnoentitiesnoconv(
"Disabled").
')', $listeall[$key]);
1404 unset($liste[$key]);
1407 $htmltabloflibs .=
'<tr class="oddeven">';
1408 $htmltabloflibs .=
'<td>'.img_picto_common($key, $objmodelexport->getPictoForKey($key)).
' ';
1409 $text = $objmodelexport->getDriverDescForKey($key);
1410 $label = $listeall[$key];
1412 $htmltabloflibs .= $form->textwithpicto($label, $text).
'</td>';
1413 $htmltabloflibs .=
'<td>'.$objmodelexport->getLibLabelForKey($key).
'</td>';
1414 $htmltabloflibs .=
'<td class="right">'.$objmodelexport->getLibVersionForKey($key).
'</td>';
1415 $htmltabloflibs .=
'</tr>'.
"\n";
1417 $htmltabloflibs .=
'</table><br>';
1420 print
'<div class="info"><span class="">'.$form->textwithpicto($langs->trans(
"NowClickToGenerateToBuildExportFile"), $htmltabloflibs, 1,
'help',
'', 0, 2,
'helphonformat').
'</span></div>';
1426 if ($sqlusedforexport && $user->admin) {
1427 print
info_admin($langs->trans(
"SQLUsedForExport").
':<br><span class="small">'.$sqlusedforexport.
'</span>', 0, 0,
'info',
'',
'TechnicalInformation').
'<br>';
1432 if (!is_dir(
$conf->export->dir_temp)) {
1438 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',
'',
'',
'');
1457 $alias = preg_replace(
'/\.(.*)$/i',
'', $code);
1458 $regexstring =
'/([a-zA-Z_]+) as '.preg_quote($alias).
'[, \)]/i';
1460 $newsql = $sqlmaxforexport;
1461 $newsql = preg_replace(
'/^(.*) FROM /i',
'', $newsql);
1462 $newsql = preg_replace(
'/WHERE (.*)$/i',
'', $newsql);
1465 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.
dol_now($mode='gmt')
Return date for now.
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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)
img_right($titlealt='default', $selected=0, $moreatt='')
Show right arrow logo.
img_left($titlealt='default', $selected=0, $moreatt='')
Show left arrow logo.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
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.
img_up($titlealt='default', $selected=0, $moreclass='')
Show top arrow logo.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $nodie=0, $mode='')
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.