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,
* sinon le nom defini par defaut dans le module.
*
* @return string Nom du module traduit
*/
function getName()
@ -297,7 +298,8 @@ abstract class DolibarrModules
/**
* 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)
{
@ -320,7 +322,8 @@ abstract class DolibarrModules
/**
* 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)
{
@ -465,12 +468,13 @@ abstract class DolibarrModules
/**
* Create tables and keys required by module.
* Files module.sql and module.key.sql with create table and create keys
* commands must be stored in directory reldir='/module/sql/'
* This function is called by this->init
* Create tables and keys required by module.
* Files module.sql and module.key.sql with create table and create keys
* commands must be stored in directory reldir='/module/sql/'
* 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)
{
@ -849,8 +853,8 @@ abstract class DolibarrModules
/**
* Insert permissions definitions related to the module into llx_rights_def
*
* @param $reinitadminperms If 1, we also grant them to all admin users
* @return int Number of error (0 if OK)
* @param int $reinitadminperms If 1, we also grant them to all admin users
* @return int Number of error (0 if OK)
*/
function insert_permissions($reinitadminperms=0)
{
@ -1188,7 +1192,9 @@ abstract class DolibarrModules
/**
* 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)
{
@ -1333,7 +1339,7 @@ abstract class DolibarrModules
{
// If entity is defined
if (is_array($value) && isset($value['entity'])) $entity = $value['entity'];
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const";
$sql.= " WHERE ".$this->db->decrypt('name')." LIKE '".$this->const_name."_".strtoupper($key)."'";
$sql.= " AND entity = ".$entity;

View File

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

View File

@ -76,7 +76,8 @@ class modPhpbarcode extends ModeleBarCode
/**
* 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)
{
@ -104,6 +105,7 @@ class modPhpbarcode extends ModeleBarCode
* @param string $code Value to encode
* @param string $encoding Mode of encoding
* @param string $readable Code can be read
* @return int <0 if KO, >0 if OK
*/
function buildBarCode($code,$encoding,$readable='Y')
{
@ -142,6 +144,7 @@ class modPhpbarcode extends ModeleBarCode
* @param string $code Value to encode
* @param string $encoding Mode of encoding
* @param string $readable Code can be read
* @return int <0 if KO, >0 if OK
*/
function writeBarCode($code,$encoding,$readable='Y')
{

View File

@ -39,10 +39,13 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
var $error='';
/**
* \brief Return list of active generation modules
* \param $db Database handler
* Return list of active generation modules
*
* @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;
@ -50,7 +53,7 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
$liste=array();
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
$liste = array('blochet'=>'blochet');
@ -60,13 +63,14 @@ abstract class ModeleChequeReceipts extends CommonDocGenerator
/**
* \brief Cree un bordereau remise de cheque
* \param db objet base de donnee
* \param id Object invoice (or id of invoice)
* \param message message
* \param modele force le modele a utiliser ('' to not force)
* \param outputlangs objet lang a utiliser pour traduction
* \return int <0 if KO, >0 if OK
* Cree un bordereau remise de cheque
*
* @param DoliDB $db Database handler
* @param int $id Object invoice (or id of invoice)
* @param string $message Message
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs Object lang a utiliser pour traduction
* @return int <0 if KO, >0 if OK
* TODO
*/
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
*
* @param _dir Directory
* @param number Number
* @param outputlangs Lang output object
* @return int 1=ok, 0=ko
* @param string $_dir Directory
* @param string $number Number
* @param Translate $outputlangs Lang output object
* @return int 1=ok, 0=ko
*/
function write_file($_dir, $number, $outputlangs)
{
@ -282,6 +282,12 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
/**
* 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)
{

View File

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

View File

@ -44,9 +44,11 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
/**
* 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;
@ -54,7 +56,7 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}

View File

@ -31,9 +31,10 @@ class ModelNumRefContracts
{
var $error='';
/**
/**
* 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()
{
@ -42,6 +43,7 @@ class ModelNumRefContracts
/**
* Return default description of numbering model
*
* @return string text description
*/
function info()
@ -51,8 +53,9 @@ class ModelNumRefContracts
return $langs->trans("NoDescription");
}
/**
/**
* Return numbering example
*
* @return string Example
*/
function getExample()
@ -62,8 +65,9 @@ class ModelNumRefContracts
return $langs->trans("NoExample");
}
/**
/**
* Test if existing numbers make problems with numbering
*
* @return boolean false if conflit, true if ok
*/
function canBeActivated()
@ -71,8 +75,9 @@ class ModelNumRefContracts
return true;
}
/**
/**
* Return next value
*
* @return string Value
*/
function getNextValue()
@ -83,6 +88,7 @@ class ModelNumRefContracts
/**
* Return numbering version module
*
* @return string Value
*/
function getVersion()

View File

@ -39,10 +39,11 @@ abstract class ModeleDon extends CommonDocGenerator
/**
* Return list of active generation modules
*
* @param DoliDB $db Database handler
* @return array List of donation templates
* @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;
@ -50,7 +51,7 @@ abstract class ModeleDon extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}
@ -66,7 +67,7 @@ abstract class ModeleNumRefDons
/**
* Return if a module can be used or not
*
*
* @return boolean true if module can be used
*/
function isEnabled()
@ -74,9 +75,9 @@ abstract class ModeleNumRefDons
return true;
}
/**
/**
* Renvoi la description par defaut du modele de numerotation
*
*
* @return string Texte descripif
*/
function info()
@ -86,9 +87,9 @@ abstract class ModeleNumRefDons
return $langs->trans("NoDescription");
}
/**
/**
* Renvoi un exemple de numerotation
*
*
* @return string Example
*/
function getExample()
@ -98,10 +99,10 @@ abstract class ModeleNumRefDons
return $langs->trans("NoExample");
}
/**
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas d
* de conflits qui empechera cette numerotation de fonctionner.
*
*
* @return boolean false si conflit, true si ok
*/
function canBeActivated()
@ -109,9 +110,9 @@ abstract class ModeleNumRefDons
return true;
}
/**
/**
* Renvoi prochaine valeur attribuee
*
*
* @return string Valeur
*/
function getNextValue()
@ -120,9 +121,9 @@ abstract class ModeleNumRefDons
return $langs->trans("NotAvailable");
}
/**
/**
* Renvoi version du module numerotation
*
*
* @return string Valeur
*/
function getVersion()

