2
0
forked from Wavyzz/dolibarr

Qual: Removed checkstyle warnings

This commit is contained in:
Laurent Destailleur
2012-01-10 10:23:57 +01:00
parent 5fc760d318
commit f86ae93526
17 changed files with 170 additions and 149 deletions

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright (C) Walter Torres <walter@torres.ws> [with a *lot* of help!] * Copyright (C) Walter Torres <walter@torres.ws> [with a *lot* of help!]
* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2011 Regis Houssin * Copyright (C) 2006-2011 Regis Houssin
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -37,28 +37,6 @@
* This Class is based off of 'SMTP PHP MAIL' by Dirk Paehl, http://www.paehl.de * This Class is based off of 'SMTP PHP MAIL' by Dirk Paehl, http://www.paehl.de
*/ */
/**
* Version number of Class
*/
define('SMTPs_VER', '1.16', false);
/**
* SMTPs Success value
*/
define('SMTPs_SUCCEED', true, false);
/**
* SMTPs Fail value
*/
define('SMTPs_FAIL', false, false);
/**
* Improper parameters
*/
define('SMTPs_INVALID_PARAMETERS', 50, false);
/** /**
* \class SMTPs * \class SMTPs

View File

@@ -83,10 +83,11 @@ class mailing_contacts1 extends MailingTargets
/** /**
* \brief Return here number of distinct emails returned by your selector. * Return here number of distinct emails returned by your selector.
* For example if this selector is used to extract 500 different * For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500. * emails from a text file, this function must return 500.
* \return int *
* @return int
*/ */
function getNbOfRecipients() function getNbOfRecipients()
{ {
@@ -107,9 +108,9 @@ class mailing_contacts1 extends MailingTargets
/** /**
* \brief Affiche formulaire de filtre qui apparait dans page de selection * Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
* des destinataires de mailings *
* \return string Retourne zone select * @return string Retourne zone select
*/ */
function formFilter() function formFilter()
{ {
@@ -152,8 +153,10 @@ class mailing_contacts1 extends MailingTargets
/** /**
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing * Renvoie url lien vers fiche de la source du destinataire du mailing
* \return string Url lien *
* @param int $id ID
* @return string Url lien
*/ */
function url($id) function url($id)
{ {
@@ -162,10 +165,11 @@ class mailing_contacts1 extends MailingTargets
/** /**
* \brief Ajoute destinataires dans table des cibles * Ajoute destinataires dans table des cibles
* \param mailing_id Id of emailing *
* \param filterarray Requete sql de selection des destinataires * @param int $mailing_id Id of emailing
* \return int <0 si erreur, nb ajout si ok * @param array $filtersarray Requete sql de selection des destinataires
* @return int <0 si erreur, nb ajout si ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {

View File

@@ -53,8 +53,10 @@ class mailing_contacts2 extends MailingTargets
/** /**
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing * Renvoie url lien vers fiche de la source du destinataire du mailing
* \return string Url lien *
* @param int $id ID
* @return string Url lien
*/ */
function url($id) function url($id)
{ {
@@ -63,8 +65,9 @@ class mailing_contacts2 extends MailingTargets
/** /**
* This is the main function that returns the array of emails * This is the main function that returns the array of emails
* @param mailing_id Id of mailing. No need to use it. *
* @param filterarray Function * @param int $mailing_id Id of mailing. No need to use it.
* @param array $filtersarray Function
* @return int <0 if error, number of emails added if ok * @return int <0 if error, number of emails added if ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
@@ -146,6 +149,7 @@ class mailing_contacts2 extends MailingTargets
/** /**
* Return here number of distinct emails returned by your selector. * Return here number of distinct emails returned by your selector.
*
* @return int * @return int
*/ */
function getNbOfRecipients() function getNbOfRecipients()
@@ -171,6 +175,7 @@ class mailing_contacts2 extends MailingTargets
/** /**
* This is to add a form filter to provide variant of selector * This is to add a form filter to provide variant of selector
* If used, the HTML select must be called "filter" * If used, the HTML select must be called "filter"
*
* @return string A html select zone * @return string A html select zone
*/ */
function formFilter() function formFilter()

View File

@@ -52,8 +52,10 @@ class mailing_contacts3 extends MailingTargets
} }
/** /**
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing * Renvoie url lien vers fiche de la source du destinataire du mailing
* \return string Url lien *
* @param int $id ID
* @return string Url lien
*/ */
function url($id) function url($id)
{ {
@@ -62,8 +64,9 @@ class mailing_contacts3 extends MailingTargets
/** /**
* This is the main function that returns the array of emails * This is the main function that returns the array of emails
* @param mailing_id Id of mailing. No need to use it. *
* @param filterarray Category * @param int $mailing_id Id of mailing. No need to use it.
* @param array $filtersarray Category
* @return int <0 if error, number of emails added if ok * @return int <0 if error, number of emails added if ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
@@ -152,7 +155,8 @@ class mailing_contacts3 extends MailingTargets
/** /**
* Return here number of distinct emails returned by your selector. * Return here number of distinct emails returned by your selector.
* @return int *
* @return int Number of recipients
*/ */
function getNbOfRecipients() function getNbOfRecipients()
{ {
@@ -188,7 +192,8 @@ class mailing_contacts3 extends MailingTargets
/** /**
* This is to add a form filter to provide variant of selector * This is to add a form filter to provide variant of selector
* If used, the HTML select must be called "filter" * If used, the HTML select must be called "filter".
*
* @return string A html select zone * @return string A html select zone
*/ */
function formFilter() function formFilter()

View File

@@ -53,8 +53,8 @@ class mailing_example extends MailingTargets
/** /**
* This is the main function that returns the array of emails * This is the main function that returns the array of emails
* *
* @param mailing_id Id of mailing. No need to use it. * @param int $mailing_id Id of mailing. No need to use it.
* @param filterarray If you used the formFilter function. Empty otherwise. * @param array $filtersarray If you used the formFilter function. Empty otherwise.
* @return int <0 if error, number of emails added if ok * @return int <0 if error, number of emails added if ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
@@ -130,6 +130,7 @@ class mailing_example extends MailingTargets
* Can include an URL link on each record provided by selector * Can include an URL link on each record provided by selector
* shown on target page. * shown on target page.
* *
* @param int $id ID
* @return string Url link * @return string Url link
*/ */
function url($id) function url($id)

View File

@@ -101,9 +101,9 @@ class mailing_fraise extends MailingTargets
/** /**
* \brief Affiche formulaire de filtre qui apparait dans page de selection * Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
* des destinataires de mailings *
* \return string Retourne zone select * @return string Retourne zone select
*/ */
function formFilter() function formFilter()
{ {
@@ -132,8 +132,10 @@ class mailing_fraise extends MailingTargets
/** /**
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing * Renvoie url lien vers fiche de la source du destinataire du mailing
* \return string Url lien *
* @param int $id ID
* @return string Url lien
*/ */
function url($id) function url($id)
{ {
@@ -142,10 +144,11 @@ class mailing_fraise extends MailingTargets
/** /**
* \brief Ajoute destinataires dans table des cibles * Ajoute destinataires dans table des cibles
* \param mailing_id Id of emailing *
* \param filterarray Param to filter sql request. Deprecated. Should use $_POST instead. * @param int $mailing_id Id of emailing
* \return int < 0 si erreur, nb ajout si ok * @param array $filtersarray Param to filter sql request. Deprecated. Should use $_POST instead.
* @return int < 0 si erreur, nb ajout si ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {

View File

@@ -82,8 +82,10 @@ class mailing_peche extends MailingTargets
/** /**
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing * Renvoie url lien vers fiche de la source du destinataire du mailing
* \return string Url lien *
* @param int $id ID
* @return string Url lien
*/ */
function url($id) function url($id)
{ {
@@ -94,9 +96,9 @@ class mailing_peche extends MailingTargets
/** /**
* \brief Affiche formulaire de filtre qui apparait dans page de selection * Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
* des destinataires de mailings *
* \return string Retourne zone select * @return string Retourne zone select
*/ */
function formFilter() function formFilter()
{ {
@@ -108,10 +110,11 @@ class mailing_peche extends MailingTargets
} }
/** /**
* \brief Ajoute destinataires dans table des cibles * Ajoute destinataires dans table des cibles
* \param mailing_id Id of emailing *
* \param filterarray Requete sql de selection des destinataires * @param int $mailing_id Id of emailing
* \return int < 0 si erreur, nb ajout si ok * @param array $filtersarray Requete sql de selection des destinataires
* @return int < 0 si erreur, nb ajout si ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {

View File

@@ -99,9 +99,9 @@ class mailing_pomme extends MailingTargets
/** /**
* \brief Affiche formulaire de filtre qui apparait dans page de selection * Affiche formulaire de filtre qui apparait dans page de selection des destinataires de mailings
* des destinataires de mailings *
* \return string Retourne zone select * @return string Retourne zone select
*/ */
function formFilter() function formFilter()
{ {
@@ -120,8 +120,10 @@ class mailing_pomme extends MailingTargets
/** /**
* \brief Renvoie url lien vers fiche de la source du destinataire du mailing * Renvoie url lien vers fiche de la source du destinataire du mailing
* \return string Url lien *
* @param int $id ID
* @return string Url lien
*/ */
function url($id) function url($id)
{ {
@@ -130,10 +132,11 @@ class mailing_pomme extends MailingTargets
/** /**
* \brief Ajoute destinataires dans table des cibles * Ajoute destinataires dans table des cibles
* \param mailing_id Id of emailing *
* \param filterarray Requete sql de selection des destinataires * @param int $mailing_id Id of emailing
* \return int < 0 si erreur, nb ajout si ok * @param array $filtersarray Requete sql de selection des destinataires
* @return int < 0 si erreur, nb ajout si ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {

View File

@@ -52,7 +52,7 @@ class mailing_thirdparties extends MailingTargets
* This is the main function that returns the array of emails * This is the main function that returns the array of emails
* *
* @param int $mailing_id Id of mailing. No need to use it. * @param int $mailing_id Id of mailing. No need to use it.
* @param array $filterarray If you used the formFilter function. Empty otherwise. * @param array $filtersarray If you used the formFilter function. Empty otherwise.
* @return int <0 if error, number of emails added if ok * @return int <0 if error, number of emails added if ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
@@ -172,9 +172,10 @@ class mailing_thirdparties extends MailingTargets
} }
/** /**
* \brief This is to add a form filter to provide variant of selector * This is to add a form filter to provide variant of selector
* If used, the HTML select must be called "filter" * If used, the HTML select must be called "filter"
* \return string A html select zone *
* @return string A html select zone
*/ */
function formFilter() function formFilter()
{ {
@@ -228,9 +229,10 @@ class mailing_thirdparties extends MailingTargets
/** /**
* \brief Can include an URL link on each record provided by selector * Can include an URL link on each record provided by selector shown on target page.
* shown on target page. *
* \return string Url link * @param int $id ID
* @return string Url link
*/ */
function url($id) function url($id)
{ {

View File

@@ -71,10 +71,11 @@ class mailing_thirdparties_services_expired extends MailingTargets
/** /**
* \brief This is the main function that returns the array of emails * This is the main function that returns the array of emails
* \param mailing_id Id of mailing. No need to use it. *
* \param filterarray If you used the formFilter function. Empty otherwise. * @param int $mailing_id Id of mailing. No need to use it.
* \return int <0 if error, number of emails added if ok * @param array $filtersarray If you used the formFilter function. Empty otherwise.
* @return int <0 if error, number of emails added if ok
*/ */
function add_to_target($mailing_id,$filtersarray=array()) function add_to_target($mailing_id,$filtersarray=array())
{ {
@@ -169,10 +170,13 @@ class mailing_thirdparties_services_expired extends MailingTargets
/** /**
* \brief Return here number of distinct emails returned by your selector. * Return here number of distinct emails returned by your selector.
* For example if this selector is used to extract 500 different * For example if this selector is used to extract 500 different
* emails from a text file, this function must return 500. * emails from a text file, this function must return 500.
* \return int *
* @param int $filter Filter
* @param string $option Option
* @return int Number of recipients
*/ */
function getNbOfRecipients($filter=1,$option='') function getNbOfRecipients($filter=1,$option='')
{ {
@@ -194,9 +198,10 @@ class mailing_thirdparties_services_expired extends MailingTargets
} }
/** /**
* \brief This is to add a form filter to provide variant of selector * This is to add a form filter to provide variant of selector
* If used, the HTML select must be called "filter" * If used, the HTML select must be called "filter"
* \return string A html select zone *
* @return string A html select zone
*/ */
function formFilter() function formFilter()
{ {
@@ -216,9 +221,10 @@ class mailing_thirdparties_services_expired extends MailingTargets
/** /**
* \brief Can include an URL link on each record provided by selector * Can include an URL link on each record provided by selector shown on target page.
* shown on target page. *
* \return string Url link * @param int $id ID
* @return string Url link
*/ */
function url($id) function url($id)
{ {

View File

@@ -225,12 +225,14 @@ class doc_generic_odt extends ModeleThirdPartyDoc
// Open and load template // Open and load template
require_once(ODTPHP_PATH.'odf.php'); require_once(ODTPHP_PATH.'odf.php');
$odfHandler = new odf($srctemplatepath, array $odfHandler = new odf(
( $srctemplatepath,
array(
'PATH_TO_TMP' => $conf->societe->dir_temp, 'PATH_TO_TMP' => $conf->societe->dir_temp,
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
'DELIMITER_LEFT' => '{', 'DELIMITER_LEFT' => '{',
'DELIMITER_RIGHT' => '}') 'DELIMITER_RIGHT' => '}'
)
); );
//print $odfHandler->__toString()."\n"; //print $odfHandler->__toString()."\n";

View File

@@ -63,7 +63,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
/** Return description of module /** Return description of module
* *
* @param $langs Object langs * @param string $langs Object langs
* @return string Description of module * @return string Description of module
*/ */
function info($langs) function info($langs)

View File

@@ -63,7 +63,7 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode
/** Return description of module /** Return description of module
* *
* @param $langs Object langs * @param string $langs Object langs
* @return string Description of module * @return string Description of module
*/ */
function info($langs) function info($langs)

View File

@@ -61,7 +61,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
/** Return description of module /** Return description of module
* *
* @param $langs Object langs * @param string $langs Object langs
* @return string Description of module * @return string Description of module
*/ */
function info($langs) function info($langs)

View File

@@ -52,7 +52,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
/** Return description of module /** Return description of module
* *
* @param $langs Object langs * @param string $langs Object langs
* @return string Description of module * @return string Description of module
*/ */
function info($langs) function info($langs)

View File

@@ -45,7 +45,7 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
/** Return description of module /** Return description of module
* *
* @param $langs Object langs * @param string $langs Object langs
* @return string Description of module * @return string Description of module
*/ */
function info($langs) function info($langs)
@@ -55,9 +55,9 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
/** Return an example of result returned by getNextValue /** Return an example of result returned by getNextValue
* *
* @param $langs Object langs * @param Translate $langs Object langs
* @param $objsoc Object thirdparty * @param Societe $objsoc Object thirdparty
* @param $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
*/ */
function getExample($langs,$objsoc=0,$type=-1) function getExample($langs,$objsoc=0,$type=-1)
{ {
@@ -67,9 +67,9 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
/** /**
* Set accountancy account code for a third party into this->code * Set accountancy account code for a third party into this->code
* *
* @param db Database handler * @param DoliDB $db Database handler
* @param societe Third party object * @param Societe $societe Third party object
* @param type 'customer' or 'supplier' * @param int $type 'customer' or 'supplier'
* @return int >=0 if OK, <0 if KO * @return int >=0 if OK, <0 if KO
*/ */
function get_code($db, $societe, $type='') function get_code($db, $societe, $type='')

View File

@@ -37,8 +37,9 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
/** /**
* Return list of active generation modules * Return list of active generation modules
* @param $db Database handler *
* @param $maxfilenamelength Max length of value to show * @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
*/ */
function liste_modeles($db,$maxfilenamelength=0) function liste_modeles($db,$maxfilenamelength=0)
{ {
@@ -65,6 +66,7 @@ abstract class ModeleThirdPartyCode
/** Renvoi la description par defaut du modele de numerotation /** Renvoi la description par defaut du modele de numerotation
* *
* @param Translate $langs Object langs
* @return string Texte descripif * @return string Texte descripif
*/ */
function info($langs) function info($langs)
@@ -75,6 +77,7 @@ abstract class ModeleThirdPartyCode
/** Renvoi nom module /** Renvoi nom module
* *
* @param Translate $langs Object langs
* @return string Nom du module * @return string Nom du module
*/ */
function getNom($langs) function getNom($langs)
@@ -85,6 +88,7 @@ abstract class ModeleThirdPartyCode
/** Renvoi un exemple de numerotation /** Renvoi un exemple de numerotation
* *
* @param Translate $langs Object langs
* @return string Example * @return string Example
*/ */
function getExample($langs) function getExample($langs)
@@ -103,8 +107,11 @@ abstract class ModeleThirdPartyCode
return true; return true;
} }
/** Return next value available /**
* Return next value available
* *
* @param Societe $objsoc Object thirdparty
* @param int $type Type
* @return string Value * @return string Value
*/ */
function getNextValue($objsoc=0,$type=-1) function getNextValue($objsoc=0,$type=-1)
@@ -132,7 +139,8 @@ abstract class ModeleThirdPartyCode
/** /**
* Renvoi la liste des modeles de numéroation * Renvoi la liste des modeles de numéroation
* *
* @param db Handler de base * @param DoliDB $db Database handler
* @return array List of numbers
*/ */
function liste_modeles($db) function liste_modeles($db)
{ {
@@ -161,10 +169,10 @@ abstract class ModeleThirdPartyCode
/** /**
* Return description of module parameters * Return description of module parameters
* *
* @param langs Output language * @param Translate $langs Output language
* @param soc Third party object * @param Societe $soc Third party object
* @param type -1=Nothing, 0=Customer, 1=Supplier * @param int $type -1=Nothing, 0=Customer, 1=Supplier
* @return string HTML translated description * @return tring HTML translated description
*/ */
function getToolTip($langs,$soc,$type) function getToolTip($langs,$soc,$type)
{ {
@@ -228,7 +236,7 @@ abstract class ModeleThirdPartyCode
/** /**
* Check if mask/numbering use prefix * Check if mask/numbering use prefix
* *
* @param int 0=no, 1=yes * @return int 0=no, 1=yes
*/ */
function verif_prefixIsUsed() function verif_prefixIsUsed()
{ {
@@ -249,7 +257,7 @@ abstract class ModeleAccountancyCode
/** Return description of module /** Return description of module
* *
* @param $langs Object langs * @param Translate $langs Object langs
* @return string Description of module * @return string Description of module
*/ */
function info($langs) function info($langs)
@@ -260,9 +268,10 @@ abstract class ModeleAccountancyCode
/** Return an example of result returned by getNextValue /** Return an example of result returned by getNextValue
* *
* @param $langs Object langs * @param Translate $langs Object langs
* @param $objsoc Object thirdparty * @param societe $objsoc Object thirdparty
* @param $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Example
*/ */
function getExample($langs,$objsoc=0,$type=-1) function getExample($langs,$objsoc=0,$type=-1)
{ {
@@ -298,9 +307,9 @@ abstract class ModeleAccountancyCode
/** /**
* Return description of module parameters * Return description of module parameters
* *
* @param langs Output language * @param Translate $langs Output language
* @param soc Third party object * @param Societe $soc Third party object
* @param type -1=Nothing, 0=Customer, 1=Supplier * @param int $type -1=Nothing, 0=Customer, 1=Supplier
* @return string HTML translated description * @return string HTML translated description
*/ */
function getToolTip($langs,$soc,$type) function getToolTip($langs,$soc,$type)
@@ -335,9 +344,9 @@ abstract class ModeleAccountancyCode
/** /**
* Set accountancy account code for a third party into this->code * Set accountancy account code for a third party into this->code
* *
* @param db Database handler * @param DoliDB $db Database handler
* @param societe Third party object * @param Societe $societe Third party object
* @param type 'customer' or 'supplier' * @param int $type 'customer' or 'supplier'
* @return int >=0 if OK, <0 if KO * @return int >=0 if OK, <0 if KO
*/ */
function get_code($db, $societe, $type='') function get_code($db, $societe, $type='')