diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 41764c38bd6..6c49b87185e 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -132,6 +132,7 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function sending an email has the adherent with the text supplied in parameter. * @@ -147,9 +148,9 @@ class Adherent extends CommonObject * @param string $errors_to erros to * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps 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='') { + // phpcs:enable global $conf,$langs; // Detect if message is HTML @@ -638,6 +639,7 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update denormalized last subscription date. * This function is called when we delete a subscription for example. @@ -645,9 +647,9 @@ class Adherent extends CommonObject * @param User $user User making change * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_end_date($user) { + // phpcs:enable $this->db->begin(); // Search for last subscription id and end date @@ -993,15 +995,16 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Method to load member from its login * * @param string $login login of member * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_login($login) { + // phpcs:enable global $conf; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; @@ -1023,6 +1026,7 @@ class Adherent extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Method to load member from its name * @@ -1030,9 +1034,9 @@ class Adherent extends CommonObject * @param string $lastname Lastname * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_name($firstname,$lastname) { + // phpcs:enable global $conf; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; @@ -1195,6 +1199,7 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction qui recupere pour un adherent les parametres * first_subscription_date @@ -1204,9 +1209,9 @@ class Adherent extends CommonObject * * @return int <0 si KO, >0 si OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_subscriptions() { + // phpcs:enable global $langs; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; @@ -1750,14 +1755,15 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to add member into external tools mailing-list, spip, etc. * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_abo() { + // phpcs:enable global $conf,$langs; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; @@ -1808,14 +1814,15 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to delete a member from external tools like mailing-list, spip, etc. * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function del_to_abo() { + // phpcs:enable global $conf,$langs; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; @@ -1988,6 +1995,7 @@ class Adherent extends CommonObject return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -1997,9 +2005,9 @@ class Adherent extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0) { + // phpcs:enable global $langs; $langs->load("members"); if ($mode == 0) @@ -2013,7 +2021,7 @@ class Adherent extends CommonObject } if ($statut == 0) return $langs->trans("MemberStatusResiliated"); } - if ($mode == 1) + elseif ($mode == 1) { if ($statut == -1) return $langs->trans("MemberStatusDraftShort"); if ($statut >= 1) @@ -2024,7 +2032,7 @@ class Adherent extends CommonObject } if ($statut == 0) return $langs->trans("MemberStatusResiliatedShort"); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort"); if ($statut >= 1) @@ -2035,7 +2043,7 @@ class Adherent extends CommonObject } if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort"); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut >= 1) @@ -2046,7 +2054,7 @@ class Adherent extends CommonObject } if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft"); if ($statut >= 1) @@ -2057,7 +2065,7 @@ class Adherent extends CommonObject } if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated"); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut >= 1) @@ -2068,7 +2076,7 @@ class Adherent extends CommonObject } if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); } - if ($mode == 6) + elseif ($mode == 6) { if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut >= 1) @@ -2082,14 +2090,15 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf; $this->nb=array(); @@ -2117,15 +2126,16 @@ class Adherent extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Objet user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user) { + // phpcs:enable global $conf, $langs; if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe @@ -2260,6 +2270,7 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -2269,9 +2280,9 @@ class Adherent extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_dn($info,$mode=0) { + // phpcs:enable global $conf; $dn=''; if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS."=".$info[$conf->global->LDAP_KEY_MEMBERS].",".$conf->global->LDAP_MEMBER_DN; @@ -2281,14 +2292,15 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Initialise tableau info (tableau des attributs LDAP) * * @return array Tableau info des attributs */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_info() { + // phpcs:enable global $conf,$langs; $info=array(); diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b7d510a3e0f..9b24461c60d 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -36,12 +36,12 @@ class AdherentType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'adherent_type'; - + /** * @var string ID to identify managed object */ public $element = 'adherent_type'; - + public $picto = 'group'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -290,14 +290,15 @@ class AdherentType extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of members' type * * @return array List of types of members */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_array() { + // phpcs:enable global $conf,$langs; $adherenttypes = array(); @@ -422,6 +423,7 @@ class AdherentType extends CommonObject return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -431,9 +433,9 @@ class AdherentType extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_dn($info,$mode=0) { + // phpcs:enable global $conf; $dn=''; if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS_TYPES."=".$info[$conf->global->LDAP_KEY_MEMBERS_TYPES].",".$conf->global->LDAP_MEMBER_TYPE_DN; @@ -443,14 +445,15 @@ class AdherentType extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Initialize the info array (array of LDAP values) that will be used to call LDAP functions * * @return array Tableau info des attributs */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_info() { + // phpcs:enable global $conf,$langs; $info=array(); diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 90452816be8..6ad63a0f682 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -36,12 +36,12 @@ class Subscription extends CommonObject * @var string ID to identify managed object */ public $element='subscription'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='subscription'; - + public $picto='payment'; var $datec; // Date creation @@ -363,15 +363,16 @@ class Subscription extends CommonObject return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * * @param int $statut Id statut * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut) { + // phpcs:enable global $langs; $langs->load("members"); return ''; diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index c4dae079c3c..859b9140f86 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -163,15 +163,16 @@ class Dolistore } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return tree of Dolistore categories. $this->categories must have been loaded before. * * @param int $parent Id of parent category * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_categories($parent = 0) { + // phpcs:enable if (!isset($this->categories)) die('not possible'); if ($parent != 0) { $html = '