View File

@ -42,10 +42,13 @@ class ModeleShippingMethod
/**
* Return list of active generation modules
* @param $db Database handler
* Return list of active generation modules
*
* @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;
@ -53,7 +56,7 @@ class ModeleShippingMethod
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}

View File

@ -39,10 +39,13 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
/**
* \brief Return list of active generation modules
* \param $db Database handler
* Return list of active generation modules
*
* @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;
@ -50,7 +53,7 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}
@ -65,8 +68,8 @@ abstract class ModelNumRefExpedition
{
var $error='';
/** 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
*/
function isEnabled()
@ -85,7 +88,7 @@ abstract class ModelNumRefExpedition
return $langs->trans("NoDescription");
}
/**
/**
* Return numbering example
* @return string Example
*/
@ -96,7 +99,7 @@ abstract class ModelNumRefExpedition
return $langs->trans("NoExample");
}
/**
/**
* Test if existing numbers make problems with numbering
* @return boolean false if conflit, true if ok
*/
@ -105,7 +108,7 @@ abstract class ModelNumRefExpedition
return true;
}
/**
/**
* Return next value
* @return string Value
*/

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
* \param db Handler de base
* Charge en memoire et renvoie la liste des modeles actifs
*
* @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/";
$handle=opendir($dir);

View File

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

View File

