This commit is contained in:
Laurent Destailleur 2011-09-12 18:15:11 +00:00
parent 0d2d1bd5eb
commit d9408d1847
13 changed files with 163 additions and 177 deletions

View File

@ -143,7 +143,7 @@ class Adherent extends CommonObject
* @param addr_bcc email bcc * @param addr_bcc email bcc
* @param deliveryreceipt demande accuse reception * @param deliveryreceipt demande accuse reception
* @param msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection * @param msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection
* @param errorsto erros to * @param errors_to erros to
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='') function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='')
@ -1454,6 +1454,7 @@ class Adherent extends CommonObject
/** /**
* Fonction qui dit si cet utilisateur est un redacteur existant dans spip * Fonction qui dit si cet utilisateur est un redacteur existant dans spip
*
* @return int 1=existe, 0=n'existe pas, -1=erreur * @return int 1=existe, 0=n'existe pas, -1=erreur
*/ */
function is_in_spip() function is_in_spip()
@ -1476,20 +1477,19 @@ class Adherent extends CommonObject
{ {
if ($mydb->num_rows($result)) if ($mydb->num_rows($result))
{ {
# nous avons au moins une reponse // nous avons au moins une reponse
$mydb->close($result); $mydb->close($result);
return 1; return 1;
} }
else else
{ {
# nous n'avons pas de reponse => n'existe pas // nous n'avons pas de reponse => n'existe pas
$mydb->close($result); $mydb->close($result);
return 0; return 0;
} }
} }
else else
{ {
# error
$this->error=$mydb->error(); $this->error=$mydb->error();
return -1; return -1;
} }
@ -1502,6 +1502,7 @@ class Adherent extends CommonObject
/** /**
* Subscribe an email to all mailing-lists * Subscribe an email to all mailing-lists
*
* @param listes To force mailing-list (string separated with ,) * @param listes To force mailing-list (string separated with ,)
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
@ -1582,6 +1583,7 @@ class Adherent extends CommonObject
/** /**
* Unsubscribe an email from all mailing-lists * Unsubscribe an email from all mailing-lists
* Used when a user is resiliated * Used when a user is resiliated
*
* @param listes To force mailing-list (string separated with ,) * @param listes To force mailing-list (string separated with ,)
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
*/ */
@ -1654,6 +1656,7 @@ class Adherent extends CommonObject
/** /**
* Return full name (civility+' '+name+' '+lastname) * Return full name (civility+' '+name+' '+lastname)
*
* @param langs Language object for translation of civility * @param langs Language object for translation of civility
* @param option 0=No option, 1=Add civility * @param option 0=No option, 1=Add civility
* @param nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname * @param nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname
@ -1691,6 +1694,7 @@ class Adherent extends CommonObject
/** /**
* Return label of a civility of a contact * Return label of a civility of a contact
*
* @param nohtmlentities 0=Encode with htmlentities for HTML output, 1=No htmlentities for memory translation * @param nohtmlentities 0=Encode with htmlentities for HTML output, 1=No htmlentities for memory translation
* @return string Name translated of civility * @return string Name translated of civility
*/ */
@ -1706,6 +1710,7 @@ class Adherent extends CommonObject
/** /**
* Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
*
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param maxlen length max libelle * @param maxlen length max libelle
* @param option Page lien * @param option Page lien
@ -1740,6 +1745,7 @@ class Adherent extends CommonObject
/** /**
* Return full address of member * Return full address of member
*
* @param withcountry 1=Add country into address string * @param withcountry 1=Add country into address string
* @param sep Separator to use to build string * @param sep Separator to use to build string
* @return string Full address string * @return string Full address string
@ -1765,6 +1771,7 @@ class Adherent extends CommonObject
/** /**
* Retourne le libelle du statut d'un adherent (brouillon, valide, resilie) * Retourne le libelle du statut d'un adherent (brouillon, valide, resilie)
*
* @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
* @return string Libelle * @return string Libelle
*/ */
@ -1775,6 +1782,7 @@ class Adherent extends CommonObject
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
*
* @param statut Id statut * @param statut Id statut
* @param need_subscription 1 si type adherent avec cotisation, 0 sinon * @param need_subscription 1 si type adherent avec cotisation, 0 sinon
* @param date_end_subscription Date fin adhesion * @param date_end_subscription Date fin adhesion
@ -1856,6 +1864,7 @@ class Adherent extends CommonObject
/** /**
* Charge indicateurs this->nb de tableau de bord * Charge indicateurs this->nb de tableau de bord
*
* @return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */
function load_state_board() function load_state_board()
@ -1889,6 +1898,7 @@ class Adherent extends CommonObject
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param user Objet user * @param user Objet user
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
@ -1979,6 +1989,7 @@ class Adherent extends CommonObject
/** /**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
* @param info Info string loaded by _load_ldap_info * @param info Info string loaded by _load_ldap_info
* @param mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb) * @param mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
* 1=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb) * 1=Return DN without key inside (ou=xxx,dc=aaa,dc=bbb)
@ -1998,6 +2009,7 @@ class Adherent extends CommonObject
/** /**
* Initialise tableau info (tableau des attributs LDAP) * Initialise tableau info (tableau des attributs LDAP)
*
* @return array Tableau info des attributs * @return array Tableau info des attributs
*/ */
function _load_ldap_info() function _load_ldap_info()
@ -2044,7 +2056,8 @@ class Adherent extends CommonObject
/** /**
* Charge les informations d'ordre info dans l'objet adherent * Charge les informations d'ordre info dans l'objet adherent
* @param id Id du membre a charger *
* @param int $id Id of member to load
*/ */
function info($id) function info($id)
{ {

View File

@ -61,11 +61,12 @@ class AdherentType extends CommonObject
/** /**
* \brief Fonction qui permet de creer le status de l'adherent * Fonction qui permet de creer le status de l'adherent
* \param userid userid de l'adherent *
* \return > 0 si ok, < 0 si ko * @param User $user User making creation
* @return >0 if OK, < 0 if KO
*/ */
function create($userid) function create($user)
{ {
global $conf; global $conf;
@ -84,7 +85,7 @@ class AdherentType extends CommonObject
if ($result) if ($result)
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."adherent_type"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."adherent_type");
return $this->update(); return $this->update($user);
} }
else else
{ {
@ -95,10 +96,12 @@ class AdherentType extends CommonObject
/** /**
* \brief Met a jour en base donnees du type * Met a jour en base donnees du type
* \return > 0 si ok, < 0 si ko *
* @param User $user Object user making change
* @return int >0 if OK, < 0 if KO
*/ */
function update() function update($user)
{ {
$this->libelle=trim($this->libelle); $this->libelle=trim($this->libelle);
@ -110,11 +113,9 @@ class AdherentType extends CommonObject
$sql.= "note = '".$this->db->escape($this->note)."',"; $sql.= "note = '".$this->db->escape($this->note)."',";
$sql.= "vote = '".$this->vote."',"; $sql.= "vote = '".$this->vote."',";
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'"; $sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
$sql .= " WHERE rowid = $this->id"; $sql .= " WHERE rowid = $this->id";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
return 1; return 1;
@ -127,12 +128,13 @@ class AdherentType extends CommonObject
} }
/** /**
* \brief Fonction qui permet de supprimer le status de l'adherent * Fonction qui permet de supprimer le status de l'adherent
* \param rowid *
* @param int $rowid Id of member type to delete
* @return int >0 if OK, < 0 if KO
*/ */
function delete($rowid) function delete($rowid)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = $rowid"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = $rowid";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@ -155,9 +157,10 @@ class AdherentType extends CommonObject
} }
/** /**
* \brief Fonction qui permet de recuperer le status de l'adherent * Fonction qui permet de recuperer le status de l'adherent
* \param rowid *
* \return int <0 si KO, >0 si OK * @param int $rowid Id of member type to load
* @return int <0 if KO, >0 if OK
*/ */
function fetch($rowid) function fetch($rowid)
{ {
@ -237,10 +240,9 @@ class AdherentType extends CommonObject
/** /**
* Renvoie nom clicable (avec eventuellement le picto) * Renvoie nom clicable (avec eventuellement le picto)
* *
* @param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* @param maxlen length max libelle * @param int $maxlen length max libelle
* @param option Page lien * @return string String with URL
* @return string Chaine avec URL
*/ */
function getNomUrl($withpicto=0,$maxlen=0) function getNomUrl($withpicto=0,$maxlen=0)
{ {

View File

@ -279,26 +279,29 @@ class Propal extends CommonObject
/** /**
* Add a proposal line into database (linked to product/service or not) * Add a proposal line into database (linked to product/service or not)
* \param propalid Id de la propale * Les parametres sont deja cense etre juste et avec valeurs finales a l'appel
* \param desc Description de la ligne
* \param pu_ht Prix unitaire
* \param qty Quantite
* \param txtva Taux de tva
* \param txlocaltax1 Local tax 1 rate
* \param txlocaltax2 Local tax 2 rate
* \param fk_product Id du produit/service predefini
* \param remise_percent Pourcentage de remise de la ligne
* \param price_base_type HT or TTC
* \param pu_ttc Prix unitaire TTC
* \param info_bits Bits de type de lignes
* \param type Type of line (product, service)
* \param rang Position of line
* \return int >0 if OK, <0 if KO
* @see add_product
* \remarks Les parametres sont deja cense etre juste et avec valeurs finales a l'appel
* de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini * de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,'',produit) * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,'',produit)
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
*
* @param propalid Id de la propale
* @param desc Description de la ligne
* @param pu_ht Prix unitaire
* @param qty Quantite
* @param txtva Taux de tva
* @param txlocaltax1 Local tax 1 rate
* @param txlocaltax2 Local tax 2 rate
* @param fk_product Id du produit/service predefini
* @param remise_percent Pourcentage de remise de la ligne
* @param price_base_type HT or TTC
* @param pu_ttc Prix unitaire TTC
* @param info_bits Bits de type de lignes
* @param type Type of line (product, service)
* @param rang Position of line
* @param special_code Special code
* @param fk_parent_line Id of parent line
* @return int >0 if OK, <0 if KO
* @see add_product
*/ */
function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0) function addline($propalid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $pu_ttc=0, $info_bits=0, $type=0, $rang=-1, $special_code=0, $fk_parent_line=0)
{ {

View File

@ -47,7 +47,7 @@ abstract class ActionsContactCardCommon
* Constructor * Constructor
* *
* @param DoliDB $DB Handler acces base de donnees * @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 $canvas Name of canvas
* @param streing $card Name of tab (sub-canvas) * @param streing $card Name of tab (sub-canvas)
*/ */
@ -62,6 +62,8 @@ abstract class ActionsContactCardCommon
/** /**
* Load data control * Load data control
*
* @param int $id Id of object
*/ */
function doActions($id) function doActions($id)
{ {
@ -186,6 +188,8 @@ abstract class ActionsContactCardCommon
/** /**
* Return the title of card * Return the title of card
*
* @param string $action Type of action
*/ */
function getTitle($action) function getTitle($action)
{ {
@ -201,7 +205,8 @@ abstract class ActionsContactCardCommon
/** /**
* Set content of ->tpl array, to use into template * Set content of ->tpl array, to use into template
* @param action Type of template *
* @param string $action Type of action
*/ */
function assign_values($action='') function assign_values($action='')
{ {

View File

@ -38,7 +38,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
* Constructor * Constructor
* *
* @param DoliDB $DB Handler acces base de donnees * @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 $canvas Name of canvas
* @param string $card Name of tab (sub-canvas) * @param string $card Name of tab (sub-canvas)
*/ */
@ -50,24 +50,6 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
$this->card = $card; $this->card = $card;
} }
/**
* Execute actions
* @param Id of object (may be empty for creation)
*/
function doActions($id)
{
$return = parent::doActions($id);
return $return;
}
/**
* Return the title of card
*/
function getTitle($action)
{
return parent::getTitle($action);
}
/** /**
* Assigne les valeurs POST dans l'objet * Assigne les valeurs POST dans l'objet
@ -79,7 +61,8 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
/** /**
* Assign custom values for canvas * Assign custom values for canvas
* @param action Type of action *
* @param string $action Type of action
*/ */
function assign_values($action='') function assign_values($action='')
{ {
@ -122,6 +105,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
/** /**
* Check permissions of a user to show a page and an object. Check read permission * Check permissions of a user to show a page and an object. Check read permission
* If $_REQUEST['action'] defined, we also check write permission. * If $_REQUEST['action'] defined, we also check write permission.
*
* @param user User to check * @param user User to check
* @param features Features to check (in most cases, it's module name) * @param features Features to check (in most cases, it's module name)
* @param objectid Object ID if we want to check permission on a particular record (optionnal) * @param objectid Object ID if we want to check permission on a particular record (optionnal)

View File

@ -61,7 +61,7 @@ class RssParser
/** /**
* Constructor * Constructor
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
*/ */
public function RssParser($db) public function RssParser($db)
{ {

View File

@ -590,7 +590,7 @@ class SMTPs
* This is defaulted to '25' * This is defaulted to '25'
* This is used only with 'socket' based mail transmission * This is used only with 'socket' based mail transmission
* *
* @param int $_smtpsPort Port Number of the Mail Server to use * @param int $_intPort Port Number of the Mail Server to use
* @return void * @return void
*/ */
function setPort($_intPort) function setPort($_intPort)
@ -604,7 +604,7 @@ class SMTPs
* Retrieves the Port Number of the Mail Server to use * Retrieves the Port Number of the Mail Server to use
* This is used only with 'socket' based mail transmission * This is used only with 'socket' based mail transmission
* *
* @return string $_smtpsPort Port Number of the Mail Server to use * @return string Port Number of the Mail Server to use
*/ */
function getPort() function getPort()
{ {
@ -625,7 +625,7 @@ class SMTPs
/** /**
* Retrieves the User Name for authentication on Mail Server * Retrieves the User Name for authentication on Mail Server
* *
* @return string _smtpsID User Name for authentication on Mail Server * @return string User Name for authentication on Mail Server
*/ */
function getID() function getID()
{ {
@ -646,7 +646,7 @@ class SMTPs
/** /**
* Retrieves the User Password for authentication on Mail Server * Retrieves the User Password for authentication on Mail Server
* *
* @return string $_smtpsPW User Password for authentication on Mail Server * @return string User Password for authentication on Mail Server
*/ */
function getPW() function getPW()
{ {
@ -732,7 +732,7 @@ class SMTPs
/** /**
* Retrieves the Content-Transfer-Encoding * Retrieves the Content-Transfer-Encoding
* *
* @return string $_smtpsTransEncode Content-Transfer-Encoding * @return string Content-Transfer-Encoding
*/ */
function getTransEncodeType() function getTransEncodeType()
{ {
@ -854,7 +854,8 @@ class SMTPs
* - $_aryEmail[host] = "domain.tld" * - $_aryEmail[host] = "domain.tld"
* - $_aryEmail[user] = "userName" * - $_aryEmail[user] = "userName"
* *
* @return array $_aryEmail An array of the various parts of an email address * @param string $_strAddr Email address
* @return array An array of the various parts of an email address
*/ */
function _strip_email($_strAddr) function _strip_email($_strAddr)
{ {
@ -896,7 +897,7 @@ class SMTPs
* This is a "build as you go" method. Each time this method is called * This is a "build as you go" method. Each time this method is called
* the underlaying array is destroyed and reconstructed. * the underlaying array is destroyed and reconstructed.
* *
* @return array $_RCPT_list Returns an array of bares addresses * @return array Returns an array of bares addresses
*/ */
function get_RCPT_list() function get_RCPT_list()
{ {
@ -925,7 +926,7 @@ class SMTPs
* Returns an array of addresses for a specific type; TO, CC or BCC * Returns an array of addresses for a specific type; TO, CC or BCC
* *
* @param mixed $_which Which collection of adresses to return * @param mixed $_which Which collection of adresses to return
* @return array $_RCPT_list Array of emaill address * @return array Array of emaill address
*/ */
function get_email_list($_which = null) function get_email_list($_which = null)
{ {
@ -987,7 +988,7 @@ class SMTPs
/** /**
* Retrieves the TO Address[es] inwhich to send mail to * Retrieves the TO Address[es] inwhich to send mail to
* *
* @return string $_msgRecipients TO Address[es] inwhich to send mail to * @return string TO Address[es] inwhich to send mail to
*/ */
function getTo() function getTo()
{ {
@ -997,7 +998,7 @@ class SMTPs
/** /**
* CC Address[es] inwhich to send mail to * CC Address[es] inwhich to send mail to
* *
* @param string $_msgRecipients CC Address[es] inwhich to send mail to * @param string $_strCC CC Address[es] inwhich to send mail to
* @return void * @return void
*/ */
function setCC($_strCC) function setCC($_strCC)
@ -1009,7 +1010,7 @@ class SMTPs
/** /**
* Retrieves the CC Address[es] inwhich to send mail to * Retrieves the CC Address[es] inwhich to send mail to
* *
* @return string $_msgRecipients CC Address[es] inwhich to send mail to * @return string CC Address[es] inwhich to send mail to
*/ */
function getCC() function getCC()
{ {
@ -1019,7 +1020,7 @@ class SMTPs
/** /**
* BCC Address[es] inwhich to send mail to * BCC Address[es] inwhich to send mail to
* *
* @param string $_msgRecipients BCC Address[es] inwhich to send mail to * @param string $_strBCC Recipients BCC Address[es] inwhich to send mail to
* @return void * @return void
*/ */
function setBCC($_strBCC) function setBCC($_strBCC)
@ -1031,7 +1032,7 @@ class SMTPs
/** /**
* Retrieves the BCC Address[es] inwhich to send mail to * Retrieves the BCC Address[es] inwhich to send mail to
* *
* @return string $_msgRecipients BCC Address[es] inwhich to send mail to * @return string BCC Address[es] inwhich to send mail to
*/ */
function getBCC() function getBCC()
{ {
@ -1041,7 +1042,7 @@ class SMTPs
/** /**
* Message Subject * Message Subject
* *
* @param string $_msgSubject Message Subject * @param string $_strSubject Message Subject
* @return void * @return void
*/ */
function setSubject($_strSubject = '') function setSubject($_strSubject = '')
@ -1053,7 +1054,7 @@ class SMTPs
/** /**
* Retrieves the Message Subject * Retrieves the Message Subject
* *
* @return string $_msgSubject Message Subject * @return string Message Subject
*/ */
function getSubject() function getSubject()
{ {
@ -1352,7 +1353,7 @@ class SMTPs
* - [2] Private * - [2] Private
* - [3] Company Confidential * - [3] Company Confidential
* *
* @param string $_msgSensitivity Message Sensitivity * @param string Message Sensitivity
* @return void * @return void
*/ */
function getSensitivity() function getSensitivity()
@ -1390,7 +1391,6 @@ class SMTPs
* - [4] 'Low' * - [4] 'Low'
* - [5] 'Lowest' * - [5] 'Lowest'
* *
* @param string $_value Message Priority
* @return void * @return void
*/ */
function getPriority() function getPriority()
@ -1403,7 +1403,7 @@ class SMTPs
/** /**
* Set flag which determines whether to calculate message MD5 checksum. * Set flag which determines whether to calculate message MD5 checksum.
* *
* @param string $_value Message Priority * @param string $_flag Message Priority
* @return void * @return void
*/ */
function setMD5flag($_flag = false) function setMD5flag($_flag = false)
@ -1414,7 +1414,7 @@ class SMTPs
/** /**
* Gets flag which determines whether to calculate message MD5 checksum. * Gets flag which determines whether to calculate message MD5 checksum.
* *
* @return string $_value Message Priority * @return string Message Priority
*/ */
function getMD5flag() function getMD5flag()
{ {

View File

@ -61,11 +61,10 @@ class ModelePDFLabels
/** /**
* Create a document onto disk accordign to template module * Create a document onto disk accordign to template module
* *
* @param DoliDB $db objet base de donnee * @param DoliDB $db Database handler
* @param int $id id de la facture a creer * @param array $arrayofmembers Array of members
* @param string $message message * @param string $modele Force le modele a utiliser ('' to not force)
* @param string $modele force le modele a utiliser ('' to not force) * @param Translate $outputlangs Objet lang a utiliser pour traduction
* @param string $outputlangs objet lang a utiliser pour traduction
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs) function members_label_pdf_create($db, $arrayofmembers, $modele, $outputlangs)

View File

@ -60,7 +60,6 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
* @param Object $object object supplier invoice * @param Object $object object supplier invoice
* @param string $model force le modele a utiliser ('' to not force) * @param string $model force le modele a utiliser ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction * @param Translate $outputlangs objet lang a utiliser pour traduction
* @param HookManager $hookmanager Hook manager instance
* @return int 0 if KO, 1 if OK * @return int 0 if KO, 1 if OK
*/ */
function supplier_invoice_pdf_create($db, $object, $model, $outputlangs) function supplier_invoice_pdf_create($db, $object, $model, $outputlangs)

View File

@ -146,7 +146,6 @@ class ModeleNumRefSuppliersOrders
* @param int $hidedetails Hide details of lines * @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description * @param int $hidedesc Hide description
* @param int $hideref Hide ref * @param int $hideref Hide ref
* @param HookManager $hookmanager Hook manager instance
* @return int 0 if KO, 1 if OK * @return int 0 if KO, 1 if OK
*/ */
function supplier_order_pdf_create($db, $object, $model, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) function supplier_order_pdf_create($db, $object, $model, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)

View File

@ -299,7 +299,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
* Show header of page for PDF generation * Show header of page for PDF generation
* *
* @param PDF $pdf Object PDF * @param PDF $pdf Object PDF
* @param Translate $outputlang Object lang for output * @param Translate $outputlangs Object lang for output
* @param int $page_height Height of page * @param int $page_height Height of page
*/ */
function pdf_pagehead(&$pdf,$outputlangs,$page_height) function pdf_pagehead(&$pdf,$outputlangs,$page_height)
@ -1193,9 +1193,9 @@ function pdf_getTotalQty($object,$type='',$outputlangs,$hookmanager=false)
/** /**
* Convert a currency code into its symbol * Convert a currency code into its symbol
* *
* @param pdf PDF object * @param PDF $pdf PDF object
* @param currency_code Currency code * @param string $currency_code Currency code
* @param string Currency symbol encoded into UTF8 * @return string Currency symbol encoded into UTF8
*/ */
function pdf_getCurrencySymbol(&$pdf, $currency_code) function pdf_getCurrencySymbol(&$pdf, $currency_code)
{ {

View File

@ -67,6 +67,7 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP6
* *
* @param string $val Value * @param string $val Value
* @param string $get 1=GET, 0=POST * @param string $get 1=GET, 0=POST
* @return boolean true if ther is an injection
*/ */
function test_sql_and_script_inject($val, $get) function test_sql_and_script_inject($val, $get)
{ {
@ -91,6 +92,7 @@ function test_sql_and_script_inject($val, $get)
* *
* @param string $var Variable name * @param string $var Variable name
* @param string $get 1=GET, 0=POST * @param string $get 1=GET, 0=POST
* @return boolean true if ther is an injection
*/ */
function analyse_sql_and_script(&$var, $get) function analyse_sql_and_script(&$var, $get)
{ {
@ -115,6 +117,7 @@ function analyse_sql_and_script(&$var, $get)
return (test_sql_and_script_inject($var,$get) <= 0); return (test_sql_and_script_inject($var,$get) <= 0);
} }
} }
// Sanity check on URL // Sanity check on URL
if (! empty($_SERVER["PHP_SELF"])) if (! empty($_SERVER["PHP_SELF"]))
{ {

View File

@ -247,7 +247,14 @@ class MouvementStock
/** /**
* Create movement in database for all subproducts * Create movement in database for all subproducts
* @param label Label of stock movement *
* @param User $user Object user
* @param int $idProduct Id product
* @param int $entrepot_id Warehouse id
* @param int $qty Quantity
* @param int $type Type
* @param int $price Price
* @param string $label Label of movement
* @return int <0 if KO, 0 if OK * @return int <0 if KO, 0 if OK
*/ */
function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type, $price=0, $label='') function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type, $price=0, $label='')
@ -289,49 +296,15 @@ class MouvementStock
} }
/**
* Cree un mouvement en base pour toutes les compositions de produits
* @param label Label of stock movement
* @return int <0 if KO, 0 if OK
*/
/* This function is specific to a module. Should be inside the trigger of module instead of core code.
function _createProductComposition($user, $fk_product, $entrepot_id, $qty, $type, $price=0, $label='')
{
dol_syslog("MouvementStock::_createProductComposition $user->id, $fk_product, $entrepot_id, $qty, $type, $price, $label");
$products_compo = array();
$sql = "SELECT fk_product_composition, qte, etat_stock";
$sql.= " FROM ".MAIN_DB_PREFIX."product_composition";
$sql.= " WHERE fk_product = $fk_product;";
$resql = $this->db->query($sql);
if ($resql)
{
while ($item = $this->db->fetch_object($resql))
{
if ($item->etat_stock != 0) array_push($products_compo,$item);
}
$this->db->free($resql);
}
else
{
dol_syslog("MouvementStock::_createProductComposition echec update ".$this->error, LOG_ERR);
return -1;
}
// Create movement for each subproduct
foreach($products_compo as $product)
{
$this->_create($user, $product->fk_product_composition, $entrepot_id, ($qty*$product->qte), $type, 0, $label);
}
return 0;
}*/
/** /**
* Decrease stock for product and subproducts * Decrease stock for product and subproducts
* @param label Label of stock movement *
* @param User $user Object user
* @param int $fk_product Id product
* @param int $entrepot_id Warehouse id
* @param int $qty Quantity
* @param int $price Price
* @param string $label Label of stock movement
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function livraison($user, $fk_product, $entrepot_id, $qty, $price=0, $label='') function livraison($user, $fk_product, $entrepot_id, $qty, $price=0, $label='')
@ -342,8 +315,13 @@ class MouvementStock
/** /**
* Increase stock for product and subproducts * Increase stock for product and subproducts
* @param label Label of stock movement *
* @return int <0 if KO, >0 if OK * @param User $user Object user
* @param int $fk_product Id product
* @param int $entrepot_id Warehouse id
* @param int $qty Quantity
* @param int $price Price
* @param string $label Label of stock movement
*/ */
function reception($user, $fk_product, $entrepot_id, $qty, $price=0, $label='') function reception($user, $fk_product, $entrepot_id, $qty, $price=0, $label='')
{ {
@ -353,8 +331,9 @@ class MouvementStock
/** /**
* Return nb of subproducts lines for a product * Return nb of subproducts lines for a product
* @param $id *
* @return int * @param int $id Id of product
* @return int <0 if KO, nb of subproducts if OK
*/ */
function nbOfSubProdcuts($id) function nbOfSubProdcuts($id)
{ {