From 157a6e109e2f992dd210f087d5c8e2c6a35c0780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= <marcosgdf@gmail.com> Date: Tue, 10 Feb 2015 10:45:48 +0100 Subject: [PATCH] Misc Adherents PHPDoc corrections --- htdocs/adherents/admin/adherent.php | 2 +- .../canvas/actions_adherentcard_common.class.php | 4 ++++ htdocs/adherents/card.php | 6 +++--- htdocs/adherents/card_subscriptions.php | 4 ++-- htdocs/adherents/class/adherent.class.php | 4 ---- htdocs/adherents/class/adherent_type.class.php | 7 +++++++ htdocs/adherents/list.php | 2 +- htdocs/adherents/type.php | 4 ++-- htdocs/compta/bank/class/account.class.php | 7 ++++++- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formcompany.class.php | 2 +- htdocs/core/class/ldap.class.php | 2 +- htdocs/core/lib/company.lib.php | 4 ++-- htdocs/core/lib/functions.lib.php | 8 ++++---- htdocs/core/lib/member.lib.php | 6 +++--- htdocs/mailmanspip/class/mailmanspip.class.php | 10 +++++----- 17 files changed, 44 insertions(+), 32 deletions(-) diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index f86e19050e4..1e445911b24 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -219,7 +219,7 @@ if ($conf->facture->enabled) print '<input type="hidden" name="constname" value="ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS">'; print '<tr '.$bc[$var].'><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>'; print '<td>'; - print $form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'constvalue_ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'); + $form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'constvalue_ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'); print '</td><td align="center" width="80">'; print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">'; print '</td>'; diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index cf89e1f526c..9987f9bc530 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -27,6 +27,10 @@ */ abstract class ActionsAdherentCardCommon { + /** + * Database handler + * @var DoliDB + */ var $db; var $dirmodule; var $targetmodule; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 3363bf34f65..d8a1a85debf 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1159,7 +1159,7 @@ else print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td colspan="2" class="valeur">'; if ($object->user_id) { - print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); } else print $langs->trans("NoDolibarrAccess"); print '</td></tr>'; @@ -1516,13 +1516,13 @@ else print '</td><td colspan="2" class="valeur">'; if ($action == 'editlogin') { - print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid',''); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid',''); } else { if ($object->user_id) { - print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); } else print $langs->trans("NoDolibarrAccess"); } diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 7b710ba9aca..17567f5ca84 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -674,13 +674,13 @@ if ($rowid) { $include=array($object->user_id,$user->id); }*/ - print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid',''); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'userid',''); } else { if ($object->user_id) { - print $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); + $form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id,$object->user_id,'none'); } else print $langs->trans("NoDolibarrAccess"); } diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 8b1a456ee79..214476299e5 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -641,10 +641,6 @@ class Adherent extends CommonObject */ function update_end_date($user) { - global $conf, $langs; - - $error=0; - $this->db->begin(); // Search for last subscription id and end date diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 5c340de1fdf..11c194526b2 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -36,6 +36,13 @@ class AdherentType extends CommonObject public $element = 'adherent_type'; var $id; + + /** + * @var int + * @deprecated Use rowid + */ + public $ref; + var $libelle; var $statut; var $cotisation; // Soumis a la cotisation diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index b70e212d2d2..7764b4d144e 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -152,7 +152,7 @@ $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $resql = $db->query($sql); - if ($resql) $nbtotalofrecords = $db->num_rows($result); + if ($resql) $nbtotalofrecords = $db->num_rows($resql); else dol_print_error($db); } // Add order and limit diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 0ffdc8b7e7f..96e13561825 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -92,7 +92,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) if ($adht->libelle) { - $id=$adht->create($user->id); + $id=$adht->create($user); if ($id > 0) { header("Location: ".$_SERVER["PHP_SELF"]); @@ -127,7 +127,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$adht); - $adht->update($user->id); + $adht->update($user); header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$_POST["rowid"]); exit; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 4343e2cb921..2c5c2451c8f 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -36,7 +36,12 @@ class Account extends CommonObject public $element='bank_account'; public $table_element='bank_account'; - var $rowid; // deprecated + /** + * //TODO: Discuss this. $rowid is preferred over $id + * @var + * @deprecated + */ + var $rowid; var $id; var $ref; var $label; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 1c7c3ffb634..544619892b5 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -590,7 +590,7 @@ class ExtraFields * @param string $value Value to show (for date type it must be in timestamp format) * @param string $moreparam To add more parametes on html input tag * @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names) - * @return void + * @return string */ function showInputField($key,$value,$moreparam='',$keyprefix='') { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7d2851f1b31..9ee6f3d5271 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4452,7 +4452,7 @@ class Form * Return HTML code to output a photo * * @param string $modulepart Key to define module concerned ('societe', 'userphoto', 'memberphoto') - * @param Object $object Object containing data to retrieve file name + * @param object $object Object containing data to retrieve file name * @param int $width Width of photo * @return string HTML code to output photo */ diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 87723c535f3..297d772b06c 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -709,7 +709,7 @@ class FormCompany * @param string $fields Fields * @param int $fieldsize Field size * @param int $disableautocomplete 1 To disable autocomplete features - * @return void + * @return string */ function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0) { diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index dc844ee3f02..ca0cbab3925 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -801,7 +801,7 @@ class Ldap * * @param string $dn DN entry key * @param string $filter Filter - * @return int <0 if KO, >0 if OK + * @return int|false|array <0 or false if KO, array if OK */ function getAttribute($dn,$filter) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2d0ecc4ebf7..8c0038f785f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -904,7 +904,7 @@ function show_addresses($conf,$langs,$db,$object,$backtopage='') * @param Conf $conf Object conf * @param Translate $langs Object langs * @param DoliDB $db Object db - * @param Object $object Object third party or member + * @param Adherent|Societe $object Object third party or member * @param Contact $objcon Object contact * @param int $noprint Return string but does not output it * @return mixed Return html part or void if noprint is 1 @@ -1067,7 +1067,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) * @param Conf $conf Object conf * @param Translate $langs Object langs * @param DoliDB $db Object db - * @param Object $object Object third party or member + * @param Adherent|Societe $object Object third party or member * @param Contact $objcon Object contact * @param int $noprint Return string but does not output it * @return mixed Return html part or void if noprint is 1 diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c3446eb7b15..4523a8fd143 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -657,7 +657,7 @@ function dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto * @param int $notab 0=Add tab header, 1=no tab header. If you set this to 1, using dol_fiche_end() to close tab is not required. * @param string $picto Add a picto on tab title * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. - * @return void + * @return string */ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0) { @@ -739,7 +739,7 @@ function dol_fiche_end($notab=0) * Return tab footer of a card * * @param int $notab 0=Add tab footer, 1=no tab footer - * @return void + * @return string */ function dol_get_fiche_end($notab=0) { @@ -2647,7 +2647,7 @@ function print_fiche_titre($title, $mesg='', $picto='title.png', $pictoisfullpat * @param string $picto Icon to use before title (should be a 32x32 transparent png file) * @param int $pictoisfullpath 1=Icon name is a full absolute url of image * @param int $id To force an id on html objects - * @return void + * @return string */ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath=0, $id='') { @@ -4639,7 +4639,7 @@ function picto_from_langcode($codelang) * * @param Conf $conf Object conf * @param Translate $langs Object langs - * @param Object|null $object Object object + * @param object|null $object Object object * @param array $head Object head * @param int $h New position to fill * @param string $type Value for object where objectvalue can be diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 879478daf8d..19e9f08e94d 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -24,10 +24,10 @@ /** * Return array head with list of tabs to view object informations * - * @param Object $object Member + * @param Adherent $object Member * @return array head */ -function member_prepare_head($object) +function member_prepare_head(Adherent $object) { global $langs, $conf, $user; @@ -155,7 +155,7 @@ function member_admin_prepare_head() /** * Return array head with list of tabs to view object stats informations * - * @param Object $object Member or null + * @param Adherent $object Member or null * @return array head */ function member_stats_prepare_head($object) diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index 6e772b09c03..d874e539164 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -166,7 +166,7 @@ class MailmanSpip /** * Fonction qui donne les droits redacteurs dans spip * - * @param Object $object Object with data (->firstname, ->lastname, ->email and ->login) + * @param object $object Object with data (->firstname, ->lastname, ->email and ->login) * @return int =0 if KO, >0 if OK */ function add_to_spip($object) @@ -208,7 +208,7 @@ class MailmanSpip /** * Fonction qui enleve les droits redacteurs dans spip * - * @param Object $object Object with data (->login) + * @param object $object Object with data (->login) * @return int =0 if KO, >0 if OK */ function del_to_spip($object) @@ -247,7 +247,7 @@ class MailmanSpip /** * Fonction qui dit si cet utilisateur est un redacteur existant dans spip * - * @param Object $object Object with data (->login) + * @param object $object Object with data (->login) * @return int 1=exists, 0=does not exists, -1=error */ function is_in_spip($object) @@ -297,7 +297,7 @@ class MailmanSpip /** * Subscribe an email to all mailing-lists * - * @param Object $object Object with data (->email, ->pass, ->element, ->type) + * @param object $object Object with data (->email, ->pass, ->element, ->type) * @param array $listes To force mailing-list (string separated with ,) * @return int <0 if KO, >=0 if OK */ @@ -369,7 +369,7 @@ class MailmanSpip * Unsubscribe an email from all mailing-lists * Used when a user is resiliated * - * @param Object $object Object with data (->email, ->pass, ->element, ->type) + * @param object $object Object with data (->email, ->pass, ->element, ->type) * @param array $listes To force mailing-list (string separated with ,) * @return int <0 if KO, >=0 if OK */ -- GitLab