@ -41,9 +41,12 @@ abstract class ModelePDFFactures extends CommonDocGenerator
/**
* 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;
@ -51,7 +54,7 @@ abstract class ModelePDFFactures extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}

View File

@ -32,8 +32,7 @@ require_once(DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php');
/**
* \class pdf_soleil
* \brief Class to build interventions documents with model Soleil
* Class to build interventions documents with model Soleil
*/
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->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->SetXY($this->marge_gauche, $tab_top + 8 );
$pdf->SetXY($this->marge_gauche, $tab_top + 8);
$text=$object->description;
if ($object->duree > 0)
{

View File

@ -40,9 +40,11 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
/**
* 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;
@ -50,7 +52,7 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
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/";
$handle=opendir($dir);

View File

@ -38,10 +38,13 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
var $error='';
/**
* \brief Return list of active generation modules
* \param $db Database handler
* Return list of active generation modules
*
* @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;
@ -49,7 +52,7 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}

View File

@ -39,10 +39,13 @@ class ModelePDFCards
/**
* \brief Return list of active generation modules
* \param $db Database handler
* Return list of active generation modules
*
* @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;
@ -50,7 +53,7 @@ class ModelePDFCards
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
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;
@ -51,7 +53,7 @@ class ModelePDFLabels
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}

View File

@ -145,11 +145,12 @@ class modCashDesk extends DolibarrModules
}
/**
* Function called when module is disabled.
* Remove from database constants, boxes and permissions from Dolibarr database.
* Data directories are not deleted.
* Function called when module is disabled.
* Remove from database constants, boxes and permissions from Dolibarr database.
* 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='')
{

View File

@ -133,12 +133,12 @@ class modProduct extends DolibarrModules
$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');
//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->barcode->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.barcode'=>'Barcode'));
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'));
$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.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->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'));
// Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'";
$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_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');
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");
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
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product'";
$resql=$this->db->query($sql);

View File

@ -35,10 +35,12 @@ abstract class ModelePDFProjects extends CommonDocGenerator
/**
* 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;
@ -46,7 +48,7 @@ abstract class ModelePDFProjects extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}
@ -63,7 +65,7 @@ abstract class ModeleNumRefProjects
/**
* Return if a module can be used or not
*
*
* @return boolean true if module can be used
*/
function isEnabled()
@ -73,7 +75,7 @@ abstract class ModeleNumRefProjects
/**
* Renvoi la description par defaut du modele de numerotation
*
*
* @return string Texte descripif
*/
function info()
@ -85,7 +87,7 @@ abstract class ModeleNumRefProjects
/**
* Renvoi un exemple de numerotation
*
*
* @return string Example
*/
function getExample()
@ -98,7 +100,7 @@ abstract class ModeleNumRefProjects
/**
* Test si les numeros deja en vigueur dans la base ne provoquent pas de
* de conflits qui empechera cette numerotation de fonctionner.
*
*
* @return boolean false si conflit, true si ok
*/
function canBeActivated()
@ -108,7 +110,7 @@ abstract class ModeleNumRefProjects
/**
* Renvoi prochaine valeur attribuee
*
*
* @return string Valeur
*/
function getNextValue()
@ -119,7 +121,7 @@ abstract class ModeleNumRefProjects
/**
* Renvoi version du module numerotation
*
*
* @return string Valeur
*/
function getVersion()

View File

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

View File

@ -41,9 +41,11 @@ abstract class ModelePDFPropales extends CommonDocGenerator
/**
* 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;
@ -51,7 +53,7 @@ abstract class ModelePDFPropales extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}

View File

@ -36,10 +36,11 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
var $error='';
/**
* Return list of active generation modules
* Return list of active generation modules
*
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @return array List of templates
*/
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
* @return array List of numbers
* @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)
{
$liste=array();
$sql ="";
@ -172,7 +174,7 @@ abstract class ModeleThirdPartyCode
* @param Translate $langs Output language
* @param Societe $soc Third party object
* @param int $type -1=Nothing, 0=Customer, 1=Supplier
* @return tring HTML translated description
* @return string HTML translated description
*/
function getToolTip($langs,$soc,$type)
{

View File

@ -37,9 +37,11 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
/**
* 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;
@ -47,7 +49,7 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}

View File

@ -43,9 +43,11 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
/**
* 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;
@ -53,7 +55,7 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
$liste=array();
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php');
$liste=getListOfModels($db,$type,'');
$liste=getListOfModels($db,$type,$maxfilenamelength);
return $liste;
}