Subversion Repositories eFlore/Applications.cel

Compare Revisions

Regard whitespace Rev 2457 → Rev 2458

/trunk/jrest/services/InventoryExport.php
1,39 → 1,32
<?php
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
 
// declare(encoding='UTF-8');
/**
* PHP Version 5
* Service d'export vers feuille de calcul d'une sélection de relevés.
*
* @category PHP
* @package jrest
* @author David Delon <david@tela-botania.org>
* @author Aurélien Peronnet <aurelien@tela-botania.org>
* @copyright 2010 Tela-Botanica
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @version SVN: <svn_id>
* @link /doc/jrest/
* @internal Mininum PHP version : 5.2
* @category CEL
* @package Services
* @subpackage Observations
* @version 0.1
* @author Mathias CHOUET <mathias@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author Aurelien PERONNET <aurelien@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org>
*/
 
/**
* in:utf8
* out:iso8859
*
* Export vers feuille de calcul d'une selection de releves
*
*/
 
set_include_path(get_include_path() . PATH_SEPARATOR . dirname(dirname(realpath(__FILE__))) . '/lib');
// la sortie est binaire (xls), mais OLE n'est pas compatible E_ALL en PHP-5.4
error_reporting(error_reporting() ^ E_STRICT);
require_once("lib/OLE.php");
require_once("lib/Spreadsheet/Excel/Writer.php");
require_once 'lib/OLE.php';
require_once 'lib/Spreadsheet/Excel/Writer.php';
 
class InventoryExport extends Cel {
 
private $extendSpreadsheetProductor;
 
function InventoryExport($config) {
 
public function __construct($config) {
parent::__construct($config);
 
$this->extendSpreadsheetProductor = new SpreadsheetProductor();
40,8 → 33,7
$this->extendSpreadsheetProductor->initSpreadsheet();
}
 
function getElement($uid){
 
public function getElement($uid){
// Controle detournement utilisateur
$this->controleUtilisateur($uid[0]);
 
51,13 → 43,11
// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();
$workbook->setVersion(8);
 
$workbook->send('liste.xls');
 
// Creating a worksheet
$worksheet = $workbook->addWorksheet('Liste');
$worksheet->setInputEncoding('utf-8');
$worksheet->write(0,0,'Espece');
$worksheet->write(0,1,'Numero nomenclatural');
$worksheet->write(0,2,'Nom retenu');
92,17 → 82,15
$i=1;
foreach ($observations as &$obs) {
 
$obs = $this->denullifierTableauValeurCel($obs);
$ids_obs[] = $obs['id_observation'];
$indices_lignes_obs[$obs['id_observation']] = $i;
if ($obs['date_observation'] != "0000-00-00 00:00:00") {
if ($obs['date_observation'] != '0000-00-00 00:00:00') {
$obs['date_observation'] = $this->formaterDate($obs['date_observation']);
} else {
$obs['date_observation'] = '00/00/0000';
}
else {
$obs['date_observation']="00/00/0000";
}
 
$worksheet->write($i,0,$obs['nom_sel']);
$worksheet->write($i,1,$obs['nom_sel_nn']);
149,19 → 137,4
$workbook->close();
exit();
}
}
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.7 2008-11-13 11:29:12 ddelon
* Reecriture gwt-ext
*
* Revision 1.6 2008-01-30 08:57:28 ddelon
* fin mise en place mygwt
*
* Revision 1.5 2007-06-06 13:31:16 ddelon
* v0.09
*
* Revision 1.4 2007-05-22 12:54:09 ddelon
* Securisation acces utilisateur
*/
?>
}