diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index a1c5265ff55..0a88c6d6d98 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -8,7 +8,7 @@ - 0 + 0 diff --git a/htdocs/accountancy/class/accountancyaccount.class.php b/htdocs/accountancy/class/accountancyaccount.class.php index dd757d5a816..dfd591ae6cd 100644 --- a/htdocs/accountancy/class/accountancyaccount.class.php +++ b/htdocs/accountancy/class/accountancyaccount.class.php @@ -22,72 +22,73 @@ */ -/** \class AccountancyAccount - \brief Classe permettant la gestion des comptes -*/ +/** + * \class AccountancyAccount + * \brief Classe permettant la gestion des comptes + */ class AccountancyAccount { - var $db; - var $error; + var $db; + var $error; - var $rowid; - var $fk_pcg_version; - var $pcg_type; - var $pcg_subtype; - var $label; - var $account_number; - var $account_parent; + var $rowid; + var $fk_pcg_version; + var $pcg_type; + var $pcg_subtype; + var $label; + var $account_number; + var $account_parent; - /** - * Constructor - * - * @param $DoliDB $DB Database handler - */ - function AccountancyAccount($DB) - { - $this->db = $DB; - } + /** + * Constructor + * + * @param DoliDB $DB Database handler + */ + function AccountancyAccount($DB) + { + $this->db = $DB; + } - /** - * Insert account into database - * - * @param User $user User making add - * @return int <0 if KO, Id line added if OK - */ - function create($user) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount"; - $sql.= " (date_creation, fk_user_author, numero,intitule)"; - $sql.= " VALUES (".$this->db->idate(gmmktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')"; + /** + * Insert account into database + * + * @param User $user User making add + * @return int <0 if KO, Id line added if OK + */ + function create($user) + { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."accountingaccount"; + $sql.= " (date_creation, fk_user_author, numero,intitule)"; + $sql.= " VALUES (".$this->db->idate(gmmktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')"; - $resql = $this->db->query($sql); - if ($resql) - { - $id = $this->db->last_insert_id(MAIN_DB_PREFIX."accountingaccount"); + $resql = $this->db->query($sql); + if ($resql) + { + $id = $this->db->last_insert_id(MAIN_DB_PREFIX."accountingaccount"); - if ($id > 0) - { - $this->id = $id; - $result = $this->id; - } - else - { - $result = -2; - $this->error="AccountancyAccount::Create Erreur $result"; - dol_syslog($this->error, LOG_ERR); - } - } - else - { - $result = -1; - $this->error="AccountancyAccount::Create Erreur $result"; - dol_syslog($this->error, LOG_ERR); - } + if ($id > 0) + { + $this->id = $id; + $result = $this->id; + } + else + { + $result = -2; + $this->error="AccountancyAccount::Create Erreur $result"; + dol_syslog($this->error, LOG_ERR); + } + } + else + { + $result = -1; + $this->error="AccountancyAccount::Create Erreur $result"; + dol_syslog($this->error, LOG_ERR); + } - return $result; - } + return $result; + } } ?> diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 44a4e37922a..2ac33a71796 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -38,12 +38,9 @@ require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); */ class Adherent extends CommonObject { - var $db; - var $error; - var $errors=array(); - var $element='member'; - var $table_element='adherent'; - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='member'; + public $table_element='adherent'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; var $ref; @@ -1938,7 +1935,11 @@ class Adherent extends CommonObject /** - * Initialise le membre avec valeurs fictives aleatoire + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index de78dcb5b3c..aa08f2cbbe3 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -33,10 +33,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class AdherentType extends CommonObject { - var $error; - var $errors=array(); - var $db; - var $table_element = 'adherent_type'; + public $table_element = 'adherent_type'; var $id; var $libelle; diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php index 5ea122c80d3..24f2450dd19 100755 --- a/htdocs/adherents/class/adherentstats.class.php +++ b/htdocs/adherents/class/adherentstats.class.php @@ -33,12 +33,11 @@ include_once DOL_DOCUMENT_ROOT . "/adherents/class/cotisation.class.php"; */ class AdherentStats extends Stats { - var $db; + public $table_element; var $socid; var $userid; - var $table_element; var $from; var $field; var $where; diff --git a/htdocs/adherents/class/cotisation.class.php b/htdocs/adherents/class/cotisation.class.php index 75c7749e465..0ac1523f6d5 100644 --- a/htdocs/adherents/class/cotisation.class.php +++ b/htdocs/adherents/class/cotisation.class.php @@ -31,13 +31,10 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class Cotisation extends CommonObject { - var $id; - var $db; - var $error; - var $errors; - var $element='subscription'; - var $table_element='cotisation'; + public $element='subscription'; + public $table_element='cotisation'; + var $id; var $datec; var $datem; var $dateh; // Subscription start date diff --git a/htdocs/boutique/client/class/boutiqueclient.class.php b/htdocs/boutique/client/class/boutiqueclient.class.php index 3f7b7c67d05..837afb5497c 100644 --- a/htdocs/boutique/client/class/boutiqueclient.class.php +++ b/htdocs/boutique/client/class/boutiqueclient.class.php @@ -33,17 +33,24 @@ class BoutiqueClient var $id ; var $nom; - function BoutiqueClient($DB, $id=0) + + /** + * Constructor + * + * @param DoliDB $DB Database handler + */ + function BoutiqueClient($DB) { $this->db = $DB; - $this->id = $id ; } /** - * \brief Fonction permettant de recuperer les informations d'un clients de la boutique - * \param id Id du client + * Fonction permettant de recuperer les informations d'un clients de la boutique + * + * @param int $id Id du client + * @return int <0 if KO, >0 if OK */ - function fetch ($id) + function fetch($id) { global $conf; diff --git a/htdocs/boutique/commande/class/boutiquecommande.class.php b/htdocs/boutique/commande/class/boutiquecommande.class.php index 25ee3b0fad1..4b2d41e5221 100644 --- a/htdocs/boutique/commande/class/boutiquecommande.class.php +++ b/htdocs/boutique/commande/class/boutiquecommande.class.php @@ -32,102 +32,109 @@ include_once(DOL_DOCUMENT_ROOT.'/boutique/commande/class/boutiquecommande.class. */ class BoutiqueCommande { - var $db ; + var $db; - var $id ; - var $nom; + var $id; + var $nom; - function BoutiqueCommande($DB, $id=0) - { - $this->db = $DB; - $this->id = $id ; - $this->billing_adr = new Address(); - $this->delivry_adr = new Address(); + /** + * Constructor + * + * @param DoliDB $DB Database handler + */ + function BoutiqueCommande($DB) + { + $this->db = $DB; + $this->id = $id; - $this->total_ot_subtotal = 0; - $this->total_ot_shipping = 0; - } + $this->billing_adr = new Address(); + $this->delivry_adr = new Address(); - /** - * \brief Get object and lines from database - * \param rowid id of object to load - * \param ref Ref of order - * \return int >0 si ok, <0 si ko - */ - function fetch ($id,$ref='') - { - global $conf; + $this->total_ot_subtotal = 0; + $this->total_ot_shipping = 0; + } - $sql = "SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value"; - $sql.= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders"; - $sql.= " WHERE orders_id = ".$id; + /** + * Get object and lines from database + * + * @param int $id id of object to load + * @param string $ref Ref of order + * @return int >0 if OK, <0 if KO + */ + function fetch($id,$ref='') + { + global $conf; - $result = $this->db->query($sql); - if ( $result ) - { - $array = $this->db->fetch_array($result); + $sql = "SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value"; + $sql.= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders"; + $sql.= " WHERE orders_id = ".$id; - $this->id = $array["orders_id"]; - $this->client_id = stripslashes($array["customers_id"]); - $this->client_name = stripslashes($array["customers_name"]); + $result = $this->db->query($sql); + if ( $result ) + { + $array = $this->db->fetch_array($result); - $this->payment_method = stripslashes($array["payment_method"]); + $this->id = $array["orders_id"]; + $this->client_id = stripslashes($array["customers_id"]); + $this->client_name = stripslashes($array["customers_name"]); - $this->date = $this->db->jdate($array["date_purchased"]); + $this->payment_method = stripslashes($array["payment_method"]); - $this->delivery_adr->name = stripslashes($array["delivery_name"]); - $this->delivery_adr->street = stripslashes($array["delivery_street_address"]); - $this->delivery_adr->cp = stripslashes($array["delivery_postcode"]); - $this->delivery_adr->city = stripslashes($array["delivery_city"]); - $this->delivery_adr->country = stripslashes($array["delivery_country"]); + $this->date = $this->db->jdate($array["date_purchased"]); - $this->billing_adr->name = stripslashes($array["billing_name"]); - $this->billing_adr->street = stripslashes($array["billing_street_address"]); - $this->billing_adr->cp = stripslashes($array["billing_postcode"]); - $this->billing_adr->city = stripslashes($array["billing_city"]); - $this->billing_adr->country = stripslashes($array["billing_country"]); + $this->delivery_adr->name = stripslashes($array["delivery_name"]); + $this->delivery_adr->street = stripslashes($array["delivery_street_address"]); + $this->delivery_adr->cp = stripslashes($array["delivery_postcode"]); + $this->delivery_adr->city = stripslashes($array["delivery_city"]); + $this->delivery_adr->country = stripslashes($array["delivery_country"]); - $this->db->free(); + $this->billing_adr->name = stripslashes($array["billing_name"]); + $this->billing_adr->street = stripslashes($array["billing_street_address"]); + $this->billing_adr->cp = stripslashes($array["billing_postcode"]); + $this->billing_adr->city = stripslashes($array["billing_city"]); + $this->billing_adr->country = stripslashes($array["billing_country"]); - /* - * Totaux - */ - $sql = "SELECT value, class "; - $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total WHERE orders_id = $id"; + $this->db->free(); - $result = $this->db->query($sql); - if ( $result ) - { - $num = $this->db->num_rows($result); + /* + * Totaux + */ + $sql = "SELECT value, class "; + $sql .= " FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."orders_total WHERE orders_id = $id"; - while ($i < $num) - { - $array = $this->db->fetch_array($result); - if ($array["class"] == 'ot_total') - { - $this->total_ot_total = $array["value"]; - } - if ($array["class"] == 'ot_shipping') - { - $this->total_ot_shipping = $array["value"]; - } - $i++; - } - } - else - { - print $this->db->error(); - } + $result = $this->db->query($sql); + if ( $result ) + { + $num = $this->db->num_rows($result); - } - else - { - print $this->db->error(); - } + while ($i < $num) + { + $array = $this->db->fetch_array($result); + if ($array["class"] == 'ot_total') + { + $this->total_ot_total = $array["value"]; + } + if ($array["class"] == 'ot_shipping') + { + $this->total_ot_shipping = $array["value"]; + } + $i++; + } + } + else + { + print $this->db->error(); + } - return $result; - } + } + else + { + print $this->db->error(); + } + + return $result; + } } ?> diff --git a/htdocs/boutique/promotion/class/promotion.class.php b/htdocs/boutique/promotion/class/promotion.class.php index 6ec86cec1f6..d78c54e729f 100644 --- a/htdocs/boutique/promotion/class/promotion.class.php +++ b/htdocs/boutique/promotion/class/promotion.class.php @@ -16,28 +16,49 @@ * */ -class Promotion { - var $db ; +/** + * \file htdocs/boutique/promotion/class/promotion.class.php + * \brief File of class to manage discounts on online shop + */ - var $id ; - var $parent_id ; - var $oscid ; +/** + * \class Promotion + * \brief Class to manage discounts on online shop + */ +class Promotion +{ + var $db; + + var $id; + var $parent_id; + var $oscid; var $ref; var $titre; var $description; - var $price ; - var $status ; + var $price; + var $status; - function Promotion($DB, $id=0) { - $this->db = $DB; - $this->id = $id ; - } - /* - * - * + /** + * Constructor * + * @param DoliDB $DB Database handler */ - function create($user, $pid, $percent) { + function Promotion($DB) + { + $this->db = $DB; + $this->id = $id; + } + + /** + * Create promotion + * + * @param User $user Object user + * @param int $pid Pid + * @param int $percent Percent + * @return int <0 if KO, >0 if OK + */ + function create($user, $pid, $percent) + { global $conf; $sql = "SELECT products_price "; @@ -51,13 +72,13 @@ class Promotion { $this->price_init = $result["products_price"]; } - $newprice = 0.95 * $this->price_init; + $newprice = $percent * $this->price_init; $date_exp = "2003-05-01"; $sql = "INSERT INTO ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."specials "; $sql .= " (products_id, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status) "; - $sql .= " VALUES ($pid, $newprice, ".$this->db->idate(mktime()).", NULL, '$date_exp',NULL,1)"; + $sql .= " VALUES ($pid, $newprice, '".$this->db->idate(mktime())."', NULL, '".$this->db->idate(mktime()+3600*24*365)."', NULL, 1)"; if ($this->db->query($sql) ) { @@ -70,10 +91,13 @@ class Promotion { print $this->db->error() . ' in ' . $sql; } } - /* - * - * + + /** + * Update * + * @param int $id id + * @param User $user Object user + * @return int <0 if KO, >0 if OK */ function update($id, $user) { @@ -89,10 +113,12 @@ class Promotion { print $this->db->error() . ' in ' . $sql; } } - /* - * - * + + /** + * Set active * + * @param int $id id + * @return int <0 if KO, >0 if OK */ function set_active($id) { @@ -109,8 +135,12 @@ class Promotion { print $this->db->error() . ' in ' . $sql; } } - /* + + /** + * Set inactive * + * @param int $id id + * @return int <0 if KO, >0 if OK */ function set_inactive($id) { @@ -127,12 +157,15 @@ class Promotion { print $this->db->error() . ' in ' . $sql; } } - /* - * - * + + /** + * Fetch datas * + * @param int $id id + * @return int <0 if KO, >0 if OK */ - function fetch ($id) { + function fetch($id) + { global $conf; $sql = "SELECT c.categories_id, cd.categories_name, c.parent_id"; @@ -157,12 +190,14 @@ class Promotion { } - /* - * + /** + * Delete object * + * @param User $user Object user + * @return int <0 if KO, >0 if OK */ - function delete($user) { - + function delete($user) + { global $conf; $sql = "DELETE FROM ".$conf->global->OSC_DB_NAME.".".$conf->global->OSC_DB_TABLE_PREFIX."products WHERE products_id = $idosc "; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6613ada6ae8..e1e68db7a58 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -36,11 +36,8 @@ require_once(DOL_DOCUMENT_ROOT."/fourn/class/fournisseur.class.php"); */ class Categorie { - var $error; - var $db; - - var $element='category'; - var $table_element='category'; + public $element='category'; + public $table_element='category'; var $id; var $id_mere; @@ -550,7 +547,7 @@ class Categorie /** * Retourne les filles de la categorie - * + * * @return void */ function get_filles() @@ -936,7 +933,7 @@ class Categorie /** * Retourne les chemin de la categorie, avec les noms des categories * separes par $sep (" >> " par defaut) - * + * * @param string $sep Separator * @param string $url Url * @return void @@ -1053,7 +1050,7 @@ class Categorie /** * Retourne dans un tableau tous les chemins possibles pour arriver a la categorie * en partant des categories principales, representes par des tableaux de categories - * + * * @return void */ function get_all_ways () @@ -1344,9 +1341,10 @@ class Categorie /** - * Initialise an example of instance with random values - * Used to build previews or test instances - * + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * * @return void */ function initAsSpecimen() diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 93f40c13a77..8b5658fcf93 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -32,12 +32,9 @@ require_once(DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'); */ class ActionComm extends CommonObject { - var $db; - var $error; - var $errors=array(); - var $element='action'; - var $table_element = 'actioncomm'; - var $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='action'; + public $table_element = 'actioncomm'; + protected $ismultientitymanaged = 2; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $type_id; var $type_code; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 5b27032918e..60fe869aa97 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Mailing extends CommonObject { - var $db; - var $error; - var $element='mailing'; - var $table_element='mailing'; + public $element='mailing'; + public $table_element='mailing'; var $id; var $statut; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 84b0d47377a..6adbc8f94d1 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -42,13 +42,11 @@ require_once(DOL_DOCUMENT_ROOT ."/contact/class/contact.class.php"); */ class Propal extends CommonObject { - var $db; - var $error; - var $element='propal'; - var $table_element='propal'; - var $table_element_line='propaldet'; - var $fk_element='fk_propal'; - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='propal'; + public $table_element='propal'; + public $table_element_line='propaldet'; + public $fk_element='fk_propal'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; @@ -2128,8 +2126,11 @@ class Propal extends CommonObject /** - * Initialise an example of instance with random values - * Used to build previews or test instances + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 018dff2c73c..b817c000646 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -33,12 +33,11 @@ include_once DOL_DOCUMENT_ROOT . "/comm/propal/class/propal.class.php"; */ class PropaleStats extends Stats { - var $db; + public $table_element; var $socid; var $userid; - var $table_element; var $from; var $field; var $where; diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php index 6cce3431ad4..57fb8e5e338 100644 --- a/htdocs/comm/prospect/recap-prospect.php +++ b/htdocs/comm/prospect/recap-prospect.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/fourn/recap-fourn.php - * \ingroup fournisseur - * \brief Page de fiche recap fournisseur + * \file htdocs/comm/prospect/recap-prospect.php + * \ingroup societe + * \brief Page with prospect summary */ require("../../main.inc.php"); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 09ae19b4991..409df18639f 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -35,16 +35,14 @@ require_once(DOL_DOCUMENT_ROOT."/product/class/product.class.php"); */ class Commande extends CommonObject { - var $db; - var $error; - var $element='commande'; - var $table_element='commande'; - var $table_element_line = 'commandedet'; - var $class_element_line = 'OrderLine'; - var $fk_element = 'fk_commande'; - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='commande'; + public $table_element='commande'; + public $table_element_line = 'commandedet'; + public $class_element_line = 'OrderLine'; + public $fk_element = 'fk_commande'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $id ; + var $id; var $socid; // Id client var $client; // Objet societe client (a charger par fetch_client) @@ -2325,7 +2323,7 @@ class Commande extends CommonObject dol_syslog("CustomerOrder::delete error", LOG_ERR); $err++; } - + // On efface le repertoire de pdf provisoire $comref = dol_sanitizeFileName($this->ref); if ($conf->commande->dir_output) @@ -2598,8 +2596,11 @@ class Commande extends CommonObject /** - * Initialise an example of instance with random values - * Used to build previews or test instances + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index e30a2c645a8..294e3d52260 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -33,12 +33,11 @@ include_once DOL_DOCUMENT_ROOT . "/fourn/class/fournisseur.commande.class.php"; */ class CommandeStats extends Stats { - var $db ; + public $table_element; var $socid; var $userid; - var $table_element; var $from; var $field; var $where; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index d5d14e9e816..40362bb5f70 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -34,10 +34,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Account extends CommonObject { - var $db; - var $error; - var $element='bank_account'; - var $table_element='bank_account'; + public $element='bank_account'; + public $table_element='bank_account'; var $rowid; var $ref; @@ -987,7 +985,11 @@ class Account extends CommonObject } /** - * Initialize properties with test values + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index 32b341c3276..061d7055637 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -36,14 +36,10 @@ */ class BankCateg // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - var $errors=array(); //!< To return several error codes (or messages) - //var $element='bank_categ'; //!< Id that identify managed objects - //var $table_element='bank_categ'; //!< Name of table without prefix where object is stored + //public $element='bank_categ'; //!< Id that identify managed objects + //public $table_element='bank_categ'; //!< Name of table without prefix where object is stored var $id; - var $label; @@ -345,16 +341,17 @@ class BankCateg // extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { $this->id=0; $this->label=''; - - } } diff --git a/htdocs/compta/class/comptacompte.class.php b/htdocs/compta/class/comptacompte.class.php deleted file mode 100644 index d0e55c29561..00000000000 --- a/htdocs/compta/class/comptacompte.class.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/compta/class/comptacompte.class.php - * \ingroup compta - * \brief Fichier de la classe des comptes comptable - */ - - -/** \class ComptaCompte - * \brief Classe permettant la gestion des comptes generaux de compta - */ - -class ComptaCompte -{ - var $db ; - - var $id ; - var $num; - var $intitule; - - /** - * \brief Constructeur de la classe - * \param DB handler acces base de donnees - * \param id id compte (0 par defaut) - */ - - function ComptaCompte($DB, $id=0) - { - $this->db = $DB; - $this->id = $id ; - } - - /** - * \brief Insere le produit en base - * \param user utilisateur qui effectue l'insertion - */ - - function create($user) - { - if (dol_strlen(trim($this->numero)) && dol_strlen(trim($this->intitule))) - { - $sql = "SELECT count(*)"; - $sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux "; - $sql .= " WHERE numero = '" .trim($this->numero)."'"; - - $resql = $this->db->query($sql); - - if ( $resql ) - { - $row = $this->db->fetch_array($resql); - if ($row[0] == 0) - { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."compta_compte_generaux (date_creation, fk_user_author, numero,intitule)"; - $sql .= " VALUES (".$this->db->idate(mktime()).",".$user->id.",'".$this->numero."','".$this->intitule."')"; - - $resql = $this->db->query($sql); - if ( $resql ) - { - $id = $this->db->last_insert_id(MAIN_DB_PREFIX."compta_compte_generaux"); - - if ($id > 0) - { - $this->id = $id; - $result = 0; - } - else - { - $result = -2; - dol_syslog("ComptaCompte::Create Erreur $result lecture ID"); - } - } - else - { - $result = -1; - dol_syslog("ComptaCompte::Create Erreur $result INSERT Mysql"); - } - } - else - { - $result = -3; - dol_syslog("ComptaCompte::Create Erreur $result SELECT Mysql"); - } - } - else - { - $result = -5; - dol_syslog("ComptaCompte::Create Erreur $result SELECT Mysql"); - } - } - else - { - $result = -4; - dol_syslog("ComptaCompte::Create Erreur $result Valeur Manquante"); - } - - return $result; - } -} -?> diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index e2cbc28f14e..f7182869870 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -31,13 +31,11 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Deplacement extends CommonObject { - var $db; - var $error; - var $element='deplacement'; - var $table_element='deplacement'; - var $table_element_line = ''; - var $fk_element = ''; - var $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='deplacement'; + public $table_element='deplacement'; + public $table_element_line = ''; + public $fk_element = ''; + protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; diff --git a/htdocs/compta/deplacement/class/deplacementstats.class.php b/htdocs/compta/deplacement/class/deplacementstats.class.php index 3e212918849..f6569ca10ae 100644 --- a/htdocs/compta/deplacement/class/deplacementstats.class.php +++ b/htdocs/compta/deplacement/class/deplacementstats.class.php @@ -31,12 +31,11 @@ include_once DOL_DOCUMENT_ROOT . "/compta/deplacement/class/deplacement.class.ph */ class DeplacementStats extends Stats { - var $db; + public $table_element; var $socid; var $userid; - var $table_element; var $from; var $field; var $where; diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php index a714a650585..71ead3c64d1 100644 --- a/htdocs/compta/dons/class/don.class.php +++ b/htdocs/compta/dons/class/don.class.php @@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Don extends CommonObject { - var $db; - var $error; - var $element='don'; - var $table_element='don'; + public $element='don'; + public $table_element='don'; var $id; var $date; @@ -142,8 +140,11 @@ class Don extends CommonObject /** - * \brief Initialise le don avec valeurs fictives alaatoire - * Sert a generer un recu de don pour l'aperu des modeles ou demo + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 3535470dd90..f9baebbe540 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -35,13 +35,12 @@ require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); */ class FactureRec extends Facture { - var $db ; - var $element='facturerec'; - var $table_element='facture_rec'; - var $table_element_line='facturedet_rec'; - var $fk_element='fk_facture'; + public $element='facturerec'; + public $table_element='facture_rec'; + public $table_element_line='facturedet_rec'; + public $fk_element='fk_facture'; - var $id ; + var $id; //! Id customer var $socid; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 02874e46bdf..c65623d2cfe 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -40,14 +40,11 @@ require_once(DOL_DOCUMENT_ROOT ."/societe/class/client.class.php"); */ class Facture extends CommonObject { - var $db; - var $error; - var $errors=array(); - var $element='facture'; - var $table_element='facture'; - var $table_element_line = 'facturedet'; - var $fk_element = 'fk_facture'; - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='facture'; + public $table_element='facture'; + public $table_element_line = 'facturedet'; + public $fk_element = 'fk_facture'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $id; //! Id client @@ -3062,8 +3059,11 @@ class Facture extends CommonObject /** - * Initialise an example of invoice with random values - * Used to build previews or test instances + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index 136121faabd..c4fc13c00a5 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -33,12 +33,10 @@ include_once DOL_DOCUMENT_ROOT . "/lib/date.lib.php"; */ class FactureStats extends Stats { - var $db; - var $socid; var $userid; - var $table_element; + public $table_element; var $from; var $field; var $where; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index e8425698343..a2e74b9d1f1 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -33,8 +33,8 @@ class PaymentTerm // extends CommonObject var $db; //!< To store db handler var $error; //!< To return error code (or message) var $errors=array(); //!< To return several error codes (or messages) - //var $element='c_payment_term'; //!< Id that identify managed objects - //var $table_element='c_payment_term'; //!< Name of table without prefix where object is stored + //public $element='c_payment_term'; //!< Id that identify managed objects + //public $table_element='c_payment_term'; //!< Name of table without prefix where object is stored var $id; @@ -455,10 +455,11 @@ class PaymentTerm // extends CommonObject /** - * Initialise object with example values - * id must be 0 if object instance is a specimen - * - * @return void + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index f58d878c21b..66964796dae 100755 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -17,6 +17,11 @@ * along with this program. If not, see . */ +/** + * \file htdocs/compta/journal/purchasesjournal.php + * \ingroup societe, fournisseur, facture + * \brief Page with purchases journal + */ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); @@ -54,8 +59,8 @@ $html=new Form($db); $year_current = strftime("%Y",dol_now()); $pastmonth = strftime("%m",dol_now()) - 1; -$pastmonthyear = $year_current; -if ($pastmonth == 0) +$pastmonthyear = $year_current; +if ($pastmonth == 0) { $pastmonth = 12; $pastmonthyear--; diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index 1ca658c2b8f..1ead0d71a72 100755 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -17,6 +17,11 @@ * along with this program. If not, see . */ +/** + * \file htdocs/compta/journal/sellsjournal.php + * \ingroup societe, facture + * \brief Page with sells journal + */ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/report.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 37151fa5302..e7890ec980a 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class RemiseCheque extends CommonObject { - var $db; - var $error; - var $element='chequereceipt'; - var $table_element='bordereau_cheque'; + public $element='chequereceipt'; + public $table_element='bordereau_cheque'; var $id; var $num; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 5f300710892..3c673da95d0 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -30,10 +30,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Paiement extends CommonObject { - var $db; - var $error; - var $element='payment'; - var $table_element='paiement'; + public $element='payment'; + public $table_element='paiement'; var $id; var $ref; diff --git a/htdocs/compta/param/comptes/fiche.php b/htdocs/compta/param/comptes/fiche.php deleted file mode 100644 index 4fb01370324..00000000000 --- a/htdocs/compta/param/comptes/fiche.php +++ /dev/null @@ -1,103 +0,0 @@ - - * Copyright (C) 2004-2005 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - - -/** - * \file htdocs/compta/param/comptes/fiche.php - * \ingroup compta - * \brief Page de la fiche des comptes comptables - */ - -require("../../../main.inc.php"); - -$mesg = ''; - -if ($_POST["action"] == 'add' && $user->rights->compta->ventilation->parametrer) -{ - $compte = new ComptaCompte($db); - - $compte->numero = $_POST["numero"]; - $compte->intitule = $_POST["intitule"]; - - $e_compte = $compte; - - $res = $compte->create($user); - - if ($res == 0) - { - Header("Location: liste.php"); - } - else - { - if ($res == -3) - { - $_error = 1; - $_GET["action"] = "create"; - $_GET["type"] = $_POST["type"]; - } - if ($res == -4) - { - $_error = 2; - $_GET["action"] = "create"; - $_GET["type"] = $_POST["type"]; - } - } -} - -llxHeader("","Nouveau compte"); - -/* - * Creation d'un compte - * - */ -if ($_GET["action"] == 'create' && $user->rights->compta->ventilation->parametrer) -{ - $html = new Form($db); - $nbligne=0; - - print_fiche_titre($langs->trans("NewAccount")); - - print '
'; - print ''; - print ''; - print ''."\n"; - - print ''; - print ''; - print ''; - print ''; - - print ''; - print '
'.$langs->trans("AccountNumber").''; - if ($_error == 1) - { - print "Ce numéro de compte existe déjà"; - } - if ($_error == 2) - { - print "Valeur(s) manquante(s)"; - } - print '
'.$langs->trans("Label").'
 
'; - print '
'; -} - -$db->close(); - -llxFooter(); -?> diff --git a/htdocs/compta/param/comptes/index.php b/htdocs/compta/param/comptes/index.php deleted file mode 100644 index 59e1fd33bf6..00000000000 --- a/htdocs/compta/param/comptes/index.php +++ /dev/null @@ -1,78 +0,0 @@ - - * Copyright (C) 2004-2005 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/param/comptes/index.php - * \ingroup compta - * \brief Page acceuil zone parametrages - */ - -require("../../../main.inc.php"); - -$langs->load("compta"); -$langs->load("bills"); - -/* - * Securite acces client - */ -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -llxHeader("","Accueil Compta"); - -/* - * Affichage page - * - */ -print_fiche_titre($langs->trans("AccountancySetup")); - -print ''; - -print ''; - -print '
'; - -/* - * Zone recherche facture - */ -print '
'; -print ''; - -print ''; -print ""; -print ''; -print ""; -print ''; -print "
'.$langs->trans("SearchABill").'
'.$langs->trans("Ref").':

"; - - - -print '
'; - - - -print '
'; - -$db->close(); - -llxFooter(); -?> diff --git a/htdocs/compta/param/comptes/liste.php b/htdocs/compta/param/comptes/liste.php deleted file mode 100644 index 36a317d20cc..00000000000 --- a/htdocs/compta/param/comptes/liste.php +++ /dev/null @@ -1,126 +0,0 @@ - - * Copyright (C) 2005 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -/** - * \file htdocs/compta/param/comptes/liste.php - * \ingroup compta - * \brief Onglet de gestion de parametrages des ventilations - */ - -require("../../../main.inc.php"); - - -llxHeader('','Compta - Liste des comptes'); - -$page = $_GET["page"]; -$sortorder = $_GET["sortorder"]; -$sortfield = $_GET["sortfield"]; -if ($sortorder == "") $sortorder="ASC"; -if ($sortfield == "") $sortfield="cg.numero"; - -$offset = $conf->liste_limit * $page ; - -/* - * Mode Liste - * - * - * - */ - -$sql = "SELECT cg.rowid, cg.numero, cg.intitule, cg.date_creation as dc"; - -$sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux as cg"; - -if (dol_strlen(trim($_GET["search_numero"])) ) -{ - - $sql .= " WHERE cg.numero LIKE '%".$_GET["search_numero"]."%'"; - - if ( dol_strlen(trim($_GET["search_intitule"]))) - { - $sql .= " AND cg.intitule LIKE '%".$_GET["search_intitule"]."%'"; - } - -} -else -{ - if ( dol_strlen(trim($_GET["search_intitule"]))) - { - $sql .= " WHERE cg.intitule LIKE '%".$_GET["search_intitule"]."%'"; - } -} - - -$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); - -$resql = $db->query($sql); -if ($resql) -{ - $num = $db->num_rows($resql); - $i = 0; - - print_barre_liste("Comptes généraux", $page, "liste.php", "", $sortfield, $sortorder, '', $num); - - print ''; - print ''; - print_liste_field_titre($langs->trans("AccountNumberShort"),"liste.php","cg.numero"); - print_liste_field_titre($langs->trans("Label"),"liste.php","cg.intitule"); - print_liste_field_titre($langs->trans("DateCreation"),"liste.php","cg.date_creation"); - print "\n"; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $var=True; - - while ($i < min($num,$conf->liste_limit)) - { - $obj = $db->fetch_object($resql); - $var=!$var; - - print ""; - - print ''."\n"; - print ''; - print ''; - print "\n"; - $i++; - } - print "
'; - print ''; - print '
'.$obj->numero.''.$obj->intitule.''; - print dol_print_date($db->jdate($obj->dc)); - - print '
"; - $db->free($resql); -} -else -{ - dol_print_error($db); -} - -$db->close(); - -llxFooter(); -?> diff --git a/htdocs/compta/param/index.php b/htdocs/compta/param/index.php deleted file mode 100644 index 28be77fe418..00000000000 --- a/htdocs/compta/param/index.php +++ /dev/null @@ -1,75 +0,0 @@ - - * Copyright (C) 2004-2005 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/compta/param/index.php - * \ingroup compta - * \brief Page acceuil zone parametrage comptabilite - */ - -require("../../main.inc.php"); - -$langs->load("compta"); -$langs->load("bills"); - -/* - * S�curit� acc�s client - */ -if ($user->societe_id > 0) -{ - $action = ''; - $socid = $user->societe_id; -} - -llxHeader("",$langs->trans("AccountancySetup")); - -/* - * Affichage page - * - */ -print_fiche_titre($langs->trans("AccountancySetup")); - -print ''; - -print ''; - -print '
'; - -/* - * Zone recherche facture - */ -print '
'; -print ''; -print ""; -print ''; -print "'; -print "
'.$langs->trans("SearchABill").'
"; -print $langs->trans("Ref").':

"; - - - -print '
'; - - - -print '
'; - -$db->close(); - -llxFooter(); -?> diff --git a/htdocs/compta/prelevement/class/bon-prelevement.class.php b/htdocs/compta/prelevement/class/bon-prelevement.class.php index 7b4c8effc0c..4dc57382854 100644 --- a/htdocs/compta/prelevement/class/bon-prelevement.class.php +++ b/htdocs/compta/prelevement/class/bon-prelevement.class.php @@ -96,15 +96,16 @@ class BonPrelevement extends CommonObject /** * Add facture to withdrawal - * @param facture_id id invoice to add - * @param client_id id invoice customer - * @param client_nom name of cliente - * @param amount amount of invoice - * @param code_banque code of bank withdrawal - * @param code_guichet code of bank's office - * @param number bank account number - * @param number_key number key of account number - * @return int >0 if OK, <0 if KO + * + * @param int $facture_id id invoice to add + * @param int $client_id id invoice customer + * @param string $client_nom name of cliente + * @param int $amount amount of invoice + * @param string $code_banque code of bank withdrawal + * @param string $code_guichet code of bank's office + * @param string $number bank account number + * @param string $number_key number key of account number + * @return int >0 if OK, <0 if KO */ function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key) { @@ -153,15 +154,16 @@ class BonPrelevement extends CommonObject /** * Add line to withdrawal - * @param ligne_id id line to add - * @param client_id id invoice customer - * @param client_nom name of cliente - * @param amount amount of invoice - * @param code_banque code of bank withdrawal - * @param code_guichet code of bank's office - * @param number bank account number - * @param number_key number key of account number - * @return int >0 if OK, <0 if KO + * + * @param int &$line_id id line to add + * @param int $client_id id invoice customer + * @param string $client_nom name of cliente + * @param int $amount amount of invoice + * @param string $code_banque code of bank withdrawal + * @param string $code_guichet code of bank's office + * @param string $number bank account number + * @param string $number_key number key of account number + * @return int >0 if OK, <0 if KO */ function addline(&$line_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key) { @@ -234,8 +236,9 @@ class BonPrelevement extends CommonObject /** * Read errors - * @param error id of error - * @return array of errors + * + * @param int $error id of error + * @return array Array of errors */ function ReadError($error) { @@ -248,8 +251,9 @@ class BonPrelevement extends CommonObject /** * Get object and lines from database - * @param rowid id of object to load - * @return int >0 if OK, <0 if KO + * + * @param int $rowid id of object to load + * @return int >0 if OK, <0 if KO */ function fetch($rowid) { @@ -308,7 +312,10 @@ class BonPrelevement extends CommonObject } /** - * @deprecated + * Set credite + * + * @deprecated + * @return int <0 if KO, >0 if OK */ function set_credite() { @@ -334,7 +341,7 @@ class BonPrelevement extends CommonObject { $facs = array(); $facs = $this->_get_list_factures(); - + $num=count($facs); for ($i = 0; $i < $num; $i++) { @@ -386,9 +393,10 @@ class BonPrelevement extends CommonObject /** * Set withdrawal to creditet status - * @param user id of user - * @param date date of action - * @return int >0 if OK, <0 if KO + * + * @param User $user id of user + * @param timestamp $date date of action + * @return int >0 if OK, <0 if KO */ function set_infocredit($user, $date) { @@ -508,10 +516,11 @@ class BonPrelevement extends CommonObject /** * Set withdrawal to transmited status - * @param user id of user - * @param date date of action - * @param method method of transmision to bank - * @return int >0 if OK, <0 if KO + * + * @param User $user id of user + * @param timestamp $date date of action + * @param string $method method of transmision to bank + * @return int >0 if OK, <0 if KO */ function set_infotrans($user, $date, $method) { @@ -575,6 +584,7 @@ class BonPrelevement extends CommonObject /** * Get invoice list + * * @return array id of invoices */ function _get_list_factures() @@ -623,7 +633,8 @@ class BonPrelevement extends CommonObject /** * Returns amount of withdrawal - * @return double total amount + * + * @return double Total amount */ function SommeAPrelever() { @@ -659,9 +670,10 @@ class BonPrelevement extends CommonObject /** * Get number of invoices to withdrawal - * @param banque bank - * @param agence agence - * @return int AddFacture($fac[0], $fac[2], $fac[8], $fac[7], - $fac[3], $fac[4], $fac[5], $fac[6]); + $ri = $bonprev->AddFacture($fac[0], $fac[2], $fac[8], $fac[7], $fac[3], $fac[4], $fac[5], $fac[6]); if ($ri <> 0) { $error++; @@ -1005,7 +1015,6 @@ class BonPrelevement extends CommonObject /* * Update total - * */ $sql = "UPDATE ".MAIN_DB_PREFIX."prelevement_bons"; @@ -1023,7 +1032,6 @@ class BonPrelevement extends CommonObject /* * Rollback or Commit - * */ if (!$error) { @@ -1046,9 +1054,10 @@ class BonPrelevement extends CommonObject /** * Returns clickable name (with picto) - * @param withpicto link with picto - * @param option link target - * @return string URL of target + * + * @param int $withpicto link with picto + * @param string $option link target + * @return string URL of target */ function getNomUrl($withpicto=0,$option='') { @@ -1073,8 +1082,9 @@ class BonPrelevement extends CommonObject /** * Delete a notification def by id - * @param rowid id of notification - * @return int 0 if OK, <0 if KO + * + * @param int $rowid id of notification + * @return int 0 if OK, <0 if KO */ function DeleteNotificationById($rowid) { @@ -1095,9 +1105,10 @@ class BonPrelevement extends CommonObject /** * Delete a notification - * @param user notification user - * @param action notification action - * @return int >0 if OK, <0 if KO + * + * @param User $user notification user + * @param string $action notification action + * @return int >0 if OK, <0 if KO */ function DeleteNotification($user, $action) { @@ -1118,9 +1129,11 @@ class BonPrelevement extends CommonObject /** * Add a notification - * @param user notification user - * @param action notification action - * @return int 0 if OK, <0 if KO + * + * @param DoliDB $db database handler + * @param User $user notification user + * @param string $action notification action + * @return int 0 if OK, <0 if KO */ function AddNotification($db, $user, $action) { @@ -1148,13 +1161,13 @@ class BonPrelevement extends CommonObject /** - * Generate a withdrawal file - * Generation Formats: - * France: CFONB - * Spain: AEB19 (if external module EsAEB is enabled) - * Others: Warning message + * Generate a withdrawal file. Generation Formats: + * France: CFONB + * Spain: AEB19 (if external module EsAEB is enabled) + * Others: Warning message * File is generated with name this->filename - * @return int 0 if OK, <0 if KO + * + * @return int 0 if OK, <0 if KO */ //TODO: Optimize code to read lines in a single function function Generate() @@ -1198,15 +1211,17 @@ class BonPrelevement extends CommonObject { $obj = $this->db->fetch_object($resql); - $esaeb19->agregaRecibo($idOrdenante, - "idcliente".$i+1, - $obj->client_nom, - $obj->code_banque, - $obj->code_guichet, - $obj->cle_rib, - $obj->number, - $obj->amount, - "Fra.".$obj->facnumber." ".$obj->amount); + $esaeb19->agregaRecibo( + $idOrdenante, + "idcliente".$i+1, + $obj->client_nom, + $obj->code_banque, + $obj->code_guichet, + $obj->cle_rib, + $obj->number, + $obj->amount, + "Fra.".$obj->facnumber." ".$obj->amount + ); $this->total = $this->total + $obj->amount; @@ -1291,14 +1306,16 @@ class BonPrelevement extends CommonObject { $row = $this->db->fetch_row($resql); - $this->EnregDestinataire($row[0], - $row[1], - $row[2], - $row[3], - $row[4], - $row[5], - $row[6], - $row[7]); + $this->EnregDestinataire( + $row[0], + $row[1], + $row[2], + $row[3], + $row[4], + $row[5], + $row[6], + $row[7] + ); $this->total = $this->total + $row[5]; @@ -1362,14 +1379,16 @@ class BonPrelevement extends CommonObject /** * Write recipient of request (customer) - * @param rowid id of line - * @param client_nom name of customer - * @param rib_banque code of bank - * @param rib_guichet code of bank office - * @param rib_number bank account - * @param amount amount - * @param facnumber ref of invoice - * @param facid id of invoice + * + * @param int $rowid id of line + * @param string $client_nom name of customer + * @param string $rib_banque code of bank + * @param string $rib_guichet code of bank office + * @param string $rib_number bank account + * @param float $amount amount + * @param string $facnumber ref of invoice + * @param int $facid id of invoice + * @return void */ function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $facnumber, $facid) { @@ -1431,6 +1450,8 @@ class BonPrelevement extends CommonObject /** * Write sender of request (me) + * + * @return void */ function EnregEmetteur() { @@ -1495,7 +1516,9 @@ class BonPrelevement extends CommonObject /** * Write end - * @param total total amount + * + * @param int $total total amount + * @return void */ function EnregTotal($total) { @@ -1554,8 +1577,9 @@ class BonPrelevement extends CommonObject /** * Return status label of object - * @param mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto - * @return string Label + * + * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto + * @return string Label */ function getLibStatut($mode=0) { @@ -1564,9 +1588,10 @@ class BonPrelevement extends CommonObject /** * Return status label for a status - * @param statut id statut - * @param mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto - * @return string Label + * + * @param int $statut id statut + * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto + * @return string Label */ function LibStatut($statut,$mode=0) { diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index d6590108419..fc6f468637a 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -31,11 +31,9 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class ChargeSociales extends CommonObject { - var $db; - var $error; - var $element='rowid'; - var $table='chargesociales'; - var $table_element='chargesociales'; + public $element='rowid'; + public $table='chargesociales'; + public $table_element='chargesociales'; var $id; var $date_ech; @@ -397,8 +395,11 @@ class ChargeSociales extends CommonObject } /** - * Initialise an example of social contribution with random values - * Used to build previews or test instances + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index a344f8fb774..9e8c08c8e03 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -30,11 +30,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class PaymentSocialContribution extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - var $errors=array(); //!< To return several error codes (or messages) - var $element='paiementcharge'; //!< Id that identify managed objects - var $table_element='paiementcharge'; //!< Name of table without prefix where object is stored + public $element='paiementcharge'; //!< Id that identify managed objects + public $table_element='paiementcharge'; //!< Name of table without prefix where object is stored var $id; var $ref; @@ -428,8 +425,11 @@ class PaymentSocialContribution extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index a7915ae9d8a..13bd7a5d0f4 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -33,11 +33,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Tva extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - var $errors=array(); //!< To return several error codes (or messages) - //var $element='tva'; //!< Id that identify managed objects - //var $table_element='tva'; //!< Name of table without prefix where object is stored + //public $element='tva'; //!< Id that identify managed objects + //public $table_element='tva'; //!< Name of table without prefix where object is stored var $id; var $ref; @@ -302,8 +299,11 @@ class Tva extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { @@ -318,8 +318,6 @@ class Tva extends CommonObject $this->fk_bank=''; $this->fk_user_creat=''; $this->fk_user_modif=''; - - } diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index 71fe2484dd3..ae33c4e0d78 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -93,8 +93,32 @@ class ActionsContactCardDefault extends ActionsContactCardCommon $this->tpl['actionsdone']=show_actions_done($conf,$langs,$db,$objsoc,$this->object,1); } + + if ($action == 'list') + { + $this->LoadListDatas($GLOBALS['limit'], $GLOBALS['offset'], $GLOBALS['sortfield'], $GLOBALS['sortorder']); + } + } + + /** + * Fetch datas list + * + * @param int $limit Limit number of responses + * @param int $offset Offset for first response + * @param string $sortfield Sort field + * @param string $sortorder Sort order ('ASC' or 'DESC') + * @return void + */ + function LoadListDatas($limit, $offset, $sortfield, $sortorder) + { + global $conf, $langs; + + //$this->getFieldList(); + + $this->list_datas = array(); + } } ?> \ No newline at end of file diff --git a/htdocs/contact/canvas/default/dao_contact_default.class.php b/htdocs/contact/canvas/default/dao_contact_default.class.php index a8fc5715254..dbfab60e45d 100644 --- a/htdocs/contact/canvas/default/dao_contact_default.class.php +++ b/htdocs/contact/canvas/default/dao_contact_default.class.php @@ -27,11 +27,6 @@ */ class DaoContactDefault extends Contact { - var $db; - - //! Numero d'erreur Plage 1280-1535 - var $errno = 0; - /** * Constructor * @@ -42,58 +37,6 @@ class DaoContactDefault extends Contact $this->db = $DB; } - /** - * Create third party in database - * - * @param User $user Object of user that ask creation - * @return int >= 0 if OK, < 0 if KO - */ - function create($user='') - { - $result = parent::create($user); - - return $result; - } - - /** - * Update parameters of third party - * - * @param int $id Id societe - * @param User $user Utilisateur qui demande la mise a jour - * @param int $call_trigger 0=non, 1=oui - * @param int $allowmodcodeclient Inclut modif code client et code compta - * @param int $allowmodcodefournisseur Inclut modif code fournisseur et code compta fournisseur - * @return int <0 if KO, >=0 if OK - */ - function update($id, $user='', $call_trigger=1, $allowmodcodeclient=0, $allowmodcodefournisseur=0) - { - $result = parent::update($id, $user, $call_trigger, $allowmodcodeclient, $allowmodcodefournisseur); - - return $result; - } - - /** - * Delete third party in database - * - * @return int <0 if KO, >=0 if OK - */ - function delete() - { - $result = parent::delete(); - - return $result; - } - - /** - * Fetch datas list - */ - function LoadListDatas($limit, $offset, $sortfield, $sortorder) - { - global $conf, $langs; - - $this->list_datas = array(); - } - } ?> \ No newline at end of file diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 112fdf22833..18e021b15be 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -34,10 +34,8 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Contact extends CommonObject { - var $db; - var $error; - var $element='contact'; - var $table_element='socpeople'; + public $element='contact'; + public $table_element='socpeople'; var $id; var $civilite_id; // In fact we stor civility_code @@ -999,9 +997,11 @@ class Contact extends CommonObject /** - * Initialise le contact avec valeurs fictives aleatoire - * - * @return void + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 4680d47cd51..cefaf94c63e 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -37,12 +37,10 @@ require_once(DOL_DOCUMENT_ROOT."/lib/price.lib.php"); */ class Contrat extends CommonObject { - var $db; - var $error; - var $element='contrat'; - var $table_element='contrat'; - var $table_element_line='contratdet'; - var $fk_element='fk_contrat'; + public $element='contrat'; + public $table_element='contrat'; + public $table_element_line='contratdet'; + public $fk_element='fk_contrat'; var $id; var $ref; @@ -1424,7 +1422,11 @@ class Contrat extends CommonObject /** - * \brief Initialise le membre avec valeurs fictives aleatoire + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index aa01c56bce8..093a227ced0 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -462,10 +462,11 @@ class DiscountAbsolute /** - * Initializes the intervention with random values - * Used to generate a intervention for the preview or demo models - * - * @return void + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 4e1ec677cef..3cebdc74504 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -36,11 +36,8 @@ */ class Events // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - var $errors=array(); //!< To return several error codes (or messages) - var $element='events'; //!< Id that identify managed objects - var $table_element='events'; //!< Name of table without prefix where object is stored + public $element='events'; //!< Id that identify managed objects + public $table_element='events'; //!< Name of table without prefix where object is stored var $id; @@ -265,8 +262,11 @@ class Events // extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 88698b61a6e..156067a0b23 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -58,9 +58,9 @@ class Menubase /** * Constructor * - * @param DoliDB $DB Database handler - * @param string $menu_handler - * @param string $type + * @param DoliDB $DB Database handler + * @param string $menu_handler Menu handler + * @param string $type Type */ function Menubase($DB,$menu_handler='',$type='') { @@ -167,10 +167,11 @@ class Menubase } /** - * Update menu entry into database - * @param user User that modify - * @param notrigger 0=no, 1=yes (no update trigger) - * @return int <0 if KO, >0 if OK + * Update menu entry into database. + * + * @param User $user User that modify + * @param int $notrigger 0=no, 1=yes (no update trigger) + * @return int <0 if KO, >0 if OK */ function update($user=0, $notrigger=0) { @@ -302,10 +303,11 @@ class Menubase } - /* - * \brief Delete object in database - * \param user User that delete - * \return int <0 if KO, >0 if OK + /** + * Delete object in database + * + * @param User $user User that delete + * @return int <0 if KO, >0 if OK */ function delete($user) { @@ -328,8 +330,11 @@ class Menubase /** - * Initialise object with example values - * Id must be 0 if object instance is a specimen. + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { @@ -355,12 +360,13 @@ class Menubase /** - * Complete this->newmenu with menu entry found in $tab + * Complete this->newmenu with menu entry found in $tab * - * @param $tab - * @param $pere - * @param $rang - * @param $myleftmenu Value for left that defined leftmenu + * @param array $tab Tab array + * @param int $pere Id of parent + * @param int $rang Rang + * @param string $myleftmenu Value for left that defined leftmenu + * @return void */ function recur($tab, $pere, $rang, $myleftmenu) { @@ -397,12 +403,14 @@ class Menubase } /** - * Load tabMenu array - * @param type_user 0=Internal,1=External,2=All - * @param mainmenu Value for mainmenu that defined top menu - * @param menu_handler Name of menu_handler used (auguria, eldy...) - * @param tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @return array Return array with menu entries for top menu + * Load tabMenu array + * + * @param string $mainmenu Value for mainmenu that defined top menu + * @param string $myleftmenu Left menu name + * @param int $type_user 0=Internal,1=External,2=All + * @param string $menu_handler Name of menu_handler used (auguria, eldy...) + * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @return array Return array with menu entries for top menu */ function menuTopCharger($mainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu=null) { @@ -446,14 +454,15 @@ class Menubase } /** - * Load entries found in database in a menu array - * @param $newmenu Menu array to complete - * @param $mainmenu Value for mainmenu that defined top menu of left menu - * @param $myleftmenu Value that defined leftmenu - * @param $type_user 0=Internal,1=External,2=All - * @param $menu_handler Name of menu_handler used (auguria, eldy...) - * @param $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) - * @return array Menu array for particular mainmenu value or full tabArray + * Load entries found in database in a menu array. + * + * @param array $newmenu Menu array to complete + * @param string $mainmenu Value for mainmenu that defined top menu of left menu + * @param string $myleftmenu Value that defined leftmenu + * @param int $type_user 0=Internal,1=External,2=All + * @param string $menu_handler Name of menu_handler used (auguria, eldy...) + * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @return array Menu array for particular mainmenu value or full tabArray */ function menuLeftCharger($newmenu, $mainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu=null) { @@ -493,12 +502,13 @@ class Menubase /** - * Load entries found in database in a menu array - * @param $myleftmenu Value for left that defined leftmenu - * @param $type_user 0=Internal,1=External,2=All - * @param $menu_handler Name of menu_handler used (auguria, eldy...) - * @param $tabMenu If array with menu entries already load, we put this array here (in most cases, it's empty) - * @return int >0 if OK, <0 if KO + * Load entries found in database in a menu array. + * + * @param string $myleftmenu Value for left that defined leftmenu + * @param int $type_user 0=Internal,1=External,2=All + * @param string $menu_handler Name of menu_handler used (auguria, eldy...) + * @param array &$tabMenu If array with menu entries already load, we put this array here (in most cases, it's empty) + * @return int >0 if OK, <0 if KO */ function menuLoad($myleftmenu, $type_user, $menu_handler, &$tabMenu=array()) { diff --git a/htdocs/core/class/stats.class.php b/htdocs/core/class/stats.class.php index c302b215d66..df1f7404e76 100644 --- a/htdocs/core/class/stats.class.php +++ b/htdocs/core/class/stats.class.php @@ -1,6 +1,6 @@ - * Copyright (c) 2008-2010 Laurent Destailleur + * Copyright (c) 2008-2011 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 @@ -28,8 +28,15 @@ */ abstract class Stats { - var $db ; + protected $db; + + /** + * Constructor + * + * @param DoliDB $DB Database handler + * @return Stats + */ function Stats($DB) { $this->db = $DB; @@ -37,6 +44,7 @@ abstract class Stats /** * Return nb of entity by month for several years + * * @param endyear Start year * @param startyear End year * @return array Array of values @@ -110,6 +118,7 @@ abstract class Stats /** * Return nb of elements by year + * * @param sql SQL request * @return array */ @@ -139,6 +148,7 @@ abstract class Stats /** * Return nb of elements, total amount and avg amount by year + * * @param sql SQL request * @return array */ @@ -171,6 +181,7 @@ abstract class Stats /** * Renvoie le nombre de proposition par mois pour une annee donnee + * * @param year Year * @param sql SQL */ @@ -218,6 +229,7 @@ abstract class Stats /** * Renvoie le nombre d'element par mois pour une annee donnee + * * @param year Year * @param sql SQL */ @@ -262,6 +274,7 @@ abstract class Stats /** * Renvoie le montant moyen par mois pour une annee donnee + * * @param year Year * @param sql SQL */ diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 0e2fd4e7259..ac8429d0c0d 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -30,11 +30,8 @@ */ class EcmDirectory // extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - var $errors=array(); //!< To return several error codes (or messages) - //var $element='ecm_directories'; //!< Id that identify managed objects - //var $table_element='ecm_directories'; //!< Name of table without prefix where object is stored + //public $element='ecm_directories'; //!< Id that identify managed objects + //public $table_element='ecm_directories'; //!< Name of table without prefix where object is stored var $id; @@ -377,8 +374,11 @@ class EcmDirectory // extends CommonObject /** - * \brief Initialise object with example values - * \remarks id must be 0 if object instance is a specimen. + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 8b267a173ed..036040ed06d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -36,11 +36,9 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/co */ class Expedition extends CommonObject { - var $db; - var $error; - var $element="shipping"; - var $fk_element="fk_expedition"; - var $table_element="expedition"; + public $element="shipping"; + public $fk_element="fk_expedition"; + public $table_element="expedition"; var $id; var $socid; @@ -973,8 +971,11 @@ class Expedition extends CommonObject } /** - * \brief Initialise la facture avec valeurs fictives aleatoire - * Sert a generer une facture pour l'aperu des modeles ou dem + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index b1b8ad1ebce..6d240bfb31d 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -32,11 +32,10 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Fichinter extends CommonObject { - var $db; - var $element='fichinter'; - var $table_element='fichinter'; - var $fk_element='fk_fichinter'; - var $table_element_line='fichinterdet'; + public $element='fichinter'; + public $table_element='fichinter'; + public $fk_element='fk_fichinter'; + public $table_element_line='fichinterdet'; var $id; @@ -751,8 +750,11 @@ class Fichinter extends CommonObject /** - * Initializes the intervention with random values - * Used to generate a intervention for the preview or demo models + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index c82680ce46b..7ee68dd62e2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -36,15 +36,11 @@ require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"); */ class CommandeFournisseur extends Commande { - var $id ; - var $db ; - var $error; - - var $element='order_supplier'; - var $table_element='commande_fournisseur'; - var $table_element_line = 'commande_fournisseurdet'; - var $fk_element = 'fk_commande'; - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='order_supplier'; + public $table_element='commande_fournisseur'; + public $table_element_line = 'commande_fournisseurdet'; + public $fk_element = 'fk_commande'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $ref; // TODO deprecated var $product_ref; @@ -1666,8 +1662,11 @@ class CommandeFournisseur extends Commande /** - * Initialise an example of instance with random values - * Used to build previews or test instances + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 0d98c3ef5ed..1f529dcedc4 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -35,15 +35,11 @@ include_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php"); */ class FactureFournisseur extends Facture { - var $id; - var $db; - var $error; - - var $element='invoice_supplier'; - var $table_element='facture_fourn'; - var $table_element_line='facture_fourn_det'; - var $fk_element='fk_facture_fourn'; - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='invoice_supplier'; + public $table_element='facture_fourn'; + public $table_element_line='facture_fourn_det'; + public $fk_element='fk_facture_fourn'; + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $ref; // TODO deprecated var $product_ref; @@ -1201,8 +1197,11 @@ class FactureFournisseur extends Facture /** - * Initialise an example of instance with random values - * Used to build previews or test instances + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index 066073f953a..ec97237457f 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -32,10 +32,8 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'); */ class PaiementFourn extends Paiement { - var $db; - var $error; - var $element='payment_supplier'; - var $table_element='paiementfourn'; + public $element='payment_supplier'; + public $table_element='paiementfourn'; var $id; var $ref; @@ -188,7 +186,7 @@ class PaiementFourn extends Paiement dol_syslog('Paiement::Create Erreur INSERT dans paiement_facture '.$facid); $error++; } - + } else { diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index c6a835fedb5..af0ae64074a 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -62,7 +62,7 @@ class Import { global $langs,$conf; - dol_syslog("Import::load_arrays user=".$user->id." filter=".$filter); + dol_syslog(get_class($this)."::load_arrays user=".$user->id." filter=".$filter); $var=true; $i=0; @@ -73,99 +73,92 @@ class Import $dir = $dirroot.'/includes/modules'; // Search available exports - $handle=@opendir($dir); - if (is_resource($handle)) + $handle=@opendir(dol_osencode($dir)); + if (! is_resource($handle)) continue; + + // Search module files + while (($file = readdir($handle))!==false) { - // Search module files - while (($file = readdir($handle))!==false) + if (! preg_match("/^(mod.*)\.class\.php/i",$file,$reg)) continue; + + $modulename=$reg[1]; + + // Defined if module is enabled + $enabled=true; + $part=strtolower(preg_replace('/^mod/i','',$modulename)); + if (empty($conf->$part->enabled)) $enabled=false; + + if (empty($enabled)) continue; + + // Init load class + $file = $dir."/".$modulename.".class.php"; + $classname = $modulename; + require_once($file); + $module = new $classname($this->db); + + if (is_array($module->import_code)) { - if (preg_match("/^(mod.*)\.class\.php/i",$file,$reg)) + foreach($module->import_code as $r => $value) { - $modulename=$reg[1]; + if ($filter && ($filter != $module->import_code[$r])) continue; - // Defined if module is enabled - $enabled=true; - $part=strtolower(preg_replace('/^mod/i','',$modulename)); - if (empty($conf->$part->enabled)) $enabled=false; - - if ($enabled) + // Test if permissions are ok + /*$perm=$module->import_permission[$r][0]; + //print_r("$perm[0]-$perm[1]-$perm[2]
"); + if ($perm[2]) { - // Chargement de la classe - $file = $dir."/".$modulename.".class.php"; - $classname = $modulename; - require_once($file); - $module = new $classname($this->db); + $bool=$user->rights->$perm[0]->$perm[1]->$perm[2]; + } + else + { + $bool=$user->rights->$perm[0]->$perm[1]; + } + if ($perm[0]=='user' && $user->admin) $bool=true; + //print $bool." $perm[0]"."
"; + */ - if (is_array($module->import_code)) + // Load lang file + $langtoload=$module->getLangFilesArray(); + if (is_array($langtoload)) + { + foreach($langtoload as $key) { - foreach($module->import_code as $r => $value) - { - if ($filter && ($filter != $module->import_code[$r])) continue; - - // Test if permissions are ok - /*$perm=$module->import_permission[$r][0]; - //print_r("$perm[0]-$perm[1]-$perm[2]
"); - if ($perm[2]) - { - $bool=$user->rights->$perm[0]->$perm[1]->$perm[2]; - } - else - { - $bool=$user->rights->$perm[0]->$perm[1]; - } - if ($perm[0]=='user' && $user->admin) $bool=true; - //print $bool." $perm[0]"."
"; - */ - - // Permissions ok - // if ($bool) - // { - // Charge fichier lang en rapport - $langtoload=$module->getLangFilesArray(); - if (is_array($langtoload)) - { - foreach($langtoload as $key) - { - $langs->load($key); - } - } - - // Module - $this->array_import_module[$i]=$module; - // Permission - $this->array_import_perms[$i]=$user->rights->import->run; - // Icon - $this->array_import_icon[$i]=(isset($module->import_icon[$r])?$module->import_icon[$r]:$module->picto); - // Code du dataset export - $this->array_import_code[$i]=$module->import_code[$r]; - // Libelle du dataset export - $this->array_import_label[$i]=$module->getImportDatasetLabel($r); - // Array of tables to import (key=alias, value=tablename) - $this->array_import_tables[$i]=$module->import_tables_array[$r]; - // Array of tables creator field to import (key=alias, value=creator field) - $this->array_import_tables_creator[$i]=$module->import_tables_creator_array[$r]; - // Array of fiels to import (key=field, value=label) - $this->array_import_fields[$i]=$module->import_fields_array[$r]; - // Tableau des entites a exporter (cle=champ, valeur=entite) - $this->array_import_entities[$i]=$module->import_entities_array[$r]; - // Tableau des alias a exporter (cle=champ, valeur=alias) - $this->array_import_regex[$i]=$module->import_regex_array[$r]; - // Tableau des alias a exporter (cle=champ, valeur=exemple) - $this->array_import_examplevalues[$i]=$module->import_examplevalues_array[$r]; - // Tableau des regles de conversion d'une valeur depuis une autre source (cle=champ, valeur=tableau des regles) - $this->array_import_convertvalue[$i]=$module->import_convertvalue_array[$r]; - - dol_syslog("Import loaded for module ".$modulename." with index ".$i.", dataset=".$module->import_code[$r].", nb of fields=".count($module->import_fields_code[$r])); - $i++; - // } - } + $langs->load($key); } } + + // Module + $this->array_import_module[$i]=$module; + // Permission + $this->array_import_perms[$i]=$user->rights->import->run; + // Icon + $this->array_import_icon[$i]=(isset($module->import_icon[$r])?$module->import_icon[$r]:$module->picto); + // Code du dataset export + $this->array_import_code[$i]=$module->import_code[$r]; + // Libelle du dataset export + $this->array_import_label[$i]=$module->getImportDatasetLabel($r); + // Array of tables to import (key=alias, value=tablename) + $this->array_import_tables[$i]=$module->import_tables_array[$r]; + // Array of tables creator field to import (key=alias, value=creator field) + $this->array_import_tables_creator[$i]=$module->import_tables_creator_array[$r]; + // Array of fiels to import (key=field, value=label) + $this->array_import_fields[$i]=$module->import_fields_array[$r]; + // Tableau des entites a exporter (cle=champ, valeur=entite) + $this->array_import_entities[$i]=$module->import_entities_array[$r]; + // Tableau des alias a exporter (cle=champ, valeur=alias) + $this->array_import_regex[$i]=$module->import_regex_array[$r]; + // Tableau des alias a exporter (cle=champ, valeur=exemple) + $this->array_import_examplevalues[$i]=$module->import_examplevalues_array[$r]; + // Tableau des regles de conversion d'une valeur depuis une autre source (cle=champ, valeur=tableau des regles) + $this->array_import_convertvalue[$i]=$module->import_convertvalue_array[$r]; + + dol_syslog("Import loaded for module ".$modulename." with index ".$i.", dataset=".$module->import_code[$r].", nb of fields=".count($module->import_fields_code[$r])); + $i++; } } } + closedir($handle); } - closedir($handle); return 1; } @@ -175,19 +168,18 @@ class Import * Build an import example file. * Arrays this->array_export_xxx are already loaded for required datatoexport * - * @param User $user User qui exporte - * @param string $model Modele d'export + * @param string $model Name of import engine ('csv', ...) * @param string $headerlinefields Array of values for first line of example file * @param string $contentlinevalues Array of values for content line of example file * @return string <0 if KO, >0 if OK */ - function build_example_file($user, $model, $headerlinefields, $contentlinevalues) + function build_example_file($model, $headerlinefields, $contentlinevalues) { global $conf,$langs; $indice=0; - dol_syslog("Import::build_example_file ".$model); + dol_syslog(get_class($this)."::build_example_file ".$model); // Creation de la classe d'import du model Import_XXX $dir = DOL_DOCUMENT_ROOT . "/includes/modules/import/"; @@ -238,7 +230,7 @@ class Import $sql.= ')'; $sql.= " VALUES (".($user->id > 0 ? $user->id : 0).", '".$this->db->escape($this->model_name)."', '".$this->datatoimport."', '".$this->hexa."')"; - dol_syslog("Import::create sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) { @@ -249,7 +241,7 @@ class Import { $this->error=$this->db->lasterror(); $this->errno=$this->db->lasterrno(); - dol_syslog("Import::create error ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); $this->db->rollback(); return -1; } @@ -267,7 +259,7 @@ class Import $sql.= ' FROM '.MAIN_DB_PREFIX.'import_model as em'; $sql.= ' WHERE em.rowid = '.$id; - dol_syslog("Import::fetch sql=".$sql, LOG_DEBUG); + dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) { diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php index 2acf78e557a..1421d116343 100644 --- a/htdocs/imports/emptyexample.php +++ b/htdocs/imports/emptyexample.php @@ -86,6 +86,6 @@ foreach($fieldstarget as $code=>$label) //var_dump($headerlinefields); //var_dump($contentlinevalues); -print $objimport->build_example_file($user,$format,$headerlinefields,$contentlinevalues); +print $objimport->build_example_file($format,$headerlinefields,$contentlinevalues); ?> diff --git a/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php index 21c0460bfca..3acd5771307 100644 --- a/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php @@ -173,9 +173,12 @@ class BordereauChequeBlochet extends ModeleChequeReceipts /** * Generate Header - * @param pdf Pdf object - * @param page Current page number - * @param pages Total number of pages + * + * @param PDF &$pdf Pdf object + * @param int $page Current page number + * @param int $pages Total number of pages + * @param Translate $outputlangs Object language for output + * @return void */ function Header(&$pdf, $page, $pages, $outputlangs) { diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 8ec3d0c9a1d..97c3a72d4b2 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -37,11 +37,9 @@ if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT."/commande/class/co */ class Livraison extends CommonObject { - var $db; - var $error; - var $element="delivery"; - var $fk_element="fk_livraison"; - var $table_element="livraison"; + public $element="delivery"; + public $fk_element="fk_livraison"; + public $table_element="livraison"; var $id; var $brouillon; @@ -713,7 +711,11 @@ class Livraison extends CommonObject /** - * \brief Initialise object with default value to be used as example + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1d9c15f5e17..55084c16d68 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -67,7 +67,7 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP6 * * @param string $val Value * @param string $get 1=GET, 0=POST - * @return boolean true if ther is an injection + * @return boolean true if there is an injection */ function test_sql_and_script_inject($val, $get) { @@ -90,7 +90,7 @@ function test_sql_and_script_inject($val, $get) /** * Security: Return true if OK, false otherwise * - * @param string $var Variable name + * @param string &$var Variable name * @param string $get 1=GET, 0=POST * @return boolean true if ther is an injection */ diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index 7e17a84272a..10384ca0086 100755 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -28,7 +28,6 @@ include_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php'); */ class ActionsCardProduct extends Product { - var $db; var $targetmodule; var $canvas; var $card; @@ -38,6 +37,7 @@ class ActionsCardProduct extends Product // List of fiels for action=list var $field_list =array(); + public $list_datas = array(); /** @@ -48,7 +48,7 @@ class ActionsCardProduct extends Product * @param string $canvas Name of canvas * @param string $card Name of tab (sub-canvas) */ - function ActionsCardIndividual($DB,$targetmodule,$canvas,$card) + function ActionsCardProduct($DB,$targetmodule,$canvas,$card) { $this->db = $DB; $this->targetmodule = $targetmodule; @@ -64,6 +64,8 @@ class ActionsCardProduct extends Product /** * Return the title of card + * + * @return string Label of card */ private function getTitle() { @@ -75,7 +77,8 @@ class ActionsCardProduct extends Product /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param action Type of action + * @param string $action Type of action + * @return void */ function assign_values($action) { @@ -141,7 +144,7 @@ class ActionsCardProduct extends Product $this->tpl['accountancySellCodeKey'] = $html->editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer); $this->tpl['accountancySellCodeVal'] = $html->editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer); } - + $this->tpl['finished'] = $this->object->finished; $this->tpl['ref'] = $this->object->ref; $this->tpl['label'] = $this->object->label; @@ -249,6 +252,8 @@ class ActionsCardProduct extends Product /** * Fetch field list + * + * @return void */ private function getFieldList() { @@ -299,6 +304,12 @@ class ActionsCardProduct extends Product /** * Fetch datas list + * + * @param int $limit Limit number of responses + * @param int $offset Offset for first response + * @param string $sortfield Sort field + * @param string $sortorder Sort order ('ASC' or 'DESC') + * @return void */ function LoadListDatas($limit, $offset, $sortfield, $sortorder) { @@ -372,7 +383,7 @@ class ActionsCardProduct extends Product $sql.= " AND p.canvas = '".$this->db->escape($_GET["canvas"])."'"; } $sql.= $this->db->order($sortfield,$sortorder); - $sql.= $this->db->plimit($limit + 1 ,$offset); + $sql.= $this->db->plimit($limit+1, $offset); //print $sql; $resql = $this->db->query($sql); diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index fb23f213c71..7706a5827db 100755 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -23,12 +23,11 @@ include_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php'); /** - * \class ProductService + * \class ActionsCardService * \brief Class with controller methods for product canvas */ class ActionsCardService extends Product { - var $db; var $targetmodule; var $canvas; var $card; @@ -38,6 +37,7 @@ class ActionsCardService extends Product // List of fiels for action=list var $field_list =array(); + public $list_datas = array(); /** @@ -48,7 +48,7 @@ class ActionsCardService extends Product * @param string $canvas Name of canvas * @param string $card Name of tab (sub-canvas) */ - function ActionsCardIndividual($DB,$targetmodule,$canvas,$card) + function ActionsCardService($DB,$targetmodule,$canvas,$card) { $this->db = $DB; $this->targetmodule = $targetmodule; @@ -64,6 +64,8 @@ class ActionsCardService extends Product /** * Return the title of card + * + * @return string Label of card */ private function getTitle() { @@ -75,7 +77,8 @@ class ActionsCardService extends Product /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * - * @param action Type of action + * @param string $action Type of action + * @return void */ function assign_values($action) { @@ -141,7 +144,7 @@ class ActionsCardService extends Product $this->tpl['accountancySellCodeKey'] = $html->editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer); $this->tpl['accountancySellCodeVal'] = $html->editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,'id',$this->id,$user->rights->produit->creer); } - + $this->tpl['finished'] = $this->object->finished; $this->tpl['ref'] = $this->object->ref; $this->tpl['label'] = $this->object->label; @@ -229,6 +232,8 @@ class ActionsCardService extends Product /** * Fetch field list + * + * @return void */ private function getFieldList() { @@ -277,7 +282,13 @@ class ActionsCardService extends Product } /** - * \brief Fetch datas list + * Fetch datas list + * + * @param int $limit Limit number of responses + * @param int $offset Offset for first response + * @param string $sortfield Sort field + * @param string $sortorder Sort order ('ASC' or 'DESC') + * @return void */ function LoadListDatas($limit, $offset, $sortfield, $sortorder) { @@ -327,7 +338,7 @@ class ActionsCardService extends Product $sql .= " AND cp.fk_categorie = ".$this->db->escape($search_categ); } $sql.= $this->db->order($sortfield,$sortorder); - $sql.= $this->db->plimit($limit + 1 ,$offset); + $sql.= $this->db->plimit($limit+1, $offset); $this->list_datas = array(); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c6b2f1f3f91..ec4cc4b49aa 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -34,16 +34,12 @@ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); */ class Product extends CommonObject { - var $db; - var $error; - var $errno = 0; - - var $element='product'; - var $table_element='product'; - var $fk_element='fk_product'; - var $childtables=array('propaldet','commandedet','facturedet','contratdet','product_fournisseur'); - var $isnolinkedbythird = 1; // No field fk_soc - var $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + public $element='product'; + public $table_element='product'; + public $fk_element='fk_product'; + public $childtables=array('propaldet','commandedet','facturedet','contratdet','product_fournisseur'); + protected $isnolinkedbythird = 1; // No field fk_soc + protected $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe //! Identifiant unique var $id ; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 0492718625d..5046fb47e28 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -33,10 +33,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); class Entrepot extends CommonObject { - var $db; - var $error; - var $element='label'; - var $table_element='entrepot'; + public $element='label'; + public $table_element='entrepot'; var $id; var $libelle; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1f63031869e..b12edb2fb37 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -30,11 +30,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class Project extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - var $errors=array(); //!< To return several error codes (or messages) - var $element='project'; //!< Id that identify managed objects - var $table_element='projet'; //!< Name of table without prefix where object is stored + public $element='project'; //!< Id that identify managed objects + public $table_element='projet'; //!< Name of table without prefix where object is stored var $id; var $ref; @@ -666,9 +663,11 @@ class Project extends CommonObject } /** - * Initialise object with default value to be used as example - * - * @return void + * Initialise an instance with random values. + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @return void */ function initAsSpecimen() { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 82b9631c852..462edcb1f25 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -32,11 +32,8 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/commonobject.class.php"); */ class Task extends CommonObject { - var $db; //!< To store db handler - var $error; //!< To return error code (or message) - var $errors=array(); //!< To return several error codes (or messages) - var $element='project_task'; //!< Id that identify managed objects - var $table_element='projet_task'; //!< Name of table without prefix where object is stored + public $element='project_task'; //!< Id that identify managed objects + public $table_element='projet_task'; //!< Name of table without prefix where object is stored var $id; @@ -437,10 +434,11 @@ class Task extends CommonObject } /** - * Initialise object with example values + * Initialise an instance with random values. + * Used to build previews or test instances. * id must be 0 if object instance is a specimen. * - * @return void + * @return void */ function initAsSpecimen() { diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 226a4553c07..68fd3c1d99f 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -33,8 +33,6 @@ abstract class ActionsCardCommon var $canvas; var $card; - //! Numero d'erreur Plage 1280-1535 - var $errno = 0; //! Template container var $tpl = array(); //! Object container diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 3f8d828b7b8..881c86fb449 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/societe/canvas/default/actions_card_company.class.php + * \file htdocs/societe/canvas/company/actions_card_company.class.php * \ingroup thirdparty - * \brief Fichier de la classe Thirdparty card controller (default canvas) + * \brief File of Thirdparty card controller (default canvas) */ include_once(DOL_DOCUMENT_ROOT.'/societe/canvas/actions_card_common.class.php'); @@ -29,7 +29,6 @@ include_once(DOL_DOCUMENT_ROOT.'/societe/canvas/actions_card_common.class.php'); */ class ActionsCardCompany extends ActionsCardCommon { - var $db; var $targetmodule; var $canvas; var $card; @@ -96,7 +95,7 @@ class ActionsCardCompany extends ActionsCardCommon $this->tpl['profid3'] = $this->object->ape; $this->tpl['profid4'] = $this->object->idprof4; - if ($conf->use_javascript_ajax && empty($conf->global->MAIN_DISABLEVATCHECK)) + if ($conf->use_javascript_ajax && empty($conf->global->MAIN_DISABLEVATCHECK)) { $js = "\n"; $js.= '