This commit is contained in:
Laurent Destailleur
2011-09-12 17:08:02 +00:00
parent e29f72adc9
commit 411b3415eb
34 changed files with 3586 additions and 4435 deletions

View File

@@ -601,10 +601,12 @@ class ActionComm extends CommonObject
/**
* Renvoie nom clicable (avec eventuellement le picto)
* Utilise $this->id, $this->code et $this->label
*
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param maxlength Nombre de caracteres max dans libelle
* @param classname Force style class on a link
* @param option ''=Link to action,'birthday'=Link to contact
* @param overwritepicto 1=Overwrite picto
* @return string Chaine avec URL
*/
function getNomUrl($withpicto=0,$maxlength=0,$classname='',$option='',$overwritepicto='')

View File

@@ -27,7 +27,9 @@
* \class CActionComm
* \brief Class to manage different types of events
*/
class CActionComm {
class CActionComm
{
var $error;
var $db;
var $id;
@@ -37,14 +39,13 @@ class CActionComm {
var $libelle;
var $active;
var $error;
var $type_actions=array();
/**
* \brief Constructeur
* \param DB Handler d'acces base de donnee
* Constructor
*
* @param DoliDB $DB Database handler
*/
function CActionComm($DB)
{
@@ -52,9 +53,10 @@ class CActionComm {
}
/**
* \brief Charge l'objet type d'action depuis la base
* \param id id ou code du type d'action a recuperer
* \return int 1=ok, 0=aucune action, -1=erreur
* Charge l'objet type d'action depuis la base
*
* @param id id ou code du type d'action a recuperer
* @return int 1=ok, 0=aucune action, -1=erreur
*/
function fetch($id)
{
@@ -95,7 +97,9 @@ class CActionComm {
/**
* Return list of event types
* @param active 1 or 0 to filter on event state active or not ('' bu default = no filter)
*
* @param int $active 1 or 0 to filter on event state active or not ('' bu default = no filter)
* @param string $idorcode 'id' or 'code'
* @return array Array of all event types if OK, <0 if KO
*/
function liste_array($active='',$idorcode='id')
@@ -156,10 +160,10 @@ class CActionComm {
/**
* \brief Renvoie le nom sous forme d'un libelle traduit d'un type d'action
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \param option Sur quoi pointe le lien
* \return string Libelle du type d'action
* Renvoie le nom sous forme d'un libelle traduit d'un type d'action
*
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @return string Libelle du type d'action
*/
function getNomUrl($withpicto=0)
{

View File

@@ -820,9 +820,11 @@ class Propal extends CommonObject
/**
* Load an object from its id and create a new one in database
* @param fromid Id of object to clone
* @param invertdetail Reverse sign of amounts for lines
* @param socid Id of thirdparty
*
* @param int $fromid Id of object to clone
* @param int $invertdetail Reverse sign of amounts for lines
* @param int $socid Id of thirdparty
* @param HookManager $hookmanager Hook manager instance
* @return int New id of clone
*/
function createFromClone($fromid,$invertdetail=0,$socid=0,$hookmanager=false)

View File

@@ -765,9 +765,11 @@ class Commande extends CommonObject
/**
* Load an object from its id and create a new one in database
* @param fromid Id of object to clone
* @param invertdetail Reverse sign of amounts for lines
* @param socid Id of thirdparty
*
* @param int $fromid Id of object to clone
* @param int $invertdetail Reverse sign of amounts for lines
* @param int $socid Id of thirdparty
* @param HookManager $hookmanager Hook manager instance
* @return int New id of clone
*/
function createFromClone($fromid,$invertdetail=0,$socid=0,$hookmanager=false)
@@ -855,7 +857,9 @@ class Commande extends CommonObject
/**
* Load an object from a proposal and create a new order into database
* @param object Object source
*
* @param Object $object Object source
* @param HookManager $hookmanager Hook manager instance
* @return int <0 if KO, 0 if nothing done, 1 if OK
*/
function createFromProposal($object,$hookmanager=false)
@@ -1678,8 +1682,9 @@ class Commande extends CommonObject
/**
* Applique une remise relative
* @param user User qui positionne la remise
* @param remise
*
* @param User $user User qui positionne la remise
* @param float $remise Discount (percent)
* @return int <0 if KO, >0 if OK
*/
function set_remise($user, $remise)
@@ -1711,8 +1716,9 @@ class Commande extends CommonObject
/**
* Applique une remise absolue
* @param user User qui positionne la remise
* @param remise
*
* @param User $user User qui positionne la remise
* @param float $remise Discount
* @return int <0 if KO, >0 if OK
*/
function set_remise_absolue($user, $remise)
@@ -1746,6 +1752,7 @@ class Commande extends CommonObject
/**
* Set the order date
*
* @param user Object user making change
* @param date Date
* @return int <0 if KO, >0 if OK
@@ -1780,6 +1787,7 @@ class Commande extends CommonObject
/**
* Set the planned delivery date
*
* @param user Objet utilisateur qui modifie
* @param date_livraison Date de livraison
* @return int <0 si ko, >0 si ok
@@ -1814,6 +1822,7 @@ class Commande extends CommonObject
/**
* Set address
*
* @param user Object user making change
* @param fk_address Adress of delivery
* @return int <0 ig KO, >0 if Ok
@@ -1841,6 +1850,7 @@ class Commande extends CommonObject
/**
* Set availability
*
* @param user Object user making change
* @param id If of availability delay
* @return int <0 if KO, >0 if OK
@@ -1869,6 +1879,7 @@ class Commande extends CommonObject
/**
* Set source of demand
*
* @param user Object user making change
* @param id Id of source
* @return int <0 if KO, >0 if OK
@@ -1896,10 +1907,11 @@ class Commande extends CommonObject
}
/**
* \brief Return list of orders (eventuelly filtered on a user) into an array
* \param brouillon 0=non brouillon, 1=brouillon
* \param user Objet user de filtre
* \return int -1 if KO, array with result if OK
* Return list of orders (eventuelly filtered on a user) into an array
*
* @param brouillon 0=non brouillon, 1=brouillon
* @param user Objet user de filtre
* @return int -1 if KO, array with result if OK
*/
function liste_array($brouillon=0, $user='')
{
@@ -1941,6 +1953,7 @@ class Commande extends CommonObject
/**
* Change les conditions de reglement de la commande
*
* @param cond_reglement_id Id de la nouvelle condition de reglement
* @return int >0 if OK, <0 if KO
*/
@@ -1974,9 +1987,10 @@ class Commande extends CommonObject
/**
* \brief Change le mode de reglement
* \param mode Id du nouveau mode
* \return int >0 si ok, <0 si ko
* Change le mode de reglement
*
* @param mode Id du nouveau mode
* @return int >0 si ok, <0 si ko
*/
function mode_reglement($mode_reglement_id)
{

View File

@@ -512,8 +512,9 @@ class Facture extends CommonObject
/**
* Load an object from its id and create a new one in database
*
* @param fromid Id of object to clone
* @param invertdetail Reverse sign of amounts for lines
* @param int $fromid Id of object to clone
* @param int $invertdetail Reverse sign of amounts for lines
* @param HookManager $hookmanager Hook manager instance
* @return int New id of clone
*/
function createFromClone($fromid,$invertdetail=0,$hookmanager=false)
@@ -600,7 +601,8 @@ class Facture extends CommonObject
/**
* Load an object from an order and create a new invoice into database
*
* @param object Object source
* @param Object $object Object source
* @param HookManager $hookmanager Hook manager instance
* @return int <0 if KO, 0 if nothing done, 1 if OK
*/
function createFromOrder($object, $hookmanager=false)

View File

@@ -259,9 +259,9 @@ abstract class CommonObject
/**
* Get array of all contacts for an object
*
* @param statut int Status of lines to get (-1=all)
* @param source string Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int list 0:Return array contains all properties, 1:Return array contains just id
* @param int $statut Status of lines to get (-1=all)
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @return array Array of contacts
*/
function liste_contact($statut=-1,$source='external',$list=0)
@@ -713,7 +713,7 @@ abstract class CommonObject
/**
* Link element with a project
*
* @param projid Project id to link element to
* @param int $projectid Project id to link element to
* @return int <0 if KO, >0 if OK
*/
function setProject($projectid)
@@ -1662,9 +1662,11 @@ abstract class CommonObject
* Show add predefined products/services form
* TODO Edit templates to use global variables and include them directly in controller call
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
* @param $dateSelector 1=Show also date range input fields
* @param $seller Object thirdparty who sell
* @param $buyer Object thirdparty who buy
*
* @param int $dateSelector 1=Show also date range input fields
* @param Societe $seller Object thirdparty who sell
* @param Societe $buyer Object thirdparty who buy
* @param HookManager $hookmanager Hook manager instance
*/
function formAddPredefinedProduct($dateSelector,$seller,$buyer,$hookmanager=false)
{
@@ -1679,7 +1681,11 @@ abstract class CommonObject
* Show add free products/services form
* TODO Edit templates to use global variables and include them directly in controller call
* But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
* @param $dateSelector 1=Show also date range input fields
*
* @param int $dateSelector 1=Show also date range input fields
* @param Societe $seller Object thirdparty who sell
* @param Societe $buyer Object thirdparty who buy
* @param HookManager $hookmanager Hook manager instance
*/
function formAddFreeProduct($dateSelector,$seller,$buyer,$hookmanager=false)
{

View File

@@ -75,7 +75,7 @@ class DolCookie
}
/**
* \brief Decrypt the cookie
* Decrypt the cookie
*/
function decryptCookie()
{
@@ -97,9 +97,14 @@ class DolCookie
}
/**
* \brief Set and create the cookie
* \param cookie Cookie name
* \param value Cookie value
* Set and create the cookie
*
* @param string $cookie Cookie name
* @param string $value Cookie value
* @param string $expire Expiration
* @param string $path Path of cookie
* @param string $domaine Domain name
* @param int $secure 0 or 1
*/
function _setCookie($cookie, $value, $expire=0, $path="/", $domain="", $secure=0)
{
@@ -116,10 +121,10 @@ class DolCookie
}
/**
* \brief Get the cookie
* \param cookie Cookie name
* \param value Cookie value
* \return decryptValue Decrypted value
* Get the cookie
*
* @param string $cookie Cookie name
* @return string Decrypted value
*/
function _getCookie($cookie)
{

File diff suppressed because it is too large Load Diff

View File

@@ -1431,9 +1431,10 @@ class CommandeFournisseur extends Commande
/**
* Update notes
* @param user
* @param note
* @param note_public
*
* @param User $user Object user
* @param string $note Private note
* @param string $note_public Public note
* @return int <0 if KO, >=0 if OK
* TODO Use instead update_note_public and update_note
*/
@@ -1548,14 +1549,15 @@ class CommandeFournisseur extends Commande
/**
* Update line
*
* @param rowid Id de la ligne de facture
* @param desc Description de la ligne
* @param pu Prix unitaire
* @param qty Quantity
* @param remise_percent Pourcentage de remise de la ligne
* @param tva_tx Taux TVA
* @param localtax1_tx Localtax1 tax
* @param localtax2_tx Localtax2 tax
* @param localtax1 Localtax1 tax
* @param localtax2 Localtax2 tax
* @param price_base_type Type of price base
* @param info_bits Miscellanous informations
* @param type Type of line (0=product, 1=service)

View File

@@ -58,10 +58,10 @@ class box_external_rss extends ModeleBoxes {
/**
* Load information for box into memory to show them later with this->showBox method.
*
* @param $max Max numbe rof records to load
* @param $cachedelay Delay we accept for cache file
* @param int $max Max numbe rof records to load
* @param int $cachedelay Delay we accept for cache file
*/
function loadBox($max=5, $cachdelay=3600)
function loadBox($max=5, $cachedelay=3600)
{
global $user, $langs, $conf;
$langs->load("boxes");
@@ -80,7 +80,7 @@ class box_external_rss extends ModeleBoxes {
$url=@constant("EXTERNAL_RSS_URLRSS_".$site);
$rssparser=new RssParser($db);
$result = $rssparser->parser($url, $this->max, $cachdelay, $conf->externalrss->dir_temp);
$result = $rssparser->parser($url, $this->max, $cachedelay, $conf->externalrss->dir_temp);
// INFO on channel
$description=$rssparser->getDescription();

View File

@@ -42,7 +42,8 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
/**
* Return list of active generation modules
* @param $db Database handler
*
* @param DoliDB $db Database handler
*/
function liste_modeles($db)
{
@@ -70,6 +71,7 @@ class ModeleNumRefCommandes
var $error='';
/** Return if a module can be used or not
*
* @return boolean true if module can be used
*/
function isEnabled()
@@ -78,6 +80,7 @@ class ModeleNumRefCommandes
}
/** Renvoie la description par defaut du modele de numerotation
*
* @return string Texte descripif
*/
function info()
@@ -88,6 +91,7 @@ class ModeleNumRefCommandes
}
/** Renvoie un exemple de numerotation
*
* @return string Example
*/
function getExample()
@@ -98,6 +102,7 @@ class ModeleNumRefCommandes
}
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
*
* @return boolean false si conflit, true si ok
*/
function canBeActivated()
@@ -106,6 +111,7 @@ class ModeleNumRefCommandes
}
/** Renvoie prochaine valeur attribuee
*
* @return string Valeur
*/
function getNextValue()
@@ -115,6 +121,7 @@ class ModeleNumRefCommandes
}
/** Renvoie version du module numerotation
*
* @return string Valeur
*/
function getVersion()
@@ -131,14 +138,16 @@ class ModeleNumRefCommandes
/**
* Cree un bon de commande sur disque en fonction d'un modele
* @param db data base object
* @param object object order
* @param modele force le modele a utiliser ('' to not force)
* @param outputlangs objet lang a utiliser pour traduction
* @param hidedetails Hide details of lines
* @param hidedesc Hide description
* @param hideref Hide ref
* Create a document onto disk accordign to template module.
*
* @param DoliDB $db Database handler
* @param Object $object Object order
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param HookManager $hookmanager Hook manager instance
* @return int 0 if KO, 1 if OK
*/
function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)

View File

@@ -130,15 +130,17 @@ class ModeleNumRefFactures
/**
* Cree une facture sur le disque en fonction du modele de FACTURE_ADDON_PDF
* @param db objet base de donnees
* @param object Object invoice
* @param message message
* @param modele force le modele a utiliser ('' to not force)
* @param outputlangs objet lang a utiliser pour traduction
* @param hidedetails Hide details of lines
* @param hidedesc Hide description
* @param hideref Hide ref
* Create a document onto disk accordign to template module.
*
* @param DoliDB $db Database handler
* @param Object $object Object invoice
* @param string $message message
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param HookManager $hookmanager Hook manager instance
* @return int <0 if KO, >0 if OK
*/
function facture_pdf_create($db, $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)

View File

@@ -39,8 +39,9 @@ class ModelePDFLabels
/**
* \brief Return list of active generation modules
* \param $db Database handler
* Return list of active generation modules
*
* @param DoliDB $db Database handler
*/
function liste_modeles($db)
{
@@ -58,13 +59,14 @@ class ModelePDFLabels
/**
* \brief Cree un fichier de cartes de visites en fonction du modele de ADHERENT_CARDS_ADDON_PDF
* \param db objet base de donnee
* \param id id de la facture a creer
* \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
* Create a document onto disk accordign to template module
*
* @param DoliDB $db objet base de donnee
* @param int $id id de la facture a creer
* @param string $message message
* @param string $modele force le modele a utiliser ('' to not force)
* @param string $outputlangs objet lang a utiliser pour traduction
* @return int <0 if KO, >0 if OK
*/
function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs)
{

View File

@@ -128,14 +128,16 @@ class ModeleNumRefPropales
/**
* Cree une propale sur disque en fonction du modele de PROPALE_ADDON_PDF
* @param db Database handler
* @param object Object proposal
* @param modele Force model to use ('' to not force)
* @param outputlangs Object langs to use for output
* @param hidedetails Hide details of lines
* @param hidedesc Hide description
* @param hideref Hide ref
* Create a document onto disk accordign to template module.
*
* @param DoliDB $db Database handler
* @param Object $object Object proposal
* @param string $modele Force model to use ('' to not force)
* @param Translate $outputlangs Object langs to use for output
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param HookManager $hookmanager Hook manager instance
* @return int 0 if KO, 1 if OK
*/
function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $hookmanager=false)

View File

@@ -34,8 +34,9 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
/**
* \brief Return list of active generation modules
* \param $db Database handler
* Return list of active generation modules
*
* @param DoliDB $db Database handler
*/
function liste_modeles($db)
{
@@ -53,12 +54,14 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
}
/**
* Create object on disk
* @param db objet base de donnee
* @param object object supplier invoice
* @param model force le modele a utiliser ('' to not force)
* @param outputlangs objet lang a utiliser pour traduction
* @return int 0 si KO, 1 si OK
* Create object on disk.
*
* @param DoliDB $db objet base de donnee
* @param Object $object object supplier invoice
* @param string $model force le modele a utiliser ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @param HookManager $hookmanager Hook manager instance
* @return int 0 if KO, 1 if OK
*/
function supplier_invoice_pdf_create($db, $object, $model, $outputlangs)
{

View File

@@ -70,6 +70,7 @@ class ModeleNumRefSuppliersOrders
var $error='';
/** Return if a module can be used or not
*
* @return boolean true if module can be used
*/
function isEnabled()
@@ -78,6 +79,7 @@ class ModeleNumRefSuppliersOrders
}
/** Renvoie la description par defaut du modele de numerotation
*
* @return string Texte descripif
*/
function info()
@@ -88,6 +90,7 @@ class ModeleNumRefSuppliersOrders
}
/** Renvoie un exemple de numerotation
*
* @return string Example
*/
function getExample()
@@ -98,6 +101,7 @@ class ModeleNumRefSuppliersOrders
}
/** Test si les numeros deja en vigueur dans la base ne provoquent pas de conflits qui empecheraient cette numerotation de fonctionner.
*
* @return boolean false si conflit, true si ok
*/
function canBeActivated()
@@ -106,6 +110,7 @@ class ModeleNumRefSuppliersOrders
}
/** Renvoie prochaine valeur attribuee
*
* @return string Valeur
*/
function getNextValue()
@@ -115,6 +120,7 @@ class ModeleNumRefSuppliersOrders
}
/** Renvoie version du module numerotation
*
* @return string Valeur
*/
function getVersion()
@@ -131,14 +137,16 @@ class ModeleNumRefSuppliersOrders
/**
* Cree un bon de commande sur disque en fonction d'un modele
* @param db data base object
* @param object object order
* @param modele force le modele a utiliser ('' to not force)
* @param outputlangs objet lang a utiliser pour traduction
* @param hidedetails Hide details of lines
* @param hidedesc Hide description
* @param hideref Hide ref
* Create a document onto disk accordign to template module.
*
* @param DoliDB $db data base object
* @param Object $object object order
* @param string $modele force le modele a utiliser ('' to not force)
* @param Translate $outputlangs Objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param HookManager $hookmanager Hook manager instance
* @return int 0 if KO, 1 if OK
*/
function supplier_order_pdf_create($db, $object, $model, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)

View File

@@ -673,7 +673,8 @@ pFooter($error,$setuplang,'jsinfo');
/**
* Create main file. No particular permissions are set by installer.
*
* @param mainfile Path to conf file to generate/update
* @param string $mainfile Full path name of main file to generate/update
* @param string $main_dir Full path name to main.inc.php file
*/
function write_main_file($mainfile,$main_dir)
{
@@ -693,7 +694,8 @@ function write_main_file($mainfile,$main_dir)
/**
* Create master file. No particular permissions are set by installer.
*
* @param masterfile Path to conf file to generate/update
* @param string $masterfile Full path name of master file to generate/update
* @param string $main_dir Full path name to master.inc.php file
*/
function write_master_file($masterfile,$main_dir)
{

View File

@@ -39,7 +39,7 @@ class AntiVir
/**
* Constructor
*
* @param DoliDB $DB Database handler
* @param DoliDB $db Database handler
* @return AntiVir
*/
function AntiVir($db)
@@ -50,6 +50,7 @@ class AntiVir
/**
* Scan a file with antivirus.
* This function runs the command defined in setup. This antivirus command must return 0 if OK.
*
* @param file File to scan
* @return int <0 if KO (-98 if error, -99 if virus), 0 if OK
*/

View File

@@ -800,15 +800,16 @@ class DoliDb
}
/**
\brief Cree une table
\param table Nom de la table
\param fields Tableau associatif [nom champ][tableau des descriptions]
\param primary_key Nom du champ qui sera la clef primaire
\param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
\param fulltext Tableau des Nom de champs qui seront indexes en fulltext
\param key Tableau des champs cles noms => valeur
\param type Type de la table
\return int <0 si KO, >=0 si OK
* Create a table into database
*
* @param string $table Nom de la table
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
* @param string $primary_key Nom du champ qui sera la clef primaire
* @param string $type Type de la table
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param string $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK
*/
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
{

View File

@@ -842,15 +842,16 @@ class DoliDb
}
/**
* \brief Cree une table
* \param table Nom de la table
* \param fields Tableau associatif [nom champ][tableau des descriptions]
* \param primary_key Nom du champ qui sera la clef primaire
* \param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* \param fulltext Tableau des Nom de champs qui seront indexes en fulltext
* \param key Tableau des champs cles noms => valeur
* \param type Type de la table
* \return int <0 si KO, >=0 si OK
* Create a table into database
*
* @param string $table Nom de la table
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
* @param string $primary_key Nom du champ qui sera la clef primaire
* @param string $type Type de la table
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param string $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK
*/
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
{

View File

@@ -687,9 +687,10 @@ class DoliDb
}
/**
* \brief Recupere l'id genere par le dernier INSERT.
* \param tab Nom de la table concernee par l'insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql
* \return int id
* Recupere l'id genere par le dernier INSERT.
*
* @param tab Nom de la table concernee par l'insert. Ne sert pas sous MySql mais requis pour compatibilite avec Postgresql
* @return int id
*/
function last_insert_id($tab)
{
@@ -699,6 +700,7 @@ class DoliDb
/**
* Encrypt sensitive data in database
* Warning: This function includes the escape, so it must use direct value
*
* @param fieldorvalue Field name or value to encrypt
* @param withQuotes Return string with quotes
* @return return XXX(field) or XXX('value') or field or 'value'
@@ -852,15 +854,16 @@ class DoliDb
}
/**
* \brief Cree une table
* \param table Nom de la table
* \param fields Tableau associatif [nom champ][tableau des descriptions]
* \param primary_key Nom du champ qui sera la clef primaire
* \param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* \param fulltext Tableau des Nom de champs qui seront indexes en fulltext
* \param key Tableau des champs cles noms => valeur
* \param type Type de la table
* \return int <0 si KO, >=0 si OK
* Create a table into database
*
* @param string $table Nom de la table
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
* @param string $primary_key Nom du champ qui sera la clef primaire
* @param string $type Type de la table
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param string $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK
*/
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
{

View File

@@ -989,17 +989,16 @@ class DoliDb
/**
* Cree une table
* Create a table into database
*
* @param table Nom de la table
* @param fields Tableau associatif [nom champ][tableau des descriptions]
* @param primary_key Nom du champ qui sera la clef primaire
* @param unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param fulltext Tableau des Nom de champs qui seront indexes en fulltext
* @param key Tableau des champs cles noms => valeur
* @param type Type de la table
* @return int <0 si KO, >=0 si OK
* TODO
* @param string $table Nom de la table
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
* @param string $primary_key Nom du champ qui sera la clef primaire
* @param string $type Type de la table
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
* @param array $fulltext_keys Tableau des Nom de champs qui seront indexes en fulltext
* @param string $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK
*/
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys="",$fulltext_keys="",$keys="")
{
@@ -1060,7 +1059,7 @@ class DoliDb
$sql .=") type=".$type;
dol_syslog($sql,LOG_DEBUG);
if(! $this -> query($sql))
if(! $this->query($sql))
return -1;
else
return 1;

View File

@@ -48,19 +48,19 @@ class DolEditor
/**
* Create an object to build an HTML area to edit a large string content
*
* @param htmlname HTML name of WYSIWIG form
* @param content Content of WYSIWIG form
* @param width Width in pixel of edit area (auto by default)
* @param height Height in pixel of edit area (200px by default)
* @param toolbarname Name of bar set to use ('Full', 'dolibarr_notes', 'dolibarr_details', 'dolibarr_mailings')
* @param toolbarlocation Where bar is stored :
* @param string $htmlname HTML name of WYSIWIG form
* @param string $content Content of WYSIWIG form
* @param int $width Width in pixel of edit area (auto by default)
* @param int $height Height in pixel of edit area (200px by default)
* @param string $toolbarname Name of bar set to use ('Full', 'dolibarr_notes', 'dolibarr_details', 'dolibarr_mailings')
* @param string $toolbarlocation Where bar is stored :
* 'In' each window has its own toolbar
* 'Out:name' share toolbar into the div called 'name'
* @param toolbarstartexpanded Bar is visible or not at start
* @param uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content.
* @param okforextandededitor True=Allow usage of extended editor tool (like fckeditor)
* @param rows Size of rows for textarea tool
* @param cols Size of cols for textarea tool
* @param boolean $toolbarstartexpanded Bar is visible or not at start
* @param int $uselocalbrowser Enabled to add links to local object with local browser. If false, only external images can be added in content.
* @param int $okforextendededitor True=Allow usage of extended editor tool (like fckeditor)
* @param int $rows Size of rows for textarea tool
* @param int $cols Size of cols for textarea tool
*/
function DolEditor($htmlname,$content,$width='',$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextendededitor=true,$rows=0,$cols=0)
{

View File

@@ -1586,13 +1586,13 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8')
/**
* Show a picto called object_picto (generic function)
*
* @param alt Text of alt on image
* @param picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...)
* @param string $alt Text of alt on image
* @param string $picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...)
* For external modules use imagename@mymodule to search into directory "img" of module.
* @param options Add more attribute on img tag
* @param pictoisfullpath If 1, image path is a full path
* @param string $options Add more attribute on img tag
* @param int $pictoisfullpath If 1, image path is a full path
* @return string Return img tag
* @see img_picto, img_picto_common
* @see #img_picto, #img_picto_common
*/
function img_object($alt, $picto, $options='', $pictoisfullpath=0)
{
@@ -1624,16 +1624,16 @@ function img_object($alt, $picto, $options='', $pictoisfullpath=0)
/**
* Show picto whatever it's its name (generic function)
*
* @param alt Text on alt and title of image
* @param picto Name of image file to show ('filenew', ...)
* @param string $alt Text on alt and title of image
* @param string $picto Name of image file to show ('filenew', ...)
* If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory.
* Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img
* Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img
* Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1)
* @param options Add more attribute on img tag (For example 'style="float: right"')
* @param pictoisfullpath If 1, image path is a full path
* @param string $options Add more attribute on img tag (For example 'style="float: right"')
* @param int $pictoisfullpath If 1, image path is a full path
* @return string Return img tag
* @see img_object, img_picto_common
* @see #img_object, #img_picto_common
*/
function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
{
@@ -1665,12 +1665,12 @@ function img_picto($alt, $picto, $options='', $pictoisfullpath=0)
/**
* Show picto (generic function)
*
* @param alt Text on alt and title of image
* @param picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
* @param options Add more attribute on img tag
* @param pictoisfullpath If 1, image path is a full path
* @param string $alt Text on alt and title of image
* @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory.
* @param string $options Add more attribute on img tag
* @param int $pictoisfullpath If 1, image path is a full path
* @return string Return img tag
* @see img_object, img_picto
* @see #img_object, #img_picto
*/
function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0)
{

View File

@@ -724,6 +724,7 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide
/**
* Return line description translated in outputlangs and encoded in UTF8
*
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
@@ -856,9 +857,12 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
/**
* Return line num
* @param object Object
* @param $i Current line number
* @param outputlangs Object langs for output
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -877,9 +881,12 @@ function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0,$hookmanager=fals
/**
* Return line product ref
* @param object Object
* @param $i Current line number
* @param outputlang Object lang for output
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -897,9 +904,12 @@ function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0,$hookmanager=fals
/**
* Return line ref_supplier
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -917,13 +927,12 @@ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0,$hookman
/**
* Return line vat rate
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
* @param hidedetails Hide value
* 0 = no
* 1 = yes
* 2 = just special lines
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -942,13 +951,12 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0,$hookmanager=
/**
* Return line unit price excluding tax
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
* @param hidedetails Hide value
* 0 = no
* 1 = yes
* 2 = just special lines
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -967,13 +975,12 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanage
/**
* Return line quantity
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
* @param hidedetails Hide value
* 0 = no
* 1 = yes
* 2 = just special lines
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -995,13 +1002,12 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0,$hookmanager=fals
/**
* Return line quantity asked
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
* @param hidedetails Hide value
* 0 = no
* 1 = yes
* 2 = just special lines
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -1023,13 +1029,12 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0,$hookmanage
/**
* Return line quantity shipped
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
* @param hidedetails Hide value
* 0 = no
* 1 = yes
* 2 = just special lines
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -1051,13 +1056,12 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0,$hookmana
/**
* Return line keep to ship quantity
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
* @param hidedetails Hide value
* 0 = no
* 1 = yes
* 2 = just special lines
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -1079,13 +1083,12 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0,$hookm
/**
* Return line remise percent
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
* @param hidedetails Hide value
* 0 = no
* 1 = yes
* 2 = just special lines
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -1109,13 +1112,12 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0,$hookma
/**
* Return line total excluding tax
* @param object Object
* @param i Current line number
* @param outputlangs Object langs for output
* @param hidedetails Hide value
* 0 = no
* 1 = yes
* 2 = just special lines
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanager=false)
{
@@ -1141,9 +1143,11 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0,$hookman
/**
* Return total quantity of products and/or services
* @param object Object
* @param type Type of line (all=all, 0=product, 1=service, 9=other)
* @param outputlangs Object langs for output
*
* @param Object $object Object
* @param string $type Type
* @param Translate $outputlangs Object langs for output
* @param HookManager $hookmanager Hook manager instance
*/
function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
{
@@ -1182,8 +1186,9 @@ function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
/**
* Convert a currency code into its symbol
*
* @param pdf PDF object
* @param currency_code
* @param currency_code Currency code
* @param string Currency symbol encoded into UTF8
*/
function pdf_getCurrencySymbol(&$pdf, $currency_code)

View File

@@ -92,7 +92,9 @@ function delivery_prepare_head($object)
/**
* List sendings and receive receipts
*
* @param $option
* @param string $origin Origin
* @param int $origin_id Origin id
* @param string $filter Filter
* @return
*/
function show_list_sending_receive($origin='commande',$origin_id,$filter='')

View File

@@ -481,7 +481,7 @@ function CalEncode($line)
* Encode into vcal format
*
* @param string $str String to convert
* @param int forcal 1=For cal
* @param int $forcal 1=For cal
* @return string String converted
*/
function QPEncode($str,$forcal=0)

View File

@@ -62,8 +62,13 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP6
}
}
// Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST)
function test_sql_and_script_inject($val,$get)
/**
* Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST)
*
* @param string $val Value
* @param string $get 1=GET, 0=POST
*/
function test_sql_and_script_inject($val, $get)
{
$sql_inj = 0;
// For SQL Injection
@@ -80,8 +85,13 @@ function test_sql_and_script_inject($val,$get)
if ($get) $sql_inj += preg_match('/"/i', $val); // We refused " in GET parameters value
return $sql_inj;
}
// Security: Return true if OK, false otherwise
function analyse_sql_and_script(&$var,$get)
/**
* Security: Return true if OK, false otherwise
*
* @param string $var Variable name
* @param string $get 1=GET, 0=POST
*/
function analyse_sql_and_script(&$var, $get)
{
if (is_array($var))
{
@@ -815,7 +825,6 @@ function top_httphead()
*
* @param string $head Optionnal head lines
* @param string $title HTML title
* @param string $help_url Link to online url help to show on left menu
* @param int $disablejs More content into html header
* @param int $disablehead More content into html header
* @param array $arrayofjs Array of complementary js files
@@ -1057,14 +1066,14 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
/**
* Show an HTML header + a BODY + The top menu bar
*
* @param string head Lines in the HEAD
* @param string title Title of web page
* @param string target Target to use in menu links
* @param int disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
* @param int disablehead Do not output head section
* @param array arrayofjs Array of js files to add in header
* @param array arrayofcss Array of css files to add in header
* @param string morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
* @param string $head Lines in the HEAD
* @param string $title Title of web page
* @param string $target Target to use in menu links
* @param int $disablejs Do not output links to js (Ex: qd fonction utilisee par sous formulaire Ajax)
* @param int $disablehead Do not output head section
* @param array $arrayofjs Array of js files to add in header
* @param array $arrayofcss Array of css files to add in header
* @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails)
*/
function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='')
{

View File

@@ -44,7 +44,7 @@ class ActionsCardProduct extends Product
* Constructor
*
* @param DoliDB $DB Handler acces base de donnees
* @param string $targmetmodule Name of directory of module where canvas is stored
* @param string $targetmodule Name of directory of module where canvas is stored
* @param string $canvas Name of canvas
* @param string $card Name of tab (sub-canvas)
*/

View File

@@ -44,7 +44,7 @@ class ActionsCardService extends Product
* Constructor
*
* @param DoliDB $DB Handler acces base de donnees
* @param string $targmetmodule Name of directory of module where canvas is stored
* @param string $targetmodule Name of directory of module where canvas is stored
* @param string $canvas Name of canvas
* @param string $card Name of tab (sub-canvas)
*/

View File

@@ -47,8 +47,8 @@ abstract class ActionsCardCommon
/**
* Constructor
*
* @param DoliDB $DB Handler acces base de donnees
* @param string $targmetmodule Name of directory of module where canvas is stored
* @param DoliDB $DB Database handler
* @param string $targetmodule Name of directory of module where canvas is stored
* @param string $canvas Name of canvas
* @param string $card Name of tab (sub-canvas)
*/

View File

@@ -38,7 +38,7 @@ class ActionsCardDefault extends ActionsCardCommon
* Constructor
*
* @param DoliDB $DB Handler acces base de donnees
* @param string $targmetmodule Name of directory of module where canvas is stored
* @param string $targetmodule Name of directory of module where canvas is stored
* @param string $canvas Name of canvas
* @param string $card Name of tab (sub-canvas)
*/

View File

@@ -37,7 +37,7 @@ class ActionsCardIndividual extends ActionsCardCommon
* Constructor
*
* @param DoliDB $DB Handler acces base de donnees
* @param string $targmetmodule Name of directory of module where canvas is stored
* @param string $targetmodule Name of directory of module where canvas is stored
* @param string $canvas Name of canvas
* @param string $card Name of tab (sub-canvas)
*/

View File

@@ -64,11 +64,12 @@ class Address
}
/**
* \brief Cree l'adresse de la societe en base
* \param user Objet utilisateur qui demande la creation
* \return int 0 si ok, < 0 si erreur
* Create address into database
*
* @param socid Company socid
* @param user Object user making creation
* @return int 0 if OK, < 0 if KO
*/
function create($socid, $user='')
{
global $langs,$conf;
@@ -135,8 +136,9 @@ class Address
/**
* \brief Verification lors de la modification de l'adresse
* \return 0 si ok, < 0 en cas d'erreur
* Verification lors de la modification de l'adresse
*
* @return int 0 if OK, <0 if KO
*/
function verify()
{
@@ -153,10 +155,12 @@ class Address
/**
* \brief Mise a jour des parametres de l'adresse
* \param id id address
* \param user Utilisateur qui demande la mise a jour
* \return int <0 si ko, >=0 si ok
* Mise a jour des parametres de l'adresse
*
* @param id id address
* @param socid id third party
* @param user Utilisateur qui demande la mise a jour
* @return int <0 si ko, >=0 si ok
*/
function update($id, $socid, $user='')
{
@@ -401,8 +405,10 @@ class Address
/**
* \brief Suppression d'une adresse
* \param id id de la societe a supprimer
* Suppression d'une adresse
*
* @param id id de la societe a supprimer
* @param socid id third party
*/
function delete($id,$socid)
{
@@ -421,9 +427,10 @@ class Address
}
/*
* \brief Charge les informations d'ordre info dans l'objet societe
* \param id id de la societe a charger
/**
* Charge les informations d'ordre info dans l'objet societe
*
* @param id id de la societe a charger
*/
function info($id)
{