--- /tmp/dsg/dolibarr/htdocs/exports/github_export.php
+++ /tmp/dsg/dolibarr/htdocs/exports/client_export.php
@@ -39,64 +39,63 @@
//if (! $user->admin)
// accessforbidden();
-// Map icons, array duplicated in import.php, was not synchronized, TODO put it somewhere only once
$entitytoicon = array(
'invoice' => 'bill',
- 'invoice_line' => 'bill',
+ 'invoice_line' => 'bill',
'order' => 'order',
- 'order_line' => 'order',
+ 'order_line' => 'order',
'propal' => 'propal',
- 'propal_line' => 'propal',
+ 'propal_line' => 'propal',
'intervention' => 'intervention',
- 'inter_line' => 'intervention',
+ 'inter_line' => 'intervention',
'member' => 'user',
- 'member_type' => 'group',
- 'subscription' => 'payment',
- 'payment' => 'payment',
+ 'member_type' => 'group',
+ 'subscription' => 'payment',
+ 'payment' => 'payment',
'tax' => 'generic',
'tax_type' => 'generic',
+ 'stock' => 'generic',
'other' => 'generic',
'account' => 'account',
'product' => 'product',
- 'virtualproduct'=>'product',
+ 'virtualproduct'=>'product',
'subproduct' => 'product',
'product_supplier_ref' => 'product',
- 'stock' => 'stock',
'warehouse' => 'stock',
'batch' => 'stock',
'stockbatch' => 'stock',
'category' => 'category',
'shipment' => 'sending',
- 'shipment_line'=> 'sending',
- 'reception'=> 'sending',
- 'reception_line'=> 'sending',
+ 'shipment_line'=> 'sending',
+ 'reception'=> 'sending',
+ 'reception_line'=> 'sending',
'expensereport'=> 'trip',
- 'expensereport_line'=> 'trip',
+ 'expensereport_line'=> 'trip',
'holiday' => 'holiday',
- 'contract_line' => 'contract',
- 'translation' => 'generic',
- 'bomm' => 'bom',
- 'bomline' => 'bom'
+ 'contract_line' => 'contract',
+ 'translation' => 'generic',
+ 'bomm' => 'bom',
+ 'bomline' => 'bom'
);
-// Translation code, array duplicated in import.php, was not synchronized, TODO put it somewhere only once
+// Translation code
$entitytolang = array(
'user' => 'User',
'company' => 'Company',
- 'contact' => 'Contact',
+ 'contact' => 'Contact',
'invoice' => 'Bill',
- 'invoice_line' => 'InvoiceLine',
+ 'invoice_line' => 'InvoiceLine',
'order' => 'Order',
- 'order_line' => 'OrderLine',
- 'propal' => 'Proposal',
- 'propal_line' => 'ProposalLine',
+ 'order_line' => 'OrderLine',
+ 'propal' => 'Proposal',
+ 'propal_line' => 'ProposalLine',
'intervention' => 'Intervention',
- 'inter_line' => 'InterLine',
+ 'inter_line' => 'InterLine',
'member' => 'Member',
- 'member_type' => 'MemberType',
- 'subscription' => 'Subscription',
+ 'member_type' => 'MemberType',
+ 'subscription' => 'Subscription',
'tax' => 'SocialContribution',
- 'tax_type' => 'DictionarySocialContributions',
+ 'tax_type' => 'DictionarySocialContributions',
'account' => 'BankTransactions',
'payment' => 'Payment',
'product' => 'Product',
@@ -104,34 +103,34 @@
'subproduct' => 'SubProduct',
'product_supplier_ref' => 'SupplierPrices',
'service' => 'Service',
- 'stock' => 'Stock',
+ 'stock' => 'Stock',
'movement' => 'StockMovement',
'batch' => 'Batch',
'stockbatch' => 'StockDetailPerBatch',
'warehouse' => 'Warehouse',
'category' => 'Category',
'other' => 'Other',
- 'trip' => 'TripsAndExpenses',
- 'shipment' => 'Shipments',
- 'shipment_line'=> 'ShipmentLine',
- 'project' => 'Projects',
- 'projecttask' => 'Tasks',
- 'task_time' => 'TaskTimeSpent',
+ 'trip' => 'TripsAndExpenses',
+ 'shipment' => 'Shipments',
+ 'shipment_line'=> 'ShipmentLine',
+ 'project' => 'Projects',
+ 'projecttask' => 'Tasks',
+ 'task_time' => 'TaskTimeSpent',
'action' => 'Event',
'expensereport'=> 'ExpenseReport',
'expensereport_line'=> 'ExpenseReportLine',
'holiday' => 'TitreRequestCP',
'contract' => 'Contract',
- 'contract_line'=> 'ContractLine',
- 'translation' => 'Translation',
- 'bom' => 'BOM',
- 'bomline' => 'BOMLine'
+ 'contract_line'=> 'ContractLine',
+ 'translation' => 'Translation',
+ 'bom' => 'BOM',
+ 'bomline' => 'BOMLine'
);
$array_selected = isset($_SESSION["export_selected_fields"]) ? $_SESSION["export_selected_fields"] : array();
$array_filtervalue = isset($_SESSION["export_filtered_fields"]) ? $_SESSION["export_filtered_fields"] : array();
$datatoexport = GETPOST("datatoexport", "aZ09");
-$action = GETPOST('action', 'aZ09');
+$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$step = GETPOST("step", "int") ?GETPOST("step", "int") : 1;
$export_name = GETPOST("export_name", "alphanohtml");
@@ -163,131 +162,137 @@
{
$fieldsarray = $objexport->array_export_fields[0];
$fieldsentitiesarray = $objexport->array_export_entities[0];
- $fieldsdependenciesarray = $objexport->array_export_dependencies[0];
-
- if ($field == 'all')
- {
+ $fieldsdependenciesarray = $objexport->array_export_dependencies[0];
+
+ if ($field == 'all')
+ {
foreach ($fieldsarray as $key=>$val)
{
if (!empty($array_selected[$key])) continue; // If already selected, check next
$array_selected[$key] = count($array_selected) + 1;
- //print_r($array_selected);
- $_SESSION["export_selected_fields"] = $array_selected;
- }
- } else {
- $warnings = array();
-
- $array_selected[$field] = count($array_selected) + 1; // We tag the key $field as "selected"
- // We check if there is a dependency to activate
- /*var_dump($field);
+ //print_r($array_selected);
+ $_SESSION["export_selected_fields"] = $array_selected;
+ }
+ }
+ else
+ {
+ $warnings = array();
+
+ $array_selected[$field] = count($array_selected) + 1; // We tag the key $field as "selected"
+ // We check if there is a dependency to activate
+ /*var_dump($field);
var_dump($fieldsentitiesarray[$field]);
var_dump($fieldsdependenciesarray);*/
- $listofdependencies = array();
- if (!empty($fieldsentitiesarray[$field]) && !empty($fieldsdependenciesarray[$fieldsentitiesarray[$field]]))
- {
- // We found a dependency on the type of field
- $tmp = $fieldsdependenciesarray[$fieldsentitiesarray[$field]]; // $fieldsdependenciesarray=array('element'=>'fd.rowid') or array('element'=>array('fd.rowid','ab.rowid'))
- if (is_array($tmp)) $listofdependencies = $tmp;
- else $listofdependencies = array($tmp);
- } elseif (!empty($field) && !empty($fieldsdependenciesarray[$field]))
- {
- // We found a dependency on a dedicated field
- $tmp = $fieldsdependenciesarray[$field]; // $fieldsdependenciesarray=array('fd.fieldx'=>'fd.rowid') or array('fd.fieldx'=>array('fd.rowid','ab.rowid'))
- if (is_array($tmp)) $listofdependencies = $tmp;
- else $listofdependencies = array($tmp);
- }
-
- if (count($listofdependencies))
- {
- foreach ($listofdependencies as $fieldid)
- {
- if (empty($array_selected[$fieldid]))
- {
- $array_selected[$fieldid] = count($array_selected) + 1; // We tag the key $fieldid as "selected"
- $warnings[] = $langs->trans("ExportFieldAutomaticallyAdded", $langs->transnoentitiesnoconv($fieldsarray[$fieldid]));
- }
- }
- }
- //print_r($array_selected);
- $_SESSION["export_selected_fields"] = $array_selected;
-
- setEventMessages($warnings, null, 'warnings');
- }
+ $listofdependencies = array();
+ if (!empty($fieldsentitiesarray[$field]) && !empty($fieldsdependenciesarray[$fieldsentitiesarray[$field]]))
+ {
+ // We found a dependency on the type of field
+ $tmp = $fieldsdependenciesarray[$fieldsentitiesarray[$field]]; // $fieldsdependenciesarray=array('element'=>'fd.rowid') or array('element'=>array('fd.rowid','ab.rowid'))
+ if (is_array($tmp)) $listofdependencies = $tmp;
+ else $listofdependencies = array($tmp);
+ }
+ elseif (!empty($field) && !empty($fieldsdependenciesarray[$field]))
+ {
+ // We found a dependency on a dedicated field
+ $tmp = $fieldsdependenciesarray[$field]; // $fieldsdependenciesarray=array('fd.fieldx'=>'fd.rowid') or array('fd.fieldx'=>array('fd.rowid','ab.rowid'))
+ if (is_array($tmp)) $listofdependencies = $tmp;
+ else $listofdependencies = array($tmp);
+ }
+
+ if (count($listofdependencies))
+ {
+ foreach ($listofdependencies as $fieldid)
+ {
+ if (empty($array_selected[$fieldid]))
+ {
+ $array_selected[$fieldid] = count($array_selected) + 1; // We tag the key $fieldid as "selected"
+ $warnings[] = $langs->trans("ExportFieldAutomaticallyAdded", $langs->transnoentitiesnoconv($fieldsarray[$fieldid]));
+ }
+ }
+ }
+ //print_r($array_selected);
+ $_SESSION["export_selected_fields"] = $array_selected;
+
+ setEventMessages($warnings, null, 'warnings');
+ }
}
if ($action == 'unselectfield')
{
- if ($_GET["field"] == 'all')
- {
+ if ($_GET["field"] == 'all')
+ {
$array_selected = array();
$_SESSION["export_selected_fields"] = $array_selected;
- } else {
- unset($array_selected[$_GET["field"]]);
- // Renumber fields of array_selected (from 1 to nb_elements)
- asort($array_selected);
- $i = 0;
- $array_selected_save = $array_selected;
- foreach ($array_selected as $code=>$value)
- {
- $i++;
- $array_selected[$code] = $i;
- //print "x $code x $i y
";
- }
- $_SESSION["export_selected_fields"] = $array_selected;
- }
+ }
+ else
+ {
+ unset($array_selected[$_GET["field"]]);
+ // Renumber fields of array_selected (from 1 to nb_elements)
+ asort($array_selected);
+ $i = 0;
+ $array_selected_save = $array_selected;
+ foreach ($array_selected as $code=>$value)
+ {
+ $i++;
+ $array_selected[$code] = $i;
+ //print "x $code x $i y
";
+ }
+ $_SESSION["export_selected_fields"] = $array_selected;
+ }
}
if ($action == 'downfield' || $action == 'upfield')
{
- $pos = $array_selected[$_GET["field"]];
- if ($action == 'downfield') $newpos = $pos + 1;
- if ($action == 'upfield') $newpos = $pos - 1;
- // Recherche code avec qui switcher
- $newcode = "";
- foreach ($array_selected as $code=>$value)
- {
- if ($value == $newpos)
- {
- $newcode = $code;
- break;
- }
- }
- //print("Switch pos=$pos (code=".$_GET["field"].") and newpos=$newpos (code=$newcode)");
- if ($newcode) // Si newcode trouve (protection contre resoumission de page)
- {
- $array_selected[$_GET["field"]] = $newpos;
- $array_selected[$newcode] = $pos;
- $_SESSION["export_selected_fields"] = $array_selected;
- }
+ $pos = $array_selected[$_GET["field"]];
+ if ($action == 'downfield') $newpos = $pos + 1;
+ if ($action == 'upfield') $newpos = $pos - 1;
+ // Recherche code avec qui switcher
+ $newcode = "";
+ foreach ($array_selected as $code=>$value)
+ {
+ if ($value == $newpos)
+ {
+ $newcode = $code;
+ break;
+ }
+ }
+ //print("Switch pos=$pos (code=".$_GET["field"].") and newpos=$newpos (code=$newcode)");
+ if ($newcode) // Si newcode trouve (protection contre resoumission de page)
+ {
+ $array_selected[$_GET["field"]] = $newpos;
+ $array_selected[$newcode] = $pos;
+ $_SESSION["export_selected_fields"] = $array_selected;
+ }
}
if ($step == 1 || $action == 'cleanselect')
{
- $_SESSION["export_selected_fields"] = array();
- $_SESSION["export_filtered_fields"] = array();
- $array_selected = array();
- $array_filtervalue = array();
+ $_SESSION["export_selected_fields"] = array();
+ $_SESSION["export_filtered_fields"] = array();
+ $array_selected = array();
+ $array_filtervalue = array();
}
if ($action == 'builddoc')
{
- $max_execution_time_for_importexport = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
- $max_time = @ini_get("max_execution_time");
- if ($max_time && $max_time < $max_execution_time_for_importexport)
- {
- 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.");
- @ini_set("max_execution_time", $max_execution_time_for_importexport); // This work only if safe mode is off. also web servers has timeout of 300
- }
-
- // Build export file
+ $max_execution_time_for_export = (empty($conf->global->EXPORT_MAX_EXECUTION_TIME) ? 300 : $conf->global->EXPORT_MAX_EXECUTION_TIME); // 5mn if not defined
+ $max_time = @ini_get("max_execution_time");
+ if ($max_time && $max_time < $max_execution_time_for_export)
+ {
+ @ini_set("max_execution_time", $max_execution_time_for_export); // This work only if safe mode is off. also web servers has timeout of 300
+ }
+
+ // Build export file
$result = $objexport->build_file($user, GETPOST('model', 'alpha'), $datatoexport, $array_selected, $array_filtervalue);
if ($result < 0)
{
setEventMessages($objexport->error, $objexport->errors, 'errors');
$sqlusedforexport = $objexport->sqlusedforexport;
- } else {
+ }
+ else
+ {
setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs');
- $sqlusedforexport = $objexport->sqlusedforexport;
- }
+ $sqlusedforexport = $objexport->sqlusedforexport;
+ }
}
// Delete file
@@ -304,9 +309,9 @@
if ($action == 'deleteprof')
{
- if (GETPOST("id", 'int'))
+ if ($_GET["id"])
{
- $objexport->fetch(GETPOST('id', 'int'));
+ $objexport->fetch($_GET["id"]);
$result = $objexport->delete($user);
}
}
@@ -336,22 +341,27 @@
}
}
- $objexport->model_name = $export_name;
- $objexport->datatoexport = $datatoexport;
- $objexport->hexa = $hexa;
- $objexport->hexafiltervalue = $hexafiltervalue;
-
- $result = $objexport->create($user);
+ $objexport->model_name = $export_name;
+ $objexport->datatoexport = $datatoexport;
+ $objexport->hexa = $hexa;
+ $objexport->hexafiltervalue = $hexafiltervalue;
+
+ $result = $objexport->create($user);
if ($result >= 0)
{
setEventMessages($langs->trans("ExportModelSaved", $objexport->model_name), null, 'mesgs');
- } else {
+ }
+ else
+ {
$langs->load("errors");
if ($objexport->errno == 'DB_ERROR_RECORD_ALREADY_EXISTS')
setEventMessages($langs->trans("ErrorExportDuplicateProfil"), null, 'errors');
- else setEventMessages($objexport->error, $objexport->errors, 'errors');
- }
- } else {
+ else
+ setEventMessages($objexport->error, $objexport->errors, 'errors');
+ }
+ }
+ else
+ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportModelName")), null, 'errors');
}
}
@@ -359,15 +369,15 @@
// Reload a predefined export model
if ($step == 2 && $action == 'select_model')
{
- $_SESSION["export_selected_fields"] = array();
- $_SESSION["export_filtered_fields"] = array();
-
- $array_selected = array();
- $array_filtervalue = array();
-
- $result = $objexport->fetch($exportmodelid);
- if ($result > 0)
- {
+ $_SESSION["export_selected_fields"] = array();
+ $_SESSION["export_filtered_fields"] = array();
+
+ $array_selected = array();
+ $array_filtervalue = array();
+
+ $result = $objexport->fetch($exportmodelid);
+ if ($result > 0)
+ {
$fieldsarray = preg_split("/,(?! [^(]*\))/", $objexport->hexa);
$i = 1;
foreach ($fieldsarray as $val)
@@ -386,7 +396,7 @@
$i++;
}
$_SESSION["export_filtered_fields"] = $array_filtervalue;
- }
+ }
}
// Get form with filters
@@ -421,142 +431,148 @@
if ($step == 1 || !$datatoexport)
{
- llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones');
-
- $h = 0;
-
- $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1';
- $head[$h][1] = $langs->trans("Step")." 1";
- $hselected = $h;
- $h++;
-
- print dol_get_fiche_head($head, $hselected, '', -1);
-
- print '
'.$langs->trans("Module").' | '; - print ''.$langs->trans("ExportableDatas").' | '; - print ''; - print ' | |||||||||
'; - //print img_object($objexport->array_export_module[$key]->getName(),$export->array_export_module[$key]->picto).' '; - print $objexport->array_export_module[$key]->getName(); - print ' | ';
- $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[$key]);
- $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
+ llxHeader('', $langs->trans("NewExport"), 'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones');
+
+ $h = 0;
+
+ $head[$h][0] = DOL_URL_ROOT.'/exports/export.php?step=1';
+ $head[$h][1] = $langs->trans("Step")." 1";
+ $hselected = $h;
+ $h++;
+
+ dol_fiche_head($head, $hselected, $langs->trans("NewExport"), -1);
+
+
+ print ' '.$langs->trans("SelectExportDataSet").' '; + + // Affiche les modules d'exports + print ' '; // You can use div-table-responsive-no-min if you dont need reserved height for your table
+ print ' ';
-
- print '';
+ //print $value.'-'.$icon.'-'.$label."
"; + print img_object($objexport->array_export_module[$key]->getName(), $icon).' '; + print $label; + print ' | '; + if ($objexport->array_export_perms[$key]) + { + print ''.img_picto($langs->trans("NewExport"), 'filenew').''; + } + else + { + print $langs->trans("NotEnoughPermissions"); + } + print ' | |||||||||
'.$langs->trans("NoExportableData").' |
'.$langs->trans("Module").' | '; - print ''; - print $objexport->array_export_module[0]->getName(); - print ' |
'.$langs->trans("Module").' | '; + print ''; + //print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' '; + print $objexport->array_export_module[0]->getName(); + print ' |
'.$langs->trans("DatasetToExport").' | '; print '';
- $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
- $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
- print img_object($objexport->array_export_module[0]->getName(), $entityicon).' ';
- print $objexport->array_export_label[0];
+ $icon = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
+ $label = $objexport->array_export_label[0];
+ //print $value.'-'.$icon.'-'.$label." "; + print img_object($objexport->array_export_module[0]->getName(), $icon).' '; + print $label; print ' |
'.$langs->trans("Entities").' | '; - print ''.$langs->trans("ExportableFields").' | '; - print ''; - print ''.$langs->trans("All").""; - print ' / '; - print ''.$langs->trans("None").""; - print ' | '; - print ''.$langs->trans("ExportedFields").' | '; - print ''.$langs->trans("ExportableFields").' | '; + print ''; + print ''.$langs->trans("All").""; + print ' / '; + print ''.$langs->trans("None").""; + print ' | '; + print ''.$langs->trans("ExportedFields").' | '; + print ''; + + // Champs exportables + $fieldsarray = $objexport->array_export_fields[0]; + // Select request if all fields are selected + $sqlmaxforexport = $objexport->build_sql(0, array(), array()); // $this->array_export_module[0]=$module; // $this->array_export_code[0]=$module->export_code[$r]; @@ -566,48 +582,50 @@ // $this->array_export_entities[0]=$module->export_fields_entities[$r]; // $this->array_export_alias[0]=$module->export_fields_alias[$r]; - $i = 0; - - foreach ($fieldsarray as $code=>$label) - { - print '||||
'; - // If value of entityicon=entitylang='icon:Label' - //print $code.'-'.$label.'-'.$entity; - - $tmparray = explode(':', $entityicon); - if (count($tmparray) >= 2) - { - $entityicon = $tmparray[0]; - $entitylang = $tmparray[1]; - } - print img_object('', $entityicon).' '.$langs->trans($entitylang); - print ' | '; - - $text = (empty($objexport->array_export_special[0][$code]) ? '' : '').$langs->trans($label).(empty($objexport->array_export_special[0][$code]) ? '' : ''); - - $tablename = getablenamefromfield($code, $sqlmaxforexport); - $htmltext = ''.$langs->trans("Name").": ".$text.'||||||||||
'; + // If value of entityicon=entitylang='icon:Label' + //print $code.'-'.$label.'-'.$entity; + + $tmparray = explode(':', $entityicon); + if (count($tmparray) >= 2) + { + $entityicon = $tmparray[0]; + $entitylang = $tmparray[1]; + } + print img_object('', $entityicon).' '.$langs->trans($entitylang); + print ' | '; + + $text = (empty($objexport->array_export_special[0][$code]) ? '' : '').$langs->trans($label).(empty($objexport->array_export_special[0][$code]) ? '' : ''); + + $tablename = getablenamefromfield($code, $sqlmaxforexport); + $htmltext = ''.$langs->trans("Name").": ".$text.''; - print ' | '.img_left('default', 0, 'style="max-width: 20px"').' | '; - print ''; + { + // Selected fields + print ' | '; + print ' | '.img_left('default', 0, 'style="max-width: 20px"').' | '; + print '';
+ //print $text.'-'.$htmltext." "; + print $form->textwithpicto($text, $htmltext); + //print ' ('.$code.')'; + print ' | ';
+ }
+ else
+ {
+ // Fields not selected
+ print '';
//print $text.'-'.$htmltext." "; print $form->textwithpicto($text, $htmltext); //print ' ('.$code.')'; - print ' | ';
- } else {
- // Fields not selected
- print '';
- //print $text.'-'.$htmltext." "; - print $form->textwithpicto($text, $htmltext); - //print ' ('.$code.')'; - print ' | ';
- print ''.img_right('default', 0, 'style="max-width: 20px"').' | '; - print ''; - } - - print ' |
'.$langs->trans("DatasetToExport").' | '; print '';
- $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
- $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity);
- print img_object($objexport->array_export_module[0]->getName(), $entityicon).' ';
- print $objexport->array_export_label[0];
+ $icon = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]);
+ $label = $objexport->array_export_label[0];
+ //print $value.'-'.$icon.'-'.$label." "; + print img_object($objexport->array_export_module[0]->getName(), $icon).' '; + print $label; print ' |
'.$langs->trans("Entities").' | '; //print ''.$langs->trans("ExportableFields").' | '; @@ -782,19 +807,21 @@ $tablename = getablenamefromfield($code, $sqlmaxforexport); $htmltext = ''.$langs->trans("Name").': '.$text.'
'.$langs->trans("Module").' | '; - print ''; - //print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' '; - print $objexport->array_export_module[0]->getName(); - print ' |
'.$langs->trans("Module").' | '; + print ''; + //print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' '; + print $objexport->array_export_module[0]->getName(); + print ' |
'.$langs->trans("DatasetToExport").' | '; print ''; - $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]); - $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity); - print img_object($objexport->array_export_module[0]->getName(), $entityicon).' '; + $icon = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]); + print img_object($objexport->array_export_module[0]->getName(), $icon).' '; print $objexport->array_export_label[0]; print ' |
'.$langs->trans("ExportedFields").' | '; - $list = ''; - foreach ($array_selected as $code=>$value) - { - $list .= (!empty($list) ? ', ' : ''); - $list .= $langs->trans($objexport->array_export_fields[0][$code]); - } - print ''.$list.' | '; - print '
'.$langs->trans("FilteredFields").' | '; - $list = ''; - if (!empty($array_filtervalue)) - { - foreach ($array_filtervalue as $code=>$value) - { - if (isset($objexport->array_export_fields[0][$code])) - { - $list .= ($list ? ', ' : ''); - if (isset($array_filtervalue[$code]) && preg_match('/^\s*[<>]/', $array_filtervalue[$code])) $list .= $langs->trans($objexport->array_export_fields[0][$code]).(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : ''); - else $list .= $langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : '')."'"; - } - } - } - print ''.(!empty($list) ? $list : ''.$langs->trans("None").'').' | '; - print '
'.$langs->trans("Entities").' | '; - print ''.$langs->trans("ExportedFields").' | '; - print ''.$langs->trans("Position").' | '; - //print ''; - //print ' | '.$langs->trans("FieldsTitle").' | '; - print '|
'; - // If value of entityicon=entitylang='icon:Label' - $tmparray = explode(':', $entityicon); - if (count($tmparray) >= 2) - { - $entityicon = $tmparray[0]; - $entitylang = $tmparray[1]; - } - print img_object('', $entityicon).' '.$langs->trans($entitylang); - print ' | '; - - $labelName = $objexport->array_export_fields[0][$code]; + // List of exported fields + print '|||||
'.$langs->trans("ExportedFields").' | '; + $list = ''; + foreach ($array_selected as $code=>$value) + { + $list .= (!empty($list) ? ', ' : ''); + $list .= $langs->trans($objexport->array_export_fields[0][$code]); + } + print ''.$list.' | '; + print '||||
'.$langs->trans("FilteredFields").' | '; + $list = ''; + if (!empty($array_filtervalue)) + { + foreach ($array_filtervalue as $code=>$value) + { + if (isset($objexport->array_export_fields[0][$code])) + { + $list .= ($list ? ', ' : ''); + if (isset($array_filtervalue[$code]) && preg_match('/^\s*[<>]/', $array_filtervalue[$code])) $list .= $langs->trans($objexport->array_export_fields[0][$code]).(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : ''); + else $list .= $langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : '')."'"; + } + } + } + print ''.(!empty($list) ? $list : ''.$langs->trans("None").'').' | '; + print '
'.$langs->trans("Entities").' | '; + print ''.$langs->trans("ExportedFields").' | '; + print ''.$langs->trans("Position").' | '; + //print ''; + //print ' | '.$langs->trans("FieldsTitle").' | '; + print '||
'; + // If value of entityicon=entitylang='icon:Label' + $tmparray = explode(':', $entityicon); + if (count($tmparray) >= 2) + { + $entityicon = $tmparray[0]; + $entitylang = $tmparray[1]; + } + print img_object('', $entityicon).' '.$langs->trans($entitylang); + print ' | '; + + $labelName = $objexport->array_export_fields[0][$code]; $text = (empty($objexport->array_export_special[0][$code]) ? '' : '').$langs->trans($labelName).(empty($objexport->array_export_special[0][$code]) ? '' : ''); - $tablename = getablenamefromfield($code, $sqlmaxforexport); - $htmltext = ''.$langs->trans("Name").': '.$text.'';
- print $form->textwithpicto($text, $htmltext);
+ $tablename = getablenamefromfield($code, $sqlmaxforexport);
+ $htmltext = ''.$langs->trans("Name").': '.$text.' '; + if (!empty($objexport->array_export_special[0][$code])) + { + $htmltext .= ''.$langs->trans("ComputedField")." -> ".$langs->trans("Method")." : ".$objexport->array_export_special[0][$code]." "; + } + else + { + $htmltext .= ''.$langs->trans("Table")." -> ".$langs->trans("Field").": ".$tablename." -> ".preg_replace('/^.*\./', '', $code)." "; + } + if (!empty($objexport->array_export_examplevalues[0][$code])) + { + $htmltext .= ''.$langs->trans("SourceExample").': '.$objexport->array_export_examplevalues[0][$code].' '; + } + if (!empty($objexport->array_export_TypeFields[0][$code])) + { + $htmltext .= ''.$langs->trans("Type").': '.$objexport->array_export_TypeFields[0][$code].' '; + } + if (!empty($objexport->array_export_help[0][$code])) + { + $htmltext .= ''.$langs->trans("Help").': '.$langs->trans($objexport->array_export_help[0][$code]).' '; + } + + print ' | '; + print $form->textwithpicto($text, $htmltext); //print ' ('.$code.')'; - print ' | '; - - print ''; - print $value.' '; - print ' | '; - if ($value < count($array_selected)) print ''.img_down().''; - if ($value > 1) print ''.img_up().''; - print ' | '; - - //print ''; - //print ' | '.$langs->trans($objexport->array_export_fields[0][$code]).' | '; - - print '
'.$langs->trans("Module").' | '; - print ''; - //print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' '; - print $objexport->array_export_module[0]->getName(); - print ' |
'.$langs->trans("Module").' | '; + print ''; + //print img_object($objexport->array_export_module[0]->getName(),$objexport->array_export_module[0]->picto).' '; + print $objexport->array_export_module[0]->getName(); + print ' |
'.$langs->trans("DatasetToExport").' | '; print ''; - $entity = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]); - $entityicon = strtolower(!empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity); - print img_object($objexport->array_export_module[0]->getName(), $entityicon).' '; + $icon = preg_replace('/:.*$/', '', $objexport->array_export_icon[0]); + print img_object($objexport->array_export_module[0]->getName(), $icon).' '; print $objexport->array_export_label[0]; print ' |
'.$langs->trans("ExportedFields").' | '; - $list = ''; - foreach ($array_selected as $code=>$label) - { - $list .= (!empty($list) ? ', ' : ''); - $list .= $langs->trans($objexport->array_export_fields[0][$code]); - } - print ''.$list.' |
'.$langs->trans("FilteredFields").' | '; - $list = ''; - if (!empty($array_filtervalue)) - { - foreach ($array_filtervalue as $code=>$value) - { - if (isset($objexport->array_export_fields[0][$code])) - { - $list .= ($list ? ', ' : ''); - if (isset($array_filtervalue[$code]) && preg_match('/^\s*[<>]/', $array_filtervalue[$code])) $list .= $langs->trans($objexport->array_export_fields[0][$code]).(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : ''); - else $list .= $langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code]) ? $array_filtervalue[$code] : '')."'"; - } - } - } - print ''.(!empty($list) ? $list : ''.$langs->trans("None").'').' | '; - print '
'.$langs->trans("AvailableFormats").' | '; - $htmltabloflibs .= ''.$langs->trans("LibraryUsed").' | '; - $htmltabloflibs .= ''.$langs->trans("LibraryVersion").' | '; - $htmltabloflibs .= '
'.img_picto_common($key, $objmodelexport->getPictoForKey($key)).' '; - $text = $objmodelexport->getDriverDescForKey($key); - $label = $listeall[$key]; - $htmltabloflibs .= $form->textwithpicto($label, $text).' | '; - $htmltabloflibs .= ''.$objmodelexport->getLibLabelForKey($key).' | '; - $htmltabloflibs .= ''.$objmodelexport->getLibVersionForKey($key).' | '; - $htmltabloflibs .= '
'.$langs->trans("AvailableFormats").' | '; + $htmltabloflibs .= ''.$langs->trans("LibraryUsed").' | '; + $htmltabloflibs .= ''.$langs->trans("LibraryVersion").' | '; + $htmltabloflibs .= '
'.img_picto_common($key, $objmodelexport->getPictoForKey($key)).' '; + $text = $objmodelexport->getDriverDescForKey($key); + $label = $listeall[$key]; + $htmltabloflibs .= $form->textwithpicto($label, $text).' | '; + $htmltabloflibs .= ''.$objmodelexport->getLibLabelForKey($key).' | '; + $htmltabloflibs .= ''.$objmodelexport->getLibVersionForKey($key).' | '; + $htmltabloflibs .= '