This commit is contained in:
Laurent Destailleur 2012-03-13 09:38:00 +01:00
parent 4f23be1b50
commit 66bad9ea04
29 changed files with 198 additions and 132 deletions

View File

@ -219,6 +219,7 @@ abstract class DolibarrModules
/** /**
* Retourne le nom traduit du module si la traduction existe dans admin.lang, * Retourne le nom traduit du module si la traduction existe dans admin.lang,
* sinon le nom defini par defaut dans le module. * sinon le nom defini par defaut dans le module.
*
* @return string Nom du module traduit * @return string Nom du module traduit
*/ */
function getName() function getName()
@ -297,7 +298,8 @@ abstract class DolibarrModules
/** /**
* Return translated label of a export dataset * Return translated label of a export dataset
* *
* @return string Label of databaset * @param int $r Index of dataset
* @return string Label of databaset
*/ */
function getExportDatasetLabel($r) function getExportDatasetLabel($r)
{ {
@ -320,7 +322,8 @@ abstract class DolibarrModules
/** /**
* Return translated label of an import dataset * Return translated label of an import dataset
* *
* @return string Label of databaset * @param int $r Index of dataset
* @return string Label of databaset
*/ */
function getImportDatasetLabel($r) function getImportDatasetLabel($r)
{ {
@ -465,12 +468,13 @@ abstract class DolibarrModules
/** /**
* Create tables and keys required by module. * Create tables and keys required by module.
* Files module.sql and module.key.sql with create table and create keys * Files module.sql and module.key.sql with create table and create keys
* commands must be stored in directory reldir='/module/sql/' * commands must be stored in directory reldir='/module/sql/'
* This function is called by this->init * This function is called by this->init
* *
* @return int <=0 if KO, >0 if OK * @param string $reldir Relative directory where to scan files
* @return int <=0 if KO, >0 if OK
*/ */
function _load_tables($reldir) function _load_tables($reldir)
{ {
@ -849,8 +853,8 @@ abstract class DolibarrModules
/** /**
* Insert permissions definitions related to the module into llx_rights_def * Insert permissions definitions related to the module into llx_rights_def
* *
* @param $reinitadminperms If 1, we also grant them to all admin users * @param int $reinitadminperms If 1, we also grant them to all admin users
* @return int Number of error (0 if OK) * @return int Number of error (0 if OK)
*/ */
function insert_permissions($reinitadminperms=0) function insert_permissions($reinitadminperms=0)
{ {
@ -1188,7 +1192,9 @@ abstract class DolibarrModules
/** /**
* Insert directories in llx_const * Insert directories in llx_const
* *
* @return int Nb of errors (0 if OK) * @param string $name Name
* @param string $dir Directory
* @return int Nb of errors (0 if OK)
*/ */
function insert_dirs($name,$dir) function insert_dirs($name,$dir)
{ {

View File

@ -38,6 +38,7 @@ abstract class ModeleBarCode
/** /**
* Return if a module can be used or not * Return if a module can be used or not
*
* @return boolean true if module can be used * @return boolean true if module can be used
*/ */
function isEnabled() function isEnabled()

View File

@ -76,7 +76,8 @@ class modPhpbarcode extends ModeleBarCode
/** /**
* Return true if encodinf is supported * Return true if encodinf is supported
* *
* @return int >0 if supported, 0 if not * @param string $encoding Encoding norm
* @return int >0 if supported, 0 if not
*/ */
function encodingIsSupported($encoding) function encodingIsSupported($encoding)
{ {
@ -104,6 +105,7 @@ class modPhpbarcode extends ModeleBarCode
* @param string $code Value to encode * @param string $code Value to encode
* @param string $encoding Mode of encoding * @param string $encoding Mode of encoding
* @param string $readable Code can be read * @param string $readable Code can be read
* @return int <0 if KO, >0 if OK
*/ */
function buildBarCode($code,$encoding,$readable='Y') function buildBarCode($code,$encoding,$readable='Y')
{ {
@ -142,6 +144,7 @@ class modPhpbarcode extends ModeleBarCode
* @param string $code Value to encode * @param string $code Value to encode
* @param string $encoding Mode of encoding * @param string $encoding Mode of encoding
* @param string $readable Code can be read * @param string $readable Code can be read
* @return int <0 if KO, >0 if OK
*/ */
function writeBarCode($code,$encoding,$readable='Y') function writeBarCode($code,$encoding,$readable='Y')
{ {

View File

@ -39,10 +39,13 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
var $error=''; var $error='';
/** /**
* \brief Return list of active generation modules * Return list of active generation modules
* \param $db Database handler *
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -50,7 +53,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
// TODO Remove this to use getListOfModels only // TODO Remove this to use getListOfModels only
$liste = array('blochet'=>'blochet'); $liste = array('blochet'=>'blochet');
@ -60,13 +63,14 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
/** /**
* \brief Cree un bordereau remise de cheque * Cree un bordereau remise de cheque
* \param db objet base de donnee *
* \param id Object invoice (or id of invoice) * @param DoliDB $db Database handler
* \param message message * @param int $id Object invoice (or id of invoice)
* \param modele force le modele a utiliser ('' to not force) * @param string $message Message
* \param outputlangs objet lang a utiliser pour traduction * @param string $modele Force le modele a utiliser ('' to not force)
* \return int <0 if KO, >0 if OK * @param Translate $outputlangs Object lang a utiliser pour traduction
* @return int <0 if KO, >0 if OK
* TODO * TODO
*/ */
function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs)

View File

@ -79,10 +79,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
/** /**
* Fonction generant le rapport sur le disque * Fonction generant le rapport sur le disque
* *
* @param _dir Directory * @param string $_dir Directory
* @param number Number * @param string $number Number
* @param outputlangs Lang output object * @param Translate $outputlangs Lang output object
* @return int 1=ok, 0=ko * @return int 1=ok, 0=ko
*/ */
function write_file($_dir, $number, $outputlangs) function write_file($_dir, $number, $outputlangs)
{ {
@ -282,6 +282,12 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
/** /**
* Output array * Output array
*
* @param PDF &$pdf PDF object
* @param int $pagenb Page nb
* @param int $pages Pages
* @param Translate $outputlangs Object lang
* @return void
*/ */
function Body(&$pdf, $pagenb, $pages, $outputlangs) function Body(&$pdf, $pagenb, $pages, $outputlangs)
{ {

View File

@ -91,6 +91,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
* *
* @param Object $object Main object to use as data source * @param Object $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @return array Array of substitution
*/ */
function get_substitutionarray_object($object,$outputlangs) function get_substitutionarray_object($object,$outputlangs)
{ {

View File

@ -44,9 +44,11 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -54,7 +56,7 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -33,7 +33,8 @@ class ModelNumRefContracts
/** /**
* Return if a module can be used or not * Return if a module can be used or not
* @return boolean true if module can be used *
* @return boolean true if module can be used
*/ */
function isEnabled() function isEnabled()
{ {
@ -42,6 +43,7 @@ class ModelNumRefContracts
/** /**
* Return default description of numbering model * Return default description of numbering model
*
* @return string text description * @return string text description
*/ */
function info() function info()
@ -53,6 +55,7 @@ class ModelNumRefContracts
/** /**
* Return numbering example * Return numbering example
*
* @return string Example * @return string Example
*/ */
function getExample() function getExample()
@ -64,6 +67,7 @@ class ModelNumRefContracts
/** /**
* Test if existing numbers make problems with numbering * Test if existing numbers make problems with numbering
*
* @return boolean false if conflit, true if ok * @return boolean false if conflit, true if ok
*/ */
function canBeActivated() function canBeActivated()
@ -73,6 +77,7 @@ class ModelNumRefContracts
/** /**
* Return next value * Return next value
*
* @return string Value * @return string Value
*/ */
function getNextValue() function getNextValue()
@ -83,6 +88,7 @@ class ModelNumRefContracts
/** /**
* Return numbering version module * Return numbering version module
*
* @return string Value * @return string Value
*/ */
function getVersion() function getVersion()

View File

@ -39,10 +39,11 @@ abstract class ModeleDon extends CommonDocGenerator
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @return array List of donation templates * @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -50,7 +51,7 @@ abstract class ModeleDon extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -42,10 +42,13 @@ class ModeleShippingMethod
/** /**
* Return list of active generation modules * Return list of active generation modules
* @param $db Database handler *
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -53,7 +56,7 @@ class ModeleShippingMethod
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -39,10 +39,13 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
/** /**
* \brief Return list of active generation modules * Return list of active generation modules
* \param $db Database handler *
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -50,7 +53,7 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -41,12 +41,15 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac
/** /**
* \brief Charge en memoire et renvoie la liste des modeles actifs * Charge en memoire et renvoie la liste des modeles actifs
* \param db Handler de base *
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
dol_syslog("ModeleExport::liste_modeles"); dol_syslog(get_class($this)."::liste_modeles");
$dir=DOL_DOCUMENT_ROOT."/core/modules/export/"; $dir=DOL_DOCUMENT_ROOT."/core/modules/export/";
$handle=opendir($dir); $handle=opendir($dir);

View File

@ -88,8 +88,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures
/** /**
* Define array with couple substitution key => substitution value * Define array with couple substitution key => substitution value
* *
* @param $object Main object to use as data source * @param Object $object Main object to use as data source
* @param $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @return array Array of substitution
*/ */
function get_substitutionarray_object($object,$outputlangs) function get_substitutionarray_object($object,$outputlangs)
{ {

View File

@ -41,9 +41,12 @@ abstract class ModelePDFFactures extends CommonDocGenerator
/** /**
* Return list of active generation modules * Return list of active generation modules
* @param $db Database handler *
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -51,7 +54,7 @@ abstract class ModelePDFFactures extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -32,8 +32,7 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php');
/** /**
* \class pdf_soleil * Class to build interventions documents with model Soleil
* \brief Class to build interventions documents with model Soleil
*/ */
class pdf_soleil extends ModelePDFFicheinter class pdf_soleil extends ModelePDFFicheinter
{ {
@ -211,10 +210,10 @@ class pdf_soleil extends ModelePDFFicheinter
$pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0); $pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0);
$pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8 ); $pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8 );
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('', '', $default_font_size - 1);
$pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->MultiCell(0, 3, ''); // Set interline to 3
$pdf->SetXY($this->marge_gauche, $tab_top + 8 ); $pdf->SetXY($this->marge_gauche, $tab_top + 8);
$text=$object->description; $text=$object->description;
if ($object->duree > 0) if ($object->duree > 0)
{ {

View File

@ -40,9 +40,11 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -50,7 +52,7 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -60,13 +60,15 @@ class ModeleImports
} }
/** /**
* Charge en memoire et renvoie la liste des modeles actifs * Charge en memoire et renvoie la liste des modeles actifs
* *
* @param DoliDB $db Handler de base * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
dol_syslog("ModeleImport::liste_modeles"); dol_syslog(get_class($this)."::liste_modeles");
$dir=DOL_DOCUMENT_ROOT."/core/modules/import/"; $dir=DOL_DOCUMENT_ROOT."/core/modules/import/";
$handle=opendir($dir); $handle=opendir($dir);

View File

@ -38,10 +38,13 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
var $error=''; var $error='';
/** /**
* \brief Return list of active generation modules * Return list of active generation modules
* \param $db Database handler *
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -49,7 +52,7 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -39,10 +39,13 @@ class ModelePDFCards
/** /**
* \brief Return list of active generation modules * Return list of active generation modules
* \param $db Database handler *
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -50,7 +53,7 @@ class ModelePDFCards
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -39,11 +39,13 @@ class ModelePDFLabels
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -51,7 +53,7 @@ class ModelePDFLabels
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -145,11 +145,12 @@ class modCashDesk extends DolibarrModules
} }
/** /**
* Function called when module is disabled. * Function called when module is disabled.
* Remove from database constants, boxes and permissions from Dolibarr database. * Remove from database constants, boxes and permissions from Dolibarr database.
* Data directories are not deleted. * Data directories are not deleted.
* *
* @return int 1 if OK, 0 if KO * @param string $options Options
* @return int 1 if OK, 0 if KO
*/ */
function remove($options='') function remove($options='')
{ {

View File

@ -133,12 +133,12 @@ class modProduct extends DolibarrModules
$this->export_permission[$r]=array(array("produit","export")); $this->export_permission[$r]=array(array("produit","export"));
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification');
//if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.stock'=>'Stock','p.pmp'=>'PMPValue')); //if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.stock'=>'Stock','p.pmp'=>'PMPValue'));
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.pmp'=>'PMPValue')); if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.pmp'=>'PMPValue'));
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.barcode'=>'Barcode')); if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'Barcode'));
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.customcode'=>'product','p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.tobuy'=>"product",'p.datec'=>"product",'p.tms'=>"product"); $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.customcode'=>'product','p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.tobuy'=>"product",'p.datec'=>"product",'p.tms'=>"product");
//if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product')); //if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product'));
if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.pmp'=>'product')); if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.pmp'=>'product'));
if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.barcode'=>'product')); if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.barcode'=>'product'));
// Add extra fields // Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'"; $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -122,9 +122,9 @@ class modService extends DolibarrModules
$this->export_label[$r]="Services"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]="Services"; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("service","export")); $this->export_permission[$r]=array(array("service","export"));
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification');
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.stock'=>'Stock')); if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock'));
$this->export_entities_array[$r]=array('p.rowid'=>"service",'p.ref'=>"service",'p.label'=>"service",'p.description'=>"service",'p.accountancy_code_sell'=>'service','p.accountancy_code_sell'=>'service','p.note'=>"service",'p.price_base_type'=>"service",'p.price'=>"service",'p.price_ttc'=>"service",'p.tva_tx'=>"service",'p.tosell'=>"service",'p.duration'=>"service",'p.datec'=>"service",'p.tms'=>"service"); $this->export_entities_array[$r]=array('p.rowid'=>"service",'p.ref'=>"service",'p.label'=>"service",'p.description'=>"service",'p.accountancy_code_sell'=>'service','p.accountancy_code_sell'=>'service','p.note'=>"service",'p.price_base_type'=>"service",'p.price'=>"service",'p.price_ttc'=>"service",'p.tva_tx'=>"service",'p.tosell'=>"service",'p.duration'=>"service",'p.datec'=>"service",'p.tms'=>"service");
if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.stock'=>'product')); if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge($this->export_entities_array[$r],array('p.stock'=>'product'));
// Add extra fields // Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'"; $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@ -36,9 +36,11 @@ abstract class ModelePDFProjects extends CommonDocGenerator
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -46,7 +48,7 @@ abstract class ModelePDFProjects extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -91,6 +91,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
* *
* @param Object $object Main object to use as data source * @param Object $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output * @param Translate $outputlangs Lang object to use for output
* @return array Array of substitution
*/ */
function get_substitutionarray_object($object,$outputlangs) function get_substitutionarray_object($object,$outputlangs)
{ {

View File

@ -41,9 +41,11 @@ abstract class ModelePDFPropales extends CommonDocGenerator
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -51,7 +53,7 @@ abstract class ModelePDFPropales extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -36,10 +36,11 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
var $error=''; var $error='';
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show * @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/ */
function liste_modeles($db,$maxfilenamelength=0) function liste_modeles($db,$maxfilenamelength=0)
{ {
@ -137,12 +138,13 @@ abstract class ModeleThirdPartyCode
} }
/** /**
* Renvoi la liste des modeles de numéroation * Renvoi la liste des modeles de numéroation
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @return array List of numbers * @param string $maxfilenamelength Max length of value to show
* @return array List of numbers
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
$liste=array(); $liste=array();
$sql =""; $sql ="";
@ -172,7 +174,7 @@ abstract class ModeleThirdPartyCode
* @param Translate $langs Output language * @param Translate $langs Output language
* @param Societe $soc Third party object * @param Societe $soc Third party object
* @param int $type -1=Nothing, 0=Customer, 1=Supplier * @param int $type -1=Nothing, 0=Customer, 1=Supplier
* @return tring HTML translated description * @return string HTML translated description
*/ */
function getToolTip($langs,$soc,$type) function getToolTip($langs,$soc,$type)
{ {

View File

@ -37,9 +37,11 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of numbers
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -47,7 +49,7 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }

View File

@ -43,9 +43,11 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of numbers
*/ */
function liste_modeles($db) function liste_modeles($db,$maxfilenamelength=0)
{ {
global $conf; global $conf;
@ -53,7 +55,7 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
$liste=array(); $liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,''); $liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }