From 1f10e4e1e33d4804c51e2905ece0fc3539d8122e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Jan 2012 15:17:36 +0100 Subject: [PATCH 1/3] Doxygen --- htdocs/core/class/html.formactions.class.php | 42 +++++++++--------- htdocs/core/class/html.formadmin.class.php | 8 ++-- htdocs/core/class/html.formbarcode.class.php | 6 +-- htdocs/core/class/html.formcompany.class.php | 7 ++- htdocs/core/class/html.formfile.class.php | 3 +- htdocs/core/class/html.formmail.class.php | 37 +++++++++------- htdocs/core/class/html.formorder.class.php | 35 ++++++++------- htdocs/core/class/html.formother.class.php | 45 ++++++++++---------- 8 files changed, 94 insertions(+), 89 deletions(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 062ad198f734b..2fcf24429569d 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -1,5 +1,5 @@ +/* Copyright (c) 2008-2012 Laurent Destailleur * Copyright (C) 2010-2011 Regis Houssin * Copyright (C) 2010 Juanjo Menent * @@ -25,8 +25,7 @@ /** - * \class FormActions - * \brief Class to manage building of HTML components + * Class to manage building of HTML components */ class FormActions { @@ -37,23 +36,23 @@ class FormActions /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function FormActions($DB) + function FormActions($db) { - $this->db = $DB; - + $this->db = $db; return 1; } /** - * Show list of action status + * Show list of action status * - * @param formname Name of form where select in included - * @param selected Preselected value - * @param canedit 1=can edit, 0=read only - * @param htmlname Name of html prefix for html fields (selectX and valX) + * @param string $formname Name of form where select in included + * @param string $selected Preselected value + * @param int $canedit 1=can edit, 0=read only + * @param string $htmlname Name of html prefix for html fields (selectX and valX) + * @return void */ function form_select_status_action($formname,$selected,$canedit=1,$htmlname='complete') { @@ -101,11 +100,12 @@ function form_select_status_action($formname,$selected,$canedit=1,$htmlname='com /** - * Show list of actions for element - * @param object Object - * @param typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter' - * @param socid socid of user - * @return int <0 if KO, >=0 if OK + * Show list of actions for element + * + * @param Object $object Object + * @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter' + * @param int $socid socid of user + * @return int <0 if KO, >=0 if OK */ function showactions($object,$typeelement,$socid=0) { @@ -159,9 +159,11 @@ function showactions($object,$typeelement,$socid=0) /** - * Output list of type of event - * @param selected Type pre-selectionne - * @param htmlname Nom champ formulaire + * Output list of type of event + * + * @param string $selected Type pre-selectionne + * @param string $htmlname Nom champ formulaire + * @return void */ function select_type_actions($selected='',$htmlname='actioncode') { diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index d408b7d8ee6db..b7ac9f7e49bed 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2007 Patrick Raguin * @@ -25,8 +25,7 @@ /** - * \class FormAdmin - * \brief Class to generate html code for admin pages + * Class to generate html code for admin pages */ class FormAdmin { @@ -42,7 +41,6 @@ class FormAdmin function FormAdmin($db) { $this->db = $db; - return 1; } @@ -279,7 +277,7 @@ function select_menu_families($selected, $htmlname, $dirmenuarray) /** - * Retourne la liste deroulante des menus disponibles (eldy) + * Return a HTML select list of timezones * * @param string $selected Menu pre-selectionnee * @param string $htmlname Nom de la zone select diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index cd52604202409..1eb70c4ae3b0a 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2008-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,8 +24,7 @@ /** - * \class Form - * \brief Classe permettant la generation de composants html + * Class to manage barcode HTML */ class FormBarCode { @@ -41,7 +40,6 @@ class FormBarCode function FormBarCode($db) { $this->db = $db; - return 1; } diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 7f22b659c1f5d..6c20b913a4c21 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,9 +23,8 @@ /** - * \class FormCompany - * \brief Class to build HTML component for third parties management - * \remarks Only common components must be here. + * Class to build HTML component for third parties management + * Only common components are here. */ class FormCompany { diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index eff452e6ff2c3..0aa977fadb2e7 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -25,8 +25,7 @@ /** - * \class FormFile - * \brief Class to offer components to list and upload files + * Class to offer components to list and upload files */ class FormFile { diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 092dd13f6c156..7d95b981b1af2 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * @@ -25,11 +25,11 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); -/** \class FormMail - * \brief Classe permettant la generation du formulaire html d'envoi de mail unitaire - * \remarks Utilisation: $formail = new FormMail($db) - * \remarks $formmail->proprietes=1 ou chaine ou tableau de valeurs - * \remarks $formmail->show_form() affiche le formulaire +/** + * Classe permettant la generation du formulaire html d'envoi de mail unitaire + * Usage: $formail = new FormMail($db) + * $formmail->proprietes=1 ou chaine ou tableau de valeurs + * $formmail->show_form() affiche le formulaire */ class FormMail { @@ -69,12 +69,13 @@ class FormMail /** - * \brief Constructeur - * \param DB handler d'acces base de donnee + * Constructor + * + * @param DoliDB $DB Database handler */ - function FormMail($DB) + function FormMail($db) { - $this->db = $DB; + $this->db = $db; $this->withform=1; @@ -103,6 +104,8 @@ function FormMail($DB) /** * Clear list of attached files in send mail form (stored in session) + * + * @return void */ function clear_attached_files() { @@ -125,6 +128,7 @@ function clear_attached_files() * @param string $path Full absolute path on filesystem of file, including file name * @param string $file Only filename * @param string $type Mime type + * @return void */ function add_attached_files($path,$file,$type) { @@ -148,7 +152,8 @@ function add_attached_files($path,$file,$type) /** * Remove a file from the list of attached files (stored in SECTION array) * - * @param $keytodelete Key in file array + * @param string $keytodelete Key in file array + * @return void */ function remove_attached_files($keytodelete) { @@ -190,8 +195,9 @@ function get_attached_files() * Show the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * - * @param addfileaction Name of action when posting file attachments - * @param removefileaction Name of action when removing file attachments + * @param string $addfileaction Name of action when posting file attachments + * @param string $removefileaction Name of action when removing file attachments + * @return void */ function show_form($addfileaction='addfile',$removefileaction='removefile') { @@ -202,8 +208,9 @@ function show_form($addfileaction='addfile',$removefileaction='removefile') * Get the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * - * @param addfileaction Name of action when posting file attachments - * @param removefileaction Name of action when removing file attachments + * @param string $addfileaction Name of action when posting file attachments + * @param string $removefileaction Name of action when removing file attachments + * @return string Form to show */ function get_form($addfileaction='addfile',$removefileaction='removefile') { diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index 68c4a21b6882b..0b2e6a999dfeb 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,9 +23,8 @@ /** - * \class FormOrder - * \brief Classe permettant la generation de composants html - * \remarks Only common components must be here. + * Classe permettant la generation de composants html + * Only common components are here. */ class FormOrder { @@ -35,24 +34,24 @@ class FormOrder /** - * \brief Constructeur - * \param DB handler d'acces base de donnee + * Constructor + * + * @param DoliDB $db Database handler */ - function FormOrder($DB) + function FormOrder($db) { - $this->db = $DB; - + $this->db = $db; return 1; } /** - * Renvoie la liste des sources de commandes + * Return list of way to order * - * @param selected Id de la source pre-selectionnee - * @param htmlname Nom de la liste deroulante - * @param addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue - * @return array Tableau des sources de commandes + * @param string $selected Id of preselected order origin + * @param string $htmlname Name of HTML select list + * @param int $addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @return array Tableau des sources de commandes */ function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0) { @@ -74,8 +73,12 @@ function selectSourcesCommande($selected='',$htmlname='source_id',$addempty=0) /** + * Return list of way to order * - * + * @param string $selected Id of preselected input method + * @param string $htmlname Name of HTML select list + * @param int $addempty 0=liste sans valeur nulle, 1=ajoute valeur inconnue + * @return array Tableau des sources de commandes */ function select_methodes_commande($selected='',$htmlname='source_id',$addempty=0) { @@ -89,7 +92,7 @@ function select_methodes_commande($selected='',$htmlname='source_id',$addempty=0 $sql.= " FROM ".MAIN_DB_PREFIX."c_input_method"; $sql.= " WHERE active = 1"; - dol_syslog("Form::select_methodes_commande sql=".$sql); + dol_syslog(get_class($this)."::select_methodes_commande sql=".$sql); $resql=$this->db->query($sql); if ($resql) { diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 16682a7b7a299..09e00ed12cf01 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Eric Seigne @@ -32,9 +32,8 @@ /** - * \class FormOther - * \brief Classe permettant la generation de composants html autre - * \remarks Only common components must be here. + * Classe permettant la generation de composants html autre + * Only common components are here. */ class FormOther { @@ -210,12 +209,12 @@ function select_ecotaxes($selected='',$htmlname='ecotaxe_id') /** * Return a HTML select list to select a percent * - * @param selected pourcentage pre-selectionne - * @param htmlname nom de la liste deroulante - * @param increment increment value - * @param start start value - * @param end end value - * @return return combo + * @param string $selected pourcentage pre-selectionne + * @param string $htmlname nom de la liste deroulante + * @param int $increment increment value + * @param int $start start value + * @param int $end end value + * @return string HTML select string */ function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100) { @@ -243,10 +242,10 @@ function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5 /** * Return select list for categories (to use in form search selectors) * - * @param type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) - * @param selected Preselected value - * @param htmlname Name of combo list - * @return return Html combo list code + * @param int $type Type of categories (0=product, 1=suppliers, 2=customers, 3=members) + * @param string $selected Preselected value + * @param string $htmlname Name of combo list + * @return string Html combo list code */ function select_categories($type,$selected=0,$htmlname='search_categ') { @@ -279,10 +278,10 @@ function select_categories($type,$selected=0,$htmlname='search_categ') /** * Return select list for categories (to use in form search selectors) * - * @param selected Preselected value - * @param htmlname Name of combo list - * @param user Object user - * @return return Html combo list code + * @param string $selected Preselected value + * @param string $htmlname Name of combo list + * @param User $user Object user + * @return string Html combo list code */ function select_salesrepresentatives($selected=0,$htmlname='search_sale',$user) { @@ -373,11 +372,11 @@ function selectProjectTasks($selectedtask='', $projectid=0, $htmlname='task_pare /** * Output a HTML code to select a color * - * @param set_color Pre-selected color - * @param prefix Name of HTML field - * @param form_name Name of form - * @param showcolorbox 1=Show color code and color box, 0=Show only color code - * @param arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') + * @param string $set_color Pre-selected color + * @param string $prefix Name of HTML field + * @param string $form_name Name of form + * @param int $showcolorbox 1=Show color code and color box, 0=Show only color code + * @param array $arrayofcolors Array of colors. Example: array('29527A','5229A3','A32929','7A367A','B1365F','0D7813') * @return void */ function select_color($set_color='', $prefix='f_color', $form_name='objForm', $showcolorbox=1, $arrayofcolors='') From aa8e7b1c0cabf1cd3912bc700f5eb0a73b58d86d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Jan 2012 16:10:44 +0100 Subject: [PATCH 2/3] Uniformize field country_id, country_code, country --- htdocs/core/class/html.formsms.class.php | 16 +- htdocs/core/class/interfaces.class.php | 31 +-- htdocs/core/class/ldap.class.php | 281 +++++++++++++---------- htdocs/core/class/menubase.class.php | 3 +- htdocs/core/class/translate.class.php | 3 +- 5 files changed, 191 insertions(+), 143 deletions(-) diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 46fae163e014d..0337578eb39c0 100755 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -24,11 +24,11 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/html.form.class.php"); -/** \class FormSms - * \brief Classe permettant la generation du formulaire d'envoi de Sms - * \remarks Utilisation: $formsms = new FormSms($db) - * \remarks $formsms->proprietes=1 ou chaine ou tableau de valeurs - * \remarks $formsms->show_form() affiche le formulaire +/** + * Classe permettant la generation du formulaire d'envoi de Sms + * Usage: $formsms = new FormSms($db) + * $formsms->proprietes=1 ou chaine ou tableau de valeurs + * $formsms->show_form() affiche le formulaire */ class FormSms { @@ -62,11 +62,11 @@ class FormSms /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function FormSms($DB) + function FormSms($db) { - $this->db = $DB; + $this->db = $db; $this->withfrom=1; $this->withto=1; diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 1b4c124f019e6..eb3395e73974f 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -25,8 +25,7 @@ /** - * \class Interfaces - * \brief Classe de la gestion des triggers + * Class to manage triggers */ class Interfaces @@ -45,26 +44,27 @@ function Interfaces($db) } /** - * \brief Fonction appelee lors du declenchement d'un evenement Dolibarr. - * Cette fonction declenche tous les triggers trouves actifs. - * \param action Trigger event code - * \param object Objet concern - * \param user Objet user - * \param lang Objet lang - * \param conf Objet conf - * \return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise. + * Function called when a Dolibarr business event occurs + * This function call all qualified triggers. + * + * @param string $action Trigger event code + * @param Object $object Objet concern + * @param User $user Objet user + * @param Lang $lang Objet lang + * @param Conf $conf Objet conf + * @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise. */ function run_triggers($action,$object,$user,$langs,$conf) { // Check parameters if (! is_object($object) || ! is_object($conf)) // Error { - dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_ERR); + dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_ERR); return -1; } if (! is_object($user) || ! is_object($langs)) // Warning { - dol_syslog('interface::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING); + dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING); } foreach($conf->triggers_modules as $reldir) @@ -175,9 +175,10 @@ function run_triggers($action,$object,$user,$langs,$conf) } /** - * Return list of triggers. Function used by admin page htdoc/admin/triggers - * @param workflow 0=Return all triggers, 1=Return only triggers not disabled if workflow module activated - * @return array Array list of triggers + * Return list of triggers. Function used by admin page htdoc/admin/triggers + * + * @param int $workflow 0=Return all triggers, 1=Return only triggers not disabled if workflow module activated + * @return array Array list of triggers */ function getTriggersList($workflow=0) { diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 862a213ef7639..ce2a91d0c4793 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -30,7 +30,6 @@ */ class Ldap { - /** * Tableau des serveurs (IP addresses ou nom d'hotes) */ @@ -90,7 +89,6 @@ class Ldap var $ldapcharset='UTF-8'; // LDAP should be UTF-8 encoded - // 1.2 Private properties ---------------------------------------------------- /** * The internal LDAP connection handle */ @@ -135,15 +133,16 @@ function __construct() - // 2.1 Connection handling methods ------------------------------------------- + // Connection handling methods ------------------------------------------- /** - * 2.1.1 : Connects to the server. Just creates a connection which is used + * Connects to the server. Just creates a connection which is used * in all later access to the LDAP server. If it can't connect and bind * anonymously, it creates an error code of -1. Returns true if connected, * false if failed. Takes an array of possible servers - if one doesn't work, * it tries the next and so on. - * \deprecated Utiliser connect_bind a la place + * + * @deprecated Utiliser connect_bind a la place */ function connect() { @@ -181,10 +180,11 @@ function connect() /** - * \brief Connect and bind - * \return <0 si KO, 1 si bind anonymous, 2 si bind auth - * \remarks Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword - * After return, this->connection and $this->bind are defined + * Connect and bind + * Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword + * After return, this->connection and $this->bind are defined + * + * @return int <0 si KO, 1 si bind anonymous, 2 si bind auth */ function connect_bind() { @@ -283,8 +283,10 @@ function connect_bind() /** - * 2.1.2 : Simply closes the connection set up earlier. + * Simply closes the connection set up earlier. * Returns true if OK, false if there was an error. + * + * @return boolean true or false */ function close() { @@ -299,8 +301,10 @@ function close() } /** - * 2.1.3 : Anonymously binds to the connection. After this is done, + * Anonymously binds to the connection. After this is done, * queries and searches can be done - but read-only. + * + * @return boolean true or false */ function bind() { @@ -318,10 +322,14 @@ function bind() } /** - * 2.1.4 : Binds as an authenticated user, which usually allows for write + * Binds as an authenticated user, which usually allows for write * access. The FULL dn must be passed. For a directory manager, this is * "cn=Directory Manager" under iPlanet. For a user, it will be something * like "uid=jbloggs,ou=People,dc=foo,dc=com". + * + * @param string $bindDn DN + * @param string $pass Password + * @return boolean true or false */ function bindauth($bindDn,$pass) { @@ -339,9 +347,9 @@ function bindauth($bindDn,$pass) } /** - * \brief Unbind du serveur ldap. - * \param ds - * \return bool + * Unbind du serveur ldap. + * + * @return boolean true or false */ function unbind() { @@ -355,9 +363,9 @@ function unbind() /** - * \brief verification de la version du serveur ldap. - * \param ds - * \return version + * Verification de la version du serveur ldap. + * + * @return string version */ function getVersion() { @@ -367,8 +375,9 @@ function getVersion() } /** - * \brief changement de la version du serveur ldap. - * \return version + * Change ldap protocol version to use. + * + * @return string version */ function setVersion() { // LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17 @@ -377,8 +386,9 @@ function setVersion() { } /** - * \brief changement du referrals. - * \return referrals + * changement du referrals. + * + * @return string referrals */ function setReferrals() { // LDAP_OPT_REFERRALS est une constante qui vaut ? @@ -388,12 +398,13 @@ function setReferrals() { /** - * \brief Add a LDAP entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that create - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Add a LDAP entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function add($dn, $info, $user) { @@ -439,12 +450,13 @@ function add($dn, $info, $user) } /** - * \brief Modify a LDAP entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that modify - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Modify a LDAP entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param string $user Objet user that modify + * @return int <0 if KO, >0 if OK */ function modify($dn, $info, $user) { @@ -490,13 +502,14 @@ function modify($dn, $info, $user) } /** - * \brief Modify a LDAP entry (to use if dn != olddn) - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that delete - * \param olddn Old DN entry key (before update) - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Modify a LDAP entry (to use if dn != olddn) + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that delete + * @param string $olddn Old DN entry key (before update) + * @return int <0 if KO, >0 if OK */ function update($dn,$info,$user,$olddn) { @@ -544,10 +557,11 @@ function update($dn,$info,$user,$olddn) /** - * \brief Delete a LDAP entry - * \param dn DN entry key - * \return int <0 si KO, >0 si OK - * \remarks Ldap object connect and bind must have been done + * Delete a LDAP entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @return int <0 if KO, >0 if OK */ function delete($dn) { @@ -577,10 +591,11 @@ function delete($dn) } /** - * \brief Build a LDAP message - * \param dn DN entry key - * \param info Attributes array - * \return string Content of file + * Build a LDAP message + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @return string Content of file */ function dump_content($dn, $info) { @@ -618,10 +633,11 @@ function dump_content($dn, $info) } /** - * \brief Dump a LDAP message to ldapinput.in file - * \param dn DN entry key - * \param info Attributes array - * \return int <0 if KO, >0 if OK + * Dump a LDAP message to ldapinput.in file + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @return int <0 if KO, >0 if OK */ function dump($dn, $info) { @@ -650,15 +666,16 @@ function dump($dn, $info) } - // 2.4 Attribute methods ----------------------------------------------------- + // Attribute methods ----------------------------------------------------- /** - * \brief Add a LDAP attribute in entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that create - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Add a LDAP attribute in entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function addAttribute($dn, $info, $user) { @@ -704,12 +721,13 @@ function addAttribute($dn, $info, $user) } /** - * \brief Update a LDAP attribute in entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that create - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Update a LDAP attribute in entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function updateAttribute($dn, $info, $user) { @@ -755,12 +773,13 @@ function updateAttribute($dn, $info, $user) } /** - * \brief Delete a LDAP attribute in entry - * \param dn DN entry key - * \param info Attributes array - * \param user Objet user that create - * \return int <0 if KO, >0 if OK - * \remarks Ldap object connect and bind must have been done + * Delete a LDAP attribute in entry + * Ldap object connect and bind must have been done + * + * @param string $dn DN entry key + * @param string $info Attributes array + * @param User $user Objet user that create + * @return int <0 if KO, >0 if OK */ function deleteAttribute($dn, $info, $user) { @@ -807,6 +826,10 @@ function deleteAttribute($dn, $info, $user) /** * Returns an array containing attributes and values for first record + * + * @param string $dn DN entry key + * @param string $filter Filter + * @return int <0 if KO, >0 if OK */ function getAttribute($dn,$filter) { @@ -848,6 +871,10 @@ function getAttribute($dn,$filter) /** * Returns an array containing values for an attribute and for first record matching filterrecord + * + * @param string $filterrecord Record + * @param string $attribute Attributes + * @return void */ function getAttributeValues($filterrecord,$attribute) { @@ -882,14 +909,15 @@ function getAttributeValues($filterrecord,$attribute) } /** - * \brief Returns an array containing a details of elements - * \param $search Valeur champ cle recherche, sinon '*' pour tous. - * \param $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org) - * \param $useridentifier Nom du champ cle (Ex: uid) - * \param $attributeArray Array of fields required (Ex: sn,userPassword) - * \param $activefilter 1=utilise le champ this->filter comme filtre - * \return array Array of [id_record][ldap_field]=value - * \remarks ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword + * Returns an array containing a details of elements + * ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword + * + * @param string $search Valeur champ cle recherche, sinon '*' pour tous. + * @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org) + * @param string $useridentifier Name of key field (Ex: uid) + * @param array $attributeArray Array of fields required (Ex: sn,userPassword) + * @param int $activefilter 1=utilise le champ this->filter comme filtre + * @return array Array of [id_record][ldap_field]=value */ function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0) { @@ -980,9 +1008,12 @@ function getRecords($search, $userDn, $useridentifier, $attributeArray, $activef /** * Converts a little-endian hex-number to one, that 'hexdec' can convert - * Indispensable pour Active Directory + * Required by Active Directory + * + * @param string $hex */ - function littleEndian($hex) { + function littleEndian($hex) + { for ($x=dol_strlen($hex)-2; $x >= 0; $x=$x-2) { $result .= substr($hex,$x,2); } @@ -991,9 +1022,10 @@ function littleEndian($hex) { /** - * Recupere le SID de l'utilisateur - * ldapuser. le login de l'utilisateur - * Indispensable pour Active Directory + * Recupere le SID de l'utilisateur + * Required by Active Directory + * + * @param string $ldapuser Login de l'utilisateur */ function getObjectSid($ldapUser) { @@ -1050,8 +1082,12 @@ function getObjectSid($ldapUser) /** * Returns the textual SID * Indispensable pour Active Directory + * + * @param string $binsid Binary SID + * @return string Textual SID */ - function binSIDtoText($binsid) { + function binSIDtoText($binsid) + { $hex_sid=bin2hex($binsid); $rev = hexdec(substr($hex_sid,0,2)); // Get revision-part of SID $subcount = hexdec(substr($hex_sid,2,2)); // Get count of sub-auth entries @@ -1066,14 +1102,15 @@ function binSIDtoText($binsid) { /** - * \brief Fonction de recherche avec filtre - * \remarks this->connection doit etre defini donc la methode bind ou bindauth doit avoir deja ete appelee - * \param checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com) - * \param filter Filtre de recherche (ex: (sn=nom_personne) ) - * \return array Tableau des reponses (cle en minuscule-valeur) - * \remarks Ne pas utiliser pour recherche d'une liste donnee de proprietes - * car conflit majuscule-minuscule. A n'utiliser que pour les pages - * 'Fiche LDAP' qui affiche champ lisibles par defaut. + * Fonction de recherche avec filtre + * this->connection doit etre defini donc la methode bind ou bindauth doit avoir deja ete appelee + * Ne pas utiliser pour recherche d'une liste donnee de proprietes + * car conflit majuscule-minuscule. A n'utiliser que pour les pages + * 'Fiche LDAP' qui affiche champ lisibles par defaut. + * + * @param checkDn DN de recherche (Ex: ou=users,cn=my-domain,cn=com) + * @param filter Filtre de recherche (ex: (sn=nom_personne) ) + * @return array Tableau des reponses (cle en minuscule-valeur) */ function search($checkDn, $filter) { @@ -1105,10 +1142,11 @@ function search($checkDn, $filter) /** * Load all attribute of a LDAP user - * @param $user User to search for. Not used if a filter is provided. - * @param filter Filter for search. Must start with &. - * Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com) - * @return int >0 if ok, <0 if ko + * + * @param User $user User to search for. Not used if a filter is provided. + * @param string $filter Filter for search. Must start with &. + * Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com) + * @return int >0 if OK, <0 if KO */ function fetch($user,$filter) { @@ -1195,12 +1233,15 @@ function fetch($user,$filter) } - // 2.6 helper methods + // helper methods /** - * Returns the correct user identifier to use, based on the ldap server type + * Returns the correct user identifier to use, based on the ldap server type + * + * @return string Login */ - function getUserIdentifier() { + function getUserIdentifier() + { if ($this->serverType == "activedirectory") { return $this->attr_sambalogin; } else { @@ -1209,10 +1250,13 @@ function getUserIdentifier() { } /** - * \brief UserAccountControl Flgs to more human understandable form... + * UserAccountControl Flgs to more human understandable form... * + * @param string $uacf UACF + * @return void */ - function parseUACF($uacf) { + function parseUACF($uacf) + { //All flags array $flags = array( "TRUSTED_TO_AUTH_FOR_DELEGATION" => 16777216, "PASSWORD_EXPIRED" => 8388608, @@ -1250,10 +1294,13 @@ function parseUACF($uacf) { } /** - * \brief SamAccountType value to text + * SamAccountType value to text * + * @param string $samtype SamType + * @return string Sam string */ - function parseSAT($samtype) { + function parseSAT($samtype) + { $stypes = array( 805306368 => "NORMAL_ACCOUNT", 805306369 => "WORKSTATION_TRUST", 805306370 => "INTERDOMAIN_TRUST", @@ -1275,9 +1322,10 @@ function parseSAT($samtype) { } /** - * \brief Convertit le temps ActiveDirectory en Unix timestamp - * \param string AD time to convert - * \return string Unix timestamp + * Convertit le temps ActiveDirectory en Unix timestamp + * + * @param string $value AD time to convert + * @return string Unix timestamp */ function convert_time($value) { @@ -1292,9 +1340,9 @@ function convert_time($value) /** * Convert a string into output/memory charset * - * @param str String to convert - * @param pagecodefrom Page code of src string - * @return string Converted string + * @param string $str String to convert + * @param string $pagecodefrom Page code of src string + * @return string Converted string */ private function convToOutputCharset($str,$pagecodefrom='UTF-8') { @@ -1307,21 +1355,22 @@ private function convToOutputCharset($str,$pagecodefrom='UTF-8') /** * Convert a string from output/memory charset * - * @param str String to convert - * @param pagecodeto Page code for result string - * @return string Converted string + * @param string $str String to convert + * @param string $pagecodeto Page code for result string + * @return string Converted string */ function convFromOutputCharset($str,$pagecodeto='UTF-8') { global $conf; - if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str); - if ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str); + if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str); + if ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str); return $str; } /** * Return available value of group GID + * * @return int gid number */ function getNextGroupGid() diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 70bb2737757a7..e4024f773661f 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -24,8 +24,7 @@ /** - * \class Menubase - * \brief Class to manage menu entries + * Class to manage menu entries */ class Menubase { diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 9f004232f22c8..2a24da9c0d520 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -27,8 +27,7 @@ /** - * \class Translate - * \brief Class to manage translations + * Class to manage translations */ class Translate { From ec0650e92be17f26c167e2b8fe8b1d69874b1153 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 27 Jan 2012 16:12:11 +0100 Subject: [PATCH 3/3] Doxygen --- htdocs/core/class/menu.class.php | 3 +-- htdocs/core/class/notify.class.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index d31be260e3133..cde57a97053bc 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -24,8 +24,7 @@ /** - * \class Menu - * \brief Class to manage left menus + * Class to manage left menus */ class Menu { diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 65c294b007792..f674831504b65 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -25,8 +25,7 @@ /** - * \class Notify - * \brief Classe de gestion des notifications + * Class to manage notifications */ class Notify {