Work on import module
This commit is contained in:
parent
b52944dd35
commit
80d4b9b26c
@ -701,7 +701,7 @@ if ($step == 4 && $datatoexport)
|
||||
print '<td colspan="2">'.$langs->trans("AvailableFormats").'</td>';
|
||||
print '<td>'.$langs->trans("LibraryUsed").'</td>';
|
||||
print '<td align="right">'.$langs->trans("LibraryVersion").'</td>';
|
||||
print '</tr>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
$liste=$objmodelexport->liste_modeles($db);
|
||||
foreach($liste as $key)
|
||||
@ -709,7 +709,9 @@ if ($step == 4 && $datatoexport)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td width="16">'.img_picto_common($key,$objmodelexport->getPicto($key)).'</td>';
|
||||
print '<td>'.$objmodelexport->getDriverLabel($key).'</td><td>'.$objmodelexport->getLibLabel($key).'</td><td align="right">'.$objmodelexport->getLibVersion($key).'</td></tr>';
|
||||
$text=$objmodelexport->getDriverDesc($key);
|
||||
print '<td>'.$html->textwithpicto($objmodelexport->getDriverLabel($key),$text).'</td>';
|
||||
print '<td>'.$objmodelexport->getLibLabel($key).'</td><td align="right">'.$objmodelexport->getLibVersion($key).'</td></tr>'."\n";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -41,6 +41,8 @@ $export->load_arrays($user);
|
||||
* View
|
||||
*/
|
||||
|
||||
$html=new Form($db);
|
||||
|
||||
llxHeader('',$langs->trans("ExportsArea"),'EN:Module_Exports_En|FR:Module_Exports|ES:Módulo_Exportaciones');
|
||||
|
||||
print_fiche_titre($langs->trans("ExportsArea"));
|
||||
@ -73,7 +75,8 @@ foreach($liste as $key)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td width="16">'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).'</td>';
|
||||
print '<td>'.dol_trunc($model->getDriverLabel($key),24).'</td>';
|
||||
$text=$model->getDriverDesc($key);
|
||||
print '<td>'.$html->textwithpicto($model->getDriverLabel($key),$text).'</td>';
|
||||
print '<td>'.$model->getLibLabel($key).'</td>';
|
||||
print '<td nowrap="nowrap" align="right">'.$model->getLibVersion($key).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -72,9 +72,9 @@ class Form
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Affiche un texte+picto avec tooltip sur texte ou sur picto
|
||||
* \brief Show a text and picto with tooltip on text or picto
|
||||
* \param text Texte a afficher
|
||||
* \param htmltext Contenu html du tooltip, code en html
|
||||
* \param htmltext Contenu html du tooltip, code en Html / UTF8
|
||||
* \param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2, 4=tooltip sur les 2 et force en Ajax
|
||||
* \param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est apres
|
||||
* \param img Code img du picto
|
||||
@ -93,11 +93,12 @@ class Form
|
||||
$paramfortooltippicto ='';
|
||||
|
||||
// Sanitize tooltip
|
||||
$htmltext=ereg_replace("'","\'",$htmltext);
|
||||
$htmltext=ereg_replace("'","\'",$htmltext);
|
||||
$htmltext=ereg_replace("\r","",$htmltext);
|
||||
$htmltext=ereg_replace("<br>\n","<br>",$htmltext);
|
||||
$htmltext=ereg_replace("\n","",$htmltext);
|
||||
$htmltext=str_replace("\\","\\\\",$htmltext);
|
||||
$htmltext=str_replace("'","\'",$htmltext);
|
||||
$htmltext=str_replace("'","\'",$htmltext);
|
||||
$htmltext=str_replace("\r","",$htmltext);
|
||||
$htmltext=str_replace("<br>\n","<br>",$htmltext);
|
||||
$htmltext=str_replace("\n","",$htmltext);
|
||||
|
||||
if ($conf->use_javascript_ajax && $tooltipon == 4)
|
||||
{
|
||||
@ -116,7 +117,7 @@ class Form
|
||||
{
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
$htmltext=eregi_replace('"',"\'",$htmltext);
|
||||
$htmltext=eregi_replace('"',""",$htmltext);
|
||||
if ($tooltipon==1 || $tooltipon==3)
|
||||
{
|
||||
$paramfortooltiptext.=' onmouseover="showtip(\''.$htmltext.'\')"';
|
||||
|
||||
@ -709,7 +709,7 @@ if ($step == 4 && $datatoimport)
|
||||
foreach($fieldstarget as $code=>$label)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr class="liste_total" height="20">';
|
||||
print '<tr '.$bc[$var].' height="20">';
|
||||
|
||||
$i++;
|
||||
|
||||
@ -717,8 +717,13 @@ if ($step == 4 && $datatoimport)
|
||||
$entityicon=$entitytoicon[$entity]?$entitytoicon[$entity]:$entity;
|
||||
$entitylang=$entitytolang[$entity]?$entitytolang[$entity]:$entity;
|
||||
|
||||
print '<td nowrap="nowrap" style="font-weight: normal">'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>';
|
||||
print '<td style="font-weight: normal">'.$langs->trans($label).' ('.$code.')</td>';
|
||||
print '<td nowrap="nowrap" style="font-weight: normal">=>'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>';
|
||||
print '<td style="font-weight: normal">';
|
||||
$text=$langs->trans($label);
|
||||
if (eregi('\*$',$label)) $text='<b>'.$text.'</b>';
|
||||
$htmltext=$langs->trans("Table").": ?<br>".$langs->trans("Field").': '.$code;
|
||||
print $html->textwithpicto($text,$htmltext);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
$save_select.=$bit;
|
||||
@ -740,7 +745,7 @@ if ($step == 4 && $datatoimport)
|
||||
{
|
||||
if (empty($fieldsplaced[$key]))
|
||||
{
|
||||
$var=!$var;
|
||||
//$var=!$var;
|
||||
$nbofnotimportedfields++;
|
||||
show_elem($fieldssource,$lefti,$key,'',$var);
|
||||
//print '> '.$lefti.'-'.$key;
|
||||
@ -855,8 +860,8 @@ if ($step == 4 && $datatoimport)
|
||||
print '</tr>';
|
||||
$var=false;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td><input name="import_name" size="32" value=""></td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
||||
print '<td><input name="import_name" size="48" value=""></td><td align="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("SaveImportProfile").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// List of existing import profils
|
||||
@ -1001,7 +1006,7 @@ function show_elem($fieldssource,$i,$pos,$key,$var)
|
||||
print '<div style="padding: 0px 0px 0px 0px;" id="boxto_'.$pos.'">'."\n";
|
||||
|
||||
print '<table summary="boxtable'.$pos.'" width="100%" class="nobordernopadding">'."\n";
|
||||
print '<tr class="liste_total" height="20">';
|
||||
print '<tr '.$bc[$var].' height="20">';
|
||||
if ($pos && $pos > sizeof($fieldssource)) // NoFields
|
||||
{
|
||||
print '<td class="nocellnopadding" width="16" style="font-weight: normal">';
|
||||
|
||||
@ -39,6 +39,8 @@ $import->load_arrays($user);
|
||||
* View
|
||||
*/
|
||||
|
||||
$html=new Form($db);
|
||||
|
||||
llxHeader('',$langs->trans("ImportArea"),'EN:Module_Imports_En|FR:Module_Imports|ES:Módulo_Importaciones');
|
||||
|
||||
print_fiche_titre($langs->trans("ImportArea"));
|
||||
@ -70,7 +72,8 @@ foreach($liste as $key)
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td width="16">'.img_picto_common($model->getDriverLabel($key),$model->getPicto($key)).'</td>';
|
||||
print '<td>'.dol_trunc($model->getDriverLabel($key),24).'</td>';
|
||||
$text=$model->getDriverDesc($key);
|
||||
print '<td>'.$html->textwithpicto($model->getDriverLabel($key),$text).'</td>';
|
||||
print '<td>'.$model->getLibLabel($key).'</td>';
|
||||
print '<td nowrap="nowrap" align="right">'.$model->getLibVersion($key).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
* or see http://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/includes/modules/export/export_csv.modules.php
|
||||
@ -34,93 +34,99 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/export/modules_export.php");
|
||||
*/
|
||||
class ExportCsv extends ModeleExports
|
||||
{
|
||||
var $id;
|
||||
var $label;
|
||||
var $extension;
|
||||
var $version;
|
||||
var $id;
|
||||
var $label;
|
||||
var $extension;
|
||||
var $version;
|
||||
|
||||
var $label_lib;
|
||||
var $version_lib;
|
||||
var $label_lib;
|
||||
var $version_lib;
|
||||
|
||||
var $separator;
|
||||
var $separator;
|
||||
|
||||
var $handle; // Handle fichier
|
||||
var $handle; // Handle fichier
|
||||
|
||||
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param db Handler acces base de donnee
|
||||
*/
|
||||
function ExportCsv($db)
|
||||
{
|
||||
global $conf;
|
||||
$this->db = $db;
|
||||
/**
|
||||
* \brief Constructeur
|
||||
* \param db Handler acces base de donnee
|
||||
*/
|
||||
function ExportCsv($db)
|
||||
{
|
||||
global $conf;
|
||||
$this->db = $db;
|
||||
|
||||
$this->separator=',';
|
||||
if (! empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->EXPORT_CSV_SEPARATOR_TO_USE;
|
||||
$this->escape="\\";
|
||||
$this->string='"';
|
||||
$this->separator=',';
|
||||
if (! empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->EXPORT_CSV_SEPARATOR_TO_USE;
|
||||
$this->escape='"';
|
||||
$this->string='"';
|
||||
|
||||
$this->id='csv'; // Same value then xxx in file name export_xxx.modules.php
|
||||
$this->label='Csv (Comma Separated Value, separator="'.$this->separator.'")'; // Label of driver
|
||||
$this->extension='csv'; // Extension for generated file by this driver
|
||||
$this->picto='mime/other'; // Picto
|
||||
$ver=split(' ','$Revision$');
|
||||
$this->version=$ver[2]; // Driver version
|
||||
$this->id='csv'; // Same value then xxx in file name export_xxx.modules.php
|
||||
$this->label='Csv'; // Label of driver
|
||||
$this->desc='<b>Comma Separated Value</b> file format (.csv). This is a text file format.<br>Fields are separated by separator [ '.$this->separator.' ]. If separator is found inside a field content, field is rounded by round character [ '.$this->string.' ]. Escape character to escape round character is [ '.$this->escape.' ].';
|
||||
$this->extension='csv'; // Extension for generated file by this driver
|
||||
$this->picto='mime/other'; // Picto
|
||||
$ver=split(' ','$Revision$');
|
||||
$this->version=$ver[2]; // Driver version
|
||||
|
||||
// If driver use an external library, put its name here
|
||||
$this->label_lib='Dolibarr';
|
||||
$this->version_lib=DOL_VERSION;
|
||||
// If driver use an external library, put its name here
|
||||
$this->label_lib='Dolibarr';
|
||||
$this->version_lib=DOL_VERSION;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function getDriverId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
function getDriverId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
function getDriverLabel()
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
function getDriverLabel()
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
function getDriverExtension()
|
||||
{
|
||||
return $this->extension;
|
||||
}
|
||||
function getDriverDesc()
|
||||
{
|
||||
return $this->desc;
|
||||
}
|
||||
|
||||
function getDriverVersion()
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
function getDriverExtension()
|
||||
{
|
||||
return $this->extension;
|
||||
}
|
||||
|
||||
function getLibLabel()
|
||||
{
|
||||
return $this->label_lib;
|
||||
}
|
||||
function getDriverVersion()
|
||||
{
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
function getLibVersion()
|
||||
{
|
||||
return $this->version_lib;
|
||||
}
|
||||
function getLibLabel()
|
||||
{
|
||||
return $this->label_lib;
|
||||
}
|
||||
|
||||
function getLibVersion()
|
||||
{
|
||||
return $this->version_lib;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Open output file
|
||||
/**
|
||||
* \brief Open output file
|
||||
* \param file Path of filename
|
||||
* \return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
function open_file($file,$outputlangs)
|
||||
{
|
||||
global $langs;
|
||||
{
|
||||
global $langs;
|
||||
|
||||
dol_syslog("ExportCsv::open_file file=".$file);
|
||||
dol_syslog("ExportCsv::open_file file=".$file);
|
||||
|
||||
$ret=1;
|
||||
|
||||
$outputlangs->load("exports");
|
||||
$outputlangs->load("exports");
|
||||
$this->handle = fopen($file, "wt");
|
||||
if (! $this->handle)
|
||||
if (! $this->handle)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans("ErrorFailToCreateFile",$file);
|
||||
@ -134,115 +140,115 @@ class ExportCsv extends ModeleExports
|
||||
* \brief Output header into file
|
||||
* \param langs Output language
|
||||
*/
|
||||
function write_header($outputlangs)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
function write_header($outputlangs)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Output title line into file
|
||||
* \param langs Output language
|
||||
*/
|
||||
function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET))
|
||||
{
|
||||
$outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET;
|
||||
}
|
||||
else
|
||||
{
|
||||
$outputlangs->charset_output = 'ISO-8859-1';
|
||||
}
|
||||
if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET))
|
||||
{
|
||||
$outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET;
|
||||
}
|
||||
else
|
||||
{
|
||||
$outputlangs->charset_output = 'ISO-8859-1';
|
||||
}
|
||||
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
$newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]);
|
||||
$newvalue=$this->csv_clean($newvalue);
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
$newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]);
|
||||
$newvalue=$this->csv_clean($newvalue);
|
||||
|
||||
fwrite($this->handle,$newvalue.$this->separator);
|
||||
}
|
||||
fwrite($this->handle,"\n");
|
||||
return 0;
|
||||
}
|
||||
fwrite($this->handle,$newvalue.$this->separator);
|
||||
}
|
||||
fwrite($this->handle,"\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief Output record line into file
|
||||
*/
|
||||
function write_record($array_alias,$array_selected_sorted,$objp,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
function write_record($array_alias,$array_selected_sorted,$objp,$outputlangs)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET))
|
||||
{
|
||||
$outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET;
|
||||
}
|
||||
else
|
||||
{
|
||||
$outputlangs->charset_output = 'ISO-8859-1';
|
||||
}
|
||||
if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET))
|
||||
{
|
||||
$outputlangs->charset_output = $conf->global->EXPORT_CSV_FORCE_CHARSET;
|
||||
}
|
||||
else
|
||||
{
|
||||
$outputlangs->charset_output = 'ISO-8859-1';
|
||||
}
|
||||
|
||||
$this->col=0;
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
$alias=$array_alias[$code];
|
||||
if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
|
||||
$newvalue=$outputlangs->convToOutputCharset($objp->$alias);
|
||||
$this->col=0;
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
$alias=$array_alias[$code];
|
||||
if (empty($alias)) dol_print_error('','Bad value for field with code='.$code.'. Try to redefine export.');
|
||||
$newvalue=$outputlangs->convToOutputCharset($objp->$alias);
|
||||
|
||||
// Translation newvalue
|
||||
if (eregi('^\((.*)\)$',$newvalue,$reg))
|
||||
{
|
||||
$newvalue=$outputlangs->transnoentities($reg[1]);
|
||||
}
|
||||
// Translation newvalue
|
||||
if (eregi('^\((.*)\)$',$newvalue,$reg))
|
||||
{
|
||||
$newvalue=$outputlangs->transnoentities($reg[1]);
|
||||
}
|
||||
|
||||
$newvalue=$this->csv_clean($newvalue);
|
||||
$newvalue=$this->csv_clean($newvalue);
|
||||
|
||||
fwrite($this->handle,$newvalue.$this->separator);
|
||||
$this->col++;
|
||||
}
|
||||
fwrite($this->handle,$newvalue.$this->separator);
|
||||
$this->col++;
|
||||
}
|
||||
|
||||
fwrite($this->handle,"\n");
|
||||
return 0;
|
||||
}
|
||||
fwrite($this->handle,"\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Output footer into file
|
||||
* \param outputlangs Output language
|
||||
*/
|
||||
function write_footer($outputlangs)
|
||||
{
|
||||
function write_footer($outputlangs)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Close file handle
|
||||
*/
|
||||
function close_file()
|
||||
{
|
||||
fclose($this->handle);
|
||||
return 0;
|
||||
}
|
||||
function close_file()
|
||||
{
|
||||
fclose($this->handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean a cell to respect rules of CSV file cells
|
||||
* @param newvalue String to clean
|
||||
* @return string Value cleaned
|
||||
*/
|
||||
function csv_clean($newvalue)
|
||||
{
|
||||
$addquote=0;
|
||||
/**
|
||||
* Clean a cell to respect rules of CSV file cells
|
||||
* @param newvalue String to clean
|
||||
* @return string Value cleaned
|
||||
*/
|
||||
function csv_clean($newvalue)
|
||||
{
|
||||
$addquote=0;
|
||||
|
||||
// Rule Dolibarr: No HTML
|
||||
$newvalue=dol_string_nohtmltag($newvalue);
|
||||
|
||||
// Rule 1 CSV: No CR, LF in cells
|
||||
$newvalue=ereg_replace("\r",'',$newvalue);
|
||||
$newvalue=ereg_replace("\n",'\n',$newvalue);
|
||||
$newvalue=ereg_replace("\r",'',$newvalue);
|
||||
$newvalue=ereg_replace("\n",'\n',$newvalue);
|
||||
|
||||
// Rule 2 CSV: If value contains ", we must duplicate ", and add "
|
||||
// Rule 2 CSV: If value contains ", we must escape with ", and add "
|
||||
if (ereg('"',$newvalue))
|
||||
{
|
||||
$addquote=1;
|
||||
@ -250,13 +256,13 @@ class ExportCsv extends ModeleExports
|
||||
}
|
||||
|
||||
// Rule 3 CSV: If value contains separator, we must add "
|
||||
if (ereg($this->separator,$newvalue))
|
||||
{
|
||||
$addquote=1;
|
||||
}
|
||||
if (ereg($this->separator,$newvalue))
|
||||
{
|
||||
$addquote=1;
|
||||
}
|
||||
|
||||
return ($addquote?'"':'').$newvalue.($addquote?'"':'');
|
||||
}
|
||||
return ($addquote?'"':'').$newvalue.($addquote?'"':'');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -63,6 +63,7 @@ class ExportExcel extends ModeleExports
|
||||
|
||||
$this->id='excel'; // Same value then xxx in file name export_xxx.modules.php
|
||||
$this->label='Excel'; // Label of driver
|
||||
$this->desc='Native <b>Excel 95</b> file format (.xls)';
|
||||
$this->extension='xls'; // Extension for generated file by this driver
|
||||
$this->picto='mime/xls'; // Picto
|
||||
$ver=split(' ','$Revision$');
|
||||
@ -85,6 +86,11 @@ class ExportExcel extends ModeleExports
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
function getDriverDesc()
|
||||
{
|
||||
return $this->desc;
|
||||
}
|
||||
|
||||
function getDriverExtension()
|
||||
{
|
||||
return $this->extension;
|
||||
|
||||
@ -57,7 +57,8 @@ class ExportTsv extends ModeleExports
|
||||
$this->db = $db;
|
||||
|
||||
$this->id='tsv'; // Same value then xxx in file name export_xxx.modules.php
|
||||
$this->label='Tsv (Tab Separated Value)'; // Label of driver
|
||||
$this->label='Tsv'; // Label of driver
|
||||
$this->desc='<b>Tab Separated Value</b> file format (.tsv)';
|
||||
$this->extension='tsv'; // Extension for generated file by this driver
|
||||
$this->picto='mime/other'; // Picto
|
||||
$ver=split(' ','$Revision$');
|
||||
@ -78,6 +79,11 @@ class ExportTsv extends ModeleExports
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
function getDriverDesc()
|
||||
{
|
||||
return $this->desc;
|
||||
}
|
||||
|
||||
function getDriverExtension()
|
||||
{
|
||||
return $this->extension;
|
||||
|
||||
@ -81,6 +81,7 @@ class ModeleExports
|
||||
$this->picto[$module->id]=$module->picto;
|
||||
// Driver properties
|
||||
$this->driverlabel[$module->id]=$module->getDriverLabel();
|
||||
$this->driverdesc[$module->id]=$module->getDriverDesc();
|
||||
$this->driverversion[$module->id]=$module->getDriverVersion();
|
||||
// If use an external lib
|
||||
$this->liblabel[$module->id]=$module->getLibLabel();
|
||||
@ -110,6 +111,14 @@ class ModeleExports
|
||||
return $this->driverlabel[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi le descriptif d'un driver export
|
||||
*/
|
||||
function getDriverDesc($key)
|
||||
{
|
||||
return $this->driverdesc[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi version d'un driver export
|
||||
*/
|
||||
|
||||
@ -58,11 +58,12 @@ class ImportCsv extends ModeleImports
|
||||
|
||||
$this->separator=',';
|
||||
if (! empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE)) $this->separator=$conf->global->EXPORT_CSV_SEPARATOR_TO_USE;
|
||||
$this->escape="\\";
|
||||
$this->escape='"';
|
||||
$this->string='"';
|
||||
|
||||
$this->id='csv'; // Same value then xxx in file name export_xxx.modules.php
|
||||
$this->label='Csv (Comma Separated Value, separator="'.$this->separator.'")'; // Label of driver
|
||||
$this->label='Csv'; // Label of driver
|
||||
$this->desc='<b>Comma Separated Value</b> file format (.csv). This is a text file format.<br>Fields are separated by separator [ '.$this->separator.' ]. If separator is found inside a field content, field is rounded by round character [ '.$this->string.' ]. Escape character to escape round character is [ '.$this->escape.' ].';
|
||||
$this->extension='csv'; // Extension for generated file by this driver
|
||||
$this->picto='mime/other'; // Picto
|
||||
$ver=split(' ','$Revision$');
|
||||
@ -83,6 +84,11 @@ class ImportCsv extends ModeleImports
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
function getDriverDesc()
|
||||
{
|
||||
return $this->desc;
|
||||
}
|
||||
|
||||
function getDriverExtension()
|
||||
{
|
||||
return $this->extension;
|
||||
|
||||
@ -80,6 +80,7 @@ class ModeleImports
|
||||
$this->picto[$module->id]=$module->picto;
|
||||
// Driver properties
|
||||
$this->driverlabel[$module->id]=$module->getDriverLabel();
|
||||
$this->driverdesc[$module->id]=$module->getDriverDesc();
|
||||
$this->driverversion[$module->id]=$module->getDriverVersion();
|
||||
// If use an external lib
|
||||
$this->liblabel[$module->id]=$module->getLibLabel();
|
||||
@ -102,7 +103,7 @@ class ModeleImports
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi libelle d'un driver export
|
||||
* \brief Renvoi libelle d'un driver import
|
||||
*/
|
||||
function getDriverLabel($key)
|
||||
{
|
||||
@ -110,7 +111,15 @@ class ModeleImports
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi version d'un driver export
|
||||
* \brief Renvoi la description d'un driver import
|
||||
*/
|
||||
function getDriverDesc($key)
|
||||
{
|
||||
return $this->driverdesc[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Renvoi version d'un driver import
|
||||
*/
|
||||
function getDriverVersion($key)
|
||||
{
|
||||
|
||||
@ -153,7 +153,7 @@ class modProduit extends DolibarrModules
|
||||
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->import_label[$r]="Products"; // Translation key
|
||||
//$this->import_permission[$r]=array(array("societe","import"));
|
||||
$this->import_fields_array[$r]=array('p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.envente'=>"OnSell",'p.duration'=>"Duration");
|
||||
$this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.envente'=>"OnSell*",'p.duration'=>"Duration");
|
||||
$this->import_entities_array[$r]=array('p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>'product','p.envente'=>"product",'p.duration'=>"product");
|
||||
$this->import_examplevalues_array[$r]=array('p.ref'=>"PR123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.envente'=>"0 or 1",'p.duration'=>"1y");
|
||||
|
||||
|
||||
@ -155,7 +155,6 @@ MemberDeletedInDolibarr = Membre %s eliminat de Dolibarr
|
||||
MemberSubscriptionAddedInDolibarr = Subscripció del membre %s afegida a Dolibar
|
||||
##### Export ##### = =
|
||||
ExportsArea = Àrea d'exportacions
|
||||
AvailableFormats = Formats disponibles
|
||||
LibraryUsed = Llibreria utilitzada
|
||||
LibraryVersion = Versió
|
||||
ExportableDatas = Dades exportables
|
||||
|
||||
@ -30,7 +30,7 @@ FieldsOrder=Fields order
|
||||
FieldsTitle=Fields title
|
||||
ChooseExportFormat=Choose export format
|
||||
NowClickToGenerateToBuildExportFile=Now, click on "Generate" to build export file...
|
||||
AvailableFormats=Formats disponibles
|
||||
AvailableFormats=Available formats
|
||||
LibraryShort=Library
|
||||
LibraryUsed=Library used
|
||||
LibraryVersion=Version
|
||||
@ -63,8 +63,9 @@ ChooseFormatOfFileToImport=Choose file format to use as import file format by cl
|
||||
ChooseFileToImport=Upload file then click on picto %s to select file as source import file...
|
||||
SourceFileFormat=Source file format
|
||||
FieldsInSourceFile=Fields in source file
|
||||
FieldsInTargetDatabase=Target fields in Dolibarr database
|
||||
FieldsInTargetDatabase=Target fields in Dolibarr database (*=mandatory)
|
||||
NoFields=No fields
|
||||
MoveField=Move field column number %s
|
||||
ExampleOfImportFile=Example_of_import_file
|
||||
SaveImportProfile=Save this import profile
|
||||
ErrorImportDuplicateProfil=Failed to save this import profile with this name. An existing profile already exists with this name.
|
||||
|
||||
@ -63,8 +63,9 @@ ChooseFileToImport=Ajouter le fichier à importer puis cliquez sur le picto %s p
|
||||
DownloadEmptyExample=Télécharger fichier vierge exemple
|
||||
SourceFileFormat=Format du fichier source
|
||||
FieldsInSourceFile=Champs dans le fichier source
|
||||
FieldsInTargetDatabase=Champs cibles dans la base Dolibarr
|
||||
FieldsInTargetDatabase=Champs cibles dans la base Dolibarr (*=obligatoire)
|
||||
NoFields=Aucun champ
|
||||
MoveField=Déplacer champ colonne numéro %s
|
||||
ExampleOfImportFile=Exemple_de_fichier_import
|
||||
SaveImportProfile=Sauvegarder ce profil d'import
|
||||
ErrorImportDuplicateProfil=Impossible de sauvegarder le profil d'import sous ce nom. Un profil existant existe déjà pour ce nom.
|
||||
Loading…
Reference in New Issue
Block a user