Extract from cvs non GPL library
This commit is contained in:
parent
4a37906ee4
commit
2cffacc593
@ -86,7 +86,7 @@ if ($action=='selectfield')
|
||||
if ($action=='unselectfield')
|
||||
{
|
||||
unset($array_selected[$_GET["field"]]);
|
||||
// Renumerote champs de array_selected (de 1 à nb_elements)
|
||||
// Renumerote champs de array_selected (de 1 <EFBFBD> nb_elements)
|
||||
asort($array_selected);
|
||||
$i=0;
|
||||
$array_selected_save=$array_selected;
|
||||
@ -104,7 +104,7 @@ 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 switché
|
||||
// Recherche code avec qui switch<EFBFBD>
|
||||
$newcode="";
|
||||
foreach($array_selected as $code=>$value)
|
||||
{
|
||||
@ -115,7 +115,7 @@ if ($action=='downfield' || $action=='upfield')
|
||||
}
|
||||
}
|
||||
//print("Switch pos=$pos (code=".$_GET["field"].") and newpos=$newpos (code=$newcode)");
|
||||
if ($newcode) // Si newcode trouvé (prtoection contre resoumission de page
|
||||
if ($newcode) // Si newcode trouv<EFBFBD> (prtoection contre resoumission de page
|
||||
{
|
||||
$array_selected[$_GET["field"]]=$newpos;
|
||||
$array_selected[$newcode]=$pos;
|
||||
@ -131,7 +131,7 @@ if ($step == 1 || $action == 'cleanselect')
|
||||
|
||||
if ($action == 'builddoc')
|
||||
{
|
||||
// Genère le fichier
|
||||
// Gen<EFBFBD>re le fichier
|
||||
$result=$objexport->build_file($user, $_POST['model'], $datatoexport, $array_selected);
|
||||
if ($result < 0)
|
||||
{
|
||||
@ -293,14 +293,14 @@ if ($step == 2 && $datatoexport)
|
||||
print $objexport->array_export_module[0]->getName();
|
||||
print '</td></tr>';
|
||||
|
||||
// Lot de données à exporter
|
||||
// Lot de donn<EFBFBD>es <20> exporter
|
||||
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
|
||||
print '<td>'.$objexport->array_export_label[0].'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
// Liste déroulante des modéles d'export
|
||||
// Liste d<EFBFBD>roulante des mod<6F>les d'export
|
||||
print '<form action="export.php" method="post">';
|
||||
print '<input type="hidden" name="action" value="select_model">';
|
||||
print '<input type="hidden" name="step" value="2">';
|
||||
@ -350,7 +350,7 @@ if ($step == 2 && $datatoexport)
|
||||
print '<td nowrap="nowrap">'.img_object('',$entityicon).' '.$langs->trans($entitylang).'</td>';
|
||||
if ((isset($array_selected[$code]) && $array_selected[$code]) || $modelchoice == 1)
|
||||
{
|
||||
// Champ sélectionné
|
||||
// Champ s<EFBFBD>lectionn<EFBFBD>
|
||||
print '<td> </td>';
|
||||
print '<td><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=unselectfield&field='.$code.'">'.img_left().'</a></td>';
|
||||
print '<td>'.$langs->trans($label).' ('.$code.')</td>';
|
||||
@ -358,7 +358,7 @@ if ($step == 2 && $datatoexport)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Champ non sélectionné
|
||||
// Champ non s<EFBFBD>lectionn<EFBFBD>
|
||||
print '<td>'.$langs->trans($label).' ('.$code.')</td>';
|
||||
print '<td><a href="'.$_SERVER["PHP_SELF"].'?step=2&datatoexport='.$datatoexport.'&action=selectfield&field='.$code.'">'.img_right().'</a></td>';
|
||||
print '<td> </td>';
|
||||
@ -425,11 +425,11 @@ if ($step == 3 && $datatoexport)
|
||||
print $objexport->array_export_module[0]->getName();
|
||||
print '</td></tr>';
|
||||
|
||||
// Lot de données à exporter
|
||||
// Lot de donn<EFBFBD>es <20> exporter
|
||||
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
|
||||
print '<td>'.$objexport->array_export_label[0].'</td></tr>';
|
||||
|
||||
// Nbre champs exportés
|
||||
// Nbre champs export<EFBFBD>s
|
||||
print '<tr><td width="25%">'.$langs->trans("ExportedFields").'</td>';
|
||||
$list='';
|
||||
foreach($array_selected as $code=>$value)
|
||||
@ -568,11 +568,11 @@ if ($step == 4 && $datatoexport)
|
||||
print $objexport->array_export_module[0]->getName();
|
||||
print '</td></tr>';
|
||||
|
||||
// Lot de données à exporter
|
||||
// Lot de donn<EFBFBD>es <20> exporter
|
||||
print '<tr><td width="25%">'.$langs->trans("DatasetToExport").'</td>';
|
||||
print '<td>'.$objexport->array_export_label[0].'</td></tr>';
|
||||
|
||||
// Nbre champs exportés
|
||||
// Nbre champs export<EFBFBD>s
|
||||
print '<tr><td width="25%">'.$langs->trans("ExportedFields").'</td>';
|
||||
$list='';
|
||||
foreach($array_selected as $code=>$label)
|
||||
@ -619,14 +619,17 @@ if ($step == 4 && $datatoexport)
|
||||
print '</td><td width="50%"> </td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
// Test d'affichage du tableau excel et csv
|
||||
//print '<table width="100%"><tr><td>';
|
||||
//require_once(DOL_DOCUMENT_ROOT.'/lib/viewfiles.lib.php');
|
||||
//viewExcelFileContent($conf->export->dir_temp.'/1/export_member_1.xls',5,3);
|
||||
//viewCsvFileContent($conf->export->dir_temp.'/1/export_member_1.csv',5);
|
||||
//print '</td></tr></table>';
|
||||
|
||||
// If external library PHPEXCELREADER is available
|
||||
// and defined by PHPEXCELREADER constant.
|
||||
if (file_exists(PHPEXCELREADER.'excelreader.php'))
|
||||
{
|
||||
// Test d'affichage du tableau excel et csv
|
||||
//print '<table width="100%"><tr><td>';
|
||||
//require_once(DOL_DOCUMENT_ROOT.'/lib/viewfiles.lib.php');
|
||||
//viewExcelFileContent($conf->export->dir_temp.'/1/export_member_1.xls',5,3);
|
||||
//viewCsvFileContent($conf->export->dir_temp.'/1/export_member_1.csv',5);
|
||||
//print '</td></tr></table>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -16,20 +16,19 @@
|
||||
* 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/
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/lib/excel.lib.php
|
||||
\brief Ensemble de fonctions de base de dolibarr sous forme d'include
|
||||
\file htdocs/lib/excel.lib.php
|
||||
\brief Ensemble de fonctions de base de dolibarr sous forme d'include
|
||||
\version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Affiche le contenu d'un fichier CSV sous forme de tableau
|
||||
* \param file_to_include Fichier CSV a afficher
|
||||
* \param max_rows Nombre max de lignes a afficher (0 = illimité)
|
||||
* \param max_rows Nombre max de lignes a afficher (0 = illimit<EFBFBD>)
|
||||
*/
|
||||
function viewCsvFileContent($file_to_include='',$max_rows=0)
|
||||
{
|
||||
@ -51,18 +50,18 @@ function viewCsvFileContent($file_to_include='',$max_rows=0)
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* \brief Affiche le contenu d'un fichier Excel (avec les feuilles de calcul) sous forme de tableau
|
||||
* \param file_to_include Fichier Excel a afficher
|
||||
* \param max_rows Nombre max de lignes a afficher (0 = illimité)
|
||||
* \param max_cols Nombre max de colonnes a afficher (0 = illimité)
|
||||
* \param max_rows Nombre max de lignes a afficher (0 = illimite)
|
||||
* \param max_cols Nombre max de colonnes a afficher (0 = illimite)
|
||||
*/
|
||||
function viewExcelFileContent($file_to_include='',$max_rows=0,$max_cols=0)
|
||||
{
|
||||
$debug = 0; //1 for on 0 for off
|
||||
$debug = 0; //1 for on 0 for off
|
||||
$force_nobr = 0; //Force the info in cells not to wrap unless stated explicitly (newline)
|
||||
|
||||
require_once(DOL_DOCUMENT_ROOT.'/includes/phpexcelreader/excelreader.php');
|
||||
require_once(PHPEXCELREADER.'excelreader.php');
|
||||
$data = new Spreadsheet_Excel_Reader();
|
||||
$data->setOutputEncoding('CPa25a');
|
||||
$data->read($file_to_include);
|
||||
|
||||
@ -213,10 +213,11 @@ if (! defined('NOREQUIRETRAN'))
|
||||
// Les path racines
|
||||
if (! defined('FPDF_PATH')) { define('FPDF_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdf/'); }
|
||||
if (! defined('FPDFI_PATH')) { define('FPDFI_PATH', DOL_DOCUMENT_ROOT .'/includes/fpdf/fpdfi/'); }
|
||||
if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); }
|
||||
if (! defined('MAGPIERSS_PATH')) { define('MAGPIERSS_PATH', DOL_DOCUMENT_ROOT .'/includes/magpierss/'); }
|
||||
if (! defined('JPGRAPH_PATH')) { define('JPGRAPH_PATH', DOL_DOCUMENT_ROOT .'/includes/jpgraph/'); }
|
||||
if (! defined('NUSOAP_PATH')) { define('NUSOAP_PATH', DOL_DOCUMENT_ROOT .'/includes/nusoap/lib/'); }
|
||||
if (! defined('PHP_WRITEEXCEL_PATH')) { define('PHP_WRITEEXCEL_PATH',DOL_DOCUMENT_ROOT .'/includes/php_writeexcel/'); }
|
||||
if (! defined('PHPEXCELREADER')) { define('PHPEXCELREADER', DOL_DOCUMENT_ROOT .'/includes/phpexcelreader/'); }
|
||||
// Les autres path
|
||||
if (! defined('FPDF_FONTPATH')) { define('FPDF_FONTPATH', FPDF_PATH . 'font/'); }
|
||||
if (! defined('MAGPIE_DIR')) { define('MAGPIE_DIR', MAGPIERSS_PATH); }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user