* 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/societe/doc/doc_generic_odt.modules.php
* \ingroup societe
* \brief File of class to build ODT documents for third parties
* \author Laurent Destailleur
* \version $Id$
*/
require_once(DOL_DOCUMENT_ROOT."/includes/modules/societe/modules_societe.class.php");
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
/**
* \class doc_generic_odt
* \brief Class to build documents using ODF templates generator
*/
class doc_generic_odt extends ModeleThirdPartyDoc
{
var $emetteur; // Objet societe qui emet
var $phpmin = array(5,2,0); // Minimum version of PHP required by module
/**
* \brief Constructor
* \param db Database handler
*/
function doc_generic_odt($db)
{
global $conf,$langs,$mysoc;
$langs->load("main");
$langs->load("companies");
$this->db = $db;
$this->name = "ODT templates";
$this->description = $langs->trans("DocumentModelOdt");
$this->scandir = 'COMPANY_ADDON_PDF_ODT_PATH'; // Name of constant that is used to save list of directories to scan
// Dimension page pour format A4
$this->type = 'odt';
$this->page_largeur = 0;
$this->page_hauteur = 0;
$this->format = array($this->page_largeur,$this->page_hauteur);
$this->marge_gauche=0;
$this->marge_droite=0;
$this->marge_haute=0;
$this->marge_basse=0;
$this->option_logo = 1; // Affiche logo
// Recupere emmetteur
$this->emetteur=$mysoc;
if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini
}
/** \brief Return description of a module
* \return string Description
*/
function info($langs)
{
global $conf,$langs;
$langs->load("companies");
$langs->load("errors");
$form = new Form($db);
$texte = $this->description.".
\n";
$texte.= '