From ba6a48360e0e1889cfd4ef4c2350b1d1a6652762 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 30 Aug 2018 12:26:59 +0200 Subject: [PATCH 001/255] Standardize and update code --- .../class/accountancycategory.class.php | 67 ++++++++++++++----- 1 file changed, 52 insertions(+), 15 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 1f81767f80d..4bb7e5aaf66 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -30,19 +30,11 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; */ class AccountancyCategory // extends CommonObject { -<<<<<<< HEAD - /** - * @var DoliDB Database handler. - */ - public $db; - -======= /** * @var DoliDB Database handler. */ public $db; ->>>>>>> upstream/develop /** * @var string Error string * @see errors @@ -64,24 +56,69 @@ class AccountancyCategory // extends CommonObject */ public $table_element='c_accounting_category'; - public $id; - public $code; - /** - * @var string proper name for given parameter - */ - public $label; - + * @var int ID + */ + public $id; + + /** + * @var mixed Sample property 1 + */ + public $code; + + /** + * @var string proper name for given parameter + */ + public $label; + + /** + * @var mixed Sample property 1 + */ public $range_account; + + /** + * @var mixed Sample property 1 + */ public $sens; + + /** + * @var mixed Sample property 1 + */ public $category_type; + + /** + * @var mixed Sample property 1 + */ public $formula; + + /** + * @var mixed Sample property 1 + */ public $position; + + /** + * @var mixed Sample property 1 + */ public $fk_country; + + /** + * @var mixed Sample property 1 + */ public $active; + /** + * @var mixed Sample property 1 + */ public $lines_cptbk; + + /** + * @var mixed Sample property 1 + */ public $lines_display; + + /** + * @var mixed Sample property 1 + */ public $sdc; From e96e3bdf42e2b594ac560626b6d0494666ff9141 Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Thu, 30 Aug 2018 14:19:21 +0200 Subject: [PATCH 002/255] Update accountancycategory.class.php --- .../class/accountancycategory.class.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 4bb7e5aaf66..3673f6df204 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -30,10 +30,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; */ class AccountancyCategory // extends CommonObject { - /** - * @var DoliDB Database handler. - */ - public $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error string @@ -57,21 +57,21 @@ class AccountancyCategory // extends CommonObject public $table_element='c_accounting_category'; /** - * @var int ID - */ - public $id; + * @var int ID + */ + public $id; /** * @var mixed Sample property 1 */ public $code; - /** - * @var string proper name for given parameter - */ - public $label; + /** + * @var string proper name for given parameter + */ + public $label; - /** + /** * @var mixed Sample property 1 */ public $range_account; From 5ec22d9fadf19a4e79b5caceadc5527b62f7af8d Mon Sep 17 00:00:00 2001 From: Philippe Grand Date: Thu, 30 Aug 2018 14:25:25 +0200 Subject: [PATCH 003/255] Update accountingaccount.class.php --- .../class/accountingaccount.class.php | 37 +++++++------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 08ae8359c96..1447ff0e7b4 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -79,35 +79,24 @@ class AccountingAccount extends CommonObject var $account_number; var $account_parent; var $account_category; -<<<<<<< HEAD - - /** - * @var string proper name for given parameter + + /** + * @var string Label of account */ public $label; - - var $fk_user_author; - var $fk_user_modif; - var $active; // duplicate with status -======= - /** - * @var string Label of account - */ - public $label; + /** + * @var int ID + */ + public $fk_user_author; - /** - * @var int ID - */ - public $fk_user_author; + /** + * @var int ID + */ + public $fk_user_modif; - /** - * @var int ID - */ - public $fk_user_modif; - - var $active; // duplicate with status ->>>>>>> upstream/develop + var $active; // duplicate with status + var $status; From 7973489f8a6c363049ec52df606e003c254557e9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 31 Aug 2018 17:18:08 +0200 Subject: [PATCH 004/255] fix display comment issue --- .../class/accountancycategory.class.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 3673f6df204..8b53c87f5fa 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -30,10 +30,10 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; */ class AccountancyCategory // extends CommonObject { - /** - * @var DoliDB Database handler. - */ - public $db; + /** + * @var DoliDB Database handler. + */ + public $db; /** * @var string Error string @@ -57,21 +57,21 @@ class AccountancyCategory // extends CommonObject public $table_element='c_accounting_category'; /** - * @var int ID - */ - public $id; + * @var int ID + */ + public $id; /** * @var mixed Sample property 1 */ public $code; - /** - * @var string proper name for given parameter - */ - public $label; + /** + * @var string proper name for given parameter + */ + public $label; - /** + /** * @var mixed Sample property 1 */ public $range_account; From 9e880d3e72bc30109b03684eeff332ca879b9615 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 31 Aug 2018 17:55:31 +0200 Subject: [PATCH 005/255] Standardize and update code --- .../action/class/actioncommreminder.class.php | 11 ++++++++--- .../compta/salaries/class/paymentsalary.class.php | 15 ++++++++++----- htdocs/core/class/discount.class.php | 9 +++++++-- .../class/fournisseur.commande.dispatch.class.php | 5 +++++ htdocs/user/class/user.class.php | 10 +++++++--- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index ce32234be56..2a5c3bf709c 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -34,17 +34,17 @@ class ActionCommReminder extends CommonObject * @var string ID to identify managed object */ public $element = 'actioncomm_reminder'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'actioncomm_reminder'; - + /** * @var array Does actioncommreminder support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; - + /** * @var string String with name of icon for actioncommreminder. Must be the part after the 'object_' into object_actioncommreminder.png */ @@ -84,7 +84,12 @@ class ActionCommReminder extends CommonObject public $rowid; public $dateremind; public $typeremind; + + /** + * @var int User ID + */ public $fk_user; + public $offsetvalue; public $offsetunit; public $status; diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 0de5bc2a67a..97d787fa097 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -44,19 +44,24 @@ class PaymentSalary extends CommonObject public $picto='payment'; public $tms; + + /** + * @var int User ID + */ public $fk_user; + public $datep; public $datev; public $amount; public $fk_project; public $type_payment; public $num_payment; - + /** - * @var string proper name for given parameter - */ - public $label; - + * @var string proper name for given parameter + */ + public $label; + public $datesp; public $dateep; public $fk_bank; diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index b3cfb73654b..ca90a545645 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -32,7 +32,7 @@ class DiscountAbsolute * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -45,7 +45,12 @@ class DiscountAbsolute public $amount_tva; // public $amount_ttc; // public $tva_tx; // Vat rate - public $fk_user; // Id utilisateur qui accorde la remise + + /** + * @var int User ID Id utilisateur qui accorde la remise + */ + public $fk_user; + public $description; // Description libre public $datec; // Date creation public $fk_facture_line; // Id invoice line when a discount is used into an invoice line (for absolute discounts) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index f5933b453ed..f45f45b6f4b 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -67,7 +67,12 @@ class CommandeFournisseurDispatch extends CommonObject public $fk_commandefourndet; public $qty; public $fk_entrepot; + + /** + * @var int User ID + */ public $fk_user; + public $datec=''; public $comment; public $status; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 40c6a6b9f19..268f4a6c95b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -44,12 +44,12 @@ class User extends CommonObject * @var string ID to identify managed object */ public $element='user'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='user'; - + public $fk_element='fk_user'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -103,6 +103,10 @@ class User extends CommonObject public $contactid; public $fk_member; + + /** + * @var int User ID + */ public $fk_user; public $clicktodial_url; @@ -1541,7 +1545,7 @@ class User extends CommonObject $adh->zip=$this->zip; $adh->state_id=$this->state_id; $adh->country_id=$this->country_id; - + $adh->email=$this->email; $adh->skype=$this->skype; $adh->phone=$this->office_phone; From 2f307aae21ee8bf647dbc5939a5b6338989edd1d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 31 Aug 2018 18:06:17 +0200 Subject: [PATCH 006/255] Standardize and update code --- htdocs/bookmarks/class/bookmark.class.php | 12 ++++++++---- .../compta/deplacement/class/deplacement.class.php | 11 ++++++++--- htdocs/holiday/class/holiday.class.php | 10 +++++++--- .../product/class/productcustomerprice.class.php | 14 ++++++++++++-- 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index 9491b10c267..95e6b3c3088 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -32,12 +32,12 @@ class Bookmark extends CommonObject * @var string ID to identify managed object */ public $element='bookmark'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='bookmark'; - + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'bookmark'; @@ -50,8 +50,12 @@ class Bookmark extends CommonObject * @var int ID */ public $id; - - var $fk_user; + + /** + * @var int User ID + */ + public $fk_user; + var $datec; var $url; var $target; // 0=replace, 1=new window diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index d9172219abe..44820c64a1c 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -35,12 +35,12 @@ class Deplacement extends CommonObject * @var string ID to identify managed object */ public $element='deplacement'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='deplacement'; - + public $table_element_line = ''; public $fk_element = ''; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -48,7 +48,12 @@ class Deplacement extends CommonObject var $datec; // Creation date var $dated; var $fk_user_author; - var $fk_user; + + /** + * @var int User ID + */ + public $fk_user; + var $km; var $socid; var $statut; // 0=draft, 1=validated diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 833b46b2bca..89d60be7569 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -36,12 +36,12 @@ class Holiday extends CommonObject * @var string ID to identify managed object */ public $element='holiday'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='holiday'; - + public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $fk_element = 'fk_holiday'; public $picto = 'holiday'; @@ -52,7 +52,11 @@ class Holiday extends CommonObject */ var $rowid; - var $fk_user; + /** + * @var int User ID + */ + public $fk_user; + var $date_create=''; var $description; var $date_debut=''; // Date start in PHP server TZ diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 4155045ec29..533a36638ce 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -54,7 +54,12 @@ class Productcustomerprice extends CommonObject var $localtax1_tx; var $localtax2_type; var $localtax2_tx; - var $fk_user; + + /** + * @var int User ID + */ + public $fk_user; + var $lines = array (); /** @@ -978,7 +983,12 @@ class PriceByCustomerLine var $recuperableonly; var $localtax1_tx; var $localtax2_tx; - var $fk_user; + + /** + * @var int User ID + */ + public $fk_user; + var $import_key; var $socname; var $prodref; From 70ae8c6081ac20c622823330431b01353b3ed21b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 31 Aug 2018 18:27:16 +0200 Subject: [PATCH 007/255] Standardize and update code --- .../accountancy/class/bookkeeping.class.php | 9 ++++-- htdocs/adherents/class/adherent.class.php | 3 ++ htdocs/core/class/comment.class.php | 3 ++ .../core/class/emailsenderprofile.class.php | 11 +++++-- htdocs/core/class/link.class.php | 12 +++++--- htdocs/cron/class/cronjob.class.php | 6 +++- htdocs/ecm/class/ecmfiles.class.php | 18 ++++++++--- htdocs/hrm/class/establishment.class.php | 8 +++-- .../template/class/myobject.class.php | 21 ++++++++----- .../class/multicurrency.class.php | 30 +++++++++---------- .../inventory/class/inventory.class.php | 17 +++++++---- .../product/stock/class/productlot.class.php | 8 ++--- htdocs/societe/class/societe.class.php | 3 ++ htdocs/societe/class/societeaccount.class.php | 11 +++++-- htdocs/stripe/class/stripe.class.php | 5 ++++ htdocs/user/class/user.class.php | 4 +++ htdocs/user/class/usergroup.class.php | 9 ++++-- htdocs/website/class/website.class.php | 28 ++++++++--------- 18 files changed, 135 insertions(+), 71 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index a3a91cdc8e5..aae6374cb50 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -35,22 +35,25 @@ class BookKeeping extends CommonObject * @var string Error code (or message) */ public $error; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var string Id to identify managed objects */ public $element = 'accountingbookkeeping'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'accounting_bookkeeping'; + /** + * @var int Entity + */ public $entity; /** diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index bf4fe0d73c2..67aa88c6e03 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -114,6 +114,9 @@ class Adherent extends CommonObject var $oldcopy; // To contains a clone of this when we need to save old properties of object + /** + * @var int Entity + */ public $entity; /** diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 9cc4b8be192..40402eb9717 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -42,6 +42,9 @@ class Comment extends CommonObject public $fk_user_author; + /** + * @var int Entity + */ public $entity; public $import_key; diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index e0ff56d6736..33f5032c6e3 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -39,17 +39,17 @@ class EmailSenderProfile extends CommonObject * @var string ID to identify managed object */ public $element = 'emailsenderprofile'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'c_email_senderprofile'; - + /** * @var array Does emailsenderprofile support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for emailsenderprofile */ @@ -89,7 +89,12 @@ class EmailSenderProfile extends CommonObject 'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1), ); public $rowid; + + /** + * @var int Entity + */ public $entity; + public $label; public $email; public $date_creation; diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 951c6e75b02..e9f8c7d9a15 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -32,21 +32,25 @@ class Link extends CommonObject * @var string ID to identify managed object */ public $element = 'link'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'links'; - public $entity; + /** + * @var int Entity + */ + public $entity; + public $datea; public $url; - + /** * @var string proper name for given parameter */ public $label; - + public $objecttype; public $objectid; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 53acd0976b4..f2b23abad65 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -42,7 +42,11 @@ class Cronjob extends CommonObject public $picto = 'cron'; - public $entity; + /** + * @var int Entity + */ + public $entity; + public $jobtype; public $tms=''; public $datec=''; diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index d6eff8e697b..056bcd94337 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -40,18 +40,23 @@ class EcmFiles extends CommonObject * @var string Id to identify managed objects */ public $element = 'ecmfiles'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'ecm_files'; - + public $picto = 'generic'; public $ref; // hash of file path public $label; // hash of file content (md5_file(dol_osencode($destfull)) public $share; // hash for file sharing, empty by default (example: getRandomPassword(true)) + + /** + * @var int Entity + */ public $entity; + public $filename; public $filepath; public $fullpath_orig; @@ -68,7 +73,7 @@ class EcmFiles extends CommonObject public $acl; public $src_object_type; public $src_object_id; - + /** * Constructor @@ -339,7 +344,7 @@ class EcmFiles extends CommonObject else { $sql .= ' AND t.rowid = '.$this->db->escape($id); // rowid already unique } - + $this->db->plimit(1); // When we search on src or on hash of content (hashforfile) to solve hash conflict when several files has same content, we take first one only $this->db->order('t.rowid', 'ASC'); @@ -830,7 +835,12 @@ class EcmFiles extends CommonObject class EcmfilesLine { public $label; + + /** + * @var int Entity + */ public $entity; + public $filename; public $filepath; public $fullpath_orig; diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 195e48bb222..8fb13046ee4 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -32,12 +32,12 @@ class Establishment extends CommonObject * @var string ID to identify managed object */ public $element='establishment'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='establishment'; - + public $table_element_line = ''; public $fk_element = 'fk_establishment'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -52,6 +52,10 @@ class Establishment extends CommonObject public $zip; public $town; public $status; // 0=open, 1=closed + + /** + * @var int Entity + */ public $entity; public $country_id; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 15e7a7f84dd..3228305ac70 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -36,22 +36,22 @@ class MyObject extends CommonObject * @var string ID to identify managed object */ public $element = 'myobject'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'mymodule_myobject'; - + /** * @var int Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; - + /** * @var int Does myobject support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ @@ -103,7 +103,12 @@ class MyObject extends CommonObject public $rowid; public $ref; + + /** + * @var int Entity + */ public $entity; + public $label; public $amount; public $status; @@ -122,22 +127,22 @@ class MyObject extends CommonObject * @var int Name of subtable line */ //public $table_element_line = 'myobjectdet'; - + /** * @var int Field with ID of parent key if this field has a parent */ //public $fk_element = 'fk_myobject'; - + /** * @var int Name of subtable class that manage subtable lines */ //public $class_element_line = 'MyObjectline'; - + /** * @var array Array of child tables (child tables to delete before deleting a record) */ //protected $childtables=array('myobjectdet'); - + /** * @var MyObjectLine[] Array of subtable lines */ diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index c7822961570..3206c7c566f 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -42,12 +42,12 @@ class MultiCurrency extends CommonObject * @var string Id to identify managed objects */ public $element = 'multicurrency'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'multicurrency'; - + /** * @var string Name of table without prefix where object is stored */ @@ -62,32 +62,32 @@ class MultiCurrency extends CommonObject * @var mixed Sample property 1 */ public $id; - + /** * @var mixed Sample property 1 */ public $code; - + /** * @var mixed Sample property 2 */ public $name; - + /** - * @var mixed Sample property 2 + * @var int Entity */ public $entity; - + /** * @var mixed Sample property 2 */ public $date_create; - + /** * @var mixed Sample property 2 */ public $fk_user; - + /** * @var mixed Sample property 2 */ @@ -695,32 +695,32 @@ class CurrencyRate extends CommonObjectLine * @var string Id to identify managed objects */ public $element = 'multicurrency_rate'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'multicurrency_rate'; - + /** * @var int ID */ public $id; - + /** * @var double Rate */ public $rate; - + /** * @var date Date synchronisation */ public $date_sync; - + /** * @var int Id of currency */ public $fk_multicurrency; - + /** * @var int Id of entity */ diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 7ba2d5cf5f1..fe57698619e 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -38,7 +38,7 @@ class Inventory extends CommonObject * @var string ID to identify managed object */ public $element = 'inventory'; - + /** * @var string Name of table without prefix where object is stored */ @@ -48,7 +48,7 @@ class Inventory extends CommonObject * @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for inventory */ @@ -101,7 +101,12 @@ class Inventory extends CommonObject public $rowid; public $ref; + + /** + * @var int Entity + */ public $entity; + public $fk_warehouse; public $date_inventory; public $title; @@ -123,22 +128,22 @@ class Inventory extends CommonObject * @var int Name of subtable line */ //public $table_element_line = 'inventorydet'; - + /** * @var int Field with ID of parent key if this field has a parent */ //public $fk_element = 'fk_inventory'; - + /** * @var int Name of subtable class that manage subtable lines */ //public $class_element_line = 'Inventoryline'; - + /** * @var array Array of child tables (child tables to delete before deleting a record) */ //protected $childtables=array('inventorydet'); - + /** * @var InventoryLine[] Array of subtable lines */ diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 1ed59eb058f..c0718924f5f 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -39,7 +39,7 @@ class Productlot extends CommonObject * @var string Id to identify managed objects */ public $element = 'productlot'; - + /** * @var string Name of table without prefix where object is stored */ @@ -55,9 +55,10 @@ class Productlot extends CommonObject public $lines = array(); /** + * @var int Entity */ - public $entity; + public $fk_product; public $batch; public $eatby = ''; @@ -68,9 +69,6 @@ class Productlot extends CommonObject public $fk_user_modif; public $import_key; - /** - */ - /** * Constructor diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 845a19cba58..5d75ab688cf 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -90,6 +90,9 @@ class Societe extends CommonObject ); + /** + * @var int Entity + */ public $entity; /** diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index e4c38893e58..76ecf52bc30 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -39,17 +39,17 @@ class SocieteAccount extends CommonObject * @var string ID to identify managed object */ public $element = 'societeaccount'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'societe_account'; - + /** * @var array Does societeaccount support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; - + /** * @var string String with name of icon for societeaccount. Must be the part after the 'object_' into object_myobject.png */ @@ -100,7 +100,12 @@ class SocieteAccount extends CommonObject 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'default'=>1, 'arrayofkeyval'=>array('1'=>'Active','0'=>'Disabled')), ); public $rowid; + + /** + * @var int Entity + */ public $entity; + public $key_account; public $login; public $pass_encoding; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index b8472d0b821..969a0e1ab9c 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -33,7 +33,12 @@ class Stripe extends CommonObject public $fk_key; public $id; public $mode; + + /** + * @var int Entity + */ public $entity; + public $statut; public $type; public $code; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 268f4a6c95b..a9f1419378f 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -76,6 +76,10 @@ class User extends CommonObject public $admin; public $login; public $api_key; + + /** + * @var int Entity + */ public $entity; //! Clear password in memory diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 8f89b4a2e35..6b08b7b732e 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -39,16 +39,19 @@ class UserGroup extends CommonObject * @var string ID to identify managed object */ public $element='usergroup'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='usergroup'; - + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='group'; - public $entity; // Entity of group + /** + * @var int Entity of group + */ + public $entity; public $name; // Name of group /** diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index be6770743bc..442ad133b97 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -39,57 +39,57 @@ class Website extends CommonObject * @var string Id to identify managed objects */ public $element = 'website'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'website'; - + /** * @var array Does website support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'globe'; /** - * @var int + * @var int Entity */ public $entity; - + /** - * @var string + * @var string Ref */ public $ref; - + /** - * @var string + * @var string description */ public $description; - + /** - * @var int + * @var int Status */ public $status; - + /** * @var mixed */ public $date_creation; - + /** * @var mixed */ public $tms = ''; - + /** * @var integer */ public $fk_default_home; - + /** * @var string */ From edaa575435228f1226c7db9b274af3d344c4d5f6 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 31 Aug 2018 18:36:15 +0200 Subject: [PATCH 008/255] Standardize and update code --- htdocs/compta/bank/class/account.class.php | 24 +++++++++++-------- .../bank/class/paymentvarious.class.php | 16 ++++++++----- htdocs/contrat/class/contrat.class.php | 18 ++++++++------ htdocs/core/class/notify.class.php | 11 ++++++--- 4 files changed, 43 insertions(+), 26 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 46c3e168a1b..f8ab6517f92 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -40,12 +40,12 @@ class Account extends CommonObject * @var string ID to identify managed object */ public $element = 'bank_account'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'bank_account'; - + public $picto = 'account'; /** @@ -1645,30 +1645,34 @@ class AccountLine extends CommonObject * @var string Error code (or message) */ public $error=''; - + /** * @var DoliDB Database handler. */ public $db; - + /** * @var string ID to identify managed object */ public $element='bank'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='bank'; - + var $picto = 'generic'; /** * @var int ID */ public $id; - - var $ref; + + /** + * @var string Ref + */ + public $ref; + var $datec; var $dateo; @@ -1677,12 +1681,12 @@ class AccountLine extends CommonObject */ var $datev; var $amount; - + /** * @var string proper name for given parameter */ public $label; - + var $note; var $fk_user_author; var $fk_user_rappro; diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 90ec1558981..6b1d35cc910 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -34,20 +34,24 @@ class PaymentVarious extends CommonObject * @var string ID to identify managed object */ public $element='variouspayment'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='payment_various'; - + public $picto = 'bill'; /** * @var int ID */ public $id; - - var $ref; + + /** + * @var string Ref + */ + public $ref; + var $tms; var $datep; var $datev; @@ -55,12 +59,12 @@ class PaymentVarious extends CommonObject var $amount; var $type_payment; var $num_payment; - + /** * @var string proper name for given parameter */ public $label; - + var $accountancy_code; var $fk_project; var $fk_bank; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 537d18245fd..26a32fe8468 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -45,22 +45,22 @@ class Contrat extends CommonObject * @var string ID to identify managed object */ public $element='contrat'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='contrat'; - + public $table_element_line='contratdet'; public $fk_element='fk_contrat'; public $picto='contract'; - + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; - + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -2465,7 +2465,7 @@ class ContratLigne extends CommonObjectLine * @var string ID to identify managed object */ public $element='contratdet'; - + /** * @var string Name of table without prefix where object is stored */ @@ -2475,8 +2475,12 @@ class ContratLigne extends CommonObjectLine * @var int ID */ public $id; - - var $ref; + + /** + * @var string Ref + */ + public $ref; + var $tms; var $fk_contrat; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index f5c0020bac1..bcab80dc19f 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -34,12 +34,12 @@ class Notify * @var int ID */ public $id; - + /** * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -51,7 +51,12 @@ class Notify public $errors = array(); var $author; - var $ref; + + /** + * @var string Ref + */ + public $ref; + var $date; var $duree; var $note; From bb05e80a877a889cd7286e275b515f40c73f4b2c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 31 Aug 2018 18:47:25 +0200 Subject: [PATCH 009/255] Standardize and update code --- htdocs/asset/class/asset.class.php | 27 +++++++++++-------- .../cheque/class/remisecheque.class.php | 8 ++++-- htdocs/cron/class/cronjob.class.php | 4 +++ htdocs/ecm/class/ecmdirectory.class.php | 12 ++++++--- htdocs/ecm/class/ecmfiles.class.php | 6 ++++- .../fourn/class/fournisseur.facture.class.php | 7 ++++- htdocs/hrm/class/establishment.class.php | 7 ++++- .../template/class/myobject.class.php | 4 +++ .../inventory/class/inventory.class.php | 4 +++ htdocs/societe/class/societe.class.php | 4 +++ 10 files changed, 63 insertions(+), 20 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 93ee5014dc2..6a9e6c7c485 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -35,22 +35,22 @@ class Asset extends CommonObject * @var string ID to identify managed object */ public $element = 'asset'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'asset'; - + /** * @var int Does module support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; - + /** * @var int Does asset support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; - + /** * @var string String with name of icon for asset. Must be the part after the 'object_' into object_asset.png */ @@ -96,14 +96,19 @@ class Asset extends CommonObject 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Active', '-1'=>'Cancel')), ); public $rowid; - public $ref; - public $entity; - + /** - * @var string proper name for given parameter - */ - public $label; - + * @var string Ref + */ + public $ref; + + public $entity; + + /** + * @var string proper name for given parameter + */ + public $label; + public $amount; public $fk_soc; public $description; diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index ceb376f7a37..dbf2d688aca 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -37,12 +37,12 @@ class RemiseCheque extends CommonObject * @var string ID to identify managed object */ public $element='chequereceipt'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='bordereau_cheque'; - + public $picto = 'payment'; var $num; @@ -56,6 +56,10 @@ class RemiseCheque extends CommonObject public $account_label; public $author_id; public $nbcheque; + + /** + * @var string Ref + */ public $ref; /** diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index f2b23abad65..28853b6a740 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1334,6 +1334,10 @@ class Cronjobline { public $id; + + /** + * @var string Ref + */ public $ref; public $tms=''; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 3e3559847b8..539baf9460a 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -31,12 +31,12 @@ class EcmDirectory // extends CommonObject * @var string ID to identify managed object */ public $element='ecm_directories'; - + /** * @var string Name of table without prefix where object is stored */ //public $table_element='ecm_directories'; - + var $picto = 'dir'; /** @@ -48,7 +48,7 @@ class EcmDirectory // extends CommonObject * @var string proper name for given parameter */ public $label; - + var $fk_parent; var $description; var $cachenbofdoc=-1; // By default cache initialized with value 'not calculated' @@ -56,6 +56,10 @@ class EcmDirectory // extends CommonObject var $date_m; public $fk_user_m; public $fk_user_c; + + /** + * @var string Ref + */ public $ref; var $cats=array(); @@ -70,7 +74,7 @@ class EcmDirectory // extends CommonObject * @var string Error code (or message) */ public $error; - + /** * @var string[] Error codes (or messages) */ diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 056bcd94337..25dc979a5db 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -48,7 +48,11 @@ class EcmFiles extends CommonObject public $picto = 'generic'; - public $ref; // hash of file path + /** + * @var string Ref hash of file path + */ + public $ref; + public $label; // hash of file content (md5_file(dol_osencode($destfull)) public $share; // hash for file sharing, empty by default (example: getRandomPassword(true)) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 3d889e51c51..1eece0f0316 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -73,7 +73,12 @@ class FactureFournisseur extends CommonInvoice protected $table_ref_field = 'ref'; public $rowid; - public $ref; + + /** + * @var string Ref + */ + public $ref; + public $product_ref; public $ref_supplier; public $socid; diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 8fb13046ee4..90b06d9fd0f 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -44,7 +44,12 @@ class Establishment extends CommonObject public $picto='building'; public $id; - public $ref; + + /** + * @var string Ref + */ + public $ref; + public $rowid; public $name; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 3228305ac70..58d2e1c0fe0 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -102,6 +102,10 @@ class MyObject extends CommonObject ); public $rowid; + + /** + * @var string Ref + */ public $ref; /** diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index fe57698619e..fc8bc8bb9e6 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -100,6 +100,10 @@ class Inventory extends CommonObject ); public $rowid; + + /** + * @var string Ref + */ public $ref; /** diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5d75ab688cf..2d4c3c3df07 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -377,7 +377,11 @@ class Societe extends CommonObject */ public $default_lang; + /** + * @var string Ref + */ public $ref; + public $ref_int; /** * External user reference. From 3a8bde227b199167f1c16f3670a675eb7b1560eb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 31 Aug 2018 19:26:08 +0200 Subject: [PATCH 010/255] Standardize and update code --- htdocs/asset/class/asset.class.php | 5 +++++ htdocs/categories/class/categorie.class.php | 16 ++++++++++------ htdocs/contrat/class/contrat.class.php | 5 ++++- htdocs/core/class/comment.class.php | 3 +++ htdocs/core/class/discount.class.php | 6 +++++- htdocs/core/class/events.class.php | 6 +++++- htdocs/core/modules/action/rapport.pdf.php | 10 +++++++--- htdocs/ecm/class/ecmdirectory.class.php | 7 ++++++- htdocs/ecm/class/ecmfiles.class.php | 10 ++++++++++ htdocs/fichinter/class/fichinter.class.php | 17 +++++++++++------ htdocs/holiday/class/holiday.class.php | 7 ++++++- htdocs/livraison/class/livraison.class.php | 18 +++++++++++------- .../class/opensurveysondage.class.php | 4 ++++ .../class/price_global_variable.class.php | 17 +++++++++++------ .../price_global_variable_updater.class.php | 19 ++++++++++++------- htdocs/product/stock/class/entrepot.class.php | 11 ++++++++--- htdocs/projet/class/project.class.php | 6 +++++- htdocs/projet/class/task.class.php | 6 +++++- htdocs/ticket/class/actions_ticket.class.php | 14 +++++++++----- htdocs/website/class/websitepage.class.php | 9 +++++++-- 20 files changed, 144 insertions(+), 52 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 6a9e6c7c485..70b45e88d73 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -111,7 +111,12 @@ class Asset extends CommonObject public $amount; public $fk_soc; + + /** + * @var string description + */ public $description; + public $note_public; public $note_private; public $date_creation; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 8903e43c2ba..c028aee050d 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -152,20 +152,24 @@ class Categorie extends CommonObject * @var string ID to identify managed object */ public $element='category'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='categorie'; public $fk_parent; - + /** - * @var string proper name for given parameter - */ - public $label; - + * @var string proper name for given parameter + */ + public $label; + + /** + * @var string description + */ public $description; + /** * @var string Color */ diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 26a32fe8468..481c005a7b4 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2498,7 +2498,10 @@ class ContratLigne extends CommonObjectLine */ public $libelle; - var $description; + /** + * @var string description + */ + public $description; var $product_ref; var $product_label; diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 40402eb9717..33e727dcfd0 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -34,6 +34,9 @@ class Comment extends CommonObject public $fk_element; public $element_type; + /** + * @var string description + */ public $description; public $tms; diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index ca90a545645..f310f6e4d04 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -51,7 +51,11 @@ class DiscountAbsolute */ public $fk_user; - public $description; // Description libre + /** + * @var string description + */ + public $description; + public $datec; // Date creation public $fk_facture_line; // Id invoice line when a discount is used into an invoice line (for absolute discounts) public $fk_facture; // Id invoice when a discount line is used into an invoice (for credit note) diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 6a2374a7d3b..30a03b71b4d 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -63,7 +63,11 @@ class Events // extends CommonObject var $type; var $entity; var $dateevent; - var $description; + + /** + * @var string description + */ + public $description; // List of all Audit/Security events supported by triggers var $eventstolog=array( diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index fe7be7f3052..51825939ae8 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -39,8 +39,12 @@ class CommActionRapport * @var DoliDB Database handler. */ public $db; - - var $description; + + /** + * @var string description + */ + public $description; + var $date_edition; var $year; var $month; @@ -103,7 +107,7 @@ class CommActionRapport if (! is_object($outputlangs)) $outputlangs=$langs; // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1'; - + // Load traductions files requiredby by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products")); diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 539baf9460a..7da35d19ee1 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -50,7 +50,12 @@ class EcmDirectory // extends CommonObject public $label; var $fk_parent; - var $description; + + /** + * @var string description + */ + public $description; + var $cachenbofdoc=-1; // By default cache initialized with value 'not calculated' var $date_c; var $date_m; diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 25dc979a5db..07494f84d3d 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -64,7 +64,12 @@ class EcmFiles extends CommonObject public $filename; public $filepath; public $fullpath_orig; + + /** + * @var string description + */ public $description; + public $keywords; public $cover; public $position; @@ -848,7 +853,12 @@ class EcmfilesLine public $filename; public $filepath; public $fullpath_orig; + + /** + * @var string description + */ public $description; + public $keywords; public $cover; public $position; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 7c772d460a5..c3cf277f409 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -39,12 +39,12 @@ class Fichinter extends CommonObject * @var string ID to identify managed object */ public $element='fichinter'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='fichinter'; - + public $fk_element='fk_fichinter'; public $table_element_line='fichinterdet'; public $picto = 'intervention'; @@ -65,7 +65,12 @@ class Fichinter extends CommonObject var $datem; var $duration; var $statut = 0; // 0=draft, 1=validated, 2=invoiced, 3=Terminate - var $description; + + /** + * @var string description + */ + public $description; + var $fk_contrat = 0; var $fk_project = 0; var $extraparams=array(); @@ -1321,7 +1326,7 @@ class FichinterLigne extends CommonObjectLine * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -1338,12 +1343,12 @@ class FichinterLigne extends CommonObjectLine * @var string ID to identify managed object */ public $element='fichinterdet'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='fichinterdet'; - + public $fk_element='fk_fichinter'; /** diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 89d60be7569..c6ab0281120 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -58,7 +58,12 @@ class Holiday extends CommonObject public $fk_user; var $date_create=''; - var $description; + + /** + * @var string description + */ + public $description; + var $date_debut=''; // Date start in PHP server TZ var $date_fin=''; // Date end in PHP server TZ var $date_debut_gmt=''; // Date start in GMT diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 763b28fb445..8c73339c612 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -43,14 +43,14 @@ class Livraison extends CommonObject * @var string ID to identify managed object */ public $element="delivery"; - + public $fk_element="fk_livraison"; - + /** * @var string Name of table without prefix where object is stored */ public $table_element="livraison"; - + public $table_element_line="livraisondet"; var $brouillon; @@ -1078,13 +1078,17 @@ class LivraisonLigne extends CommonObjectLine var $price; var $fk_product; var $origin_id; - + /** * @var string proper name for given parameter */ public $label; - - var $description; // Description produit + + /** + * @var string description produit + */ + public $description; + /** * @deprecated * @see product_ref @@ -1103,7 +1107,7 @@ class LivraisonLigne extends CommonObjectLine * @var string ID to identify managed object */ public $element='livraisondet'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 5d3129f1585..cbfd73ac9bf 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -52,6 +52,10 @@ class Opensurveysondage extends CommonObject * @see description */ public $commentaires; + + /** + * @var string description + */ public $description; public $mail_admin; diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index f30260a30c0..2997e88c589 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -33,26 +33,31 @@ class PriceGlobalVariable * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var int ID */ public $id; - + var $code; - var $description; + + /** + * @var string description + */ + public $description; + var $value; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 7ca18f36b5d..2155470484e 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -33,33 +33,38 @@ class PriceGlobalVariableUpdater * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + var $types=array(0, 1); //!< Updater types var $update_min = 5; //!< Minimal update rate - + /** * @var int ID */ public $id; - + var $type; - var $description; + + /** + * @var string description + */ + public $description; + var $parameters; var $fk_variable; var $update_interval; //!< Interval in mins var $next_update; //!< Next update timestamp var $last_status; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index f8e60f135b9..6015608f5e3 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -37,12 +37,12 @@ class Entrepot extends CommonObject * @var string ID to identify managed object */ public $element='stock'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='entrepot'; - + public $picto='stock'; /** @@ -61,7 +61,12 @@ class Entrepot extends CommonObject const STATUS_OPEN_INTERNAL = 2; var $libelle; - var $description; + + /** + * @var string description + */ + public $description; + var $statut; var $lieu; var $address; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 91cc8dbbcad..24cfef47ea8 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -53,7 +53,11 @@ class Project extends CommonObject */ protected $table_ref_field = 'ref'; - var $description; + /** + * @var string description + */ + public $description; + /** * @var string * @deprecated diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 2d16e2f53fb..6cd128380e5 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -52,7 +52,11 @@ class Task extends CommonObject */ public $label; - var $description; + /** + * @var string description + */ + public $description; + var $duration_effective; // total of time spent on this task var $planned_workload; var $date_c; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index 49007d325c4..e8e637dd87a 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -39,21 +39,21 @@ class ActionsTicket * @var DoliDB Database handler. */ public $db; - + public $dao; public $mesg; - + /** * @var string Error code (or message) */ public $error; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + //! Numero de l'erreur public $errno = 0; @@ -61,7 +61,11 @@ class ActionsTicket public $template; public $label; - public $description; + + /** + * @var string description + */ + public $description; public $fk_statut; public $fk_soc; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 9874b1fa8b0..f7dec16c6c0 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -39,12 +39,12 @@ class WebsitePage extends CommonObject * @var string Id to identify managed objects */ public $element = 'websitepage'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'website_page'; - + /** * @var string String with name of icon for websitepage. Must be the part after the 'object_' into object_myobject.png */ @@ -55,7 +55,12 @@ class WebsitePage extends CommonObject public $aliasalt; public $type_container; public $title; + + /** + * @var string description + */ public $description; + public $keywords; public $htmlheader; public $content; From 0dc812cf10d28811a194fcab7b2ad70c29b52166 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 13:02:27 +0200 Subject: [PATCH 011/255] precise label comment --- htdocs/accountancy/class/accountancycategory.class.php | 2 +- htdocs/accountancy/class/accountancysystem.class.php | 10 +++++----- htdocs/accountancy/class/accountingjournal.class.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 31a5593dd39..fec51f84cee 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -67,7 +67,7 @@ class AccountancyCategory // extends CommonObject public $code; /** - * @var string proper name for given parameter + * @var string Accountancy Category label */ public $label; diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index 8b30070317a..d126bd84acc 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -32,22 +32,22 @@ class AccountancySystem * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - + var $rowid; var $fk_pcg_version; var $pcg_type; var $pcg_subtype; - + /** - * @var string proper name for given parameter + * @var string Accountancy System label */ public $label; - + var $account_number; var $account_parent; diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index f10e0d1ce01..32a0ea0f448 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -45,7 +45,7 @@ class AccountingJournal extends CommonObject public $code; /** - * @var string proper name for given parameter + * @var string Accounting Journal label */ public $label; From 7354e485b0b3e128fabc816debb2b955a263b714 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 13:22:08 +0200 Subject: [PATCH 012/255] precise label comment --- htdocs/asset/class/asset.class.php | 2 +- htdocs/categories/class/categorie.class.php | 2 +- htdocs/comm/action/class/actioncomm.class.php | 10 +++++----- htdocs/comm/action/class/cactioncomm.class.php | 8 ++++---- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/bank/class/bankcateg.class.php | 2 +- htdocs/compta/bank/class/paymentvarious.class.php | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 70b45e88d73..72ec7e9707e 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -105,7 +105,7 @@ class Asset extends CommonObject public $entity; /** - * @var string proper name for given parameter + * @var string Asset label */ public $label; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index c028aee050d..b752af7157b 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -161,7 +161,7 @@ class Categorie extends CommonObject public $fk_parent; /** - * @var string proper name for given parameter + * @var string Category label */ public $label; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 0bc0a8236f6..45a1ff2380f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -38,21 +38,21 @@ class ActionComm extends CommonObject * @var string ID to identify managed object */ public $element='action'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'actioncomm'; - + public $table_rowid = 'id'; public $picto='action'; - + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; - + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty * @var integer @@ -78,7 +78,7 @@ class ActionComm extends CommonObject var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...) /** - * @var string proper name for given parameter + * @var string Agenda event label */ public $label; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 43844522a5a..68f2f723976 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -32,7 +32,7 @@ class CActionComm * @var string Error code (or message) */ public $error=''; - + /** * @var DoliDB Database handler. */ @@ -46,12 +46,12 @@ class CActionComm var $code; var $type; var $libelle; // deprecated - + /** - * @var string proper name for given parameter + * @var string Type of agenda event label */ public $label; - + var $active; var $color; var $picto; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c392684d967..8426a714e58 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3814,7 +3814,7 @@ class OrderLine extends CommonOrderLine var $fk_facture; /** - * @var string proper name for given parameter + * @var string Order lines label */ public $label; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index e2344693f3f..a28555d9c1d 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1679,7 +1679,7 @@ class AccountLine extends CommonObject var $amount; /** - * @var string proper name for given parameter + * @var string bank transaction lines label */ public $label; diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index 9aefcd5d863..3c07d9b49b9 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -35,7 +35,7 @@ class BankCateg // extends CommonObject public $id; /** - * @var string proper name for given parameter + * @var string bank categories label */ public $label; diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 595b503004c..e21e052e478 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -61,7 +61,7 @@ class PaymentVarious extends CommonObject var $num_payment; /** - * @var string proper name for given parameter + * @var string various payments label */ public $label; From 7b47c79bc38d47379be29039c772153c42e1d9e7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 14:06:58 +0200 Subject: [PATCH 013/255] precise label comment --- htdocs/compta/localtax/class/localtax.class.php | 2 +- htdocs/compta/salaries/class/paymentsalary.class.php | 2 +- htdocs/compta/tva/class/tva.class.php | 10 +++++----- htdocs/core/class/ccountry.class.php | 12 ++++++------ htdocs/core/class/ctyperesource.class.php | 4 ++-- htdocs/core/class/fiscalyear.class.php | 2 +- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/class/link.class.php | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 2d98182b668..764ba119dc7 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -48,7 +48,7 @@ class Localtax extends CommonObject var $amount; /** - * @var string proper name for given parameter + * @var string local tax */ public $label; diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 9119a7bf02a..a7a8736b96a 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -58,7 +58,7 @@ class PaymentSalary extends CommonObject public $num_payment; /** - * @var string proper name for given parameter + * @var string salary payments label */ public $label; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 538c33152ea..24c660f789c 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -37,12 +37,12 @@ class Tva extends CommonObject * @var string ID to identify managed object */ public $element='tva'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='tva'; - + public $picto='payment'; var $tms; @@ -51,12 +51,12 @@ class Tva extends CommonObject var $amount; var $type_payment; var $num_payment; - + /** - * @var string proper name for given parameter + * @var string label */ public $label; - + var $fk_bank; var $fk_user_creat; var $fk_user_modif; diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index 30f426ec30d..f25e0a14ce5 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -36,7 +36,7 @@ class Ccountry // extends CommonObject * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -46,7 +46,7 @@ class Ccountry // extends CommonObject * @var string[] Error codes (or messages) */ public $errors = array(); - + //var $element='ccountry'; //!< Id that identify managed objects //var $table_element='ccountry'; //!< Name of table without prefix where object is stored @@ -54,15 +54,15 @@ class Ccountry // extends CommonObject * @var int ID */ public $id; - + var $code; var $code_iso; - + /** - * @var string proper name for given parameter + * @var string Countries label */ public $label; - + var $active; diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php index d459ff6fb41..ae4036214a2 100644 --- a/htdocs/core/class/ctyperesource.class.php +++ b/htdocs/core/class/ctyperesource.class.php @@ -50,7 +50,7 @@ class Ctyperesource public $code; /** - * @var string proper name for given parameter + * @var string Type resource label */ public $label; @@ -486,7 +486,7 @@ class CtyperesourceLine public $code; /** - * @var string proper name for given parameter + * @var string Type resource line label */ public $label; diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index b822402bd2e..72a5ad644e4 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -45,7 +45,7 @@ class Fiscalyear extends CommonObject var $rowid; /** - * @var string proper name for given parameter + * @var string fiscal year label */ public $label; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index bbe809dcf3a..ac7968cbd52 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1399,7 +1399,7 @@ class ModelMail public $id; /** - * @var string proper name for given parameter + * @var string Model mail label */ public $label; diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 47911a48829..b1196d6746b 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -47,7 +47,7 @@ class Link extends CommonObject public $url; /** - * @var string proper name for given parameter + * @var string Links label */ public $label; From bd473059ae0d8b9d8a3bd831e32d9d2bdf9e4d46 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 14:13:05 +0200 Subject: [PATCH 014/255] precise label comment --- htdocs/core/modules/export/export_csv.modules.php | 14 +++++++------- .../core/modules/export/export_excel.modules.php | 12 ++++++------ .../modules/export/export_excel2007.modules.php | 10 +++++----- htdocs/core/modules/export/export_tsv.modules.php | 10 +++++----- htdocs/core/modules/import/import_csv.modules.php | 10 +++++----- htdocs/core/modules/import/import_xlsx.modules.php | 10 +++++----- htdocs/core/modules/import/modules_import.php | 2 +- htdocs/ecm/class/ecmdirectory.class.php | 2 +- htdocs/livraison/class/livraison.class.php | 4 ++-- 9 files changed, 37 insertions(+), 37 deletions(-) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 3f16b398f75..edcdacef6e0 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -34,12 +34,12 @@ class ExportCsv extends ModeleExports * @var int ID */ public $id; - + /** - * @var string proper name for given parameter + * @var string export files label */ public $label; - + var $extension; var $version; @@ -265,7 +265,7 @@ class ExportCsv extends ModeleExports $array = $array['options']; $newvalue = $array[$newvalue]; } - + fwrite($this->handle,$newvalue.$this->separator); $this->col++; } @@ -310,14 +310,14 @@ class ExportCsv extends ModeleExports { global $conf; $addquote=0; - + // Rule Dolibarr: No HTML //print $charset.' '.$newvalue."\n"; //$newvalue=dol_string_nohtmltag($newvalue,0,$charset); $newvalue=dol_htmlcleanlastbr($newvalue); //print $charset.' '.$newvalue."\n"; - + // Rule 1 CSV: No CR, LF in cells (except if USE_STRICT_CSV_RULES is on, we can keep record as it is but we must add quotes) $oldvalue=$newvalue; $newvalue=str_replace("\r",'',$newvalue); @@ -328,7 +328,7 @@ class ExportCsv extends ModeleExports $newvalue=$oldvalue; $addquote=1; } - + // Rule 2 CSV: If value contains ", we must escape with ", and add " if (preg_match('/"/',$newvalue)) { diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 216f45b0148..c4fe3c5bbbf 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -36,12 +36,12 @@ class ExportExcel extends ModeleExports * @var int ID */ public $id; - + /** - * @var string proper name for given parameter + * @var string Export Excel label */ public $label; - + var $extension; var $version; @@ -73,7 +73,7 @@ class ExportExcel extends ModeleExports $this->version='1.30'; // Driver version $this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages) - + if (empty($this->disabled)) { // If driver use an external library, put its name here @@ -337,14 +337,14 @@ class ExportExcel extends ModeleExports $newvalue=$this->excel_clean($newvalue); $typefield=isset($array_types[$code])?$array_types[$code]:''; - + if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) { $array = unserialize($typefield); $array = $array['options']; $newvalue = $array[$newvalue]; } - + // Traduction newvalue if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) { diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 578f2323857..9a7dc5df1b1 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -37,12 +37,12 @@ class ExportExcel2007 extends ExportExcel * @var int ID */ public $id; - + /** - * @var string proper name for given parameter + * @var string label */ public $label; - + var $extension; var $version; @@ -73,7 +73,7 @@ class ExportExcel2007 extends ExportExcel $this->version='1.30'; // Driver version $this->disabled = (in_array(constant('PHPEXCEL_PATH'),array('disabled','disabled/'))?1:0); // A condition to disable module (used for native debian packages) - + if (empty($this->disabled)) { // If driver use an external library, put its name here @@ -93,7 +93,7 @@ class ExportExcel2007 extends ExportExcel $this->version_lib='1.8.0'; // No way to get info from library } } - + $this->row=0; } diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index ff5aa403015..a9d46817cd7 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -35,12 +35,12 @@ class ExportTsv extends ModeleExports * @var int ID */ public $id; - + /** - * @var string proper name for given parameter + * @var string label */ public $label; - + var $extension; var $version; @@ -234,14 +234,14 @@ class ExportTsv extends ModeleExports if (preg_match('/^\((.*)\)$/i',$newvalue,$reg)) $newvalue=$outputlangs->transnoentities($reg[1]); $newvalue=$this->tsv_clean($newvalue,$outputlangs->charset_output); - + if (preg_match('/^Select:/i', $typefield, $reg) && $typefield = substr($typefield, 7)) { $array = unserialize($typefield); $array = $array['options']; $newvalue = $array[$newvalue]; } - + fwrite($this->handle,$newvalue.$this->separator); $this->col++; } diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index dd9e6622cd8..07d1875c5e3 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -37,14 +37,14 @@ class ImportCsv extends ModeleImports * @var DoliDB Database handler. */ public $db; - + var $datatoimport; /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) */ @@ -54,12 +54,12 @@ class ImportCsv extends ModeleImports * @var int ID */ public $id; - + /** - * @var string proper name for given parameter + * @var string label */ public $label; - + var $extension; // Extension of files imported by driver var $version; // Version of driver diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index c95fec3965c..ae8d55c3f4e 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -37,14 +37,14 @@ class ImportXlsx extends ModeleImports * @var DoliDB Database handler. */ public $db; - + var $datatoimport; /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) */ @@ -54,12 +54,12 @@ class ImportXlsx extends ModeleImports * @var int ID */ public $id; - + /** - * @var string proper name for given parameter + * @var string label */ public $label; - + var $extension; // Extension of files imported by driver var $version; // Version of driver diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index 7f38007d2d0..98c667afac9 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -45,7 +45,7 @@ class ModeleImports public $id; /** - * @var string proper name for given parameter + * @var string label */ public $label; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index b9d99614a60..509d6cd19eb 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -45,7 +45,7 @@ class EcmDirectory // extends CommonObject public $id; /** - * @var string proper name for given parameter + * @var string ECM directories label */ public $label; diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index f97d1dd7be1..aa091665905 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -1061,7 +1061,7 @@ class Livraison extends CommonObject /** - * Classe de gestion des lignes de bons de livraison + * Management class of delivery note lines */ class LivraisonLigne extends CommonObjectLine { @@ -1079,7 +1079,7 @@ class LivraisonLigne extends CommonObjectLine var $origin_id; /** - * @var string proper name for given parameter + * @var string delivery note lines label */ public $label; From b27358790927ab413b28a97ecd7cd299db7c5300 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 14:28:30 +0200 Subject: [PATCH 015/255] translations --- htdocs/livraison/class/livraison.class.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index aa091665905..eaa999882cf 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -24,7 +24,7 @@ /** * \file htdocs/livraison/class/livraison.class.php * \ingroup delivery - * \brief Fichier de la classe de gestion des bons de livraison + * \brief Delivery Order Management Class File */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; @@ -158,7 +158,7 @@ class Livraison extends CommonObject /* - * Insertion des produits dans la base + * Inserting products into the database */ $num=count($this->lines); for ($i = 0; $i < $num; $i++) @@ -310,7 +310,7 @@ class Livraison extends CommonObject if ($this->statut == 0) $this->brouillon = 1; - // Retreive all extrafield + // Retreive all extrafields // fetch optionals attributes and labels $this->fetch_optionals(); @@ -361,7 +361,7 @@ class Livraison extends CommonObject { if (! empty($conf->global->LIVRAISON_ADDON_NUMBER)) { - // Definition du nom de module de numerotation de commande + // Setting the command numbering module name $modName = $conf->global->LIVRAISON_ADDON_NUMBER; if (is_readable(DOL_DOCUMENT_ROOT .'/core/modules/livraison/'.$modName.'.php')) @@ -370,7 +370,7 @@ class Livraison extends CommonObject $now=dol_now(); - // Recuperation de la nouvelle reference + // Retrieving the new reference $objMod = new $modName($this->db); $soc = new Societe($this->db); $soc->fetch($this->socid); @@ -385,8 +385,7 @@ class Livraison extends CommonObject } $this->newref = $numref; - // Tester si non deja au statut valide. Si oui, on arrete afin d'eviter - // de decrementer 2 fois le stock. + // Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice. $sql = "SELECT ref"; $sql.= " FROM ".MAIN_DB_PREFIX."livraison"; $sql.= " WHERE ref = '".$this->db->escape($numref)."'"; @@ -493,10 +492,10 @@ class Livraison extends CommonObject } /** - * Cree le bon de livraison depuis une expedition existante + * Creating the delivery slip from an existing shipment * - * @param User $user Utilisateur qui cree - * @param int $sending_id Id de l'expedition qui sert de modele + * @param User $user User who creates + * @param int $sending_id Id of the expedition that serves as a model * @return integer */ function create_from_sending($user, $sending_id) @@ -1084,7 +1083,7 @@ class LivraisonLigne extends CommonObjectLine public $label; /** - * @var string description produit + * @var string product description */ public $description; From f77dd2ebc787056dd1886272e7bc25258d79f4c2 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 15:13:59 +0200 Subject: [PATCH 016/255] Standardize and update code --- .../class/accountingjournal.class.php | 4 ++ htdocs/comm/propal/class/propal.class.php | 7 +++- htdocs/commande/class/commande.class.php | 5 +++ .../deplacement/class/deplacement.class.php | 5 +++ .../facture/class/facture-rec.class.php | 11 +++-- htdocs/compta/facture/class/facture.class.php | 11 +++-- htdocs/contrat/class/contrat.class.php | 5 +++ htdocs/core/class/comment.class.php | 6 ++- htdocs/core/class/fiscalyear.class.php | 21 ++++++---- htdocs/don/class/don.class.php | 42 ++++++++++--------- 10 files changed, 82 insertions(+), 35 deletions(-) diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 32a0ea0f448..b062b9495b9 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -36,7 +36,11 @@ class AccountingJournal extends CommonObject */ public $table_element='accounting_journal'; + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element = ''; + public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'generic'; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 6e14b14ea48..bac7cbfcf36 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -56,7 +56,12 @@ class Propal extends CommonObject public $table_element='propal'; public $table_element_line='propaldet'; - public $fk_element='fk_propal'; + + /** + * @var int Field with ID of parent key if this field has a parent + */ + public $fk_element ='fk_propal'; + public $picto='propal'; /** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 8426a714e58..5e0475b158a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -54,7 +54,12 @@ class Commande extends CommonOrder public $table_element_line = 'commandedet'; public $class_element_line = 'OrderLine'; + + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element = 'fk_commande'; + public $picto = 'order'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 71ca92093a7..c6c95a0e282 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -42,7 +42,12 @@ class Deplacement extends CommonObject public $table_element='deplacement'; public $table_element_line = ''; + + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element = ''; + public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $datec; // Creation date diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index b6be8315897..7d054d054da 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -43,14 +43,19 @@ class FactureRec extends CommonInvoice * @var string ID to identify managed object */ public $element='facturerec'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='facture_rec'; - + public $table_element_line='facturedet_rec'; + + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element='fk_facture'; + public $picto='bill'; var $entity; @@ -1651,7 +1656,7 @@ class FactureLigneRec extends CommonInvoiceLine * @var string ID to identify managed object */ public $element='facturedetrec'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7b743ad0b36..0b77f7c5c07 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -57,14 +57,19 @@ class Facture extends CommonInvoice * @var string ID to identify managed object */ public $element='facture'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='facture'; - + public $table_element_line = 'facturedet'; + + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element = 'fk_facture'; + public $picto='bill'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -4242,7 +4247,7 @@ class FactureLigne extends CommonInvoiceLine * @var string ID to identify managed object */ public $element='facturedet'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 8c89ffa810f..4f153cf33d7 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -52,7 +52,12 @@ class Contrat extends CommonObject public $table_element='contrat'; public $table_element_line='contratdet'; + + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element='fk_contrat'; + public $picto='contract'; /** diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 33e727dcfd0..b75b4050788 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -31,7 +31,11 @@ class Comment extends CommonObject */ public $table_element='comment'; - public $fk_element; + /** + * @var int Field with ID of parent key if this field has a parent + */ + public $fk_element =''; + public $element_type; /** diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 72a5ad644e4..ad8c98d43c8 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -39,24 +39,29 @@ class Fiscalyear extends CommonObject public $table_element='accounting_fiscalyear'; public $table_element_line = ''; + + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element = ''; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $rowid; + public $rowid; /** * @var string fiscal year label */ public $label; - var $date_start; - var $date_end; - var $datec; - var $statut; // 0=open, 1=closed - var $entity; + public $date_start; + public $date_end; + public $datec; + public $statut; // 0=open, 1=closed + public $entity; - var $statuts=array(); - var $statuts_short=array(); + public $statuts=array(); + public $statuts_short=array(); /** * Constructor diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index de24f60a9c0..85d0fb81b8c 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -38,38 +38,42 @@ class Don extends CommonObject * @var string ID to identify managed object */ public $element='don'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='don'; - + + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element = 'fk_donation'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $picto = 'generic'; + public $picto = 'generic'; - var $date; - var $amount; - var $societe; - var $address; - var $zip; - var $town; - var $email; - var $public; - var $fk_project; - var $fk_typepayment; - var $num_payment; - var $date_valid; - var $modepaymentid = 0; + public $date; + public $amount; + public $societe; + public $address; + public $zip; + public $town; + public $email; + public $public; + public $fk_project; + public $fk_typepayment; + public $num_payment; + public $date_valid; + public $modepaymentid = 0; - var $labelstatut; - var $labelstatutshort; + public $labelstatut; + public $labelstatutshort; /** * @deprecated * @see note_private, note_public */ - var $commentaire; + public $commentaire; /** From 45cbc36a1575fbe1a7ffbcd2831ee999cf5097b4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 15:27:55 +0200 Subject: [PATCH 017/255] Standardize and update code --- htdocs/fichinter/class/fichinter.class.php | 45 +++++++++++-------- .../class/fournisseur.commande.class.php | 7 ++- .../fourn/class/fournisseur.facture.class.php | 7 ++- htdocs/hrm/class/establishment.class.php | 5 +++ htdocs/livraison/class/livraison.class.php | 17 ++++--- htdocs/product/class/product.class.php | 4 ++ htdocs/projet/class/project.class.php | 7 ++- htdocs/projet/class/task.class.php | 4 ++ htdocs/societe/class/societe.class.php | 4 ++ 9 files changed, 71 insertions(+), 29 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 59d4ecabad1..40ca5862df0 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -45,7 +45,11 @@ class Fichinter extends CommonObject */ public $table_element='fichinter'; + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element='fk_fichinter'; + public $table_element_line='fichinterdet'; public $picto = 'intervention'; @@ -54,28 +58,28 @@ class Fichinter extends CommonObject */ protected $table_ref_field = 'ref'; - var $socid; // Id client + public $socid; // Id client - var $author; - var $datec; - var $datev; - var $dateo; - var $datee; - var $datet; - var $datem; - var $duration; - var $statut = 0; // 0=draft, 1=validated, 2=invoiced, 3=Terminate + public $author; + public $datec; + public $datev; + public $dateo; + public $datee; + public $datet; + public $datem; + public $duration; + public $statut = 0; // 0=draft, 1=validated, 2=invoiced, 3=Terminate /** * @var string description */ public $description; - var $fk_contrat = 0; - var $fk_project = 0; - var $extraparams=array(); + public $fk_contrat = 0; + public $fk_project = 0; + public $extraparams=array(); - var $lines = array(); + public $lines = array(); /** * Draft status @@ -1332,11 +1336,11 @@ class FichinterLigne extends CommonObjectLine public $error=''; // From llx_fichinterdet - var $fk_fichinter; - var $desc; // Description ligne - var $datei; // Date intervention - var $duration; // Duree de l'intervention - var $rang = 0; + public $fk_fichinter; + public $desc; // Description ligne + public $datei; // Date intervention + public $duration; // Duree de l'intervention + public $rang = 0; /** * @var string ID to identify managed object @@ -1348,6 +1352,9 @@ class FichinterLigne extends CommonObjectLine */ public $table_element='fichinterdet'; + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element='fk_fichinter'; /** diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9ea7febfbd9..b2c05eb4253 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -51,7 +51,12 @@ class CommandeFournisseur extends CommonOrder public $table_element='commande_fournisseur'; public $table_element_line = 'commande_fournisseurdet'; - public $fk_element = 'fk_commande'; + + /** + * @var int Field with ID of parent key if this field has a parent + */ + public $fk_element = 'fk_commande'; + public $picto='order'; /** diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 1eece0f0316..2f50e9ac137 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -52,7 +52,12 @@ class FactureFournisseur extends CommonInvoice public $table_element='facture_fourn'; public $table_element_line='facture_fourn_det'; - public $fk_element='fk_facture_fourn'; + + /** + * @var int Field with ID of parent key if this field has a parent + */ + public $fk_element='fk_facture_fourn'; + public $picto='bill'; /** diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 90b06d9fd0f..7cd7eff5d68 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -39,7 +39,12 @@ class Establishment extends CommonObject public $table_element='establishment'; public $table_element_line = ''; + + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element = 'fk_establishment'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='building'; diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index eaa999882cf..8b8236e62e9 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -44,6 +44,9 @@ class Livraison extends CommonObject */ public $element="delivery"; + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element="fk_livraison"; /** @@ -53,14 +56,14 @@ class Livraison extends CommonObject public $table_element_line="livraisondet"; - var $brouillon; - var $socid; - var $ref_customer; + public $brouillon; + public $socid; + public $ref_customer; - var $date_delivery; // Date really received - var $date_creation; - var $date_valid; - var $model_pdf; + public $date_delivery; // Date really received + public $date_creation; + public $date_valid; + public $model_pdf; /** * Constructor diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ebb40516636..57a969cb924 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -53,7 +53,11 @@ class Product extends CommonObject */ public $table_element='product'; + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element='fk_product'; + protected $childtables=array('supplier_proposaldet', 'propaldet','commandedet','facturedet','contratdet','facture_fourn_det','commande_fournisseurdet'); // To test if we can delete object public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index cf706f47e44..48e322b3a3e 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -44,7 +44,12 @@ class Project extends CommonObject public $table_element = 'projet'; public $table_element_line = 'projet_task'; - public $fk_element = 'fk_projet'; + + /** + * @var int Field with ID of parent key if this field has a parent + */ + public $fk_element = 'fk_projet'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'projectpub'; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 6cd128380e5..be72fafc261 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -41,7 +41,11 @@ class Task extends CommonObject */ public $table_element='projet_task'; + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element='fk_task'; + public $picto = 'task'; protected $childtables=array('projet_task_time'); // To test if we can delete object diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 19e87aeb5af..3eb85ff9365 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -51,7 +51,11 @@ class Societe extends CommonObject */ public $table_element = 'societe'; + /** + * @var int Field with ID of parent key if this field has a parent + */ public $fk_element='fk_soc'; + public $fieldsforcombobox='nom,name_alias'; protected $childtables=array("supplier_proposal"=>'SupplierProposal',"propal"=>'Proposal',"commande"=>'Order',"facture"=>'Invoice',"facture_rec"=>'RecurringInvoiceTemplate',"contrat"=>'Contract',"fichinter"=>'Fichinter',"facture_fourn"=>'SupplierInvoice',"commande_fournisseur"=>'SupplierOrder',"projet"=>'Project',"expedition"=>'Shipment',"prelevement_lignes"=>'DirectDebitRecord'); // To test if we can delete object protected $childtablesoncascade=array("societe_prices", "societe_log", "societe_address", "product_fournisseur_price", "product_customer_price_log", "product_customer_price", "socpeople", "adherent", "societe_rib", "societe_remise", "societe_remise_except", "societe_commerciaux", "categorie", "notify", "notify_def", "actioncomm"); From d86d7323fb03168459f8d154cac2e1bf9faf9952 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 22:46:35 +0200 Subject: [PATCH 018/255] Update code --- .../class/accountingaccount.class.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 06a9e1b1955..894fea8c356 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -71,15 +71,15 @@ class AccountingAccount extends CommonObject */ public $id; - var $rowid; - var $datec; // Creation date - var $fk_pcg_version; - var $pcg_type; - var $pcg_subtype; - var $account_number; - var $account_parent; - var $account_category; - var $status; + public $rowid; + public $datec; // Creation date + public $fk_pcg_version; + public $pcg_type; + public $pcg_subtype; + public $account_number; + public $account_parent; + public $account_category; + public $status; /** * @var string Label of account @@ -96,7 +96,7 @@ class AccountingAccount extends CommonObject */ public $fk_user_modif; - var $active; // duplicate with status + public $active; // duplicate with status /** From 7b0d3c32aba6c514a80146c4a7a4b21fa81c368b Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 22:55:10 +0200 Subject: [PATCH 019/255] Standardize and Update code --- .../accountancy/class/accountingaccount.class.php | 4 ++++ .../accountancy/class/accountingjournal.class.php | 3 +++ htdocs/asset/class/asset.class.php | 4 ++++ htdocs/core/class/emailsenderprofile.class.php | 4 ++++ htdocs/core/class/fiscalyear.class.php | 3 +++ htdocs/don/class/paymentdonation.class.php | 3 +++ htdocs/fourn/class/fournisseur.facture.class.php | 5 ++++- htdocs/hrm/class/establishment.class.php | 8 +++++++- htdocs/loan/class/loan.class.php | 4 ++++ .../modulebuilder/template/class/myobject.class.php | 3 +++ htdocs/product/inventory/class/inventory.class.php | 3 +++ htdocs/societe/class/companypaymentmode.class.php | 13 +++++++++---- htdocs/stripe/class/stripe.class.php | 4 ++++ 13 files changed, 55 insertions(+), 6 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 894fea8c356..c2da46c6911 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -71,7 +71,11 @@ class AccountingAccount extends CommonObject */ public $id; + /** + * @var int ID + */ public $rowid; + public $datec; // Creation date public $fk_pcg_version; public $pcg_type; diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index b8d3852246c..852a70d38c2 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -44,6 +44,9 @@ class AccountingJournal extends CommonObject public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'generic'; + /** + * @var int ID + */ public $rowid; public $code; diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 55f2d3f5df0..3ca85a4015f 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -95,6 +95,10 @@ class Asset extends CommonObject 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,), 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Active', '-1'=>'Cancel')), ); + + /** + * @var int ID + */ public $rowid; /** diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 94c9488a085..7b934c68a2b 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -88,6 +88,10 @@ class EmailSenderProfile extends CommonObject 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'visible'=>-1, 'enabled'=>1, 'position'=>500, 'notnull'=>1,), 'active' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1, 'index'=>1), ); + + /** + * @var int ID + */ public $rowid; /** diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 9d8a045ba62..dc6bc5d0310 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -47,6 +47,9 @@ class Fiscalyear extends CommonObject public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + /** + * @var int ID + */ public $rowid; /** diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 3a839c2e759..e85cb410cd5 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -41,6 +41,9 @@ class PaymentDonation extends CommonObject public $picto = 'payment'; + /** + * @var int ID + */ public $rowid; public $fk_donation; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index bf263819ced..3633325fdcb 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -77,7 +77,10 @@ class FactureFournisseur extends CommonInvoice */ protected $table_ref_field = 'ref'; - public $rowid; + /** + * @var int ID + */ + public $rowid; /** * @var string Ref diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index d57e45e5073..0b163af9346 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -48,13 +48,19 @@ class Establishment extends CommonObject public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='building'; - public $id; + /** + * @var int ID + */ + public $id; /** * @var string Ref */ public $ref; + /** + * @var int ID + */ public $rowid; public $name; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index b1bcbc65567..cd72a54c504 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -43,7 +43,11 @@ class Loan extends CommonObject public $picto = 'bill'; + /** + * @var int ID + */ public $rowid; + public $datestart; public $dateend; public $label; diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 42fa508f36a..d34b141bc56 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -101,6 +101,9 @@ class MyObject extends CommonObject 'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), ); + /** + * @var int ID + */ public $rowid; /** diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index a49a75dd3cc..7e068818db8 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -99,6 +99,9 @@ class Inventory extends CommonObject 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'default'=>0, 'arrayofkeyval'=>array(0=>'Todo', 1=>'Done', -1=>'Cancel')), ); + /** + * @var int ID + */ public $rowid; /** diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 4f3b666049b..ae405ac6249 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -36,22 +36,22 @@ class CompanyPaymentMode extends CommonObject * @var string ID to identify managed object */ public $element = 'companypaymentmode'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'societe_rib'; - + /** * @var int Does companypaymentmode support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 2; - + /** * @var int Does companypaymentmode support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 0; - + /** * @var string String with name of icon for companypaymentmode. Must be the part after the 'object_' into object_companypaymentmode.png */ @@ -118,7 +118,12 @@ class CompanyPaymentMode extends CommonObject 'import_key' =>array('type'=>'varchar(14)', 'label'=>'Import key', 'enabled'=>1, 'visible'=>-2, 'position'=>105), //'aaa' =>array('type'=>'date', 'label'=>'Ending date', 'enabled'=>0, 'visible'=>-2, 'position'=>185), ); + + /** + * @var int ID + */ public $rowid; + public $fk_soc; public $label; public $bank; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 877e767406f..b8a56b6aa15 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -28,7 +28,11 @@ require_once DOL_DOCUMENT_ROOT.'/stripe/config.php'; // This set stripe glo */ class Stripe extends CommonObject { + /** + * @var int ID + */ public $rowid; + public $fk_soc; public $fk_key; public $id; From ae2df6be117acebcf826fda0e432772bd5a54e22 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 23:04:46 +0200 Subject: [PATCH 020/255] Standardize and Update code --- .../accountancy/class/bookkeeping.class.php | 7 ++++-- htdocs/blockedlog/class/blockedlog.class.php | 3 ++- htdocs/cashdesk/class/Facturation.class.php | 7 +++++- .../comm/action/class/cactioncomm.class.php | 14 ++++++------ htdocs/compta/bank/class/bankcateg.class.php | 5 ++++- .../facture/class/paymentterm.class.php | 22 +++++++++---------- htdocs/core/class/ccountry.class.php | 6 ++--- htdocs/core/class/cstate.class.php | 12 +++++----- htdocs/core/class/ctypent.class.php | 14 ++++++------ htdocs/core/class/discount.class.php | 6 ++++- htdocs/core/class/html.formmail.class.php | 3 +++ htdocs/core/class/menubase.class.php | 5 ++++- htdocs/stripe/class/stripe.class.php | 9 ++++++++ 13 files changed, 72 insertions(+), 41 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 38a4fb72028..cacf9b0a641 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -65,8 +65,7 @@ class BookKeeping extends CommonObject * @var int ID */ public $id; - /** - */ + public $doc_date; public $date_lim_reglement; public $doc_type; @@ -1865,7 +1864,11 @@ class BookKeeping extends CommonObject */ class BookKeepingLine { + /** + * @var int ID + */ public $id; + public $doc_date = ''; public $doc_type; public $doc_ref; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index eaec787b099..dab99d80bc9 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -39,6 +39,7 @@ class BlockedLog * @var int */ public $id; + /** * Entity * @var int @@ -46,7 +47,7 @@ class BlockedLog public $entity; public $error = ''; - + /** * @var string[] Error codes (or messages) */ diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 755c48faf88..3051035813a 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -37,7 +37,12 @@ class Facturation * int $prix => Prix HT du produit en cours * int $tva => 'rowid' du taux de tva dans llx_c_tva */ - public $id; + + /** + * @var int ID + */ + public $id; + protected $ref; protected $qte; protected $stock; diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 8f189c31e6e..f339e79d6a2 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -43,20 +43,20 @@ class CActionComm */ public $id; - var $code; - var $type; - var $libelle; // deprecated + public $code; + public $type; + public $libelle; // deprecated /** * @var string Type of agenda event label */ public $label; - var $active; - var $color; - var $picto; + public $active; + public $color; + public $picto; - var $type_actions=array(); + public $type_actions=array(); /** diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index 3c07d9b49b9..10bcd9a07c4 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -32,7 +32,10 @@ class BankCateg // extends CommonObject //public $table_element='bank_categ'; //!< Name of table without prefix where object is stored public $picto='generic'; - public $id; + /** + * @var int ID + */ + public $id; /** * @var string bank categories label diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 2bdd288e748..619487e9574 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -32,7 +32,7 @@ class PaymentTerm // extends CommonObject * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -42,24 +42,24 @@ class PaymentTerm // extends CommonObject * @var string[] Error codes (or messages) */ public $errors = array(); - + //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 $context =array(); + public $context =array(); /** * @var int ID */ public $id; - var $code; - var $sortorder; - var $active; - var $libelle; - var $libelle_facture; - var $type_cdr; - var $nbjour; - var $decalage; + public $code; + public $sortorder; + public $active; + public $libelle; + public $libelle_facture; + public $type_cdr; + public $nbjour; + public $decalage; diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index f25e0a14ce5..2f9a8636c8b 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -55,15 +55,15 @@ class Ccountry // extends CommonObject */ public $id; - var $code; - var $code_iso; + public $code; + public $code_iso; /** * @var string Countries label */ public $label; - var $active; + public $active; diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php index 3b1016aa55f..085da06c754 100644 --- a/htdocs/core/class/cstate.class.php +++ b/htdocs/core/class/cstate.class.php @@ -36,7 +36,7 @@ class Cstate // extends CommonObject * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -46,7 +46,7 @@ class Cstate // extends CommonObject * @var string[] Error codes (or messages) */ public $errors = array(); - + //var $element='cstate'; //!< Id that identify managed objects //var $table_element='cstate'; //!< Name of table without prefix where object is stored @@ -54,10 +54,10 @@ class Cstate // extends CommonObject * @var int ID */ public $id; - - var $code_departement; - var $nom; - var $active; + + public $code_departement; + public $nom; + public $active; diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index aa3e6620d4f..9366cf6317b 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -31,7 +31,7 @@ class Ctypent // extends CommonObject * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -41,7 +41,7 @@ class Ctypent // extends CommonObject * @var string[] Error codes (or messages) */ public $errors = array(); - + //var $element='ctypent'; //!< Id that identify managed objects //var $table_element='ctypent'; //!< Name of table without prefix where object is stored @@ -49,11 +49,11 @@ class Ctypent // extends CommonObject * @var int ID */ public $id; - - var $code; - var $libelle; - var $active; - var $module; + + public $code; + public $libelle; + public $active; + public $module; diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 7ed51a5ed7c..78f713232d4 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -43,7 +43,11 @@ class DiscountAbsolute */ public $errors=array(); - public $id; // Id discount + /** + * @var int ID discount + */ + public $id; + public $fk_soc; public $discount_type; // 0 => customer discount, 1 => supplier discount public $amount_ht; // diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 17a8ec17939..cdc6a20ffa1 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1402,6 +1402,9 @@ class FormMail extends Form */ class ModelMail { + /** + * @var int ID + */ public $id; /** diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 5078d7759ea..7db88051e5e 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -43,7 +43,10 @@ class Menubase */ public $errors = array(); - public $id; + /** + * @var int ID + */ + public $id; public $menu_handler; public $module; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index b8a56b6aa15..68b3d8f8ef0 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -34,8 +34,14 @@ class Stripe extends CommonObject public $rowid; public $fk_soc; + public $fk_key; + + /** + * @var int ID + */ public $id; + public $mode; /** @@ -44,8 +50,11 @@ class Stripe extends CommonObject public $entity; public $statut; + public $type; + public $code; + public $message; /** From 5cd955731814aaab6f2eb88159f836ff26fd94a9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 23:12:20 +0200 Subject: [PATCH 021/255] Standardize and Update code --- .../modules/export/export_csv.modules.php | 12 +++---- .../modules/export/export_excel.modules.php | 18 +++++----- .../export/export_excel2007.modules.php | 18 +++++----- .../modules/export/export_tsv.modules.php | 12 +++---- .../modules/import/import_csv.modules.php | 22 ++++++------ .../modules/import/import_xlsx.modules.php | 24 ++++++------- .../generate/modGeneratePassNone.class.php | 12 +++---- .../generate/modGeneratePassPerso.class.php | 36 +++++++++---------- .../modGeneratePassStandard.class.php | 12 +++---- htdocs/cron/class/cronjob.class.php | 3 ++ htdocs/ecm/class/ecmdirectory.class.php | 18 +++++----- 11 files changed, 95 insertions(+), 92 deletions(-) diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index 8c56f11274a..a0f8f0df543 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -40,15 +40,15 @@ class ExportCsv extends ModeleExports */ public $label; - var $extension; - var $version; + public $extension; + public $version; - var $label_lib; - var $version_lib; + public $label_lib; + public $version_lib; - var $separator; + public $separator; - var $handle; // Handle fichier + public $handle; // Handle fichier /** diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 55cd439376b..6c50b3c46de 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -42,17 +42,17 @@ class ExportExcel extends ModeleExports */ public $label; - var $extension; - var $version; + public $extension; + public $version; - var $label_lib; - var $version_lib; + public $label_lib; + public $version_lib; - var $workbook; // Handle fichier - var $worksheet; // Handle onglet - var $row; - var $col; - var $file; // To save filename + public $workbook; // Handle fichier + public $worksheet; // Handle onglet + public $row; + public $col; + public $file; // To save filename /** diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 63242ef1c4e..3deb88d6991 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -43,17 +43,17 @@ class ExportExcel2007 extends ExportExcel */ public $label; - var $extension; - var $version; + public $extension; + public $version; - var $label_lib; - var $version_lib; + public $label_lib; + public $version_lib; - var $workbook; // Handle fichier - var $worksheet; // Handle onglet - var $row; - var $col; - var $file; // To save filename + public $workbook; // Handle fichier + public $worksheet; // Handle onglet + public $row; + public $col; + public $file; // To save filename /** * Constructor diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index c1a320a48ae..db96382a04a 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -41,15 +41,15 @@ class ExportTsv extends ModeleExports */ public $label; - var $extension; - var $version; + public $extension; + public $version; - var $label_lib; - var $version_lib; + public $label_lib; + public $version_lib; - var $separator="\t"; + public $separator="\t"; - var $handle; // Handle fichier + public $handle; // Handle fichier /** diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 3834e03d0dc..36a5d3d70ba 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -60,22 +60,22 @@ class ImportCsv extends ModeleImports */ public $label; - var $extension; // Extension of files imported by driver - var $version; // Version of driver + public $extension; // Extension of files imported by driver + public $version; // Version of driver - var $label_lib; // Label of external lib used by driver - var $version_lib; // Version of external lib used by driver + public $label_lib; // Label of external lib used by driver + public $version_lib; // Version of external lib used by driver - var $separator; + public $separator; - var $file; // Path of file - var $handle; // Handle fichier + public $file; // Path of file + public $handle; // Handle fichier - var $cacheconvert=array(); // Array to cache list of value found after a convertion - var $cachefieldtable=array(); // Array to cache list of value found into fields@tables + public $cacheconvert=array(); // Array to cache list of value found after a convertion + public $cachefieldtable=array(); // Array to cache list of value found into fields@tables - var $nbinsert = 0; // # of insert done during the import - var $nbupdate = 0; // # of update done during the import + public $nbinsert = 0; // # of insert done during the import + public $nbupdate = 0; // # of update done during the import /** diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 6db66d33b02..9ac1d8bc6a6 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -60,23 +60,23 @@ class ImportXlsx extends ModeleImports */ public $label; - var $extension; // Extension of files imported by driver - var $version; // Version of driver + public $extension; // Extension of files imported by driver + public $version; // Version of driver - var $label_lib; // Label of external lib used by driver - var $version_lib; // Version of external lib used by driver + public $label_lib; // Label of external lib used by driver + public $version_lib; // Version of external lib used by driver - var $separator; + public $separator; - var $file; // Path of file - var $handle; // Handle fichier + public $file; // Path of file + public $handle; // Handle fichier - var $cacheconvert=array(); // Array to cache list of value found after a convertion - var $cachefieldtable=array(); // Array to cache list of value found into fields@tables + public $cacheconvert=array(); // Array to cache list of value found after a convertion + public $cachefieldtable=array(); // Array to cache list of value found into fields@tables - var $workbook; // temporary import file - var $record; // current record - var $headers; + public $workbook; // temporary import file + public $record; // current record + public $headers; /** diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index df3071f7b26..d0e8c617217 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -35,17 +35,17 @@ class modGeneratePassNone extends ModeleGenPassword * @var int ID */ public $id; - - var $length; + + public $length; /** * @var DoliDB Database handler. */ public $db; - - var $conf; - var $lang; - var $user; + + public $conf; + public $lang; + public $user; /** diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index d0ae019bf09..a95a48d20b2 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -37,30 +37,30 @@ class modGeneratePassPerso extends ModeleGenPassword * @var int ID */ public $id; - - var $length; - var $length2; // didn't overright display - var $NbMaj; - var $NbNum; - var $NbSpe; - var $NbRepeat; - var $WithoutAmbi; + + public $length; + public $length2; // didn't overright display + public $NbMaj; + public $NbNum; + public $NbSpe; + public $NbRepeat; + public $WithoutAmbi; /** * @var DoliDB Database handler. */ public $db; - - var $conf; - var $lang; - var $user; - var $Maj; - var $Min; - var $Nb; - var $Spe; - var $Ambi; - var $All; + public $conf; + public $lang; + public $user; + + public $Maj; + public $Min; + public $Nb; + public $Spe; + public $Ambi; + public $All; /** * Constructor diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index 87a792672fb..d051c173c6d 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -35,17 +35,17 @@ class modGeneratePassStandard extends ModeleGenPassword * @var int ID */ public $id; - - var $length; + + public $length; /** * @var DoliDB Database handler. */ public $db; - - var $conf; - var $lang; - var $user; + + public $conf; + public $lang; + public $user; /** diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 3850b15187f..e18d918d56a 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1337,6 +1337,9 @@ class Cronjob extends CommonObject class Cronjobline { + /** + * @var int ID + */ public $id; /** diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index c2de8fef3c7..97885bf2430 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -37,7 +37,7 @@ class EcmDirectory // extends CommonObject */ //public $table_element='ecm_directories'; - var $picto = 'dir'; + public $picto = 'dir'; /** * @var int ID @@ -49,16 +49,16 @@ class EcmDirectory // extends CommonObject */ public $label; - var $fk_parent; + public $fk_parent; /** * @var string description */ public $description; - var $cachenbofdoc=-1; // By default cache initialized with value 'not calculated' - var $date_c; - var $date_m; + public $cachenbofdoc=-1; // By default cache initialized with value 'not calculated' + public $date_c; + public $date_m; public $fk_user_m; public $fk_user_c; @@ -67,11 +67,11 @@ class EcmDirectory // extends CommonObject */ public $ref; - var $cats=array(); - var $motherof=array(); + public $cats=array(); + public $motherof=array(); - var $forbiddenchars = array('<','>',':','/','\\','?','*','|','"'); - var $forbiddencharsdir = array('<','>',':','?','*','|','"'); + public $forbiddenchars = array('<','>',':','/','\\','?','*','|','"'); + public $forbiddencharsdir = array('<','>',':','?','*','|','"'); public $full_arbo_loaded; From db32d8903e2d48d8233297db75f31410b01b58af Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 23:20:20 +0200 Subject: [PATCH 022/255] Standardize and Update code --- .../class/fournisseur.commande.class.php | 5 +- .../fournisseur.commande.dispatch.class.php | 5 +- .../fourn/class/fournisseur.product.class.php | 54 +++++++++---------- .../class/productcustomerprice.class.php | 36 ++++++------- .../class/propalmergepdfproduct.class.php | 16 +++--- .../class/price_expression.class.php | 12 ++--- .../class/price_global_variable.class.php | 4 +- .../price_global_variable_updater.class.php | 16 +++--- .../inventory/class/inventory.class.php | 2 + htdocs/societe/class/address.class.php | 9 ++++ 10 files changed, 88 insertions(+), 71 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 0f727559507..6768097f7c1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -76,7 +76,10 @@ class CommandeFournisseur extends CommonOrder */ protected $table_ref_field = 'ref'; - public $id; + /** + * @var int ID + */ + public $id; /** * Supplier order reference diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 4052d17b8b0..2e1162873d5 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -60,7 +60,10 @@ class CommandeFournisseurDispatch extends CommonObject public $table_element='commande_fournisseur_dispatch'; //!< Name of table without prefix where object is stored public $lines=array(); - public $id; + /** + * @var int ID + */ + public $id; public $fk_commande; public $fk_product; diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 77a31689237..994358e4511 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -41,52 +41,52 @@ class ProductFournisseur extends Product * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - var $product_fourn_price_id; // id of ligne product-supplier + public $product_fourn_price_id; // id of ligne product-supplier /** * @var int ID */ public $id; - + /** * @deprecated * @see ref_supplier */ - var $fourn_ref; - var $delivery_time_days; - var $ref_supplier; // ref supplier (can be set by get_buyprice) - var $desc_supplier; - var $vatrate_supplier; // default vat rate for this supplier/qty/product (can be set by get_buyprice) + public $fourn_ref; + public $delivery_time_days; + public $ref_supplier; // ref supplier (can be set by get_buyprice) + public $desc_supplier; + public $vatrate_supplier; // default vat rate for this supplier/qty/product (can be set by get_buyprice) - var $fourn_id; //supplier id - var $fourn_qty; // quantity for price (can be set by get_buyprice) - var $fourn_pu; // unit price for quantity (can be set by get_buyprice) + public $fourn_id; //supplier id + public $fourn_qty; // quantity for price (can be set by get_buyprice) + public $fourn_pu; // unit price for quantity (can be set by get_buyprice) - var $fourn_price; // price for quantity - var $fourn_remise_percent; // discount for quantity (percent) - var $fourn_remise; // discount for quantity (amount) - var $product_fourn_id; // supplier id - var $fk_availability; // availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) - var $fourn_unitprice; - var $fourn_tva_tx; - var $fourn_tva_npr; + public $fourn_price; // price for quantity + public $fourn_remise_percent; // discount for quantity (percent) + public $fourn_remise; // discount for quantity (amount) + public $product_fourn_id; // supplier id + public $fk_availability; // availability delay - visible/used if option FOURN_PRODUCT_AVAILABILITY is on (duplicate information compared to delivery delay) + public $fourn_unitprice; + public $fourn_tva_tx; + public $fourn_tva_npr; - var $fk_supplier_price_expression; - var $supplier_reputation; // reputation of supplier - var $reputations=array(); // list of available supplier reputations + public $fk_supplier_price_expression; + public $supplier_reputation; // reputation of supplier + public $reputations=array(); // list of available supplier reputations // Multicurreny - var $fourn_multicurrency_id; - var $fourn_multicurrency_code; - var $fourn_multicurrency_tx; - var $fourn_multicurrency_price; - var $fourn_multicurrency_unitprice; + public $fourn_multicurrency_id; + public $fourn_multicurrency_code; + public $fourn_multicurrency_tx; + public $fourn_multicurrency_price; + public $fourn_multicurrency_unitprice; /** * Constructor diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 011a95345db..35ba8621ae8 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -970,28 +970,28 @@ class PriceByCustomerLine */ public $id; - var $entity; - var $datec = ''; - var $tms = ''; - var $fk_product; - var $fk_soc; - var $price; - var $price_ttc; - var $price_min; - var $price_min_ttc; - var $price_base_type; - var $default_vat_code; - var $tva_tx; - var $recuperableonly; - var $localtax1_tx; - var $localtax2_tx; + public $entity; + public $datec = ''; + public $tms = ''; + public $fk_product; + public $fk_soc; + public $price; + public $price_ttc; + public $price_min; + public $price_min_ttc; + public $price_base_type; + public $default_vat_code; + public $tva_tx; + public $recuperableonly; + public $localtax1_tx; + public $localtax2_tx; /** * @var int User ID */ public $fk_user; - var $import_key; - var $socname; - var $prodref; + public $import_key; + public $socname; + public $prodref; } diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 75fe5282bd1..fb0a7ad2cb5 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -645,14 +645,14 @@ class PropalmergepdfproductLine */ public $id; - var $fk_product; - var $file_name; - var $lang; - var $fk_user_author; - var $fk_user_mod; - var $datec=''; - var $tms=''; - var $import_key; + public $fk_product; + public $file_name; + public $lang; + public $fk_user_author; + public $fk_user_mod; + public $datec=''; + public $tms=''; + public $import_key; /** * Constructor diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 0d991ace9fe..c80cb43e727 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -33,7 +33,7 @@ class PriceExpression * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -43,15 +43,15 @@ class PriceExpression * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var int ID */ public $id; - - var $title; - var $expression; - + + public $title; + public $expression; + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php index 2997e88c589..ebdba3b5949 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php @@ -49,14 +49,14 @@ class PriceGlobalVariable */ public $id; - var $code; + public $code; /** * @var string description */ public $description; - var $value; + public $value; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index 943e78d633c..8c7c936856b 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -44,26 +44,26 @@ class PriceGlobalVariableUpdater */ public $errors = array(); - var $types=array(0, 1); //!< Updater types - var $update_min = 5; //!< Minimal update rate + public $types=array(0, 1); //!< Updater types + public $update_min = 5; //!< Minimal update rate /** * @var int ID */ public $id; - var $type; + public $type; /** * @var string description */ public $description; - var $parameters; - var $fk_variable; - var $update_interval; //!< Interval in mins - var $next_update; //!< Next update timestamp - var $last_status; + public $parameters; + public $fk_variable; + public $update_interval; //!< Interval in mins + public $next_update; //!< Next update timestamp + public $last_status; /** * @var string Name of table without prefix where object is stored diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 7e068818db8..2233a6c76e5 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -483,10 +483,12 @@ class InventoryObjectLine * @var int ID */ public $id; + /** * @var mixed Sample line property 1 */ public $prop1; + /** * @var mixed Sample line property 2 */ diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php index 1cb4f1c4b65..7a6fc299a78 100644 --- a/htdocs/societe/class/address.class.php +++ b/htdocs/societe/class/address.class.php @@ -33,7 +33,11 @@ class Address { protected $db; + /** + * @var int ID + */ public $id; + public $type; public $label; public $socid; @@ -496,7 +500,12 @@ class Address class AddressLine { protected $db; + + /** + * @var int ID + */ public $id; + public $date_creation; public $date_modification; public $label; From bb18982f7885a74781090face331ad99cdceb8f4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 23:24:59 +0200 Subject: [PATCH 023/255] Standardize and Update code --- .../class/supplier_proposal.class.php | 100 ++++++++++-------- htdocs/ticket/class/ticket.class.php | 5 +- htdocs/ticket/class/ticketlogs.class.php | 5 +- 3 files changed, 61 insertions(+), 49 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index a9b44339930..547e9e9efcf 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -49,12 +49,12 @@ class SupplierProposal extends CommonObject * @var string ID to identify managed object */ public $element='supplier_proposal'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='supplier_proposal'; - + public $table_element_line='supplier_proposaldet'; public $fk_element='fk_supplier_proposal'; public $picto='propal'; @@ -2658,7 +2658,7 @@ class SupplierProposalLine extends CommonObjectLine * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -2668,31 +2668,32 @@ class SupplierProposalLine extends CommonObjectLine * @var string ID to identify managed object */ public $element='supplier_proposaldet'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='supplier_proposaldet'; - var $oldline; + public $oldline; // From llx_supplier_proposaldet - var $rowid; // deprecated - + public $rowid; // deprecated + /** * @var int ID */ public $id; - - var $fk_supplier_proposal; - var $fk_parent_line; - var $desc; // Description ligne - var $fk_product; // Id produit predefini + + public $fk_supplier_proposal; + public $fk_parent_line; + public $desc; // Description ligne + public $fk_product; // Id produit predefini + /** * @deprecated * @see product_type */ - var $fk_product_type; + public $fk_product_type; /** * Product type * @var int @@ -2700,89 +2701,94 @@ class SupplierProposalLine extends CommonObjectLine */ public $product_type = Product::TYPE_PRODUCT; - var $qty; - var $tva_tx; - var $subprice; - var $remise_percent; - var $fk_remise_except; + public $qty; + public $tva_tx; + public $subprice; + public $remise_percent; + public $fk_remise_except; - var $rang = 0; + public $rang = 0; - var $fk_fournprice; - var $pa_ht; - var $marge_tx; - var $marque_tx; + public $fk_fournprice; + public $pa_ht; + public $marge_tx; + public $marque_tx; - var $special_code; // Tag for special lines (exlusive tags) + public $special_code; // Tag for special lines (exlusive tags) // 1: frais de port // 2: ecotaxe // 3: option line (when qty = 0) - var $info_bits = 0; // Liste d'options cumulables: + public $info_bits = 0; // Liste d'options cumulables: // Bit 0: 0 si TVA normal - 1 si TVA NPR // Bit 1: 0 ligne normale - 1 si ligne de remise fixe - var $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne - var $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne - var $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne + public $total_ht; // Total HT de la ligne toute quantite et incluant la remise ligne + public $total_tva; // Total TVA de la ligne toute quantite et incluant la remise ligne + public $total_ttc; // Total TTC de la ligne toute quantite et incluant la remise ligne /** * @deprecated * @see remise_percent, fk_remise_except */ - var $remise; + public $remise; + /** * @deprecated * @see subprice */ - var $price; + public $price; // From llx_product /** * @deprecated * @see product_ref */ - var $ref; + public $ref; + /** * Product reference * @var string */ public $product_ref; + /** * @deprecated * @see product_label */ - var $libelle; + public $libelle; + /** * Product label * @var string */ public $product_label; + /** * Product description * @var string */ public $product_desc; - var $localtax1_tx; // Local tax 1 - var $localtax2_tx; // Local tax 2 - var $localtax1_type; // Local tax 1 type - var $localtax2_type; // Local tax 2 type - var $total_localtax1; // Line total local tax 1 - var $total_localtax2; // Line total local tax 2 + public $localtax1_tx; // Local tax 1 + public $localtax2_tx; // Local tax 2 + public $localtax1_type; // Local tax 1 type + public $localtax2_type; // Local tax 2 type + public $total_localtax1; // Line total local tax 1 + public $total_localtax2; // Line total local tax 2 - var $skip_update_total; // Skip update price total for special lines + public $skip_update_total; // Skip update price total for special lines - var $ref_fourn; - var $ref_supplier; + public $ref_fourn; + public $ref_supplier; // Multicurrency - var $fk_multicurrency; - var $multicurrency_code; - var $multicurrency_subprice; - var $multicurrency_total_ht; - var $multicurrency_total_tva; - var $multicurrency_total_ttc; + public $fk_multicurrency; + public $multicurrency_code; + public $multicurrency_subprice; + public $multicurrency_total_ht; + public $multicurrency_total_tva; + public $multicurrency_total_ttc; /** * Class line Contructor diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 74f5c825e6c..3f3b08b1cba 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2488,7 +2488,10 @@ class Ticket extends CommonObject */ class TicketsLine { - public $id; + /** + * @var int ID + */ + public $id; /** * @var string $ref Ticket reference diff --git a/htdocs/ticket/class/ticketlogs.class.php b/htdocs/ticket/class/ticketlogs.class.php index e006759ed51..c5e77bc9dae 100644 --- a/htdocs/ticket/class/ticketlogs.class.php +++ b/htdocs/ticket/class/ticketlogs.class.php @@ -57,7 +57,10 @@ class Ticketlogs// extends CommonObject */ public $table_element = 'ticketlogs'; //!< Name of table without prefix where object is stored - public $id; + /** + * @var int ID + */ + public $id; public $fk_track_id; public $fk_user_create; From 3e723af0189ce964550999462e4962068ae90182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 1 Sep 2018 23:46:13 +0200 Subject: [PATCH 024/255] start changing phpcs:ignore --- htdocs/comm/propal/class/propal.class.php | 66 +++++--- htdocs/contrat/class/contrat.class.php | 36 +++-- htdocs/cron/class/cronjob.class.php | 16 +- htdocs/expedition/class/expedition.class.php | 52 +++--- .../class/paymentexpensereport.class.php | 8 +- htdocs/product/card.php | 2 +- .../product/class/html.formproduct.class.php | 10 +- htdocs/product/class/product.class.php | 149 ++++++++++++------ htdocs/product/class/productbatch.class.php | 7 +- .../inventory/class/inventory.class.php | 15 +- .../class/productstockentrepot.class.php | 5 +- test/phpunit/CoreTest.php | 3 +- 12 files changed, 235 insertions(+), 134 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index d59ccc63d1c..e8437e66498 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -232,9 +232,10 @@ class Propal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Add line into array products - * $this->thirdparty should be loaded + * Add line into array products + * $this->thirdparty should be loaded * * @param int $idproduct Product Id to add * @param int $qty Quantity @@ -244,9 +245,9 @@ class Propal extends CommonObject * TODO Replace calls to this function by generation objet Ligne * inserted into table $this->products */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_product($idproduct, $qty, $remise_percent=0) { + // phpcs:enable global $conf, $mysoc; if (! $qty) $qty = 1; @@ -293,15 +294,16 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adding line of fixed discount in the proposal in DB * * @param int $idremise Id of fixed discount * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_discount($idremise) { + // phpcs:enable global $langs; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -1172,6 +1174,7 @@ class Propal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Insert into DB a proposal object completely defined by its data members (ex, results from copy). * @@ -1179,9 +1182,9 @@ class Propal extends CommonObject * @return int Id of the new object if ok, <0 if ko * @see create */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_from($user) { + // phpcs:enable // i love this function because $this->products is not used in create function... $this->products=$this->lines; @@ -1564,15 +1567,16 @@ class Propal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load array lines * * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines($only_product=0) { + // phpcs:enable $this->lines=array(); $sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,'; @@ -1803,6 +1807,7 @@ class Propal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define proposal date * @@ -1811,9 +1816,9 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date($user, $date, $notrigger=0) { + // phpcs:enable if (empty($date)) { $this->error='ErrorBadParameter'; @@ -1871,6 +1876,7 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define end validity date * @@ -1879,9 +1885,9 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_echeance($user, $date_fin_validite, $notrigger=0) { + // phpcs:enable if (! empty($user->rights->propal->creer)) { $error=0; @@ -1932,6 +1938,7 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set delivery date * @@ -1940,9 +1947,9 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date_livraison($user, $date_livraison, $notrigger=0) { + // phpcs:enable if (! empty($user->rights->propal->creer)) { $error=0; @@ -1993,6 +2000,7 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set delivery * @@ -2001,9 +2009,9 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_availability($user, $id, $notrigger=0) { + // phpcs:enable if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT) { $error=0; @@ -2063,6 +2071,7 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set source of demand * @@ -2071,9 +2080,9 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_demand_reason($user, $id, $notrigger=0) { + // phpcs:enable if (! empty($user->rights->propal->creer) && $this->statut >= self::STATUS_DRAFT) { $error=0; @@ -2135,6 +2144,7 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set customer reference number * @@ -2143,9 +2153,9 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_ref_client($user, $ref_client, $notrigger=0) { + // phpcs:enable if (! empty($user->rights->propal->creer)) { $error=0; @@ -2199,6 +2209,7 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set an overall discount on the proposal * @@ -2207,9 +2218,9 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_percent($user, $remise, $notrigger=0) { + // phpcs:enable $remise=trim($remise)?trim($remise):0; if (! empty($user->rights->propal->creer)) @@ -2265,6 +2276,7 @@ class Propal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set an absolute overall discount on the proposal * @@ -2273,9 +2285,9 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_absolue($user, $remise, $notrigger=0) { + // phpcs:enable $remise=trim($remise)?trim($remise):0; if (! empty($user->rights->propal->creer)) @@ -2550,6 +2562,7 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set draft status * @@ -2557,9 +2570,9 @@ class Propal extends CommonObject * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_draft($user, $notrigger=0) { + // phpcs:enable $error=0; $this->db->begin(); @@ -2608,6 +2621,7 @@ class Propal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of proposal (eventually filtered on user) into an array * @@ -2621,9 +2635,9 @@ class Propal extends CommonObject * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_array($shortlist=0, $draft=0, $notcurrentuser=0, $socid=0, $limit=0, $offset=0, $sortfield='p.datep', $sortorder='DESC') { + // phpcs:enable global $user; $ga = array(); @@ -2695,15 +2709,16 @@ class Propal extends CommonObject return $this->InvoiceArrayList($this->id); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array with id and ref of related invoices * * @param int $id Id propal * @return array Array of invoices id */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function InvoiceArrayList($id) { + // phpcs:enable $ga = array(); $linkedInvoices = array(); @@ -2974,6 +2989,7 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Change source demand * @@ -2982,9 +2998,9 @@ class Propal extends CommonObject * @return int >0 si ok, <0 si ko * @deprecated use set_demand_reason */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function demand_reason($demand_reason_id, $notrigger=0) { + // phpcs:enable global $user; if ($this->statut >= self::STATUS_DRAFT) @@ -3115,6 +3131,7 @@ class Propal extends CommonObject return $this->LibStatut($this->statut, $mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a status (draft, validated, ...) * @@ -3122,9 +3139,9 @@ class Propal extends CommonObject * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=1) { + // phpcs:enable global $conf; // Init/load array of translation of status @@ -3158,9 +3175,10 @@ class Propal extends CommonObject if ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut]; if ($mode == 5) return ''.$this->labelstatut_short[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); if ($mode == 6) return ''.$this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); - } + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * @@ -3168,9 +3186,9 @@ class Propal extends CommonObject * @param int $mode "opened" for proposal to close, "signed" for proposal to invoice * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user,$mode) { + // phpcs:enable global $conf, $langs; $clause = " WHERE"; @@ -3336,14 +3354,15 @@ class Propal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $user; $this->nb=array(); @@ -4223,15 +4242,16 @@ class PropaleLigne extends CommonObjectLine } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update DB line fields total_xxx * Used by migration * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_total() { + // phpcs:enable $this->db->begin(); // Mise a jour ligne en base diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index c7601cf9c1d..ee62ee5680c 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -236,6 +236,7 @@ class Contrat extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Activate a contract line * @@ -246,9 +247,9 @@ class Contrat extends CommonObject * @param string $comment A comment typed by user * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function active_line($user, $line_id, $date, $date_end='', $comment='') { + // phpcs:enable $result = $this->lines[$this->lines_id_index_mapper[$line_id]]->active_line($user, $date, $date_end, $comment); if ($result < 0) { @@ -259,6 +260,7 @@ class Contrat extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close a contract line * @@ -268,9 +270,9 @@ class Contrat extends CommonObject * @param string $comment A comment typed by user * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function close_line($user, $line_id, $date_end, $comment='') { + // phpcs:enable $result=$this->lines[$this->lines_id_index_mapper[$line_id]]->close_line($user, $date_end, $comment); if ($result < 0) { @@ -702,15 +704,16 @@ class Contrat extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load lines array into this->lines. * This set also nbofserviceswait, nbofservicesopened, nbofservicesexpired and nbofservicesclosed * * @return ContratLigne[] Return array of contract lines */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { + // phpcs:enable $this->nbofserviceswait=0; $this->nbofservicesopened=0; $this->nbofservicesexpired=0; @@ -1780,6 +1783,7 @@ class Contrat extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update statut of contract according to services * @@ -1787,9 +1791,9 @@ class Contrat extends CommonObject * @return int <0 if KO, >0 if OK * @deprecated This function will never be used. Status of a contract is status of its lines. */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_statut($user) { + // phpcs:enable dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); // If draft, we keep it (should not happen) @@ -1819,6 +1823,7 @@ class Contrat extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi label of a given contrat status * @@ -1826,9 +1831,9 @@ class Contrat extends CommonObject * @param int $mode 0=Long label, 1=Short label, 2=Picto + Libelle court, 3=Picto, 4=Picto + Long label of all services, 5=Libelle court + Picto, 6=Picto of all services, 7=Same than 6 with fixed length * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode) { + // phpcs:enable global $langs; $langs->load("contracts"); if ($mode == 0) @@ -2002,15 +2007,16 @@ class Contrat extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of line rowid * * @param int $statut Status of lines to get * @return array Array of line's rowid */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function array_detail($statut=-1) { + // phpcs:enable $tab=array(); $sql = "SELECT cd.rowid"; @@ -2078,6 +2084,7 @@ class Contrat extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * @@ -2085,9 +2092,9 @@ class Contrat extends CommonObject * @param string $mode "inactive" pour services a activer, "expired" pour services expires * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user,$mode) { + // phpcs:enable global $conf, $langs; $this->from = " FROM ".MAIN_DB_PREFIX."contrat as c"; @@ -2157,14 +2164,15 @@ class Contrat extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * * @return int <0 si ko, >0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf, $user; $this->nb=array(); @@ -2580,6 +2588,7 @@ class ContratLigne extends CommonObjectLine return $this->LibStatut($this->statut,$mode,((! empty($this->date_fin_validite))?($this->date_fin_validite < dol_now()?1:0):-1)); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a contract line status * @@ -2589,9 +2598,9 @@ class ContratLigne extends CommonObjectLine * @param string $moreatt More attribute * @return string Libelle */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($statut,$mode,$expired=-1,$moreatt='') { + // phpcs:enable global $langs; $langs->load("contracts"); if ($mode == 0) @@ -3003,15 +3012,16 @@ class ContratLigne extends CommonObjectLine } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Mise a jour en base des champs total_xxx de ligne * Used by migration process * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_total() { + // phpcs:enable $this->db->begin(); // Mise a jour ligne en base @@ -3120,6 +3130,7 @@ class ContratLigne extends CommonObjectLine } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Activate a contract line * @@ -3129,9 +3140,9 @@ class ContratLigne extends CommonObjectLine * @param string $comment A comment typed by user * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function active_line($user, $date, $date_end = '', $comment = '') { + // phpcs:enable global $langs, $conf; $error = 0; @@ -3178,6 +3189,7 @@ class ContratLigne extends CommonObjectLine } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close a contract line * @@ -3187,9 +3199,9 @@ class ContratLigne extends CommonObjectLine * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function close_line($user, $date_end, $comment = '', $notrigger=0) { + // phpcs:enable global $langs, $conf; // Update object diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 02fd4a95643..7c9396c70e8 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -368,6 +368,7 @@ class Cronjob extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load object in memory from the database * @@ -380,10 +381,10 @@ class Cronjob extends CommonObject * @param int $processing Processing or not * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_all($sortorder='DESC', $sortfield='t.rowid', $limit=0, $offset=0, $status=1, $filter='', $processing=-1) { - global $langs; + // phpcs:enable + global $langs; $this->lines=array(); @@ -920,6 +921,7 @@ class Cronjob extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Run a job. * Once job is finished, status and nb of run is updated. @@ -928,9 +930,9 @@ class Cronjob extends CommonObject * @param string $userlogin User login * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function run_jobs($userlogin) { + // phpcs:enable global $langs, $conf; $now=dol_now(); @@ -1191,6 +1193,7 @@ class Cronjob extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Reprogram a job * @@ -1198,9 +1201,9 @@ class Cronjob extends CommonObject * @param timestamp $now Date returned by dol_now() * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function reprogram_jobs($userlogin, $now) { + // phpcs:enable dol_syslog(get_class($this)."::reprogram_jobs userlogin:$userlogin", LOG_DEBUG); require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; @@ -1279,6 +1282,7 @@ class Cronjob extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -1286,10 +1290,10 @@ class Cronjob extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { - global $langs; + // phpcs:enable + global $langs; $langs->load('users'); if ($mode == 0) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 8a46f14c829..e40faafeefd 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -48,14 +48,14 @@ class Expedition extends CommonObject * @var string ID to identify managed object */ public $element="shipping"; - + public $fk_element="fk_expedition"; - + /** * @var string Name of table without prefix where object is stored */ public $table_element="expedition"; - + public $table_element_line="expeditiondet"; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'sending'; @@ -380,6 +380,7 @@ class Expedition extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a expedition line * @@ -389,9 +390,9 @@ class Expedition extends CommonObject * @param array $array_options extrafields array * @return int <0 if KO, line_id if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_line($entrepot_id, $origin_line_id, $qty,$array_options=0) { + //phpcs:enable $expeditionline = new ExpeditionLigne($this->db); $expeditionline->fk_expedition = $this->id; $expeditionline->entrepot_id = $entrepot_id; @@ -407,6 +408,7 @@ class Expedition extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create the detail (eat-by date) of the expedition line * @@ -414,9 +416,9 @@ class Expedition extends CommonObject * @param array $array_options extrafields array * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_line_batch($line_ext,$array_options=0) { + // phpcs:enable $error = 0; $stockLocationQty = array(); // associated array with batch qty in stock location @@ -478,7 +480,7 @@ class Expedition extends CommonObject $sql.= ", e.note_private, e.note_public"; $sql.= ', e.fk_incoterms, e.location_incoterms'; $sql.= ', i.libelle as libelle_incoterms'; - $sql.= ', s.libelle as shipping_method'; + $sql.= ', s.libelle as shipping_method'; $sql.= ", el.fk_source as origin_id, el.sourcetype as origin"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->db->escape($this->element)."'"; @@ -807,15 +809,16 @@ class Expedition extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a delivery receipt from a shipment * * @param User $user User * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_delivery($user) { + // phpcs:enable global $conf; if ($conf->livraison_bon->enabled) @@ -915,6 +918,7 @@ class Expedition extends CommonObject $this->lines[$num] = $line; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add a shipment line with batch record * @@ -922,9 +926,9 @@ class Expedition extends CommonObject * @param array $array_options extrafields array * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function addline_batch($dbatch,$array_options=0) { + // phpcs:enable global $conf,$langs; $num = count($this->lines); @@ -1303,14 +1307,15 @@ class Expedition extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load lines * * @return int >0 if OK, Otherwise if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { + // phpcs:enable global $conf, $mysoc; // TODO: recuperer les champs du document associe a part @@ -1590,6 +1595,7 @@ class Expedition extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a status * @@ -1597,9 +1603,9 @@ class Expedition extends CommonObject * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode) { + // phpcs:enable global $langs; if ($mode==0) @@ -1713,6 +1719,7 @@ class Expedition extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set the planned delivery date * @@ -1720,9 +1727,9 @@ class Expedition extends CommonObject * @param timestamp $date_livraison Date de livraison * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date_livraison($user, $date_livraison) { + // phpcs:enable if ($user->rights->expedition->creer) { $sql = "UPDATE ".MAIN_DB_PREFIX."expedition"; @@ -1748,14 +1755,15 @@ class Expedition extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch deliveries method and return an array. Load array this->meths(rowid=>label). * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_delivery_methods() { + // phpcs:enable global $langs; $this->meths = array(); @@ -1775,15 +1783,16 @@ class Expedition extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch all deliveries method and return an array. Load array this->listmeths. * * @param id $id only this carrier, all if none * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_delivery_methods($id='') { + // phpcs:enable global $langs; $this->listmeths = array(); @@ -1810,6 +1819,7 @@ class Expedition extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update/create delivery method. * @@ -1817,9 +1827,9 @@ class Expedition extends CommonObject * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_delivery_method($id='') { + // phpcs:enable if ($id=='') { $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_shipment_mode (code, libelle, description, tracking)"; @@ -1839,6 +1849,7 @@ class Expedition extends CommonObject if ($resql < 0) dol_print_error($this->db,''); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Activate delivery method. * @@ -1846,15 +1857,16 @@ class Expedition extends CommonObject * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function activ_delivery_method($id) { + // phpcs:enable $sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=1'; $sql.= ' WHERE rowid='.$id; $resql = $this->db->query($sql); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * DesActivate delivery method. * @@ -1862,9 +1874,9 @@ class Expedition extends CommonObject * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function disable_delivery_method($id) { + // phpcs:enable $sql = 'UPDATE '.MAIN_DB_PREFIX.'c_shipment_mode SET active=0'; $sql.= ' WHERE rowid='.$id; @@ -1872,15 +1884,16 @@ class Expedition extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Forge an set tracking url * * @param string $value Value * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetUrlTrackingStatus($value='') { + // phpcs:enable if (! empty($this->shipping_method_id)) { $sql = "SELECT em.code, em.tracking"; @@ -2058,14 +2071,15 @@ class Expedition extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Classify the shipping as invoiced (used when WORKFLOW_BILL_ON_SHIPMENT is on) * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_billed() { + // phpcs:enable global $user; $error=0; @@ -2293,7 +2307,7 @@ class ExpeditionLigne extends CommonObjectLine * @var string ID to identify managed object */ public $element='expeditiondet'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 0dceeae4808..fa581161494 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -450,16 +450,17 @@ class PaymentExpenseReport extends CommonObject return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * - * @param int $statut Id statut + * @param int $statut Id statut * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; return ''; @@ -604,15 +605,16 @@ class PaymentExpenseReport extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update link between the expense report payment and the generated line in llx_bank * * @param int $id_bank Id if bank * @return int >0 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_fk_bank($id_bank) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 672ad334422..52815c1303d 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1068,7 +1068,7 @@ else print ''; } if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) - { + { // Volume print ''.$langs->trans("Volume").''; print ''; diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 4eee6ffe502..22b5e4656a7 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -167,6 +167,7 @@ class FormProduct } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Return full path to current warehouse in $tab (recursive function) * @@ -174,10 +175,9 @@ class FormProduct * @param String $final_label full label with all parents, separated by ' >> ' (completed on each call) * @return String full label with all parents, separated by ' >> ' */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function get_parent_path($tab, $final_label='') { - + //phpcs:enable if(empty($final_label)) $final_label = $tab['label']; if(empty($tab['parent_id'])) return $final_label; @@ -282,6 +282,7 @@ class FormProduct } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output a combo box with list of units * pour l'instant on ne definit pas les unites dans la base @@ -292,12 +293,13 @@ class FormProduct * @param int $adddefault Add empty unit called "Default" * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_measuring_units($name='measuring_units', $measuring_style='', $default='0', $adddefault=0) { + //phpcs:enable print $this->load_measuring_units($name, $measuring_style, $default, $adddefault); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a combo box with list of units * For the moment, units labels are defined in measuring_units_string @@ -308,9 +310,9 @@ class FormProduct * @param int $adddefault Add empty unit called "Default" * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_measuring_units($name='measuring_units', $measuring_style='', $default='0', $adddefault=0) { + //phpcs:enable global $langs,$conf,$mysoc; $langs->load("other"); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index cdacd56e432..4f81927dca0 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -692,19 +692,20 @@ class Product extends CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Check barcode * - * @param string $valuetotest Value to test - * @param string $typefortest Type of barcode (ISBN, EAN, ...) + * @param string $valuetotest Value to test + * @param string $typefortest Type of barcode (ISBN, EAN, ...) * @return int 0 if OK * -1 ErrorBadBarCodeSyntax * -2 ErrorBarCodeRequired * -3 ErrorBarCodeAlreadyUsed */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function check_barcode($valuetotest,$typefortest) { + // phpcs:enable global $conf; if (! empty($conf->barcode->enabled) && ! empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) { @@ -1446,6 +1447,7 @@ class Product extends CommonObject + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Insert a track that we changed a customer price * @@ -1453,9 +1455,9 @@ class Product extends CommonObject * @param int $level price level to change * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _log_price($user,$level=0) { + // phpcs:enable global $conf; $now=dol_now(); @@ -1485,6 +1487,7 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Delete a price line * @@ -1492,9 +1495,9 @@ class Product extends CommonObject * @param int $rowid Line id to delete * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function log_price_delete($user, $rowid) { + // phpcs:enable $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_price_by_qty"; $sql.= " WHERE fk_product_price=".$rowid; $resql=$this->db->query($sql); @@ -1514,6 +1517,7 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Read price used by a provider. * We enter as input couple prodfournprice/qty or triplet qty/product_id/fourn_ref. @@ -1526,9 +1530,9 @@ class Product extends CommonObject * @param int $fk_soc If of supplier * @return int <-1 if KO, -1 if qty not enough, 0 if OK but nothing found, id_product if OK and found. May also initialize some properties like (->ref_supplier, buyprice, fourn_pu, vatrate_supplier...) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_buyprice($prodfournprice, $qty, $product_id=0, $fourn_ref='', $fk_soc=0) { + // phpcs:enable global $conf; $result = 0; @@ -2216,15 +2220,16 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge tableau des stats propale pour le produit/service * * @param int $socid Id societe * @return array Tableau des stats */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stats_propale($socid=0) { + // phpcs:enable global $conf; global $user; @@ -2260,15 +2265,16 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge tableau des stats propale pour le produit/service * * @param int $socid Id thirdparty * @return array Tableau des stats */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stats_proposal_supplier($socid=0) { + // phpcs:enable global $conf; global $user; @@ -2304,6 +2310,7 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge tableau des stats commande client pour le produit/service * @@ -2312,9 +2319,9 @@ class Product extends CommonObject * @param int $forVirtualStock Ignore rights filter for virtual stock calculation. * @return array Array of stats (nb=nb of order, qty=qty ordered) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stats_commande($socid=0,$filtrestatut='', $forVirtualStock = 0) { + // phpcs:enable global $conf,$user; $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_customers, COUNT(DISTINCT c.rowid) as nb,"; @@ -2401,6 +2408,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge tableau des stats commande fournisseur pour le produit/service * @@ -2409,9 +2417,9 @@ class Product extends CommonObject * @param int $forVirtualStock Ignore rights filter for virtual stock calculation. * @return array Tableau des stats */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stats_commande_fournisseur($socid=0,$filtrestatut='', $forVirtualStock = 0) { + // phpcs:enable global $conf,$user; $sql = "SELECT COUNT(DISTINCT c.fk_soc) as nb_suppliers, COUNT(DISTINCT c.rowid) as nb,"; @@ -2445,6 +2453,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge tableau des stats expedition client pour le produit/service * @@ -2453,9 +2462,9 @@ class Product extends CommonObject * @param int $forVirtualStock Ignore rights filter for virtual stock calculation. * @return array Tableau des stats */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stats_sending($socid=0,$filtrestatut='', $forVirtualStock = 0) { + // phpcs:enable global $conf,$user; $sql = "SELECT COUNT(DISTINCT e.fk_soc) as nb_customers, COUNT(DISTINCT e.rowid) as nb,"; @@ -2493,6 +2502,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge tableau des stats réception fournisseur pour le produit/service * @@ -2501,9 +2511,9 @@ class Product extends CommonObject * @param int $forVirtualStock Ignore rights filter for virtual stock calculation. * @return array Tableau des stats */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stats_reception($socid=0,$filtrestatut='', $forVirtualStock = 0) { + // phpcs:enable global $conf,$user; $sql = "SELECT COUNT(DISTINCT cf.fk_soc) as nb_customers, COUNT(DISTINCT cf.rowid) as nb,"; @@ -2537,15 +2547,16 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge tableau des stats contrat pour le produit/service * - * @param int $socid Id societe + * @param int $socid Id societe * @return array Tableau des stats */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stats_contrat($socid=0) { + // phpcs:enable global $conf; global $user; @@ -2580,15 +2591,16 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge tableau des stats facture pour le produit/service * * @param int $socid Id societe * @return array Tableau des stats */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stats_facture($socid=0) { + // phpcs:enable global $conf; global $user; @@ -2623,15 +2635,16 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge tableau des stats facture pour le produit/service * * @param int $socid Id societe * @return array Tableau des stats */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stats_facture_fournisseur($socid=0) { + // phpcs:enable global $conf; global $user; @@ -2666,6 +2679,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return an array formated for showing graphs * @@ -2674,9 +2688,9 @@ class Product extends CommonObject * @param int $year Year (0=current year) * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _get_stats($sql, $mode, $year=0) { + // phpcs:enable $resql = $this->db->query($sql); if ($resql) { @@ -2731,6 +2745,7 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of units or customers invoices in which product is included * @@ -2741,9 +2756,9 @@ class Product extends CommonObject * @param string $morefilter More sql filters * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_nb_vente($socid, $mode, $filteronproducttype=-1, $year=0, $morefilter='') { + // phpcs:enable global $conf; global $user; @@ -2768,6 +2783,7 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of units or supplier invoices in which product is included * @@ -2778,9 +2794,9 @@ class Product extends CommonObject * @param string $morefilter More sql filters * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_nb_achat($socid, $mode, $filteronproducttype=-1, $year=0, $morefilter='') { + // phpcs:enable global $conf; global $user; @@ -2804,6 +2820,7 @@ class Product extends CommonObject return $this->_get_stats($sql,$mode, $year); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of units or proposals in which product is included * @@ -2814,9 +2831,9 @@ class Product extends CommonObject * @param string $morefilter More sql filters * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_nb_propal($socid, $mode, $filteronproducttype=-1, $year=0, $morefilter='') { + // phpcs:enable global $conf; global $user; @@ -2840,6 +2857,7 @@ class Product extends CommonObject return $this->_get_stats($sql,$mode, $year); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of units or proposals in which product is included * @@ -2850,9 +2868,9 @@ class Product extends CommonObject * @param string $morefilter More sql filters * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_nb_propalsupplier($socid, $mode, $filteronproducttype=-1, $year=0, $morefilter='') { + // phpcs:enable global $conf; global $user; @@ -2876,6 +2894,7 @@ class Product extends CommonObject return $this->_get_stats($sql,$mode, $year); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of units or orders in which product is included * @@ -2886,9 +2905,9 @@ class Product extends CommonObject * @param string $morefilter More sql filters * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_nb_order($socid, $mode, $filteronproducttype=-1, $year=0, $morefilter='') { + // phpcs:enable global $conf, $user; $sql = "SELECT sum(d.qty), date_format(c.date_commande, '%Y%m')"; @@ -2911,6 +2930,7 @@ class Product extends CommonObject return $this->_get_stats($sql,$mode, $year); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of units or orders in which product is included * @@ -2921,9 +2941,9 @@ class Product extends CommonObject * @param string $morefilter More sql filters * @return array <0 if KO, result[month]=array(valuex,valuey) where month is 0 to 11 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_nb_ordersupplier($socid, $mode, $filteronproducttype=-1, $year=0, $morefilter='') { + // phpcs:enable global $conf, $user; $sql = "SELECT sum(d.qty), date_format(c.date_commande, '%Y%m')"; @@ -2946,6 +2966,7 @@ class Product extends CommonObject return $this->_get_stats($sql,$mode, $year); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Link a product/service to a parent product/service * @@ -2955,9 +2976,9 @@ class Product extends CommonObject * @param int $incdec 1=Increase/decrease stock of child when parent stock increase/decrease * @return int < 0 if KO, > 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_sousproduit($id_pere, $id_fils, $qty, $incdec=1) { + // phpcs:enable // Clean parameters if (! is_numeric($id_pere)) $id_pere=0; if (! is_numeric($id_fils)) $id_fils=0; @@ -3003,6 +3024,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Modify composed product * @@ -3012,9 +3034,9 @@ class Product extends CommonObject * @param int $incdec 1=Increase/decrease stock of child when parent stock increase/decrease * @return int < 0 if KO, > 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_sousproduit($id_pere, $id_fils, $qty, $incdec=1) { + // phpcs:enable // Clean parameters if (! is_numeric($id_pere)) $id_pere=0; if (! is_numeric($id_fils)) $id_fils=0; @@ -3037,6 +3059,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retire le lien entre un sousproduit et un produit/service * @@ -3044,9 +3067,9 @@ class Product extends CommonObject * @param int $fk_child Id du produit a ne plus lie * @return int < 0 if KO, > 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function del_sousproduit($fk_parent, $fk_child) { + // phpcs:enable if (! is_numeric($fk_parent)) $fk_parent=0; if (! is_numeric($fk_child)) $fk_child=0; @@ -3064,16 +3087,17 @@ class Product extends CommonObject return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Verifie si c'est un sous-produit * - * @param int $fk_parent Id du produit auquel le produit est lie - * @param int $fk_child Id du produit lie + * @param int $fk_parent Id du produit auquel le produit est lie + * @param int $fk_child Id du produit lie * @return int < 0 si erreur, > 0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function is_sousproduit($fk_parent, $fk_child) { + // phpcs:enable $sql = "SELECT fk_product_pere, qty, incdec"; $sql.= " FROM ".MAIN_DB_PREFIX."product_association"; $sql.= " WHERE fk_product_pere = '".$fk_parent."'"; @@ -3105,6 +3129,7 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add a supplier price for the product. * Note: Duplicate ref is accepted for different quantity only, or for different companies. @@ -3115,9 +3140,9 @@ class Product extends CommonObject * @param float $quantity Quantity minimum for price * @return int < 0 if KO, 0 if link already exists for this product, > 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_fournisseur($user, $id_fourn, $ref_fourn, $quantity) { + // phpcs:enable global $conf; $now=dol_now(); @@ -3210,14 +3235,15 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la liste des fournisseurs du produit/service * * @return array Tableau des id de fournisseur */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_suppliers() { + // phpcs:enable global $conf; $list = array(); @@ -3243,6 +3269,7 @@ class Product extends CommonObject return $list; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Recopie les prix d'un produit/service sur un autre * @@ -3250,9 +3277,9 @@ class Product extends CommonObject * @param int $toId Id product target * @return nt < 0 if KO, > 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function clone_price($fromId, $toId) { + // phpcs:enable $this->db->begin(); // les prix @@ -3272,6 +3299,7 @@ class Product extends CommonObject return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Clone links between products * @@ -3279,9 +3307,9 @@ class Product extends CommonObject * @param int $toId Product id * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function clone_associations($fromId, $toId) { + // phpcs:enable $this->db->begin(); $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association (fk_product_pere, fk_product_fils, qty)'; @@ -3299,6 +3327,7 @@ class Product extends CommonObject return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Recopie les fournisseurs et prix fournisseurs d'un produit/service sur un autre * @@ -3306,9 +3335,9 @@ class Product extends CommonObject * @param int $toId Id produit cible * @return int < 0 si erreur, > 0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function clone_fournisseurs($fromId, $toId) { + // phpcs:enable $this->db->begin(); $now=dol_now(); @@ -3347,6 +3376,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction recursive uniquement utilisee par get_arbo_each_prod, recompose l'arborescence des sousproduits * Define value of this->res @@ -3358,9 +3388,9 @@ class Product extends CommonObject * @param int $id_parent Id parent * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_prod_arbo($prod, $compl_path="", $multiply=1, $level=1, $id_parent=0) { + // phpcs:enable global $conf,$langs; $product = new Product($this->db); @@ -3407,6 +3437,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Build the tree of subproducts into an array * this->sousprods is loaded by this->get_sousproduits_arbo() @@ -3414,9 +3445,9 @@ class Product extends CommonObject * @param int $multiply Because each sublevel must be multiplicated by parent nb * @return array $this->res */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_arbo_each_prod($multiply=1) { + // phpcs:enable $this->res = array(); if (isset($this->sousprods) && is_array($this->sousprods)) { @@ -3558,15 +3589,16 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return tree of all subproducts for product. Tree contains id, name and quantity. * Set this->sousprods * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_sousproduits_arbo() { + // phpcs:enable $parent=array(); foreach($this->getChildsArbo($this->id) as $keyChild => $valueChild) // Warning. getChildsArbo can call getChildsArbo recursively. Starting point is $value[0]=id of product @@ -3760,6 +3792,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a given status * @@ -3768,9 +3801,9 @@ class Product extends CommonObject * @param int $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0,$type=0) { + // phpcs:enable global $conf, $langs; $langs->load('products'); @@ -3855,6 +3888,7 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adjust stock in a warehouse for product * @@ -3869,9 +3903,9 @@ class Product extends CommonObject * @param int $origin_id Origin id of element * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label='', $price=0, $inventorycode='', $origin_element='', $origin_id=null) { + // phpcs:enable if ($id_entrepot) { $this->db->begin(); @@ -3901,6 +3935,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adjust stock in a warehouse for product with batch number * @@ -3918,9 +3953,9 @@ class Product extends CommonObject * @param int $origin_id Origin id of element * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label='', $price=0, $dlc='', $dluo='',$lot='', $inventorycode='', $origin_element='', $origin_id=null) { + // phpcs:enable if ($id_entrepot) { $this->db->begin(); @@ -3950,6 +3985,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load information about stock of a product into ->stock_reel, ->stock_warehouse[] (including stock_warehouse[idwarehouse]->detail_batch for batch products) * This function need a lot of load. If you use it on list, use a cache to execute it once for each product id. @@ -3964,9 +4000,9 @@ class Product extends CommonObject * @return int < 0 if KO, > 0 if OK * @see load_virtual_stock, getBatchInfo */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_stock($option='') { + // phpcs:enable global $conf; $this->stock_reel = 0; @@ -4031,6 +4067,7 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load value ->stock_theorique of a product. Property this->id must be defined. * This function need a lot of load. If you use it on list, use a cache to execute it one for each product id. @@ -4038,9 +4075,9 @@ class Product extends CommonObject * @return int < 0 if KO, > 0 if OK * @see load_stock, getBatchInfo */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_virtual_stock() { + // phpcs:enable global $conf; $stock_commande_client=0; @@ -4131,6 +4168,7 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Move an uploaded file described into $file array into target directory $sdir. * @@ -4138,9 +4176,9 @@ class Product extends CommonObject * @param string $file Array of file info of file to upload: array('name'=>..., 'tmp_name'=>...) * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_photo($sdir, $file) { + // phpcs:enable global $conf; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -4173,15 +4211,16 @@ class Product extends CommonObject else return -1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return if at least one photo is available * * @param string $sdir Directory to scan * @return boolean True if at least one photo is available, False if not */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function is_photo_available($sdir) { + // phpcs:enable include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; @@ -4210,6 +4249,7 @@ class Product extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne tableau de toutes les photos du produit * @@ -4217,9 +4257,9 @@ class Product extends CommonObject * @param int $nbmax Nombre maximum de photos (0=pas de max) * @return array Tableau de photos */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_photos($dir,$nbmax=0) { + // phpcs:enable include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; @@ -4266,15 +4306,16 @@ class Product extends CommonObject return $tabobj; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Efface la photo du produit et sa vignette * * @param string $file Chemin de l'image * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_photo($file) { + // phpcs:enable require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; @@ -4302,29 +4343,31 @@ class Product extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load size of image file * * @param string $file Path to file * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_image_size($file) { + // phpcs:enable $file_osencoded=dol_osencode($file); $infoImg = getimagesize($file_osencoded); // Get information on image $this->imgWidth = $infoImg[0]; // Largeur de l'image $this->imgHeight = $infoImg[1]; // Hauteur de l'image } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators this->nb for the dashboard * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf, $user, $hookmanager; $this->nb=array(); @@ -4380,6 +4423,7 @@ class Product extends CommonObject return ($this->type == Product::TYPE_SERVICE ? true : false); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get a barcode from the module to generate barcode values. * Return value is stored into this->barcode @@ -4388,9 +4432,9 @@ class Product extends CommonObject * @param string $type Barcode type (ean, isbn, ...) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_barcode($object,$type='') { + // phpcs:enable global $conf; $result=''; @@ -4509,14 +4553,15 @@ class Product extends CommonObject } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Return minimum product recommended price * - * @return int Minimum recommanded price that is higher price among all suppliers * PRODUCT_MINIMUM_RECOMMENDED_PRICE + * @return int Minimum recommanded price that is higher price among all suppliers * PRODUCT_MINIMUM_RECOMMENDED_PRICE */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function min_recommended_price() { + // phpcs:enable global $conf; $maxpricesupplier=0; diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 16ff44e563c..fc36c64a3eb 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -73,7 +73,7 @@ class Productbatch extends CommonObject $error=0; // Clean parameters - $this->clean_param(); + $this->cleanParam(); // Check parameters // Put here code to add control on parameters values @@ -204,7 +204,7 @@ class Productbatch extends CommonObject $error=0; // Clean parameters - $this->clean_param(); + $this->cleanParam(); // TODO Check qty is ok for stock move. Negative may not be allowed. if ($this->qty < 0) @@ -402,8 +402,7 @@ class Productbatch extends CommonObject * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - private function clean_param() + private function cleanParam() { if (isset($this->fk_product_stock)) $this->fk_product_stock=(int) trim($this->fk_product_stock); if (isset($this->batch)) $this->batch=trim($this->batch); diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 19fa3e3e627..ae5cbd0e580 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -38,7 +38,7 @@ class Inventory extends CommonObject * @var string ID to identify managed object */ public $element = 'inventory'; - + /** * @var string Name of table without prefix where object is stored */ @@ -48,7 +48,7 @@ class Inventory extends CommonObject * @var array Does inventory support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for inventory */ @@ -123,22 +123,22 @@ class Inventory extends CommonObject * @var int Name of subtable line */ //public $table_element_line = 'inventorydet'; - + /** * @var int Field with ID of parent key if this field has a parent */ //public $fk_element = 'fk_inventory'; - + /** * @var int Name of subtable class that manage subtable lines */ //public $class_element_line = 'Inventoryline'; - + /** * @var array Array of child tables (child tables to delete before deleting a record) */ //protected $childtables=array('inventorydet'); - + /** * @var InventoryLine[] Array of subtable lines */ @@ -339,6 +339,7 @@ class Inventory extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -346,9 +347,9 @@ class Inventory extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto, 6=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index 651ee59c22e..e0c15d03520 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -44,7 +44,7 @@ class ProductStockEntrepot extends CommonObject * @var string Id to identify managed objects */ public $element = 'ProductStockEntrepot'; - + /** * @var string Name of table without prefix where object is stored */ @@ -511,6 +511,7 @@ class ProductStockEntrepot extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un status donne * @@ -518,9 +519,9 @@ class ProductStockEntrepot extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) diff --git a/test/phpunit/CoreTest.php b/test/phpunit/CoreTest.php index c29adf0861f..c725d668763 100644 --- a/test/phpunit/CoreTest.php +++ b/test/phpunit/CoreTest.php @@ -250,6 +250,7 @@ class CoreTest extends PHPUnit_Framework_TestCase // This is code copied from main.inc.php !!!!!!!!!!!!!!! + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF). * @@ -257,9 +258,9 @@ class CoreTest extends PHPUnit_Framework_TestCase * @param string $type 1=GET, 0=POST, 2=PHP_SELF * @return int >0 if there is an injection */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function test_sql_and_script_inject($val, $type) { + // phpcs:enable $inj = 0; // For SQL Injection (only GET and POST are used to be included into bad escaped SQL requests) if ($type != 2) From e98b8e5e25cded665b3511b1207034809294f69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 09:27:59 +0200 Subject: [PATCH 025/255] move phpcs:ignore --- dev/translation/autotranslator.class.php | 5 +- htdocs/comm/action/class/actioncomm.class.php | 22 +-- .../action/class/actioncommreminder.class.php | 9 +- htdocs/commande/class/commande.class.php | 54 ++++--- htdocs/core/class/html.form.class.php | 142 ++++++++++++------ htdocs/loan/class/loanschedule.class.php | 7 +- htdocs/societe/class/address.class.php | 6 +- htdocs/societe/class/client.class.php | 3 +- 8 files changed, 159 insertions(+), 89 deletions(-) diff --git a/dev/translation/autotranslator.class.php b/dev/translation/autotranslator.class.php index 3d1445b0cce..123b7f6157d 100644 --- a/dev/translation/autotranslator.class.php +++ b/dev/translation/autotranslator.class.php @@ -64,7 +64,7 @@ class autoTranslator // Translate //ini_set('default_charset','UTF-8'); ini_set('default_charset',$this->_outputpagecode); - $this->parse_refLangTranslationFiles(); + $this->parseRefLangTranslationFiles(); } /** @@ -72,8 +72,7 @@ class autoTranslator * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - private function parse_refLangTranslationFiles() + private function parseRefLangTranslationFiles() { $files = $this->getTranslationFilesArray($this->_refLang); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 6ad7ce68ba7..ef6e2d2c5e4 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -38,21 +38,21 @@ class ActionComm extends CommonObject * @var string ID to identify managed object */ public $element='action'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'actioncomm'; - + public $table_rowid = 'id'; public $picto='action'; - + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; - + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty * @var integer @@ -694,14 +694,15 @@ class ActionComm extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Initialize this->userassigned array with list of id of user assigned to event * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_userassigned() { + // phpcs:enable $sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency"; $sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources"; $sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id; @@ -1017,6 +1018,7 @@ class ActionComm extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * @@ -1024,10 +1026,10 @@ class ActionComm extends CommonObject * @param int $load_state_board Charge indicateurs this->nb de tableau de bord * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user, $load_state_board=0) { - global $conf, $langs; + // phpcs:enable + global $conf, $langs; if(empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp"; else { @@ -1142,6 +1144,7 @@ class ActionComm extends CommonObject return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of action status * @@ -1151,9 +1154,9 @@ class ActionComm extends CommonObject * @param int $datestart Date start of event * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($percent,$mode,$hidenastatus=0,$datestart='') { + // phpcs:enable global $langs; if ($mode == 0) @@ -1351,6 +1354,7 @@ class ActionComm extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Export events from database into a cal file. * @@ -1361,9 +1365,9 @@ class ActionComm extends CommonObject * @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...) * @return int <0 if error, nb of events in new file if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function build_exportfile($format,$type,$cachedelay,$filename,$filters) { + // phpcs:enable global $conf,$langs,$dolibarr_main_url_root,$mysoc; require_once DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php"; diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index ca1a97c5406..afee2690e77 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -34,17 +34,17 @@ class ActionCommReminder extends CommonObject * @var string ID to identify managed object */ public $element = 'actioncomm_reminder'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'actioncomm_reminder'; - + /** * @var array Does actioncommreminder support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; - + /** * @var string String with name of icon for actioncommreminder. Must be the part after the 'object_' into object_actioncommreminder.png */ @@ -168,6 +168,7 @@ class ActionCommReminder extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -175,9 +176,9 @@ class ActionCommReminder extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4c2cd368aac..011846ba08e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -429,6 +429,7 @@ class Commande extends CommonOrder } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set draft status * @@ -436,9 +437,9 @@ class Commande extends CommonOrder * @param int $idwarehouse Warehouse ID to use for stock change (Used only if option STOCK_CALCULATE_ON_VALIDATE_ORDER is on) * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_draft($user, $idwarehouse=-1) { + //phpcs:enable global $conf,$langs; $error=0; @@ -511,6 +512,7 @@ class Commande extends CommonOrder } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Tag the order as validated (opened) * Function used when order is reopend after being closed. @@ -518,9 +520,9 @@ class Commande extends CommonOrder * @param User $user Object user that change status * @return int <0 if KO, 0 if nothing is done, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_reopen($user) { + // phpcs:enable $error=0; if ($this->statut != self::STATUS_CANCELED && $this->statut != self::STATUS_CLOSED) @@ -1476,6 +1478,7 @@ class Commande extends CommonOrder } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add line into array * $this->client must be loaded @@ -1490,9 +1493,9 @@ class Commande extends CommonOrder * TODO Remplacer les appels a cette fonction par generation objet Ligne * insere dans tableau $this->products */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_product($idproduct, $qty, $remise_percent=0.0, $date_start='', $date_end='') { + // phpcs:enable global $conf, $mysoc; if (! $qty) $qty = 1; @@ -1715,15 +1718,16 @@ class Commande extends CommonOrder } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adding line of fixed discount in the order in DB * * @param int $idremise Id de la remise fixe * @return int >0 si ok, <0 si ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_discount($idremise) { + // phpcs:enable global $langs; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -1793,15 +1797,16 @@ class Commande extends CommonOrder } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load array lines * * @param int $only_product Return only physical products * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines($only_product=0) { + // phpcs:enable $this->lines=array(); $sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.product_type, l.fk_commande, l.label as custom_label, l.description, l.price, l.qty, l.vat_src_code, l.tva_tx,'; @@ -2019,6 +2024,7 @@ class Commande extends CommonOrder } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns a array with expeditions lines number * @@ -2026,9 +2032,9 @@ class Commande extends CommonOrder * * TODO deprecate, move to Shipping class */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function nb_expedition() { + // phpcs:enable $sql = 'SELECT count(*)'; $sql.= ' FROM '.MAIN_DB_PREFIX.'expedition as e'; $sql.= ', '.MAIN_DB_PREFIX.'element_element as el'; @@ -2045,6 +2051,7 @@ class Commande extends CommonOrder else dol_print_error($this->db); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a array with the pending stock by product * @@ -2053,9 +2060,9 @@ class Commande extends CommonOrder * * TODO FONCTION NON FINIE A FINIR */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function stock_array($filtre_statut=self::STATUS_CANCELED) { + // phpcs:enable $this->stocks = array(); // Tableau des id de produit de la commande @@ -2162,6 +2169,7 @@ class Commande extends CommonOrder } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Applique une remise relative * @@ -2170,9 +2178,9 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise($user, $remise, $notrigger=0) { + // phpcs:enable $remise=trim($remise)?trim($remise):0; if ($user->rights->commande->creer) @@ -2229,6 +2237,7 @@ class Commande extends CommonOrder } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Applique une remise absolue * @@ -2237,9 +2246,9 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_absolue($user, $remise, $notrigger=0) { + // phpcs:enable $remise=trim($remise)?trim($remise):0; if ($user->rights->commande->creer) @@ -2296,6 +2305,7 @@ class Commande extends CommonOrder } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set the order date * @@ -2304,9 +2314,9 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date($user, $date, $notrigger=0) { + // phpcs:enable if ($user->rights->commande->creer) { $error=0; @@ -2361,6 +2371,7 @@ class Commande extends CommonOrder } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set the planned delivery date * @@ -2369,9 +2380,9 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 si ko, >0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date_livraison($user, $date_livraison, $notrigger=0) { + // phpcs:enable if ($user->rights->commande->creer) { $error=0; @@ -2426,6 +2437,7 @@ class Commande extends CommonOrder } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of orders (eventuelly filtered on a user) into an array * @@ -2439,9 +2451,9 @@ class Commande extends CommonOrder * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='c.date_commande', $sortorder='DESC') { + // phpcs:enable global $user; $ga = array(); @@ -2570,6 +2582,7 @@ class Commande extends CommonOrder } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update order demand_reason * @@ -2577,9 +2590,9 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int >0 if ok, <0 if ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function demand_reason($demand_reason_id, $notrigger=0) { + // phpcs:enable global $user; dol_syslog('Commande::demand_reason('.$demand_reason_id.')'); @@ -2641,6 +2654,7 @@ class Commande extends CommonOrder } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set customer ref * @@ -2649,9 +2663,9 @@ class Commande extends CommonOrder * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_ref_client($user, $ref_client, $notrigger=0) { + // phpcs:enable if ($user->rights->commande->creer) { $error=0; @@ -3254,15 +3268,16 @@ class Commande extends CommonOrder } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Object user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user) { + // phpcs:enable global $conf, $langs; $clause = " WHERE"; @@ -3340,6 +3355,7 @@ class Commande extends CommonOrder return $this->LibStatut($this->statut, $this->billed, $mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of status * @@ -3349,9 +3365,9 @@ class Commande extends CommonOrder * @param int $donotshowbilled Do not show billed status after order status * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$billed,$mode,$donotshowbilled=0) { + // phpcs:enable global $langs, $conf; $billedtext = ''; @@ -3660,14 +3676,15 @@ class Commande extends CommonOrder } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * * @return int <0 si ko, >0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $user; $this->nb=array(); @@ -4296,14 +4313,15 @@ class OrderLine extends CommonOrderLine } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update totals of order into database * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_total() { + // phpcs:enable $this->db->begin(); // Clean parameters diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0419e2cfc68..bbe7fc7d071 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -51,12 +51,12 @@ class Form * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - + var $num; // Cache arrays @@ -653,6 +653,7 @@ class Form return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return combo list of activated countries, into language of user * @@ -666,9 +667,9 @@ class Form * @param int $disablefavorites Disable favorites * @return string HTML string with select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0) { + // phpcs:enable global $conf,$langs; $langs->load("dict"); @@ -750,6 +751,7 @@ class Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return select list of incoterms * @@ -762,9 +764,9 @@ class Form * @param array $events Event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @return string HTML string with select and input */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_incoterms($selected='', $location_incoterms='', $page='', $htmlname='incoterm_id', $htmloption='', $forcecombo=1, $events=array()) { + // phpcs:enable global $conf,$langs; $langs->load("dict"); @@ -843,6 +845,7 @@ class Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of types of lines (product or service) * Example: 0=product, 1=service, 9=other (for external module) @@ -854,9 +857,9 @@ class Form * @param integer $forceall 1=Force to show products and services in combo list, whatever are activated modules, 0=No force, -1=Force none (and set hidden field to 'service') * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_type_of_lines($selected='',$htmlname='type',$showempty=0,$hidetext=0,$forceall=0) { + // phpcs:enable global $db,$langs,$user,$conf; // If product & services are enabled or both disabled. @@ -899,14 +902,15 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load into cache cache_types_fees, array of types of fees * * @return int Nb of lines loaded, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_cache_types_fees() { + // phpcs:enable global $langs; $num = count($this->cache_types_fees); @@ -947,6 +951,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of types of notes * @@ -955,9 +960,9 @@ class Form * @param int $showempty Add an empty field * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_type_fees($selected='',$htmlname='type',$showempty=0) { + // phpcs:enable global $user, $langs; dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); @@ -986,6 +991,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML code to select a company. * @@ -998,12 +1004,13 @@ class Form * @return string Return select box for thirdparty. * @deprecated 3.8 Use select_company instead. For exemple $form->select_thirdparty(GETPOST('socid'),'socid','',0) => $form->select_company(GETPOST('socid'),'socid','',1,0,0,array(),0) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_thirdparty($selected='', $htmlname='socid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0) { + // phpcs:enable return $this->select_thirdparty_list($selected,$htmlname,$filter,1,0,$forcecombo,array(),'',0, $limit); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output html form to select a third party * @@ -1023,9 +1030,9 @@ class Form * @param bool $multiple add [] in the name of element and add 'multiple' attribut (not working with ajax_autocompleter) * @return string HTML string with select box for thirdparty. */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array(), $multiple=false) { + // phpcs:enable global $conf,$user,$langs; $out=''; @@ -1067,6 +1074,7 @@ class Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output html form to select a third party. * Note, you must use the select_company to get the component to select a third party. This function must only be called by select_company. @@ -1086,9 +1094,9 @@ class Form * @param bool $multiple add [] in the name of element and add 'multiple' attribut * @return string HTML string with */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showempty='', $showtype=0, $forcecombo=0, $events=array(), $filterkey='', $outputmode=0, $limit=0, $morecss='minwidth100', $moreparam='', $multiple=false) { + // phpcs:enable global $conf,$user,$langs; $out=''; @@ -1248,6 +1256,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML combo list of absolute discounts * @@ -1258,9 +1267,9 @@ class Form * @param int $maxvalue Max value for lines that can be selected * @return int Return number of qualifed lines in list */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_remises($selected, $htmlname, $filter, $socid, $maxvalue=0) { + // phpcs:enable global $langs,$conf; // On recherche les remises @@ -1324,6 +1333,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of all contacts (for a third party or all) * @@ -1344,9 +1354,9 @@ class Form * @return int <0 if KO, Nb of contact in list if OK * @deprected You can use selectcontacts directly (warning order of param was changed) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $events=array(), $options_only=false, $moreparam='', $htmlid='') { + // phpcs:enable print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $options_only, $showsoc, $forcecombo, $events, $moreparam, $htmlid); return $this->num; } @@ -1484,6 +1494,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return select list of users * @@ -1499,12 +1510,13 @@ class Form * @deprecated Use select_dolusers instead * @see select_dolusers() */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity='0') { + // phpcs:enable print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return select list of users * @@ -1528,9 +1540,9 @@ class Form * @return string HTML select string * @see select_dolgroups */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0, $multiple=false) { + // phpcs:enable global $conf,$user,$langs; // If no preselected user defined, we take current user @@ -1713,6 +1725,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return select list of users. Selected users are stored into session. * List of users are provided into $_SESSION['assignedtouser']. @@ -1735,9 +1748,9 @@ class Form * @return string HTML select string * @see select_dolgroups */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array()) { + // phpcs:enable global $conf, $user, $langs; $userstatic=new User($this->db); @@ -1802,6 +1815,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of products for customer in Ajax if Ajax activated or go to select_produits_list * @@ -1827,9 +1841,9 @@ class Form * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_produits($selected='', $htmlname='productid', $filtertype='', $limit=20, $price_level=0, $status=1, $finished=2, $selected_input_value='', $hidelabel=0, $ajaxoptions=array(), $socid=0, $showempty='1', $forcecombo=0, $morecss='', $hidepriceinlabel=0, $warehouseStatus='', $selected_combinations = array()) { + // phpcs:enable global $langs,$conf; $price_level = (! empty($price_level) ? $price_level : 0); @@ -1945,6 +1959,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of products for a customer * @@ -1968,9 +1983,9 @@ class Form * 'warehouseinternal' = select products from warehouses for internal correct/transfer only * @return array Array of keys for json */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0,$morecss='',$hidepriceinlabel=0, $warehouseStatus='') { + // phpcs:enable global $langs,$conf,$user,$db; $out=''; @@ -2432,6 +2447,7 @@ class Form $optJson = array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'label2'=>$outlabel, 'desc'=>$outdesc, 'type'=>$outtype, 'price_ht'=>$outprice_ht, 'price_ttc'=>$outprice_ttc, 'pricebasetype'=>$outpricebasetype, 'tva_tx'=>$outtva_tx, 'qty'=>$outqty, 'discount'=>$outdiscount, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of products for customer (in Ajax if Ajax activated or go to select_produits_fournisseurs_list) * @@ -2445,9 +2461,9 @@ class Form * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_produits_fournisseurs($socid, $selected='', $htmlname='productid', $filtertype='', $filtre='', $ajaxoptions=array(), $hidelabel=0, $alsoproductwithnosupplierprice=0) { + // phpcs:enable global $langs,$conf; global $price_level, $status, $finished; @@ -2474,6 +2490,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of suppliers products * @@ -2489,9 +2506,9 @@ class Form * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices * @return array Array of keys for json */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_produits_fournisseurs_list($socid,$selected='',$htmlname='productid',$filtertype='',$filtre='',$filterkey='',$statut=-1,$outputmode=0,$limit=100,$alsoproductwithnosupplierprice=0) { + // phpcs:enable global $langs,$conf,$db; $out=''; @@ -2704,6 +2721,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of suppliers prices for a product * @@ -2712,9 +2730,9 @@ class Form * @param int $selected_supplier Pre-selected supplier if more than 1 result * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_product_fourn_price($productid, $htmlname='productfournpriceid', $selected_supplier='') { + // phpcs:enable global $langs,$conf; $langs->load('stocks'); @@ -2816,6 +2834,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of delivery address * @@ -2825,10 +2844,10 @@ class Form * @param int $showempty Add an empty field * @return integer|null */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_address($selected, $socid, $htmlname='address_id',$showempty=0) { - // On recherche les utilisateurs + // phpcs:enable + // looking for users $sql = "SELECT a.rowid, a.label"; $sql .= " FROM ".MAIN_DB_PREFIX ."societe_address as a"; $sql .= " WHERE a.fk_soc = ".$socid; @@ -2869,14 +2888,15 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load into cache list of payment terms * * @return int Nb of lines loaded, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_cache_conditions_paiements() { + // phpcs:enable global $langs; $num = count($this->cache_conditions_paiements); @@ -2917,14 +2937,15 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge dans cache la liste des délais de livraison possibles * * @return int Nb of lines loaded, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_cache_availability() { + // phpcs:enable global $langs; $num = count($this->cache_availability); @@ -3084,14 +3105,15 @@ class Form if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge dans cache la liste des types de paiements possibles * * @return int Nb of lines loaded, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_cache_types_paiements() { + // phpcs:enable global $langs; $num=count($this->cache_types_paiements); @@ -3137,6 +3159,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of payment modes. * Constant MAIN_DEFAULT_PAYMENT_TERM_ID can used to set default value but scope is all application, probably not what you want. @@ -3150,9 +3173,9 @@ class Form * @param string $morecss Add more CSS on select tag * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_conditions_paiements($selected=0, $htmlname='condid', $filtertype=-1, $addempty=0, $noinfoadmin=0, $morecss='') { + // phpcs:enable global $langs, $user, $conf; dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG); @@ -3182,6 +3205,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of payment methods * @@ -3196,9 +3220,9 @@ class Form * @param string $morecss Add more CSS on select tag * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='') { + // phpcs:enable global $langs,$user; dol_syslog(__METHOD__." ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); @@ -3458,6 +3482,7 @@ class Form return $return; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a HTML select list of bank accounts * @@ -3470,9 +3495,9 @@ class Form * @param int $showcurrency Show currency in label * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_comptes($selected='',$htmlname='accountid',$statut=0,$filtre='',$useempty=0,$moreattrib='',$showcurrency=0) { + // phpcs:enable global $langs, $conf; $langs->load("admin"); @@ -3562,6 +3587,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of categories having choosed type * @@ -3574,9 +3600,9 @@ class Form * @return string * @see select_categories */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0, $outputmode=0) { + // phpcs:enable global $conf, $langs; $langs->load("categories"); @@ -3648,6 +3674,7 @@ class Form return $output; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a confirmation HTML form or AJAX popup * @@ -3664,9 +3691,9 @@ class Form * @deprecated * @see formconfirm() */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_confirm($page, $title, $question, $action, $formquestion='', $selectedchoice="", $useajax=0, $height=170, $width=500) { + // phpcs:enable print $this->formconfirm($page, $title, $question, $action, $formquestion, $selectedchoice, $useajax, $height, $width); } @@ -3960,6 +3987,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a form to select a project * @@ -3973,9 +4001,9 @@ class Form * @param int $nooutput No print is done. String is returned. * @return string Return html content */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0, $maxlength=20, $forcefocus=0, $nooutput=0) { + // phpcs:enable global $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; @@ -4019,6 +4047,7 @@ class Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a form to select payment conditions * @@ -4028,9 +4057,9 @@ class Form * @param int $addempty Add empty entry * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_conditions_reglement($page, $selected='', $htmlname='cond_reglement_id', $addempty=0) { + // phpcs:enable global $langs; if ($htmlname != "none") { @@ -4053,6 +4082,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a form to select a delivery delay * @@ -4062,9 +4092,9 @@ class Form * @param int $addempty Ajoute entree vide * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_availability($page, $selected='', $htmlname='availability', $addempty=0) { + // phpcs:enable global $langs; if ($htmlname != "none") { @@ -4128,6 +4158,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a form + html select a date * @@ -4140,9 +4171,9 @@ class Form * @return string * @see select_date */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0) { + // phpcs:enable global $langs; $ret=''; @@ -4170,6 +4201,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a select form to choose a user * @@ -4180,9 +4212,9 @@ class Form * @param array $include List of users id to include * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_users($page, $selected='', $htmlname='userid', $exclude='', $include='') { + // phpcs:enable global $langs; if ($htmlname != "none") @@ -4209,6 +4241,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show form with payment mode * @@ -4219,9 +4252,9 @@ class Form * @param int $active Active or not, -1 = all * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_modes_reglement($page, $selected='', $htmlname='mode_reglement_id', $filtertype='', $active=1) { + // phpcs:enable global $langs; if ($htmlname != "none") { @@ -4244,6 +4277,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show form with multicurrency code * @@ -4252,9 +4286,9 @@ class Form * @param string $htmlname Name of select html field * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_multicurrency_code($page, $selected='', $htmlname='multicurrency_code') { + // phpcs:enable global $langs; if ($htmlname != "none") { @@ -4272,6 +4306,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show form with multicurrency rate * @@ -4281,9 +4316,9 @@ class Form * @param string $currency Currency code to explain the rate * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_multicurrency_rate($page, $rate='', $htmlname='multicurrency_tx', $currency='') { + // phpcs:enable global $langs, $mysoc, $conf; if ($htmlname != "none") @@ -4314,6 +4349,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a select box with available absolute discounts * @@ -4329,9 +4365,9 @@ class Form * @param int $discount_type 0 => customer discount, 1 => supplier discount * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_remise_dispo($page, $selected, $htmlname, $socid, $amount, $filter='', $maxvalue=0, $more='', $hidelist=0, $discount_type=0) { + // phpcs:enable global $conf,$langs; if ($htmlname != "none") { @@ -4410,6 +4446,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show forms to select a contact * @@ -4419,9 +4456,9 @@ class Form * @param string $htmlname Name of HTML select. If 'none', we just show contact link. * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_contacts($page, $societe, $selected='', $htmlname='contactid') { + // phpcs:enable global $langs, $conf; if ($htmlname != "none") @@ -4455,6 +4492,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output html select to select thirdparty * @@ -4468,9 +4506,9 @@ class Form * @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_thirdparty($page, $selected='', $htmlname='socid', $filter='',$showempty=0, $showtype=0, $forcecombo=0, $events=array()) { + // phpcs:enable global $langs; if ($htmlname != "none") @@ -4498,6 +4536,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste des devises, dans la langue de l'utilisateur * @@ -4505,9 +4544,9 @@ class Form * @param string $htmlname name of HTML select list * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_currency($selected='',$htmlname='currency_id') { + // phpcs:enable print $this->selectCurrency($selected,$htmlname); } @@ -4610,15 +4649,16 @@ class Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load into the cache vat rates of a country * * @param string $country_code Country code with quotes ("'CA'", or "'CA,IN,...'") * @return int Nb of loaded lines, 0 if already loaded, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_cache_vatrates($country_code) { + // phpcs:enable global $langs; $num = count($this->cache_vatrates); @@ -4676,6 +4716,7 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output an HTML select vat rate. * The name of this function should be selectVat. We keep bad name for compatibility purpose. @@ -4697,9 +4738,9 @@ class Form * @param int $mode 0=Use vat rate as key in combo list, 1=Add VAT code after vat rate into key, -1=Use id of vat line as key * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_tva($htmlname='tauxtva', $selectedrate='', $societe_vendeuse='', $societe_acheteuse='', $idprod=0, $info_bits=0, $type='', $options_only=false, $mode=0) { + // phpcs:enable global $langs,$conf,$mysoc; $langs->load('errors'); @@ -4864,6 +4905,7 @@ class Form } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a HTML widget to input a date or combo list for day, month, years and optionaly hours and minutes. * Fields are preselected with : @@ -4887,9 +4929,9 @@ class Form * @return string|null Nothing or string if nooutput is 1 * @see form_date, select_month, select_year, select_dayofweek */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='') { + // phpcs:enable global $conf,$langs; $retstring=''; @@ -5241,6 +5283,7 @@ class Form return; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to show a form to select a duration on a page * @@ -5254,9 +5297,9 @@ class Form * @param int $nooutput Do not output html string but return it * @return string|null */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0) { + // phpcs:enable global $langs; $retstring=''; @@ -6440,6 +6483,7 @@ class Form + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of export templates * @@ -6449,10 +6493,9 @@ class Form * @param int $useempty Affiche valeur vide dans liste * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0) { - + // phpcs:enable $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."export_model"; $sql.= " WHERE type = '".$type."'"; @@ -6815,6 +6858,7 @@ class Form return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return select list of groups * @@ -6830,9 +6874,9 @@ class Form * @return string * @see select_dolusers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity='0', $multiple=false) { + // phpcs:enable global $conf,$user,$langs; // Permettre l'exclusion de groupes diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index 80341e8df0c..a8774244e00 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -58,7 +58,7 @@ class LoanSchedule extends CommonObject * @deprecated * @see amount, amounts */ - var $total; + public $total; /** * Constructor @@ -372,6 +372,7 @@ class LoanSchedule extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Calculate mensuality * @@ -380,9 +381,9 @@ class LoanSchedule extends CommonObject * @param int $nbterm nb term * @return double mensuality */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function calc_mens($capital, $rate, $nbterm) { + // phpcs:enable $result=''; if (!empty($capital) && !empty($rate) && !empty($nbterm)) { @@ -465,7 +466,7 @@ class LoanSchedule extends CommonObject * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function trans_paiment() { require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php index 1cb4f1c4b65..578127fc248 100644 --- a/htdocs/societe/class/address.class.php +++ b/htdocs/societe/class/address.class.php @@ -230,6 +230,7 @@ class Address } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge depuis la base toutes les adresses d'une societe * @@ -237,9 +238,9 @@ class Address * @param User $user Objet de l'utilisateur * @return int >0 si ok, <0 si ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines($socid, $user=null) { + // phpcs:enable global $langs, $conf; $sql = 'SELECT rowid, nom as name, client, fournisseur'; @@ -324,6 +325,7 @@ class Address } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge depuis la base l'objet adresse * @@ -331,9 +333,9 @@ class Address * @param User $user Objet de l'utilisateur * @return int >0 si ok, <0 si ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_address($id, $user=null) { + // phpcs:enable global $langs; global $conf; diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php index 9c24aecae85..400dc65b0c2 100644 --- a/htdocs/societe/class/client.class.php +++ b/htdocs/societe/class/client.class.php @@ -47,14 +47,15 @@ class Client extends Societe $this->fournisseur = 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators into this->nb for board * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $user; $this->nb=array("customers" => 0,"prospects" => 0); From 47879d44bc5d94ec81fdaaef5088123cf11261af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 09:57:19 +0200 Subject: [PATCH 026/255] move phpcs:ignore --- .../class/accountingjournal.class.php | 3 +- htdocs/api/class/api.class.php | 3 +- .../mailing/class/advtargetemailing.class.php | 12 ++-- .../class/rejetprelevement.class.php | 5 +- htdocs/imports/class/import.class.php | 6 +- .../class/opensurveysondage.class.php | 6 +- .../class/productcustomerprice.class.php | 6 +- htdocs/product/stock/class/entrepot.class.php | 22 ++++--- htdocs/user/class/user.class.php | 61 ++++++++++++------- 9 files changed, 80 insertions(+), 44 deletions(-) diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 91cc87e6952..282ac93c72a 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -260,6 +260,7 @@ class AccountingJournal extends CommonObject return $this->LibType($this->nature,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return type of an accounting journal * @@ -267,9 +268,9 @@ class AccountingJournal extends CommonObject * @param int $mode 0=libelle long, 1=libelle court * @return string Label of type */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibType($nature,$mode=0) { + // phpcs:enable global $langs; $langs->loadLangs(array("accountancy")); diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 32ebc4fb26e..6ddb4dae1b3 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -271,15 +271,16 @@ class DolibarrApi return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to forge a SQL criteria * * @param array $matches Array of found string by regex search * @return string Forged criteria. Example: "t.field like 'abc%'" */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function _forge_criteria_callback($matches) { + // phpcs:enable global $db; //dol_syslog("Convert matches ".$matches[1]); diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index 14d1fb20f4e..c862b8392fd 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -254,15 +254,16 @@ class AdvanceTargetingMailing extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load object in memory from the database * * @param int $id Id object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_by_mailing($id=0) { + // phpcs:enable global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; @@ -320,6 +321,7 @@ class AdvanceTargetingMailing extends CommonObject + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load object in memory from the database * @@ -327,9 +329,9 @@ class AdvanceTargetingMailing extends CommonObject * @param string $type_element Type target * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_by_element($id=0, $type_element='mailing') { + // phpcs:enable global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; @@ -546,15 +548,16 @@ class AdvanceTargetingMailing extends CommonObject + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load object in memory from database * * @param array $arrayquery All element to Query * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function query_thirdparty($arrayquery) { + // phpcs:enable global $langs,$conf; $sql = "SELECT"; @@ -700,6 +703,7 @@ class AdvanceTargetingMailing extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load object in memory from database * @@ -707,9 +711,9 @@ class AdvanceTargetingMailing extends CommonObject * @param int $withThirdpartyFilter add contact with tridparty filter * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function query_contact($arrayquery, $withThirdpartyFilter = 0) { + // phpcs:enable global $langs,$conf; $sql = "SELECT"; diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 095defe986a..6e3cfe499a8 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -34,7 +34,7 @@ class RejetPrelevement * @var int ID */ public $id; - + /** * @var DoliDB Database handler. */ @@ -199,15 +199,16 @@ class RejetPrelevement } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Send email to all users that has asked the withdraw request * * @param Facture $fac Invoice object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _send_email($fac) { + // phpcs:enable global $langs; $userid = 0; diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 3d3e195b7c9..a0d33d4c28a 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -65,6 +65,7 @@ class Import } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load description int this->array_import_module, this->array_import_fields, ... of an importable dataset * @@ -72,9 +73,9 @@ class Import * @param string $filter Load a particular dataset only. Index will start to 0. * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_arrays($user,$filter='') { + // phpcs:enable global $langs,$conf; dol_syslog(get_class($this)."::load_arrays user=".$user->id." filter=".$filter); @@ -184,6 +185,7 @@ class Import + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Build an import example file. * Arrays this->array_export_xxx are already loaded for required datatoexport @@ -194,9 +196,9 @@ class Import * @param string $datatoimport Dataset to import * @return string <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function build_example_file($model, $headerlinefields, $contentlinevalues,$datatoimport) { + // phpcs:enable global $conf,$langs; $indice=0; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 62a9a798617..f0c01594191 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -467,14 +467,15 @@ class Opensurveysondage extends CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return array of lines * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { + // phpcs:enable $ret=array(); $sql = "SELECT id_users, nom as name, reponses FROM ".MAIN_DB_PREFIX."opensurvey_user_studs"; @@ -623,6 +624,7 @@ class Opensurveysondage extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of status * @@ -630,9 +632,9 @@ class Opensurveysondage extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode) { + // phpcs:enable global $langs, $conf; //print 'x'.$status.'-'.$billed; diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index bb3782be0bb..589321eacb0 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -304,6 +304,7 @@ class Productcustomerprice extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load all customer prices in memory from database * @@ -314,9 +315,9 @@ class Productcustomerprice extends CommonObject * @param array $filter Filter for select * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_all($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, $filter = array()) { + // phpcs:enable global $langs; if ( empty($sortfield)) $sortfield = "t.rowid"; @@ -418,6 +419,7 @@ class Productcustomerprice extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load all objects in memory from database * @@ -428,9 +430,9 @@ class Productcustomerprice extends CommonObject * @param array $filter Filter for sql request * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_all_log($sortorder, $sortfield, $limit, $offset, $filter = array()) { + // phpcs:enable global $langs; if (! empty($sortfield)) $sortfield = "t.rowid"; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 8fa05f5c453..a0aee6fb2b5 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -37,12 +37,12 @@ class Entrepot extends CommonObject * @var string ID to identify managed object */ public $element='stock'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='entrepot'; - + public $picto='stock'; /** @@ -415,15 +415,16 @@ class Entrepot extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of all warehouses * * @param int $status Status * @return array Array list of warehouses */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_array($status=1) { + // phpcs:enable $liste = array(); $sql = "SELECT rowid, ref as label"; @@ -447,14 +448,15 @@ class Entrepot extends CommonObject return $liste; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return number of unique different product into a warehouse * * @return Array Array('nb'=>Nb, 'value'=>Value) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function nb_different_products() { + // phpcs:enable $ret=array(); $sql = "SELECT count(distinct p.rowid) as nb"; @@ -480,14 +482,15 @@ class Entrepot extends CommonObject return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return stock and value of warehosue * * @return Array Array('nb'=>Nb, 'value'=>Value) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function nb_products() { + // phpcs:enable $ret=array(); $sql = "SELECT sum(ps.reel) as nb, sum(ps.reel * p.pmp) as value"; @@ -525,6 +528,7 @@ class Entrepot extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a given status * @@ -532,9 +536,9 @@ class Entrepot extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; $langs->load('stocks'); @@ -652,14 +656,15 @@ class Entrepot extends CommonObject $this->country_code='FR'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return full path to current warehouse * * @return string String full path to current warehouse separated by " >> " */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_full_arbo() { + // phpcs:enable global $user,$langs,$conf; $TArbo = array(empty($this->label)?$this->libelle:$this->label); @@ -693,6 +698,7 @@ class Entrepot extends CommonObject return implode(' >> ', array_reverse($TArbo)); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return array of children warehouses ids from $id warehouse (recursive function) * @@ -700,9 +706,9 @@ class Entrepot extends CommonObject * @param array $TChildWarehouses array which will contain all children (param by reference) * @return array $TChildWarehouses array which will contain all children */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_children_warehouses($id, &$TChildWarehouses) { + // phpcs:enable $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'entrepot diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 7cac0419772..b221f0fa4f3 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1176,6 +1176,7 @@ class User extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a user from a contact object. User will be internal but if contact is linked to a third party, user will be external * @@ -1184,9 +1185,9 @@ class User extends CommonObject * @param string $password Password to force * @return int <0 if error, if OK returns id of created user */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_from_contact($contact,$login='',$password='') { + // phpcs:enable global $conf,$user,$langs; $error=0; @@ -1254,6 +1255,7 @@ class User extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a user into database from a member object * @@ -1261,9 +1263,9 @@ class User extends CommonObject * @param string $login Login to force * @return int <0 if KO, if OK, return id of created account */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_from_member($member,$login='') { + // phpcs:enable global $conf,$user,$langs; // Positionne parametres @@ -1328,14 +1330,15 @@ class User extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign rights by default * * @return integer erreur <0, si ok renvoi le nbre de droits par defaut positionnes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_default_rights() { + // phpcs:enable global $conf; $sql = "SELECT id FROM ".MAIN_DB_PREFIX."rights_def"; @@ -1663,15 +1666,16 @@ class User extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Mise a jour en base de la date de derniere connexion d'un utilisateur * Fonction appelee lors d'une nouvelle connexion * * @return <0 si echec, >=0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_last_login_date() { + // phpcs:enable $now=dol_now(); $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; @@ -1829,6 +1833,7 @@ class User extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Send new password by email * @@ -1837,9 +1842,9 @@ class User extends CommonObject * @param int $changelater 0=Send clear passwod into email, 1=Change password only after clicking on confirm email. @TODO Add method 2 = Send link to reset password * @return int < 0 si erreur, > 0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function send_password($user, $password='', $changelater=0) { + // phpcs:enable global $conf,$langs; global $dolibarr_main_url_root; @@ -1944,14 +1949,15 @@ class User extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Read clicktodial information for user * * @return <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_clicktodial() { + // phpcs:enable $sql = "SELECT url, login, pass, poste "; $sql.= " FROM ".MAIN_DB_PREFIX."user_clicktodial as u"; $sql.= " WHERE u.fk_user = ".$this->id; @@ -1981,14 +1987,15 @@ class User extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update clicktodial info * * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_clicktodial() { + // phpcs:enable $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_clicktodial"; @@ -2021,6 +2028,7 @@ class User extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add user into a group * @@ -2029,9 +2037,9 @@ class User extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetInGroup($group, $entity, $notrigger=0) { + // phpcs:enable global $conf, $langs, $user; $error=0; @@ -2082,6 +2090,7 @@ class User extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Remove a user from a group * @@ -2090,9 +2099,9 @@ class User extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function RemoveFromGroup($group, $entity, $notrigger=0) { + // phpcs:enable global $conf,$langs,$user; $error=0; @@ -2355,6 +2364,7 @@ class User extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -2362,9 +2372,9 @@ class User extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; $langs->load('users'); @@ -2402,6 +2412,7 @@ class User extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -2411,9 +2422,9 @@ class User extends CommonObject * 2=Return key only (RDN) (uid=qqq) * @return string DN */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_dn($info,$mode=0) { + // phpcs:enable global $conf; $dn=''; if ($mode==0) $dn=$conf->global->LDAP_KEY_USERS."=".$info[$conf->global->LDAP_KEY_USERS].",".$conf->global->LDAP_USER_DN; @@ -2422,14 +2433,15 @@ class User extends CommonObject return $dn; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Initialize the info array (array of LDAP values) that will be used to call LDAP functions * * @return array Tableau info des attributs */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_info() { + // phpcs:enable global $conf,$langs; $info=array(); @@ -2692,6 +2704,7 @@ class User extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update user using data from the LDAP * @@ -2699,9 +2712,9 @@ class User extends CommonObject * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_ldap2dolibarr(&$ldapuser) { + // phpcs:enable // TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?) global $user, $conf; @@ -2729,15 +2742,16 @@ class User extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return and array with all instanciated first level children users of current user * * @return void * @see getAllChildIds */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_children() { + // phpcs:enable $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user"; $sql.= " WHERE fk_user = ".$this->id; @@ -2767,8 +2781,7 @@ class User extends CommonObject * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - private function load_parentof() + private function loadParentOf() { global $conf; @@ -2780,7 +2793,7 @@ class User extends CommonObject $sql.= " WHERE fk_user <> 0"; $sql.= " AND entity IN (".getEntity('user').")"; - dol_syslog(get_class($this)."::load_parentof", LOG_DEBUG); + dol_syslog(get_class($this)."::loadParentOf", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -2797,6 +2810,7 @@ class User extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Reconstruit l'arborescence hierarchique des users sous la forme d'un tableau * Set and return this->users that is an array sorted according to tree with arrays of: @@ -2810,9 +2824,9 @@ class User extends CommonObject * @param string $filter SQL filter on users * @return array Array of users $this->users. Note: $this->parentof is also set. */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_full_tree($deleteafterid=0, $filter='') { + // phpcs:enable global $conf, $user; global $hookmanager; @@ -2822,7 +2836,7 @@ class User extends CommonObject $this->users = array(); // Init this->parentof that is array(id_son=>id_parent, ...) - $this->load_parentof(); + $this->loadParentOf(); // Init $this->users array $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.admin, u.statut, u.photo, u.entity"; // Distinct reduce pb with old tables with duplicates @@ -2941,6 +2955,7 @@ class User extends CommonObject return $childids; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * For user id_user and its childs available in this->users, define property fullpath and fullname. * Function called by get_full_tree(). @@ -2949,9 +2964,9 @@ class User extends CommonObject * @param int $protection Deep counter to avoid infinite loop (no more required, a protection is added with array useridfound) * @return int < 0 if KO (infinit loop), >= 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function build_path_from_id_user($id_user,$protection=0) { + // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_user id_user=".$id_user." protection=".$protection, LOG_DEBUG); if (! empty($this->users[$id_user]['fullpath'])) @@ -3004,14 +3019,15 @@ class User extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb pour le tableau de bord * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf; $this->nb=array(); @@ -3075,6 +3091,7 @@ class User extends CommonObject return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return property of user from its id * @@ -3082,9 +3099,9 @@ class User extends CommonObject * @param string $mode 'email' or 'mobile' * @return string Email of user with format: "Full name " */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function user_get_property($rowid,$mode) { + // phpcs:enable $user_property=''; if (empty($rowid)) return ''; From c4f05aff2866361aa90a37641d1f12a1e5109ba9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 2 Sep 2018 10:42:31 +0200 Subject: [PATCH 027/255] Standardize and update code --- htdocs/compta/bank/class/account.class.php | 32 ++--- .../bank/class/paymentvarious.class.php | 24 ++-- htdocs/contrat/class/contrat.class.php | 114 +++++++++--------- 3 files changed, 87 insertions(+), 83 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 62028804a4b..7681434bdfe 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1664,7 +1664,7 @@ class AccountLine extends CommonObject */ public $table_element='bank'; - var $picto = 'generic'; + public $picto = 'generic'; /** * @var int ID @@ -1676,32 +1676,32 @@ class AccountLine extends CommonObject */ public $ref; - var $datec; - var $dateo; + public $datec; + public $dateo; /** * Value date */ - var $datev; - var $amount; + public $datev; + public $amount; /** * @var string bank transaction lines label */ public $label; - var $note; - var $fk_user_author; - var $fk_user_rappro; - var $fk_type; - var $rappro; // Is it conciliated - var $num_releve; // If conciliated, what is bank statement - var $num_chq; // Num of cheque - var $bank_chq; // Bank of cheque - var $fk_bordereau; // Id of cheque receipt + public $note; + public $fk_user_author; + public $fk_user_rappro; + public $fk_type; + public $rappro; // Is it conciliated + public $num_releve; // If conciliated, what is bank statement + public $num_chq; // Num of cheque + public $bank_chq; // Bank of cheque + public $fk_bordereau; // Id of cheque receipt - var $fk_account; // Id of bank account - var $bank_account_label; // Label of bank account + public $fk_account; // Id of bank account + public $bank_account_label; // Label of bank account public $emetteur; diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 47e7219ea81..3a6fe74ab37 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -52,24 +52,24 @@ class PaymentVarious extends CommonObject */ public $ref; - var $tms; - var $datep; - var $datev; - var $sens; - var $amount; - var $type_payment; - var $num_payment; + public $tms; + public $datep; + public $datev; + public $sens; + public $amount; + public $type_payment; + public $num_payment; /** * @var string various payments label */ public $label; - var $accountancy_code; - var $fk_project; - var $fk_bank; - var $fk_user_author; - var $fk_user_modif; + public $accountancy_code; + public $fk_project; + public $fk_bank; + public $fk_user_author; + public $fk_user_modif; /** diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2ae8c785282..f5e03412b41 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -81,27 +81,29 @@ class Contrat extends CommonObject * Customer reference of the contract * @var string */ - var $ref_customer; + public $ref_customer; /** * Supplier reference of the contract * @var string */ - var $ref_supplier; + public $ref_supplier; /** * Client id linked to the contract * @var int */ - var $socid; - var $societe; // Objet societe + public $socid; + + public $societe; // Objet societe /** * Status of the contract * @var int */ - var $statut=0; // 0=Draft, - var $product; + public $statut=0; // 0=Draft, + + public $product; /** * @var int Id of user author of the contract @@ -128,7 +130,7 @@ class Contrat extends CommonObject /** * @var int Date of creation */ - var $date_creation; + public $date_creation; /** * @var int Date of last modification. Not filled until you call ->info() @@ -138,34 +140,34 @@ class Contrat extends CommonObject /** * @var int Date of validation */ - var $date_validation; + public $date_validation; /** * @var int Date when contract was signed */ - var $date_contrat; + public $date_contrat; /** * @var int Date of contract closure * @deprecated we close contract lines, not a contract */ - var $date_cloture; + public $date_cloture; - var $commercial_signature_id; - var $commercial_suivi_id; + public $commercial_signature_id; + public $commercial_suivi_id; /** * @deprecated Use fk_project instead * @see fk_project */ - var $fk_projet; + public $fk_projet; - var $extraparams=array(); + public $extraparams=array(); /** * @var ContratLigne[] Contract lines */ - var $lines=array(); + public $lines=array(); /** * Maps ContratLigne IDs to $this->lines indexes @@ -2492,17 +2494,19 @@ class ContratLigne extends CommonObjectLine */ public $ref; - var $tms; + public $tms; + + public $fk_contrat; + public $fk_product; + public $statut; // 0 inactive, 4 active, 5 closed + public $type; // 0 for product, 1 for service - var $fk_contrat; - var $fk_product; - var $statut; // 0 inactive, 4 active, 5 closed - var $type; // 0 for product, 1 for service /** * @var string * @deprecated */ - var $label; + public $label; + /** * @var string * @deprecated @@ -2514,31 +2518,31 @@ class ContratLigne extends CommonObjectLine */ public $description; - var $product_ref; - var $product_label; + public $product_ref; + public $product_label; - var $date_commande; + public $date_commande; - var $date_start; // date start planned - var $date_start_real; // date start real - var $date_end; // date end planned - var $date_end_real; // date end real + public $date_start; // date start planned + public $date_start_real; // date start real + public $date_end; // date end planned + public $date_end_real; // date end real // For backward compatibility - var $date_ouverture_prevue; // date start planned - var $date_ouverture; // date start real - var $date_fin_validite; // date end planned - var $date_cloture; // date end real - var $tva_tx; - var $localtax1_tx; - var $localtax2_tx; - var $localtax1_type; // Local tax 1 type - var $localtax2_type; // Local tax 2 type - var $qty; - var $remise_percent; - var $remise; - var $fk_remise_except; + public $date_ouverture_prevue; // date start planned + public $date_ouverture; // date start real + public $date_fin_validite; // date end planned + public $date_cloture; // date end real + public $tva_tx; + public $localtax1_tx; + public $localtax2_tx; + public $localtax1_type; // Local tax 1 type + public $localtax2_type; // Local tax 2 type + public $qty; + public $remise_percent; + public $remise; + public $fk_remise_except; - var $subprice; // Unit price HT + public $subprice; // Unit price HT /** * @var float @@ -2547,22 +2551,22 @@ class ContratLigne extends CommonObjectLine */ public $price; - var $price_ht; + public $price_ht; - var $total_ht; - var $total_tva; - var $total_localtax1; - var $total_localtax2; - var $total_ttc; + public $total_ht; + public $total_tva; + public $total_localtax1; + public $total_localtax2; + public $total_ttc; - var $fk_fournprice; - var $pa_ht; + public $fk_fournprice; + public $pa_ht; - var $info_bits; - var $fk_user_author; - var $fk_user_ouverture; - var $fk_user_cloture; - var $commentaire; + public $info_bits; + public $fk_user_author; + public $fk_user_ouverture; + public $fk_user_cloture; + public $commentaire; const STATUS_INITIAL = 0; const STATUS_OPEN = 4; From b60f7db60a1c979f36e3cdbc915574871ada366b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 10:43:34 +0200 Subject: [PATCH 028/255] move phpcs:ignore --- htdocs/comm/action/class/ical.class.php | 70 +++++++---- htdocs/core/class/CMailFile.class.php | 27 ++-- htdocs/core/class/antivir.class.php | 5 +- htdocs/core/class/canvas.class.php | 8 +- htdocs/ecm/class/ecmdirectory.class.php | 23 ++-- htdocs/ecm/class/ecmfiles.class.php | 9 +- .../class/companypaymentmode.class.php | 29 ++--- htdocs/societe/class/societe.class.php | 119 ++++++++++++------ htdocs/societe/class/societeaccount.class.php | 9 +- 9 files changed, 183 insertions(+), 116 deletions(-) diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index 4d8675bc8ee..d3c2070d321 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/xcal.lib.php'; /** - * Class to read/parse ICal calendars + * Class to read/parse ICal calendars */ class ICal { @@ -39,22 +39,23 @@ class ICal var $last_key; //Help variable save last key (multiline string) - /** - * Constructor - */ - public function __construct() - { - } + /** + * Constructor + */ + public function __construct() + { + } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Read text file, icalender text file * * @param string $file File * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function read_file($file) { + // phpcs:enable $this->file = $file; $file_text=''; @@ -67,25 +68,27 @@ class ICal return $file_text; // return all text } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns the number of calendar events * * @return int */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_event_count() { + // phpcs:enable return $this->event_count; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns the number of to do * * @return int */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_todo_count() { + // phpcs:enable return $this->todo_count; } @@ -197,6 +200,7 @@ class ICal return $this->cal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add to $this->ical array one value and key. * @@ -205,9 +209,9 @@ class ICal * @param string $value Value * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_array($type, $key, $value) { + // phpcs:enable //print 'type='.$type.' key='.$key.' value='.$value.'
'."\n"; @@ -258,16 +262,17 @@ class ICal $this->last_key = $key; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Parse text "XXXX:value text some with : " and return array($key = "XXXX", $value="value"); * * @param string $text Text * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function retun_key_value($text) { - /* + // phpcs:enable + /* preg_match("/([^:]+)[:]([\w\W]+)/", $text, $matches); if (empty($matches)) @@ -279,19 +284,20 @@ class ICal $matches = array_splice($matches, 1, 2); return $matches; }*/ - return explode(':',$text,2); + return explode(':',$text,2); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Parse RRULE return array * * @param string $value string * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ical_rrule($value) { - $result=array(); + // phpcs:enable + $result = array(); $rrule = explode(';',$value); foreach ($rrule as $line) { @@ -300,15 +306,17 @@ class ICal } return $result; } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return Unix time from ical date time fomrat (YYYYMMDD[T]HHMMSS[Z] or YYYYMMDD[T]HHMMSS) * * @param string $ical_date String date * @return int */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ical_date_to_unix($ical_date) { + // phpcs:enable $ical_date = str_replace('T', '', $ical_date); $ical_date = str_replace('Z', '', $ical_date); @@ -322,6 +330,7 @@ class ICal return $ntime; // ntime is a GTM time } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return unix date from iCal date format * @@ -329,10 +338,10 @@ class ICal * @param string $value Value * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ical_dt_date($key, $value) { - $return_value=array(); + // phpcs:enable + $return_value = array(); $value = $this->ical_date_to_unix($value); // Analyse TZID @@ -352,14 +361,15 @@ class ICal return array($key,$return_value); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return sorted eventlist as array or false if calenar is empty * * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_sort_event_list() { + // phpcs:enable $temp = $this->get_event_list(); if (!empty($temp)) { @@ -372,6 +382,7 @@ class ICal } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Compare two unix timestamp * @@ -379,64 +390,69 @@ class ICal * @param array $b Operand b * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ical_dtstart_compare($a, $b) { + // phpcs:enable return strnatcasecmp($a['DTSTART']['unixtime'], $b['DTSTART']['unixtime']); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return eventlist array (not sort eventlist array) * * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_event_list() { + // phpcs:enable return (! empty($this->cal['VEVENT'])?$this->cal['VEVENT']:''); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return eventlist array (not sort eventlist array) * * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_freebusy_list() { + // phpcs:enable return $this->cal['VFREEBUSY']; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return to do array (not sort to do array) * * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_todo_list() { + // phpcs:enable return $this->cal['VTODO']; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return base calendar data * * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_calender_data() { + // phpcs:enable return $this->cal['VCALENDAR']; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return array with all data * * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_all_data() { + // phpcs:enable return $this->cal; } } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 0fdd3333549..45998a78869 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -827,15 +827,16 @@ class CMailFile return '=?'.$conf->file->character_set_client.'?B?'.base64_encode($stringtoencode).'?='; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Read a file on disk and return encoded content for emails (mode = 'mail') * * @param string $sourcefile Path to file to encode * @return int <0 if KO, encoded string if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _encode_file($sourcefile) { + // phpcs:enable $newsourcefile=dol_osencode($sourcefile); if (is_readable($newsourcefile)) @@ -853,6 +854,7 @@ class CMailFile } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write content of a SMTP request into a dump file (mode = all) * Used for debugging. @@ -860,9 +862,9 @@ class CMailFile * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function dump_mail() { + // phpcs:enable global $conf,$dolibarr_main_data_root; if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir @@ -947,14 +949,15 @@ class CMailFile } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create SMTP headers (mode = 'mail') * * @return string headers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_smtpheaders() { + // phpcs:enable global $conf; $out = ""; @@ -1010,6 +1013,7 @@ class CMailFile } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create header MIME (mode = 'mail') * @@ -1017,9 +1021,9 @@ class CMailFile * @param array $mimefilename_list Array of mime types * @return string mime headers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_mimeheaders($filename_list, $mimefilename_list) { + // phpcs:enable $mimedone=0; $out = ""; @@ -1040,15 +1044,16 @@ class CMailFile return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return email content (mode = 'mail') * * @param string $msgtext Message string * @return string String content */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_body($msgtext) { + // phpcs:enable global $conf; $out=''; @@ -1141,6 +1146,7 @@ class CMailFile return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Attach file to email (mode = 'mail') * @@ -1149,9 +1155,9 @@ class CMailFile * @param array $mimefilename_list Tableau * @return string Chaine fichiers encodes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_files($filename_list,$mimetype_list,$mimefilename_list) { + // phpcs:enable $out = ''; $filename_list_size=count($filename_list); @@ -1189,15 +1195,16 @@ class CMailFile } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Attach an image to email (mode = 'mail') * * @param array $images_list Tableau * @return string Chaine images encodees */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_images($images_list) { + // phpcs:enable $out = ''; if ($images_list) @@ -1221,6 +1228,7 @@ class CMailFile } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Try to create a socket connection * @@ -1228,9 +1236,9 @@ class CMailFile * @param int $port Example: 25, 465 * @return int Socket id if ok, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function check_server_port($host,$port) { + // phpcs:enable global $conf; $_retVal=0; @@ -1285,6 +1293,7 @@ class CMailFile return $_retVal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This function has been modified as provided by SirSir to allow multiline responses when * using SMTP Extensions. @@ -1293,9 +1302,9 @@ class CMailFile * @param string $response Response string * @return boolean true if success */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function server_parse($socket, $response) { + // phpcs:enable $_retVal = true; // Indicates if Object was created or not $server_response = ''; diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php index e1a50c63083..d18501d54d9 100644 --- a/htdocs/core/class/antivir.class.php +++ b/htdocs/core/class/antivir.class.php @@ -41,7 +41,7 @@ class AntiVir public $errors = array(); var $output; - + /** * @var DoliDB Database handler. */ @@ -57,6 +57,7 @@ class AntiVir $this->db=$db; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Scan a file with antivirus. * This function runs the command defined in setup. This antivirus command must return 0 if OK. @@ -65,9 +66,9 @@ class AntiVir * @param string $file File to scan * @return int <0 if KO (-98 if error, -99 if virus), 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function dol_avscan_file($file) { + // phpcs:enable global $conf; $return = 0; diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index c65b2ba6fe1..a4665701661 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -32,7 +32,7 @@ class Canvas * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -133,6 +133,7 @@ class Canvas //print ' => template_dir='.$this->template_dir.'
'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Shared method for canvas to assign values for templates * @@ -141,9 +142,9 @@ class Canvas * @param string $ref Object ref (if id not provided) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action='view', $id=0, $ref='') { + // phpcs:enable if (method_exists($this->control,'assign_values')) $this->control->assign_values($action, $id, $ref); } @@ -161,6 +162,7 @@ class Canvas else return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Display a canvas page. This will include the template for output. * Variables used by templates may have been defined or loaded before into the assign_values function. @@ -168,9 +170,9 @@ class Canvas * @param string $action Action code * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function display_canvas($action) { + // phpcs:enable global $db, $conf, $langs, $user, $canvas; global $form, $formfile; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 6393d201188..349cea676f1 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -31,12 +31,12 @@ class EcmDirectory // extends CommonObject * @var string ID to identify managed object */ public $element='ecm_directories'; - + /** * @var string Name of table without prefix where object is stored */ //public $table_element='ecm_directories'; - + var $picto = 'dir'; /** @@ -48,7 +48,7 @@ class EcmDirectory // extends CommonObject * @var string proper name for given parameter */ public $label; - + var $fk_parent; var $description; var $cachenbofdoc=-1; // By default cache initialized with value 'not calculated' @@ -70,7 +70,7 @@ class EcmDirectory // extends CommonObject * @var string Error code (or message) */ public $error; - + /** * @var string[] Error codes (or messages) */ @@ -512,14 +512,15 @@ class EcmDirectory // extends CommonObject return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load this->motherof that is array(id_son=>id_parent, ...) * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_motherof() { + // phpcs:enable global $conf; $this->motherof=array(); @@ -560,6 +561,7 @@ class EcmDirectory // extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -567,14 +569,15 @@ class EcmDirectory // extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Reconstruit l'arborescence des categories sous la forme d'un tableau à partir de la base de donnée * Renvoi un tableau de tableau('id','id_mere',...) trie selon arbre et avec: @@ -594,9 +597,9 @@ class EcmDirectory // extends CommonObject * @param int $force Force reload of full arbo even if already loaded in cache $this->cats * @return array Tableau de array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_full_arbo($force=0) { + // phpcs:enable global $conf; if (empty($force) && ! empty($this->full_arbo_loaded)) @@ -676,6 +679,7 @@ class EcmDirectory // extends CommonObject return $this->cats; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define properties fullpath, fullrelativename, fulllabel of a directory of array this->cats and all its childs. * Separator between directories is always '/', whatever is OS. @@ -684,9 +688,9 @@ class EcmDirectory // extends CommonObject * @param int $protection Deep counter to avoid infinite loop * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function build_path_from_id_categ($id_categ,$protection=0) { + // phpcs:enable // Define fullpath if (! empty($this->cats[$id_categ]['id_mere'])) { @@ -761,6 +765,7 @@ class EcmDirectory // extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Call trigger based on this instance * @@ -772,9 +777,9 @@ class EcmDirectory // extends CommonObject * @param User $user Object user * @return int Result of run_triggers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function call_trigger($trigger_name, $user) { + // phpcs:enable global $langs,$conf; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 95d4b42a4b6..38d155f3328 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -40,12 +40,12 @@ class EcmFiles extends CommonObject * @var string Id to identify managed objects */ public $element = 'ecmfiles'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'ecm_files'; - + public $picto = 'generic'; public $ref; // hash of file path @@ -68,7 +68,7 @@ class EcmFiles extends CommonObject public $acl; public $src_object_type; public $src_object_id; - + /** * Constructor @@ -779,6 +779,7 @@ class EcmFiles extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -786,9 +787,9 @@ class EcmFiles extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; return ''; } diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 4f3b666049b..7ff2e2de6f9 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -36,22 +36,22 @@ class CompanyPaymentMode extends CommonObject * @var string ID to identify managed object */ public $element = 'companypaymentmode'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'societe_rib'; - + /** * @var int Does companypaymentmode support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 2; - + /** * @var int Does companypaymentmode support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 0; - + /** * @var string String with name of icon for companypaymentmode. Must be the part after the 'object_' into object_companypaymentmode.png */ @@ -452,6 +452,7 @@ class CompanyPaymentMode extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -459,43 +460,37 @@ class CompanyPaymentMode extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; - if ($mode == 0) - { - $prefix=''; - if ($status == 1) return $langs->trans('Enabled'); - if ($status == 0) return $langs->trans('Disabled'); - } - if ($mode == 1) + if ($mode == 0 || $mode == 1) { if ($status == 1) return $langs->trans('Enabled'); if ($status == 0) return $langs->trans('Disabled'); } - if ($mode == 2) + elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 3) + elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 5) + elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 6) + elseif ($mode == 6) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 5c15f82952f..2cd3ba2f6d8 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -571,15 +571,16 @@ class Societe extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a contact/address from thirdparty * * @param User $user Object user * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_individual(User $user) { + // phpcs:enable require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $contact=new Contact($this->db); @@ -1475,14 +1476,15 @@ class Societe extends CommonObject return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define third party as a customer * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_as_client() { + // phpcs:enable if ($this->id) { $newclient=1; @@ -1502,6 +1504,7 @@ class Societe extends CommonObject return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Definit la societe comme un client * @@ -1510,9 +1513,9 @@ class Societe extends CommonObject * @param User $user Utilisateur qui definie la remise * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_client($remise, $note, User $user) { + // phpcs:enable global $conf, $langs; // Nettoyage parametres @@ -1564,6 +1567,7 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Definit la societe comme un client * @@ -1572,9 +1576,9 @@ class Societe extends CommonObject * @param User $user Utilisateur qui definie la remise * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_supplier($remise, $note, User $user) { + // phpcs:enable global $conf, $langs; // Nettoyage parametres @@ -1626,6 +1630,7 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add a discount for third party * @@ -1636,9 +1641,9 @@ class Societe extends CommonObject * @param int $discount_type 0 => customer discount, 1 => supplier discount * @return int <0 if KO, id of discount record if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_except($remise, User $user, $desc, $tva_tx=0, $discount_type=0) { + // phpcs:enable global $langs; // Clean parameters @@ -1771,6 +1776,7 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set the price level * @@ -1778,9 +1784,9 @@ class Societe extends CommonObject * @param User $user Use making change * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_price_level($price_level, User $user) { + // phpcs:enable if ($this->id) { $now=dol_now(); @@ -1809,6 +1815,7 @@ class Societe extends CommonObject return -1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add link to sales representative * @@ -1816,14 +1823,12 @@ class Societe extends CommonObject * @param int $commid Id of user * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_commercial(User $user, $commid) { + // phpcs:enable $error=0; - - if ($this->id > 0 && $commid > 0) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux"; @@ -1848,6 +1853,7 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add link to sales representative * @@ -1855,9 +1861,9 @@ class Societe extends CommonObject * @param int $commid Id of user * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function del_commercial(User $user, $commid) { + // phpcs:enable $error=0; $this->context=array('commercial_modified'=>$commid); @@ -2069,6 +2075,7 @@ class Societe extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -2076,9 +2083,9 @@ class Societe extends CommonObject * @param int $mode 0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto, 6=Long label + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; $langs->load('companies'); @@ -2119,15 +2126,16 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of contacts emails existing for third party * * @param int $addthirdparty 1=Add also a record for thirdparty email * @return array Array of contacts emails */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function thirdparty_and_contact_email_array($addthirdparty=0) { + // phpcs:enable global $langs; $contact_emails = $this->contact_property_array('email',1); @@ -2140,14 +2148,15 @@ class Societe extends CommonObject return $contact_emails; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of contacts mobile phone existing for third party * * @return array Array of contacts emails */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function thirdparty_and_contact_phone_array() { + // phpcs:enable global $langs; $contact_phone = $this->contact_property_array('mobile'); @@ -2161,6 +2170,7 @@ class Societe extends CommonObject return $contact_phone; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of contacts emails or mobile existing for third party * @@ -2168,9 +2178,9 @@ class Societe extends CommonObject * @param int $hidedisabled 1=Hide contact if disabled * @return array Array of contacts emails or mobile. Example: array(id=>'Name ') */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function contact_property_array($mode='email', $hidedisabled=0) { + // phpcs:enable global $langs; $contact_property = array(); @@ -2230,14 +2240,15 @@ class Societe extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la liste des contacts de cette societe * * @return array tableau des contacts */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function contact_array() { + // phpcs:enable $contacts = array(); $sql = "SELECT rowid, lastname, firstname FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$this->id; @@ -2263,14 +2274,15 @@ class Societe extends CommonObject return $contacts; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la liste des contacts de cette societe * * @return array $contacts tableau des contacts */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function contact_array_objects() { + // phpcs:enable require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; $contacts = array(); @@ -2299,6 +2311,7 @@ class Societe extends CommonObject return $contacts; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return property of contact from its id * @@ -2306,9 +2319,9 @@ class Societe extends CommonObject * @param string $mode 'email' or 'mobile' * @return string Email of contact with format: "Full name " */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function contact_get_property($rowid,$mode) { + // phpcs:enable $contact_property=''; if (empty($rowid)) return ''; @@ -2338,15 +2351,16 @@ class Societe extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return bank number property of thirdparty (label or rum) * * @param string $mode 'label' or 'rum' or 'format' * @return string Bank number */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function display_rib($mode='label') { + // phpcs:enable require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; $bac = new CompanyBankAccount($this->db); @@ -2375,14 +2389,15 @@ class Societe extends CommonObject return 'BadParameterToFunctionDisplayRib'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return Array of RIB * * @return array|int 0 if KO, Array of CompanyBanckAccount if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_all_rib() { + // phpcs:enable require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php'; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib WHERE type='ban' AND fk_soc = ".$this->id; $result = $this->db->query($sql); @@ -2404,6 +2419,7 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Attribut un code client a partir du module de controle des codes. * Return value is stored into this->code_client @@ -2412,9 +2428,9 @@ class Societe extends CommonObject * @param int $type Should be 0 to say customer * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_codeclient($objsoc=0,$type=0) { + // phpcs:enable global $conf; if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) { @@ -2435,6 +2451,7 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Attribut un code fournisseur a partir du module de controle des codes. * Return value is stored into this->code_fournisseur @@ -2443,9 +2460,9 @@ class Societe extends CommonObject * @param int $type Should be 1 to say supplier * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_codefournisseur($objsoc=0,$type=1) { + // phpcs:enable global $conf; if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) { @@ -2465,15 +2482,16 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Verifie si un code client est modifiable en fonction des parametres * du module de controle des codes. * * @return int 0=No, 1=Yes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function codeclient_modifiable() { + // phpcs:enable global $conf; if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) { @@ -2501,14 +2519,15 @@ class Societe extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Verifie si un code fournisseur est modifiable dans configuration du module de controle des codes * * @return int 0=No, 1=Yes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function codefournisseur_modifiable() { + // phpcs:enable global $conf; if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) { @@ -2536,6 +2555,7 @@ class Societe extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Check customer code * @@ -2545,9 +2565,9 @@ class Societe extends CommonObject * -3 ErrorCustomerCodeAlreadyUsed * -4 ErrorPrefixRequired */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function check_codeclient() { + // phpcs:enable global $conf; if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) { @@ -2572,6 +2592,7 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Check supplier code * @@ -2581,9 +2602,9 @@ class Societe extends CommonObject * -3 ErrorCustomerCodeAlreadyUsed * -4 ErrorPrefixRequired */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function check_codefournisseur() { + // phpcs:enable global $conf; if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) { @@ -2608,6 +2629,7 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie un code compta, suivant le module de code compta. * Peut etre identique a celui saisit ou genere automatiquement. @@ -2616,9 +2638,9 @@ class Societe extends CommonObject * @param string $type Type of thirdparty ('customer' or 'supplier') * @return string Code compta si ok, 0 si aucun, <0 si ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_codecompta($type) { + // phpcs:enable global $conf; if (! empty($conf->global->SOCIETE_CODECOMPTA_ADDON)) @@ -2659,15 +2681,16 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define parent commany of current company * * @param int $id Id of thirdparty to set or '' to remove * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_parent($id) { + // phpcs:enable if ($this->id) { $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; @@ -2688,15 +2711,16 @@ class Societe extends CommonObject else return -1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns if a profid sould be verified * * @param int $idprof 1,2,3,4,5,6 (Exemple: 1=siren,2=siret,3=naf,4=rcs/rm,5=idprof5,6=idprof6) * @return boolean true , false */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function id_prof_verifiable($idprof) { + // phpcs:enable global $conf; switch($idprof) @@ -2726,6 +2750,7 @@ class Societe extends CommonObject return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Verify if a profid exists into database for others thirds * @@ -2734,9 +2759,9 @@ class Societe extends CommonObject * @param int $socid Id of thirdparty to exclude (if update) * @return boolean True if exists, False if not */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function id_prof_exists($idprof, $value, $socid=0) { + // phpcs:enable $field = $idprof; switch($idprof) // For backward compatibility @@ -2785,6 +2810,7 @@ class Societe extends CommonObject else return false; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Verifie la validite d'un identifiant professionnel en fonction du pays de la societe (siren, siret, ...) * @@ -2793,9 +2819,9 @@ class Societe extends CommonObject * @return int <=0 if KO, >0 if OK * TODO better to have this in a lib than into a business class */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function id_prof_check($idprof,$soc) { + // phpcs:enable global $conf; $ok=1; @@ -2935,6 +2961,7 @@ class Societe extends CommonObject return $ok; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return an url to check online a professional id or empty string * @@ -2943,9 +2970,9 @@ class Societe extends CommonObject * @return string Url or empty string if no URL known * TODO better in a lib than into business class */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function id_prof_url($idprof,$thirdparty) { + // phpcs:enable global $conf,$langs,$hookmanager; $url=''; @@ -2988,14 +3015,15 @@ class Societe extends CommonObject return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Indique si la societe a des projets * * @return bool true si la societe a des projets, false sinon */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function has_projects() { + // phpcs:enable $sql = 'SELECT COUNT(*) as numproj FROM '.MAIN_DB_PREFIX.'projet WHERE fk_soc = ' . $this->id; $resql = $this->db->query($sql); if ($resql) @@ -3090,14 +3118,15 @@ class Societe extends CommonObject return isInEEC($this); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge la liste des categories fournisseurs * * @return int 0 if success, <> 0 if error */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LoadSupplierCateg() { + // phpcs:enable $this->SupplierCategories = array(); $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie"; @@ -3118,15 +3147,16 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Insert link supplier - category * * @param int $categorie_id Id of category * @return int 0 if success, <> 0 if error */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function AddFournisseurInCategory($categorie_id) { + // phpcs:enable if ($categorie_id > 0 && $this->id > 0) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_fournisseur (fk_categorie, fk_soc) "; @@ -3142,6 +3172,7 @@ class Societe extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a third party into database from a member object * @@ -3150,9 +3181,9 @@ class Societe extends CommonObject * @param string $socalias Alias name of third party to force * @return int <0 if KO, id of created account if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_from_member(Adherent $member, $socname='', $socalias='') { + // phpcs:enable global $user,$langs; dol_syslog(get_class($this)."::create_from_member", LOG_DEBUG); @@ -3419,15 +3450,16 @@ class Societe extends CommonObject return $this->LibProspLevel($this->fk_prospectlevel); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of prospect level * * @param int $fk_prospectlevel Prospect level * @return string label of level */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibProspLevel($fk_prospectlevel) { + // phpcs:enable global $langs; $lib=$langs->trans("ProspectLevel".$fk_prospectlevel); @@ -3440,6 +3472,7 @@ class Societe extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set prospect level * @@ -3447,9 +3480,9 @@ class Societe extends CommonObject * @return int <0 if KO, >0 if OK * @deprecated Use update function instead */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_prospect_level(User $user) { + // phpcs:enable return $this->update($this->id, $user); } @@ -3465,6 +3498,7 @@ class Societe extends CommonObject return $this->LibProspCommStatut($this->stcomm_id, $mode, $label); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a given status * @@ -3473,9 +3507,9 @@ class Societe extends CommonObject * @param string $label Label to use for status for added status * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibProspCommStatut($statut, $mode=0, $label='') { + // phpcs:enable global $langs; $langs->load('customers'); @@ -3519,6 +3553,7 @@ class Societe extends CommonObject return "Error, mode/status not found"; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set outstanding value * @@ -3526,9 +3561,9 @@ class Societe extends CommonObject * @return int <0 if KO, >0 if OK * @deprecated Use update function instead */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_OutstandingBill(User $user) { + // phpcs:enable return $this->update($this->id, $user); } @@ -3685,15 +3720,16 @@ class Societe extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return amount of bill not paid * * @return int Amount in debt for thirdparty * @deprecated */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_OutstandingBill() { + // phpcs:enable /* Accurate value of remain to pay is to sum remaintopay for each invoice $paiement = $invoice->getSommePaiement(); $creditnotes=$invoice->getSumCreditNotesUsed(); @@ -3739,15 +3775,16 @@ class Societe extends CommonObject return $this->LibCustProspStatut($this->client); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * * @param int $statut Id statut * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibCustProspStatut($statut) { + // phpcs:enable global $langs; $langs->load('companies'); diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index e6aabf68f6d..61e7303a35b 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -39,17 +39,17 @@ class SocieteAccount extends CommonObject * @var string ID to identify managed object */ public $element = 'societeaccount'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'societe_account'; - + /** * @var array Does societeaccount support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; - + /** * @var string String with name of icon for societeaccount. Must be the part after the 'object_' into object_myobject.png */ @@ -395,6 +395,7 @@ class SocieteAccount extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -402,9 +403,9 @@ class SocieteAccount extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) From 3de16a145e8b9a6aee84348bd2c8084fbc7f3612 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 2 Sep 2018 11:08:41 +0200 Subject: [PATCH 029/255] Standardize and update code --- htdocs/comm/propal/class/propal.class.php | 3 + htdocs/commande/class/commande.class.php | 13 +++ .../deplacement/class/deplacement.class.php | 21 +++-- .../facture/class/facture-rec.class.php | 41 +++++---- htdocs/compta/facture/class/facture.class.php | 8 ++ htdocs/contrat/class/contrat.class.php | 3 + htdocs/core/class/commonobject.class.php | 7 +- htdocs/core/class/fiscalyear.class.php | 3 + htdocs/expedition/class/expedition.class.php | 70 ++++++++------- htdocs/fichinter/class/fichinter.class.php | 7 ++ .../class/fournisseur.commande.class.php | 21 ++++- .../fourn/class/fournisseur.facture.class.php | 8 +- htdocs/hrm/class/establishment.class.php | 3 + htdocs/livraison/class/livraison.class.php | 7 +- htdocs/projet/class/project.class.php | 49 ++++++----- .../class/supplier_proposal.class.php | 88 +++++++++++-------- 16 files changed, 226 insertions(+), 126 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 4957bf3e764..a3e1ec42bf7 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -55,6 +55,9 @@ class Propal extends CommonObject */ public $table_element='propal'; + /** + * @var int Name of subtable line + */ public $table_element_line='propaldet'; /** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 380d26f2496..cfc1a38fef6 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -52,7 +52,11 @@ class Commande extends CommonOrder */ public $table_element='commande'; + /** + * @var int Name of subtable line + */ public $table_element_line = 'commandedet'; + public $class_element_line = 'OrderLine'; /** @@ -61,11 +65,13 @@ class Commande extends CommonOrder public $fk_element = 'fk_commande'; public $picto = 'order'; + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -92,6 +98,7 @@ class Commande extends CommonOrder * @var int */ public $statut; + /** * Billed * @var int @@ -114,21 +121,25 @@ class Commande extends CommonOrder * @var int */ public $mode_reglement_id; + /** * Payment mode code * @var string */ public $mode_reglement_code; + /** * Availability delivery time id * @var int */ public $availability_id; + /** * Availability delivery time code * @var string */ public $availability_code; + /** * Label of availability delivery time. Use it in case translation cannot be found. * @var string @@ -138,11 +149,13 @@ class Commande extends CommonOrder public $demand_reason_id; // Source reason. Why we receive order (after a phone campaign, ...) public $demand_reason_code; public $date; // Date commande + /** * @deprecated * @see date */ public $date_commande; + public $date_livraison; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) public $fk_remise_except; public $remise_percent; diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index 0600a141308..1456d29e0d1 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -41,6 +41,9 @@ class Deplacement extends CommonObject */ public $table_element='deplacement'; + /** + * @var int Name of subtable line + */ public $table_element_line = ''; /** @@ -50,22 +53,22 @@ class Deplacement extends CommonObject public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $datec; // Creation date - var $dated; - var $fk_user_author; + public $datec; // Creation date + public $dated; + public $fk_user_author; /** * @var int User ID */ public $fk_user; - var $km; - var $socid; - var $statut; // 0=draft, 1=validated - var $extraparams=array(); + public $km; + public $socid; + public $statut; // 0=draft, 1=validated + public $extraparams=array(); - var $statuts=array(); - var $statuts_short=array(); + public $statuts=array(); + public $statuts_short=array(); /** * Constructor diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 6e61b55e2ba..012dac4a274 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -49,6 +49,9 @@ class FactureRec extends CommonInvoice */ public $table_element='facture_rec'; + /** + * @var int Name of subtable line + */ public $table_element_line='facturedet_rec'; /** @@ -58,30 +61,30 @@ class FactureRec extends CommonInvoice public $picto='bill'; - var $entity; - var $number; - var $date; - var $amount; - var $remise; - var $tva; - var $total; - var $db_table; - var $propalid; + public $entity; + public $number; + public $date; + public $amount; + public $remise; + public $tva; + public $total; + public $db_table; + public $propalid; - var $date_last_gen; - var $date_when; - var $nb_gen_done; - var $nb_gen_max; + public $date_last_gen; + public $date_when; + public $nb_gen_done; + public $nb_gen_max; - var $frequency; - var $unit_frequency; + public $frequency; + public $unit_frequency; - var $rang; - var $special_code; + public $rang; + public $special_code; - var $usenewprice=0; + public $usenewprice=0; - var $suspended; // status + public $suspended; // status const STATUS_NOTSUSPENDED = 0; const STATUS_SUSPENDED = 1; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index cb705e063db..3ae11078b67 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -63,6 +63,9 @@ class Facture extends CommonInvoice */ public $table_element='facture'; + /** + * @var int Name of subtable line + */ public $table_element_line = 'facturedet'; /** @@ -71,11 +74,13 @@ class Facture extends CommonInvoice public $fk_element = 'fk_facture'; public $picto='bill'; + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -125,14 +130,17 @@ class Facture extends CommonInvoice public $cond_reglement_code; // Code in llx_c_paiement public $mode_reglement_code; // Code in llx_c_paiement public $fk_bank; // Field to store bank id to use when payment mode is withdraw + /** * @deprecated */ public $products=array(); + /** * @var FactureLigne[] */ public $lines=array(); + public $line; public $extraparams=array(); public $specimen; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index f5e03412b41..053d51905df 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -51,6 +51,9 @@ class Contrat extends CommonObject */ public $table_element='contrat'; + /** + * @var int Name of subtable line + */ public $table_element_line='contratdet'; /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a00f91ac5bc..d9053cce731 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -73,9 +73,9 @@ abstract class CommonObject public $table_element; /** - * @var + * @var int Name of subtable line */ - public $table_element_line; + public $table_element_line=''; /** * @var string Key value used to track if data is coming from import wizard @@ -168,6 +168,7 @@ abstract class CommonObject * @see fetch_origin() */ public $origin; + /** * @var int The id of originating object * @see fetch_origin() @@ -6175,7 +6176,7 @@ abstract class CommonObject { //Show only the key field in params if (is_array($params) && array_key_exists('onlykey',$params) && $key != $params['onlykey']) continue; - + $enabled = 1; if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) { diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index dc6bc5d0310..f6ba7c00088 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -38,6 +38,9 @@ class Fiscalyear extends CommonObject */ public $table_element='accounting_fiscalyear'; + /** + * @var int Name of subtable line + */ public $table_element_line = ''; /** diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 8a46f14c829..4c337825822 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -48,61 +48,69 @@ class Expedition extends CommonObject * @var string ID to identify managed object */ public $element="shipping"; - + public $fk_element="fk_expedition"; - + /** * @var string Name of table without prefix where object is stored */ public $table_element="expedition"; - + + /** + * @var int Name of subtable line + */ public $table_element_line="expeditiondet"; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'sending'; - var $socid; - var $ref_customer; - var $ref_int; - var $brouillon; - var $entrepot_id; - var $lines=array(); - var $tracking_number; - var $tracking_url; - var $billed; - var $model_pdf; + public $socid; + public $ref_customer; + public $ref_int; + public $brouillon; + public $entrepot_id; + public $lines=array(); + public $tracking_number; + public $tracking_url; + public $billed; + public $model_pdf; - var $trueWeight; - var $weight_units; - var $trueWidth; - var $width_units; - var $trueHeight; - var $height_units; - var $trueDepth; - var $depth_units; + public $trueWeight; + public $weight_units; + public $trueWidth; + public $width_units; + public $trueHeight; + public $height_units; + public $trueDepth; + public $depth_units; // A denormalized value - var $trueSize; + public $trueSize; + + public $date_delivery; // Date delivery planed - var $date_delivery; // Date delivery planed /** * @deprecated * @see date_shipping */ - var $date; + public $date; + /** * @deprecated * @see date_shipping */ - var $date_expedition; + public $date_expedition; + /** * Effective delivery date * @var int */ public $date_shipping; - var $date_creation; - var $date_valid; - var $meths; - var $listmeths; // List of carriers + public $date_creation; + public $date_valid; + + public $meths; + public $listmeths; // List of carriers const STATUS_DRAFT = 0; @@ -478,7 +486,7 @@ class Expedition extends CommonObject $sql.= ", e.note_private, e.note_public"; $sql.= ', e.fk_incoterms, e.location_incoterms'; $sql.= ', i.libelle as libelle_incoterms'; - $sql.= ', s.libelle as shipping_method'; + $sql.= ', s.libelle as shipping_method'; $sql.= ", el.fk_source as origin_id, el.sourcetype as origin"; $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = e.rowid AND el.targettype = '".$this->db->escape($this->element)."'"; @@ -2293,7 +2301,7 @@ class ExpeditionLigne extends CommonObjectLine * @var string ID to identify managed object */ public $element='expeditiondet'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 2d879a1d17f..bce5f81c339 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -50,7 +50,11 @@ class Fichinter extends CommonObject */ public $fk_element='fk_fichinter'; + /** + * @var int Name of subtable line + */ public $table_element_line='fichinterdet'; + public $picto = 'intervention'; /** @@ -85,14 +89,17 @@ class Fichinter extends CommonObject * Draft status */ const STATUS_DRAFT = 0; + /** * Validated status */ const STATUS_VALIDATED = 1; + /** * Billed */ const STATUS_BILLED = 2; + /** * Closed */ diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 6768097f7c1..4b9e5532c28 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -4,11 +4,11 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2010-2014 Juanjo Menent - * Copyright (C) 2010-2016 Philippe Grand + * Copyright (C) 2010-2018 Philippe Grand * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Nicolas ZABOURI * * 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 @@ -50,7 +50,10 @@ class CommandeFournisseur extends CommonOrder */ public $table_element='commande_fournisseur'; - public $table_element_line = 'commande_fournisseurdet'; + /** + * @var int Name of subtable line + */ + public $table_element_line = 'commande_fournisseurdet'; /** * @var int Field with ID of parent key if this field has a parent @@ -108,17 +111,20 @@ class CommandeFournisseur extends CommonOrder * Delivery date */ public $date_livraison; + public $total_ht; public $total_tva; public $total_localtax1; // Total Local tax 1 public $total_localtax2; // Total Local tax 2 public $total_ttc; public $source; + /** * @deprecated * @see note_private, note_public */ public $note; + public $note_private; public $note_public; public $model_pdf; @@ -144,6 +150,7 @@ class CommandeFournisseur extends CommonOrder * @var CommandeFournisseurLigne[] */ public $lines = array(); + //Add for supplier_proposal public $origin; public $origin_id; @@ -161,34 +168,42 @@ class CommandeFournisseur extends CommonOrder * Draft status */ const STATUS_DRAFT = 0; + /** * Validated status */ const STATUS_VALIDATED = 1; + /** * Accepted */ const STATUS_ACCEPTED = 2; + /** * Order sent, shipment on process */ const STATUS_ORDERSENT = 3; + /** * Received partially */ const STATUS_RECEIVED_PARTIALLY = 4; + /** * Received completely */ const STATUS_RECEIVED_COMPLETELY = 5; + /** * Order canceled */ const STATUS_CANCELED = 6; + /** * Order canceled/never received */ const STATUS_CANCELED_AFTER_ORDER = 7; + /** * Refused */ diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 3633325fdcb..2381417596f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Marc Barilley * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2017 Juanjo Menent - * Copyright (C) 2013 Philippe Grand + * Copyright (C) 2013-2018 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Bahfir Abbes @@ -51,7 +51,10 @@ class FactureFournisseur extends CommonInvoice */ public $table_element='facture_fourn'; - public $table_element_line='facture_fourn_det'; + /** + * @var int Name of subtable line + */ + public $table_element_line='facture_fourn_det'; /** * @var int Field with ID of parent key if this field has a parent @@ -144,6 +147,7 @@ class FactureFournisseur extends CommonInvoice * @var SupplierInvoiceLine[] */ public $lines = array(); + /** * @deprecated */ diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 0b163af9346..4038c5b16b5 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -38,6 +38,9 @@ class Establishment extends CommonObject */ public $table_element='establishment'; + /** + * @var int Name of subtable line + */ public $table_element_line = ''; /** diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 6252c1948c4..a56091870ce 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -3,8 +3,8 @@ * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006-2007 Laurent Destailleur * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2011-2018 Philippe Grand - * Copyright (C) 2013 Florian Henry + * Copyright (C) 2011-2018 Philippe Grand + * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García * * This program is free software; you can redistribute it and/or modify @@ -54,6 +54,9 @@ class Livraison extends CommonObject */ public $table_element="livraison"; + /** + * @var int Name of subtable line + */ public $table_element_line="livraisondet"; public $brouillon; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 41ea4ead700..158215e9935 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -43,7 +43,10 @@ class Project extends CommonObject */ public $table_element = 'projet'; - public $table_element_line = 'projet_task'; + /** + * @var int Name of subtable line + */ + public $table_element_line = 'projet_task'; /** * @var int Field with ID of parent key if this field has a parent @@ -69,31 +72,32 @@ class Project extends CommonObject * @see title */ public $titre; - var $title; - var $date_start; - var $date_end; - var $date_close; - var $socid; // To store id of thirdparty - var $thirdparty_name; // To store name of thirdparty (defined only in some cases) + public $title; + public $date_start; + public $date_end; + public $date_close; - var $user_author_id; //!< Id of project creator. Not defined if shared project. - var $user_close_id; - var $public; //!< Tell if this is a public or private project - var $budget_amount; - var $bill_time; // Is the time spent on project must be invoiced or not + public $socid; // To store id of thirdparty + public $thirdparty_name; // To store name of thirdparty (defined only in some cases) - var $statuts_short; - var $statuts_long; + public $user_author_id; //!< Id of project creator. Not defined if shared project. + public $user_close_id; + public $public; //!< Tell if this is a public or private project + public $budget_amount; + public $bill_time; // Is the time spent on project must be invoiced or not - var $statut; // 0=draft, 1=opened, 2=closed - var $opp_status; // opportunity status, into table llx_c_lead_status - var $opp_percent; // opportunity probability + public $statuts_short; + public $statuts_long; - var $oldcopy; + public $statut; // 0=draft, 1=opened, 2=closed + public $opp_status; // opportunity status, into table llx_c_lead_status + public $opp_percent; // opportunity probability - var $weekWorkLoad; // Used to store workload details of a projet - var $weekWorkLoadPerTask; // Used to store workload details of tasks of a projet + public $oldcopy; + + public $weekWorkLoad; // Used to store workload details of a projet + public $weekWorkLoadPerTask; // Used to store workload details of tasks of a projet /** * @var int Creation date @@ -101,16 +105,19 @@ class Project extends CommonObject * @see date_c */ public $datec; + /** * @var int Creation date */ public $date_c; + /** * @var int Modification date * @deprecated * @see date_m */ public $datem; + /** * @var int Modification date */ @@ -125,10 +132,12 @@ class Project extends CommonObject * Draft status */ const STATUS_DRAFT = 0; + /** * Open/Validated status */ const STATUS_VALIDATED = 1; + /** * Closed status */ diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 547e9e9efcf..b79a70a4ea7 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2015 Juanjo Menent - * Copyright (C) 2010-2011 Philippe Grand + * Copyright (C) 2010-2018 Philippe Grand * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Marcos García @@ -55,14 +55,21 @@ class SupplierProposal extends CommonObject */ public $table_element='supplier_proposal'; - public $table_element_line='supplier_proposaldet'; + /** + * @var int Name of subtable line + */ + public $table_element_line='supplier_proposaldet'; + public $fk_element='fk_supplier_proposal'; + public $picto='propal'; + /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int */ public $ismultientitymanaged = 1; + /** * 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user * @var integer @@ -74,24 +81,25 @@ class SupplierProposal extends CommonObject */ protected $table_ref_field = 'ref'; - var $socid; // Id client + public $socid; // Id client /** * @deprecated * @see user_author_id */ - var $author; - var $ref_fourn; //Reference saisie lors de l'ajout d'une ligne à la demande - var $ref_supplier; //Reference saisie lors de l'ajout d'une ligne à la demande - var $statut; // 0 (draft), 1 (validated), 2 (signed), 3 (not signed), 4 (processed/billed) - var $date; // Date of proposal - var $date_livraison; + public $author; + + public $ref_fourn; //Reference saisie lors de l'ajout d'une ligne à la demande + public $ref_supplier; //Reference saisie lors de l'ajout d'une ligne à la demande + public $statut; // 0 (draft), 1 (validated), 2 (signed), 3 (not signed), 4 (processed/billed) + public $date; // Date of proposal + public $date_livraison; /** * @deprecated * @see date_creation */ - var $datec; + public $datec; /** * Creation date @@ -103,7 +111,7 @@ class SupplierProposal extends CommonObject * @deprecated * @see date_validation */ - var $datev; + public $datev; /** * Validation date @@ -112,70 +120,76 @@ class SupplierProposal extends CommonObject public $date_validation; - var $user_author_id; - var $user_valid_id; - var $user_close_id; + public $user_author_id; + public $user_valid_id; + public $user_close_id; /** * @deprecated * @see price_ht */ - var $price; + public $price; + /** * @deprecated * @see total_tva */ - var $tva; + public $tva; + /** * @deprecated * @see total_ttc */ - var $total; + public $total; - var $cond_reglement_code; - var $mode_reglement_code; - var $remise = 0; - var $remise_percent = 0; - var $remise_absolue = 0; + public $cond_reglement_code; + public $mode_reglement_code; + public $remise = 0; + public $remise_percent = 0; + public $remise_absolue = 0; - var $products=array(); - var $extraparams=array(); + public $products=array(); + public $extraparams=array(); - var $lines = array(); - var $line; + public $lines = array(); + public $line; - var $labelstatut=array(); - var $labelstatut_short=array(); + public $labelstatut=array(); + public $labelstatut_short=array(); - var $nbtodo; - var $nbtodolate; + public $nbtodo; + public $nbtodolate; - var $specimen; + public $specimen; // Multicurrency - var $fk_multicurrency; - var $multicurrency_code; - var $multicurrency_tx; - var $multicurrency_total_ht; - var $multicurrency_total_tva; - var $multicurrency_total_ttc; + public $fk_multicurrency; + public $multicurrency_code; + public $multicurrency_tx; + public $multicurrency_total_ht; + public $multicurrency_total_tva; + public $multicurrency_total_ttc; /** * Draft status */ const STATUS_DRAFT = 0; + /** * Validated status */ const STATUS_VALIDATED = 1; + /** * Signed quote */ const STATUS_SIGNED = 2; + /** * Not signed quote, canceled */ const STATUS_NOTSIGNED = 3; + /** * Billed or closed/processed quote */ From 4ea582ad4aa4168eac7f34e0f38ca5aadd435ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 11:12:07 +0200 Subject: [PATCH 030/255] move phpcs:ignore --- htdocs/asset/class/asset.class.php | 21 ++--- htdocs/asset/class/asset_type.class.php | 7 +- htdocs/categories/class/categorie.class.php | 51 ++++++++---- htdocs/comm/mailing/class/mailing.class.php | 37 ++++----- .../stock/class/mouvementstock.class.php | 22 +++-- .../product/stock/class/productlot.class.php | 5 +- .../class/supplier_proposal.class.php | 80 +++++++++++-------- 7 files changed, 122 insertions(+), 101 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 036aa8dc0ba..f94fa4b8a12 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -338,6 +338,7 @@ class Asset extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -345,43 +346,37 @@ class Asset extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; - if ($mode == 0) - { - $prefix=''; - if ($status == 1) return $langs->trans('Enabled'); - if ($status == 0) return $langs->trans('Disabled'); - } - if ($mode == 1) + if ($mode == 0 || $mode == 1) { if ($status == 1) return $langs->trans('Enabled'); if ($status == 0) return $langs->trans('Disabled'); } - if ($mode == 2) + elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 3) + elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 5) + elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 6) + elseif ($mode == 6) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index e6b95d7ad37..7aa9beda627 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -33,12 +33,12 @@ class AssetType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'asset_type'; - + /** * @var string ID to identify managed object */ public $element = 'asset_type'; - + public $picto = 'group'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -282,14 +282,15 @@ class AssetType extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of asset's type * * @return array List of types of members */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_array() { + // phpcs:enable global $conf,$langs; $assettypes = array(); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 433b05aceeb..32910c3ed8a 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -640,6 +640,7 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Link an object to the category * @@ -647,9 +648,9 @@ class Categorie extends CommonObject * @param string $type Type of category ('product', ...) * @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_type($obj, $type) { + // phpcs:enable global $user,$langs,$conf; $error=0; @@ -742,6 +743,7 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Delete object from category * @@ -750,9 +752,9 @@ class Categorie extends CommonObject * * @return int 1 if OK, -1 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function del_type($obj,$type) { + // phpcs:enable global $user,$langs,$conf; $error=0; @@ -966,14 +968,15 @@ class Categorie extends CommonObject return $categories; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return childs of a category * * @return array|int <0 KO, array ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_filles() { + // phpcs:enable $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; $sql.= " WHERE fk_parent = ".$this->id; @@ -996,14 +999,15 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Load this->motherof that is array(id_son=>id_parent, ...) * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function load_motherof() { + // phpcs:enable global $conf; $this->motherof=array(); @@ -1031,6 +1035,7 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Rebuilding the category tree as an array * Return an array of table('id','id_mere',...) trie selon arbre et avec: @@ -1046,9 +1051,9 @@ class Categorie extends CommonObject * * @return array Array of categories. this->cats and this->motherof are set. */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_full_arbo($type, $markafterid=0) { + // phpcs:enable global $conf, $langs; if (! is_numeric($type)) $type = $this->MAP_ID[$type]; @@ -1123,6 +1128,7 @@ class Categorie extends CommonObject return $this->cats; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * For category id_categ and its childs available in this->cats, define property fullpath and fulllabel * @@ -1130,9 +1136,9 @@ class Categorie extends CommonObject * @param int $protection Deep counter to avoid infinite loop * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function build_path_from_id_categ($id_categ,$protection=1000) { + // phpcs:enable dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG); if (! empty($this->cats[$id_categ]['fullpath'])) @@ -1166,14 +1172,15 @@ class Categorie extends CommonObject return; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Display content of $this->cats * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function debug_cats() { + // phpcs:enable // Display $this->cats foreach($this->cats as $key => $val) { @@ -1188,6 +1195,7 @@ class Categorie extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns all categories * @@ -1195,9 +1203,9 @@ class Categorie extends CommonObject * @param boolean $parent Just parent categories if true * @return array Table of Object Category */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_all_categories($type=null, $parent=false) { + // phpcs:enable if (! is_numeric($type)) $type = $this->MAP_ID[$type]; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie"; @@ -1226,14 +1234,15 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Check if no category with same label already exists for this cat's parent or root and for this cat's type * * @return integer 1 if already exist, 0 otherwise, -1 if error */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function already_exists() { + // phpcs:enable $type=$this->type; if (! is_numeric($type)) $type=$this->MAP_ID[$type]; @@ -1276,18 +1285,20 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns the top level categories (which are not girls) * * @param int $type Type of category (0, 1, ...) * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_main_categories($type=null) { + // phpcs:enable return $this->get_all_categories($type, true); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns the path of the category, with the names of the categories * separated by $sep (" >> " by default) @@ -1297,9 +1308,9 @@ class Categorie extends CommonObject * @param int $nocolor 0 * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function print_all_ways($sep = " >> ", $url='', $nocolor=0) { + // phpcs:enable $ways = array(); $allways = $this->get_all_ways(); // Load array of categories @@ -1346,14 +1357,15 @@ class Categorie extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array containing the list of parent categories * * @return int|array <0 KO, array OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_meres() { + // phpcs:enable $parents = array(); $sql = "SELECT fk_parent FROM ".MAIN_DB_PREFIX."categorie"; @@ -1381,15 +1393,16 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns in a table all possible paths to get to the category * starting with the major categories represented by Tables of categories * * @return array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_all_ways() { + // phpcs:enable $ways = array(); $parents=$this->get_meres(); @@ -1596,6 +1609,7 @@ class Categorie extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Deplace fichier uploade sous le nom $files dans le repertoire sdir * @@ -1603,9 +1617,9 @@ class Categorie extends CommonObject * @param string $file Nom du fichier uploade * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_photo($sdir, $file) { + // phpcs:enable require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $dir = $sdir .'/'. get_exdir($this->id,2,0,0,$this,'category') . $this->id ."/"; @@ -1646,6 +1660,7 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return tableau de toutes les photos de la categorie * @@ -1653,9 +1668,9 @@ class Categorie extends CommonObject * @param int $nbmax Nombre maximum de photos (0=pas de max) * @return array Tableau de photos */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_photos($dir,$nbmax=0) { + // phpcs:enable include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; $nbphoto=0; @@ -1702,15 +1717,16 @@ class Categorie extends CommonObject return $tabobj; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Efface la photo de la categorie et sa vignette * * @param string $file Path to file * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_photo($file) { + // phpcs:enable require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine @@ -1731,15 +1747,16 @@ class Categorie extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load size of image file * * @param string $file Path to file * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_image_size($file) { + // phpcs:enable $infoImg = getimagesize($file); // Recuperation des infos de l'image $this->imgWidth = $infoImg[0]; // Largeur de l'image $this->imgHeight = $infoImg[1]; // Hauteur de l'image diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index fa7a9a1bc9e..26e2c7bec90 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -35,12 +35,12 @@ class Mailing extends CommonObject * @var string ID to identify managed object */ public $element='mailing'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='mailing'; - + public $picto='email'; var $titre; @@ -444,7 +444,7 @@ class Mailing extends CommonObject * * @return int 1 if OK, 0 if error */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_targets() { $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles"; @@ -470,7 +470,7 @@ class Mailing extends CommonObject * @param User $user Objet user qui valide * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function reset_targets_status($user) { $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; @@ -536,6 +536,7 @@ class Mailing extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -543,42 +544,38 @@ class Mailing extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; $langs->load('mails'); - if ($mode == 0) + if ($mode == 0 || $mode == 1) { return $langs->trans($this->statuts[$statut]); } - if ($mode == 1) - { - return $langs->trans($this->statuts[$statut]); - } - if ($mode == 2) + elseif ($mode == 2) { if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0'); if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1'); if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3'); if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut == 0) return img_picto($langs->trans($this->statuts[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut == 1) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); if ($statut == 2) return img_picto($langs->trans($this->statuts[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); if ($statut == 3) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut == 0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut0'); if ($statut == 1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1'); @@ -606,39 +603,39 @@ class Mailing extends CommonObject { return $langs->trans('MailingStatusError'); } - if ($mode == 1) + elseif ($mode == 1) { return $langs->trans('MailingStatusSent'); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3'); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3'); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); if ($statut==2) return $langs->trans("MailingStatusRead").' '.img_picto($langs->trans("MailingStatusRead"),'statut4'); if ($statut==3) return $langs->trans("MailingStatusNotContact").' '.img_picto($langs->trans("MailingStatusNotContact"),'statut3'); } - if ($mode == 6) + elseif ($mode == 6) { if ($statut==-1) return $langs->trans("MailingStatusError").' '.img_error($desc); if ($statut==1) return $langs->trans("MailingStatusSent").' '.img_picto($langs->trans("MailingStatusSent"),'statut6'); diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index ba82e007086..76225ff8902 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -34,7 +34,7 @@ class MouvementStock extends CommonObject * @var string Id to identify managed objects */ public $element = 'stockmouvement'; - + /** * @var string Name of table without prefix where object is stored */ @@ -858,6 +858,7 @@ class MouvementStock extends CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return Url link of origin object * @@ -865,9 +866,9 @@ class MouvementStock extends CommonObject * @param int $origintype Type origin * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_origin($fk_origin, $origintype) { + // phpcs:enable $origin=''; switch ($origintype) { @@ -1012,38 +1013,35 @@ class MouvementStock extends CommonObject return $this->LibStatut($mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un status donne * * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($mode=0) { + // phpcs:enable global $langs; - if ($mode == 0) + if ($mode == 0 || $mode == 1) { return $langs->trans('StatusNotApplicable'); } - if ($mode == 1) - { - return $langs->trans('StatusNotApplicable'); - } - if ($mode == 2) + elseif ($mode == 2) { return img_picto($langs->trans('StatusNotApplicable'),'statut9').' '.$langs->trans('StatusNotApplicable'); } - if ($mode == 3) + elseif ($mode == 3) { return img_picto($langs->trans('StatusNotApplicable'),'statut9'); } - if ($mode == 4) + elseif ($mode == 4) { return img_picto($langs->trans('StatusNotApplicable'),'statut9').' '.$langs->trans('StatusNotApplicable'); } - if ($mode == 5) + elseif ($mode == 5) { return $langs->trans('StatusNotApplicable').' '.img_picto($langs->trans('StatusNotApplicable'),'statut9'); } diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 0c501a1a09f..2cee8f7a2a1 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -39,7 +39,7 @@ class Productlot extends CommonObject * @var string Id to identify managed objects */ public $element = 'productlot'; - + /** * @var string Name of table without prefix where object is stored */ @@ -475,6 +475,7 @@ class Productlot extends CommonObject return $this->LibStatut(0,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a given status * @@ -482,9 +483,9 @@ class Productlot extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; //$langs->load('stocks'); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index a9b44339930..f690cdd8625 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -49,12 +49,12 @@ class SupplierProposal extends CommonObject * @var string ID to identify managed object */ public $element='supplier_proposal'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='supplier_proposal'; - + public $table_element_line='supplier_proposaldet'; public $fk_element='fk_supplier_proposal'; public $picto='propal'; @@ -203,9 +203,10 @@ class SupplierProposal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add line into array products - * $this->client doit etre charge + * $this->client doit etre charge * * @param int $idproduct Product Id to add * @param int $qty Quantity @@ -215,9 +216,9 @@ class SupplierProposal extends CommonObject * TODO Remplacer les appels a cette fonction par generation objet Ligne * insere dans tableau $this->products */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_product($idproduct, $qty, $remise_percent=0) { + // phpcs:enable global $conf, $mysoc; if (! $qty) $qty = 1; @@ -259,15 +260,16 @@ class SupplierProposal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adding line of fixed discount in the proposal in DB * * @param int $idremise Id of fixed discount * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_discount($idremise) { + // phpcs:enable global $langs; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -1074,6 +1076,7 @@ class SupplierProposal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Insert into DB a supplier_proposal object completely defined by its data members (ex, results from copy). * @@ -1081,9 +1084,9 @@ class SupplierProposal extends CommonObject * @return int Id of the new object if ok, <0 if ko * @see create */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_from($user) { + // phpcs:enable $this->products=$this->lines; return $this->create($user); @@ -1504,6 +1507,7 @@ class SupplierProposal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set delivery date * @@ -1511,9 +1515,9 @@ class SupplierProposal extends CommonObject * @param int $date_livraison Delivery date * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date_livraison($user, $date_livraison) { + // phpcs:enable if (! empty($user->rights->supplier_proposal->creer)) { $sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposal "; @@ -1534,6 +1538,7 @@ class SupplierProposal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set an overall discount on the proposal * @@ -1541,9 +1546,9 @@ class SupplierProposal extends CommonObject * @param double $remise Amount discount * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_percent($user, $remise) { + // phpcs:enable $remise=trim($remise)?trim($remise):0; if (! empty($user->rights->supplier_proposal->creer)) @@ -1568,6 +1573,7 @@ class SupplierProposal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set an absolute overall discount on the proposal * @@ -1575,9 +1581,9 @@ class SupplierProposal extends CommonObject * @param double $remise Amount discount * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_absolue($user, $remise) { + // phpcs:enable $remise=trim($remise)?trim($remise):0; if (! empty($user->rights->supplier_proposal->creer)) @@ -1841,15 +1847,16 @@ class SupplierProposal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Set draft status + * Set draft status * * @param User $user Object user that modify * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_draft($user) { + // phpcs:enable global $conf,$langs; $sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposal SET fk_statut = 0"; @@ -1868,6 +1875,7 @@ class SupplierProposal extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of askprice (eventually filtered on user) into an array * @@ -1881,9 +1889,9 @@ class SupplierProposal extends CommonObject * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_array($shortlist=0, $draft=0, $notcurrentuser=0, $socid=0, $limit=0, $offset=0, $sortfield='p.datec', $sortorder='DESC') { + // phpcs:enable global $conf,$user; $ga = array(); @@ -2133,16 +2141,17 @@ class SupplierProposal extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return label of a status (draft, validated, ...) + * Return label of a status (draft, validated, ...) * - * @param int $statut id statut - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto - * @return string Label + * @param int $statut id statut + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto + * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=1) { + // phpcs:enable // Init/load array of translation of status if (empty($this->labelstatut) || empty($this->labelstatut_short)) { @@ -2162,21 +2171,22 @@ class SupplierProposal extends CommonObject $statuttrans=''; if ($statut==0) $statuttrans='statut0'; - if ($statut==1) $statuttrans='statut1'; - if ($statut==2) $statuttrans='statut3'; - if ($statut==3) $statuttrans='statut5'; - if ($statut==4) $statuttrans='statut6'; + elseif ($statut==1) $statuttrans='statut1'; + elseif ($statut==2) $statuttrans='statut3'; + elseif ($statut==3) $statuttrans='statut5'; + elseif ($statut==4) $statuttrans='statut6'; if ($mode == 0) return $this->labelstatut[$statut]; - if ($mode == 1) return $this->labelstatut_short[$statut]; - if ($mode == 2) return img_picto($this->labelstatut[$statut], $statuttrans).' '.$this->labelstatut_short[$statut]; - if ($mode == 3) return img_picto($this->labelstatut[$statut], $statuttrans); - if ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut]; - if ($mode == 5) return ''.$this->labelstatut_short[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); - if ($mode == 6) return ''.$this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); + elseif ($mode == 1) return $this->labelstatut_short[$statut]; + elseif ($mode == 2) return img_picto($this->labelstatut[$statut], $statuttrans).' '.$this->labelstatut_short[$statut]; + elseif ($mode == 3) return img_picto($this->labelstatut[$statut], $statuttrans); + elseif ($mode == 4) return img_picto($this->labelstatut[$statut],$statuttrans).' '.$this->labelstatut[$statut]; + elseif ($mode == 5) return ''.$this->labelstatut_short[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); + elseif ($mode == 6) return ''.$this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],$statuttrans); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * @@ -2184,9 +2194,9 @@ class SupplierProposal extends CommonObject * @param int $mode "opened" for askprice to close, "signed" for proposal to invoice * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user,$mode) { + // phpcs:enable global $conf, $user, $langs; $now=dol_now(); @@ -2338,14 +2348,15 @@ class SupplierProposal extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf, $user; $this->nb=array(); @@ -2658,7 +2669,7 @@ class SupplierProposalLine extends CommonObjectLine * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -2668,7 +2679,7 @@ class SupplierProposalLine extends CommonObjectLine * @var string ID to identify managed object */ public $element='supplier_proposaldet'; - + /** * @var string Name of table without prefix where object is stored */ @@ -2678,12 +2689,12 @@ class SupplierProposalLine extends CommonObjectLine // From llx_supplier_proposaldet var $rowid; // deprecated - + /** * @var int ID */ public $id; - + var $fk_supplier_proposal; var $fk_parent_line; var $desc; // Description ligne @@ -3185,15 +3196,16 @@ class SupplierProposalLine extends CommonObjectLine } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update DB line fields total_xxx * Used by migration * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_total() { + // phpcs:enable $this->db->begin(); // Mise a jour ligne en base From 04c1a7d4af9dbd7a44e0f4ee10e6ae0974733046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 13:38:11 +0200 Subject: [PATCH 031/255] move phpcs:ignore --- htdocs/api/class/api_access.class.php | 6 +- htdocs/compta/bank/class/account.class.php | 59 +++++++----- .../bank/class/paymentvarious.class.php | 26 ++--- .../deplacement/class/deplacement.class.php | 17 ++-- .../compta/paiement/class/paiement.class.php | 19 ++-- .../class/bonprelevement.class.php | 68 +++++++------ .../salaries/class/paymentsalary.class.php | 6 +- .../sociales/class/cchargesociales.class.php | 3 +- .../sociales/class/chargesociales.class.php | 35 ++++--- .../class/paymentsocialcontribution.class.php | 6 +- htdocs/core/class/CSMSFile.class.php | 6 +- htdocs/core/class/commonobject.class.php | 95 ++++++++++++------- htdocs/loan/class/loan.class.php | 25 +++-- htdocs/loan/class/paymentloan.class.php | 3 +- .../class/propalmergepdfproduct.class.php | 9 +- .../class/price_expression.class.php | 14 +-- .../price_global_variable_updater.class.php | 18 ++-- 17 files changed, 244 insertions(+), 171 deletions(-) diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php index 8d8281745fa..e453bd331c2 100644 --- a/htdocs/api/class/api_access.class.php +++ b/htdocs/api/class/api_access.class.php @@ -59,15 +59,16 @@ class DolibarrApiAccess implements iAuthenticate */ public static $user = ''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName /** * Check access * * @return bool * @throws RestException */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName public function __isAllowed() { + // phpcs:enable global $conf, $db; $login = ''; @@ -165,15 +166,16 @@ class DolibarrApiAccess implements iAuthenticate return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName /** * @return string string to be used with WWW-Authenticate header * @example Basic * @example Digest * @example OAuth */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName public function __getWWWAuthenticateString() { + // phpcs:enable return ''; } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index bba4e2ff001..4a1d2b047ab 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -40,12 +40,12 @@ class Account extends CommonObject * @var string ID to identify managed object */ public $element = 'bank_account'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'bank_account'; - + public $picto = 'account'; /** @@ -304,7 +304,7 @@ class Account extends CommonObject * @param string $type Type of link ('payment', 'company', 'member', ...) * @return int <0 if KO, id line if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_url_line($line_id, $url_id, $url, $label, $type) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url ("; @@ -343,7 +343,7 @@ class Account extends CommonObject * @param string $type To search using type * @return array|-1 Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_url($fk_bank='', $url_id='', $type='') { $lines = array(); @@ -790,7 +790,7 @@ class Account extends CommonObject * @param User $user Object user making update * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_bban(User $user = null) { global $conf,$langs; @@ -1078,7 +1078,7 @@ class Account extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut, $mode = 0) { global $langs; @@ -1114,7 +1114,7 @@ class Account extends CommonObject * * @return boolean vrai si peut etre supprime, faux sinon */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function can_be_deleted() { $can_be_deleted=false; @@ -1184,7 +1184,7 @@ class Account extends CommonObject * @param int $filteraccountid To get info for a particular account id * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board(User $user, $filteraccountid = 0) { global $conf, $langs; @@ -1238,7 +1238,7 @@ class Account extends CommonObject * @param int $filteraccountid To get info for a particular account id * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board($filteraccountid = 0) { global $user; @@ -1648,29 +1648,29 @@ class AccountLine extends CommonObject * @var string Error code (or message) */ public $error=''; - + /** * @var DoliDB Database handler. */ public $db; - + /** * @var string ID to identify managed object */ public $element='bank'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='bank'; - + var $picto = 'generic'; /** * @var int ID */ public $id; - + var $ref; var $datec; var $dateo; @@ -1680,12 +1680,12 @@ class AccountLine extends CommonObject */ var $datev; var $amount; - + /** * @var string proper name for given parameter */ public $label; - + var $note; var $fk_user_author; var $fk_user_rappro; @@ -1884,15 +1884,16 @@ class AccountLine extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Delete bank line records * * @param User $user User object that delete * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_urls(User $user = null) { + // phpcs:enable $nbko=0; if ($this->rappro) @@ -1955,6 +1956,7 @@ class AccountLine extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update conciliation field * @@ -1962,9 +1964,9 @@ class AccountLine extends CommonObject * @param int $cat Category id * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_conciliation(User $user, $cat) { + // phpcs:enable global $conf,$langs; $this->db->begin(); @@ -2018,6 +2020,7 @@ class AccountLine extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Increase/decrease value date of a rowid * @@ -2025,9 +2028,9 @@ class AccountLine extends CommonObject * @param int $sign 1 or -1 * @return int >0 if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function datev_change($rowid,$sign=1) { + // phpcs:enable $sql = "SELECT datev FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid; $resql = $this->db->query($sql); if ($resql) @@ -2057,31 +2060,34 @@ class AccountLine extends CommonObject return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Increase value date of a rowid * * @param int $id Id of line to change * @return int >0 if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function datev_next($id) { + // phpcs:enable return $this->datev_change($id,1); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Decrease value date of a rowid * * @param int $id Id of line to change * @return int >0 if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function datev_previous($id) { + // phpcs:enable return $this->datev_change($id,-1); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Increase/decrease operation date of a rowid * @@ -2089,9 +2095,9 @@ class AccountLine extends CommonObject * @param int $sign 1 or -1 * @return int >0 if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function dateo_change($rowid,$sign=1) { + // phpcs:enable $sql = "SELECT dateo FROM ".MAIN_DB_PREFIX."bank WHERE rowid = ".$rowid; $resql = $this->db->query($sql); if ($resql) @@ -2121,27 +2127,29 @@ class AccountLine extends CommonObject return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Increase operation date of a rowid * * @param int $id Id of line to change * @return int >0 if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function dateo_next($id) { + // phpcs:enable return $this->dateo_change($id,1); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Decrease operation date of a rowid * * @param int $id Id of line to change * @return int >0 if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function dateo_previous($id) { + // phpcs:enable return $this->dateo_change($id,-1); } @@ -2248,6 +2256,7 @@ class AccountLine extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -2255,9 +2264,9 @@ class AccountLine extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; //$langs->load('companies'); /* diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 74df6c24ad6..df3507d4dca 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -34,19 +34,19 @@ class PaymentVarious extends CommonObject * @var string ID to identify managed object */ public $element='variouspayment'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='payment_various'; - + public $picto = 'bill'; /** * @var int ID */ public $id; - + var $ref; var $tms; var $datep; @@ -55,12 +55,12 @@ class PaymentVarious extends CommonObject var $amount; var $type_payment; var $num_payment; - + /** * @var string proper name for given parameter */ public $label; - + var $accountancy_code; var $fk_project; var $fk_bank; @@ -451,15 +451,16 @@ class PaymentVarious extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update link between payment various and line generate into llx_bank * * @param int $id_bank Id bank account * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_fk_bank($id_bank) { + // phpcs:enable $sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_various SET fk_bank = '.$id_bank; $sql.= ' WHERE rowid = '.$this->id; $result = $this->db->query($sql); @@ -486,6 +487,7 @@ class PaymentVarious extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -493,38 +495,38 @@ class PaymentVarious extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Libelle */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) { return $langs->trans($this->statuts[$statut]); } - if ($mode == 1) + elseif ($mode == 1) { return $langs->trans($this->statuts_short[$statut]); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index c78ca6707eb..2330e81d3a0 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -35,12 +35,12 @@ class Deplacement extends CommonObject * @var string ID to identify managed object */ public $element='deplacement'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='deplacement'; - + public $table_element_line = ''; public $fk_element = ''; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -300,6 +300,7 @@ class Deplacement extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -307,38 +308,38 @@ class Deplacement extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Libelle */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) { return $langs->trans($this->statuts[$statut]); } - if ($mode == 1) + elseif ($mode == 1) { return $langs->trans($this->statuts_short[$statut]); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); if ($statut==2 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 1fd2ad8bbef..3a2b3f900a1 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -40,12 +40,12 @@ class Paiement extends CommonObject * @var string ID to identify managed object */ public $element='payment'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='paiement'; - + public $picto = 'payment'; var $facid; @@ -702,15 +702,16 @@ class Paiement extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Mise a jour du lien entre le paiement et la ligne generee dans llx_bank * * @param int $id_bank Id compte bancaire * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_fk_bank($id_bank) { + // phpcs:enable $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' set fk_bank = '.$id_bank; $sql.= ' WHERE rowid = '.$this->id; @@ -728,15 +729,16 @@ class Paiement extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Updates the payment date * * @param int $date New date * @return int <0 if KO, 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_date($date) { + // phpcs:enable if (!empty($date) && $this->statut!=1) { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; @@ -760,15 +762,16 @@ class Paiement extends CommonObject return -1; //no date given or already validated } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Updates the payment number * * @param string $num New num * @return int <0 if KO, 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_num($num) { + // phpcs:enable if(!empty($num) && $this->statut!=1) { $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; @@ -1123,6 +1126,7 @@ class Paiement extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -1130,9 +1134,9 @@ class Paiement extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage $langs->load('compta'); @@ -1174,15 +1178,16 @@ class Paiement extends CommonObject return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load the third party of object, from id into this->thirdparty * * @param int $force_thirdparty_id Force thirdparty id * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_thirdparty($force_thirdparty_id=0) { + // phpcs:enable include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; if (empty($force_thirdparty_id)) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 7eba6afec29..dbb8932d7f5 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -43,12 +43,12 @@ class BonPrelevement extends CommonObject * @var string ID to identify managed object */ public $element='widthdraw'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='prelevement_bons'; - + public $picto = 'payment'; var $date_echeance; @@ -109,6 +109,7 @@ class BonPrelevement extends CommonObject $this->_fetched = 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add invoice to withdrawal * @@ -122,9 +123,9 @@ class BonPrelevement extends CommonObject * @param string $number_key number key of account number * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function AddFacture($facture_id, $client_id, $client_nom, $amount, $code_banque, $code_guichet, $number, $number_key) { + // phpcs:enable $result = 0; $line_id = 0; @@ -328,14 +329,15 @@ class BonPrelevement extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set credite and set status of linked invoices. Still used ?? * * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_credite() { + // phpcs:enable global $user,$conf; $error = 0; @@ -406,6 +408,7 @@ class BonPrelevement extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set direct debit order to "credited" status. * @@ -413,9 +416,9 @@ class BonPrelevement extends CommonObject * @param int $date date of action * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_infocredit($user, $date) { + // phpcs:enable global $conf,$langs; $error = 0; @@ -553,6 +556,7 @@ class BonPrelevement extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set withdrawal to transmited status * @@ -561,9 +565,9 @@ class BonPrelevement extends CommonObject * @param string $method method of transmision to bank * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_infotrans($user, $date, $method) { + // phpcs:enable global $conf,$langs; $error = 0; @@ -678,14 +682,15 @@ class BonPrelevement extends CommonObject return $arr; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns amount of withdrawal * * @return double Total amount */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SommeAPrelever() { + // phpcs:enable global $conf; $sql = "SELECT sum(pfd.amount) as nb"; @@ -716,6 +721,7 @@ class BonPrelevement extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get number of invoices to withdrawal * TODO delete params banque and agence when not necesary @@ -724,9 +730,9 @@ class BonPrelevement extends CommonObject * @param int $agence dolibarr mysoc agence * @return int 0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DeleteNotification($user, $action) { + // phpcs:enable $result = 0; $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; @@ -1243,6 +1252,7 @@ class BonPrelevement extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add a notification * @@ -1251,9 +1261,9 @@ class BonPrelevement extends CommonObject * @param string $action notification action * @return int 0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function AddNotification($db, $user, $action) { + // phpcs:enable $result = 0; if ($this->DeleteNotification($user, $action) == 0) @@ -1469,6 +1479,7 @@ class BonPrelevement extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write recipient of request (customer) * @@ -1483,9 +1494,9 @@ class BonPrelevement extends CommonObject * @param string $rib_dom rib domiciliation * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function EnregDestinataire($rowid, $client_nom, $rib_banque, $rib_guichet, $rib_number, $amount, $facnumber, $facid, $rib_dom='') { + // phpcs:enable fputs($this->file, "06"); fputs($this->file, "08"); // Prelevement ordinaire @@ -1556,6 +1567,7 @@ class BonPrelevement extends CommonObject return $pre.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write recipient of request (customer) * @@ -1577,9 +1589,9 @@ class BonPrelevement extends CommonObject * @param string $row_drum rib.rowid used to generate rum * @return string Return string with SEPA part DrctDbtTxInf */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum) { + // phpcs:enable $CrLf = "\n"; $Rowing = sprintf("%06d", $row_idfac); @@ -1634,14 +1646,15 @@ class BonPrelevement extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write sender of request (me) * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function EnregEmetteur() { + // phpcs:enable fputs($this->file, "03"); fputs($this->file, "08"); // Prelevement ordinaire @@ -1700,6 +1713,7 @@ class BonPrelevement extends CommonObject fputs($this->file, "\n"); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write sender of request (me). * Note: The tag PmtInf is opened here but closed into caller @@ -1712,9 +1726,9 @@ class BonPrelevement extends CommonObject * @param string $format FRST or RCUR or ALL * @return string String with SEPA Sender */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n', $format='FRST') { + // phpcs:enable // SEPA INITIALISATION global $conf; @@ -1822,15 +1836,16 @@ class BonPrelevement extends CommonObject return $XML_SEPA_INFO; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write end * * @param int $total total amount * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function EnregTotal($total) { + // phpcs:enable fputs($this->file, "08"); fputs($this->file, "08"); // Prelevement ordinaire @@ -1895,6 +1910,7 @@ class BonPrelevement extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return status label for a status * @@ -1902,9 +1918,9 @@ class BonPrelevement extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable if (empty($this->labelstatut)) { global $langs; @@ -1914,39 +1930,35 @@ class BonPrelevement extends CommonObject $this->labelstatut[2]=$langs->trans("StatusCredited"); } - if ($mode == 0) + if ($mode == 0 || $mode == 1) { return $this->labelstatut[$statut]; } - if ($mode == 1) - { - return $this->labelstatut[$statut]; - } - if ($mode == 2) + elseif ($mode == 2) { if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut]; if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut]; if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut]; } - if ($mode == 3) + elseif ($mode == 3) { if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1'); if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3'); if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut==0) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut]; if ($statut==1) return img_picto($this->labelstatut[$statut],'statut3').' '.$this->labelstatut[$statut]; if ($statut==2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut]; } - if ($mode == 5) + elseif ($mode == 5) { if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1'); if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3'); if ($statut==2) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut6'); } - if ($mode == 6) + elseif ($mode == 6) { if ($statut==0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut1'); if ($statut==1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut3'); diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 5aa11229452..7630800ad15 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -486,15 +486,16 @@ class PaymentSalary extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update link between payment salary and line generate into llx_bank * * @param int $id_bank Id bank account * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_fk_bank($id_bank) { + // phpcs:enable $sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank; $sql.= ' WHERE rowid = '.$this->id; $result = $this->db->query($sql); @@ -584,6 +585,7 @@ class PaymentSalary extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -591,9 +593,9 @@ class PaymentSalary extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage $langs->load('compta'); diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index bfa8c97a058..409ee99aaae 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -461,6 +461,7 @@ class Cchargesociales return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un status donne * @@ -468,9 +469,9 @@ class Cchargesociales * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index bad851450a7..726eef6feff 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -36,14 +36,14 @@ class ChargeSociales extends CommonObject * @var string ID to identify managed object */ public $element='chargesociales'; - + public $table='chargesociales'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='chargesociales'; - + public $picto = 'bill'; /** @@ -367,15 +367,16 @@ class ChargeSociales extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Tag social contribution as payed completely * * @param User $user Object user making change * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_paid($user) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; $sql.= " paye = 1"; $sql.= " WHERE rowid = ".$this->id; @@ -383,15 +384,17 @@ class ChargeSociales extends CommonObject if ($return) return 1; else return -1; } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Remove tag payed on social contribution * * @param User $user Object user making change * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_unpaid($user) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales SET"; $sql.= " paye = 0"; $sql.= " WHERE rowid = ".$this->id; @@ -412,6 +415,7 @@ class ChargeSociales extends CommonObject return $this->LibStatut($this->paye,$mode,$alreadypaid); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -420,55 +424,50 @@ class ChargeSociales extends CommonObject * @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0,$alreadypaid=-1) { + // phpcs:enable global $langs; $langs->load('customers'); $langs->load('bills'); - if ($mode == 0) + if ($mode == 0 || $mode == 1) { if ($statut == 0) return $langs->trans("Unpaid"); if ($statut == 1) return $langs->trans("Paid"); } - if ($mode == 1) - { - if ($statut == 0) return $langs->trans("Unpaid"); - if ($statut == 1) return $langs->trans("Paid"); - } - if ($mode == 2) + elseif ($mode == 2) { if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1'); if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); } - if ($mode == 6) + elseif ($mode == 6) { if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); } - return "Error, mode/status not found"; + else return "Error, mode/status not found"; } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 4a989554b69..ca233eb43ea 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -600,15 +600,16 @@ class PaymentSocialContribution extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee * * @param int $id_bank Id if bank * @return int >0 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_fk_bank($id_bank) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG); @@ -636,6 +637,7 @@ class PaymentSocialContribution extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -643,9 +645,9 @@ class PaymentSocialContribution extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage $langs->load('compta'); diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php index 5bc8105049e..c2512af70ef 100644 --- a/htdocs/core/class/CSMSFile.class.php +++ b/htdocs/core/class/CSMSFile.class.php @@ -192,15 +192,16 @@ class CSMSFile } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write content of a SendSms request into a dump file (mode = all) * Used for debugging. * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function dump_sms() { + // phpcs:enable global $conf,$dolibarr_main_data_root; if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir @@ -222,6 +223,7 @@ class CSMSFile } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write content of a SendSms result into a dump file (mode = all) * Used for debugging. @@ -229,9 +231,9 @@ class CSMSFile * @param int $result Result of sms sending * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function dump_sms_result($result) { + // phpcs:enable global $conf,$dolibarr_main_data_root; if (@is_writeable($dolibarr_main_data_root)) // Avoid fatal error on fopen with open_basedir diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a00f91ac5bc..ca493b98041 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -713,6 +713,7 @@ abstract class CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add a link between element $this->element and a contact * @@ -722,9 +723,9 @@ abstract class CommonObject * @param int $notrigger Disable all triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_contact($fk_socpeople, $type_contact, $source='external',$notrigger=0) { + // phpcs:enable global $user,$langs; @@ -836,6 +837,7 @@ abstract class CommonObject } else return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Copy contact from one element to current * @@ -843,9 +845,9 @@ abstract class CommonObject * @param string $source Nature of contact ('internal' or 'external') * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function copy_linked_contact($objFrom, $source='internal') { + // phpcs:enable $contacts = $objFrom->liste_contact(-1, $source); foreach($contacts as $contact) { @@ -858,6 +860,7 @@ abstract class CommonObject return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update a link to contact line * @@ -867,9 +870,9 @@ abstract class CommonObject * @param int $fk_socpeople Id of soc_people to update (not modified if 0) * @return int <0 if KO, >= 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_contact($rowid, $statut, $type_contact_id=0, $fk_socpeople=0) { + // phpcs:enable // Insert into database $sql = "UPDATE ".MAIN_DB_PREFIX."element_contact set"; $sql.= " statut = ".$statut; @@ -888,6 +891,7 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Delete a link to contact line * @@ -895,9 +899,9 @@ abstract class CommonObject * @param int $notrigger Disable all triggers * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_contact($rowid, $notrigger=0) { + // phpcs:enable global $user; @@ -926,6 +930,7 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Delete all links between an object $this and all its contacts * @@ -933,9 +938,9 @@ abstract class CommonObject * @param string $code Type of contact (code or id) * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_linked_contact($source='',$code='') { + // phpcs:enable $temp = array(); $typeContact = $this->liste_type_contact($source,'',0,0,$code); @@ -962,6 +967,7 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get array of all contacts for an object * @@ -971,9 +977,9 @@ abstract class CommonObject * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) * @return array Array of contacts */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_contact($statut=-1,$source='external',$list=0,$code='') { + // phpcs:enable global $langs; $tab=array(); @@ -1070,6 +1076,7 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return array with list of possible values for type of contacts * @@ -1080,9 +1087,9 @@ abstract class CommonObject * @param string $code Type of contact (Example: 'CUSTOMER', 'SERVICE') * @return array Array list of type of contacts (id->label if option=0, code->label if option=1) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_type_contact($source='internal', $order='position', $option=0, $activeonly=0, $code='') { + // phpcs:enable global $langs; if (empty($order)) $order='position'; @@ -1184,15 +1191,16 @@ abstract class CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load object contact with id=$this->contactid into $this->contact * * @param int $contactid Id du contact. Use this->contactid if empty. * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_contact($contactid=null) { + // phpcs:enable if (empty($contactid)) $contactid=$this->contactid; if (empty($contactid)) return 0; @@ -1204,15 +1212,16 @@ abstract class CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty * * @param int $force_thirdparty_id Force thirdparty id * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_thirdparty($force_thirdparty_id=0) { + // phpcs:enable global $conf; if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) @@ -1266,6 +1275,7 @@ abstract class CommonObject return $this->fetch($result->rowid); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load data for barcode into properties ->barcode_type* * Properties ->barcode_type that is id of barcode. Type is used to find other properties, but @@ -1273,9 +1283,9 @@ abstract class CommonObject * * @return int <0 if KO, 0 if can't guess type of barcode (ISBN, EAN13...), >0 if OK (all barcode properties loaded) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_barcode() { + // phpcs:enable global $conf; dol_syslog(get_class($this).'::fetch_barcode this->element='.$this->element.' this->barcode_type='.$this->barcode_type); @@ -1316,14 +1326,15 @@ abstract class CommonObject return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load the project with id $this->fk_project into this->project * * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_projet() { + // phpcs:enable include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (empty($this->fk_project) && ! empty($this->fk_projet)) $this->fk_project = $this->fk_projet; // For backward compatibility @@ -1337,14 +1348,15 @@ abstract class CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load the product with id $this->fk_product into this->product * * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_product() { + // phpcs:enable include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (empty($this->fk_product)) return 0; @@ -1356,29 +1368,31 @@ abstract class CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load the user with id $userid into this->user * * @param int $userid Id du contact * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_user($userid) { + // phpcs:enable $user = new User($this->db); $result=$user->fetch($userid); $this->user = $user; return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Read linked origin object * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_origin() { + // phpcs:enable if ($this->origin == 'shipping') $this->origin = 'expedition'; if ($this->origin == 'delivery') $this->origin = 'livraison'; @@ -1538,6 +1552,7 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load properties id_previous and id_next by comparing $fieldid with $this->ref * @@ -1546,9 +1561,9 @@ abstract class CommonObject * @param int $nodbprefix Do not include DB prefix to forge table name * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_previous_next_ref($filter, $fieldid, $nodbprefix=0) { + // phpcs:enable global $conf, $user; if (! $this->table_element) @@ -2173,6 +2188,7 @@ abstract class CommonObject // TODO: Move line related operations to CommonObjectLine? + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Save a new position (field rang) for details lines. * You can choose to set position for lines with already a position or lines without any position defined. @@ -2182,9 +2198,9 @@ abstract class CommonObject * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function line_order($renum=false, $rowidorder='ASC', $fk_parent_line=true) { + // phpcs:enable if (! $this->table_element_line) { dol_syslog(get_class($this)."::line_order was called on objet with property table_element_line not defined",LOG_ERR); @@ -2293,6 +2309,7 @@ abstract class CommonObject return $rows; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update a line to have a lower rank * @@ -2300,9 +2317,9 @@ abstract class CommonObject * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function line_up($rowid, $fk_parent_line=true) { + // phpcs:enable $this->line_order(false, 'ASC', $fk_parent_line); // Get rang of line @@ -2312,6 +2329,7 @@ abstract class CommonObject $this->updateLineUp($rowid, $rang); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update a line to have a higher rank * @@ -2319,9 +2337,9 @@ abstract class CommonObject * @param boolean $fk_parent_line Table with fk_parent_line field or not * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function line_down($rowid, $fk_parent_line=true) { + // phpcs:enable $this->line_order(false, 'ASC', $fk_parent_line); // Get rang of line @@ -2356,15 +2374,16 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update position of line with ajax (rang) * * @param array $rows Array of rows * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function line_ajaxorder($rows) { + // phpcs:enable $num = count($rows); for ($i = 0 ; $i < $num ; $i++) { @@ -2472,15 +2491,16 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get max value used for position of line (rang) * * @param int $fk_parent_line Parent line id * @return int Max value of rang in table of lines */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function line_max($fk_parent_line=0) { + // phpcs:enable // Search the last rang with fk_parent_line if ($fk_parent_line) { @@ -2519,15 +2539,16 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update external ref of element * * @param string $ref_ext Update field ref_ext * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_ref_ext($ref_ext) { + // phpcs:enable if (! $this->table_element) { dol_syslog(get_class($this)."::update_ref_ext was called on objet with property table_element not defined", LOG_ERR); @@ -2551,6 +2572,7 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update note of element * @@ -2558,9 +2580,9 @@ abstract class CommonObject * @param string $suffix '', '_public' or '_private' * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_note($note, $suffix='') { + // phpcs:enable global $user; if (! $this->table_element) @@ -2603,6 +2625,7 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update public note (kept for backward compatibility) * @@ -2611,12 +2634,13 @@ abstract class CommonObject * @deprecated * @see update_note() */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_note_public($note) { + // phpcs:enable return $this->update_note($note,'_public'); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update total_ht, total_ttc, total_vat, total_localtax1, total_localtax2 for an object (sum of lines). * Must be called at end of methods addline or updateline. @@ -2627,9 +2651,9 @@ abstract class CommonObject * @param Societe $seller If roundingadjust is '0' or '1' or maybe 'auto', it means we recalculate total for lines before calculating total for object and for this, we need seller object. * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_price($exclspec=0,$roundingadjust='none',$nodatabaseupdate=0,$seller=null) { + // phpcs:enable global $conf, $hookmanager, $action; // Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield) @@ -2856,6 +2880,7 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add objects linked in llx_element_element. * @@ -2864,9 +2889,9 @@ abstract class CommonObject * @return int <=0 if KO, >0 if OK * @see fetchObjectLinked, updateObjectLinked, deleteObjectLinked */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_object_linked($origin=null, $origin_id=null) { + // phpcs:enable $origin = (! empty($origin) ? $origin : $this->origin); $origin_id = (! empty($origin_id) ? $origin_id : $this->origin_id); @@ -3617,15 +3642,16 @@ abstract class CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return incoterms informations * TODO Use a cache for label get * * @return string incoterms info */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function display_incoterms() { + // phpcs:enable $out = ''; $this->libelle_incoterms = ''; if (!empty($this->fk_incoterms)) @@ -4225,6 +4251,7 @@ abstract class CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add resources to the current object : add entry into llx_element_resources * Need $this->element & $this->id @@ -4235,9 +4262,9 @@ abstract class CommonObject * @param int $mandatory Mandatory or not * @return int <=0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_element_resource($resource_id, $resource_type, $busy=0, $mandatory=0) { + // phpcs:enable $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_resources ("; @@ -4270,6 +4297,7 @@ abstract class CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Delete a link to resource line * @@ -4278,9 +4306,9 @@ abstract class CommonObject * @param int $notrigger Disable all triggers * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_resource($rowid, $element, $notrigger=0) { + // phpcs:enable global $user; $this->db->begin(); @@ -4653,6 +4681,7 @@ abstract class CommonObject /* For triggers */ + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Call trigger based on this instance. * Some context information may also be provided into array property this->context. @@ -4663,9 +4692,9 @@ abstract class CommonObject * @param User $user Object user * @return int Result of run_triggers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function call_trigger($trigger_name, $user) { + // phpcs:enable global $langs,$conf; include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; @@ -4690,6 +4719,7 @@ abstract class CommonObject /* Functions for extrafields */ + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to get extra fields of an object into $this->array_options * This method is in most cases called by method fetch of objects but you can call it separately. @@ -4698,9 +4728,9 @@ abstract class CommonObject * @param array $optionsArray Array resulting of call of extrafields->fetch_name_optionals_label(). Deprecated. Function must be called without parameters. * @return int <0 if error, 0 if no values of extrafield to find nor found, 1 if an attribute is found and value loaded */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_optionals($rowid=null, $optionsArray=null) { + // phpcs:enable if (empty($rowid)) $rowid=$this->id; // To avoid SQL errors. Probably not the better solution though @@ -6175,7 +6205,7 @@ abstract class CommonObject { //Show only the key field in params if (is_array($params) && array_key_exists('onlykey',$params) && $key != $params['onlykey']) continue; - + $enabled = 1; if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) { @@ -6462,6 +6492,7 @@ abstract class CommonObject return $buyPrice; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show photos of an object (nbmax maximum), into several columns * @@ -6479,9 +6510,9 @@ abstract class CommonObject * @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead) * @return string Html code to show photo. Number of photos shown is saved in this->nbphoto */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0) { + // phpcs:enable global $conf,$user,$langs; include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index b1bcbc65567..ba14c2828b6 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -333,15 +333,16 @@ class Loan extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Tag loan as payed completely * * @param User $user Object user making change * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_paid($user) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."loan SET"; $sql.= " paid = 1"; $sql.= " WHERE rowid = ".$this->id; @@ -366,6 +367,7 @@ class Loan extends CommonObject return $this->LibStatut($this->paid,$mode,$alreadypaid); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label for given status * @@ -374,54 +376,49 @@ class Loan extends CommonObject * @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise) * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0,$alreadypaid=-1) { + // phpcs:enable global $langs; $langs->loadLangs(array("customers","bills")); - if ($mode == 0) + if ($mode == 0 || $mode == 1) { if ($statut == 0) return $langs->trans("Unpaid"); if ($statut == 1) return $langs->trans("Paid"); } - if ($mode == 1) - { - if ($statut == 0) return $langs->trans("Unpaid"); - if ($statut == 1) return $langs->trans("Paid"); - } - if ($mode == 2) + elseif ($mode == 2) { if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1'); if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut == 0 && $alreadypaid <= 0) return img_picto($langs->trans("Unpaid"), 'statut1').' '.$langs->trans("Unpaid"); if ($statut == 0 && $alreadypaid > 0) return img_picto($langs->trans("BillStatusStarted"), 'statut3').' '.$langs->trans("BillStatusStarted"); if ($statut == 1) return img_picto($langs->trans("Paid"), 'statut6').' '.$langs->trans("Paid"); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); } - if ($mode == 6) + elseif ($mode == 6) { if ($statut == 0 && $alreadypaid <= 0) return $langs->trans("Unpaid").' '.img_picto($langs->trans("Unpaid"), 'statut1'); if ($statut == 0 && $alreadypaid > 0) return $langs->trans("BillStatusStarted").' '.img_picto($langs->trans("BillStatusStarted"), 'statut3'); if ($statut == 1) return $langs->trans("Paid").' '.img_picto($langs->trans("Paid"), 'statut6'); } - return "Error, mode/status not found"; + else return "Error, mode/status not found"; } diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index 32b4080187f..add1aef496d 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -478,15 +478,16 @@ class PaymentLoan extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update link between loan's payment and the line generate in llx_bank * * @param int $id_bank Id if bank * @return int >0 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_fk_bank($id_bank) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."payment_loan SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG); diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index 75fe5282bd1..b02f1710bb5 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -223,6 +223,7 @@ class Propalmergepdfproduct extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load object in memory from the database * @@ -230,9 +231,9 @@ class Propalmergepdfproduct extends CommonObject * @param string $lang Lang string code * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_by_product($product_id, $lang='') { + // phpcs:enable global $langs,$conf; $sql = "SELECT"; @@ -436,6 +437,7 @@ class Propalmergepdfproduct extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Delete object in database * @@ -445,9 +447,9 @@ class Propalmergepdfproduct extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_by_product($user, $product_id, $lang_id='', $notrigger=0) { + // phpcs:enable global $conf, $langs; $error=0; @@ -501,15 +503,16 @@ class Propalmergepdfproduct extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Delete object in database * * @param User $user User that deletes * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_by_file($user) { + // phpcs:enable global $conf, $langs; $error=0; diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php index 0d991ace9fe..8d7dfbb7ce4 100644 --- a/htdocs/product/dynamic_price/class/price_expression.class.php +++ b/htdocs/product/dynamic_price/class/price_expression.class.php @@ -33,7 +33,7 @@ class PriceExpression * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -43,15 +43,15 @@ class PriceExpression * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var int ID */ public $id; - + var $title; var $expression; - + /** * @var string Name of table without prefix where object is stored */ @@ -176,14 +176,15 @@ class PriceExpression } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List all price expressions * * @return array Array of price expressions */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_price_expression() { + // phpcs:enable $sql = "SELECT rowid, title, expression"; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql.= " ORDER BY title"; @@ -214,15 +215,16 @@ class PriceExpression } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns any existing rowid with specified title * * @param String $title Title of expression * @return int < 0 if KO, 0 if OK but not found, > 0 rowid */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function find_title($title) { + // phpcs:enable $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql.= " WHERE title = '".$this->db->escape($title)."'"; diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php index ca81e40beb6..69639677f73 100644 --- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php +++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php @@ -33,25 +33,25 @@ class PriceGlobalVariableUpdater * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + var $types=array(0, 1); //!< Updater types var $update_min = 5; //!< Minimal update rate - + /** * @var int ID */ public $id; - + var $type; var $description; var $parameters; @@ -59,7 +59,7 @@ class PriceGlobalVariableUpdater var $update_interval; //!< Interval in mins var $next_update; //!< Next update timestamp var $last_status; - + /** * @var string Name of table without prefix where object is stored */ @@ -551,6 +551,7 @@ class PriceGlobalVariableUpdater return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update next_update into database * @@ -559,9 +560,9 @@ class PriceGlobalVariableUpdater * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_next_update($next_update, $user=0, $notrigger=0) { + // phpcs:enable $error=0; $this->next_update = $next_update; @@ -596,6 +597,7 @@ class PriceGlobalVariableUpdater } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update last_status into database * @@ -604,9 +606,9 @@ class PriceGlobalVariableUpdater * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_status($last_status, $user=0, $notrigger=0) { + // phpcs:enable $error=0; $this->last_status = $last_status; From 2a5c994009cfd7f9b1fe14defc42e45127d6f85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 14:01:37 +0200 Subject: [PATCH 032/255] move phpcs:ignore --- htdocs/adherents/class/adherent.class.php | 48 ++++++++++++------- .../adherents/class/adherent_type.class.php | 13 +++-- htdocs/adherents/class/subscription.class.php | 7 +-- .../admin/dolistore/class/dolistore.class.php | 23 +++++---- .../compta/localtax/class/localtax.class.php | 15 ++++-- htdocs/holiday/class/holiday.class.php | 18 +++---- htdocs/hrm/class/establishment.class.php | 17 +++---- .../product/actions_card_product.class.php | 6 ++- .../service/actions_card_service.class.php | 6 ++- 9 files changed, 94 insertions(+), 59 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 41764c38bd6..6c49b87185e 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -132,6 +132,7 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function sending an email has the adherent with the text supplied in parameter. * @@ -147,9 +148,9 @@ class Adherent extends CommonObject * @param string $errors_to erros to * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='') { + // phpcs:enable global $conf,$langs; // Detect if message is HTML @@ -638,6 +639,7 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update denormalized last subscription date. * This function is called when we delete a subscription for example. @@ -645,9 +647,9 @@ class Adherent extends CommonObject * @param User $user User making change * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_end_date($user) { + // phpcs:enable $this->db->begin(); // Search for last subscription id and end date @@ -993,15 +995,16 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Method to load member from its login * * @param string $login login of member * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_login($login) { + // phpcs:enable global $conf; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; @@ -1023,6 +1026,7 @@ class Adherent extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Method to load member from its name * @@ -1030,9 +1034,9 @@ class Adherent extends CommonObject * @param string $lastname Lastname * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_name($firstname,$lastname) { + // phpcs:enable global $conf; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; @@ -1195,6 +1199,7 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction qui recupere pour un adherent les parametres * first_subscription_date @@ -1204,9 +1209,9 @@ class Adherent extends CommonObject * * @return int <0 si KO, >0 si OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_subscriptions() { + // phpcs:enable global $langs; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; @@ -1750,14 +1755,15 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to add member into external tools mailing-list, spip, etc. * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_abo() { + // phpcs:enable global $conf,$langs; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; @@ -1808,14 +1814,15 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to delete a member from external tools like mailing-list, spip, etc. * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function del_to_abo() { + // phpcs:enable global $conf,$langs; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; @@ -1988,6 +1995,7 @@ class Adherent extends CommonObject return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -1997,9 +2005,9 @@ class Adherent extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0) { + // phpcs:enable global $langs; $langs->load("members"); if ($mode == 0) @@ -2013,7 +2021,7 @@ class Adherent extends CommonObject } if ($statut == 0) return $langs->trans("MemberStatusResiliated"); } - if ($mode == 1) + elseif ($mode == 1) { if ($statut == -1) return $langs->trans("MemberStatusDraftShort"); if ($statut >= 1) @@ -2024,7 +2032,7 @@ class Adherent extends CommonObject } if ($statut == 0) return $langs->trans("MemberStatusResiliatedShort"); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort"); if ($statut >= 1) @@ -2035,7 +2043,7 @@ class Adherent extends CommonObject } if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort"); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut >= 1) @@ -2046,7 +2054,7 @@ class Adherent extends CommonObject } if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft"); if ($statut >= 1) @@ -2057,7 +2065,7 @@ class Adherent extends CommonObject } if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated"); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut >= 1) @@ -2068,7 +2076,7 @@ class Adherent extends CommonObject } if ($statut == 0) return ''.$langs->trans("MemberStatusResiliated").' '.img_picto($langs->trans('MemberStatusResiliated'),'statut5'); } - if ($mode == 6) + elseif ($mode == 6) { if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0'); if ($statut >= 1) @@ -2082,14 +2090,15 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf; $this->nb=array(); @@ -2117,15 +2126,16 @@ class Adherent extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Objet user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user) { + // phpcs:enable global $conf, $langs; if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe @@ -2260,6 +2270,7 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -2269,9 +2280,9 @@ class Adherent extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_dn($info,$mode=0) { + // phpcs:enable global $conf; $dn=''; if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS."=".$info[$conf->global->LDAP_KEY_MEMBERS].",".$conf->global->LDAP_MEMBER_DN; @@ -2281,14 +2292,15 @@ class Adherent extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Initialise tableau info (tableau des attributs LDAP) * * @return array Tableau info des attributs */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_info() { + // phpcs:enable global $conf,$langs; $info=array(); diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b7d510a3e0f..9b24461c60d 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -36,12 +36,12 @@ class AdherentType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'adherent_type'; - + /** * @var string ID to identify managed object */ public $element = 'adherent_type'; - + public $picto = 'group'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -290,14 +290,15 @@ class AdherentType extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of members' type * * @return array List of types of members */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_array() { + // phpcs:enable global $conf,$langs; $adherenttypes = array(); @@ -422,6 +423,7 @@ class AdherentType extends CommonObject return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -431,9 +433,9 @@ class AdherentType extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_dn($info,$mode=0) { + // phpcs:enable global $conf; $dn=''; if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS_TYPES."=".$info[$conf->global->LDAP_KEY_MEMBERS_TYPES].",".$conf->global->LDAP_MEMBER_TYPE_DN; @@ -443,14 +445,15 @@ class AdherentType extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Initialize the info array (array of LDAP values) that will be used to call LDAP functions * * @return array Tableau info des attributs */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_info() { + // phpcs:enable global $conf,$langs; $info=array(); diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 90452816be8..6ad63a0f682 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -36,12 +36,12 @@ class Subscription extends CommonObject * @var string ID to identify managed object */ public $element='subscription'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='subscription'; - + public $picto='payment'; var $datec; // Date creation @@ -363,15 +363,16 @@ class Subscription extends CommonObject return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * * @param int $statut Id statut * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut) { + // phpcs:enable global $langs; $langs->load("members"); return ''; diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index c4dae079c3c..859b9140f86 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -163,15 +163,16 @@ class Dolistore } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return tree of Dolistore categories. $this->categories must have been loaded before. * * @param int $parent Id of parent category * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_categories($parent = 0) { + // phpcs:enable if (!isset($this->categories)) die('not possible'); if ($parent != 0) { $html = '
    '; @@ -211,14 +212,15 @@ class Dolistore } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of product formated for output * * @return string HTML output */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_products() { + // phpcs:enable global $langs, $conf; $html = ""; $parity = "pair"; @@ -293,38 +295,41 @@ class Dolistore return $html; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * get previous link * * @param string $text symbol previous * @return string html previous link */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_previous_link($text = '<<') { + // phpcs:enable return ''.$text.''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * get next link * * @param string $text symbol next * @return string html next link */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_next_link($text = '>>') { + // phpcs:enable return ''.$text.''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * get previous url * * @return string previous url */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function get_previous_url() + function get_previous_url() { + // phpcs:enable $param_array = array(); if ($this->start < $this->per_page) { $sub = 0; @@ -340,14 +345,15 @@ class Dolistore return $this->url."&".$param; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * get next url * * @return string next url */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_next_url() { + // phpcs:enable $param_array = array(); if (count($this->products) < $this->per_page) { $add = 0; @@ -363,6 +369,7 @@ class Dolistore return $this->url."&".$param; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * version compare * @@ -370,9 +377,9 @@ class Dolistore * @param string $v2 version 2 * @return int result of compare */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function version_compare($v1, $v2) { + // phpcs:enable $v1 = explode('.', $v1); $v2 = explode('.', $v2); $ret = 0; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 18b284f9187..2c777d671fc 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -344,15 +344,16 @@ class Localtax extends CommonObject return $solde; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Total de la localtax des factures emises par la societe. * * @param int $year Year * @return int ??? */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function localtax_sum_collectee($year = 0) { + // phpcs:enable $sql = "SELECT sum(f.localtax) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1"; if ($year) @@ -383,15 +384,16 @@ class Localtax extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * localtax payed * * @param int $year Year * @return int ??? */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function localtax_sum_payee($year = 0) { + // phpcs:enable $sql = "SELECT sum(f.total_localtax) as total_localtax"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; @@ -424,6 +426,7 @@ class Localtax extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * localtax payed * Total de la localtax payed @@ -431,9 +434,9 @@ class Localtax extends CommonObject * @param int $year Year * @return int ??? */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function localtax_sum_reglee($year = 0) { + // phpcs:enable $sql = "SELECT sum(f.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."localtax as f"; @@ -579,15 +582,16 @@ class Localtax extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update the link betwen localtax payment and the line into llx_bank * * @param int $id Id bank account * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_fk_bank($id) { + // phpcs:enable $sql = 'UPDATE '.MAIN_DB_PREFIX.'localtax SET fk_bank = '.$id; $sql.= ' WHERE rowid = '.$this->id; $result = $this->db->query($sql); @@ -639,6 +643,7 @@ class Localtax extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -646,9 +651,9 @@ class Localtax extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status, $mode=0) { + // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage return ''; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 0240ff8a34c..0f4107bf3ad 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -36,12 +36,12 @@ class Holiday extends CommonObject * @var string ID to identify managed object */ public $element='holiday'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='holiday'; - + public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $fk_element = 'fk_holiday'; public $picto = 'holiday'; @@ -921,6 +921,7 @@ class Holiday extends CommonObject return $this->LibStatut($this->statut, $mode, $this->date_debut); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns the label of a statut * @@ -929,9 +930,9 @@ class Holiday extends CommonObject * @param date $startdate Date holiday should start * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut, $mode=0, $startdate='') { + // phpcs:enable global $langs; if ($mode == 0) @@ -942,7 +943,7 @@ class Holiday extends CommonObject if ($statut == 4) return $langs->trans('CancelCP'); if ($statut == 5) return $langs->trans('RefuseCP'); } - if ($mode == 2) + elseif ($mode == 2) { $pictoapproved='statut6'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; @@ -952,7 +953,7 @@ class Holiday extends CommonObject if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5').' '.$langs->trans('CancelCP'); if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5').' '.$langs->trans('RefuseCP'); } - if ($mode == 3) + elseif ($mode == 3) { $pictoapproved='statut6'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; @@ -962,7 +963,7 @@ class Holiday extends CommonObject if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5'); if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5'); } - if ($mode == 5) + elseif ($mode == 5) { $pictoapproved='statut6'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; @@ -972,7 +973,7 @@ class Holiday extends CommonObject if ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'),'statut5'); if ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'),'statut5'); } - if ($mode == 6) + elseif ($mode == 6) { $pictoapproved='statut6'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; @@ -1580,15 +1581,16 @@ class Holiday extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of people with permission to validate leave requests. * Search for permission "approve leave requests" * * @return array Array of user ids */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_users_approver_holiday() { + // phpcs:enable $users_validator=array(); $sql = "SELECT DISTINCT ur.fk_user"; diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php index 60493b0b7f0..8ff5c2da52b 100644 --- a/htdocs/hrm/class/establishment.class.php +++ b/htdocs/hrm/class/establishment.class.php @@ -32,12 +32,12 @@ class Establishment extends CommonObject * @var string ID to identify managed object */ public $element='establishment'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='establishment'; - + public $table_element_line = ''; public $fk_element = 'fk_establishment'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe @@ -265,6 +265,7 @@ class Establishment extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Give a label from a status * @@ -272,35 +273,35 @@ class Establishment extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) { return $langs->trans($this->statuts[$status]); } - if ($mode == 1) + elseif ($mode == 1) { return $langs->trans($this->statuts_short[$status]); } - if ($mode == 2) + elseif ($mode == 2) { if ($status==0) return img_picto($langs->trans($this->statuts_short[$status]),'statut5').' '.$langs->trans($this->statuts_short[$status]); if ($status==1) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts_short[$status]); } - if ($mode == 3) + elseif ($mode == 3) { if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut5'); if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4'); } - if ($mode == 4) + elseif ($mode == 4) { if ($status==0 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut5').' '.$langs->trans($this->statuts[$status]); if ($status==1 && ! empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]),'statut4').' '.$langs->trans($this->statuts[$status]); } - if ($mode == 5) + elseif ($mode == 5) { if ($status==0 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut5'); if ($status==1 && ! empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]),'statut4'); diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index c24d5a8214a..bcd9773c719 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -64,6 +64,7 @@ class ActionsCardProduct } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * @@ -72,9 +73,9 @@ class ActionsCardProduct * @param string $ref Ref of object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id=0, $ref='') { + // phpcs:enable global $limit, $offset, $sortfield, $sortorder; global $conf, $langs, $user, $mysoc, $canvas; global $form, $formproduct; @@ -295,6 +296,7 @@ class ActionsCardProduct } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch datas list and save into ->list_datas * @@ -304,9 +306,9 @@ class ActionsCardProduct * @param string $sortorder Sort order ('ASC' or 'DESC') * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LoadListDatas($limit, $offset, $sortfield, $sortorder) { + // phpcs:enable global $conf, $langs; $this->getFieldList(); diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index 3d10988de85..2f0489b6f91 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -63,6 +63,7 @@ class ActionsCardService } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * @@ -71,9 +72,9 @@ class ActionsCardService * @param string $ref Ref of object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id=0, $ref='') { + // phpcs:enable global $limit, $offset, $sortfield, $sortorder; global $conf, $langs, $user, $mysoc, $canvas; global $form, $formproduct; @@ -273,6 +274,7 @@ class ActionsCardService } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch datas list and save into ->list_datas * @@ -282,9 +284,9 @@ class ActionsCardService * @param string $sortorder Sort order ('ASC' or 'DESC') * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LoadListDatas($limit, $offset, $sortfield, $sortorder) { + // phpcs:enable global $conf; global $search_categ,$sall,$sref,$search_barcode,$snom,$catid; From 28a146fb5e56a4fba782295c2d8e862f87d2bc86 Mon Sep 17 00:00:00 2001 From: Abbes Bahfir Date: Sun, 2 Sep 2018 14:47:02 +0100 Subject: [PATCH 033/255] New:Algerian Chart of accounts - First version --- .../install/mysql/data/llx_accounting_abc.sql | 3 + .../mysql/data/llx_accounting_account_dz.sql | 838 ++++++++++++++++++ 2 files changed, 841 insertions(+) create mode 100644 htdocs/install/mysql/data/llx_accounting_account_dz.sql diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql index 734831e3806..83fe8964614 100644 --- a/htdocs/install/mysql/data/llx_accounting_abc.sql +++ b/htdocs/install/mysql/data/llx_accounting_abc.sql @@ -7,6 +7,7 @@ -- Copyright (C) 2007 Patrick Raguin -- Copyright (C) 2011-2018 Alexandre Spangaro -- Copyright (C) 2015-2017 Juanjo Menent +-- Copyright (C) 2018 Abbes bahfir -- -- 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 @@ -124,3 +125,5 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE -- Description of chart of account RO RO-BASE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 188, 'RO-BASE', 'Plan de conturi romanesc', 1); +-- Description of chart of account DZ NSCF +INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 13, 'NSCF', 'Nouveau système comptable financier', 1); diff --git a/htdocs/install/mysql/data/llx_accounting_account_dz.sql b/htdocs/install/mysql/data/llx_accounting_account_dz.sql new file mode 100644 index 00000000000..4bee6a217f3 --- /dev/null +++ b/htdocs/install/mysql/data/llx_accounting_account_dz.sql @@ -0,0 +1,838 @@ +-- Copyright (C) 2018 Abbes Bahfir +-- +-- 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 3 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 . +-- +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + +-- +-- Descriptif du système comptable financier DZ NSCF +-- ID 15000 - 15811 +-- +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (17000,'NSCF','CAPIT','XXXXXX','1',0,'Comptes de capitaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15001,'NSCF','CAPIT','XXXXXX','10',17000,'Capital, réserves et assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15002,'NSCF','CAPIT','XXXXXX','101',15001,'Capital émis','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15003,'NSCF','CAPIT','XXXXXX','1011',15002,'Capital souscrit, non appelé','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15004,'NSCF','CAPIT','XXXXXX','1012',15002,'Capital souscrit, appelé, non versé','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15005,'NSCF','CAPIT','XXXXXX','1013',15002,'Capital souscrit, appelé, versé','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15006,'NSCF','CAPIT','XXXXXX','10131',15005,'Capital non amorti','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15007,'NSCF','CAPIT','XXXXXX','10132',15005,'Capital amorti','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15008,'NSCF','CAPIT','XXXXXX','1018',15002,'Capital souscrit, soumis à des réglementations particulières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15009,'NSCF','CAPIT','XXXXXX','103',15001,'Primes liées au capital social','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15010,'NSCF','CAPIT','XXXXXX','1031',15009,'Primes d''émission','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15011,'NSCF','CAPIT','XXXXXX','1032',15009,'Primes de fusion','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15012,'NSCF','CAPIT','XXXXXX','1033',15009,'Primes d''apport','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15013,'NSCF','CAPIT','XXXXXX','1034',15009,'Primes de conversion d''obligations en actions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15014,'NSCF','CAPIT','XXXXXX','104',15001,'Ecart d''évaluation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15015,'NSCF','CAPIT','XXXXXX','105',15001,'Ecart de réévaluation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15016,'NSCF','CAPIT','XXXXXX','1050',15015,'Ecart de réévaluation : Immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15017,'NSCF','CAPIT','XXXXXX','10503',15016,'Ecart de réévaluation : Frais de recherche et de développement immobilisés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15018,'NSCF','CAPIT','XXXXXX','10504',15016,'Ecart de réévaluation : Logiciels informatiques et assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15019,'NSCF','CAPIT','XXXXXX','10505',15016,'Ecart de réévaluation : Concessions et droits similaires, brevets, licences et marques','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15020,'NSCF','CAPIT','XXXXXX','10507',15016,'Ecarts de réévaluation : Fonds commercial – goodwill','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15021,'NSCF','CAPIT','XXXXXX','10508',15016,'Ecart de réévaluation : Immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15022,'NSCF','CAPIT','XXXXXX','1051',15015,'Ecart de réévaluation :Immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15023,'NSCF','CAPIT','XXXXXX','10511',15022,'Ecart de réévaluation : Terrains','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15024,'NSCF','CAPIT','XXXXXX','10512',15022,'Ecart de réévaluation : Agencements et aménagements de terrains','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15025,'NSCF','CAPIT','XXXXXX','10513',15022,'Ecart de réévaluation : Constructions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15026,'NSCF','CAPIT','XXXXXX','10515',15022,'Ecarts de réévaluation : Installations techniques','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15027,'NSCF','CAPIT','XXXXXX','10518',15022,'Ecart de réévaluation : Autres Immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15028,'NSCF','CAPIT','XXXXXX','1052',15015,'Ecart de réévaluation sur immobilisations financières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15029,'NSCF','CAPIT','XXXXXX','10526',15028,'Ecart de réévaluation : Titres de filiale','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15030,'NSCF','CAPIT','XXXXXX','10527',15028,'Ecart de réévaluation : Autres immobilisations financières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15031,'NSCF','CAPIT','XXXXXX','106',15001,'Réserves','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15032,'NSCF','CAPIT','XXXXXX','1061',15031,'Réserve légale','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15033,'NSCF','CAPIT','XXXXXX','1062',15031,'Réserve statutaire','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15034,'NSCF','CAPIT','XXXXXX','1063',15031,'Réserve ordinaire','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15035,'NSCF','CAPIT','XXXXXX','1064',15031,'Réserve réglementée','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15036,'NSCF','CAPIT','XXXXXX','10641',15035,'Réserve réglementée proprement dits','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15037,'NSCF','CAPIT','XXXXXX','10642',15035,'Plus-values nettes à long terme','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15038,'NSCF','CAPIT','XXXXXX','1068',15031,'Autres réserves','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15039,'NSCF','CAPIT','XXXXXX','107',15001,'Ecart d''équivalence','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15040,'NSCF','CAPIT','XXXXXX','108',15001,'Compte de l''exploitant','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15041,'NSCF','CAPIT','XXXXXX','109',15001,'Capital souscrit - non appelé (Solde débiteur à l''actif du bilan)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15042,'NSCF','CAPIT','XXXXXX','11',17000,'Report à nouveau (solde créditeur ou débiteur)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15043,'NSCF','CAPIT','XXXXXX','110',15042,'Report à nouveau (solde créditeur)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15044,'NSCF','CAPIT','XXXXXX','119',15042,'Report à nouveau (solde débiteur)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15045,'NSCF','CAPIT','XXXXXX','12',17000,'Résultat de l''exercice (bénéfice ou perte)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15046,'NSCF','CAPIT','XXXXXX','120',15045,'Résultat de l''exercice (bénéfice)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15047,'NSCF','CAPIT','XXXXXX','129',15045,'Résultat de l''exercice (perte)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15048,'NSCF','CAPIT','XXXXXX','13',17000,'Produits et charges différés – hors cycle d''exploitation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15049,'NSCF','CAPIT','XXXXXX','131',15048,'Subventions d''équipements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15050,'NSCF','CAPIT','XXXXXX','1312',15049,'Subventions d''équipements – Transfert gratuit d''immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15051,'NSCF','CAPIT','XXXXXX','1314',15049,'Subventions d''équipements – Financement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15052,'NSCF','CAPIT','XXXXXX','1319',15049,'Subventions d''investissement inscrites au compte de résultat','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15053,'NSCF','CAPIT','XXXXXX','132',15048,'Autres subventions d''investissements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15054,'NSCF','CAPIT','XXXXXX','133',15048,'Impôts différés actif','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15055,'NSCF','CAPIT','XXXXXX','134',15048,'Impôts différés passif','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15056,'NSCF','CAPIT','XXXXXX','138',15048,'Autres produits et charges différés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15057,'NSCF','CAPIT','XXXXXX','15',17000,'Provisions pour charges - passifs non courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15058,'NSCF','CAPIT','XXXXXX','153',15057,'Provisions pour pensions et obligations similaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15059,'NSCF','CAPIT','XXXXXX','155',15057,'Provisions pour impôts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15060,'NSCF','CAPIT','XXXXXX','156',15057,'Provisions pour renouvellement des immobilisations en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15061,'NSCF','CAPIT','XXXXXX','1560',15060,'Provisions pour renouvellement d''immobilisation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15062,'NSCF','CAPIT','XXXXXX','1562',15060,'Provisions pour renouvellement de gisements miniers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15063,'NSCF','CAPIT','XXXXXX','158',15057,'Autres provisions pour charges – passifs non courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15064,'NSCF','CAPIT','XXXXXX','1581',15063,'Provisions réglementées relatives aux immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15065,'NSCF','CAPIT','XXXXXX','1583',15063,'Provisions pour risques environnementaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15066,'NSCF','CAPIT','XXXXXX','16',17000,'Emprunts et dettes assimilées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15067,'NSCF','CAPIT','XXXXXX','161',15066,'Titres participatifs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15068,'NSCF','CAPIT','XXXXXX','162',15066,'Emprunts obligataires convertibles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15069,'NSCF','CAPIT','XXXXXX','163',15066,'Autres emprunts obligataires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15070,'NSCF','CAPIT','XXXXXX','164',15066,'Emprunts auprès des établissements de crédit','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15071,'NSCF','CAPIT','XXXXXX','165',15066,'Dépôts et cautionnements reçus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15072,'NSCF','CAPIT','XXXXXX','1651',15071,'Dépôts reçus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15073,'NSCF','CAPIT','XXXXXX','1655',15071,'Cautionnements reçus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15074,'NSCF','CAPIT','XXXXXX','167',15066,'Dettes sur contrat de location - financement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15075,'NSCF','CAPIT','XXXXXX','168',15066,'Autres emprunts et dettes assimilées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15076,'NSCF','CAPIT','XXXXXX','1681',15075,'Autres emprunts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15077,'NSCF','CAPIT','XXXXXX','1682',15075,'Emprunts auprès d''organismes internationaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15078,'NSCF','CAPIT','XXXXXX','1688',15075,'Intérêts courus sur emprunts et dettes assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15079,'NSCF','CAPIT','XXXXXX','169',15066,'Primes de remboursement des obligations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15080,'NSCF','CAPIT','XXXXXX','17',17000,'Dettes rattachées à des participations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15081,'NSCF','CAPIT','XXXXXX','171',15080,'Dettes rattachées à des participations groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15082,'NSCF','CAPIT','XXXXXX','172',15080,'Dettes rattachées à des participations hors groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15083,'NSCF','CAPIT','XXXXXX','173',15080,'Dettes rattachées à des sociétés en participation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15084,'NSCF','CAPIT','XXXXXX','1731',15083,'Principal','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15085,'NSCF','CAPIT','XXXXXX','1738',15083,'Intérêts courus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15086,'NSCF','CAPIT','XXXXXX','178',15080,'Autres dettes rattachées à des participations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15087,'NSCF','CAPIT','XXXXXX','18',17000,'Comptes de liaison des établissements et sociétés en participation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15088,'NSCF','CAPIT','XXXXXX','187',15087,'Biens et prestations de services échangés entre établissements (produits)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15089,'NSCF','CAPIT','XXXXXX','188',15087,'Comptes de liaison entre sociétés en participation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15090,'NSCF','IMMO','XXXXXX','2',0,'COMPTES D''IMMOBILISATIONS','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15091,'NSCF','IMMO','XXXXXX','20',15090,'Immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15092,'NSCF','IMMO','XXXXXX','203',15091,'Frais de développement immobilisables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15093,'NSCF','IMMO','XXXXXX','204',15091,'Logiciels informatiques et assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15094,'NSCF','IMMO','XXXXXX','205',15091,'Concessions et droits similaires, brevets, licences, marques','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15095,'NSCF','IMMO','XXXXXX','2051',15094,'Logiciels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15096,'NSCF','IMMO','XXXXXX','2052',15094,'Brevets','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15097,'NSCF','IMMO','XXXXXX','2053',15094,'Marques','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15098,'NSCF','IMMO','XXXXXX','2056',15094,'Licence','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15099,'NSCF','IMMO','XXXXXX','2058',15094,'Concession - autres droits similaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15100,'NSCF','IMMO','XXXXXX','207',15091,'Ecart d''acquisition - goodwill','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15101,'NSCF','IMMO','XXXXXX','208',15091,'Autres immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15102,'NSCF','IMMO','XXXXXX','21',15090,'Immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15103,'NSCF','IMMO','XXXXXX','211',15102,'Terrains','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15104,'NSCF','IMMO','XXXXXX','2110',15103,'Terrains de construction et chantiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15105,'NSCF','IMMO','XXXXXX','2111',15103,'Terrains nus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15106,'NSCF','IMMO','XXXXXX','2112',15103,'Terrains aménagés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15107,'NSCF','IMMO','XXXXXX','2114',15103,'Terrains bâtis','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15108,'NSCF','IMMO','XXXXXX','2115',15103,'Carrières et gisements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15109,'NSCF','IMMO','XXXXXX','2118',15103,'Autres terrains','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15110,'NSCF','IMMO','XXXXXX','212',15102,'Agencements et aménagements de terrains (même ventilation que celle du compte 211)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15111,'NSCF','IMMO','XXXXXX','213',15102,'Constructions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15112,'NSCF','IMMO','XXXXXX','2131',15111,'Bâtiments','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15113,'NSCF','IMMO','XXXXXX','21311',15112,'Bâtiments industriels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15114,'NSCF','IMMO','XXXXXX','21312',15112,'Bâtiments administratifs et commerciaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15115,'NSCF','IMMO','XXXXXX','21318',15112,'Autres ensembles immobiliers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15116,'NSCF','IMMO','XXXXXX','213181',15115,'Affectés aux opérations professionnelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15117,'NSCF','IMMO','XXXXXX','213188',15115,'Affectés aux opérations non professionnelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15118,'NSCF','IMMO','XXXXXX','2135',15111,'Installations générales - agencements - aménagements des constructions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15119,'NSCF','IMMO','XXXXXX','21351',15118,'Installation d''eau','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15120,'NSCF','IMMO','XXXXXX','21352',15118,'Installation d''électricité','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15121,'NSCF','IMMO','XXXXXX','21353',15118,'Installation de gaz','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15122,'NSCF','IMMO','XXXXXX','21354',15118,'Installation de vapeur','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15123,'NSCF','IMMO','XXXXXX','21355',15118,'Installation de protection et de sécurité','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15124,'NSCF','IMMO','XXXXXX','21356',15118,'Installation de télécommunication','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15125,'NSCF','IMMO','XXXXXX','21357',15118,'Installation d''aération, chauffage et climatisation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15126,'NSCF','IMMO','XXXXXX','21358',15118,'Autres agencements et installations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15127,'NSCF','IMMO','XXXXXX','2138',15111,'Ouvrages d''infrastructures','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15128,'NSCF','IMMO','XXXXXX','21381',15127,'Voies de terre','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15129,'NSCF','IMMO','XXXXXX','21382',15127,'Voies de fer','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15130,'NSCF','IMMO','XXXXXX','21383',15127,'Voies d''eau','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15131,'NSCF','IMMO','XXXXXX','21384',15127,'Barrages - puits d''eau','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15132,'NSCF','IMMO','XXXXXX','21385',15127,'Pistes d''aérodromes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15133,'NSCF','IMMO','XXXXXX','215',15102,'Installations techniques, matériel et outillage industriels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15134,'NSCF','IMMO','XXXXXX','2151',15133,'Installations complexes spécialisées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15135,'NSCF','IMMO','XXXXXX','2153',15133,'Installations à caractère spécifique','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15136,'NSCF','IMMO','XXXXXX','2154',15133,'Matériel industriel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15137,'NSCF','IMMO','XXXXXX','2155',15133,'Outillage industriel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15138,'NSCF','IMMO','XXXXXX','2157',15133,'Agencements et aménagements des matériels et outillage industriels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15139,'NSCF','IMMO','XXXXXX','218',15102,'Autres immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15140,'NSCF','IMMO','XXXXXX','2181',15139,'Installations générales, agencements, aménagements divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15141,'NSCF','IMMO','XXXXXX','2182',15139,'Matériel de transport','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15142,'NSCF','IMMO','XXXXXX','2183',15139,'Matériel de bureau et matériel informatique','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15143,'NSCF','IMMO','XXXXXX','2184',15139,'Mobilier','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15144,'NSCF','IMMO','XXXXXX','2185',15139,'Cheptel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15145,'NSCF','IMMO','XXXXXX','2186',15139,'Emballages récupérables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15146,'NSCF','IMMO','XXXXXX','22',15090,'Immobilisations mises en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15147,'NSCF','IMMO','XXXXXX','221',15146,'Terrains en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15148,'NSCF','IMMO','XXXXXX','222',15146,'Agencements et aménagements de terrains en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15149,'NSCF','IMMO','XXXXXX','223',15146,'Constructions en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15150,'NSCF','IMMO','XXXXXX','225',15146,'Installations techniques en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15151,'NSCF','IMMO','XXXXXX','228',15146,'Autres immobilisations corporelles en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15152,'NSCF','IMMO','XXXXXX','229',15146,'Droits du concédant','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15153,'NSCF','IMMO','XXXXXX','23',15090,'Immobilisations en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15154,'NSCF','IMMO','XXXXXX','232',15153,'Immobilisations corporelles en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15155,'NSCF','IMMO','XXXXXX','2322',15154,'Agencements et aménagements de Terrains en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15156,'NSCF','IMMO','XXXXXX','2323',15154,'Constructions en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15157,'NSCF','IMMO','XXXXXX','2325',15154,'Installations techniques, matériel et outillage industriels en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15158,'NSCF','IMMO','XXXXXX','2328',15154,'Autres immobilisations corporelles en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15159,'NSCF','IMMO','XXXXXX','237',15153,'Immobilisations incorporelles en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15160,'NSCF','IMMO','XXXXXX','238',15153,'Avances et acomptes versés sur commandes d''immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15161,'NSCF','IMMO','XXXXXX','2382',15160,'Avances et acomptes versés sur commandes d''immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15162,'NSCF','IMMO','XXXXXX','2387',15160,'Avances et acomptes versés sur commandes d''immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15163,'NSCF','IMMO','XXXXXX','26',15090,'Participations et créances rattachées à des participations (entreprises associées)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15164,'NSCF','IMMO','XXXXXX','261',15163,'Titres de filiales','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15165,'NSCF','IMMO','XXXXXX','2611',15164,'Actions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15166,'NSCF','IMMO','XXXXXX','2618',15164,'Autres titres','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15167,'NSCF','IMMO','XXXXXX','262',15163,'Autres titres de participation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15168,'NSCF','IMMO','XXXXXX','265',15163,'Titres de participation évalués par équivalence','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15169,'NSCF','IMMO','XXXXXX','266',15163,'Créances rattachées à des participations groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15170,'NSCF','IMMO','XXXXXX','2661',15169,'Créances liées à des participations groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15171,'NSCF','IMMO','XXXXXX','2665',15169,'Versements représentatifs d''apports non capitalisés (appel de fonds)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15172,'NSCF','IMMO','XXXXXX','2666',15169,'Avances consolidables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15173,'NSCF','IMMO','XXXXXX','2668',15169,'Dividendes à percevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15174,'NSCF','IMMO','XXXXXX','267',15163,'Créances rattachées à des participations hors groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15175,'NSCF','IMMO','XXXXXX','2671',15174,'Créances liées à des participations hors groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15176,'NSCF','IMMO','XXXXXX','2675',15174,'Versements représentatifs d''apports non capitalisés (appel de fonds)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15177,'NSCF','IMMO','XXXXXX','2676',15174,'Avances consolidables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15178,'NSCF','IMMO','XXXXXX','2677',15174,'Autres créances rattachées à des participations hors groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15179,'NSCF','IMMO','XXXXXX','2678',15174,'Dividendes et intérêts à percevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15180,'NSCF','IMMO','XXXXXX','268',15163,'Créances rattachées à des sociétés en participation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15181,'NSCF','IMMO','XXXXXX','2681',15180,'Principal','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15182,'NSCF','IMMO','XXXXXX','2688',15180,'Intérêts courus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15183,'NSCF','IMMO','XXXXXX','269',15163,'Versements restant à effectuer sur titres de participation non libérés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15184,'NSCF','IMMO','XXXXXX','27',15090,'Autres immobilisations financières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15185,'NSCF','IMMO','XXXXXX','271',15184,'Titres immobilisés autres que les titres immobilisés de l''activité de portefeuille','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15186,'NSCF','IMMO','XXXXXX','2711',15185,'Actions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15187,'NSCF','IMMO','XXXXXX','2718',15185,'Autres titres','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15188,'NSCF','IMMO','XXXXXX','272',15184,'Titres représentatifs de droit de créance','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15189,'NSCF','IMMO','XXXXXX','2721',15188,'Obligations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15190,'NSCF','IMMO','XXXXXX','2722',15188,'Bons','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15191,'NSCF','IMMO','XXXXXX','273',15184,'Titres immobilisés de l''activité de portefeuille','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15192,'NSCF','IMMO','XXXXXX','2731',15191,'Actions immobilisées de l''activité de portefeuille','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15193,'NSCF','IMMO','XXXXXX','2732',15191,'Obligations remboursables en actions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15194,'NSCF','IMMO','XXXXXX','2733',15191,'Obligations convertibles en actions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15195,'NSCF','IMMO','XXXXXX','274',15184,'Prêts et créances sur contrat de location – financement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15196,'NSCF','IMMO','XXXXXX','2741',15195,'Prêts participatifs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15197,'NSCF','IMMO','XXXXXX','2742',15195,'Prêts aux associés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15198,'NSCF','IMMO','XXXXXX','2743',15195,'Prêts au personnel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15199,'NSCF','IMMO','XXXXXX','2745',15195,'Créances sur contrat de location - financement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15200,'NSCF','IMMO','XXXXXX','2748',15195,'Autres prêts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15201,'NSCF','IMMO','XXXXXX','275',15184,'Dépôts et cautionnements versés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15202,'NSCF','IMMO','XXXXXX','2751',15201,'Dépôts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15203,'NSCF','IMMO','XXXXXX','2755',15201,'Cautionnements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15204,'NSCF','IMMO','XXXXXX','276',15184,'Autres créances immobilisées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15205,'NSCF','IMMO','XXXXXX','2761',15204,'Créances diverses','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15206,'NSCF','IMMO','XXXXXX','2768',15204,'Intérêts courus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15207,'NSCF','IMMO','XXXXXX','27682',15206,'Autres créances sur titres immobilisés (droit de créance)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15208,'NSCF','IMMO','XXXXXX','27684',15206,'Autres créances sur prêts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15209,'NSCF','IMMO','XXXXXX','27685',15206,'Autres créances sur dépôts et cautionnements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15210,'NSCF','IMMO','XXXXXX','27688',15206,'Autres créances sur créances diverses','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15211,'NSCF','IMMO','XXXXXX','279',15184,'Versements restant à effectuer sur titres immobilisés non libérés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15212,'NSCF','IMMO','XXXXXX','28',15090,'Amortissement des immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15213,'NSCF','IMMO','XXXXXX','280',15212,'Amortissement des immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15214,'NSCF','IMMO','XXXXXX','2803',15213,'Amortissement des frais de recherche et de développement immobilisables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15215,'NSCF','IMMO','XXXXXX','2804',15213,'Amortissement. des logiciels informatiques et assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15216,'NSCF','IMMO','XXXXXX','2805',15213,'Amortissement concessions et droits similaires, brevets, licences, marques.','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15217,'NSCF','IMMO','XXXXXX','2807',15213,'Amortissement écart d''acquisition - Goodwill','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15218,'NSCF','IMMO','XXXXXX','2808',15213,'Amortissement autres immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15219,'NSCF','IMMO','XXXXXX','281',15212,'Amortissement des immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15220,'NSCF','IMMO','XXXXXX','2812',15219,'Amortissement des agencements et aménagement de terrains','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15221,'NSCF','IMMO','XXXXXX','2813',15219,'Amortissement des constructions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15222,'NSCF','IMMO','XXXXXX','2815',15219,'Amortissement des installations techniques','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15223,'NSCF','IMMO','XXXXXX','2818',15219,'Amortissement des autres immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15224,'NSCF','IMMO','XXXXXX','282',15212,'Amortissement des immobilisations mises en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15225,'NSCF','IMMO','XXXXXX','29',15090,'Pertes de valeur sur immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15226,'NSCF','IMMO','XXXXXX','290',15225,'Pertes de valeur sur immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15227,'NSCF','IMMO','XXXXXX','2903',15226,'Pertes de valeurs sur frais de recherche et de développement immobilisables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15228,'NSCF','IMMO','XXXXXX','2904',15226,'Pertes de valeur sur logiciels informatiques et assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15229,'NSCF','IMMO','XXXXXX','2905',15226,'Pertes de valeur sur concessions et droits similaires, brevets, licences, marques.','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15230,'NSCF','IMMO','XXXXXX','2907',15226,'Pertes de valeur sur écart d''acquisition – Goodwill','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15231,'NSCF','IMMO','XXXXXX','2908',15226,'Pertes de valeur sur autres immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15232,'NSCF','IMMO','XXXXXX','291',15225,'Pertes de valeurs sur immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15233,'NSCF','IMMO','XXXXXX','2912',15232,'Pertes de valeur sur agencements et aménagements de terrains','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15234,'NSCF','IMMO','XXXXXX','2913',15232,'Pertes de valeur sur constructions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15235,'NSCF','IMMO','XXXXXX','2915',15232,'Pertes de valeur sur installations techniques','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15236,'NSCF','IMMO','XXXXXX','2918',15232,'Pertes de valeur sur autres immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15237,'NSCF','IMMO','XXXXXX','292',15225,'Pertes de valeur sur immobilisations mises en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15238,'NSCF','IMMO','XXXXXX','293',15225,'Pertes de valeur sur immobilisations en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15239,'NSCF','IMMO','XXXXXX','2931',15238,'Pertes de valeur sur immobilisations corporelles en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15240,'NSCF','IMMO','XXXXXX','2932',15238,'Pertes de valeur sur immobilisations incorporelles en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15241,'NSCF','IMMO','XXXXXX','296',15225,'Pertes de valeur sur participations et créances rattachées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15242,'NSCF','IMMO','XXXXXX','2961',15241,'Pertes de valeur sur titres de filiales','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15243,'NSCF','IMMO','XXXXXX','2962',15241,'Pertes de valeur sur autres formes de participations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15244,'NSCF','IMMO','XXXXXX','2965',15241,'Pertes de valeur sur titres de participations évalués par équivalence','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15245,'NSCF','IMMO','XXXXXX','2966',15241,'Pertes de valeur sur créances rattachées à des participations groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15246,'NSCF','IMMO','XXXXXX','2967',15241,'Pertes de valeur sur créances rattachées à des participations hors groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15247,'NSCF','IMMO','XXXXXX','2968',15241,'Pertes de valeur sur créances rattachées à des sociétés en participations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15248,'NSCF','IMMO','XXXXXX','297',15225,'Pertes de valeur sur autres titres immobilisés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15249,'NSCF','IMMO','XXXXXX','2971',15248,'Pertes de valeur sur titres immobilisés autres que les titres immobilisés autres que TIAP (droits de propriété)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15250,'NSCF','IMMO','XXXXXX','2972',15248,'Pertes de valeur sur titres représentatifs de droit de créance','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15251,'NSCF','IMMO','XXXXXX','2973',15248,'Pertes de valeur sur titres immobilisés de l''activité de portefeuille','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15252,'NSCF','IMMO','XXXXXX','2974',15248,'Pertes de valeur sur contrat de location – financement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15253,'NSCF','IMMO','XXXXXX','2975',15248,'Pertes de valeur sur dépôts et cautionnements versés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15254,'NSCF','IMMO','XXXXXX','2976',15248,'Pertes de valeur sur autres créances immobilisées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15255,'NSCF','IMMO','XXXXXX','298',15225,'Pertes de valeur sur autres instruments financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15256,'NSCF','STOCK','XXXXXX','3',0,'COMPTES DE STOCKS ET ENCOURS','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15257,'NSCF','STOCK','XXXXXX','30',15256,'Stocks de marchandises','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15258,'NSCF','STOCK','XXXXXX','31',15256,'Matières premières et fournitures','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15259,'NSCF','STOCK','XXXXXX','311',15258,'Matières (ou groupe) A','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15260,'NSCF','STOCK','XXXXXX','312',15258,'Matières (ou groupe) B','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15261,'NSCF','STOCK','XXXXXX','313',15258,'Matières ...','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15262,'NSCF','STOCK','XXXXXX','32',15256,'Autres approvisionnements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15263,'NSCF','STOCK','XXXXXX','321',15262,'Matières consommables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15264,'NSCF','STOCK','XXXXXX','322',15262,'Fournitures consommables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15265,'NSCF','STOCK','XXXXXX','326',15262,'Emballages','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15266,'NSCF','STOCK','XXXXXX','3261',15265,'Emballages perdus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15267,'NSCF','STOCK','XXXXXX','3265',15265,'Emballages récupérables non identifiables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15268,'NSCF','STOCK','XXXXXX','3267',15265,'Emballages à usage mixte','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15269,'NSCF','STOCK','XXXXXX','33',15256,'En-cours de production de biens','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15270,'NSCF','STOCK','XXXXXX','331',15269,'Produits en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15271,'NSCF','STOCK','XXXXXX','335',15269,'Travaux en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15272,'NSCF','STOCK','XXXXXX','34',15256,'En-cours de production de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15273,'NSCF','STOCK','XXXXXX','341',15272,'Etudes en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15274,'NSCF','STOCK','XXXXXX','345',15272,'Prestations de services en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15275,'NSCF','STOCK','XXXXXX','35',15256,'Stocks de produits','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15276,'NSCF','STOCK','XXXXXX','351',15275,'Produits intermédiaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15277,'NSCF','STOCK','XXXXXX','355',15275,'Produits finis','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15278,'NSCF','STOCK','XXXXXX','358',15275,'Produits résiduels ou matières de récupération','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15279,'NSCF','STOCK','XXXXXX','3581',15278,'Déchets','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15280,'NSCF','STOCK','XXXXXX','3585',15278,'Rebuts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15281,'NSCF','STOCK','XXXXXX','3586',15278,'Matières de récupération','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15282,'NSCF','STOCK','XXXXXX','36',15256,'Stocks provenant d''immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15283,'NSCF','STOCK','XXXXXX','37',15256,'Stocks à l''extérieur','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15284,'NSCF','STOCK','XXXXXX','370',15283,'Stocks de marchandises l''extérieur','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15285,'NSCF','STOCK','XXXXXX','3700',15284,'Stocks en cours de route','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15286,'NSCF','STOCK','XXXXXX','3701',15284,'Stocks de marchandises en dépôt à l''extérieur','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15287,'NSCF','STOCK','XXXXXX','3702',15284,'Stocks de marchandises en consignation à l''extérieur','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15288,'NSCF','STOCK','XXXXXX','371',15283,'Stocks de matières premières et fournitures à l''extérieur','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15289,'NSCF','STOCK','XXXXXX','375',15283,'Stocks de produits à l''extérieur','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15290,'NSCF','STOCK','XXXXXX','38',15256,'Achats stockés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15291,'NSCF','STOCK','XXXXXX','380',15290,'Marchandises stockées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15292,'NSCF','STOCK','XXXXXX','381',15290,'Matières premières et fournitures stockées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15293,'NSCF','STOCK','XXXXXX','382',15290,'Autres approvisionnements stockés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15294,'NSCF','STOCK','XXXXXX','39',15256,'Pertes de valeur sur stocks et en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15295,'NSCF','STOCK','XXXXXX','390',15294,'Pertes de valeur sur stocks de marchandises','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15296,'NSCF','STOCK','XXXXXX','391',15294,'Pertes de valeur sur matières premières et fournitures de biens','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15297,'NSCF','STOCK','XXXXXX','392',15294,'Pertes de valeur sur autres approvisionnements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15298,'NSCF','STOCK','XXXXXX','393',15294,'Pertes de valeur sur en-cours de production de de biens','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15299,'NSCF','STOCK','XXXXXX','394',15294,'Pertes de valeur sur en-cours de production de de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15300,'NSCF','STOCK','XXXXXX','395',15294,'Pertes de valeur sur stocks de produits','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15301,'NSCF','STOCK','XXXXXX','397',15294,'Pertes de valeur sur stocks à l''extérieur','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15302,'NSCF','THIRDPARTY','XXXXXX','4',0,'COMPTES DE TIERS','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15303,'NSCF','THIRDPARTY','XXXXXX','40',15302,'Fournisseurs et comptes rattachés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15304,'NSCF','THIRDPARTY','XXXXXX','401',15303,'Fournisseurs de stocks et services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15305,'NSCF','THIRDPARTY','XXXXXX','4011',15304,'Fournisseurs - Achats de biens et prestations de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15306,'NSCF','THIRDPARTY','XXXXXX','4017',15304,'Fournisseurs - Retenues de garantie','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15307,'NSCF','THIRDPARTY','XXXXXX','403',15303,'Fournisseurs - Effets à payer','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15308,'NSCF','THIRDPARTY','XXXXXX','404',15303,'Fournisseurs d''immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15309,'NSCF','THIRDPARTY','XXXXXX','4041',15308,'Fournisseurs - Achats d''immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15310,'NSCF','THIRDPARTY','XXXXXX','4047',15308,'Fournisseurs d''immobilisations – Retenues de garantie','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15311,'NSCF','THIRDPARTY','XXXXXX','405',15303,'Fournisseurs d''immobilisations - Effets à payer','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15312,'NSCF','THIRDPARTY','XXXXXX','408',15303,'Fournisseurs - factures non parvenues','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15313,'NSCF','THIRDPARTY','XXXXXX','4081',15312,'Fournisseurs de stocks - Factures non parvenues','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15314,'NSCF','THIRDPARTY','XXXXXX','4084',15312,'Fournisseurs d''immobilisations – Factures non parvenues','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15315,'NSCF','THIRDPARTY','XXXXXX','4088',15312,'Fournisseurs - Intérêts courus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15316,'NSCF','THIRDPARTY','XXXXXX','409',15303,'Fournisseurs débiteurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15317,'NSCF','THIRDPARTY','XXXXXX','4091',15316,'Fournisseurs - Avances et acomptes versés sur commandes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15318,'NSCF','THIRDPARTY','XXXXXX','4096',15316,'Fournisseurs - Créances pour emballages et matériel à rendre ','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15319,'NSCF','THIRDPARTY','XXXXXX','4097',15316,'Fournisseurs - Autres avoirs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15320,'NSCF','THIRDPARTY','XXXXXX','4098',15316,'Rabais, remises, ristournes à obtenir et autres avoirs non encore reçus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15321,'NSCF','THIRDPARTY','XXXXXX','41',15302,'Clients et comptes rattachés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15322,'NSCF','THIRDPARTY','XXXXXX','411',15321,'Clients','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15323,'NSCF','THIRDPARTY','XXXXXX','4111',15322,'Clients - Ventes de biens ou de prestations de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15324,'NSCF','THIRDPARTY','XXXXXX','4117',15322,'Clients - Retenues de garantie','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15325,'NSCF','THIRDPARTY','XXXXXX','413',15321,'Clients - Effets à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15326,'NSCF','THIRDPARTY','XXXXXX','416',15321,'Clients douteux (litigieux)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15327,'NSCF','THIRDPARTY','XXXXXX','417',15321,'Créances sur travaux ou prestations en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15328,'NSCF','THIRDPARTY','XXXXXX','418',15321,'Clients - Produits non encore facturés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15329,'NSCF','THIRDPARTY','XXXXXX','4181',15328,'Clients - Factures à établir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15330,'NSCF','THIRDPARTY','XXXXXX','4188',15328,'Clients - Intérêts courus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15331,'NSCF','THIRDPARTY','XXXXXX','419',15321,'Clients créditeurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15332,'NSCF','THIRDPARTY','XXXXXX','4191',15331,'Clients - Avances et acomptes reçus sur commandes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15333,'NSCF','THIRDPARTY','XXXXXX','4196',15331,'Clients - Dettes sur emballages et matériels consignés autres avoirs à établir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15334,'NSCF','THIRDPARTY','XXXXXX','4197',15331,'Clients - Autres avoirs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15335,'NSCF','THIRDPARTY','XXXXXX','4198',15331,'Rabais, remises, ristournes à accorder et','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15336,'NSCF','THIRDPARTY','XXXXXX','42',15302,'Personnel et comptes rattachés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15337,'NSCF','THIRDPARTY','XXXXXX','421',15336,'Personnel - Rémunérations dues','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15338,'NSCF','THIRDPARTY','XXXXXX','422',15336,'Fonds des œuvres sociales','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15339,'NSCF','THIRDPARTY','XXXXXX','423',15336,'Participation des salariés aux résultats','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15340,'NSCF','THIRDPARTY','XXXXXX','425',15336,'Personnel - Avances et acomptes accordés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15341,'NSCF','THIRDPARTY','XXXXXX','426',15336,'Personnel - Dépôts reçus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15342,'NSCF','THIRDPARTY','XXXXXX','427',15336,'Personnel - Oppositions sur salaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15343,'NSCF','THIRDPARTY','XXXXXX','428',15336,'Personnel - Charges à payer et produits à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15344,'NSCF','THIRDPARTY','XXXXXX','4286',15343,'Personnel, charges à payer','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15345,'NSCF','THIRDPARTY','XXXXXX','4287',15343,'Personnel, produits à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15346,'NSCF','THIRDPARTY','XXXXXX','43',15302,'Organismes sociaux et comptes rattachés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15347,'NSCF','THIRDPARTY','XXXXXX','431',15346,'Sécurité sociale','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15348,'NSCF','THIRDPARTY','XXXXXX','432',15346,'Autres organismes sociaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15349,'NSCF','THIRDPARTY','XXXXXX','438',15346,'Organismes sociaux - Charges à payer et produits à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15350,'NSCF','THIRDPARTY','XXXXXX','4386',15349,'Organismes sociaux, charges à payer','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15351,'NSCF','THIRDPARTY','XXXXXX','4387',15349,'Organismes sociaux, produits à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15352,'NSCF','THIRDPARTY','XXXXXX','44',15302,'État, collectivités publiques, organismes internationaux et comptes rattachés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15353,'NSCF','THIRDPARTY','XXXXXX','441',15352,'État et collectivités publiques, subventions à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15354,'NSCF','THIRDPARTY','XXXXXX','4411',15353,'Subventions d''investissement à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15355,'NSCF','THIRDPARTY','XXXXXX','4417',15353,'Subventions d''exploitation à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15356,'NSCF','THIRDPARTY','XXXXXX','4418',15353,'Subventions d''équilibre à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15357,'NSCF','THIRDPARTY','XXXXXX','4419',15353,'Avances sur subventions à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15358,'NSCF','THIRDPARTY','XXXXXX','442',15352,'Impôts et taxes recouvrables sur des tiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15359,'NSCF','THIRDPARTY','XXXXXX','443',15352,'Opérations particulières avec l''Etat et les collectivités publiques','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15360,'NSCF','THIRDPARTY','XXXXXX','444',15352,'Etat - Impôts sur les résultats','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15361,'NSCF','THIRDPARTY','XXXXXX','445',15352,'Etat - Taxes sur le chiffre d''affaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15362,'NSCF','THIRDPARTY','XXXXXX','4451',15361,'Taxes sur le chiffre d''affaires à décaisser','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15363,'NSCF','THIRDPARTY','XXXXXX','44511',15362,'T.V.A. à décaisser','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15364,'NSCF','THIRDPARTY','XXXXXX','44518',15362,'Autres taxes assimilées à décaisser','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15365,'NSCF','THIRDPARTY','XXXXXX','4456',15361,'Taxes sur le chiffre d''affaires déductibles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15366,'NSCF','THIRDPARTY','XXXXXX','44562',15365,'T.V.A. sur immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15367,'NSCF','THIRDPARTY','XXXXXX','44566',15365,'T.V.A. sur autres biens et services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15368,'NSCF','THIRDPARTY','XXXXXX','44567',15365,'Crédit de T.V.A. à reporter','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15369,'NSCF','THIRDPARTY','XXXXXX','4457',15361,'Taxes sur le chiffre d''affaires collectées par l''entreprise','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15370,'NSCF','THIRDPARTY','XXXXXX','44571',15369,'T.V.A. collectée','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15371,'NSCF','THIRDPARTY','XXXXXX','44578',15369,'Autres taxes collectée assimilées à la T.V.A.','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15372,'NSCF','THIRDPARTY','XXXXXX','4458',15361,'Taxes sur le chiffre d''affaires à régulariser ou en attente','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15373,'NSCF','THIRDPARTY','XXXXXX','44586',15372,'Taxes sur le chiffre d''affaires sur factures non parvenues','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15374,'NSCF','THIRDPARTY','XXXXXX','44587',15372,'Taxes sur le chiffre d''affaires sur factures à établir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15375,'NSCF','THIRDPARTY','XXXXXX','446',15352,'Organismes internationaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15376,'NSCF','THIRDPARTY','XXXXXX','447',15352,'Autres impôts, taxes et versements assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15377,'NSCF','THIRDPARTY','XXXXXX','448',15352,'Etat - Charges à payer et produits à recevoir (hors impôts)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15378,'NSCF','THIRDPARTY','XXXXXX','4486',15377,'Etat, charges à payer','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15379,'NSCF','THIRDPARTY','XXXXXX','4487',15377,'Etat, produits à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15380,'NSCF','THIRDPARTY','XXXXXX','4488',15377,'Obligations cautionnées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15381,'NSCF','THIRDPARTY','XXXXXX','45',15302,'Groupe et associés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15382,'NSCF','THIRDPARTY','XXXXXX','451',15381,'Opérations groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15383,'NSCF','THIRDPARTY','XXXXXX','4510',15382,'Groupe, avances accordées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15384,'NSCF','THIRDPARTY','XXXXXX','4511',15382,'Groupe, avances reçues','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15385,'NSCF','THIRDPARTY','XXXXXX','455',15381,'Associés - Comptes courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15386,'NSCF','THIRDPARTY','XXXXXX','4551',15385,'Principal','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15387,'NSCF','THIRDPARTY','XXXXXX','4558',15385,'Intérêts courus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15388,'NSCF','THIRDPARTY','XXXXXX','456',15381,'Associés - Opérations sur le capital','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15389,'NSCF','THIRDPARTY','XXXXXX','4561',15388,'Associés - Comptes d''apport en société','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15390,'NSCF','THIRDPARTY','XXXXXX','45611',15389,'Apports en nature','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15391,'NSCF','THIRDPARTY','XXXXXX','45615',15389,'Apports en numéraire','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15392,'NSCF','THIRDPARTY','XXXXXX','4562',15388,'Apporteurs - Capital appelé, non versé','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15393,'NSCF','THIRDPARTY','XXXXXX','45621',15392,'Actionnaires - Capital souscrit et appelé, non versé','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15394,'NSCF','THIRDPARTY','XXXXXX','45625',15392,'Associés - Capital appelé, non versé','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15395,'NSCF','THIRDPARTY','XXXXXX','4563',15388,'Associés - versements reçus sur augmentation de capital','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15396,'NSCF','THIRDPARTY','XXXXXX','4564',15388,'Associés - Versements anticipés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15397,'NSCF','THIRDPARTY','XXXXXX','4566',15388,'Actionnaires défaillants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15398,'NSCF','THIRDPARTY','XXXXXX','4567',15388,'Associés - Capital à rembourser','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15399,'NSCF','THIRDPARTY','XXXXXX','457',15381,'Associés - Dividendes à payer','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15400,'NSCF','THIRDPARTY','XXXXXX','458',15381,'Associés - Opérations faites en commun ou en groupement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15401,'NSCF','THIRDPARTY','XXXXXX','4581',15400,'Opérations courantes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15402,'NSCF','THIRDPARTY','XXXXXX','4588',15400,'Intérêts courus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15403,'NSCF','THIRDPARTY','XXXXXX','46',15302,'Débiteurs divers et créditeurs divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15404,'NSCF','THIRDPARTY','XXXXXX','462',15403,'Créances sur cessions d''immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15405,'NSCF','THIRDPARTY','XXXXXX','464',15403,'Dettes sur acquisitions valeurs mobilières de placement et instruments financiers dérivés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15406,'NSCF','THIRDPARTY','XXXXXX','465',15403,'Créances sur cessions valeurs mobilières de placement et instruments financiers dérivés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15407,'NSCF','THIRDPARTY','XXXXXX','467',15403,'Autres comptes débiteurs ou créditeurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15408,'NSCF','THIRDPARTY','XXXXXX','468',15403,'Diverses charges à payer et produits à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15409,'NSCF','THIRDPARTY','XXXXXX','4686',15408,'Diverses charges à payer','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15410,'NSCF','THIRDPARTY','XXXXXX','4687',15408,'Divers produits à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15411,'NSCF','THIRDPARTY','XXXXXX','47',15302,'Comptes transitoires ou d''attente','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15412,'NSCF','THIRDPARTY','XXXXXX','471',15411,'Compte d''attente 1','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15413,'NSCF','THIRDPARTY','XXXXXX','472',15411,'Compte d''attente 2','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15414,'NSCF','THIRDPARTY','XXXXXX','473',15411,'Compte d''attente 3','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15415,'NSCF','THIRDPARTY','XXXXXX','474',15411,'Compte d''attente 4','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15416,'NSCF','THIRDPARTY','XXXXXX','475',15411,'Compte d''attente 5','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15417,'NSCF','THIRDPARTY','XXXXXX','476',15411,'Différence de conversion - Actif','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15418,'NSCF','THIRDPARTY','XXXXXX','4761',15417,'Diminution des créances','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15419,'NSCF','THIRDPARTY','XXXXXX','4762',15417,'Augmentation des dettes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15420,'NSCF','THIRDPARTY','XXXXXX','4768',15417,'Différences compensées par couverture de change','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15421,'NSCF','THIRDPARTY','XXXXXX','477',15411,'Différences de conversion - Passif','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15422,'NSCF','THIRDPARTY','XXXXXX','4771',15421,'Augmentation des créances','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15423,'NSCF','THIRDPARTY','XXXXXX','4772',15421,'Diminution des dettes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15424,'NSCF','THIRDPARTY','XXXXXX','4778',15421,'Différences compensées par couverture de change','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15425,'NSCF','THIRDPARTY','XXXXXX','478',15411,'Autres comptes transitoires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15426,'NSCF','THIRDPARTY','XXXXXX','48',15302,'Charges ou produits constatés d''avance et provisions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15427,'NSCF','THIRDPARTY','XXXXXX','481',15426,'Provisions, passifs courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15428,'NSCF','THIRDPARTY','XXXXXX','486',15426,'Charges constatées d''avance','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15429,'NSCF','THIRDPARTY','XXXXXX','487',15426,'Produits constatés d''avance','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15430,'NSCF','THIRDPARTY','XXXXXX','49',15302,'Pertes de valeur sur comptes de tiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15431,'NSCF','THIRDPARTY','XXXXXX','491',15430,'Pertes de valeur sur comptes de clients','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15432,'NSCF','THIRDPARTY','XXXXXX','495',15430,'Pertes de valeur sur comptes du groupe et sur associés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15433,'NSCF','THIRDPARTY','XXXXXX','4951',15432,'Pertes de valeur sur comptes du groupe','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15434,'NSCF','THIRDPARTY','XXXXXX','4955',15432,'Pertes de valeur sur comptes courants des associés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15435,'NSCF','THIRDPARTY','XXXXXX','496',15430,'Pertes de valeur sur comptes de débiteurs divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15436,'NSCF','THIRDPARTY','XXXXXX','4962',15435,'Créances sur cessions d''immobilisations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15437,'NSCF','THIRDPARTY','XXXXXX','4965',15435,'Créances sur cessions de valeurs mobilières de placement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15438,'NSCF','THIRDPARTY','XXXXXX','4967',15435,'Autres comptes débiteurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15439,'NSCF','THIRDPARTY','XXXXXX','498',15430,'Pertes de valeur sur comptes de débiteurs divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15440,'NSCF','FINAN','XXXXXX','5',0,'COMPTES FINANCIERS','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15441,'NSCF','FINAN','XXXXXX','50',15440,'Valeurs mobilières de placement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15442,'NSCF','FINAN','XXXXXX','501',15441,'Parts dans des entreprises liées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15443,'NSCF','FINAN','XXXXXX','502',15441,'Actions propres','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15444,'NSCF','FINAN','XXXXXX','503',15441,'Autres actions ou titres conférant un droit de propriété','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15445,'NSCF','FINAN','XXXXXX','5031',15444,'Titres cotés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15446,'NSCF','FINAN','XXXXXX','5032',15444,'Titres non cotés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15447,'NSCF','FINAN','XXXXXX','506',15441,'Obligations, bons du Trésor et bons de caisse à court terme','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15448,'NSCF','FINAN','XXXXXX','5061',15447,'Obligations à court termes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15449,'NSCF','FINAN','XXXXXX','5062',15447,'Bons du trésor à court terme','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15450,'NSCF','FINAN','XXXXXX','5063',15447,'Bons de caisse à court terme','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15451,'NSCF','FINAN','XXXXXX','508',15441,'Autres valeurs mobilières de placement et créances assimilées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15452,'NSCF','FINAN','XXXXXX','5088',15451,'Autres valeurs mobilières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15453,'NSCF','FINAN','XXXXXX','5082',15451,'Bons de souscription','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15454,'NSCF','FINAN','XXXXXX','5083',15451,'Intérêts courus sur obligations, bons et valeurs assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15455,'NSCF','FINAN','XXXXXX','509',15441,'Versements restant à effectuer sur valeurs mobilières de placement non libérées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15456,'NSCF','FINAN','XXXXXX','51',15440,'Banques, établissements financiers et assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15457,'NSCF','FINAN','XXXXXX','511',15456,'Valeurs à l''encaissement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15458,'NSCF','FINAN','XXXXXX','5111',15457,'Coupons échus à l''encaissement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15459,'NSCF','FINAN','XXXXXX','5112',15457,'Chèques à encaisser','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15460,'NSCF','FINAN','XXXXXX','5113',15457,'Effets à l''encaissement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15461,'NSCF','FINAN','XXXXXX','5114',15457,'Effets à l''escompte','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15462,'NSCF','FINAN','XXXXXX','5115',15457,'Cartes bancaires à l''encaissement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15463,'NSCF','FINAN','XXXXXX','512',15456,'Banques comptes courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15464,'NSCF','FINAN','XXXXXX','514',15456,'Chèques postaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15465,'NSCF','FINAN','XXXXXX','515',15456,'Caisses du Trésor et des établissements publics','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15466,'NSCF','FINAN','XXXXXX','516',15456,'Sociétés de bourse','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15467,'NSCF','FINAN','XXXXXX','517',15456,'Autres organismes financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15468,'NSCF','FINAN','XXXXXX','518',15456,'Intérêts courus','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15469,'NSCF','FINAN','XXXXXX','5181',15468,'Intérêts courus à payer','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15470,'NSCF','FINAN','XXXXXX','5188',15468,'Intérêts courus à recevoir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15471,'NSCF','FINAN','XXXXXX','519',15456,'Concours bancaires courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15472,'NSCF','FINAN','XXXXXX','5191',15471,'Crédit de mobilisation de créances commerciales (CMCC)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15473,'NSCF','FINAN','XXXXXX','5192',15471,'Crédit documentaire','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15474,'NSCF','FINAN','XXXXXX','5193',15471,'Mobilisation de créances nées à l''étranger','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15475,'NSCF','FINAN','XXXXXX','5198',15471,'Intérêts courus sur concours bancaires courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15476,'NSCF','FINAN','XXXXXX','52',15440,'Instruments de trésorerie','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15477,'NSCF','FINAN','XXXXXX','53',15440,'Caisse','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15478,'NSCF','FINAN','XXXXXX','54',15440,'Régies d''avance et accréditifs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15479,'NSCF','FINAN','XXXXXX','541',15478,'Régie d''avance','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15480,'NSCF','FINAN','XXXXXX','542',15478,'Accréditifs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15481,'NSCF','FINAN','XXXXXX','58',15440,'Virements internes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15482,'NSCF','FINAN','XXXXXX','581',15481,'Virements de fonds','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15483,'NSCF','FINAN','XXXXXX','588',15481,'Autres virements internes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15484,'NSCF','FINAN','XXXXXX','59',15440,'Pertes de valeur des actifs financiers courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15485,'NSCF','FINAN','XXXXXX','591',15484,'Pertes de valeur des dépôts en banque et autres établissements financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15486,'NSCF','FINAN','XXXXXX','594',15484,'Pertes de valeur sur des régies d''avance et accréditifs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15487,'NSCF','EXPENSE','XXXXXX','6',0,'COMPTES DE CHARGES','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15488,'NSCF','EXPENSE','XXXXXX','60',15487,'Achats consommées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15489,'NSCF','EXPENSE','XXXXXX','600',15488,'Achats de marchandises vendues','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15490,'NSCF','EXPENSE','XXXXXX','601',15488,'Matières premières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15491,'NSCF','EXPENSE','XXXXXX','602',15488,'Autres approvisionnements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15492,'NSCF','EXPENSE','XXXXXX','603',15488,'Variations des stocks ','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15493,'NSCF','EXPENSE','XXXXXX','6030',15492,'Variations des stocks de marchandises','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15494,'NSCF','EXPENSE','XXXXXX','6031',15492,'Variations des stocks de matières premières et fournitures','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15495,'NSCF','EXPENSE','XXXXXX','6032',15492,'Variations des stocks d''autres approvisionnements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15496,'NSCF','EXPENSE','XXXXXX','604',15488,'Achats d''études et prestations de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15497,'NSCF','EXPENSE','XXXXXX','605',15488,'Achats de matériel, équipements et travaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15498,'NSCF','EXPENSE','XXXXXX','607',15488,'Achats non stockés de matière et fournitures','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15499,'NSCF','EXPENSE','XXXXXX','6071',15498,'Fournitures non stockables (eau, énergie)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15500,'NSCF','EXPENSE','XXXXXX','6073',15498,'Fournitures d''entretien et de petit équipement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15501,'NSCF','EXPENSE','XXXXXX','6074',15498,'Fournitures administratives','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15502,'NSCF','EXPENSE','XXXXXX','6078',15498,'Autres matières et fournitures','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15503,'NSCF','EXPENSE','XXXXXX','608',15488,'Frais accessoires sur achats (FAA)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15504,'NSCF','EXPENSE','XXXXXX','609',15488,'Rabais, remises et ristournes obtenus sur achats','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15505,'NSCF','EXPENSE','XXXXXX','61',15487,'Services extérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15506,'NSCF','EXPENSE','XXXXXX','611',15505,'Sous-traitance générale','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15507,'NSCF','EXPENSE','XXXXXX','613',15505,'Locations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15508,'NSCF','EXPENSE','XXXXXX','6132',15507,'Locations immobilières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15509,'NSCF','EXPENSE','XXXXXX','6135',15507,'Locations mobilières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15510,'NSCF','EXPENSE','XXXXXX','6136',15507,'Malis sur emballages','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15511,'NSCF','EXPENSE','XXXXXX','614',15505,'Charges locatives et charges de copropriété','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15512,'NSCF','EXPENSE','XXXXXX','615',15505,'Entretien, réparations et maintenance','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15513,'NSCF','EXPENSE','XXXXXX','6152',15512,'Sur biens immobiliers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15514,'NSCF','EXPENSE','XXXXXX','6155',15512,'Sur biens mobiliers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15515,'NSCF','EXPENSE','XXXXXX','6156',15512,'Maintenance','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15516,'NSCF','EXPENSE','XXXXXX','616',15505,'Primes d''assurances','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15517,'NSCF','EXPENSE','XXXXXX','6161',15516,'Multirisques','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15518,'NSCF','EXPENSE','XXXXXX','6162',15516,'Assurance obligatoire dommage construction','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15519,'NSCF','EXPENSE','XXXXXX','6163',15516,'Assurance-transport','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15520,'NSCF','EXPENSE','XXXXXX','61636',15519,'sur achats','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15521,'NSCF','EXPENSE','XXXXXX','61637',15519,'sur ventes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15522,'NSCF','EXPENSE','XXXXXX','61638',15519,'sur autres biens','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15523,'NSCF','EXPENSE','XXXXXX','6166',15516,'Assurances véhicules','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15524,'NSCF','EXPENSE','XXXXXX','6168',15516,'Autres assurances','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15525,'NSCF','EXPENSE','XXXXXX','617',15505,'Etudes et recherches','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15526,'NSCF','EXPENSE','XXXXXX','618',15505,'Documentation et divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15527,'NSCF','EXPENSE','XXXXXX','6181',15526,'Documentation générale','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15528,'NSCF','EXPENSE','XXXXXX','6183',15526,'Documentation technique','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15529,'NSCF','EXPENSE','XXXXXX','6185',15526,'Frais de colloques, séminaires, conférences','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15530,'NSCF','EXPENSE','XXXXXX','619',15505,'Rabais, remises et ristournes obtenus sur services extérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15531,'NSCF','EXPENSE','XXXXXX','62',15487,'Autres services extérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15532,'NSCF','EXPENSE','XXXXXX','621',15531,'Personnel extérieur à l''entreprise','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15533,'NSCF','EXPENSE','XXXXXX','6211',15532,'Personnel intérimaire','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15534,'NSCF','EXPENSE','XXXXXX','6214',15532,'Personnel détaché ou prêté à l''entreprise','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15535,'NSCF','EXPENSE','XXXXXX','622',15531,'Rémunérations d''intermédiaires et honoraires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15536,'NSCF','EXPENSE','XXXXXX','6221',15535,'Commissions et courtages sur achats','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15537,'NSCF','EXPENSE','XXXXXX','6222',15535,'Commissions et courtages sur ventes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15538,'NSCF','EXPENSE','XXXXXX','6224',15535,'Rémunérations des transitaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15539,'NSCF','EXPENSE','XXXXXX','6225',15535,'Rémunérations d''affacturage (mémoire)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15540,'NSCF','EXPENSE','XXXXXX','6226',15535,'Honoraires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15541,'NSCF','EXPENSE','XXXXXX','6227',15535,'Frais d''actes et de contentieux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15542,'NSCF','EXPENSE','XXXXXX','6228',15535,'Divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15543,'NSCF','EXPENSE','XXXXXX','624',15531,'Transports de biens et transports collectifs du personnel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15544,'NSCF','EXPENSE','XXXXXX','6241',15543,'Transports sur achats','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15545,'NSCF','EXPENSE','XXXXXX','6242',15543,'Transports sur ventes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15546,'NSCF','EXPENSE','XXXXXX','6243',15543,'Transports entre établissements ou chantiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15547,'NSCF','EXPENSE','XXXXXX','6244',15543,'Transports administratifs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15548,'NSCF','EXPENSE','XXXXXX','6247',15543,'Transports collectifs du personnel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15549,'NSCF','EXPENSE','XXXXXX','6248',15543,'Divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15550,'NSCF','EXPENSE','XXXXXX','625',15531,'Déplacements, missions et réceptions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15551,'NSCF','EXPENSE','XXXXXX','6251',15550,'Voyages et déplacements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15552,'NSCF','EXPENSE','XXXXXX','6255',15550,'Frais de déménagement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15553,'NSCF','EXPENSE','XXXXXX','6256',15550,'Missions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15554,'NSCF','EXPENSE','XXXXXX','6257',15550,'Réceptions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15555,'NSCF','EXPENSE','XXXXXX','626',15531,'Frais postaux et de télécommunications','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15556,'NSCF','EXPENSE','XXXXXX','627',15531,'Services bancaires et assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15557,'NSCF','EXPENSE','XXXXXX','6271',15556,'Frais sur titres (achat, vente, garde)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15558,'NSCF','EXPENSE','XXXXXX','6272',15556,'Commissions et frais sur émission d''emprunts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15559,'NSCF','EXPENSE','XXXXXX','6275',15556,'Frais sur effets','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15560,'NSCF','EXPENSE','XXXXXX','6276',15556,'Location de coffres','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15561,'NSCF','EXPENSE','XXXXXX','6278',15556,'Autres frais et commissions sur prestations de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15562,'NSCF','EXPENSE','XXXXXX','628',15531,'Cotisations et divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15563,'NSCF','EXPENSE','XXXXXX','6281',15562,'Concours divers (cotisations)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15564,'NSCF','EXPENSE','XXXXXX','6284',15562,'Frais de recrutement de personnel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15565,'NSCF','EXPENSE','XXXXXX','629',15531,'Rabais, remises et ristournes obtenus sur autres services extérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15566,'NSCF','EXPENSE','XXXXXX','63',15487,'Charges de personnel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15567,'NSCF','EXPENSE','XXXXXX','631',15566,'Rémunérations du personnel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15568,'NSCF','EXPENSE','XXXXXX','6311',15567,'Salaires, appointements','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15569,'NSCF','EXPENSE','XXXXXX','6312',15567,'Congés payés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15570,'NSCF','EXPENSE','XXXXXX','6313',15567,'Primes et gratifications','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15571,'NSCF','EXPENSE','XXXXXX','6314',15567,'Indemnités et avantages divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15572,'NSCF','EXPENSE','XXXXXX','6316',15567,'Contributions aux œuvres sociales','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15573,'NSCF','EXPENSE','XXXXXX','634',15566,'Rémunération de l''exploitant individuel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15574,'NSCF','EXPENSE','XXXXXX','635',15566,'Cotisations aux organismes sociaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15575,'NSCF','EXPENSE','XXXXXX','6351',15574,'Cotisations CNAS','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15576,'NSCF','EXPENSE','XXXXXX','6352',15574,'Cotisations aux mutuelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15577,'NSCF','EXPENSE','XXXXXX','6353',15574,'Cotisations aux caisses de retraites','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15578,'NSCF','EXPENSE','XXXXXX','6358',15574,'Cotisations aux autres organismes sociaux (CACOBATH)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15579,'NSCF','EXPENSE','XXXXXX','636',15566,'Charges sociales de l''exploitant individuel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15580,'NSCF','EXPENSE','XXXXXX','637',15566,'Autres charges sociales','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15581,'NSCF','EXPENSE','XXXXXX','6371',15580,'Prestations directes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15582,'NSCF','EXPENSE','XXXXXX','6372',15580,'Versements aux comités d''entreprise et d''établissement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15583,'NSCF','EXPENSE','XXXXXX','6374',15580,'Versements aux autres œuvres sociales','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15584,'NSCF','EXPENSE','XXXXXX','6375',15580,'Médecine du travail, pharmacie','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15585,'NSCF','EXPENSE','XXXXXX','638',15566,'Autres charges de personnel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15586,'NSCF','EXPENSE','XXXXXX','64',15487,'Impôts, taxes et versements assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15587,'NSCF','EXPENSE','XXXXXX','641',15586,'Impôts, taxes et versements assimilés sur rémunérations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15588,'NSCF','EXPENSE','XXXXXX','6411',15587,'Taxe sur les salaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15589,'NSCF','EXPENSE','XXXXXX','6413',15587,'Participation des employeurs à la formation professionnelle','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15590,'NSCF','EXPENSE','XXXXXX','6418',15587,'Autres impôts, taxes et versements assimilés sur rémunérations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15591,'NSCF','EXPENSE','XXXXXX','642',15586,'Impôts et taxes non récupérables sur le chiffre d''affaire','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15592,'NSCF','EXPENSE','XXXXXX','6421',15591,'Taxe sur l''activité professionnelle (TAP)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15593,'NSCF','EXPENSE','XXXXXX','6422',15591,'TVA non récupérable','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15594,'NSCF','EXPENSE','XXXXXX','6423',15591,'Droits de timbre et d''enregistrement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15595,'NSCF','EXPENSE','XXXXXX','6428',15591,'Autres impôts et taxes non récupérables sur le chiffre d''affaire','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15596,'NSCF','EXPENSE','XXXXXX','645',15586,'Autres impôts et taxes (hors impôts sur le résultat)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15597,'NSCF','EXPENSE','XXXXXX','6451',15596,'Taxe foncière','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15598,'NSCF','EXPENSE','XXXXXX','6452',15596,'Taxe d''assainissement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15599,'NSCF','EXPENSE','XXXXXX','6453',15596,'Droits de douane','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15600,'NSCF','EXPENSE','XXXXXX','6454',15596,'Vignettes automobiles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15601,'NSCF','EXPENSE','XXXXXX','6456',15596,'Taxe écologique','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15602,'NSCF','EXPENSE','XXXXXX','6458',15596,'Autres droits et taxes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15603,'NSCF','EXPENSE','XXXXXX','65',15487,'Autres charges opérationnelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15604,'NSCF','EXPENSE','XXXXXX','651',15603,'Redevances pour concessions, brevets, licences, logiciels et accès similaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15605,'NSCF','EXPENSE','XXXXXX','6511',15604,'Redevances pour concessions, brevets, licences, marques, procédés, logiciels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15606,'NSCF','EXPENSE','XXXXXX','6516',15604,'Droits d''auteur et de reproduction','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15607,'NSCF','EXPENSE','XXXXXX','6518',15604,'Autres droits et valeurs similaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15608,'NSCF','EXPENSE','XXXXXX','652',15603,'Moins-values sur sorties d''actifs immobilisés non financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15609,'NSCF','EXPENSE','XXXXXX','653',15603,'Jetons de présence','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15610,'NSCF','EXPENSE','XXXXXX','654',15603,'Pertes sur créances irrécouvrables','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15611,'NSCF','EXPENSE','XXXXXX','6541',15610,'Pertes sur créances de l''exercice','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15612,'NSCF','EXPENSE','XXXXXX','6544',15610,'Pertes sur créances des exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15613,'NSCF','EXPENSE','XXXXXX','655',15603,'Quote-part de résultat sur opérations faites en commun','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15614,'NSCF','EXPENSE','XXXXXX','6551',15613,'Quote-part de résultats de groupement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15615,'NSCF','EXPENSE','XXXXXX','6558',15613,'Amortissements de caducité des immobilisations mises en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15616,'NSCF','EXPENSE','XXXXXX','6559',15613,'Dotations aux provisions des immobilisations mises en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15617,'NSCF','EXPENSE','XXXXXX','656',15603,'Amendes et pénalités, subventions accordées dons et libéralités','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15618,'NSCF','EXPENSE','XXXXXX','6561',15617,'Amendes et pénalité','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15619,'NSCF','EXPENSE','XXXXXX','6562',15617,'Subventions accordées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15620,'NSCF','EXPENSE','XXXXXX','6563',15617,'Dons et libéralités','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15621,'NSCF','EXPENSE','XXXXXX','657',15603,'Charges exceptionnelles de gestion courante','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15622,'NSCF','EXPENSE','XXXXXX','658',15603,'Autres charges de gestion courante','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15623,'NSCF','EXPENSE','XXXXXX','66',15487,'Charges financières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15624,'NSCF','EXPENSE','XXXXXX','661',15623,'Charges d''intérêts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15625,'NSCF','EXPENSE','XXXXXX','6611',15624,'Intérêts des emprunts et dettes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15626,'NSCF','EXPENSE','XXXXXX','66116',15625,'Intérêts des emprunts et dettes assimilées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15627,'NSCF','EXPENSE','XXXXXX','66117',15625,'Intérêts des emprunts et dettes rattachées à des participations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15628,'NSCF','EXPENSE','XXXXXX','6615',15624,'Intérêts des comptes courants et des dépôts créditeurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15629,'NSCF','EXPENSE','XXXXXX','6616',15624,'Intérêts bancaires et sur opérations de financement (escompte,…)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15630,'NSCF','EXPENSE','XXXXXX','6617',15624,'Intérêts des obligations cautionnées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15631,'NSCF','EXPENSE','XXXXXX','6618',15624,'Intérêts des autres dettes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15632,'NSCF','EXPENSE','XXXXXX','66181',15631,'Intérêts des dettes commerciales','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15633,'NSCF','EXPENSE','XXXXXX','66188',15631,'Intérêts des dettes diverses','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15634,'NSCF','EXPENSE','XXXXXX','664',15623,'Pertes sur créances liées à des participations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15635,'NSCF','EXPENSE','XXXXXX','665',15623,'Ecarts d''évaluation sur actifs financiers – Moins-values','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15636,'NSCF','EXPENSE','XXXXXX','6651',15635,'Ecarts d''évaluation - moins-values sur des parts dans les entreprises liées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15637,'NSCF','EXPENSE','XXXXXX','6653',15635,'Ecarts d''évaluation - moins-values sur autres titres conférant un droit de propriété','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15638,'NSCF','EXPENSE','XXXXXX','6656',15635,'Ecarts d''évaluation - moins-values sur obligations, bons du trésor et bons de caisse à court terme','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15639,'NSCF','EXPENSE','XXXXXX','6658',15635,'Ecarts d''évaluation - moins-values sur autres valeurs mobilières et autres créances assimilées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15640,'NSCF','EXPENSE','XXXXXX','666',15623,'Pertes de change','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15641,'NSCF','EXPENSE','XXXXXX','667',15623,'Pertes nettes sur cessions d''actifs financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15642,'NSCF','EXPENSE','XXXXXX','6671',15641,'Pertes nettes sur cession des parts dans les entreprises liées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15643,'NSCF','EXPENSE','XXXXXX','6672',15641,'Pertes nettes sur cession d''actions propres','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15644,'NSCF','EXPENSE','XXXXXX','6673',15641,'Pertes nettes sur cession d''autres titres conférant un droit de propriété','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15645,'NSCF','EXPENSE','XXXXXX','6676',15641,'Pertes nettes sur cession d''obligations, bons du trésor et bons de caisse à court terme','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15646,'NSCF','EXPENSE','XXXXXX','6678',15641,'Pertes nettes sur cession des autres valeurs mobilières et autres créances assimilées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15647,'NSCF','EXPENSE','XXXXXX','668',15623,'Autres charges financières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15648,'NSCF','EXPENSE','XXXXXX','67',15487,'Eléments extraordinaires - charges','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15649,'NSCF','EXPENSE','XXXXXX','672',15648,'Valeur résiduelle des immobilisations cédées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15650,'NSCF','EXPENSE','XXXXXX','676',15648,'Charges sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15651,'NSCF','EXPENSE','XXXXXX','6760',15650,'Consommations sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15652,'NSCF','EXPENSE','XXXXXX','6761',15650,'Services sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15653,'NSCF','EXPENSE','XXXXXX','6762',15650,'Autres services sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15654,'NSCF','EXPENSE','XXXXXX','6763',15650,'Charges de personnel sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15655,'NSCF','EXPENSE','XXXXXX','6764',15650,'Impôts et taxes sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15656,'NSCF','EXPENSE','XXXXXX','6765',15650,'Autres charges opérationnelles sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15657,'NSCF','EXPENSE','XXXXXX','6766',15650,'Charges financières sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15658,'NSCF','EXPENSE','XXXXXX','6768',15650,'Dotations aux amortissements, provisions et pertes de valeurs sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15659,'NSCF','EXPENSE','XXXXXX','6769',15650,'Impôts sur les bénéfices sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15660,'NSCF','EXPENSE','XXXXXX','678',15648,'Autres éléments extraordinaires - charges','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15661,'NSCF','EXPENSE','XXXXXX','6783',15660,'Malis provenant du rachat par l''entreprise d''actions et obligations émises par elle-même','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15662,'NSCF','EXPENSE','XXXXXX','6788',15660,'Autres charges extraordinaires diverses','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15663,'NSCF','EXPENSE','XXXXXX','68',15487,'Dotations aux amortissements, provisions et pertes de valeur','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15664,'NSCF','EXPENSE','XXXXXX','681',15663,'Dotations aux amortissements, provisions et pertes de valeur, actifs non courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15665,'NSCF','EXPENSE','XXXXXX','6811',15664,'Dotations aux amortissements, provisions et pertes de valeur sur immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15666,'NSCF','EXPENSE','XXXXXX','68111',15665,'Dotations aux amortissements et provisions et pertes de valeur sur immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15667,'NSCF','EXPENSE','XXXXXX','68112',15665,'Pertes de valeur sur immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15668,'NSCF','EXPENSE','XXXXXX','6812',15664,'Dotations aux amortissements, provisions et pertes de valeur sur immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15669,'NSCF','EXPENSE','XXXXXX','68121',15668,'Dotations aux amortissements et provisions et immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15670,'NSCF','EXPENSE','XXXXXX','68122',15668,'Pertes de valeur sur immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15671,'NSCF','EXPENSE','XXXXXX','68123',15668,'Pertes de valeur sur les investissements en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15672,'NSCF','EXPENSE','XXXXXX','68126',15668,'Pertes de valeur sur immobilisations financières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15673,'NSCF','EXPENSE','XXXXXX','682',15663,'Dotations aux amortissements, provisions et pertes de valeur des biens mis en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15674,'NSCF','EXPENSE','XXXXXX','6821',15673,'Dotations aux amortissements, des biens mis en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15675,'NSCF','EXPENSE','XXXXXX','6822',15673,'Dotations aux provisions des biens mis-en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15676,'NSCF','EXPENSE','XXXXXX','6828',15673,'Pertes de valeur des biens mis en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15677,'NSCF','EXPENSE','XXXXXX','685',15663,'Dotations aux amortissements, provisions et pertes de valeur, actifs courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15678,'NSCF','EXPENSE','XXXXXX','6853',15677,'Dotations aux pertes de valeur sur stocks','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15679,'NSCF','EXPENSE','XXXXXX','6854',15677,'Dotations aux pertes de valeur sur créances','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15680,'NSCF','EXPENSE','XXXXXX','6855',15677,'Dotations aux provisions et pertes de valeur sur comptes financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15681,'NSCF','EXPENSE','XXXXXX','686',15663,'Dotations aux amortissements, provisions et pertes de valeur, éléments financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15682,'NSCF','EXPENSE','XXXXXX','6861',15681,'Dotations aux amortissements des primes de remboursement des obligations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15683,'NSCF','EXPENSE','XXXXXX','6865',15681,'Dotations aux provisions pour risques et charges financières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15684,'NSCF','EXPENSE','XXXXXX','6866',15681,'Dotations aux provisions pour dépréciations des éléments financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15685,'NSCF','EXPENSE','XXXXXX','68662',15684,'Dotations aux provisions pour dépréciations des immobilisations financières','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15686,'NSCF','EXPENSE','XXXXXX','68665',15684,'Dotations aux provisions pour les valeurs mobilières de placement','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15687,'NSCF','EXPENSE','XXXXXX','6868',15681,'Autres dotations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15688,'NSCF','EXPENSE','XXXXXX','69',15487,'Impôts sur les résultats et assimilés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15689,'NSCF','EXPENSE','XXXXXX','692',15688,'Imposition différée actif','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15690,'NSCF','EXPENSE','XXXXXX','693',15688,'Imposition différée passif','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15691,'NSCF','EXPENSE','XXXXXX','695',15688,'Impôts sur les bénéfices basés sur les résultats des activités ordinaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15692,'NSCF','EXPENSE','XXXXXX','698',15688,'Autres impôts sur les résultats','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15693,'NSCF','INCOME','XXXXXX','7',0,'COMPTES DE PRODUITS','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15694,'NSCF','INCOME','XXXXXX','70',15693,'Ventes de marchandises et de produits fabriqués, ventes de prestations de services et produits annexes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15695,'NSCF','INCOME','XXXXXX','700',15694,'Ventes de marchandises','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15696,'NSCF','INCOME','XXXXXX','701',15694,'Ventes de produits finis','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15697,'NSCF','INCOME','XXXXXX','702',15694,'Ventes de produits intermédiaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15698,'NSCF','INCOME','XXXXXX','703',15694,'Ventes de produits résiduels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15699,'NSCF','INCOME','XXXXXX','704',15694,'Ventes de travaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15700,'NSCF','INCOME','XXXXXX','705',15694,'Ventes d''études ','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15701,'NSCF','INCOME','XXXXXX','706',15694,'Autres prestations de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15702,'NSCF','INCOME','XXXXXX','708',15694,'Produits des activités annexes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15703,'NSCF','INCOME','XXXXXX','7081',15702,'Produits des services exploités dans l''intérêt du personnel','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15704,'NSCF','INCOME','XXXXXX','7082',15702,'Commissions et courtages','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15705,'NSCF','INCOME','XXXXXX','7083',15702,'Locations diverses','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15706,'NSCF','INCOME','XXXXXX','7084',15702,'Mise à disposition de personnel facturée','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15707,'NSCF','INCOME','XXXXXX','7085',15702,'Ports et frais accessoires facturés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15708,'NSCF','INCOME','XXXXXX','7086',15702,'Bonis sur reprises d''emballages consignés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15709,'NSCF','INCOME','XXXXXX','7087',15702,'Bonifications obtenues des clients et primes sur ventes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15710,'NSCF','INCOME','XXXXXX','7088',15702,'Autres produits d''activités annexes (cessions d''approvisionnements)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15711,'NSCF','INCOME','XXXXXX','709',15694,'Rabais, remises et ristournes accordés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15712,'NSCF','INCOME','XXXXXX','7090',15711,'R.RR, accordés sur ventes de marchandises','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15713,'NSCF','INCOME','XXXXXX','7091',15711,'R.RR, accordés sur ventes de produits finis','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15714,'NSCF','INCOME','XXXXXX','7092',15711,'R.RR, accordés sur ventes de produits intermédiaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15715,'NSCF','INCOME','XXXXXX','7094',15711,'R.RR, accordés sur ventes de travaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15716,'NSCF','INCOME','XXXXXX','7095',15711,'R.RR, accordés sur ventes d''études ','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15717,'NSCF','INCOME','XXXXXX','7096',15711,'R.RR, accordés sur autres prestations de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15718,'NSCF','INCOME','XXXXXX','7098',15711,'R.RR, accordés sur produits des activités annexes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15719,'NSCF','INCOME','XXXXXX','72',15693,'Production stockée ou déstockée','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15720,'NSCF','INCOME','XXXXXX','723',15719,'Variation de stocks d''encours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15721,'NSCF','INCOME','XXXXXX','7233',15720,'Variation des en-cours de production de biens','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15722,'NSCF','INCOME','XXXXXX','72331',15721,'Produits en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15723,'NSCF','INCOME','XXXXXX','72335',15721,'Travaux en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15724,'NSCF','INCOME','XXXXXX','7234',15720,'Variation des en-cours de production de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15725,'NSCF','INCOME','XXXXXX','72341',15724,'Etudes en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15726,'NSCF','INCOME','XXXXXX','72345',15724,'Autres prestations de services en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15727,'NSCF','INCOME','XXXXXX','724',15719,'Variation de stocks de produits','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15728,'NSCF','INCOME','XXXXXX','7241',15727,'Variation de stocks des produits intermédiaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15729,'NSCF','INCOME','XXXXXX','7245',15727,'Variation de stocks des produits finis','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15730,'NSCF','INCOME','XXXXXX','7248',15727,'Variation des stocks des produits résiduels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15731,'NSCF','INCOME','XXXXXX','73',15693,'Production immobilisée','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15732,'NSCF','INCOME','XXXXXX','731',15731,'Production immobilisée d''actifs incorporels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15733,'NSCF','INCOME','XXXXXX','732',15731,'Production immobilisée d''actifs corporels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15734,'NSCF','INCOME','XXXXXX','74',15693,'Subventions d''exploitation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15735,'NSCF','INCOME','XXXXXX','741',15734,'Subventions d''équilibre','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15736,'NSCF','INCOME','XXXXXX','748',15734,'Autres subventions d''exploitation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15737,'NSCF','INCOME','XXXXXX','75',15693,'Autres produits opérationnels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15738,'NSCF','INCOME','XXXXXX','751',15737,'Redevances pour concessions, brevets, licences, logiciels et valeurs similaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15739,'NSCF','INCOME','XXXXXX','7511',15738,'Redevances pour concessions, brevets, licences, logiciels, marques, procédés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15740,'NSCF','INCOME','XXXXXX','7516',15738,'Droits d''auteur et de reproduction','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15741,'NSCF','INCOME','XXXXXX','7518',15738,'Autres droits et valeurs similaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15742,'NSCF','INCOME','XXXXXX','752',15737,'Plus-value sur sortie d''actifs immobilisés non financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15743,'NSCF','INCOME','XXXXXX','753',15737,'Jetons de présence et rémunérations d''administrateurs ou de gérants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15744,'NSCF','INCOME','XXXXXX','754',15737,'Quotes-parts de subventions d''investissements virés au résultat de l''exercice','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15745,'NSCF','INCOME','XXXXXX','755',15737,'Quotes-parts de résultat sur opérations faites en commun','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15746,'NSCF','INCOME','XXXXXX','7551',15745,'Quote-part de perte transférée (comptabilité du gérant)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15747,'NSCF','INCOME','XXXXXX','7555',15745,'Quote-part de bénéfice attribuée (comptabilité des associés non-gérants)','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15748,'NSCF','INCOME','XXXXXX','756',15737,'Rentrées sur créances amorties','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15749,'NSCF','INCOME','XXXXXX','757',15737,'Produits exceptionnels sur opérations de gestion','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15750,'NSCF','INCOME','XXXXXX','758',15737,'Autres produits de gestion courante','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15751,'NSCF','INCOME','XXXXXX','76',15693,'Produits financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15752,'NSCF','INCOME','XXXXXX','761',15751,'Produits des participations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15753,'NSCF','INCOME','XXXXXX','7611',15752,'Revenus des titres de participation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15754,'NSCF','INCOME','XXXXXX','7616',15752,'Revenus sur autres formes de participation','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15755,'NSCF','INCOME','XXXXXX','7617',15752,'Revenus des créances rattachées à des participations','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15756,'NSCF','INCOME','XXXXXX','762',15751,'Revenus des actifs financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15757,'NSCF','INCOME','XXXXXX','7621',15756,'Revenus des titres immobilisés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15758,'NSCF','INCOME','XXXXXX','7626',15756,'Revenus des prêts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15759,'NSCF','INCOME','XXXXXX','7627',15756,'Revenus des créances immobilisées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15760,'NSCF','INCOME','XXXXXX','763',15751,'Revenus de créances','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15761,'NSCF','INCOME','XXXXXX','7631',15760,'Revenus des créances commerciales','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15762,'NSCF','INCOME','XXXXXX','7638',15760,'Revenus des créances diverses','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15763,'NSCF','INCOME','XXXXXX','765',15751,'Ecart d''évaluation sur actifs financiers - plus values','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15764,'NSCF','INCOME','XXXXXX','766',15751,'Gains de change','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15765,'NSCF','INCOME','XXXXXX','767',15751,'Produits nets sur cessions d''actifs financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15766,'NSCF','INCOME','XXXXXX','7671',15765,'Profits nets sur cession des part dans les entreprises liées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15767,'NSCF','INCOME','XXXXXX','7672',15765,'Profits nets sur cession d''actions propres','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15768,'NSCF','INCOME','XXXXXX','7673',15765,'Profits nets sur cession des autres titres conférant un droit de propriété','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15769,'NSCF','INCOME','XXXXXX','7676',15765,'Profits nets sur cession d''obligations, bons du trésor et bons de caisse à court terme','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15770,'NSCF','INCOME','XXXXXX','7678',15765,'Profits nets sur cession des autres valeurs mobilières et créances assimilées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15771,'NSCF','INCOME','XXXXXX','768',15751,'Autres produits financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15772,'NSCF','INCOME','XXXXXX','77',15693,'Eléments extraordinaires - produits','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15773,'NSCF','INCOME','XXXXXX','770',15772,'Produits sur exercices antérieurs','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15774,'NSCF','INCOME','XXXXXX','7700',15773,'Produits sur exercices antérieurs – ventes de marchandises','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15775,'NSCF','INCOME','XXXXXX','7701',15773,'Produits sur exercices antérieurs – ventes de produits finis','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15776,'NSCF','INCOME','XXXXXX','7702',15773,'Produits sur exercices antérieurs – ventes de produits intermédiaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15777,'NSCF','INCOME','XXXXXX','7703',15773,'Produits sur exercices antérieurs – ventes de produits résiduels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15778,'NSCF','INCOME','XXXXXX','7704',15773,'Produits sur exercices antérieurs – ventes de travaux','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15779,'NSCF','INCOME','XXXXXX','7705',15773,'Produits sur exercices antérieurs – ventes d''études ','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15780,'NSCF','INCOME','XXXXXX','7706',15773,'Produits sur exercices antérieurs – autres prestations de services','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15781,'NSCF','INCOME','XXXXXX','7708',15773,'Produits sur exercices antérieur - ventes de produits des activités annexes','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15782,'NSCF','INCOME','XXXXXX','775',15772,'Produits sur exercices antérieurs - autres produits opérationnels','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15783,'NSCF','INCOME','XXXXXX','7751',15782,'Redevances pour concessions, brevets, licence ; logiciels et valeurs similaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15784,'NSCF','INCOME','XXXXXX','7752',15782,'Plus-values sur sorties d''actifs immobilisés non financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15785,'NSCF','INCOME','XXXXXX','7753',15782,'Jetons de présence et rémunérations d''administrateurs ou de gérants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15786,'NSCF','INCOME','XXXXXX','7754',15782,'Quotes-parts de subventions d''investissements virées au résultat de l''exercice','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15787,'NSCF','INCOME','XXXXXX','7755',15782,'Quotes-parts de résultat sur opérations faites en commun','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15788,'NSCF','INCOME','XXXXXX','7756',15782,'Rentrées sur créances amorties','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15789,'NSCF','INCOME','XXXXXX','7757',15782,'Produits exceptionnels sur opération de gestion','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15790,'NSCF','INCOME','XXXXXX','7759',15782,'Produits sur exercices antérieurs - remboursement des immobilisations expropriées détruites','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15791,'NSCF','INCOME','XXXXXX','778',15772,'Autres éléments extraordinaires - produits','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15792,'NSCF','INCOME','XXXXXX','7783',15791,'Bonis provenant du rachat par l''entreprise d''actions et d''obligations émises par elle-même','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15793,'NSCF','INCOME','XXXXXX','7788',15791,'Autres Produits extraordinaires divers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15794,'NSCF','INCOME','XXXXXX','78',15693,'Reprises sur pertes de valeur et provisions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15795,'NSCF','INCOME','XXXXXX','781',15794,'Reprises d''exploitation sur pertes de valeurs et provisions - actifs non courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15796,'NSCF','INCOME','XXXXXX','7810',15795,'Reprises sur provisions et pertes de valeur des immobilisations incorporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15797,'NSCF','INCOME','XXXXXX','7811',15795,'Reprises sur provisions et pertes de valeur des immobilisations corporelles','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15798,'NSCF','INCOME','XXXXXX','7812',15795,'Reprises sur provisions des immobilisations en concession','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15799,'NSCF','INCOME','XXXXXX','7813',15795,'Reprises sur provisions d''immobilisations en cours','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15800,'NSCF','INCOME','XXXXXX','7816',15795,'Reprise sur pertes de valeur des participations et créances rattachées','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15801,'NSCF','INCOME','XXXXXX','7817',15795,'Reprise sur perte de valeur des autres titres immobilisés','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15802,'NSCF','INCOME','XXXXXX','7818',15795,'Reprise sur pertes de valeur des autres instruments financiers','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15803,'NSCF','INCOME','XXXXXX','785',15794,'Reprises d''exploitation sur pertes de valeur et provisions - actifs courants','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15804,'NSCF','INCOME','XXXXXX','7853',15803,'Reprises sur provisions et pertes de valeur sur les comptes de stocks','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15805,'NSCF','INCOME','XXXXXX','7854',15803,'Reprises sur provisions et pertes de valeur sur les comptes de créances','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15806,'NSCF','INCOME','XXXXXX','7855',15803,'Reprises sur provisions et pertes de valeur sur les comptes de trésorerie','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15807,'NSCF','INCOME','XXXXXX','786',15794,'Reprises financières sur pertes de valeurs et provisions','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15808,''NSCF','INCOME','XXXXXX','7860',15807,'Reprises provisions sur plus-values à réinvestir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15809,'NSCF','INCOME','XXXXXX','7863',15807,'Reprises provisions sur pensions et obligations similaires','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15810,'NSCF','INCOME','XXXXXX','7865',15807,'Reprises provisions pour impôts','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15811,'NSCF','INCOME','XXXXXX','7868',15807,'Reprises autres provisions pour charges - passifs non courants','1'); From 6952f346ad67f02984709d54707b04a639f9ee0f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Sep 2018 17:47:21 +0200 Subject: [PATCH 034/255] Prepare 8.0.1 --- ChangeLog | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ChangeLog b/ChangeLog index ceb1d847ddb..2f0d6538e7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,38 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 8.0.1 compared to 8.0.0 ***** +FIX: #9258 +FIX: #9328 +FIX: #9337 +FIX: adding GROUP BY for PostgreSQL +FIX: API template for list pages in module builder +FIX: API template for record page to delete a record +FIX: a removed option was still in setup +FIX: badge on time spent on project and tasks +FIX: Delete file on smartphone +FIX: Fetch function will fetch comments +FIX: Fetch task will now fetch comments +FIX: $fk_account is always empty, must be $soc->fk_account +FIX: Force stripe api version to avoid trouble if we update stripe api +FIX: get_product_vat_for_country functions.lib.php +FIX: Get templates in a forced language +FIX: hook on dispatch order fourn +FIX: Language selection lost if error during creation of email template +FIX: Look and feel v8 +FIX: propal.class.php +FIX: Add calls to fetchComments function +FIX: Remove fetchComments from project and task fetch function +FIX: remove internal property isextrafieldmanaged from API returns +FIX: sql error +FIX: table llx_chargessociales doesn't exists +FIX: trans on null object +FIX: vat rate code not returned by get_product_vat_for_country +FIX: warning for late template invoices to remove when suspended +FIX: Add hidden option MAIN_xxx_IN_SOURCE_ADDRESS to solve legal issues on PDF +FIX: Table llx_facture_rec_extrafields missing after migration + + ***** ChangeLog for 8.0.0 compared to 7.0.0 ***** For Users: From 09b75fc53ed29d75137b0f476a6cae370aff4108 Mon Sep 17 00:00:00 2001 From: Bahfir Abbes Date: Sun, 2 Sep 2018 16:52:41 +0100 Subject: [PATCH 035/255] Update llx_accounting_account_dz.sql --- htdocs/install/mysql/data/llx_accounting_account_dz.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_dz.sql b/htdocs/install/mysql/data/llx_accounting_account_dz.sql index 4bee6a217f3..5954fcc57a2 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_dz.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_dz.sql @@ -832,7 +832,7 @@ INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_ INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15805,'NSCF','INCOME','XXXXXX','7854',15803,'Reprises sur provisions et pertes de valeur sur les comptes de créances','1'); INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15806,'NSCF','INCOME','XXXXXX','7855',15803,'Reprises sur provisions et pertes de valeur sur les comptes de trésorerie','1'); INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15807,'NSCF','INCOME','XXXXXX','786',15794,'Reprises financières sur pertes de valeurs et provisions','1'); -INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15808,''NSCF','INCOME','XXXXXX','7860',15807,'Reprises provisions sur plus-values à réinvestir','1'); +INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15808,'NSCF','INCOME','XXXXXX','7860',15807,'Reprises provisions sur plus-values à réinvestir','1'); INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15809,'NSCF','INCOME','XXXXXX','7863',15807,'Reprises provisions sur pensions et obligations similaires','1'); INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15810,'NSCF','INCOME','XXXXXX','7865',15807,'Reprises provisions pour impôts','1'); INSERT IGNORE INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (15811,'NSCF','INCOME','XXXXXX','7868',15807,'Reprises autres provisions pour charges - passifs non courants','1'); From 61c4e9831f0e8c1d2f13d1181896988b4b2900e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 18:18:10 +0200 Subject: [PATCH 036/255] move phpcs:ignore --- htdocs/contact/class/contact.class.php | 30 ++++++++++++++---------- htdocs/exports/class/export.class.php | 18 +++++++++----- htdocs/loan/class/loanschedule.class.php | 3 ++- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 4cd6fe81820..ecaeedad9f3 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -41,12 +41,12 @@ class Contact extends CommonObject * @var string ID to identify managed object */ public $element='contact'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='socpeople'; - + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto = 'contact'; @@ -131,9 +131,6 @@ class Contact extends CommonObject public $oldcopy; // To contains a clone of this when we need to save old properties of object - - - /** * Constructor * @@ -145,14 +142,15 @@ class Contact extends CommonObject $this->statut = 1; // By default, status is enabled } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators into this->nb for board * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $user; $this->nb=array(); @@ -475,6 +473,7 @@ class Contact extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -484,9 +483,9 @@ class Contact extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_dn($info,$mode=0) { + // phpcs:enable global $conf; $dn=''; if ($mode==0) $dn=$conf->global->LDAP_KEY_CONTACTS."=".$info[$conf->global->LDAP_KEY_CONTACTS].",".$conf->global->LDAP_CONTACT_DN; @@ -496,14 +495,15 @@ class Contact extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Initialise tableau info (tableau des attributs LDAP) * * @return array Tableau info des attributs */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_info() { + // phpcs:enable global $conf,$langs; $info = array(); @@ -570,6 +570,7 @@ class Contact extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update field alert birthday * @@ -578,9 +579,9 @@ class Contact extends CommonObject * @param int $notrigger 0=no, 1=yes * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_perso($id, $user=null, $notrigger=0) { + // phpcs:enable $error=0; $result=false; @@ -726,7 +727,7 @@ class Contact extends CommonObject $this->date_creation = $this->db->jdate($obj->date_creation); $this->date_modification = $this->db->jdate($obj->date_modification); - + $this->fk_departement = $obj->fk_departement; // deprecated $this->state_id = $obj->fk_departement; $this->departement_code = $obj->state_code; // deprecated @@ -852,6 +853,7 @@ class Contact extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load number of elements the contact is used as a link for * ref_facturation @@ -861,9 +863,9 @@ class Contact extends CommonObject * * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_ref_elements() { + // phpcs:enable // Compte les elements pour lesquels il est contact $sql ="SELECT tc.element, count(ec.rowid) as nb"; $sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc"; @@ -1194,6 +1196,7 @@ class Contact extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -1201,9 +1204,9 @@ class Contact extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode) { + // phpcs:enable global $langs; if ($mode == 0) @@ -1240,15 +1243,16 @@ class Contact extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return translated label of Public or Private * * @param int $statut Type (0 = public, 1 = private) * @return string Label translated */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibPubPriv($statut) { + // phpcs:enable global $langs; if ($statut=='1') return $langs->trans('ContactPrivate'); else return $langs->trans('ContactPublic'); diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index fd685ad74fd..46d21eba031 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -70,6 +70,7 @@ class Export } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load an exportable dataset * @@ -77,9 +78,9 @@ class Export * @param string $filter Load a particular dataset only * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_arrays($user,$filter='') { + // phpcs:enable global $langs,$conf,$mysoc; dol_syslog(get_class($this)."::load_arrays user=".$user->id." filter=".$filter); @@ -208,6 +209,7 @@ class Export } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Build the sql export request. * Arrays this->array_export_xxx are already loaded for required datatoexport @@ -217,9 +219,9 @@ class Export * @param array $array_filterValue Filter records on array of value for fields * @return string SQL String. Example "select s.rowid as r_rowid, s.status as s_status from ..." */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function build_sql($indice, $array_selected, $array_filterValue) { + // phpcs:enable // Build the sql request $sql=$this->array_export_sql_start[$indice]; $i=0; @@ -271,6 +273,7 @@ class Export return $sql; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Build the conditionnal string from filter the query * @@ -279,9 +282,9 @@ class Export * @param string $ValueField Value of the field for filter. Must not be '' * @return string sql string of then field ex : "field='xxx'>" */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function build_filterQuery($TypeField, $NameField, $ValueField) { + // phpcs:enable //print $TypeField." ".$NameField." ".$ValueField; $InfoFieldList = explode(":", $TypeField); // build the input field on depend of the type of file @@ -365,6 +368,7 @@ class Export return $Condition; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Build an input field used to filter the query * @@ -373,9 +377,9 @@ class Export * @param string $ValueField Initial value of the field to filter * @return string html string of the input field ex : "" */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function build_filterField($TypeField, $NameField, $ValueField) { + // phpcs:enable global $conf,$langs; $szFilterField=''; @@ -514,6 +518,7 @@ class Export return $szMsg; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Build export file. * File is built into directory $conf->export->dir_temp.'/'.$user->id @@ -527,9 +532,9 @@ class Export * @param string $sqlquery If set, transmit the sql request for select (otherwise, sql request is generated from arrays) * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function build_file($user, $model, $datatoexport, $array_selected, $array_filterValue, $sqlquery = '') { + // phpcs:enable global $conf,$langs; $indice=0; @@ -825,15 +830,16 @@ class Export } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output list all export models * TODO Move this into a class htmlxxx.class.php * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_export_model() { + // phpcs:enable global $conf, $langs; $sql = "SELECT em.rowid, em.field, em.label, em.type, em.filter"; diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php index a8774244e00..71217444b16 100644 --- a/htdocs/loan/class/loanschedule.class.php +++ b/htdocs/loan/class/loanschedule.class.php @@ -461,14 +461,15 @@ class LoanSchedule extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * trans_paiment * * @return void */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function trans_paiment() { + // phpcs:enable require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; From 03a5aba8a2038844838a4119fe06eb7f8891d991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 18:49:23 +0200 Subject: [PATCH 037/255] move phpcs:ignore --- dev/setup/codesniffer/ruleset.xml | 4 +- htdocs/comm/mailing/class/mailing.class.php | 6 +- htdocs/don/class/don.class.php | 36 ++++++----- htdocs/don/class/paymentdonation.class.php | 8 ++- .../class/expensereport.class.php | 59 ++++++++++++------- .../template/class/myobject.class.php | 19 +++--- 6 files changed, 79 insertions(+), 53 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index b8ddcebf18c..79b16bdbf55 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -238,9 +238,9 @@ - + diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 26e2c7bec90..4b7b31b6b13 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -439,14 +439,15 @@ class Mailing extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Delete targets emailing * * @return int 1 if OK, 0 if error */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_targets() { + // phpcs:enable $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql.= " WHERE fk_mailing = ".$this->id; @@ -464,15 +465,16 @@ class Mailing extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Change status of each recipient * * @param User $user Objet user qui valide * @return int <0 if KO, >0 if OK */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function reset_targets_status($user) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles"; $sql.= " SET statut = 0"; $sql.= " WHERE fk_mailing = ".$this->id; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index d2039a200cb..958924c4da5 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -38,12 +38,12 @@ class Don extends CommonObject * @var string ID to identify managed object */ public $element='don'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='don'; - + public $fk_element = 'fk_donation'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe var $picto = 'generic'; @@ -96,6 +96,7 @@ class Don extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -103,9 +104,9 @@ class Don extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable if (empty($this->labelstatut) || empty($this->labelstatushort)) { global $langs; @@ -124,39 +125,39 @@ class Don extends CommonObject { return $this->labelstatut[$statut]; } - if ($mode == 1) + elseif ($mode == 1) { return $this->labelstatutshort[$statut]; } - if ($mode == 2) + elseif ($mode == 2) { if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5').' '.$this->labelstatutshort[$statut]; if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatutshort[$statut]; if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatutshort[$statut]; if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatutshort[$statut]; } - if ($mode == 3) + elseif ($mode == 3) { if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5'); if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0'); if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1'); if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut == -1) return img_picto($this->labelstatut[$statut],'statut5').' '.$this->labelstatut[$statut]; if ($statut == 0) return img_picto($this->labelstatut[$statut],'statut0').' '.$this->labelstatut[$statut]; if ($statut == 1) return img_picto($this->labelstatut[$statut],'statut1').' '.$this->labelstatut[$statut]; if ($statut == 2) return img_picto($this->labelstatut[$statut],'statut6').' '.$this->labelstatut[$statut]; } - if ($mode == 5) + elseif ($mode == 5) { if ($statut == -1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut5'); if ($statut == 0) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut0'); if ($statut == 1) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut1'); if ($statut == 2) return $this->labelstatutshort[$statut].' '.img_picto($this->labelstatut[$statut],'statut6'); } - if ($mode == 6) + elseif ($mode == 6) { if ($statut == -1) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut5'); if ($statut == 0) return $this->labelstatut[$statut].' '.img_picto($this->labelstatut[$statut],'statut0'); @@ -694,6 +695,7 @@ class Don extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Validate a promise of donation * @@ -702,9 +704,9 @@ class Don extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function valid_promesse($id, $userid, $notrigger=0) { + // phpcs:enable global $langs, $user; $error=0; @@ -745,6 +747,7 @@ class Don extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Classify the donation as paid, the donation was received * @@ -752,9 +755,9 @@ class Don extends CommonObject * @param int $modepayment mode of payment * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_paid($id, $modepayment=0) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2"; if ($modepayment) { @@ -781,15 +784,16 @@ class Don extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set donation to status cancelled * * @param int $id id of donation * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_cancel($id) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = -1 WHERE rowid = ".$id; $resql=$this->db->query($sql); @@ -811,15 +815,16 @@ class Don extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Sum of donations * * @param string $param 1=promesses de dons validees , 2=xxx, 3=encaisses * @return int Summ of donations */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function sum_donations($param) { + // phpcs:enable global $conf; $result=0; @@ -839,14 +844,15 @@ class Don extends CommonObject return $result; } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Charge indicateurs this->nb pour le tableau de bord * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf; $this->nb=array(); diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index 3a839c2e759..575a5355877 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -453,6 +453,7 @@ class PaymentDonation extends CommonObject return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -460,10 +461,10 @@ class PaymentDonation extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { - global $langs; + // phpcs:enable + global $langs; return ''; } @@ -577,15 +578,16 @@ class PaymentDonation extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update link between the donation payment and the generated line in llx_bank * * @param int $id_bank Id if bank * @return int >0 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_fk_bank($id_bank) { + // phpcs:enable $sql = "UPDATE ".MAIN_DB_PREFIX."payment_donation SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG); diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 7ccb88d82ee..9f5fdc485e3 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -547,6 +547,7 @@ class ExpenseReport extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Classify the expense report as paid * @@ -555,9 +556,9 @@ class ExpenseReport extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_paid($id, $fuser, $notrigger = 0) { + // phpcs:enable $error = 0; $this->db->begin(); @@ -619,6 +620,7 @@ class ExpenseReport extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns the label of a statut * @@ -626,30 +628,30 @@ class ExpenseReport extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) return $langs->transnoentities($this->statuts[$status]); - if ($mode == 1) + elseif ($mode == 1) return $langs->transnoentities($this->statuts_short[$status]); - if ($mode == 2) + elseif ($mode == 2) return img_picto($langs->transnoentities($this->statuts_short[$status]), $this->statuts_logo[$status]).' '.$langs->transnoentities($this->statuts_short[$status]); - if ($mode == 3) + elseif ($mode == 3) return img_picto($langs->transnoentities($this->statuts_short[$status]), $this->statuts_logo[$status]); - if ($mode == 4) + elseif ($mode == 4) return img_picto($langs->transnoentities($this->statuts_short[$status]),$this->statuts_logo[$status]).' '.$langs->transnoentities($this->statuts[$status]); - if ($mode == 5) + elseif ($mode == 5) return ''.$langs->transnoentities($this->statuts_short[$status]).' '.img_picto($langs->transnoentities($this->statuts_short[$status]),$this->statuts_logo[$status]); - if ($mode == 6) + elseif ($mode == 6) return $langs->transnoentities($this->statuts[$status]).' '.img_picto($langs->transnoentities($this->statuts_short[$status]),$this->statuts_logo[$status]); } @@ -794,6 +796,7 @@ class ExpenseReport extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * fetch_line_by_project * @@ -801,9 +804,9 @@ class ExpenseReport extends CommonObject * @param User $user User * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_line_by_project($projectid,$user='') { + // phpcs:enable global $conf,$db,$langs; $langs->load('trips'); @@ -951,14 +954,15 @@ class ExpenseReport extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * fetch_lines * * @return int <0 if OK, >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { + // phpcs:enable $this->lines=array(); $sql = ' SELECT de.rowid, de.comments, de.qty, de.value_unit, de.date, de.rang,'; @@ -1195,15 +1199,16 @@ class ExpenseReport extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * set_save_from_refuse * * @param User $fuser User * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_save_from_refuse($fuser) { + // phpcs:enable global $conf,$langs; // Sélection de la date de début de la NDF @@ -1368,6 +1373,7 @@ class ExpenseReport extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * set_unpaid * @@ -1375,9 +1381,9 @@ class ExpenseReport extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_unpaid($fuser, $notrigger = 0) { + // phpcs:enable $error = 0; if ($this->fk_c_deplacement_statuts != 5) @@ -1428,6 +1434,7 @@ class ExpenseReport extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * set_cancel * @@ -1436,9 +1443,9 @@ class ExpenseReport extends CommonObject * @param int $notrigger Disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_cancel($fuser,$detail, $notrigger=0) { + // phpcs:enable $error = 0; $this->date_cancel = $this->db->idate(gmmktime()); if ($this->fk_statut != 4) @@ -1613,6 +1620,7 @@ class ExpenseReport extends CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update total of an expense report when you add a line. * @@ -1620,9 +1628,9 @@ class ExpenseReport extends CommonObject * @param string $ligne_total_tva Amount of all taxes * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_totaux_add($ligne_total_ht,$ligne_total_tva) { + // phpcs:enable $this->total_ht = $this->total_ht + $ligne_total_ht; $this->total_tva = $this->total_tva + $ligne_total_tva; $this->total_ttc = $this->total_ht + $this->total_tva; @@ -1642,6 +1650,7 @@ class ExpenseReport extends CommonObject endif; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update total of an expense report when you delete a line. * @@ -1649,9 +1658,9 @@ class ExpenseReport extends CommonObject * @param string $ligne_total_tva Amount of all taxes * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_totaux_del($ligne_total_ht,$ligne_total_tva) { + // phpcs:enable $this->total_ht = $this->total_ht - $ligne_total_ht; $this->total_tva = $this->total_tva - $ligne_total_tva; $this->total_ttc = $this->total_ht + $this->total_tva; @@ -2058,6 +2067,7 @@ class ExpenseReport extends CommonObject return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * periode_existe * @@ -2066,9 +2076,9 @@ class ExpenseReport extends CommonObject * @param Date $date_fin End date * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function periode_existe($fuser, $date_debut, $date_fin) { + // phpcs:enable $sql = "SELECT rowid, date_debut, date_fin"; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql.= " WHERE fk_user_author = '{$fuser->id}'"; @@ -2115,15 +2125,16 @@ class ExpenseReport extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of people with permission to validate expense reports. * Search for permission "approve expense report" * * @return array Array of user ids */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_users_approver_expensereport() { + // phpcs:enable $users_validator=array(); $sql = "SELECT DISTINCT ur.fk_user"; @@ -2222,14 +2233,15 @@ class ExpenseReport extends CommonObject return $ret; } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Charge indicateurs this->nb pour le tableau de bord * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf; $this->nb=array(); @@ -2257,6 +2269,7 @@ class ExpenseReport extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * @@ -2264,9 +2277,9 @@ class ExpenseReport extends CommonObject * @param string $option 'topay' or 'toapprove' * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user, $option='topay') { + // phpcs:enable global $conf, $langs; if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe @@ -2696,6 +2709,7 @@ class ExpenseReportLine } +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des differents etats d'une note de frais. * Les valeurs de la liste sont les id de la table c_expensereport_statuts @@ -2706,9 +2720,9 @@ class ExpenseReportLine * @param int $useshortlabel Use short labels * @return string HTML select with status */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_expensereport_statut($selected='',$htmlname='fk_statut',$useempty=1, $useshortlabel=0) { + // phpcs:enable global $db, $langs; $tmpep=new ExpenseReport($db); @@ -2733,6 +2747,7 @@ function select_expensereport_statut($selected='',$htmlname='fk_statut',$useempt print ''; } +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of types of notes with select value = id * @@ -2742,9 +2757,9 @@ function select_expensereport_statut($selected='',$htmlname='fk_statut',$useempt * @param int $active 1=Active only, 0=Unactive only, -1=All * @return string Select html */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_type_fees_id($selected='',$htmlname='type',$showempty=0, $active=1) { + // phpcs:enable global $db,$langs,$user; $langs->load("trips"); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 21e8df59efc..a37f9d35c18 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -36,22 +36,22 @@ class MyObject extends CommonObject * @var string ID to identify managed object */ public $element = 'myobject'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'mymodule_myobject'; - + /** * @var int Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; - + /** * @var int Does myobject support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; - + /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ @@ -122,22 +122,22 @@ class MyObject extends CommonObject * @var int Name of subtable line */ //public $table_element_line = 'myobjectdet'; - + /** * @var int Field with ID of parent key if this field has a parent */ //public $fk_element = 'fk_myobject'; - + /** * @var int Name of subtable class that manage subtable lines */ //public $class_element_line = 'MyObjectline'; - + /** * @var array Array of child tables (child tables to delete before deleting a record) */ //protected $childtables=array('myobjectdet'); - + /** * @var MyObjectLine[] Array of subtable lines */ @@ -368,6 +368,7 @@ class MyObject extends CommonObject return $this->LibStatut($this->status, $mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -375,9 +376,9 @@ class MyObject extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status, $mode=0) { + // phpcs:enable if (empty($this->labelstatus)) { global $langs; From 35232b753a79652a6e619453d7a11fb212cc47ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 20:37:12 +0200 Subject: [PATCH 038/255] move phpcs:ignore --- .../comm/action/class/cactioncomm.class.php | 9 +++-- .../cheque/class/remisecheque.class.php | 34 +++++++++------- .../class/ligneprelevement.class.php | 11 +++--- .../actions_contactcard_common.class.php | 14 ++++--- htdocs/fourn/class/fournisseur.class.php | 9 +++-- .../mailinglist_mymodule_myobject.modules.php | 5 ++- htdocs/resource/class/dolresource.class.php | 24 ++++++++---- .../class/html.formresource.class.php | 6 ++- htdocs/user/class/usergroup.class.php | 15 ++++--- htdocs/website/class/website.class.php | 39 ++++++++----------- 10 files changed, 94 insertions(+), 72 deletions(-) diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 2fcd4e63bd7..e7fa7a3d2ef 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -32,7 +32,7 @@ class CActionComm * @var string Error code (or message) */ public $error=''; - + /** * @var DoliDB Database handler. */ @@ -46,12 +46,12 @@ class CActionComm var $code; var $type; var $libelle; // deprecated - + /** * @var string proper name for given parameter */ public $label; - + var $active; var $color; var $picto; @@ -114,6 +114,7 @@ class CActionComm } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of event types: array(id=>label) or array(code=>label) * @@ -125,9 +126,9 @@ class CActionComm * @param int $shortlabel 1=Get short label instead of long label * @return mixed Array of all event types if OK, <0 if KO. Key of array is id or code depending on parameter $idorcode. */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='', $shortlabel=0) { + // phpcs:enable global $langs,$conf; $langs->load("commercial"); diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index e858f599cc8..70e642cbf90 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -37,12 +37,12 @@ class RemiseCheque extends CommonObject * @var string ID to identify managed object */ public $element='chequereceipt'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='bordereau_cheque'; - + public $picto = 'payment'; var $num; @@ -488,15 +488,16 @@ class RemiseCheque extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Objet user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user) { + // phpcs:enable global $conf, $langs; if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe @@ -542,14 +543,15 @@ class RemiseCheque extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $user; if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe @@ -857,14 +859,15 @@ class RemiseCheque extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge les proprietes ref_previous et ref_next * * @return int <0 if KO, 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_previous_next_id() { + // phpcs:enable global $conf; $this->errno = 0; @@ -899,6 +902,7 @@ class RemiseCheque extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set the creation date * @@ -906,9 +910,9 @@ class RemiseCheque extends CommonObject * @param int $date Date creation * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date($user, $date) { + // phpcs:enable if ($user->rights->banque->cheque) { $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; @@ -934,6 +938,7 @@ class RemiseCheque extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set the ref of bordereau * @@ -941,9 +946,9 @@ class RemiseCheque extends CommonObject * @param int $ref ref of bordereau * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_number($user, $ref) { + // phpcs:enable if ($user->rights->banque->cheque) { $sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque"; @@ -1057,6 +1062,7 @@ class RemiseCheque extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a status * @@ -1064,9 +1070,9 @@ class RemiseCheque extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage $langs->load('compta'); if ($mode == 0) @@ -1074,32 +1080,32 @@ class RemiseCheque extends CommonObject if ($status == 0) return $langs->trans('ToValidate'); if ($status == 1) return $langs->trans('Validated'); } - if ($mode == 1) + elseif ($mode == 1) { if ($status == 0) return $langs->trans('ToValidate'); if ($status == 1) return $langs->trans('Validated'); } - if ($mode == 2) + elseif ($mode == 2) { if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0').' '.$langs->trans('ToValidate'); if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); } - if ($mode == 3) + elseif ($mode == 3) { if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0'); if ($status == 1) return img_picto($langs->trans('Validated'),'statut4'); } - if ($mode == 4) + elseif ($mode == 4) { if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut0').' '.$langs->trans('ToValidate'); if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated'); } - if ($mode == 5) + elseif ($mode == 5) { if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0'); if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); } - if ($mode == 6) + elseif ($mode == 6) { if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut0'); if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4'); diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index fc92302cf7d..d8434caefd8 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -35,7 +35,7 @@ class LignePrelevement * @var int ID */ public $id; - + /** * @var DoliDB Database handler. */ @@ -128,6 +128,7 @@ class LignePrelevement return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return status label for a status * @@ -135,28 +136,28 @@ class LignePrelevement * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) { return $langs->trans($this->statuts[$statut]); } - if ($mode == 1) + elseif ($mode == 1) { if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); // Waiting if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); // Credited if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); // Refused } - if ($mode == 2) + elseif ($mode == 2) { if ($statut==0) return img_picto($langs->trans($this->statuts[$statut]),'statut1'); if ($statut==2) return img_picto($langs->trans($this->statuts[$statut]),'statut6'); if ($statut==3) return img_picto($langs->trans($this->statuts[$statut]),'statut8'); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut1'); if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts[$statut]),'statut6'); diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 06c65500527..7e413854846 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -31,7 +31,7 @@ abstract class ActionsContactCardCommon * @var DoliDB Database handler. */ public $db; - + var $dirmodule; var $targetmodule; var $canvas; @@ -41,12 +41,12 @@ abstract class ActionsContactCardCommon var $tpl = array(); //! Object container var $object; - + /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) @@ -76,16 +76,17 @@ abstract class ActionsContactCardCommon //} } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Set content of ->tpl array, to use into template * * @param string $action Type of action * @param int $id Id * @return string HTML output */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id) { + // phpcs:enable global $conf, $langs, $user, $canvas; global $form, $formcompany, $objsoc; @@ -266,14 +267,15 @@ abstract class ActionsContactCardCommon } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Assign POST values into object * * @return string HTML output */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function assign_post() { + // phpcs:enable global $langs, $mysoc; $this->object->old_name = $_POST["old_name"]; diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php index 66f0c730938..878f4bee67e 100644 --- a/htdocs/fourn/class/fournisseur.class.php +++ b/htdocs/fourn/class/fournisseur.class.php @@ -102,14 +102,15 @@ class Fournisseur extends Societe } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load statistics indicators * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf, $user; $this->nb=array(); @@ -144,6 +145,7 @@ class Fournisseur extends Societe } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a supplier category * @@ -151,9 +153,9 @@ class Fournisseur extends Societe * @param string $name Category name * @return int <0 if KO, 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function CreateCategory($user, $name) { + // phpcs:enable $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label,visible,type)"; $sql.= " VALUES "; $sql.= " ('".$this->db->escape($name)."',1,1)"; @@ -173,14 +175,15 @@ class Fournisseur extends Societe } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the suppliers list * * @return array Array of suppliers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ListArray() { + // phpcs:enable global $conf; global $user; diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index 9b52b3119f6..545e53d350a 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -27,7 +27,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets var $enabled=0; var $require_module=array(); var $picto='mymodule@mymodule'; - + /** * @var DoliDB Database handler. */ @@ -92,6 +92,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This is the main function that returns the array of emails * @@ -99,9 +100,9 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets * @param array $filtersarray Requete sql de selection des destinataires * @return int <0 if error, number of emails added if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id,$filtersarray=array()) { + // phpcs:enable $target = array(); $cibles = array(); $j = 0; diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 13de6e62ccf..4d3a4a55c74 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -333,15 +333,16 @@ class Dolresource extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load object in memory from database * * @param int $id id object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_element_resource($id) { + // phpcs:enable global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; @@ -478,6 +479,7 @@ class Dolresource extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load resource objects into $this->lines * @@ -488,9 +490,9 @@ class Dolresource extends CommonObject * @param array $filter filter output * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_all($sortorder, $sortfield, $limit, $offset, $filter='') { + // phpcs:enable global $conf; $sql="SELECT "; $sql.= " t.rowid,"; @@ -574,6 +576,7 @@ class Dolresource extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load all objects into $this->lines * @@ -584,9 +587,9 @@ class Dolresource extends CommonObject * @param array $filter filter output * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_all_resources($sortorder, $sortfield, $limit, $offset, $filter='') { + // phpcs:enable global $conf; $sql="SELECT "; $sql.= " t.rowid,"; @@ -652,6 +655,7 @@ class Dolresource extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load all objects into $this->lines * @@ -662,9 +666,9 @@ class Dolresource extends CommonObject * @param array $filter filter output * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_all_used($sortorder, $sortfield, $limit, $offset=1, $filter='') { + // phpcs:enable global $conf; if ( ! $sortorder) $sortorder="ASC"; @@ -730,6 +734,7 @@ class Dolresource extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch all resources available, declared by modules * Load available resource in array $this->available_resources @@ -738,9 +743,9 @@ class Dolresource extends CommonObject * @deprecated, remplaced by hook getElementResources * @see getElementResources() */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_all_available() { + // phpcs:enable global $conf; if (! empty($conf->modules_parts['resources'])) @@ -752,6 +757,7 @@ class Dolresource extends CommonObject return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update element resource into database * @@ -759,9 +765,9 @@ class Dolresource extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_element_resource($user=null, $notrigger=0) { + // phpcs:enable global $conf, $langs; $error=0; @@ -880,14 +886,15 @@ class Dolresource extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load in cache resource type code (setup in dictionary) * * @return int Nb lignes chargees, 0 si deja chargees, <0 si ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_cache_code_type_resource() { + // phpcs:enable global $langs; if (count($this->cache_code_type_resource)) return 0; // Cache deja charge @@ -967,6 +974,7 @@ class Dolresource extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -974,9 +982,9 @@ class Dolresource extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 5=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; return ''; diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 6ed6038af81..b95ba78e2be 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -60,6 +60,7 @@ class FormResource } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output html form to select a resource * @@ -75,9 +76,9 @@ class FormResource * @param int $limit Limit number of answers * @return string HTML string with */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_resource_list($selected='',$htmlname='fk_resource',$filter='',$showempty=0, $showtype=0, $forcecombo=0, $event=array(), $filterkey='', $outputmode=0, $limit=20) { + // phpcs:enable global $conf,$user,$langs; $out=''; @@ -155,6 +156,7 @@ class FormResource return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return html list of tickets type * @@ -167,9 +169,9 @@ class FormResource * @param int $maxlength Max length of label * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_types_resource($selected='',$htmlname='type_resource',$filtertype='',$format=0, $empty=0, $noadmininfo=0,$maxlength=0) { + // phpcs:enable global $langs,$user; $resourcestat = new Dolresource($this->db); diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 98d20bd0ad5..33360116c97 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -39,12 +39,12 @@ class UserGroup extends CommonObject * @var string ID to identify managed object */ public $element='usergroup'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='usergroup'; - + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe public $picto='group'; public $entity; // Entity of group @@ -803,6 +803,7 @@ class UserGroup extends CommonObject return $this->LibStatut(0,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -810,9 +811,9 @@ class UserGroup extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; $langs->load('users'); return ''; @@ -895,6 +896,7 @@ class UserGroup extends CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -904,9 +906,9 @@ class UserGroup extends CommonObject * 2=Return key only (uid=qqq) * @return string DN */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_dn($info,$mode=0) { + // phpcs:enable global $conf; $dn=''; if ($mode==0) $dn=$conf->global->LDAP_KEY_GROUPS."=".$info[$conf->global->LDAP_KEY_GROUPS].",".$conf->global->LDAP_GROUP_DN; @@ -916,14 +918,15 @@ class UserGroup extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Initialize the info array (array of LDAP values) that will be used to call LDAP functions * * @return array Tableau info des attributs */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_ldap_info() { + // phpcs:enable global $conf,$langs; $info=array(); @@ -986,7 +989,7 @@ class UserGroup extends CommonObject * @param int $hidedetails Hide details of lines * @param int $hidedesc Hide description * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information + * @param null|array $moreparams Array to provide more information * @return int 0 if KO, 1 if OK */ public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index d4e29841821..039bea84bc6 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -39,17 +39,17 @@ class Website extends CommonObject * @var string Id to identify managed objects */ public $element = 'website'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'website'; - + /** * @var array Does website support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for website. Must be the part after the 'object_' into object_myobject.png */ @@ -59,37 +59,37 @@ class Website extends CommonObject * @var int */ public $entity; - + /** * @var string */ public $ref; - + /** * @var string */ public $description; - + /** * @var int */ public $status; - + /** * @var mixed */ public $date_creation; - + /** * @var mixed */ public $tms = ''; - + /** * @var integer */ public $fk_default_home; - + /** * @var string */ @@ -695,6 +695,7 @@ class Website extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un status donne * @@ -702,38 +703,32 @@ class Website extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; - if ($mode == 0) - { - $prefix=''; - if ($status == 1) return $langs->trans('Enabled'); - if ($status == 0) return $langs->trans('Disabled'); - } - if ($mode == 1) + if ($mode == 0 || $mode == 1) { if ($status == 1) return $langs->trans('Enabled'); if ($status == 0) return $langs->trans('Disabled'); } - if ($mode == 2) + elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 3) + elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 5) + elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); From 22b96325559d902f71e9997f22635fd2f2d3bb92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 21:08:57 +0200 Subject: [PATCH 039/255] move phpcs:ignore --- .../facture/class/facture-rec.class.php | 22 +++--- htdocs/compta/facture/class/facture.class.php | 72 ++++++++++++------- htdocs/compta/tva/class/tva.class.php | 23 +++--- .../company/actions_card_company.class.php | 3 +- 4 files changed, 75 insertions(+), 45 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 4687a841807..51b031b5c7c 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -43,12 +43,12 @@ class FactureRec extends CommonInvoice * @var string ID to identify managed object */ public $element='facturerec'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='facture_rec'; - + public $table_element_line='facturedet_rec'; public $fk_element='fk_facture'; public $picto='bill'; @@ -440,14 +440,15 @@ class FactureRec extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Recupere les lignes de factures predefinies dans this->lines * * @return int 1 if OK, < 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { + // phpcs:enable $this->lines=array(); // Retreive all extrafield for line @@ -1182,6 +1183,7 @@ class FactureRec extends CommonInvoice return $this->LibStatut($this->frequency?1:0, $this->suspended, $mode, $alreadypaid, empty($this->type)?0:$this->type); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a status * @@ -1192,9 +1194,9 @@ class FactureRec extends CommonInvoice * @param int $type Type invoice * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($recur, $status, $mode=0, $alreadypaid=-1, $type=0) { + // phpcs:enable global $langs; $langs->load('bills'); @@ -1213,7 +1215,7 @@ class FactureRec extends CommonInvoice else return $langs->trans("Draft"); } } - if ($mode == 1) + elseif ($mode == 1) { $prefix='Short'; if ($recur) @@ -1227,7 +1229,7 @@ class FactureRec extends CommonInvoice else return $langs->trans("Draft"); } } - if ($mode == 2) + elseif ($mode == 2) { if ($recur) { @@ -1240,7 +1242,7 @@ class FactureRec extends CommonInvoice else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); } } - if ($mode == 3) + elseif ($mode == 3) { if ($recur) { @@ -1254,7 +1256,7 @@ class FactureRec extends CommonInvoice else return img_picto($langs->trans('Draft'),'statut0'); } } - if ($mode == 4) + elseif ($mode == 4) { $prefix=''; if ($recur) @@ -1268,7 +1270,7 @@ class FactureRec extends CommonInvoice else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); } } - if ($mode == 5 || $mode == 6) + elseif ($mode == 5 || $mode == 6) { $prefix=''; if ($mode == 5) $prefix='Short'; @@ -1653,7 +1655,7 @@ class FactureLigneRec extends CommonInvoiceLine * @var string ID to identify managed object */ public $element='facturedetrec'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index da0d66b2784..cb38b954736 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -57,12 +57,12 @@ class Facture extends CommonInvoice * @var string ID to identify managed object */ public $element='facture'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='facture'; - + public $table_element_line = 'facturedet'; public $fk_element = 'fk_facture'; public $picto='bill'; @@ -1406,14 +1406,15 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load all detailed lines into this->lines * * @return int 1 if OK, < 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { + // phpcs:enable $this->lines=array(); $sql = 'SELECT l.rowid, l.fk_facture, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx,'; @@ -1666,15 +1667,16 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount) * * @param int $idremise Id of absolute discount * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_discount($idremise) { + // phpcs:enable global $langs; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -1767,6 +1769,7 @@ class Facture extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set customer ref * @@ -1774,9 +1777,9 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_ref_client($ref_client, $notrigger=0) { + // phpcs:enable global $user; $error=0; @@ -2001,6 +2004,7 @@ class Facture extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Tag la facture comme paye completement (si close_code non renseigne) => this->fk_statut=2, this->paye=1 * ou partiellement (si close_code renseigne) + appel trigger BILL_PAYED => this->fk_statut=2, this->paye stay 0 @@ -2010,9 +2014,9 @@ class Facture extends CommonInvoice * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet (cas escompte par exemple) * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_paid($user, $close_code='', $close_note='') { + // phpcs:enable $error=0; if ($this->paye != 1) @@ -2060,6 +2064,7 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Tag la facture comme non payee completement + appel trigger BILL_UNPAYED * Fonction utilisee quand un paiement prelevement est refuse, @@ -2068,9 +2073,9 @@ class Facture extends CommonInvoice * @param User $user Object user that change status * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_unpaid($user) { + // phpcs:enable $error=0; $this->db->begin(); @@ -2108,6 +2113,7 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Tag invoice as canceled, with no payment on it (example for replacement invoice or payment never received) + call trigger BILL_CANCEL * Warning, if option to decrease stock on invoice was set, this function does not change stock (it might be a cancel because @@ -2118,9 +2124,9 @@ class Facture extends CommonInvoice * @param string $close_note Comment * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_canceled($user, $close_code='', $close_note='') { + // phpcs:enable dol_syslog(get_class($this)."::set_canceled rowid=".$this->id, LOG_DEBUG); @@ -2472,6 +2478,7 @@ class Facture extends CommonInvoice return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set draft status * @@ -2479,9 +2486,9 @@ class Facture extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_draft($user,$idwarehouse=-1) { + // phpcs:enable global $conf,$langs; $error=0; @@ -3038,6 +3045,7 @@ class Facture extends CommonInvoice else return $situation_percent < $obj->situation_percent; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update invoice line with percentage * @@ -3045,9 +3053,9 @@ class Facture extends CommonInvoice * @param int $percent Percentage * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_percent($line, $percent) { + // phpcs:enable global $mysoc,$user; include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php'; @@ -3135,6 +3143,7 @@ class Facture extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set percent discount * @@ -3143,9 +3152,9 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise($user, $remise, $notrigger=0) { + // phpcs:enable // Clean parameters if (empty($remise)) $remise=0; @@ -3200,6 +3209,7 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set absolute discount * @@ -3208,9 +3218,9 @@ class Facture extends CommonInvoice * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_remise_absolue($user, $remise, $notrigger=0) { + // phpcs:enable if (empty($remise)) $remise=0; if ($user->rights->facture->creer) @@ -3401,6 +3411,7 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of invoices (eventually filtered on a user) into an array * @@ -3414,9 +3425,9 @@ class Facture extends CommonInvoice * @param string $sortorder Sort order * @return int -1 if KO, array with result if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC') { + // phpcs:enable global $conf,$user; $ga = array(); @@ -3476,6 +3487,7 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of invoices qualified to be replaced by another invoice. * Invoices matching the following rules are returned: @@ -3484,9 +3496,9 @@ class Facture extends CommonInvoice * @param int $socid Id thirdparty * @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_replacable_invoices($socid=0) { + // phpcs:enable global $conf; $return = array(); @@ -3525,6 +3537,7 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of invoices qualified to be corrected by a credit note. * Invoices matching the following rules are returned: @@ -3533,9 +3546,9 @@ class Facture extends CommonInvoice * @param int $socid Id thirdparty * @return array Array of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_qualified_avoir_invoices($socid=0) { + // phpcs:enable global $conf; $return = array(); @@ -3599,6 +3612,7 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a withdrawal request for a standing order. * Use the remain to pay excluding all existing open direct debit requests. @@ -3607,9 +3621,9 @@ class Facture extends CommonInvoice * @param float $amount Amount we request direct debit for * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function demande_prelevement($fuser, $amount=0) { + // phpcs:enable $error=0; @@ -3710,6 +3724,7 @@ class Facture extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Supprime une demande de prelevement * @@ -3717,9 +3732,9 @@ class Facture extends CommonInvoice * @param int $did id de la demande a supprimer * @return int <0 if OK, >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function demande_prelevement_delete($fuser, $did) { + // phpcs:enable $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'prelevement_facture_demande'; $sql .= ' WHERE rowid = '.$did; $sql .= ' AND traite = 0'; @@ -3736,15 +3751,16 @@ class Facture extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Object user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user) { + // phpcs:enable global $conf, $langs; $clause = " WHERE"; @@ -3982,14 +3998,15 @@ class Facture extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf, $user; $this->nb=array(); @@ -4096,25 +4113,27 @@ class Facture extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Checks if the invoice is the first of a cycle * * @return boolean */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function is_first() { + // phpcs:enable return ($this->situation_counter == 1); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array containing the previous situations as Facture objects * * @return mixed -1 if error, array of previous situations */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_prev_sits() { + // phpcs:enable global $conf; $sql = 'SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture'; @@ -4187,15 +4206,16 @@ class Facture extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Checks if the invoice is the last in its cycle * * @return bool Last of the cycle status * */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function is_last_in_cycle() { + // phpcs:enable global $conf; if (!empty($this->situation_cycle_ref)) { @@ -4262,7 +4282,7 @@ class FactureLigne extends CommonInvoiceLine * @var string ID to identify managed object */ public $element='facturedet'; - + /** * @var string Name of table without prefix where object is stored */ @@ -4825,15 +4845,16 @@ class FactureLigne extends CommonInvoiceLine } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Mise a jour en base des champs total_xxx de ligne de facture * TODO What is goal of this method ? * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_total() { + // phpcs:enable $this->db->begin(); dol_syslog(get_class($this)."::update_total", LOG_DEBUG); @@ -4866,6 +4887,7 @@ class FactureLigne extends CommonInvoiceLine } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns situation_percent of the previous line. * Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line. @@ -4873,9 +4895,9 @@ class FactureLigne extends CommonInvoiceLine * @param int $invoiceid Invoice id * @return int >= 0 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_prev_progress($invoiceid) { + // phpcs:enable if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") { return 0; } else { diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index a5f7c3134d7..b1197260240 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -37,12 +37,12 @@ class Tva extends CommonObject * @var string ID to identify managed object */ public $element='tva'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='tva'; - + public $picto='payment'; var $tms; @@ -51,12 +51,12 @@ class Tva extends CommonObject var $amount; var $type_payment; var $num_payment; - + /** * @var string proper name for given parameter */ public $label; - + var $fk_bank; var $fk_user_creat; var $fk_user_modif; @@ -363,15 +363,16 @@ class Tva extends CommonObject return $solde; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Total of the VAT from invoices emitted by the thirdparty. * * @param int $year Year * @return double Amount */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function tva_sum_collectee($year = 0) { + // phpcs:enable $sql = "SELECT sum(f.tva) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1"; @@ -403,15 +404,16 @@ class Tva extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * VAT payed * * @param int $year Year * @return double Amount */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function tva_sum_payee($year = 0) { + // phpcs:enable $sql = "SELECT sum(f.total_tva) as total_tva"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; @@ -444,15 +446,16 @@ class Tva extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Total of the VAT payed * * @param int $year Year * @return double Amount */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function tva_sum_reglee($year = 0) { + // phpcs:enable $sql = "SELECT sum(f.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."tva as f"; @@ -636,15 +639,16 @@ class Tva extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update link between payment tva and line generate into llx_bank * * @param int $id_bank Id bank account * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_fk_bank($id_bank) { + // phpcs:enable $sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.$id_bank; $sql.= ' WHERE rowid = '.$this->id; $result = $this->db->query($sql); @@ -800,6 +804,7 @@ class Tva extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -807,9 +812,9 @@ class Tva extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Libelle du statut */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage return ''; diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 1949f696a86..3e18b7944f2 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -67,6 +67,7 @@ class ActionsCardCompany extends ActionsCardCommon } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * @@ -75,9 +76,9 @@ class ActionsCardCompany extends ActionsCardCommon * @param string $ref Ref of object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id=0, $ref='') { + // phpcs:enable global $conf, $langs, $user, $mysoc; global $form, $formadmin, $formcompany; From 2a9ef8dc0573ed0a907a3843915dce2ecec5bcbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 22:05:19 +0200 Subject: [PATCH 040/255] move phpcs:ignore --- .../class/accountingaccount.class.php | 19 ++++--- .../actions_adherentcard_common.class.php | 8 +-- .../actions_adherentcard_default.class.php | 6 ++- .../actions_contactcard_default.class.php | 10 ++-- .../core/class/emailsenderprofile.class.php | 26 ++++----- htdocs/core/class/html.formprojet.class.php | 11 ++-- htdocs/core/class/html.formsms.class.php | 3 +- htdocs/core/class/menu.class.php | 3 +- htdocs/core/modules/DolibarrModules.class.php | 54 ++++++++++++------- .../barcode/mod_barcode_product_standard.php | 6 ++- .../modules/fichinter/modules_fichinter.php | 6 ++- htdocs/core/modules/member/modules_cards.php | 6 ++- .../fourn/class/fournisseur.product.class.php | 25 +++++---- .../mailmanspip/class/mailmanspip.class.php | 17 +++--- .../canvas/actions_card_common.class.php | 12 +++-- .../actions_card_individual.class.php | 3 +- htdocs/website/class/websitepage.class.php | 17 +++--- 17 files changed, 140 insertions(+), 92 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index c6848bfe689..f2e2bbaf04c 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -528,15 +528,16 @@ class AccountingAccount extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Account deactivated * * @param int $id Id * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function account_desactivate($id) { + // phpcs:enable $result = $this->checkUsage(); if ($result > 0) { @@ -562,15 +563,16 @@ class AccountingAccount extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Account activated * * @param int $id Id * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function account_activate($id) { + // phpcs:enable $this->db->begin(); $sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account "; @@ -601,6 +603,7 @@ class AccountingAccount extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -608,9 +611,9 @@ class AccountingAccount extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; $langs->loadLangs(array("users")); @@ -620,27 +623,27 @@ class AccountingAccount extends CommonObject if ($statut == 1) return $langs->trans('Enabled'); if ($statut == 0) return $langs->trans('Disabled'); } - if ($mode == 1) + elseif ($mode == 1) { if ($statut == 1) return $langs->trans('Enabled'); if ($statut == 0) return $langs->trans('Disabled'); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index fe91fc74436..b84534af37a 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -75,16 +75,17 @@ abstract class ActionsAdherentCardCommon //} } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Set content of ->tpl array, to use into template * * @param string $action Type of action * @param int $id Id * @return string HTML output */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id) { + // phpcs:enable global $conf, $langs, $user, $canvas; global $form, $formcompany, $objsoc; @@ -233,14 +234,15 @@ abstract class ActionsAdherentCardCommon } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Assign POST values into object * * @return string HTML output */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function assign_post() { + // phpcs:enable global $langs, $mysoc; $this->object->old_name = $_POST["old_name"]; diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php index c5d6a89a152..be7af41e894 100644 --- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php +++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php @@ -67,6 +67,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas * @@ -74,9 +75,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon * @param int $id Id * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id) { + // phpcs:enable global $limit, $offset, $sortfield, $sortorder; global $conf, $db, $langs, $user; global $form; @@ -121,6 +122,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch datas list and save into ->list_datas * @@ -130,9 +132,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon * @param string $sortorder Sort order ('ASC' or 'DESC') * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LoadListDatas($limit, $offset, $sortfield, $sortorder) { + // phpcs:enable global $conf, $langs; //$this->getFieldList(); diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index 566434c1d5a..5831b943d76 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -29,8 +29,8 @@ include_once DOL_DOCUMENT_ROOT.'/contact/canvas/actions_contactcard_common.class */ class ActionsContactCardDefault extends ActionsContactCardCommon { - /** - * Constructor + /** + * Constructor * * @param DoliDB $db Handler acces base de donnees * @param string $dirmodule Name of directory of module @@ -66,6 +66,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas * @@ -73,9 +74,9 @@ class ActionsContactCardDefault extends ActionsContactCardCommon * @param int $id Id * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id) { + // phpcs:enable global $limit, $offset, $sortfield, $sortorder; global $conf, $db, $langs, $user; global $form; @@ -120,6 +121,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fetch datas list and save into ->list_datas * @@ -129,9 +131,9 @@ class ActionsContactCardDefault extends ActionsContactCardCommon * @param string $sortorder Sort order ('ASC' or 'DESC') * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LoadListDatas($limit, $offset, $sortfield, $sortorder) { + // phpcs:enable global $conf, $langs; //$this->getFieldList(); diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index ffff8ef1941..37685001aba 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -39,17 +39,17 @@ class EmailSenderProfile extends CommonObject * @var string ID to identify managed object */ public $element = 'emailsenderprofile'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'c_email_senderprofile'; - + /** * @var array Does emailsenderprofile support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 1; - + /** * @var string String with name of icon for emailsenderprofile */ @@ -310,6 +310,7 @@ class EmailSenderProfile extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return the status * @@ -317,43 +318,36 @@ class EmailSenderProfile extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function LibStatut($status,$mode=0) { global $langs; - if ($mode == 0) - { - $prefix=''; - if ($status == 1) return $langs->trans('Enabled'); - if ($status == 0) return $langs->trans('Disabled'); - } - if ($mode == 1) + if ($mode == 0 || $mode == 1) { if ($status == 1) return $langs->trans('Enabled'); if ($status == 0) return $langs->trans('Disabled'); } - if ($mode == 2) + elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 3) + elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 5) + elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 6) + elseif ($mode == 6) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 61c633c720b..e9e1d8fe6c9 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -33,7 +33,7 @@ class FormProjets * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -51,6 +51,7 @@ class FormProjets return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output a combo list with projects qualified for a third party / user * @@ -71,9 +72,9 @@ class FormProjets * @param int $htmlid Html id to use instead of htmlname * @return string Return html content */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '', $nooutput=0, $forceaddid=0, $morecss='', $htmlid='') { + // phpcs:enable global $langs,$conf,$form; $out=''; @@ -119,6 +120,7 @@ class FormProjets else return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array with projects qualified for a third party * @@ -139,9 +141,9 @@ class FormProjets * @param string $morecss More CSS * @return int Nb of project if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode=0, $filterkey = '', $nooutput=0, $forceaddid=0, $htmlid='', $morecss='maxwidth500') { + // phpcs:enable global $user,$conf,$langs; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -470,6 +472,7 @@ class FormProjets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Build a HTML select list of element of same thirdparty to suggest to link them to project * @@ -480,9 +483,9 @@ class FormProjets * @param string $projectkey Equivalent key to fk_projet for actual table_element * @return int|string The HTML select list of element or '' if nothing or -1 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet") { + // phpcs:enable global $conf, $langs; if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done) diff --git a/htdocs/core/class/html.formsms.class.php b/htdocs/core/class/html.formsms.class.php index 1db9fe4d3d8..a549485ac4c 100644 --- a/htdocs/core/class/html.formsms.class.php +++ b/htdocs/core/class/html.formsms.class.php @@ -88,6 +88,7 @@ class FormSms return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show the form to input an sms. * @@ -95,9 +96,9 @@ class FormSms * @param int $showform Show form tags and submit button (recommanded is to use with value 0) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function show_form($morecss='titlefield', $showform=1) { + // phpcs:enable global $conf, $langs, $user, $form; if (! is_object($form)) $form=new Form($this->db); diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php index b1ecbbf483c..3d9d92189a3 100644 --- a/htdocs/core/class/menu.class.php +++ b/htdocs/core/class/menu.class.php @@ -96,14 +96,15 @@ class Menu $this->liste=array_merge($array_start,$array_new,$array_end); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Remove a menu entry from this->liste * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function remove_last() { + // phpcs:enable if (count($this->liste) > 1) { array_pop($this->liste); } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 42be08bfe34..c700b8c84a1 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -999,6 +999,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create tables and keys required by module. * Files module.sql and module.key.sql with create table and create keys @@ -1008,9 +1009,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it * @param string $reldir Relative directory where to scan files * @return int <=0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _load_tables($reldir) { + // phpcs:enable global $conf; $error=0; @@ -1118,6 +1119,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds boxes * @@ -1125,9 +1127,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_boxes($option='') { + // phpcs:enable require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; global $conf; @@ -1218,14 +1220,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes boxes * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_boxes() { + // phpcs:enable global $conf; $err=0; @@ -1294,14 +1297,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds cronjobs * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_cronjobs() { + // phpcs:enable require_once DOL_DOCUMENT_ROOT . '/core/class/infobox.class.php'; global $conf; @@ -1408,14 +1412,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes boxes * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_cronjobs() { + // phpcs:enable global $conf; $err=0; @@ -1438,14 +1443,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes tabs * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_tabs() { + // phpcs:enable global $conf; $err=0; @@ -1464,14 +1470,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds tabs * * @return int Error count (0 if ok) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_tabs() { + // phpcs:enable global $conf; $err=0; @@ -1532,14 +1539,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds constants * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_const() { + // phpcs:enable global $conf; $err=0; @@ -1602,14 +1610,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes constants tagged 'deleteonunactive' * * @return int <0 if KO, 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_const() { + // phpcs:enable global $conf; $err=0; @@ -1638,6 +1647,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds access rights * @@ -1646,9 +1656,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_permissions($reinitadminperms=0, $force_entity=null, $notrigger=0) { + // phpcs:enable global $conf,$user; $err=0; @@ -1794,14 +1804,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes access rights * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_permissions() { + // phpcs:enable global $conf; $err=0; @@ -1820,14 +1831,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds menu entries * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_menus() { + // phpcs:enable global $user; if (! is_array($this->menu) || empty($this->menu)) return 0; @@ -1930,14 +1942,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes menu entries * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_menus() { + // phpcs:enable global $conf; $err=0; @@ -1960,14 +1973,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Creates directories * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_dirs() { + // phpcs:enable global $langs, $conf; $err=0; @@ -2019,6 +2033,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds directories definitions * @@ -2027,9 +2042,9 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_dirs($name,$dir) { + // phpcs:enable global $conf; $err=0; @@ -2064,14 +2079,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes directories * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_dirs() { + // phpcs:enable global $conf; $err=0; @@ -2090,14 +2106,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it return $err; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Adds generic parts * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_module_parts() { + // phpcs:enable global $conf; $error=0; @@ -2169,14 +2186,15 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Removes generic parts * * @return int Error count (0 if OK) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function delete_module_parts() { + // phpcs:enable global $conf; $err=0; diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php index bd61dab4ff4..42ce154c648 100644 --- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php +++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php @@ -223,6 +223,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return if a code is used (by other element) * @@ -231,9 +232,9 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode * @param Product $product Objet product * @return int 0 if available, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_dispo($db, $code, $product) { + // phpcs:enable $sql = "SELECT barcode FROM ".MAIN_DB_PREFIX."product"; $sql.= " WHERE barcode = '".$code."'"; if ($product->id > 0) $sql.= " AND rowid <> ".$product->id; @@ -256,6 +257,7 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return if a barcode value match syntax * @@ -263,9 +265,9 @@ class mod_barcode_product_standard extends ModeleNumRefBarCode * @param string $typefortest Type of barcode (ISBN, EAN, ...) * @return int 0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_syntax($codefortest, $typefortest) { + // phpcs:enable global $conf; $result = 0; diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index bc08063ea21..2d3c4bebfe6 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -40,6 +40,7 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -47,9 +48,9 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='ficheinter'; @@ -148,6 +149,7 @@ abstract class ModeleNumRefFicheinter } +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create an intervention document on disk using template defined into FICHEINTER_ADDON_PDF * @@ -160,9 +162,9 @@ abstract class ModeleNumRefFicheinter * @param int $hideref Hide ref * @return int 0 if KO, 1 if OK */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { + // phpcs:enable global $conf,$langs,$user; $langs->load("ficheinter"); diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php index b1dc86d4e4d..c931abce4ed 100644 --- a/htdocs/core/modules/member/modules_cards.php +++ b/htdocs/core/modules/member/modules_cards.php @@ -40,6 +40,7 @@ class ModelePDFCards public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -47,9 +48,9 @@ class ModelePDFCards * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='member'; @@ -63,6 +64,7 @@ class ModelePDFCards } +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Cree un fichier de cartes de visites en fonction du modele de ADHERENT_CARDS_ADDON_PDF * @@ -74,9 +76,9 @@ class ModelePDFCards * @param string $template pdf generenate document class to use default 'standard' * @return int <0 if KO, >0 if OK */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $outputdir='', $template='standard') { + // phpcs:enable global $conf,$langs; $langs->load("members"); diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 77a31689237..57502a52365 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -41,7 +41,7 @@ class ProductFournisseur extends Product * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -53,7 +53,7 @@ class ProductFournisseur extends Product * @var int ID */ public $id; - + /** * @deprecated * @see ref_supplier @@ -104,15 +104,16 @@ class ProductFournisseur extends Product + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Remove all prices for this couple supplier-product * * @param int $id_fourn Supplier Id * @return int < 0 if error, > 0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function remove_fournisseur($id_fourn) { + // phpcs:enable $ok=1; $this->db->begin(); @@ -141,15 +142,16 @@ class ProductFournisseur extends Product } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Remove a price for a couple supplier-product * * @param int $rowid Line id of price * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function remove_product_fournisseur_price($rowid) { + // phpcs:enable global $conf, $user; $error=0; @@ -186,6 +188,7 @@ class ProductFournisseur extends Product } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Modify the purchase price for a supplier * @@ -212,9 +215,9 @@ class ProductFournisseur extends Product * @param string $desc_fourn Custom description for product_fourn_price * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0, $newnpr=0, $delivery_time_days=0, $supplier_reputation='', $localtaxes_array=array(), $newdefaultvatcode='', $multicurrency_buyprice=0, $multicurrency_price_base_type='HT',$multicurrency_tx=1,$multicurrency_code='', $desc_fourn='') { + // phpcs:enable global $conf, $langs; //global $mysoc; @@ -441,6 +444,7 @@ class ProductFournisseur extends Product } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Loads the price information of a provider * @@ -448,9 +452,9 @@ class ProductFournisseur extends Product * @param int $ignore_expression Ignores the math expression for calculating price and uses the db value instead * @return int < 0 if KO, 0 if OK but not found, > 0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_product_fournisseur_price($rowid, $ignore_expression = 0) { + // phpcs:enable global $conf; $sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.default_vat_code, pfp.info_bits as fourn_tva_npr, pfp.fk_availability,"; @@ -529,6 +533,7 @@ class ProductFournisseur extends Product } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List all supplier prices of a product * @@ -539,9 +544,9 @@ class ProductFournisseur extends Product * @param int $offset Offset * @return array Array of Products with new properties to define supplier price */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_product_fournisseur_price($prodid, $sortfield='', $sortorder='', $limit=0, $offset=0) { + // phpcs:enable global $conf; $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,"; @@ -630,6 +635,7 @@ class ProductFournisseur extends Product } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load properties for minimum price * @@ -638,9 +644,9 @@ class ProductFournisseur extends Product * @param int $socid get min price for specific supplier * @return int <0 if KO, 0=Not found of no product id provided, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function find_min_price_product_fournisseur($prodid, $qty=0, $socid=0) { + // phpcs:enable global $conf; if (empty($prodid)) @@ -818,6 +824,7 @@ class ProductFournisseur extends Product return $thirdparty->getNomUrl($withpicto,$option,$maxlen,$notooltip); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Display price of product * @@ -829,9 +836,9 @@ class ProductFournisseur extends Product * to display in table format. * @return string String with supplier price */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function display_price_product_fournisseur($showunitprice=1,$showsuptitle=1,$maxlen=0,$notooltip=0, $productFournList=array()) { + // phpcs:enable global $langs; $out = ''; diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index c33e015ec79..139183e0375 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -42,7 +42,7 @@ class MailmanSpip * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -170,15 +170,16 @@ class MailmanSpip return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction qui donne les droits redacteurs dans spip * * @param Adherent $object Object with data (->firstname, ->lastname, ->email and ->login) * @return int =0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_spip($object) { + // phpcs:enable dol_syslog(get_class($this)."::add_to_spip"); if ($this->isSpipEnabled()) @@ -213,15 +214,16 @@ class MailmanSpip return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction qui enleve les droits redacteurs dans spip * * @param Adherent $object Object with data (->login) * @return int =0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function del_to_spip($object) { + // phpcs:enable dol_syslog(get_class($this)."::del_to_spip"); if ($this->isSpipEnabled()) @@ -253,15 +255,16 @@ class MailmanSpip return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction qui dit si cet utilisateur est un redacteur existant dans spip * * @param object $object Object with data (->login) * @return int 1=exists, 0=does not exists, -1=error */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function is_in_spip($object) { + // phpcs:enable if ($this->isSpipEnabled()) { if ($this->checkSpipConfig()) @@ -304,6 +307,7 @@ class MailmanSpip return -1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Subscribe an email to all mailing-lists * @@ -311,9 +315,9 @@ class MailmanSpip * @param array $listes To force mailing-list (string separated with ,) * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_mailman($object,$listes='') { + // phpcs:enable global $conf,$langs,$user; dol_syslog(get_class($this)."::add_to_mailman"); @@ -376,6 +380,7 @@ class MailmanSpip } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Unsubscribe an email from all mailing-lists * Used when a user is resiliated @@ -384,9 +389,9 @@ class MailmanSpip * @param array $listes To force mailing-list (string separated with ,) * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function del_to_mailman($object,$listes='') { + // phpcs:enable global $conf,$langs,$user; dol_syslog(get_class($this)."::del_to_mailman"); diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 30b1667afcf..2577f5bed5d 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -31,7 +31,7 @@ abstract class ActionsCardCommon * @var DoliDB Database handler. */ public $db; - + var $dirmodule; var $targetmodule; var $canvas; @@ -41,12 +41,12 @@ abstract class ActionsCardCommon var $tpl = array(); //! Object container var $object; - + /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) @@ -70,6 +70,7 @@ abstract class ActionsCardCommon $this->object = $object; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * @@ -78,9 +79,9 @@ abstract class ActionsCardCommon * @param string $ref Ref of object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id=0, $ref='') { + // phpcs:enable global $conf, $langs, $user, $mysoc, $canvas; global $form, $formadmin, $formcompany; @@ -370,15 +371,16 @@ abstract class ActionsCardCommon } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Assign POST values into object * * @param string $action Action string * @return string HTML output */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function assign_post($action) { + // phpcs:enable global $langs, $mysoc; $this->object->id = $_POST["socid"]; diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index c662ce2ae6f..5fd7ee01faf 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -84,6 +84,7 @@ class ActionsCardIndividual extends ActionsCardCommon return $return; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Assign custom values for canvas (for example into this->tpl to be used by templates) * @@ -92,9 +93,9 @@ class ActionsCardIndividual extends ActionsCardCommon * @param string $ref Ref of object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function assign_values(&$action, $id=0, $ref='') { + // phpcs:enable global $conf, $langs; global $form, $formcompany; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 4b313808e0d..3f446f13a5b 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -39,12 +39,12 @@ class WebsitePage extends CommonObject * @var string Id to identify managed objects */ public $element = 'websitepage'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element = 'website_page'; - + /** * @var string String with name of icon for websitepage. Must be the part after the 'object_' into object_myobject.png */ @@ -467,6 +467,7 @@ class WebsitePage extends CommonObject return $this->LibStatut($this->status,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un status donne * @@ -474,9 +475,9 @@ class WebsitePage extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($status,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) @@ -485,27 +486,27 @@ class WebsitePage extends CommonObject if ($status == 1) return $langs->trans('Enabled'); if ($status == 0) return $langs->trans('Disabled'); } - if ($mode == 1) + elseif ($mode == 1) { if ($status == 1) return $langs->trans('Enabled'); if ($status == 0) return $langs->trans('Disabled'); } - if ($mode == 2) + elseif ($mode == 2) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 3) + elseif ($mode == 3) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled'); if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled'); } - if ($mode == 5) + elseif ($mode == 5) { if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4'); if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5'); From 47e73bfd8e937950925025067c6a22405f83da66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 23:01:14 +0200 Subject: [PATCH 041/255] move phpcs:ignore --- .../class/commonstickergenerator.class.php | 21 ++-- htdocs/core/class/discount.class.php | 8 +- htdocs/core/class/doleditor.class.php | 3 +- htdocs/core/class/dolgraph.class.php | 97 ++++++++++++------- htdocs/core/class/dolreceiptprinter.class.php | 41 ++++---- .../core/class/html.formaccounting.class.php | 20 ++-- htdocs/core/class/html.formactions.class.php | 8 +- htdocs/core/class/html.formadmin.class.php | 26 +++-- htdocs/core/class/html.formcron.class.php | 5 +- htdocs/core/class/openid.class.php | 57 +++++++---- htdocs/core/class/translate.class.php | 9 +- 11 files changed, 186 insertions(+), 109 deletions(-) diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 26227048782..6d4c32d82bb 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -94,6 +94,7 @@ abstract class CommonStickerGenerator $this->db = $db; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build PDF on disk, then output on HTTP strem. * @@ -103,8 +104,8 @@ abstract class CommonStickerGenerator * @param string $outputdir Output directory for pdf file * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps abstract function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir=''); + // phpcs:enable /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) @@ -116,6 +117,7 @@ abstract class CommonStickerGenerator */ abstract function addSticker(&$pdf,$outputlangs,$param); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Methode qui permet de modifier la taille des caracteres * Cela modiera aussi l'espace entre chaque ligne @@ -124,9 +126,9 @@ abstract class CommonStickerGenerator * @param int $pt point * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Set_Char_Size(&$pdf,$pt) { + // phpcs:enable if ($pt > 3) { $this->_Char_Size = $pt; $this->_Line_Height = $this->_Get_Height_Chars($pt); @@ -134,6 +136,7 @@ abstract class CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Print dot line * @@ -146,9 +149,9 @@ abstract class CommonStickerGenerator * @param int $nbPointilles Nb pointilles * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Pointille(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$nbPointilles=15) { + // phpcs:enable $pdf->SetLineWidth($epaisseur); $length=abs($x1-$x2); $hauteur=abs($y1-$y2); @@ -176,6 +179,7 @@ abstract class CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Function realisant une croix aux 4 coins des cartes * @@ -188,9 +192,9 @@ abstract class CommonStickerGenerator * @param int $taille Size * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Croix(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=4) { + // phpcs:enable $pdf->SetDrawColor(192,192,192); $pdf->SetLineWidth($epaisseur); @@ -211,6 +215,7 @@ abstract class CommonStickerGenerator $pdf->SetDrawColor(0,0,0); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Convert units (in to mm, mm to in) * $src and $dest must be 'in' or 'mm' @@ -220,9 +225,9 @@ abstract class CommonStickerGenerator * @param string $dest to * @return float value value after conversion */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Convert_Metric($value, $src, $dest) { + // phpcs:enable if ($src != $dest) { $tab['in'] = 39.37008; $tab['mm'] = 1000; @@ -232,15 +237,16 @@ abstract class CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Give the height for a char size given. * * @param int $pt Point * @return int Height chars */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Get_Height_Chars($pt) { + // phpcs:enable // Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes $_Table_Hauteur_Chars = array(6=>2, 7=>2.5, 8=>3, 9=>3.5, 10=>4, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10); if (in_array($pt, array_keys($_Table_Hauteur_Chars))) { @@ -250,6 +256,7 @@ abstract class CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Set format * @@ -257,9 +264,9 @@ abstract class CommonStickerGenerator * @param string $format Format * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Set_Format(&$pdf, $format) { + // phpcs:enable $this->_Metric = $format['metric']; $this->_Avery_Name = $format['name']; $this->_Avery_Code = $format['code']; diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index a2ac7a1f458..b1a92ae0f5f 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -32,7 +32,7 @@ class DiscountAbsolute * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -344,6 +344,7 @@ class DiscountAbsolute + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Link the discount to a particular invoice line or a particular invoice. * When discount is a global discount used as an invoice line, we link using rowidline. @@ -353,9 +354,9 @@ class DiscountAbsolute * @param int $rowidinvoice Invoice id (To use discount as a credit note to reduc payment of invoice) * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function link_to_invoice($rowidline,$rowidinvoice) { + // phpcs:enable // Check parameters if (! $rowidline && ! $rowidinvoice) { @@ -399,15 +400,16 @@ class DiscountAbsolute } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Link the discount to a particular invoice line or a particular invoice. * Do not call this if discount is linked to a reconcialiated invoice * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function unlink_invoice() { + // phpcs:enable $sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except"; if(! empty($this->discount_type)) { $sql.=" SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL"; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 52d9b47ecdf..548721be05f 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -137,6 +137,7 @@ class DolEditor } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output edit area inside the HTML stream. * Output depends on this->tool (fckeditor, ckeditor, textarea, ...) @@ -148,9 +149,9 @@ class DolEditor * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...) * @return void|string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='') { + // phpcs:enable global $conf,$langs; $fullpage=false; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 55ecc77291a..f3d6041515c 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -69,7 +69,7 @@ class DolGraph var $showpercent=0; var $combine=0; // 0.05 if you want to combine records < 5% into "other" var $graph; // Objet Graph (Artichow, Phplot...) - + /** * @var string Error code (or message) */ @@ -128,120 +128,130 @@ class DolGraph } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set Y precision * * @param float $which_prec Precision * @return boolean */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetPrecisionY($which_prec) { + // phpcs:enable $this->PrecisionY = $which_prec; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * * @param float $xi Xi * @return boolean True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetHorizTickIncrement($xi) { + // phpcs:enable $this->horizTickIncrement = $xi; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * * @param float $xt Xt * @return boolean True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetNumXTicks($xt) { + // phpcs:enable $this->SetNumXTicks = $xt; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set label interval to reduce number of labels * * @param float $x Label interval * @return boolean True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetLabelInterval($x) { + // phpcs:enable $this->labelInterval = $x; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Hide X grid * * @param boolean $bool XGrid or not * @return boolean true */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetHideXGrid($bool) { + // phpcs:enable $this->hideXGrid = $bool; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Hide Y grid * * @param boolean $bool YGrid or not * @return boolean true */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetHideYGrid($bool) { + // phpcs:enable $this->hideYGrid = $bool; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set y label * * @param string $label Y label * @return boolean|null True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetYLabel($label) { + // phpcs:enable $this->YLabel = $label; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set width * * @param int $w Width * @return boolean|null True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetWidth($w) { + // phpcs:enable $this->width = $w; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set title * * @param string $title Title * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetTitle($title) { + // phpcs:enable $this->title = $title; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set data * @@ -249,161 +259,174 @@ class DolGraph * @return void * @see draw_jflot for syntax of data array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetData($data) { + // phpcs:enable $this->data = $data; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set data * * @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetDataColor($datacolor) { + // phpcs:enable $this->datacolor = $datacolor; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set type * * @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars') * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetType($type) { + // phpcs:enable $this->type = $type; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set legend * * @param array $legend Legend. Example: array('seriename1','seriname2',...) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetLegend($legend) { + // phpcs:enable $this->Legend = $legend; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set min width * * @param int $legendwidthmin Min width * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetLegendWidthMin($legendwidthmin) { + // phpcs:enable $this->LegendWidthMin = $legendwidthmin; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set max value * * @param int $max Max value * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetMaxValue($max) { + // phpcs:enable $this->MaxValue = $max; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get max value * * @return int Max value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetMaxValue() { + // phpcs:enable return $this->MaxValue; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set min value * * @param int $min Min value * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetMinValue($min) { + // phpcs:enable $this->MinValue = $min; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get min value * * @return int Max value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetMinValue() { + // phpcs:enable return $this->MinValue; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set height * * @param int $h Height * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetHeight($h) { + // phpcs:enable $this->height = $h; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set shading * * @param string $s Shading * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetShading($s) { + // phpcs:enable $this->SetShading = $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set shading * * @param string $s Shading * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetCssPrefix($s) { + // phpcs:enable $this->cssprefix = $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Reset bg color * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ResetBgColor() { + // phpcs:enable unset($this->bgcolor); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Reset bgcolorgrid * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ResetBgColorGrid() { + // phpcs:enable unset($this->bgcolorgrid); } @@ -452,15 +475,16 @@ class DolGraph + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define background color of complete image * * @param array $bg_color array(R,G,B) ou 'onglet' ou 'default' * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetBgColor($bg_color = array(255,255,255)) { + // phpcs:enable global $theme_bgcolor,$theme_bgcoloronglet; if (! is_array($bg_color)) @@ -481,15 +505,16 @@ class DolGraph } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define background color of grid * * @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default' * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetBgColorGrid($bg_colorgrid = array(255,255,255)) { + // phpcs:enable global $theme_bgcolor,$theme_bgcoloronglet; if (! is_array($bg_colorgrid)) @@ -510,25 +535,27 @@ class DolGraph } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Reset data color * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ResetDataColor() { + // phpcs:enable unset($this->datacolor); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get max value * * @return int Max value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetMaxValueInData() { + // phpcs:enable $k = 0; $vals = array(); @@ -547,14 +574,15 @@ class DolGraph return $vals[0]; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return min value of all data * * @return int Min value of all data */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetMinValueInData() { + // phpcs:enable $k = 0; $vals = array(); @@ -573,14 +601,15 @@ class DolGraph return $vals[0]; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return max value of all data * * @return int Max value of all data */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetCeilMaxValue() { + // phpcs:enable $max = $this->GetMaxValueInData(); if ($max != 0) $max++; $size=dol_strlen(abs(ceil($max))); @@ -597,14 +626,15 @@ class DolGraph return $res; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return min value of all data * * @return double Max value of all data */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetFloorMinValue() { + // phpcs:enable $min = $this->GetMinValueInData(); if ($min == '') $min=0; if ($min != 0) $min--; @@ -659,7 +689,7 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function draw_artichow($file,$fileurl) { global $artichow_defaultfont; @@ -832,6 +862,7 @@ class DolGraph } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Build a graph using JFlot library. Input when calling this method should be: * $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB)); @@ -848,9 +879,9 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk. Never used here. * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function draw_jflot($file,$fileurl) { + // phpcs:enable global $artichow_defaultfont; dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type)." this->MaxValue=".$this->MaxValue); diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index a00da884aba..36881b76f84 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -105,25 +105,25 @@ class dolReceiptPrinter extends Escpos const CONNECTOR_NETWORK_PRINT = 3; const CONNECTOR_WINDOWS_PRINT = 4; //const CONNECTOR_JAVA = 5; - + /** * @var DoliDB Database handler. */ public $db; - + var $tags; var $printer; var $template; - + /** - * @var string Error code (or message) - */ - public $error=''; - + * @var string Error code (or message) + */ + public $error=''; + /** - * @var string[] Error codes (or messages) - */ - public $errors = array(); + * @var string[] Error codes (or messages) + */ + public $errors = array(); @@ -350,6 +350,7 @@ class dolReceiptPrinter extends Escpos } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Add a printer in db * @@ -359,9 +360,9 @@ class dolReceiptPrinter extends Escpos * @param string $parameter Printer parameter * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function AddPrinter($name, $type, $profile, $parameter) { + // phpcs:enable global $conf; $error = 0; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt'; @@ -375,6 +376,7 @@ class dolReceiptPrinter extends Escpos return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Update a printer in db * @@ -385,9 +387,9 @@ class dolReceiptPrinter extends Escpos * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function UpdatePrinter($name, $type, $profile, $parameter, $printerid) { + // phpcs:enable global $conf; $error = 0; $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt'; @@ -404,15 +406,16 @@ class dolReceiptPrinter extends Escpos return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Delete a printer from db * * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DeletePrinter($printerid) { + // phpcs:enable global $conf; $error = 0; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt'; @@ -425,6 +428,7 @@ class dolReceiptPrinter extends Escpos return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Update a printer template in db * @@ -433,9 +437,9 @@ class dolReceiptPrinter extends Escpos * @param int $templateid Template id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function UpdateTemplate($name, $template, $templateid) { + // phpcs:enable global $conf; $error = 0; $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template'; @@ -451,15 +455,16 @@ class dolReceiptPrinter extends Escpos } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Send Test page to Printer * * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SendTestToPrinter($printerid) { + // phpcs:enable global $conf; $error = 0; $img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png'); @@ -486,6 +491,7 @@ class dolReceiptPrinter extends Escpos return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Print Receipt Ticket * @@ -494,9 +500,9 @@ class dolReceiptPrinter extends Escpos * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SendToPrinter($object, $templateid, $printerid) { + // phpcs:enable global $conf; $error = 0; $ret = $this->loadTemplate($templateid); @@ -650,15 +656,16 @@ class dolReceiptPrinter extends Escpos } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function Init Printer * * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function InitPrinter($printerid) { + // phpcs:enable global $conf; $error=0; $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter'; diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 64e33cd5023..5ffaf0463a6 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -39,7 +39,7 @@ class FormAccounting extends Form * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -55,6 +55,7 @@ class FormAccounting extends Form $this->db = $db; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of journals with label by nature * @@ -69,9 +70,9 @@ class FormAccounting extends Form * @param int $disabledajaxcombo Disable ajax combo box. * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_journal($selectid, $htmlname = 'journal', $nature=0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='', $disabledajaxcombo=0) { + // phpcs:enable global $conf,$langs; $out = ''; @@ -137,6 +138,7 @@ class FormAccounting extends Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of accounting category. * Use mysoc->country_id or mysoc->country_code so they must be defined. @@ -149,9 +151,9 @@ class FormAccounting extends Form * @param int $allcountries All countries * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_accounting_category($selected='',$htmlname='account_category', $useempty=0, $maxlen=0, $help=1, $allcountries=0) { + // phpcs:enable global $db,$langs,$user,$mysoc; if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries)) @@ -218,6 +220,7 @@ class FormAccounting extends Form print $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return select filter with date of transaction * @@ -225,9 +228,9 @@ class FormAccounting extends Form * @param string $selectedkey Value * @return string HTML edit field */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') { + // phpcs:enable $options = array(); $sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping'; @@ -250,6 +253,7 @@ class FormAccounting extends Form return Form::selectarray($htmlname, $options, $selectedkey); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of accounts with label by chart of accounts * @@ -263,9 +267,9 @@ class FormAccounting extends Form * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='') { + // phpcs:enable global $conf, $langs; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; @@ -342,6 +346,7 @@ class FormAccounting extends Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of auxilary thirdparty accounts * @@ -351,9 +356,9 @@ class FormAccounting extends Form * @param string $morecss More css * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') { + // phpcs:enable $aux_account = array(); @@ -403,6 +408,7 @@ class FormAccounting extends Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML combo list of years existing into book keepping * @@ -412,9 +418,9 @@ class FormAccounting extends Form * @param string $output_format (html/opton (for option html only)/array (to return options arrays * @return string/array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html') { + // phpcs:enable global $conf; $out_array = array(); diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 7fc07ab46ed..e01e1f2ad65 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -33,7 +33,7 @@ class FormActions * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -52,6 +52,7 @@ class FormActions } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show list of action status * @@ -64,9 +65,9 @@ class FormActions * @param string $morecss More css on select field * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_select_status_action($formname, $selected, $canedit=1, $htmlname='complete', $showempty=0, $onlyselect=0, $morecss='maxwidth100') { + // phpcs:enable global $langs,$conf; $listofstatus = array( @@ -314,6 +315,7 @@ class FormActions } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output html select list of type of event * @@ -326,9 +328,9 @@ class FormActions * @param int $nooutput 1=No output * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0) { + // phpcs:enable global $langs,$user,$form,$conf; if (! is_object($form)) $form=new Form($db); diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index fd9bc3ab3f9..22fa73741ce 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -29,15 +29,8 @@ */ class FormAdmin { - /** - * @var DoliDB Database handler. - */ - public $db; - - /** - * @var string Error code (or message) - */ - public $error=''; + var $db; + var $error; /** @@ -51,6 +44,7 @@ class FormAdmin return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return html select list with available languages (key='en_US', value='United States' for example) * @@ -66,9 +60,9 @@ class FormAdmin * @param int $forcecombo Force to use combo box (so no ajax beautify effect) * @return string Return HTML select string with list of languages */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0) { + // phpcs:enable global $langs; $langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT,12); @@ -127,6 +121,7 @@ class FormAdmin return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of available menus (eldy_backoffice, ...) * @@ -136,9 +131,9 @@ class FormAdmin * @param string $moreattrib More attributes on html select tag * @return integer|null */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='') { + // phpcs:enable global $langs,$conf; // Clean parameters @@ -217,6 +212,7 @@ class FormAdmin print ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return combo list of available menu families * @@ -225,9 +221,9 @@ class FormAdmin * @param string[] $dirmenuarray Directories to scan * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_menu_families($selected, $htmlname, $dirmenuarray) { + // phpcs:enable global $langs,$conf; //$expdevmenu=array('smartphone_backoffice.php','smartphone_frontoffice.php'); // Menu to disable if $conf->global->MAIN_FEATURES_LEVEL is not set @@ -289,6 +285,7 @@ class FormAdmin } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a HTML select list of timezones * @@ -296,9 +293,9 @@ class FormAdmin * @param string $htmlname Nom de la zone select * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_timezone($selected,$htmlname) { + // phpcs:enable global $langs,$conf; print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''.$langs->trans("ChooseFileToImport",img_picto('','filenew')).'

    '; @@ -648,7 +648,8 @@ if ($step == 4 && $datatoimport) $classname = "Import".ucfirst($model); require_once $dir.$file; $obj = new $classname($db,$datatoimport); - if ($model == 'csv') { + if ($model == 'csv') + { $obj->separator = $separator; $obj->enclosure = $enclosure; } @@ -796,9 +797,9 @@ if ($step == 4 && $datatoimport) print ''; print ''; print $langs->trans("Separator").' : '; - print ''; + print ''; print '    '.$langs->trans("Enclosure").' : '; - print ''; + print ''; print ''; print ''; print ''; @@ -833,8 +834,8 @@ if ($step == 4 && $datatoimport) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; } From 639f24a95b23707024c36cf8535e9b3f8210881e Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 5 Sep 2018 17:36:28 +0200 Subject: [PATCH 114/255] Add online payment link --- htdocs/don/card.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 5a9e439a9c7..d033f7b73c9 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -790,6 +790,16 @@ if (! empty($id) && $action != 'edit') // Show links to link elements $linktoelem = $form->showLinkToObjectBlock($object, null, array('don')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); + + // Show online payment link + $useonlinepayment = (! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled) || ! empty($conf->paybox->enabled)); + + if ($useonlinepayment) //$object->statut != Facture::STATUS_DRAFT && + { + print '
    '."\n"; + require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; + print showOnlinePaymentUrl('donation', $object->ref).'
    '; + } print '
    '; From 6e209b550bdf0025fa76e3edb63627aaa9a7f0a3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 5 Sep 2018 17:40:26 +0200 Subject: [PATCH 115/255] add payment link for donation --- htdocs/core/lib/payments.lib.php | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 98d9035112f..0f0cfc267d3 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -24,7 +24,8 @@ * @param Paiement $object Current payment object * @return array Tabs for the payment section */ -function payment_prepare_head(Paiement $object) { +function payment_prepare_head(Paiement $object) +{ global $langs, $conf; @@ -59,7 +60,8 @@ function payment_prepare_head(Paiement $object) { * @param Paiement $object Current payment object * @return array Tabs for the payment section */ -function payment_supplier_prepare_head(Paiement $object) { +function payment_supplier_prepare_head(Paiement $object) +{ global $langs, $conf; @@ -90,7 +92,7 @@ function payment_supplier_prepare_head(Paiement $object) { /** * Return array of valid payment mode * - * @param string $paymentmethod Filter on this payment method + * @param string $paymentmethod Filter on this payment method (''=none, 'paypal', ...) * @return array Array of valid payment method */ function getValidOnlinePaymentMethods($paymentmethod='') @@ -234,6 +236,24 @@ function getOnlinePaymentUrl($mode, $type, $ref='', $amount='9.99', $freetag='yo } } } + if ($type == 'donation') + { + $out=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?source=donation&ref='.($mode?'':''); + if ($mode == 1) $out.='donation_ref'; + if ($mode == 0) $out.=urlencode($ref); + $out.=($mode?'':''); + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN)) + { + if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + else + { + $out.='&securekey='.($mode?'':''); + if ($mode == 1) $out.="hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + donation_ref)"; + if ($mode == 0) $out.= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $type . $ref, 2); + $out.=($mode?'':''); + } + } + } // For multicompany if (! empty($out) && ! empty($conf->multicompany->enabled)) $out.="&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities From b630a9721516380b165b91616a45f99ddd983681 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 5 Sep 2018 17:41:37 +0200 Subject: [PATCH 116/255] add payment link on admin gateway --- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 25 +++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index a425055135f..a5c5ce7cf11 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -1,4 +1,4 @@ - * * This program is free software; you can redistribute it and/or modify @@ -118,6 +118,28 @@ if (! empty($conf->adherent->enabled)) } print '
    '; } +if (! empty($conf->don->enabled)) +{ + print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnDonation",$servicename).':
    '; + print ''.getOnlinePaymentUrl(1,'donation')."
    \n"; + if (! empty($conf->global->PAYMENT_SECURITY_TOKEN) && ! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) + { + $langs->load("members"); + print '
    '; + print $langs->trans("EnterRefToBuildUrl",$langs->transnoentitiesnoconv("Don")).': '; + print ''; + print ''; + if (GETPOST('generate_donation_ref')) + { + print '
    -> '; + $url=getOnlinePaymentUrl(0,'donation',GETPOST('generate_donation_ref','alpha')); + print $url; + print "
    \n"; + } + print ''; + } + print '
    '; +} if (! empty($conf->use_javascript_ajax)) { @@ -140,3 +162,4 @@ print info_admin($langs->trans("YouCanAddTagOnUrl")); print ''; + From f7c3ca9d20ade10cfaa9bd7f670b028041263b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Sep 2018 18:49:06 +0200 Subject: [PATCH 117/255] move phpcs:ignore --- htdocs/core/class/html.formother.class.php | 60 +++++++++------ .../modules/cheque/mod_chequereceipt_mint.php | 3 +- .../cheque/mod_chequereceipt_thyme.php | 3 +- .../doc/doc_generic_order_odt.modules.php | 3 +- .../doc/doc_generic_contract_odt.modules.php | 3 +- .../expedition/mod_expedition_ribera.php | 3 +- .../expedition/mod_expedition_safor.php | 3 +- .../modules/import/import_csv.modules.php | 42 +++++++---- .../modules/mailings/modules_mailings.php | 15 ++-- .../modules/member/doc/pdf_standard.class.php | 6 +- .../doc/pdf_standardlabel.class.php | 26 ++++--- .../doc/doc_generic_product_odt.modules.php | 3 +- .../societe/mod_codeclient_elephant.php | 6 +- ..._generic_supplier_proposal_odt.modules.php | 3 +- .../user/doc/doc_generic_user_odt.modules.php | 6 +- htdocs/projet/class/task.class.php | 75 ++++++++++--------- 16 files changed, 156 insertions(+), 104 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index ed371cc1e23..93b17669c2c 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -58,6 +58,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML select list of export models * @@ -68,13 +69,13 @@ class FormOther * @param int $fk_user Utilisateur créant le modèle * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_export_model($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null) { + // phpcs:enable $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."export_model"; $sql.= " WHERE type = '".$type."'"; - if(!empty($fk_user))$sql.=" AND fk_user=".$fk_user; + if (!empty($fk_user)) $sql.=" AND fk_user=".$fk_user; $sql.= " ORDER BY rowid"; $result = $this->db->query($sql); if ($result) @@ -110,6 +111,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of export models * @@ -119,9 +121,9 @@ class FormOther * @param int $useempty Affiche valeur vide dans liste * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_import_model($selected='', $htmlname='importmodelid', $type='', $useempty=0) { + // phpcs:enable $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."import_model"; $sql.= " WHERE type = '".$type."'"; @@ -160,6 +162,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of ecotaxes with label * @@ -167,9 +170,9 @@ class FormOther * @param string $htmlname Name of combo list * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_ecotaxes($selected='', $htmlname='ecotaxe_id') { + // phpcs:enable global $langs; $sql = "SELECT e.rowid, e.code, e.label, e.price, e.organization,"; @@ -217,6 +220,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of revenue stamp for country * @@ -225,9 +229,9 @@ class FormOther * @param string $country_code Country Code * @return string HTML select list */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_revenue_stamp($selected='', $htmlname='revenuestamp', $country_code='') { + // phpcs:enable global $langs; $out=''; @@ -275,6 +279,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a HTML select list to select a percent * @@ -287,9 +292,9 @@ class FormOther * @param int $showempty Add also an empty line * @return string HTML select string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100,$showempty=0) { + // phpcs:enable $return = ''; if ($useempty) @@ -829,6 +841,7 @@ class FormOther return $select_week; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML combo list of month * @@ -839,9 +852,9 @@ class FormOther * @param string $morecss More Css * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_month($selected='', $htmlname='monthid', $useempty=0, $longlabel=0, $morecss='') { + // phpcs:enable global $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -871,6 +884,7 @@ class FormOther return $select_month; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML combo list of years * @@ -885,9 +899,9 @@ class FormOther * @param string $morecss More CSS * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto') { + // phpcs:enable print $this->selectyear($selected,$htmlname,$useempty,$min_year,$max_year,$offset,$invert,$option,$morecss); } @@ -944,6 +958,7 @@ class FormOther return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show form to select address * @@ -955,9 +970,9 @@ class FormOther * @param int $originid Id de l'origine * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='') { + // phpcs:enable global $langs,$conf; global $form; @@ -1206,6 +1221,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a HTML select list of a dictionary * @@ -1218,9 +1234,9 @@ class FormOther * @param string $moreattrib More attributes on HTML select tag * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0,$moreattrib='') { + // phpcs:enable global $langs, $conf; $langs->load("admin"); diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index 32e0d373631..b3b6fb96b66 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -138,6 +138,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -145,9 +146,9 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts * @param string $objforref Object for number to search * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function chequereceipt_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index ec276d52935..caf063da7d4 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -124,6 +124,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -131,9 +132,9 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts * @param string $objforref Object for number to search * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function chequereceipt_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 166c7f389d1..f7f51302972 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -177,6 +177,7 @@ class doc_generic_order_odt extends ModelePDFCommandes return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -188,9 +189,9 @@ class doc_generic_order_odt extends ModelePDFCommandes * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index b58a67a2cb0..413daf7ba25 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -167,6 +167,7 @@ class doc_generic_contract_odt extends ModelePDFContract return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -178,9 +179,9 @@ class doc_generic_contract_odt extends ModelePDFContract * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index 8865fed7d77..dadde0fd814 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -121,6 +121,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition return $numFinal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -128,9 +129,9 @@ class mod_expedition_ribera extends ModelNumRefExpedition * @param Object $objforref Shipment object * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function expedition_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php index c74d621f01d..2a20c22a88d 100644 --- a/htdocs/core/modules/expedition/mod_expedition_safor.php +++ b/htdocs/core/modules/expedition/mod_expedition_safor.php @@ -133,6 +133,7 @@ class mod_expedition_safor extends ModelNumRefExpedition return $this->prefix.$yymm."-".$num; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -140,9 +141,9 @@ class mod_expedition_safor extends ModelNumRefExpedition * @param Object $objforref Shipment object * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function expedition_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 36a5d3d70ba..2b8d2825f75 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -109,18 +109,20 @@ class ImportCsv extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output header of an example file for this format * * @param Translate $outputlangs Output language * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_header_example($outputlangs) { + // phpcs:enable return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output title line of an example file for this format * @@ -128,13 +130,14 @@ class ImportCsv extends ModeleImports * @param array $headerlinefields Array of fields name * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_title_example($outputlangs,$headerlinefields) { + // phpcs:enable $s=join($this->separator,array_map('cleansep',$headerlinefields)); return $s."\n"; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output record of an example file for this format * @@ -142,36 +145,38 @@ class ImportCsv extends ModeleImports * @param array $contentlinevalues Array of lines * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_record_example($outputlangs,$contentlinevalues) { + // phpcs:enable $s=join($this->separator,array_map('cleansep',$contentlinevalues)); return $s."\n"; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output footer of an example file for this format * * @param Translate $outputlangs Output language * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_footer_example($outputlangs) { + // phpcs:enable return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Open input file * * @param string $file Path of filename * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_open_file($file) { + // phpcs:enable global $langs; $ret=1; @@ -195,39 +200,42 @@ class ImportCsv extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of records. File must be closed. * * @param string $file Path of filename * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_get_nb_of_lines($file) { - return dol_count_nb_of_line($file); + // phpcs:enable + return dol_count_nb_of_line($file); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Input header line from file * * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_read_header() { + // phpcs:enable return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return array of next record in input file. * * @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_read_record() { + // phpcs:enable global $conf; $arrayres=fgetcsv($this->handle,100000,$this->separator,$this->enclosure,$this->escape); @@ -276,19 +284,21 @@ class ImportCsv extends ModeleImports return $newarrayres; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close file handle * * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_close_file() { + // phpcs:enable fclose($this->handle); return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Insert a record into database * @@ -300,9 +310,9 @@ class ImportCsv extends ModeleImports * @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor. * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid,$updatekeys) { + // phpcs:enable global $langs,$conf,$user; global $thirdparty_static; // Specific to thirdparty import global $tablewithentity_cache; // Cache to avoid to call desc at each rows on tables @@ -577,9 +587,13 @@ class ImportCsv extends ModeleImports $listfields[] = $fieldname; // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert - if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues[] = ($newval=='0'?$newval:"null"); - elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues[] = "''"; - else $listvalues[] = "'".$this->db->escape($newval)."'"; + if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) { + $listvalues[] = ($newval=='0'?$newval:"null"); + } elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) { + $listvalues[] = "''"; + } else { + $listvalues[] = "'".$this->db->escape($newval)."'"; + } } $i++; } diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 9d1a0458e88..e0316a75390 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -35,12 +35,12 @@ class MailingTargets // This can't be abstract as it is used for some method * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - + var $tooltip=''; @@ -117,15 +117,16 @@ class MailingTargets // This can't be abstract as it is used for some method return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Met a jour nombre de destinataires * * @param int $mailing_id Id of emailing * @return int < 0 si erreur, nb destinataires si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_nb($mailing_id) { + // phpcs:enable // Mise a jour nombre de destinataire dans table des mailings $sql = "SELECT COUNT(*) nb FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql .= " WHERE fk_mailing = ".$mailing_id; @@ -150,6 +151,7 @@ class MailingTargets // This can't be abstract as it is used for some method return $nb; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Ajoute destinataires dans table des cibles * @@ -157,9 +159,9 @@ class MailingTargets // This can't be abstract as it is used for some method * @param array $cibles Array with targets * @return int < 0 si erreur, nb ajout si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id, $cibles) { + // phpcs:enable global $conf; $this->db->begin(); @@ -234,15 +236,16 @@ class MailingTargets // This can't be abstract as it is used for some method return $j; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Supprime tous les destinataires de la table des cibles * - * @param int $mailing_id Id of emailing + * @param int $mailing_id Id of emailing * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function clear_target($mailing_id) { + // phpcs:enable $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql .= " WHERE fk_mailing = ".$mailing_id; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 1531248d746..524d1446427 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -47,6 +47,7 @@ class pdf_standard extends CommonStickerGenerator // use this method in future refactoring } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) * - __LOGO__ is replace with company logo @@ -62,9 +63,9 @@ class pdf_standard extends CommonStickerGenerator * @param string $photo Photo (full path to image file used as replacement for key __PHOTOS__ into left, right, header or footer text) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Add_PDF_card(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$idmember=0,$photo='') { + // phpcs:enable global $db,$mysoc,$conf,$langs; global $forceimgscalewidth,$forceimgscaleheight; @@ -236,6 +237,7 @@ class pdf_standard extends CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build PDF on disk, then output on HTTP stream. * @@ -246,9 +248,9 @@ class pdf_standard extends CommonStickerGenerator * @param int $nooutput 1=Generate only file on disk and do not return it on response * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object, $outputlangs, $srctemplatepath, $mode='member', $nooutput=0) { + // phpcs:enable global $user,$conf,$langs,$mysoc,$_Avery_Labels; $this->code=$srctemplatepath; diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 1ca929c08cf..0047dda7669 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2015 Francis Appels +/* Copyright (C) 2003 Steve Dillon + * Copyright (C) 2003 Laurent Passebecq + * Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2015 Francis Appels * * 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 @@ -21,15 +21,15 @@ */ /** - * \file htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php - * \ingroup core - * \brief Fichier de la classe permettant d'editer au format PDF des etiquettes au format Avery ou personnalise + * \file htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php + * \ingroup core + * \brief Fichier de la classe permettant d'editer au format PDF des etiquettes au format Avery ou personnalise */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonstickergenerator.class.php'; /** - * Class to generate stick sheet with format Avery or other personalised + * Class to generate stick sheet with format Avery or other personalised */ class pdf_standardlabel extends CommonStickerGenerator { @@ -46,6 +46,7 @@ class pdf_standardlabel extends CommonStickerGenerator // use this method in future refactoring } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) * - %LOGO% is replace with company logo @@ -60,9 +61,9 @@ class pdf_standardlabel extends CommonStickerGenerator * @param string $photo Photo (full path to image file used as replacement for key %PHOTOS% into left, right, header or footer text) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Add_PDF_label(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$photo='') { + // phpcs:enable global $mysoc, $conf, $langs; global $forceimgscalewidth, $forceimgscaleheight; @@ -226,6 +227,7 @@ class pdf_standardlabel extends CommonStickerGenerator + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build PDF on disk, then output on HTTP strem. * @@ -236,9 +238,9 @@ class pdf_standardlabel extends CommonStickerGenerator * @param string $filename Short file name of PDF output file * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir='',$filename='tmp_address_sheet.pdf') { + // phpcs:enable global $user,$conf,$langs,$mysoc,$_Avery_Labels; $this->code=$srctemplatepath; diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index c93e4b50fe3..b92c05e6f48 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -191,6 +191,7 @@ class doc_generic_product_odt extends ModelePDFProduct return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -202,9 +203,9 @@ class doc_generic_product_odt extends ModelePDFProduct * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $product,$langs,$conf,$mysoc,$hookmanager,$user; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index b8d3ad53092..5aba06db359 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -216,14 +216,15 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Check if mask/numbering use prefix * * @return int 0 or 1 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_prefixIsUsed() { + // phpcs:enable global $conf; $mask = $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER; @@ -292,6 +293,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi si un code est pris ou non (par autre tiers) * @@ -301,9 +303,9 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if available, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_dispo($db, $code, $soc, $type=0) { + // phpcs:enable $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; if ($type == 1) $sql.= " WHERE code_fournisseur = '".$code."'"; else $sql.= " WHERE code_client = '".$code."'"; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index a95ad54ba02..da3eb6ef734 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -207,6 +207,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -218,9 +219,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 2ba83623020..5318220beb8 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -190,6 +190,7 @@ class doc_generic_user_odt extends ModelePDFUser return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -201,9 +202,9 @@ class doc_generic_user_odt extends ModelePDFUser * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) @@ -423,6 +424,7 @@ class doc_generic_user_odt extends ModelePDFUser return -1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * get substitution array for object * @@ -431,9 +433,9 @@ class doc_generic_user_odt extends ModelePDFUser * @param string $array_key key for array * @return array array of substitutions */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_object($object,$outputlangs,$array_key='object') { + // phpcs:enable $array_other = array(); foreach($object as $key => $value) { if (!is_array($value) && !is_object($value)) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index a908f3315fd..aec0f40443e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1719,6 +1719,7 @@ class Task extends CommonObject return $this->LibStatut($this->fk_statut, $mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return status label for an object * @@ -1726,9 +1727,9 @@ class Task extends CommonObject * @param integer $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut, $mode=0) { + // phpcs:enable // list of Statut of the task $this->statuts[0]='Draft'; $this->statuts[1]='ToDo'; @@ -1747,59 +1748,59 @@ class Task extends CommonObject { return $langs->trans($this->statuts[$statut]); } - if ($mode == 1) + elseif ($mode == 1) { return $langs->trans($this->statuts_short[$statut]); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); - if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); - if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); + elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); + elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); - if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); - if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); - if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); - if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]); } - if ($mode == 5) + elseif ($mode == 5) { /*if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); - if ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); - if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + elseif ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); + elseif ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); + elseif ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); */ - //return $this->progress.' %'; + //else return $this->progress.' %'; return ' '; } - if ($mode == 6) + elseif ($mode == 6) { /*if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); - if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); - if ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + elseif ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); + elseif ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); + elseif ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); */ - //return $this->progress.' %'; + //else return $this->progress.' %'; return ' '; } } @@ -1837,15 +1838,16 @@ class Task extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Objet user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user) { + // phpcs:enable global $conf, $langs; // For external user, no check is done on company because readability is managed by public status of project and assignement. @@ -1911,14 +1913,15 @@ class Task extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $user; $mine=0; $socid=$user->societe_id; From e3339f5f956d031f3415cfdb779e6f8877107ca1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 19:00:26 +0200 Subject: [PATCH 118/255] Fix trad --- htdocs/langs/en_US/cron.lang | 2 +- htdocs/langs/fr_FR/cron.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang index a476a09d677..704b852e138 100644 --- a/htdocs/langs/en_US/cron.lang +++ b/htdocs/langs/en_US/cron.lang @@ -79,5 +79,5 @@ CronCannotLoadObject=Class file %s was loaded, but object %s was not found into UseMenuModuleToolsToAddCronJobs=Go into menu "Home - Admin tools - Scheduled jobs" to see and edit scheduled jobs. JobDisabled=Job disabled MakeLocalDatabaseDumpShort=Local database backup -MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql' or 'pgsql'), 1, 'auto' or filename to build, number of backup files to keep +MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run. diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index d707a0cc313..5e50c173fe7 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -79,5 +79,5 @@ CronCannotLoadObject=Le fichier de classe %s a été chargé, mais l'objet %s n' UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmées et les modifier. JobDisabled=Travail désactivé MakeLocalDatabaseDumpShort=Sauvegarde locale de base -MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql' ou 'pgsql'), 1, 'auto' ou nom du fichier à générer, nb de fichiers de sauvegarde à garder +MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql', 'pgsql', 'auto'), 1, 'auto' ou nom du fichier à générer, nb de fichiers de sauvegarde à garder WarningCronDelayed=Attention, à des fins de performance, quelle que soit la prochaine date d'exécution des travaux activés, vos travaux peuvent être retardés jusqu'à %s heures avant d'être exécutés. From 85df267a5b05affa52569987e0b32b7d71642533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Sep 2018 20:36:44 +0200 Subject: [PATCH 119/255] move phpcs:ignore --- .../class/html.formintervention.class.php | 5 +- htdocs/core/db/Database.interface.php | 90 +++++++++++-------- .../modules/cheque/doc/pdf_blochet.class.php | 9 +- .../doc/doc_generic_shipment_odt.modules.php | 3 +- .../modules/export/export_excel.modules.php | 35 +++++--- .../doc/doc_generic_invoice_odt.modules.php | 3 +- .../modules/import/import_xlsx.modules.php | 70 ++++++++------- .../livraison/mod_livraison_saphir.php | 9 +- .../mailings/advthirdparties.modules.php | 5 +- .../modules/product/modules_product.class.php | 21 +++-- .../doc/doc_generic_proposal_odt.modules.php | 3 +- .../core/modules/propale/modules_propale.php | 3 +- .../modules/rapport/pdf_paiement.class.php | 6 +- 13 files changed, 156 insertions(+), 106 deletions(-) diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index 3d5f2c9b640..ae35b74fad9 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -31,7 +31,7 @@ class FormIntervention * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -49,6 +49,7 @@ class FormIntervention } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show a combo list with contracts qualified for a third party * @@ -59,9 +60,9 @@ class FormIntervention * @param int $showempty Show empty line * @return int Nbre of project if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_interventions($socid=-1, $selected='', $htmlname='interventionid', $maxlength=16, $showempty=1) { + // phpcs:enable global $db,$user,$conf,$langs; $out=''; diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index b4c5d770253..db233dda1b4 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -35,14 +35,15 @@ interface Database */ function ifsql($test, $resok, $resko); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return array Array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function fetch_row($resultset); + function fetch_row($resultset); + // phpcs:enable /** * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field. @@ -67,6 +68,7 @@ interface Database */ function begin(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new database * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated @@ -78,8 +80,8 @@ interface Database * @param string $owner Username of database owner * @return resource resource defined if OK, null if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLCreateDb($database, $charset = '', $collation = '', $owner = ''); + function DDLCreateDb($database, $charset = '', $collation = '', $owner = ''); + // phpcs:enable /** * Return version of database server into an array @@ -97,6 +99,7 @@ interface Database */ static function convertSQLFromMysql($line, $type = 'ddl'); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * @@ -104,8 +107,8 @@ interface Database * @return int Nombre de lignes * @see num_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function affected_rows($resultset); + function affected_rows($resultset); + // phpcs:enable /** * Return description of last error @@ -114,6 +117,7 @@ interface Database */ function error(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List tables into a database * @@ -121,8 +125,8 @@ interface Database * @param string $table Nmae of table filter ('xxx%') * @return array List of tables in an array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLListTables($database, $table = ''); + function DDLListTables($database, $table = ''); + // phpcs:enable /** * Return last request executed with query() @@ -148,14 +152,15 @@ interface Database */ function decrypt($value); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return array Array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function fetch_array($resultset); + function fetch_array($resultset); + // phpcs:enable /** * Return last error label @@ -172,6 +177,7 @@ interface Database */ function escape($stringtoencode); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get last ID after an insert INSERT * @@ -179,8 +185,8 @@ interface Database * @param string $fieldid Field name * @return int Id of row */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function last_insert_id($tab, $fieldid = 'rowid'); + function last_insert_id($tab, $fieldid = 'rowid'); + // phpcs:enable /** * Return full path of restore program @@ -253,6 +259,7 @@ interface Database */ function getDefaultCollationDatabase(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return number of lines for result of a SELECT * @@ -260,8 +267,8 @@ interface Database * @return int Nb of lines * @see affected_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function num_rows($resultset); + function num_rows($resultset); + // phpcs:enable /** * Return full path of dump program @@ -284,6 +291,7 @@ interface Database */ function errno(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a table into database * @@ -296,17 +304,18 @@ interface Database * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null); + function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a table into database * * @param string $table Name of table * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLDropTable($table); + function DDLDropTable($table); + // phpcs:enable /** * Return list of available charset that can be used to store data in database @@ -315,6 +324,7 @@ interface Database */ function getListOfCharacterSet(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new field into table * @@ -324,9 +334,10 @@ interface Database * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLAddField($table, $field_name, $field_desc, $field_position = ""); + function DDLAddField($table, $field_name, $field_desc, $field_position = ""); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a field from table * @@ -334,9 +345,10 @@ interface Database * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLDropField($table, $field_name); + function DDLDropField($table, $field_name); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update format of a field into a table * @@ -345,8 +357,8 @@ interface Database * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLUpdateField($table, $field_name, $field_desc); + function DDLUpdateField($table, $field_name, $field_desc); + // phpcs:enable /** * Return list of available collation that can be used for database @@ -355,6 +367,7 @@ interface Database */ function getListOfCollation(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a pointer of line with description of a table or field * @@ -362,8 +375,8 @@ interface Database * @param string $field Optionnel : Name of field if we want description of field * @return resource Resource */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLDescTable($table, $field = ""); + function DDLDescTable($table, $field = ""); + // phpcs:enable /** * Return version of database server @@ -379,6 +392,7 @@ interface Database */ function getDefaultCharacterSetDatabase(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a user and privileges to connect to database (even if database does not exists yet) * @@ -388,13 +402,13 @@ interface Database * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateUser( $dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name - ); + ); + // phpcs:enable /** * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true) @@ -425,14 +439,15 @@ interface Database */ function commit($log = ''); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List information of columns into a table. * * @param string $table Name of table * @return array Array with inforation on table */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLInfoTable($table); + function DDLInfoTable($table); + // phpcs:enable /** * Free last resultset used. @@ -457,29 +472,32 @@ interface Database */ function lastqueryerror(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return connexion ID * * @return string Id connexion */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function DDLGetConnectId(); + function DDLGetConnectId(); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la ligne courante (comme un objet) pour le curseur resultset * * @param resource $resultset Curseur de la requete voulue * @return Object Object result line or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function fetch_object($resultset); + function fetch_object($resultset); + // phpcs:enable + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Select a database * * @param string $database Name of database * @return boolean true if OK, false if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function select_db($database); + function select_db($database); + // phpcs:enable } diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index 464bd7eed05..159f8664390 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -74,6 +74,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $this->tab_height = 200; //$this->line_height * $this->line_per_page; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction to generate document on disk * @@ -83,9 +84,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts * @param Translate $outputlangs Lang output object * @return int 1=ok, 0=ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object, $_dir, $number, $outputlangs) { + // phpcs:enable global $user,$conf,$langs,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -198,6 +199,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Generate Header * @@ -207,9 +209,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts * @param Translate $outputlangs Object language for output * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Header(&$pdf, $page, $pages, $outputlangs) { + // phpcs:enable global $langs; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -305,6 +307,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output array * @@ -314,9 +317,9 @@ class BordereauChequeBlochet extends ModeleChequeReceipts * @param Translate $outputlangs Object lang * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Body(&$pdf, $pagenb, $pages, $outputlangs) { + // phpcs:enable // x=10 - Num // x=30 - Banque // x=100 - Emetteur diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 9971c3acd81..2ca4300bb26 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -177,6 +177,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -188,9 +189,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/export/export_excel.modules.php b/htdocs/core/modules/export/export_excel.modules.php index 6c50b3c46de..665a6925c6b 100644 --- a/htdocs/core/modules/export/export_excel.modules.php +++ b/htdocs/core/modules/export/export_excel.modules.php @@ -37,7 +37,7 @@ class ExportExcel extends ModeleExports */ public $id; - /** + /** * @var string Export Excel label */ public $label; @@ -48,8 +48,8 @@ class ExportExcel extends ModeleExports public $label_lib; public $version_lib; - public $workbook; // Handle fichier - public $worksheet; // Handle onglet + public $workbook; // Handle file + public $worksheet; // Handle sheet public $row; public $col; public $file; // To save filename @@ -168,6 +168,7 @@ class ExportExcel extends ModeleExports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Open output file * @@ -175,9 +176,9 @@ class ExportExcel extends ModeleExports * @param Translate $outputlangs Output language object * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function open_file($file,$outputlangs) { + // phpcs:enable global $user,$conf,$langs; if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) @@ -238,21 +239,23 @@ class ExportExcel extends ModeleExports return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Write header + * Write header * - * @param Translate $outputlangs Object lang to translate values + * @param Translate $outputlangs Object lang to translate values * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_header($outputlangs) { + // phpcs:enable //$outputlangs->charset_output='ISO-8859-1'; // Because Excel 5 format is ISO return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output title line into file * @@ -262,9 +265,9 @@ class ExportExcel extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs,$array_types) { + // phpcs:enable global $conf; // Create a format for the column headings @@ -309,6 +312,7 @@ class ExportExcel extends ModeleExports return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output record line into file * @@ -318,9 +322,9 @@ class ExportExcel extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_record($array_selected_sorted,$objp,$outputlangs,$array_types) { + // phpcs:enable global $conf; // Create a format for the column headings @@ -428,27 +432,29 @@ class ExportExcel extends ModeleExports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write footer * * @param Translate $outputlangs Output language object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_footer($outputlangs) { + // phpcs:enable return 0; } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Close Excel file * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function close_file() { + // phpcs:enable global $conf; if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) @@ -467,15 +473,16 @@ class ExportExcel extends ModeleExports } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Clean a cell to respect rules of Excel file cells * * @param string $newvalue String to clean * @return string Value cleaned */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function excel_clean($newvalue) { + // phpcs:enable // Rule Dolibarr: No HTML $newvalue=dol_string_nohtmltag($newvalue); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 623473d5595..a73d6f13296 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -176,6 +176,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -187,9 +188,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 9ac1d8bc6a6..31f09a7893f 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -38,9 +38,9 @@ class ImportXlsx extends ModeleImports */ public $db; - var $datatoimport; + public $datatoimport; - /** + /** * @var string Error code (or message) */ public $error=''; @@ -115,38 +115,40 @@ class ImportXlsx extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output header of an example file for this format * * @param Translate $outputlangs Output language * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_header_example($outputlangs) { - global $user,$conf,$langs; - // create a temporary object, the final output will be generated in footer - if (!empty($conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR)) { + // phpcs:enable + global $user,$conf,$langs; + // create a temporary object, the final output will be generated in footer + if (!empty($conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR)) { $cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_discISAM; $cacheSettings = array ( - 'dir' => $conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR - ); - PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); + 'dir' => $conf->global->MAIN_USE_FILECACHE_EXPORT_EXCEL_DIR + ); + PHPExcel_Settings::setCacheStorageMethod($cacheMethod, $cacheSettings); } - $this->workbook = new PHPExcel(); - $this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION); - $this->workbook->getProperties()->setTitle($outputlangs->trans("Import").' - '.$file); - $this->workbook->getProperties()->setSubject($outputlangs->trans("Import").' - '.$file); - $this->workbook->getProperties()->setDescription($outputlangs->trans("Import").' - '.$file); + $this->workbook = new PHPExcel(); + $this->workbook->getProperties()->setCreator($user->getFullName($outputlangs).' - Dolibarr '.DOL_VERSION); + $this->workbook->getProperties()->setTitle($outputlangs->trans("Import").' - '.$file); + $this->workbook->getProperties()->setSubject($outputlangs->trans("Import").' - '.$file); + $this->workbook->getProperties()->setDescription($outputlangs->trans("Import").' - '.$file); - $this->workbook->setActiveSheetIndex(0); - $this->workbook->getActiveSheet()->setTitle($outputlangs->trans("Sheet")); - $this->workbook->getActiveSheet()->getDefaultRowDimension()->setRowHeight(16); + $this->workbook->setActiveSheetIndex(0); + $this->workbook->getActiveSheet()->setTitle($outputlangs->trans("Sheet")); + $this->workbook->getActiveSheet()->getDefaultRowDimension()->setRowHeight(16); - return ''; - } + return ''; + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output title line of an example file for this format * @@ -154,9 +156,9 @@ class ImportXlsx extends ModeleImports * @param array $headerlinefields Array of fields name * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_title_example($outputlangs,$headerlinefields) { + // phpcs:enable global $conf; $this->workbook->getActiveSheet()->getStyle('1')->getFont()->setBold(true); $this->workbook->getActiveSheet()->getStyle('1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT); @@ -172,6 +174,7 @@ class ImportXlsx extends ModeleImports return ''; // final output will be generated in footer } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output record of an example file for this format * @@ -179,9 +182,9 @@ class ImportXlsx extends ModeleImports * @param array $contentlinevalues Array of lines * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_record_example($outputlangs,$contentlinevalues) { + // phpcs:enable $col = 0; $row = 2; foreach($contentlinevalues as $cell) { @@ -192,16 +195,17 @@ class ImportXlsx extends ModeleImports return ''; // final output will be generated in footer } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output footer of an example file for this format * * @param Translate $outputlangs Output language * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_footer_example($outputlangs) { - // return te file content as a string + // phpcs:enable + // return the file content as a string $tempfile = tempnam(sys_get_temp_dir(), 'dol'); $objWriter = new PHPExcel_Writer_Excel2007($this->workbook); $objWriter->save($tempfile); @@ -215,15 +219,16 @@ class ImportXlsx extends ModeleImports + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Open input file * * @param string $file Path of filename * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_open_file($file) { + // phpcs:enable global $langs; $ret=1; @@ -238,15 +243,16 @@ class ImportXlsx extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of records. File must be closed. * * @param string $file Path of filename * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_get_nb_of_lines($file) { + // phpcs:enable $reader = new PHPExcel_Reader_Excel2007(); $this->workbook = $reader->load($file); @@ -259,14 +265,15 @@ class ImportXlsx extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Input header line from file * * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_read_header() { + // phpcs:enable // This is not called by the import code !!! $this->headers = array(); $colcount = PHPExcel_Cell::columnIndexFromString($this->workbook->getActiveSheet()->getHighestDataColumn()); @@ -277,14 +284,15 @@ class ImportXlsx extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return array of next record in input file. * * @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_read_record() { + // phpcs:enable global $conf; $rowcount = $this->workbook->getActiveSheet()->getHighestDataRow(); @@ -301,19 +309,22 @@ class ImportXlsx extends ModeleImports return $array; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close file handle * * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_close_file() { + // phpcs:enable $this->workbook->disconnectWorksheets(); unset($this->workbook); } + // What is this doing here ? it is common to all imports, is should be in the parent class + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Insert a record into database * @@ -325,10 +336,9 @@ class ImportXlsx extends ModeleImports * @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor. * @return int <0 if KO, >0 if OK */ - // What is this doing here ? it is common to all imports, is should be in the parent class - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid,$updatekeys) { + // phpcs:enable global $langs,$conf,$user; global $thirdparty_static; // Specific to thirdparty import global $tablewithentity_cache; // Cache to avoid to call desc at each rows on tables diff --git a/htdocs/core/modules/livraison/mod_livraison_saphir.php b/htdocs/core/modules/livraison/mod_livraison_saphir.php index 4fed4689738..bad82554ff3 100644 --- a/htdocs/core/modules/livraison/mod_livraison_saphir.php +++ b/htdocs/core/modules/livraison/mod_livraison_saphir.php @@ -139,16 +139,17 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder } - /** - * Return next free ref - * + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Return next free ref + * * @param Societe $objsoc Object thirdparty * @param Object $object Objet livraison * @return string Texte descripif */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function livraison_get_num($objsoc=0,$object='') { + // phpcs:enable return $this->getNextValue($objsoc,$object); } } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 59fc4f14039..f41992bee14 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -32,7 +32,7 @@ class mailing_advthirdparties extends MailingTargets var $require_module=array("none"); // This module should not be displayed as Selector in mailling var $picto='company'; - + /** * @var DoliDB Database handler. */ @@ -52,6 +52,7 @@ class mailing_advthirdparties extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This is the main function that returns the array of emails * @@ -61,9 +62,9 @@ class mailing_advthirdparties extends MailingTargets * @param array $contactid Array of contact id to add * @return int <0 if error, number of emails added if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target_spec($mailing_id,$socid,$type_of_target, $contactid) { + // phpcs:enable global $conf, $langs; dol_syslog(get_class($this)."::add_to_target socid=".var_export($socid,true).' contactid='.var_export($contactid,true)); diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php index 3202bf9ca1d..b632f387d05 100644 --- a/htdocs/core/modules/product/modules_product.class.php +++ b/htdocs/core/modules/product/modules_product.class.php @@ -39,16 +39,17 @@ abstract class ModelePDFProduct extends CommonDocGenerator public $error=''; - /** - * Return list of active generation modules - * + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Return list of active generation modules + * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='product'; @@ -140,6 +141,7 @@ abstract class ModeleProductCode return $langs->trans("NotAvailable"); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi la liste des modeles de numérotation * @@ -147,9 +149,9 @@ abstract class ModeleProductCode * @param integer $maxfilenamelength Max length of value to show * @return array List of numbers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable $liste=array(); $sql =""; @@ -202,7 +204,7 @@ abstract class ModeleProductCode if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && ! empty($this->code_null)) $s.=' '.yn(1,1,2).' ('.$langs->trans("ForcedToByAModule",$langs->transnoentities("yes")).')'; $s.='
    '; } - if ($type == 1) + elseif ($type == 1) { $s.=$langs->trans("RequiredIfService").': '; if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && ! empty($this->code_null)) $s.=''; @@ -210,7 +212,7 @@ abstract class ModeleProductCode if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && ! empty($this->code_null)) $s.=' '.yn(1,1,2).' ('.$langs->trans("ForcedToByAModule",$langs->transnoentities("yes")).')'; $s.='
    '; } - if ($type == -1) + elseif ($type == -1) { $s.=$langs->trans("Required").': '; if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && ! empty($this->code_null)) $s.=''; @@ -239,14 +241,15 @@ abstract class ModeleProductCode return $s; } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Check if mask/numbering use prefix * * @return int 0=no, 1=yes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_prefixIsUsed() { + // phpcs:enable return 0; } } diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 1e0d084fbba..96bd6bfbfda 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -207,6 +207,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -218,9 +219,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php index 0c046746486..c7514ab973c 100644 --- a/htdocs/core/modules/propale/modules_propale.php +++ b/htdocs/core/modules/propale/modules_propale.php @@ -42,6 +42,7 @@ abstract class ModelePDFPropales extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -49,9 +50,9 @@ abstract class ModelePDFPropales extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='propal'; diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 801b3820bc5..154d37115dd 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -83,6 +83,7 @@ class pdf_paiement } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction generant la rapport sur le disque * @@ -92,9 +93,9 @@ class pdf_paiement * @param string $outputlangs Lang output object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($_dir, $month, $year, $outputlangs) { + // phpcs:enable include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; global $conf, $hookmanager, $langs, $user; @@ -406,6 +407,7 @@ class pdf_paiement } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output body * @@ -415,9 +417,9 @@ class pdf_paiement * @param Translate $outputlangs Object langs * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Body(&$pdf, $page, $lines, $outputlangs) { + // phpcs:enable global $langs; $default_font_size = pdf_getPDFFontSize($outputlangs); From 5a618c68084651848dac7a016b794075a87d45c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Sep 2018 21:14:15 +0200 Subject: [PATCH 120/255] Update holiday.class.php --- htdocs/holiday/class/holiday.class.php | 50 +++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index c8f73111021..c18c0d0731a 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -906,53 +906,53 @@ class Holiday extends CommonObject if ($mode == 0) { if ($statut == 1) return $langs->trans('DraftCP'); - if ($statut == 2) return $langs->trans('ToReviewCP'); - if ($statut == 3) return $langs->trans('ApprovedCP'); - if ($statut == 4) return $langs->trans('CancelCP'); - if ($statut == 5) return $langs->trans('RefuseCP'); + elseif ($statut == 2) return $langs->trans('ToReviewCP'); + elseif ($statut == 3) return $langs->trans('ApprovedCP'); + elseif ($statut == 4) return $langs->trans('CancelCP'); + elseif ($statut == 5) return $langs->trans('RefuseCP'); } - if ($mode == 2) + elseif ($mode == 2) { $pictoapproved='statut6'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; if ($statut == 1) return img_picto($langs->trans('DraftCP'),'statut0').' '.$langs->trans('DraftCP'); // Draft - if ($statut == 2) return img_picto($langs->trans('ToReviewCP'),'statut1').' '.$langs->trans('ToReviewCP'); // Waiting approval - if ($statut == 3) return img_picto($langs->trans('ApprovedCP'),$pictoapproved).' '.$langs->trans('ApprovedCP'); - if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5').' '.$langs->trans('CancelCP'); - if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5').' '.$langs->trans('RefuseCP'); + elseif ($statut == 2) return img_picto($langs->trans('ToReviewCP'),'statut1').' '.$langs->trans('ToReviewCP'); // Waiting approval + elseif ($statut == 3) return img_picto($langs->trans('ApprovedCP'),$pictoapproved).' '.$langs->trans('ApprovedCP'); + elseif ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5').' '.$langs->trans('CancelCP'); + elseif ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5').' '.$langs->trans('RefuseCP'); } - if ($mode == 3) + elseif ($mode == 3) { $pictoapproved='statut6'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; if ($statut == 1) return img_picto($langs->trans('DraftCP'),'statut0'); - if ($statut == 2) return img_picto($langs->trans('ToReviewCP'),'statut1'); - if ($statut == 3) return img_picto($langs->trans('ApprovedCP'),$pictoapproved); - if ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5'); - if ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5'); + elseif ($statut == 2) return img_picto($langs->trans('ToReviewCP'),'statut1'); + elseif ($statut == 3) return img_picto($langs->trans('ApprovedCP'),$pictoapproved); + elseif ($statut == 4) return img_picto($langs->trans('CancelCP'),'statut5'); + elseif ($statut == 5) return img_picto($langs->trans('RefuseCP'),'statut5'); } - if ($mode == 5) + elseif ($mode == 5) { $pictoapproved='statut6'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; if ($statut == 1) return $langs->trans('DraftCP').' '.img_picto($langs->trans('DraftCP'),'statut0'); // Draft - if ($statut == 2) return $langs->trans('ToReviewCP').' '.img_picto($langs->trans('ToReviewCP'),'statut1'); // Waiting approval - if ($statut == 3) return $langs->trans('ApprovedCP').' '.img_picto($langs->trans('ApprovedCP'),$pictoapproved); - if ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'),'statut5'); - if ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'),'statut5'); + elseif ($statut == 2) return $langs->trans('ToReviewCP').' '.img_picto($langs->trans('ToReviewCP'),'statut1'); // Waiting approval + elseif ($statut == 3) return $langs->trans('ApprovedCP').' '.img_picto($langs->trans('ApprovedCP'),$pictoapproved); + elseif ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'),'statut5'); + elseif ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'),'statut5'); } - if ($mode == 6) + elseif ($mode == 6) { $pictoapproved='statut6'; if (! empty($startdate) && $startdate > dol_now()) $pictoapproved='statut4'; if ($statut == 1) return $langs->trans('DraftCP').' '.img_picto($langs->trans('DraftCP'),'statut0'); // Draft - if ($statut == 2) return $langs->trans('ToReviewCP').' '.img_picto($langs->trans('ToReviewCP'),'statut1'); // Waiting approval - if ($statut == 3) return $langs->trans('ApprovedCP').' '.img_picto($langs->trans('ApprovedCP'),$pictoapproved); - if ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'),'statut5'); - if ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'),'statut5'); + elseif ($statut == 2) return $langs->trans('ToReviewCP').' '.img_picto($langs->trans('ToReviewCP'),'statut1'); // Waiting approval + elseif ($statut == 3) return $langs->trans('ApprovedCP').' '.img_picto($langs->trans('ApprovedCP'),$pictoapproved); + elseif ($statut == 4) return $langs->trans('CancelCP').' '.img_picto($langs->trans('CancelCP'),'statut5'); + elseif ($statut == 5) return $langs->trans('RefuseCP').' '.img_picto($langs->trans('RefuseCP'),'statut5'); } - return $statut; + else return $statut; } From f7c87a9ad3e02611141dfedf9baaa1e158184dc6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 22:46:08 +0200 Subject: [PATCH 121/255] Clean cron init --- htdocs/core/modules/modAdherent.class.php | 3 +++ htdocs/core/modules/modAgenda.class.php | 4 ++-- htdocs/core/modules/modAsset.class.php | 6 +++--- htdocs/core/modules/modDav.class.php | 4 ++-- htdocs/core/modules/modFacture.class.php | 13 +++++++------ 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 4c22f4b31b4..4339e2cac8d 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -347,6 +347,8 @@ class modAdherent extends DolibarrModules ); // Cronjobs + $arraydate=dol_getdate(dol_now()); + $datestart=dol_mktime(22, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']); $this->cronjobs = array( 0=>array( 'label'=>'SendReminderForExpiredSubscriptionTitle', @@ -360,6 +362,7 @@ class modAdherent extends DolibarrModules 'priority'=>50, 'status'=>0, 'test'=>true, + 'datestart'=>$datestart ), ); } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 525c27488a7..15a6b361079 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -113,9 +113,9 @@ class modAgenda extends DolibarrModules // Cronjobs //------------ + $datestart=dol_now(); $this->cronjobs = array( - 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1'), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24) + 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>10, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'1', 'datestart'=>$datestart), ); // Permissions diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index e0ad2db49b7..840db44daab 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -174,9 +174,9 @@ class modAsset extends DolibarrModules // Cronjobs (List of cron jobs entries to add when module is enabled) // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week - $this->cronjobs = array( - 0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/asset/class/asset.class.php', 'objectname'=>'Asset', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true) - ); + //$this->cronjobs = array( + // 0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/asset/class/asset.class.php', 'objectname'=>'Asset', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true) + //); // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true) // ); diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index 5ef202cda86..88a81ab51f5 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -173,9 +173,9 @@ class modDav extends DolibarrModules // Cronjobs (List of cron jobs entries to add when module is enabled) // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week - $this->cronjobs = array( + //$this->cronjobs = array( //0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/dav/class/myobject.class.php', 'objectname'=>'MyObject', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true) - ); + //); // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true) // ); diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index 41ef5e26051..5d8efb7d70b 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -114,13 +114,14 @@ class modFacture extends DolibarrModules 2=>array('file'=>'box_graph_invoices_permonth.php', 'enabledbydefaulton'=>'Home') ); - // Cronjobs - $this->cronjobs = array( - 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true), - // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>3600, 'unitfrequency'=>3600) - ); + // Cronjobs + $arraydate=dol_getdate(dol_now()); + $datestart=dol_mktime(23, 0, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']); + $this->cronjobs = array( + 0=>array('label'=>'RecurringInvoices', 'jobtype'=>'method', 'class'=>'compta/facture/class/facture-rec.class.php', 'objectname'=>'FactureRec', 'method'=>'createRecurringInvoices', 'parameters'=>'', 'comment'=>'Generate recurring invoices', 'frequency'=>1, 'unitfrequency'=>3600 * 24, 'priority'=>50, 'status'=>1, 'test'=>true, 'datestart'=>$datestart), + ); - // Permissions + // Permissions $this->rights = array(); $this->rights_class = 'facture'; $r = 0; From b25a0ca672ad05ce4cef1f66b7f1f4545a652130 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 23:25:17 +0200 Subject: [PATCH 122/255] Fix no need of thumb when upload image for email --- htdocs/core/actions_sendmails.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 8c81c0efc6a..6afd6b1e354 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -42,7 +42,7 @@ if (GETPOST('addfile','alpha')) $vardir=$conf->user->dir_output."/".$user->id; $upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path - dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid); + dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid, 0); $action='presend'; } From c5695db3e42c3e3769446e15c691b0107037f79e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Sep 2018 11:09:51 +0200 Subject: [PATCH 123/255] NEW Can disable meteo on smartphone only --- htdocs/admin/delais.php | 16 +++++++++++++--- htdocs/index.php | 4 ++-- htdocs/langs/en_US/admin.lang | 1 + 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 14dfb9922f6..19fa67abcff 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -122,6 +122,13 @@ $modules=array( ), ); +$labelmeteo = array(0=>$langs->trans("No"), 1=>$langs->trans("Yes"), 2=>$langs->trans("OnMobileOnly")); + + +/* + * Actions + */ + if ($action == 'update') { foreach($modules as $module => $delays) @@ -201,9 +208,10 @@ if ($action == 'edit') print '
    '; print $langs->trans("SelectImportFields",img_picto('','grip_title','')).' '; $htmlother->select_import_model($importmodelid,'importmodelid',$datatoimport,1); @@ -1117,8 +1118,8 @@ if ($step == 4 && $datatoimport) print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; @@ -1263,10 +1264,8 @@ if ($step == 5 && $datatoimport) if ($model == 'csv') { print ''; print ''; } From f2ec94e9fdc87d8e069921e90507dcf4281ed720 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:13:54 +0200 Subject: [PATCH 079/255] FIX #9353 Bug: html error - div inside span on graphs --- htdocs/core/class/dolgraph.class.php | 4 ++-- htdocs/install/mysql/tables/llx_commande.key.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index f40d30f389e..b002c96f081 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -924,7 +924,7 @@ class DolGraph var percent=Math.round(series.percent); var number=series.data[0][1]; return \''; - $this->stringtoshow.='\'; + $this->stringtoshow.='\'; }, background: { opacity: 0.0, diff --git a/htdocs/install/mysql/tables/llx_commande.key.sql b/htdocs/install/mysql/tables/llx_commande.key.sql index 9652079846e..9134092195b 100644 --- a/htdocs/install/mysql/tables/llx_commande.key.sql +++ b/htdocs/install/mysql/tables/llx_commande.key.sql @@ -18,7 +18,7 @@ -- ============================================================================ --- Supprimme orphelins pour permettre montee de la cle +-- Delete orphans -- V4 DELETE llx_commande FROM llx_commande LEFT JOIN llx_societe ON llx_commande.fk_soc = llx_societe.rowid WHERE llx_societe.rowid IS NULL; ALTER TABLE llx_commande ADD UNIQUE INDEX uk_commande_ref (ref, entity); From e7d2bcc34c77dbfe5024aa672e067883a31bf6bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:17:08 +0200 Subject: [PATCH 080/255] FIX #9316 Error when listing invoices --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 6c39c0cd0a9..7f1d5baa924 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -509,7 +509,7 @@ if (! $sall) $sql.= ' typent.code,'; $sql.= ' state.code_departement, state.nom,'; $sql.= ' country.code,'; - $sql.= " p.rowid, p.ref"; + $sql.= " p.rowid, p.ref, p.title"; foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by { From 9042d341f0f07a6302c9d69441133c7a6b0cf968 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:19:31 +0200 Subject: [PATCH 081/255] FIX #9316 Error when listing invoices --- htdocs/compta/facture/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 7f1d5baa924..d45939bb29c 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -510,7 +510,8 @@ if (! $sall) $sql.= ' state.code_departement, state.nom,'; $sql.= ' country.code,'; $sql.= " p.rowid, p.ref, p.title"; - + if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc"; + // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by { $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); From 3ef808cb9bead0030abeb99b591ff824235bc0ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:23:28 +0200 Subject: [PATCH 082/255] Fix #9302 MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES broken --- htdocs/commande/class/commande.class.php | 96 +++++++++---------- htdocs/compta/facture/class/facture.class.php | 8 +- 2 files changed, 53 insertions(+), 51 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4c2cd368aac..f212c4efbdf 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3456,60 +3456,60 @@ class Commande extends CommonOrder if (!$user->rights->commande->lire) $option = 'nolink'; - if ($option !== 'nolink') + if ($option !== 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } + + if ($short) return $url; + + $label = ''; + + if ($user->rights->commande->lire) { + $label = ''.$langs->trans("ShowOrder").''; + $label .= '
    '.$langs->trans('Ref').': '.$this->ref; + $label .= '
    '.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client); + if (!empty($this->total_ht)) { + $label .= '
    '.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); + } + if (!empty($this->total_tva)) { + $label .= '
    '.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); + } + if (!empty($this->total_ttc)) { + $label .= '
    '.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); + } + } + + $linkclose=''; + if (empty($notooltip) && $user->rights->commande->lire) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - // Add param to save lastsearch_values or not - $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); - if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; - if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + $label=$langs->trans("ShowOrder"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; } + $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip"'; + } - if ($short) return $url; + $linkstart = ''; + $linkend=''; - $label = ''; + if ($option === 'nolink') { + $linkstart = ''; + $linkend = ''; + } - if ($user->rights->commande->lire) { - $label = ''.$langs->trans("ShowOrder").''; - $label .= '
    '.$langs->trans('Ref').': '.$this->ref; - $label .= '
    '.$langs->trans('RefCustomer').': '.($this->ref_customer ? $this->ref_customer : $this->ref_client); - if (!empty($this->total_ht)) { - $label .= '
    '.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); - } - if (!empty($this->total_tva)) { - $label .= '
    '.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); - } - if (!empty($this->total_ttc)) { - $label .= '
    '.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); - } - } + $result .= $linkstart; + if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); + if ($withpicto != 2) $result.= $this->ref; + $result .= $linkend; - $linkclose=''; - if (empty($notooltip) && $user->rights->commande->lire) - { - if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) - { - $label=$langs->trans("ShowOrder"); - $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; - } - $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose.=' class="classfortooltip"'; - } - - $linkstart = ''; - $linkend=''; - - if ($option === 'nolink') { - $linkstart = ''; - $linkend = ''; - } - - $result .= $linkstart; - if ($withpicto) $result.=img_object(($notooltip?'':$label), $this->picto, ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); - if ($withpicto != 2) $result.= $this->ref; - $result .= $linkend; - - return $result; + return $result; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index da0d66b2784..395d8b24c38 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -57,12 +57,12 @@ class Facture extends CommonInvoice * @var string ID to identify managed object */ public $element='facture'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='facture'; - + public $table_element_line = 'facturedet'; public $fk_element = 'fk_facture'; public $picto='bill'; @@ -1178,6 +1178,8 @@ class Facture extends CommonInvoice if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; } + if ($short) return $url; + $picto='bill'; if ($this->type == self::TYPE_REPLACEMENT) $picto.='r'; // Replacement invoice if ($this->type == self::TYPE_CREDIT_NOTE) $picto.='a'; // Credit note @@ -4262,7 +4264,7 @@ class FactureLigne extends CommonInvoiceLine * @var string ID to identify managed object */ public $element='facturedet'; - + /** * @var string Name of table without prefix where object is stored */ From 69cf7026eb7c6fff08fd9cb65bae4987507356d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:29:52 +0200 Subject: [PATCH 083/255] NEW Close #9296 Add field ref_ext into llx_categorie --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 3 +++ htdocs/install/mysql/tables/llx_categorie.sql | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index b5e80f43593..87053d8ccb7 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -67,3 +67,6 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',204); ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after amount; + +ALTER TABLE llx_categorie ADD COLUMN ref_ext varchar(255); + diff --git a/htdocs/install/mysql/tables/llx_categorie.sql b/htdocs/install/mysql/tables/llx_categorie.sql index fe2b03b2429..5493d2cfc8c 100644 --- a/htdocs/install/mysql/tables/llx_categorie.sql +++ b/htdocs/install/mysql/tables/llx_categorie.sql @@ -24,7 +24,8 @@ create table llx_categorie rowid integer AUTO_INCREMENT PRIMARY KEY, entity integer DEFAULT 1 NOT NULL, -- multi company id fk_parent integer DEFAULT 0 NOT NULL, - label varchar(180) NOT NULL, -- category name + label varchar(180) NOT NULL, -- category ref/name + ref_ext varchar(255), -- reference into an external system (not used by dolibarr) type tinyint DEFAULT 1 NOT NULL, -- category type (product, supplier, customer, member) description text, -- description of the category color varchar(8), -- color From 8c2eac4c937d1947c192a76de1972a45df0cd9ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:34:23 +0200 Subject: [PATCH 084/255] FIX #9317 --- htdocs/projet/element.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 98877689c4c..5afee3f7dc9 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -290,7 +290,7 @@ $listofreferent=array( 'class'=>'SupplierProposal', 'table'=>'supplier_proposal', 'datefieldname'=>'date', - 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&socid='.$socid, + 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object 'lang'=>'supplier_proposal', 'buttonnew'=>'AddSupplierProposal', 'testnew'=>$user->rights->supplier_proposal->creer, @@ -550,8 +550,6 @@ print '
    '; print ''; print ''; -$var = false; - foreach ($listofreferent as $key => $value) { $name=$langs->trans($value['name']); From c7fdd8686b85465724134023ff65318399254d5b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:41:28 +0200 Subject: [PATCH 085/255] NEW Add civility in list of members. Close #9251 --- htdocs/adherents/list.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index db017d71f61..a17d9a84b29 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -107,6 +107,7 @@ $arrayfields=array( 'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), 'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), + 'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0), 'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1), 'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), 'd.morphy'=>array('label'=>$langs->trans("MorPhy"), 'checked'=>1), @@ -202,7 +203,7 @@ $memberstatic=new Adherent($db); $now=dol_now(); -$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,"; +$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.civility, d.societe as company, d.fk_soc,"; $sql.= " d.datefin, d.address, d.zip, d.town, d.state_id, d.country,"; $sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,"; $sql.= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,"; @@ -427,37 +428,36 @@ if (! empty($arrayfields['d.ref']['checked'])) print ''; print ''; } - if (! empty($arrayfields['d.firstname']['checked'])) { print ''; } - if (! empty($arrayfields['d.lastname']['checked'])) { print ''; } - +if (! empty($arrayfields['d.civility']['checked'])) +{ + print ''; +} if (! empty($arrayfields['d.company']['checked'])) { print ''; } - if (! empty($arrayfields['d.login']['checked'])) { print ''; } - if (! empty($arrayfields['d.morphy']['checked'])) { print ''; } - if (! empty($arrayfields['t.libelle']['checked'])) { print '\n"; } + // Civility + if (! empty($arrayfields['d.civility']['checked'])) + { + print "\n"; + } // Company if (! empty($arrayfields['d.company']['checked'])) { From 23f4e7cc36609071b576558da476ffac0011f221 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 11:49:11 +0200 Subject: [PATCH 086/255] FIX #9251 --- htdocs/adherents/list.php | 44 +++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index a17d9a84b29..7b90878dff7 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -48,6 +48,7 @@ $search=GETPOST("search",'alpha'); $search_ref=GETPOST("search_ref",'alpha'); $search_lastname=GETPOST("search_lastname",'alpha'); $search_firstname=GETPOST("search_firstname",'alpha'); +$search_civility=GETPOST("search_civility",'alpha'); $search_login=GETPOST("search_login",'alpha'); $search_address=GETPOST("search_address",'alpha'); $search_zip=GETPOST("search_zip",'alpha'); @@ -105,9 +106,9 @@ $fieldstosearchall = array( if($db->type == 'pgsql') unset($fieldstosearchall['d.rowid']); $arrayfields=array( 'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), + 'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0), 'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), 'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), - 'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0), 'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1), 'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), 'd.morphy'=>array('label'=>$langs->trans("MorPhy"), 'checked'=>1), @@ -122,7 +123,7 @@ $arrayfields=array( 'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0), 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0), /*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0), - 'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/ + 'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/ 'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>500), 'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), @@ -161,6 +162,7 @@ if (empty($reshook)) $search_ref=""; $search_lastname=""; $search_firstname=""; + $search_civility=""; $search_login=""; $search_company=""; $search_type=""; @@ -203,8 +205,8 @@ $memberstatic=new Adherent($db); $now=dol_now(); -$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.civility, d.societe as company, d.fk_soc,"; -$sql.= " d.datefin, d.address, d.zip, d.town, d.state_id, d.country,"; +$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,"; +$sql.= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,"; $sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,"; $sql.= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,"; $sql.= " t.libelle as type, t.subscription,"; @@ -235,6 +237,7 @@ if ($search_ref) if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")"; else $sql.=" AND 1 = 2"; // Always wrong } +if ($search_civility) $sql.= natural_search("d.civility", $search_civility); if ($search_firstname) $sql.= natural_search("d.firstname", $search_firstname); if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname); if ($search_login) $sql.= natural_search("d.login", $search_login); @@ -323,6 +326,7 @@ if ($sall != "") $param.="&sall=".urlencode($sall); if ($statut != "") $param.="&statut=".urlencode($statut); if ($search_ref) $param.="&search_ref=".urlencode($search_ref); if ($search_nom) $param.="&search_nom=".urlencode($search_nom); +if ($search_civility) $param.="&search_civility=".urlencode($search_civility); if ($search_firstname) $param.="&search_firstname=".urlencode($search_firstname); if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname); if ($search_login) $param.="&search_login=".urlencode($search_login); @@ -428,6 +432,11 @@ if (! empty($arrayfields['d.ref']['checked'])) print ''; print ''; } +if (! empty($arrayfields['d.civility']['checked'])) +{ + print ''; +} if (! empty($arrayfields['d.firstname']['checked'])) { print ''; } -if (! empty($arrayfields['d.civility']['checked'])) -{ - print ''; -} if (! empty($arrayfields['d.company']['checked'])) { print '\n"; print ''; if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID",$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],'d.rowid','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'],$_SERVER["PHP_SELF"],'d.civility','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder); -if (! empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'],$_SERVER["PHP_SELF"],'d.civility','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.societe','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'],$_SERVER["PHP_SELF"],'d.login','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.morphy']['checked'])) print_liste_field_titre($arrayfields['d.morphy']['label'],$_SERVER["PHP_SELF"],'d.morphy','',$param,'',$sortfield,$sortorder); @@ -632,10 +636,17 @@ while ($i < min($num, $limit)) // Ref if (! empty($arrayfields['d.ref']['checked'])) { - print "\n"; } + // Civility + if (! empty($arrayfields['d.civility']['checked'])) + { + print "\n"; + } // Firstname if (! empty($arrayfields['d.firstname']['checked'])) { @@ -650,13 +661,6 @@ while ($i < min($num, $limit)) print $obj->lastname; print "\n"; } - // Civility - if (! empty($arrayfields['d.civility']['checked'])) - { - print "\n"; - } // Company if (! empty($arrayfields['d.company']['checked'])) { @@ -667,12 +671,12 @@ while ($i < min($num, $limit)) // Login if (! empty($arrayfields['d.login']['checked'])) { - print "\n"; + print "\n"; } // Moral/Physique if (! empty($arrayfields['d.morphy']['checked'])) { - print "\n"; + print "\n"; } // Type label if (! empty($arrayfields['t.libelle']['checked'])) From b658626e21bd6e2b329eb8aeb378fd8d39ab6417 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Tue, 4 Sep 2018 11:54:13 +0200 Subject: [PATCH 087/255] NEW: Highlight lines on lists when they are checked --- htdocs/admin/ihm.php | 4 +++ htdocs/core/class/html.form.class.php | 13 ++++--- htdocs/core/lib/usergroups.lib.php | 52 +++++++++++++++++++++++++-- htdocs/langs/en_US/admin.lang | 1 + htdocs/theme/eldy/style.css.php | 12 +++++++ htdocs/theme/md/style.css.php | 12 +++++++ htdocs/user/param_ihm.php | 7 ++++ 7 files changed, 95 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 4cb5a907927..c6929a0f61e 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -133,6 +134,9 @@ if ($action == 'update') if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); + if (GETPOST('THEME_ELDY_USE_CHECKED') == '') dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", '0', 'chaine', 0, '', $conf->entity); + else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $_POST["THEME_ELDY_USE_CHECKED"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 550ecea4867..80b3a2b546a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6956,17 +6956,22 @@ class Form $("#checkallactions").click(function() { if($(this).is(\':checked\')){ console.log("We check all"); - $(".'.$cssclass.'").prop(\'checked\', true); + $(".'.$cssclass.'").prop(\'checked\', true).trigger(\'change\'); } else { console.log("We uncheck all"); - $(".'.$cssclass.'").prop(\'checked\', false); + $(".'.$cssclass.'").prop(\'checked\', false).trigger(\'change\'); }'."\n"; if ($calljsfunction) $out.='if (typeof initCheckForSelect == \'function\') { initCheckForSelect(0); } else { console.log("No function initCheckForSelect found. Call won\'t be done."); }'; $out.=' }); - }); - '; + + $(".checkforselect").change(function() { + $(this).closest("tr").toggleClass("highlight", this.checked); + }); + + }); + '; return $out; } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 2cbba69d256..ae469b89552 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -2,6 +2,7 @@ /* Copyright (C) 2006-2012 Laurent Destailleur * Copyright (C) 2010-2017 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -322,6 +323,10 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) if (empty($foruserprofile)) $hoverdisabled=(isset($conf->global->THEME_ELDY_USE_HOVER) && $conf->global->THEME_ELDY_USE_HOVER == '0'); else $hoverdisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_HOVER) || $fuser->conf->THEME_ELDY_USE_HOVER == '0'):''); + $checkeddisabled=''; + if (empty($foruserprofile)) $checkeddisabled=(isset($conf->global->THEME_ELDY_USE_CHECKED) && $conf->global->THEME_ELDY_USE_CHECKED == '0'); + else $checkeddisabled=(is_object($fuser)?(empty($fuser->conf->THEME_ELDY_USE_CHECKED) || $fuser->conf->THEME_ELDY_USE_CHECKED == '0'):''); + $colspan=2; if ($foruserprofile) $colspan=4; @@ -809,8 +814,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; */ } - else - { + else { print ''; print ''; print ''; + } + + // Use Checked + if ($foruserprofile) + { + /* Must first change option to choose color of highlight instead of yes or no. + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + */ + } + else + { + print ''; + print ''; + print ''; print ''; } diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 16ca7cc7201..5f5e37d38a8 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1703,6 +1703,7 @@ InstallModuleFromWebHasBeenDisabledByFile=Install of external module from applic ConfFileMustContainCustom=Installing or building an external module from application need to save the module files into directory %s. To have this directory processed by Dolibarr, you must setup your conf/conf.php to add the 2 directive lines:
    $dolibarr_main_url_root_alt='/custom';
    $dolibarr_main_document_root_alt='%s/custom'; HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over HighlightLinesColor=Highlight color of the line when the mouse passes over (keep empty for no highlight) +HighlightLinesChecked=Highlight color of the line when it is checked (keep empty for no highlight) TextTitleColor=Text color of Page title LinkColor=Color of links PressF5AfterChangingThis=Press CTRL+F5 on keyboard or clear your browser cache after changing this value to have it effective diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b6e744672e8..222e7a14593 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -4,6 +4,7 @@ * Copyright (C) 2007-2017 Regis Houssin * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -107,6 +108,7 @@ if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_ if (! isset($conf->global->THEME_ELDY_VERMENU_BACK1)) $conf->global->THEME_ELDY_VERMENU_BACK1=$colorbackvmenu1; if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1; if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER=$colorbacklinepairhover; +if (! isset($conf->global->THEME_ELDY_USE_CHECKED)) $conf->global->THEME_ELDY_USE_CHECKED=$colorbacklinepairchecked; if (! isset($conf->global->THEME_ELDY_LINEBREAK)) $conf->global->THEME_ELDY_LINEBREAK=$colorbacklinebreak; if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab; if (! isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK=$colortextlink; @@ -143,9 +145,11 @@ $fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( // Hover color $colorbacklinepairhover=((! isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER === '0')?'':($conf->global->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_HOVER)); +$colorbacklinepairchecked=((! isset($conf->global->THEME_ELDY_USE_CHECKED) || (string) $conf->global->THEME_ELDY_USE_CHECKED === '0')?'':($conf->global->THEME_ELDY_USE_CHECKED === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_CHECKED)); if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) { $colorbacklinepairhover=((! isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0')?'':($user->conf->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_HOVER)); + $colorbacklinepairchecked=((! isset($user->conf->THEME_ELDY_USE_CHECKED) || $user->conf->THEME_ELDY_USE_CHECKED === '0')?'':($user->conf->THEME_ELDY_USE_CHECKED === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_CHECKED)); } //$colortopbordertitle1=$colorbackhmenu1; @@ -191,6 +195,7 @@ $colorbacklineimpair2=join(',',colorStringToArray($colorbacklineimpair2)); $colorbacklinepair1=join(',',colorStringToArray($colorbacklinepair1)); $colorbacklinepair2=join(',',colorStringToArray($colorbacklinepair2)); if ($colorbacklinepairhover != '') $colorbacklinepairhover=join(',',colorStringToArray($colorbacklinepairhover)); +if ($colorbacklinepairchecked != '') $colorbacklinepairchecked=join(',',colorStringToArray($colorbacklinepairchecked)); $colorbackbody=join(',',colorStringToArray($colorbackbody)); $colortexttitlenotab=join(',',colorStringToArray($colortexttitlenotab)); $colortexttitle=join(',',colorStringToArray($colortexttitle)); @@ -218,6 +223,7 @@ print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; print 'colorbacklinepair1='.$colorbacklinepair1."\n"; print 'colorbacklinepair2='.$colorbacklinepair2."\n"; print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print 'colorbacklinepairchecked='.$colorbacklinepairchecked."\n"; print '$colortexttitlenotab='.$colortexttitlenotab."\n"; print '$colortexttitle='.$colortexttitle."\n"; print '$colortext='.$colortext."\n"; @@ -2931,6 +2937,12 @@ div.pagination li.paginationafterarrows { background: rgb() !important; /* Must be background to be stronger than background of odd or even */ } + +.highlight { + background: rgb() !important; /* Must be background to be stronger than background of odd or even */ +} + + .nohover:hover { background: unset; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index aa02805c5cc..873319b39d1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -5,6 +5,7 @@ * Copyright (C) 2011 Philippe Grand * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -108,6 +109,7 @@ if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_ if (! isset($conf->global->THEME_ELDY_VERMENU_BACK1)) $conf->global->THEME_ELDY_VERMENU_BACK1=$colorbackvmenu1; if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1=$colorbacktitle1; if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER==$colorbacklinepairhover; +if (! isset($conf->global->THEME_ELDY_USE_CHECKED)) $conf->global->THEME_ELDY_USE_CHECKED=$colorbacklinepairchecked; if (! isset($conf->global->THEME_ELDY_LINEBREAK)) $conf->global->THEME_ELDY_LINEBREAK=$colorbacklinebreak; if (! isset($conf->global->THEME_ELDY_TEXTTITLENOTAB)) $conf->global->THEME_ELDY_TEXTTITLENOTAB=$colortexttitlenotab; if (! isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK=$colortextlink; @@ -145,9 +147,11 @@ $fontsizesmaller =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty( // Hover color $colorbacklinepairhover=((! isset($conf->global->THEME_ELDY_USE_HOVER) || (string) $conf->global->THEME_ELDY_USE_HOVER === '0')?'':($conf->global->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_HOVER)); +$colorbacklinepairchecked=((! isset($conf->global->THEME_ELDY_USE_CHECKED) || (string) $conf->global->THEME_ELDY_USE_CHECKED === '0')?'':($conf->global->THEME_ELDY_USE_CHECKED === '1'?'edf4fb':$conf->global->THEME_ELDY_USE_CHECKED)); if (! empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)) { $colorbacklinepairhover=((! isset($user->conf->THEME_ELDY_USE_HOVER) || $user->conf->THEME_ELDY_USE_HOVER === '0')?'':($user->conf->THEME_ELDY_USE_HOVER === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_HOVER)); + $colorbacklinepairchecked=((! isset($user->conf->THEME_ELDY_USE_CHECKED) || $user->conf->THEME_ELDY_USE_CHECKED === '0')?'':($user->conf->THEME_ELDY_USE_CHECKED === '1'?'edf4fb':$user->conf->THEME_ELDY_USE_CHECKED)); } if (empty($colortopbordertitle1)) $colortopbordertitle1=$colorbackhmenu1; @@ -193,6 +197,7 @@ $colorbacklineimpair2=join(',',colorStringToArray($colorbacklineimpair2)); $colorbacklinepair1=join(',',colorStringToArray($colorbacklinepair1)); $colorbacklinepair2=join(',',colorStringToArray($colorbacklinepair2)); if ($colorbacklinepairhover != '') $colorbacklinepairhover=join(',',colorStringToArray($colorbacklinepairhover)); +if ($colorbacklinepairchecked != '') $colorbacklinepairchecked=join(',',colorStringToArray($colorbacklinepairchecked)); $colorbackbody=join(',',colorStringToArray($colorbackbody)); $colortexttitlenotab=join(',',colorStringToArray($colortexttitlenotab)); $colortexttitle=join(',',colorStringToArray($colortexttitle)); @@ -211,6 +216,7 @@ print 'colorbacklineimpair2='.$colorbacklineimpair2."\n"; print 'colorbacklinepair1='.$colorbacklinepair1."\n"; print 'colorbacklinepair2='.$colorbacklinepair2."\n"; print 'colorbacklinepairhover='.$colorbacklinepairhover."\n"; +print 'colorbacklinepairchecked='.$colorbacklinepairchecked."\n"; print '$colortexttitlenotab='.$colortexttitlenotab."\n"; print '$colortexttitle='.$colortexttitle."\n"; print '$colortext='.$colortext."\n"; @@ -2907,6 +2913,12 @@ ul.noborder li:nth-child(odd):not(.liste_titre) { } + +.highlight { + background: rgb() !important; /* Must be background to be stronger than background of odd or even */ +} + + .oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover { font-family: ; diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 5c2869847c6..6cb418ff641 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2017 Laurent Destailleur * Copyright (C) 2010-2015 Regis Houssin * Copyright (C) 2013 Florian Henry + * Copyright (C) 2018 Ferran Marcet * * 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 @@ -137,6 +138,12 @@ if (empty($reshook)) { $tabparam["THEME_ELDY_USE_HOVER"] = 0; } + if (GETPOST('check_THEME_ELDY_USE_CHECKED') == 'on') { + $tabparam["THEME_ELDY_USE_CHECKED"] = 1; + } else { + $tabparam["THEME_ELDY_USE_CHECKED"] = 0; + } + $result = dol_set_user_param($db, $conf, $object, $tabparam); header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id); From 203c925c5b6942e1139f7753c46ddd8b61f9bf67 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 12:03:21 +0200 Subject: [PATCH 088/255] Fix look and feel v8 --- htdocs/projet/element.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 5afee3f7dc9..88ab25acb1e 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -741,9 +741,9 @@ foreach ($listofreferent as $key => $value) if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) { $addform.='
    '; - if ($testnew) $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).''; + if ($testnew) $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' '; elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { - $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).''; + $addform.=''.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' '; } $addform.='
    '; } From 42565e722e6c682a978514e98233093042eedd80 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 4 Sep 2018 13:37:00 +0200 Subject: [PATCH 089/255] Standardize and update code --- htdocs/asset/class/asset.class.php | 6 +++++- htdocs/core/class/discount.class.php | 4 ++++ htdocs/product/class/productcustomerprice.class.php | 7 ++++++- htdocs/societe/class/companypaymentmode.class.php | 6 +++++- htdocs/societe/class/societeaccount.class.php | 7 ++++++- htdocs/stripe/class/stripe.class.php | 5 ++++- htdocs/ticket/class/actions_ticket.class.php | 4 ++++ htdocs/ticket/class/ticket.class.php | 4 ++-- 8 files changed, 36 insertions(+), 7 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 3ca85a4015f..3f82a6aca98 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -114,7 +114,11 @@ class Asset extends CommonObject public $label; public $amount; - public $fk_soc; + + /** + * @var int Thirdparty ID + */ + public $fk_soc; /** * @var string description diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 78f713232d4..6a91384a2f2 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -48,7 +48,11 @@ class DiscountAbsolute */ public $id; + /** + * @var int Thirdparty ID + */ public $fk_soc; + public $discount_type; // 0 => customer discount, 1 => supplier discount public $amount_ht; // public $amount_tva; // diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 35ba8621ae8..29327293723 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -974,7 +974,12 @@ class PriceByCustomerLine public $datec = ''; public $tms = ''; public $fk_product; - public $fk_soc; + + /** + * @var int Thirdparty ID + */ + public $fk_soc; + public $price; public $price_ttc; public $price_min; diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index ae405ac6249..cbe8a111985 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -124,7 +124,11 @@ class CompanyPaymentMode extends CommonObject */ public $rowid; - public $fk_soc; + /** + * @var int Thirdparty ID + */ + public $fk_soc; + public $label; public $bank; public $code_banque; diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 03fa94c0dd0..b5cd4d8e8ff 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -111,7 +111,12 @@ class SocieteAccount extends CommonObject public $pass_encoding; public $pass_crypted; public $pass_temp; - public $fk_soc; + + /** + * @var int Thirdparty ID + */ + public $fk_soc; + public $site; public $date_last_login; public $date_previous_login; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 9ef6b60977e..4264ae984b0 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -33,7 +33,10 @@ class Stripe extends CommonObject */ public $rowid; - public $fk_soc; + /** + * @var int Thirdparty ID + */ + public $fk_soc; public $fk_key; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index fc45740863b..17df0bb8265 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -68,6 +68,10 @@ class ActionsTicket public $description; public $fk_statut; + + /** + * @var int Thirdparty ID + */ public $fk_soc; /** diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index e73e0bf95ef..310d4b02207 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -2502,8 +2502,8 @@ class TicketsLine public $track_id; /** - * Thirdparty ID - */ + * @var int Thirdparty ID + */ public $fk_soc; /** From 47b6374abcf517bc35d70cb7c5abd1ef7e916d56 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 4 Sep 2018 13:45:20 +0200 Subject: [PATCH 090/255] Standardize and update code --- htdocs/adherents/class/adherent.class.php | 89 ++++++++++--------- .../class/productcustomerprice.class.php | 39 ++++---- 2 files changed, 68 insertions(+), 60 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index f9a02252387..fdb0a03aa00 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -53,66 +53,69 @@ class Adherent extends CommonObject public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - var $mesgs; + public $mesgs; - var $login; + public $login; //! Clear password in memory - var $pass; + public $pass; //! Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0) - var $pass_indatabase; + public $pass_indatabase; //! Encrypted password in database (always defined) - var $pass_indatabase_crypted; + public $pass_indatabase_crypted; - var $societe; - var $company; - var $address; - var $zip; - var $town; + public $societe; + public $company; + public $address; + public $zip; + public $town; - var $state_id; // Id of department - var $state_code; // Code of department - var $state; // Label of department + public $state_id; // Id of department + public $state_code; // Code of department + public $state; // Label of department - var $email; - var $skype; - var $phone; - var $phone_perso; - var $phone_mobile; + public $email; + public $skype; + public $phone; + public $phone_perso; + public $phone_mobile; - var $morphy; - var $public; - var $statut; // -1:brouillon, 0:resilie, >=1:valide,paye - var $photo; + public $morphy; + public $public; + public $statut; // -1:brouillon, 0:resilie, >=1:valide,paye + public $photo; - var $datec; - var $datem; - var $datefin; - var $datevalid; - var $birth; + public $datec; + public $datem; + public $datefin; + public $datevalid; + public $birth; - var $note_public; - var $note_private; + public $note_public; + public $note_private; - var $typeid; // Id type adherent - var $type; // Libelle type adherent - var $need_subscription; + public $typeid; // Id type adherent + public $type; // Libelle type adherent + public $need_subscription; - var $user_id; - var $user_login; + public $user_id; + public $user_login; - var $fk_soc; + /** + * @var int Thirdparty ID + */ + public $fk_soc; // Fields loaded by fetch_subscriptions() - var $first_subscription_date; - var $first_subscription_amount; - var $last_subscription_date; - var $last_subscription_date_start; - var $last_subscription_date_end; - var $last_subscription_amount; - var $subscriptions=array(); + public $first_subscription_date; + public $first_subscription_amount; + public $last_subscription_date; + public $last_subscription_date_start; + public $last_subscription_date_end; + public $last_subscription_amount; + public $subscriptions=array(); - var $oldcopy; // To contains a clone of this when we need to save old properties of object + public $oldcopy; // To contains a clone of this when we need to save old properties of object /** * @var int Entity diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 29327293723..667e63b3ecc 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -38,29 +38,34 @@ class Productcustomerprice extends CommonObject */ public $table_element = 'product_customer_price'; - var $entity; - var $datec = ''; - var $tms = ''; - var $fk_product; - var $fk_soc; - var $price; - var $price_ttc; - var $price_min; - var $price_min_ttc; - var $price_base_type; - var $tva_tx; - var $recuperableonly; - var $localtax1_type; - var $localtax1_tx; - var $localtax2_type; - var $localtax2_tx; + public $entity; + public $datec = ''; + public $tms = ''; + public $fk_product; + + /** + * @var int Thirdparty ID + */ + public $fk_soc; + + public $price; + public $price_ttc; + public $price_min; + public $price_min_ttc; + public $price_base_type; + public $tva_tx; + public $recuperableonly; + public $localtax1_type; + public $localtax1_tx; + public $localtax2_type; + public $localtax2_tx; /** * @var int User ID */ public $fk_user; - var $lines = array (); + public $lines = array (); /** * Constructor From d3570317194c7e6275121117fd2eaaa4e2cc58da Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 4 Sep 2018 14:46:10 +0200 Subject: [PATCH 091/255] fix merge --- .../class/accountingaccount.class.php | 3 ++ .../class/accountingjournal.class.php | 4 ++ .../adherents/class/adherent_type.class.php | 14 +++++- htdocs/adherents/class/subscription.class.php | 23 +++++----- htdocs/asset/class/asset_type.class.php | 13 +++++- htdocs/bookmarks/class/bookmark.class.php | 18 +++++--- htdocs/categories/class/categorie.class.php | 5 ++- htdocs/comm/action/class/actioncomm.class.php | 6 ++- .../comm/action/class/cactioncomm.class.php | 6 ++- htdocs/comm/mailing/class/mailing.class.php | 45 ++++++++++--------- htdocs/comm/propal/class/propal.class.php | 3 ++ 11 files changed, 95 insertions(+), 45 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index c2da46c6911..ba6f53e3785 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -37,6 +37,9 @@ class AccountingAccount extends CommonObject */ public $table_element='accounting_account'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'billr'; /** diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 852a70d38c2..dc34d0adf40 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -42,6 +42,10 @@ class AccountingJournal extends CommonObject public $fk_element = ''; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'generic'; /** diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b7d510a3e0f..ba2f2306092 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -36,13 +36,17 @@ class AdherentType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'adherent_type'; - + /** * @var string ID to identify managed object */ public $element = 'adherent_type'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'group'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** @@ -51,19 +55,25 @@ class AdherentType extends CommonObject * @see label */ public $libelle; + /** @var string Label */ public $label; + /** * @var int Subsription required (0 or 1) * @since 5.0 */ public $subscription; + /** @var string Public note */ public $note; + /** @var integer Can vote */ public $vote; + /** @var string Email sent during validation */ public $mail_valid; + /** @var array Array of members */ public $members=array(); diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 90452816be8..85b024a1582 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -36,21 +36,24 @@ class Subscription extends CommonObject * @var string ID to identify managed object */ public $element='subscription'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='subscription'; - - public $picto='payment'; - var $datec; // Date creation - var $datem; // Date modification - var $dateh; // Subscription start date (date subscription) - var $datef; // Subscription end date - var $fk_adherent; - var $amount; - var $fk_bank; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='payment'; + + public $datec; // Date creation + public $datem; // Date modification + public $dateh; // Subscription start date (date subscription) + public $datef; // Subscription end date + public $fk_adherent; + public $amount; + public $fk_bank; /** diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index e6b95d7ad37..5df411ef129 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -33,25 +33,34 @@ class AssetType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'asset_type'; - + /** * @var string ID to identify managed object */ public $element = 'asset_type'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'group'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** @var string Label */ public $label; + /** @var string Accountancy code asset */ public $accountancy_code_asset; + /** @var string Accountancy code depreciation asset */ public $accountancy_code_depreciation_asset; + /** @var string Accountancy code depreciation expense */ public $accountancy_code_depreciation_expense; + /** @var string Public note */ public $note; + /** @var array Array of asset */ public $asset=array(); diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index f0942b18a82..7f3b2c58300 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -39,7 +39,11 @@ class Bookmark extends CommonObject public $table_element='bookmark'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - public $picto = 'bookmark'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'bookmark'; /** * @var DoliDB Database handler. @@ -56,12 +60,12 @@ class Bookmark extends CommonObject */ public $fk_user; - var $datec; - var $url; - var $target; // 0=replace, 1=new window - var $title; - var $position; - var $favicon; + public $datec; + public $url; + public $target; // 0=replace, 1=new window + public $title; + public $position; + public $favicon; /** diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 94e42ee4334..cddf26e343d 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -51,8 +51,11 @@ class Categorie extends CommonObject const TYPE_USER = 'user'; const TYPE_PROJECT = 'project'; const TYPE_ACCOUNT = 'bank_account'; - const TYPE_BANK_LINE = 'bank_line'; + const TYPE_BANK_LINE = 'bank_line'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'category'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index fd620ef2fce..f2983a190c9 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -45,7 +45,11 @@ class ActionComm extends CommonObject public $table_element = 'actioncomm'; public $table_rowid = 'id'; - public $picto='action'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='action'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index f339e79d6a2..4f0a824007a 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -54,7 +54,11 @@ class CActionComm public $active; public $color; - public $picto; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto; public $type_actions=array(); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index fa7a9a1bc9e..43087b2ea53 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -35,39 +35,42 @@ class Mailing extends CommonObject * @var string ID to identify managed object */ public $element='mailing'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='mailing'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='email'; - var $titre; - var $sujet; - var $body; - var $nbemail; - var $bgcolor; - var $bgimage; + public $titre; + public $sujet; + public $body; + public $nbemail; + public $bgcolor; + public $bgimage; - var $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely + public $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely - var $email_from; - var $email_replyto; - var $email_errorsto; + public $email_from; + public $email_replyto; + public $email_errorsto; - var $joined_file1; - var $joined_file2; - var $joined_file3; - var $joined_file4; + public $joined_file1; + public $joined_file2; + public $joined_file3; + public $joined_file4; - var $user_creat; - var $user_valid; + public $user_creat; + public $user_valid; - var $date_creat; - var $date_valid; + public $date_creat; + public $date_valid; - var $extraparams=array(); + public $extraparams=array(); public $statut_dest=array(); public $statuts=array(); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a3e1ec42bf7..e1f7736cbc3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -65,6 +65,9 @@ class Propal extends CommonObject */ public $fk_element ='fk_propal'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='propal'; /** From 707f8b731217f3923167052b038f582c6b70ae78 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Tue, 4 Sep 2018 14:46:10 +0200 Subject: [PATCH 092/255] fix merge --- .../class/accountingaccount.class.php | 3 ++ .../class/accountingjournal.class.php | 4 ++ .../adherents/class/adherent_type.class.php | 14 +++++- htdocs/adherents/class/subscription.class.php | 23 +++++----- htdocs/asset/class/asset_type.class.php | 13 +++++- htdocs/bookmarks/class/bookmark.class.php | 18 +++++--- htdocs/categories/class/categorie.class.php | 5 ++- htdocs/comm/action/class/actioncomm.class.php | 6 ++- .../comm/action/class/cactioncomm.class.php | 6 ++- htdocs/comm/mailing/class/mailing.class.php | 45 ++++++++++--------- htdocs/comm/propal/class/propal.class.php | 3 ++ 11 files changed, 95 insertions(+), 45 deletions(-) diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index c2da46c6911..ba6f53e3785 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -37,6 +37,9 @@ class AccountingAccount extends CommonObject */ public $table_element='accounting_account'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'billr'; /** diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 852a70d38c2..dc34d0adf40 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -42,6 +42,10 @@ class AccountingJournal extends CommonObject public $fk_element = ''; public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'generic'; /** diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index b7d510a3e0f..ba2f2306092 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -36,13 +36,17 @@ class AdherentType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'adherent_type'; - + /** * @var string ID to identify managed object */ public $element = 'adherent_type'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'group'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** @@ -51,19 +55,25 @@ class AdherentType extends CommonObject * @see label */ public $libelle; + /** @var string Label */ public $label; + /** * @var int Subsription required (0 or 1) * @since 5.0 */ public $subscription; + /** @var string Public note */ public $note; + /** @var integer Can vote */ public $vote; + /** @var string Email sent during validation */ public $mail_valid; + /** @var array Array of members */ public $members=array(); diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 90452816be8..85b024a1582 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -36,21 +36,24 @@ class Subscription extends CommonObject * @var string ID to identify managed object */ public $element='subscription'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='subscription'; - - public $picto='payment'; - var $datec; // Date creation - var $datem; // Date modification - var $dateh; // Subscription start date (date subscription) - var $datef; // Subscription end date - var $fk_adherent; - var $amount; - var $fk_bank; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='payment'; + + public $datec; // Date creation + public $datem; // Date modification + public $dateh; // Subscription start date (date subscription) + public $datef; // Subscription end date + public $fk_adherent; + public $amount; + public $fk_bank; /** diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index e6b95d7ad37..5df411ef129 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -33,25 +33,34 @@ class AssetType extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'asset_type'; - + /** * @var string ID to identify managed object */ public $element = 'asset_type'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'group'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** @var string Label */ public $label; + /** @var string Accountancy code asset */ public $accountancy_code_asset; + /** @var string Accountancy code depreciation asset */ public $accountancy_code_depreciation_asset; + /** @var string Accountancy code depreciation expense */ public $accountancy_code_depreciation_expense; + /** @var string Public note */ public $note; + /** @var array Array of asset */ public $asset=array(); diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index f0942b18a82..7f3b2c58300 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -39,7 +39,11 @@ class Bookmark extends CommonObject public $table_element='bookmark'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - public $picto = 'bookmark'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'bookmark'; /** * @var DoliDB Database handler. @@ -56,12 +60,12 @@ class Bookmark extends CommonObject */ public $fk_user; - var $datec; - var $url; - var $target; // 0=replace, 1=new window - var $title; - var $position; - var $favicon; + public $datec; + public $url; + public $target; // 0=replace, 1=new window + public $title; + public $position; + public $favicon; /** diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 94e42ee4334..cddf26e343d 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -51,8 +51,11 @@ class Categorie extends CommonObject const TYPE_USER = 'user'; const TYPE_PROJECT = 'project'; const TYPE_ACCOUNT = 'bank_account'; - const TYPE_BANK_LINE = 'bank_line'; + const TYPE_BANK_LINE = 'bank_line'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'category'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index fd620ef2fce..f2983a190c9 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -45,7 +45,11 @@ class ActionComm extends CommonObject public $table_element = 'actioncomm'; public $table_rowid = 'id'; - public $picto='action'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='action'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index f339e79d6a2..4f0a824007a 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -54,7 +54,11 @@ class CActionComm public $active; public $color; - public $picto; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto; public $type_actions=array(); diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index fa7a9a1bc9e..43087b2ea53 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -35,39 +35,42 @@ class Mailing extends CommonObject * @var string ID to identify managed object */ public $element='mailing'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='mailing'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='email'; - var $titre; - var $sujet; - var $body; - var $nbemail; - var $bgcolor; - var $bgimage; + public $titre; + public $sujet; + public $body; + public $nbemail; + public $bgcolor; + public $bgimage; - var $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely + public $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely - var $email_from; - var $email_replyto; - var $email_errorsto; + public $email_from; + public $email_replyto; + public $email_errorsto; - var $joined_file1; - var $joined_file2; - var $joined_file3; - var $joined_file4; + public $joined_file1; + public $joined_file2; + public $joined_file3; + public $joined_file4; - var $user_creat; - var $user_valid; + public $user_creat; + public $user_valid; - var $date_creat; - var $date_valid; + public $date_creat; + public $date_valid; - var $extraparams=array(); + public $extraparams=array(); public $statut_dest=array(); public $statuts=array(); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a3e1ec42bf7..e1f7736cbc3 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -65,6 +65,9 @@ class Propal extends CommonObject */ public $fk_element ='fk_propal'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='propal'; /** From 154e44e7619d745232c91a4e09b23ddbd6b29561 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 19:57:20 +0200 Subject: [PATCH 093/255] Fix responsive --- htdocs/societe/list.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 8eb6bf447d6..1adb3ab2c15 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -711,48 +711,48 @@ if (! empty($arrayfields['s.nom']['checked'])) { print '
    '; } if (! empty($arrayfields['s.name_alias']['checked'])) { print ''; } // Barcode if (! empty($arrayfields['s.barcode']['checked'])) { print ''; } // Customer code if (! empty($arrayfields['s.code_client']['checked'])) { print ''; } // Supplier code if (! empty($arrayfields['s.code_fournisseur']['checked'])) { print ''; } // Account Customer code if (! empty($arrayfields['s.code_compta']['checked'])) { print ''; } // Account Supplier code if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) { print ''; } // Town From aec0d4022b0560551eee28f06b3911e50528d29d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Sep 2018 19:59:20 +0200 Subject: [PATCH 094/255] Fix responsive --- htdocs/societe/list.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 1adb3ab2c15..72071919a9b 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -766,21 +766,21 @@ if (! empty($arrayfields['s.town']['checked'])) if (! empty($arrayfields['s.zip']['checked'])) { print ''; } // State if (! empty($arrayfields['state.nom']['checked'])) { print ''; } // Region if (! empty($arrayfields['region.nom']['checked'])) { print ''; } // Country @@ -801,14 +801,14 @@ if (! empty($arrayfields['s.email']['checked'])) { // Email print ''; } if (! empty($arrayfields['s.phone']['checked'])) { // Phone print ''; } if (! empty($arrayfields['s.fax']['checked'])) @@ -822,14 +822,14 @@ if (! empty($arrayfields['s.url']['checked'])) { // Url print ''; } if (! empty($arrayfields['s.siren']['checked'])) { // IdProf1 print ''; } if (! empty($arrayfields['s.siret']['checked'])) @@ -850,28 +850,28 @@ if (! empty($arrayfields['s.idprof4']['checked'])) { // IdProf4 print ''; } if (! empty($arrayfields['s.idprof5']['checked'])) { // IdProf5 print ''; } if (! empty($arrayfields['s.idprof6']['checked'])) { // IdProf6 print ''; } if (! empty($arrayfields['s.tva_intra']['checked'])) { // Vat number print ''; } @@ -958,7 +958,7 @@ if (! empty($arrayfields['s.status']['checked'])) if (! empty($arrayfields['s.import_key']['checked'])) { print ''; } // Action column From fd6281b364ab571242e09aa3c7ead48764216393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 20:00:09 +0200 Subject: [PATCH 095/255] move phpcs:ignore --- htdocs/core/class/fiscalyear.class.php | 21 ++++++----- htdocs/core/modules/bank/modules_bank.php | 3 +- .../expensereport/modules_expensereport.php | 3 +- .../export/export_excel2007.modules.php | 15 ++++---- htdocs/core/modules/export/modules_export.php | 3 +- .../core/modules/facture/modules_facture.php | 5 ++- .../holiday/mod_holiday_immaculate.php | 11 +++--- .../modules/holiday/mod_holiday_madonna.php | 3 +- .../modules/livraison/mod_livraison_jade.php | 7 ++-- .../modules/mailings/xinputfile.modules.php | 3 +- .../modules/mailings/xinputuser.modules.php | 7 ++-- .../modules/payment/mod_payment_cicada.php | 5 ++- .../modules_product_batch.class.php | 11 +++--- .../fourn/class/fournisseur.facture.class.php | 37 ++++++++++++------- 14 files changed, 79 insertions(+), 55 deletions(-) diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 0bc58a64e64..4e9b4021ee5 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -250,6 +250,7 @@ class Fiscalyear extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Give a label from a status * @@ -257,38 +258,38 @@ class Fiscalyear extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable global $langs; if ($mode == 0) { return $langs->trans($this->statuts[$statut]); } - if ($mode == 1) + elseif ($mode == 1) { return $langs->trans($this->statuts_short[$statut]); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts_short[$statut]); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); - if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8'); + elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut==0 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut4').' '.$langs->trans($this->statuts[$statut]); - if ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return img_picto($langs->trans($this->statuts_short[$statut]),'statut8').' '.$langs->trans($this->statuts[$statut]); } - if ($mode == 5) + elseif ($mode == 5) { if ($statut==0 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut4'); - if ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==1 && ! empty($this->statuts_short[$statut])) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); } } diff --git a/htdocs/core/modules/bank/modules_bank.php b/htdocs/core/modules/bank/modules_bank.php index 300b06896b7..faae304222d 100644 --- a/htdocs/core/modules/bank/modules_bank.php +++ b/htdocs/core/modules/bank/modules_bank.php @@ -37,6 +37,7 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -44,9 +45,9 @@ abstract class ModeleBankAccountDoc extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db, $maxfilenamelength=0) { + // phpcs:enable global $conf; $type = 'bankaccount'; diff --git a/htdocs/core/modules/expensereport/modules_expensereport.php b/htdocs/core/modules/expensereport/modules_expensereport.php index f0a1573b996..11396f84435 100644 --- a/htdocs/core/modules/expensereport/modules_expensereport.php +++ b/htdocs/core/modules/expensereport/modules_expensereport.php @@ -29,6 +29,7 @@ abstract class ModeleExpenseReport extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -36,9 +37,9 @@ abstract class ModeleExpenseReport extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='expensereport'; diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 46f4d8960c2..0c13dfde688 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -37,12 +37,12 @@ class ExportExcel2007 extends ExportExcel * @var int ID */ public $id; - + /** * @var string proper name for given parameter */ public $label; - + var $extension; var $version; @@ -98,14 +98,15 @@ class ExportExcel2007 extends ExportExcel } - /** - * Close Excel file - * - * @return int <0 if KO, >0 if OK - */ // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Close Excel file + * + * @return int <0 if KO, >0 if OK + */ function close_file() { + // phpcs:enable global $conf; if (! empty($conf->global->MAIN_USE_PHP_WRITEEXCEL)) diff --git a/htdocs/core/modules/export/modules_export.php b/htdocs/core/modules/export/modules_export.php index ae409d71b05..6c155510f30 100644 --- a/htdocs/core/modules/export/modules_export.php +++ b/htdocs/core/modules/export/modules_export.php @@ -42,6 +42,7 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac var $libversion=array(); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load into memory list of available export format * @@ -49,9 +50,9 @@ class ModeleExports extends CommonDocGenerator // This class can't be abstrac * @param integer $maxfilenamelength Max length of value to show * @return array List of templates (same content than array this->driverlabel) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable dol_syslog(get_class($this)."::liste_modeles"); $dir=DOL_DOCUMENT_ROOT."/core/modules/export/"; diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php index 521e6471561..12d41903edb 100644 --- a/htdocs/core/modules/facture/modules_facture.php +++ b/htdocs/core/modules/facture/modules_facture.php @@ -42,6 +42,7 @@ abstract class ModelePDFFactures extends CommonDocGenerator */ public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -49,9 +50,9 @@ abstract class ModelePDFFactures extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='invoice'; @@ -65,7 +66,7 @@ abstract class ModelePDFFactures extends CommonDocGenerator } /** - * Classe mere des modeles de numerotation des references de facture + * Classe mere des modeles de numerotation des references de facture */ abstract class ModeleNumRefFactures { diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index afd9d35387c..16b7adce4ac 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -118,16 +118,17 @@ class mod_holiday_immaculate extends ModelNumRefHolidays return $numFinal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return next value + * Return next value * - * @param User $fuser User object - * @param Object $objforref Holiday object - * @return string Value if OK, 0 if KO + * @param User $fuser User object + * @param Object $objforref Holiday object + * @return string Value if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function holiday_get_num($fuser, $objforref) { + // phpcs:enable return $this->getNextValue($fuser, $objforref); } } diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php index 91bf0f511bb..ba951bb557c 100644 --- a/htdocs/core/modules/holiday/mod_holiday_madonna.php +++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php @@ -136,6 +136,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next value * @@ -143,9 +144,9 @@ class mod_holiday_madonna extends ModelNumRefHolidays * @param Object $objforref Holiday object * @return string Value if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function holiday_get_num($fuser,$objforref) { + // phpcs:enable return $this->getNextValue($fuser,$objforref); } } diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/livraison/mod_livraison_jade.php index 9cf6de78aea..2bc64bdcb63 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/livraison/mod_livraison_jade.php @@ -142,16 +142,17 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free ref * - * @param Societe $objsoc Object thirdparty + * @param Societe $objsoc Object thirdparty * @param Object $object Object livraison - * @return string Texte descripif + * @return string Texte descriptif */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function livraison_get_num($objsoc=0,$object='') { + // phpcs:enable return $this->getNextValue($objsoc,$object); } } diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 30c719689f2..7de27a0c753 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -110,6 +110,7 @@ class mailing_xinputfile extends MailingTargets return $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Ajoute destinataires dans table des cibles * @@ -117,9 +118,9 @@ class mailing_xinputfile extends MailingTargets * @param array $filtersarray Requete sql de selection des destinataires * @return int < 0 si erreur, nb ajout si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id,$filtersarray=array()) { + // phpcs:enable global $conf,$langs,$_FILES; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 89c626c447d..2364eeb08ef 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -108,6 +108,7 @@ class mailing_xinputuser extends MailingTargets return $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Ajoute destinataires dans table des cibles * @@ -115,9 +116,9 @@ class mailing_xinputuser extends MailingTargets * @param array $filtersarray Requete sql de selection des destinataires * @return int < 0 si erreur, nb ajout si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id,$filtersarray=array()) { + // phpcs:enable global $conf,$langs,$_FILES; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -154,8 +155,8 @@ class mailing_xinputuser extends MailingTargets } else { - $langs->load("errors"); - $this->error = $langs->trans("ErrorBadEmail",$email); + $langs->load("errors"); + $this->error = $langs->trans("ErrorBadEmail",$email); return -1; } } diff --git a/htdocs/core/modules/payment/mod_payment_cicada.php b/htdocs/core/modules/payment/mod_payment_cicada.php index 94fc445a1e2..5e87f33f8c1 100644 --- a/htdocs/core/modules/payment/mod_payment_cicada.php +++ b/htdocs/core/modules/payment/mod_payment_cicada.php @@ -138,16 +138,17 @@ class mod_payment_cicada extends ModeleNumRefPayments } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search + * @param string $objforref Object for number to search * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function payment_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/product_batch/modules_product_batch.class.php b/htdocs/core/modules/product_batch/modules_product_batch.class.php index 02e3be660b8..31e0ec676b2 100644 --- a/htdocs/core/modules/product_batch/modules_product_batch.class.php +++ b/htdocs/core/modules/product_batch/modules_product_batch.class.php @@ -21,8 +21,8 @@ /** - * \class ModeleProductCode - * \brief Parent class for product code generators + * \class ModeleProductCode + * \brief Parent class for product code generators */ /** @@ -44,16 +44,17 @@ abstract class ModelePDFProductBatch extends CommonDocGenerator public $error=''; - /** - * Return list of active generation modules + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Return list of active generation modules * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db, $maxfilenamelength=0) { + // phpcs:enable global $conf; $type='product_batch'; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f9f352c1f70..e8ef92a7d63 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -668,14 +668,15 @@ class FactureFournisseur extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load this->lines * * @return int 1 si ok, < 0 si erreur */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { + // phpcs:enable $this->lines = array(); $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.description, f.date_start, f.date_end, f.pu_ht, f.pu_ttc, f.qty, f.remise_percent, f.vat_src_code, f.tva_tx'; @@ -894,15 +895,16 @@ class FactureFournisseur extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add a discount line into an invoice (as an invoice line) using an existing absolute discount (Consume the discount) * * @param int $idremise Id of absolute discount * @return int >0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function insert_discount($idremise) { + // phpcs:enable global $langs; include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; @@ -1146,17 +1148,18 @@ class FactureFournisseur extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Tag invoice as a payed invoice + * Tag invoice as a payed invoice * * @param User $user Object user * @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet. Not implementd yet. * @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet. Not implementd yet. * @return int <0 si ko, >0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_paid($user, $close_code='', $close_note='') { + // phpcs:enable global $conf,$langs; $error=0; @@ -1195,6 +1198,7 @@ class FactureFournisseur extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Tag la facture comme non payee completement + appel trigger BILL_UNPAYED * Fonction utilisee quand un paiement prelevement est refuse, @@ -1203,9 +1207,9 @@ class FactureFournisseur extends CommonInvoice * @param User $user Object user that change status * @return int <0 si ok, >0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_unpaid($user) { + // phpcs:enable global $conf,$langs; $error=0; @@ -1407,6 +1411,7 @@ class FactureFournisseur extends CommonInvoice } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set draft status * @@ -1414,9 +1419,9 @@ class FactureFournisseur extends CommonInvoice * @param int $idwarehouse Id warehouse to use for stock change. * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_draft($user, $idwarehouse=-1) { + // phpcs:enable global $conf,$langs; $error=0; @@ -1972,16 +1977,17 @@ class FactureFournisseur extends CommonInvoice } } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Renvoi liste des factures remplacables * Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee * * @param int $socid Id societe * @return array Tableau des factures ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_replacable_supplier_invoices($socid=0) { + // phpcs:enable global $conf; $return = array(); @@ -2019,6 +2025,7 @@ class FactureFournisseur extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi liste des factures qualifiables pour correction par avoir * Les factures qui respectent les regles suivantes sont retournees: @@ -2027,9 +2034,9 @@ class FactureFournisseur extends CommonInvoice * @param int $socid Id societe * @return array Tableau des factures ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_qualified_avoir_supplier_invoices($socid=0) { + // phpcs:enable global $conf; $return = array(); @@ -2070,15 +2077,16 @@ class FactureFournisseur extends CommonInvoice } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Object user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user) { + // phpcs:enable global $conf, $langs; $sql = 'SELECT ff.rowid, ff.date_lim_reglement as datefin, ff.fk_statut'; @@ -2367,14 +2375,15 @@ class FactureFournisseur extends CommonInvoice $this->total_ttc = $xnbp*119.6; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $conf, $user; $this->nb=array(); @@ -3106,14 +3115,16 @@ class SupplierInvoiceLine extends CommonObjectLine return -2; } } - /** + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Mise a jour de l'objet ligne de commande en base * * @return int <0 si ko, >0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_total() { + // phpcs:enable $this->db->begin(); // Mise a jour ligne en base From 48d8a444e0e7b11a5601f896f9796a83aecb17dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 20:58:05 +0200 Subject: [PATCH 096/255] correct merge --- .../class/supplier_proposal.class.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 533b35ab0ab..ecd940fea96 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -2702,29 +2702,18 @@ class SupplierProposalLine extends CommonObjectLine public $oldline; // From llx_supplier_proposaldet -<<<<<<< HEAD - var $rowid; // deprecated -======= public $rowid; // deprecated ->>>>>>> upstream/develop /** * @var int ID */ public $id; -<<<<<<< HEAD - var $fk_supplier_proposal; - var $fk_parent_line; - var $desc; // Description ligne - var $fk_product; // Id produit predefini -======= public $fk_supplier_proposal; public $fk_parent_line; public $desc; // Description ligne public $fk_product; // Id produit predefini ->>>>>>> upstream/develop /** * @deprecated * @see product_type From c6cef85ccdbc1e86221ad35144c77804cf8e80ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 21:16:17 +0200 Subject: [PATCH 097/255] move phpcs:ignore --- .../core/modules/expensereport/modules_expensereport.php | 5 +++-- htdocs/core/modules/export/export_excel2007.modules.php | 2 +- htdocs/core/modules/societe/mod_codecompta_panicum.php | 3 ++- htdocs/core/modules/usergroup/modules_usergroup.class.php | 7 ++++--- htdocs/livraison/class/livraison.class.php | 8 ++------ 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/htdocs/core/modules/expensereport/modules_expensereport.php b/htdocs/core/modules/expensereport/modules_expensereport.php index 11396f84435..9ff7f671f9f 100644 --- a/htdocs/core/modules/expensereport/modules_expensereport.php +++ b/htdocs/core/modules/expensereport/modules_expensereport.php @@ -52,6 +52,7 @@ abstract class ModeleExpenseReport extends CommonDocGenerator } } +// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * expensereport_pdf_create * @@ -65,9 +66,9 @@ abstract class ModeleExpenseReport extends CommonDocGenerator * @param int $hideref Hide ref * @return int 0 if KO, 1 if OK */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { + // phpcs:enable return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } @@ -142,7 +143,7 @@ abstract class ModeleNumRefExpenseReport /** * Renvoie version du module numerotation * - * @return string Valeur + * @return string Valeur */ function getVersion() { diff --git a/htdocs/core/modules/export/export_excel2007.modules.php b/htdocs/core/modules/export/export_excel2007.modules.php index 5b2fd563427..74e35ff5b18 100644 --- a/htdocs/core/modules/export/export_excel2007.modules.php +++ b/htdocs/core/modules/export/export_excel2007.modules.php @@ -98,7 +98,7 @@ class ExportExcel2007 extends ExportExcel } - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close Excel file * diff --git a/htdocs/core/modules/societe/mod_codecompta_panicum.php b/htdocs/core/modules/societe/mod_codecompta_panicum.php index 1e990b42d69..2dd6a81de02 100644 --- a/htdocs/core/modules/societe/mod_codecompta_panicum.php +++ b/htdocs/core/modules/societe/mod_codecompta_panicum.php @@ -67,6 +67,7 @@ class mod_codecompta_panicum extends ModeleAccountancyCode return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set accountancy account code for a third party into this->code * @@ -75,9 +76,9 @@ class mod_codecompta_panicum extends ModeleAccountancyCode * @param int $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_code($db, $societe, $type='') { + // phpcs:enable $this->code=''; if (is_object($societe)) { diff --git a/htdocs/core/modules/usergroup/modules_usergroup.class.php b/htdocs/core/modules/usergroup/modules_usergroup.class.php index ec976239b9b..caa79594080 100644 --- a/htdocs/core/modules/usergroup/modules_usergroup.class.php +++ b/htdocs/core/modules/usergroup/modules_usergroup.class.php @@ -44,16 +44,17 @@ abstract class ModelePDFUserGroup extends CommonDocGenerator public $error=''; - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Return list of active generation modules * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type = 'group'; @@ -63,4 +64,4 @@ abstract class ModelePDFUserGroup extends CommonDocGenerator $list = getListOfModels($db, $type, $maxfilenamelength); return $list; } -} \ No newline at end of file +} diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index e3c03b723b1..c5e4b36ed25 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -1100,25 +1100,21 @@ class LivraisonLigne extends CommonObjectLine */ public $label; -<<<<<<< HEAD - var $description; // Description produit -======= /** * @var string product description */ public $description; ->>>>>>> upstream/develop /** * @deprecated * @see product_ref */ - var $ref; + public $ref; /** * @deprecated * @see product_label; */ - var $libelle; + public $libelle; public $product_ref; public $product_label; From 3847df1de6c4a87525e5ec9996100743c13a6f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 21:53:53 +0200 Subject: [PATCH 098/255] move phpcs:ignore --- htdocs/core/class/commoninvoice.class.php | 19 ++--- htdocs/core/db/mysqli.class.php | 72 ++++++++++++------- htdocs/core/modules/dons/modules_don.php | 7 +- .../modules/export/export_csv.modules.php | 20 ++++-- .../core/modules/holiday/modules_holiday.php | 7 +- .../modules/livraison/modules_livraison.php | 3 +- .../thirdparties_services_expired.modules.php | 7 +- .../core/modules/project/modules_project.php | 5 +- .../mod_commande_fournisseur_muguet.php | 3 +- .../pdf/pdf_muscadet.modules.php | 12 ++-- .../core/modules/user/modules_user.class.php | 3 +- 11 files changed, 98 insertions(+), 60 deletions(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 54d9aed45e9..e9be4b1f9da 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -325,6 +325,7 @@ abstract class CommonInvoice extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return if an invoice can be deleted * Rule is: @@ -337,9 +338,9 @@ abstract class CommonInvoice extends CommonObject * * @return int <=0 if no, >0 if yes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function is_erasable() { + // phpcs:enable global $conf; // We check if invoice is a temporary number (PROVxxxx) @@ -450,6 +451,7 @@ abstract class CommonInvoice extends CommonObject return $this->LibStatut($this->paye, $this->statut, $mode, $alreadypaid, $this->type); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of a status * @@ -460,9 +462,9 @@ abstract class CommonInvoice extends CommonObject * @param int $type Type invoice * @return string Label of status */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($paye, $status, $mode=0, $alreadypaid=-1, $type=0) { + // phpcs:enable global $langs; $langs->load('bills'); @@ -485,7 +487,7 @@ abstract class CommonInvoice extends CommonObject else return $langs->trans('Bill'.$prefix.'StatusPaid'); } } - if ($mode == 1) + elseif ($mode == 1) { $prefix='Short'; if (! $paye) @@ -503,7 +505,7 @@ abstract class CommonInvoice extends CommonObject else return $langs->trans('Bill'.$prefix.'StatusPaid'); } } - if ($mode == 2) + elseif ($mode == 2) { $prefix='Short'; if (! $paye) @@ -521,7 +523,7 @@ abstract class CommonInvoice extends CommonObject else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('Bill'.$prefix.'StatusPaid'); } } - if ($mode == 3) + elseif ($mode == 3) { $prefix='Short'; if (! $paye) @@ -539,7 +541,7 @@ abstract class CommonInvoice extends CommonObject else return img_picto($langs->trans('BillStatusPaid'),'statut6'); } } - if ($mode == 4) + elseif ($mode == 4) { $prefix=''; if (! $paye) @@ -557,7 +559,7 @@ abstract class CommonInvoice extends CommonObject else return img_picto($langs->trans('BillStatusPaid'),'statut6').' '.$langs->trans('BillStatusPaid'); } } - if ($mode == 5 || $mode == 6) + elseif ($mode == 5 || $mode == 6) { $prefix=''; if ($mode == 5) $prefix='Short'; @@ -582,6 +584,7 @@ abstract class CommonInvoice extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi une date limite de reglement de facture en fonction des * conditions de reglements de la facture et date de facturation @@ -589,9 +592,9 @@ abstract class CommonInvoice extends CommonObject * @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition. * @return date Date limite de reglement si ok, <0 si ko */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function calculate_date_lim_reglement($cond_reglement=0) { + // phpcs:enable if (! $cond_reglement) $cond_reglement=$this->cond_reglement_code; if (! $cond_reglement) $cond_reglement=$this->cond_reglement_id; diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index cd434791310..868712a31d0 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -167,17 +167,18 @@ class DoliDBMysqli extends DoliDB return $line; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Select a database + * Select a database * - * @param string $database Name of database - * @return boolean true if OK, false if KO + * @param string $database Name of database + * @return boolean true if OK, false if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_db($database) { + // phpcs:enable dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG); - return $this->db->select_db($database); + return $this->db->select_db($database); } @@ -286,44 +287,47 @@ class DoliDBMysqli extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la ligne courante (comme un objet) pour le curseur resultset * * @param mysqli_result $resultset Curseur de la requete voulue * @return object|null Object result line or null if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_object($resultset) { + // phpcs:enable // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_object($resultset)) { $resultset=$this->_results; } return $resultset->fetch_object(); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param mysqli_result $resultset Resultset of request * @return array|null Array or null if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_array($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } return $resultset->fetch_array(); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param mysqli_result $resultset Resultset of request * @return array|null|0 Array or null if KO or end of cursor or 0 if resultset is bool */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_row($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_bool($resultset)) { @@ -337,6 +341,7 @@ class DoliDBMysqli extends DoliDB } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return number of lines for result of a SELECT * @@ -344,14 +349,15 @@ class DoliDBMysqli extends DoliDB * @return int Nb of lines * @see affected_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function num_rows($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } return $resultset->num_rows; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * @@ -359,9 +365,9 @@ class DoliDBMysqli extends DoliDB * @return int Nombre de lignes * @see num_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function affected_rows($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } // mysql necessite un link de base pour cette fonction contrairement @@ -462,6 +468,7 @@ class DoliDBMysqli extends DoliDB } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get last ID after an insert INSERT * @@ -469,9 +476,9 @@ class DoliDBMysqli extends DoliDB * @param string $fieldid Field name * @return int|string Id of row */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function last_insert_id($tab,$fieldid='rowid') { + // phpcs:enable return $this->db->insert_id; } @@ -545,14 +552,15 @@ class DoliDBMysqli extends DoliDB } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return connexion ID * * @return string Id connexion */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLGetConnectId() { + // phpcs:enable $resql=$this->query('SELECT CONNECTION_ID()'); if ($resql) { @@ -562,8 +570,9 @@ class DoliDBMysqli extends DoliDB else return '?'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Create a new database + * Create a new database * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated * We force to create database with charset this->forcecharset and collate this->forcecollate * @@ -573,9 +582,9 @@ class DoliDBMysqli extends DoliDB * @param string $owner Username of database owner * @return bool|mysqli_result resource defined if OK, null if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateDb($database,$charset='',$collation='',$owner='') { + // phpcs:enable if (empty($charset)) $charset=$this->forcecharset; if (empty($collation)) $collation=$this->forcecollate; @@ -595,6 +604,7 @@ class DoliDBMysqli extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List tables into a database * @@ -602,9 +612,9 @@ class DoliDBMysqli extends DoliDB * @param string $table Nmae of table filter ('xxx%') * @return array List of tables in an array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLListTables($database, $table='') { + // phpcs:enable $listtables=array(); $like = ''; @@ -622,15 +632,16 @@ class DoliDBMysqli extends DoliDB return $listtables; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List information of columns into a table. * * @param string $table Name of table * @return array Tableau des informations des champs de la table */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLInfoTable($table) { + // phpcs:enable $infotables=array(); $sql="SHOW FULL COLUMNS FROM ".$table.";"; @@ -647,6 +658,7 @@ class DoliDBMysqli extends DoliDB return $infotables; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a table into database * @@ -659,9 +671,9 @@ class DoliDBMysqli extends DoliDB * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) { + // phpcs:enable // FIXME: $fulltext_keys parameter is unused // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra @@ -730,16 +742,17 @@ class DoliDBMysqli extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Drop a table into database + * Drop a table into database * * @param string $table Name of table * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropTable($table) { - $sql = "DROP TABLE ".$table; + // phpcs:enable + $sql = "DROP TABLE ".$table; if (! $this->query($sql)) return -1; @@ -747,6 +760,7 @@ class DoliDBMysqli extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a pointer of line with description of a table or field * @@ -754,9 +768,9 @@ class DoliDBMysqli extends DoliDB * @param string $field Optionnel : Name of field if we want description of field * @return bool|mysqli_result Resultset x (x->Field, x->Type, ...) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDescTable($table,$field="") { + // phpcs:enable $sql="DESC ".$table." ".$field; dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG); @@ -764,6 +778,7 @@ class DoliDBMysqli extends DoliDB return $this->_results; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new field into table * @@ -773,9 +788,9 @@ class DoliDBMysqli extends DoliDB * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLAddField($table,$field_name,$field_desc,$field_position="") { + // phpcs:enable // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); $sql= "ALTER TABLE ".$table." ADD ".$field_name." "; @@ -815,6 +830,7 @@ class DoliDBMysqli extends DoliDB return -1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update format of a field into a table * @@ -823,9 +839,9 @@ class DoliDBMysqli extends DoliDB * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLUpdateField($table,$field_name,$field_desc) { + // phpcs:enable $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { @@ -861,6 +877,7 @@ class DoliDBMysqli extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a field from table * @@ -868,19 +885,20 @@ class DoliDBMysqli extends DoliDB * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropField($table,$field_name) { + // phpcs:enable $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG); if ($this->query($sql)) { return 1; } - $this->error=$this->lasterror(); - return -1; + $this->error=$this->lasterror(); + return -1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a user and privileges to connect to database (even if database does not exists yet) * @@ -890,9 +908,9 @@ class DoliDBMysqli extends DoliDB * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) { + // phpcs:enable $sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."'"; dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log $resql=$this->query($sql); diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index 07bb84ef5d6..d8fbe92c2c7 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -39,16 +39,17 @@ abstract class ModeleDon extends CommonDocGenerator */ public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * - * @param DoliDB $db Database handler - * @param integer $maxfilenamelength Max length of value to show + * @param DoliDB $db Database handler + * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='donation'; diff --git a/htdocs/core/modules/export/export_csv.modules.php b/htdocs/core/modules/export/export_csv.modules.php index a0f8f0df543..c3dfc84f94c 100644 --- a/htdocs/core/modules/export/export_csv.modules.php +++ b/htdocs/core/modules/export/export_csv.modules.php @@ -149,6 +149,7 @@ class ExportCsv extends ModeleExports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Open output file * @@ -156,9 +157,9 @@ class ExportCsv extends ModeleExports * @param Translate $outputlangs Output language object * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function open_file($file,$outputlangs) { + // phpcs:enable global $langs; dol_syslog("ExportCsv::open_file file=".$file); @@ -177,19 +178,21 @@ class ExportCsv extends ModeleExports return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output header into file * * @param Translate $outputlangs Output language object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_header($outputlangs) { + // phpcs:enable return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output title line into file * @@ -199,9 +202,9 @@ class ExportCsv extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs,$array_types) { + // phpcs:enable global $conf; if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET)) @@ -225,7 +228,8 @@ class ExportCsv extends ModeleExports } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Output record line into file * * @param array $array_selected_sorted Array with list of field to export @@ -234,9 +238,9 @@ class ExportCsv extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_record($array_selected_sorted,$objp,$outputlangs,$array_types) { + // phpcs:enable global $conf; if (! empty($conf->global->EXPORT_CSV_FORCE_CHARSET)) @@ -278,26 +282,28 @@ class ExportCsv extends ModeleExports return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output footer into file * * @param Translate $outputlangs Output language object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_footer($outputlangs) { + // phpcs:enable return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close file handle * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function close_file() { + // phpcs:enable fclose($this->handle); return 0; } diff --git a/htdocs/core/modules/holiday/modules_holiday.php b/htdocs/core/modules/holiday/modules_holiday.php index 160c84b84db..07234c447e6 100644 --- a/htdocs/core/modules/holiday/modules_holiday.php +++ b/htdocs/core/modules/holiday/modules_holiday.php @@ -44,16 +44,17 @@ abstract class ModelePDFHoliday extends CommonDocGenerator public $error=''; - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Return list of active generation modules * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db, $maxfilenamelength=0) { + // phpcs:enable global $conf; $type = 'holiday'; diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/livraison/modules_livraison.php index ab38adb46af..f9f7a5380f3 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/livraison/modules_livraison.php @@ -41,6 +41,7 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator */ public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -48,9 +49,9 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='delivery'; diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 3a6484f37bb..4f6f3c4ecdb 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -29,12 +29,12 @@ class mailing_thirdparties_services_expired extends MailingTargets var $require_module=array('contrat'); var $picto='company'; - + /** * @var DoliDB Database handler. */ public $db; - + var $arrayofproducts=array(); @@ -78,6 +78,7 @@ class mailing_thirdparties_services_expired extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This is the main function that returns the array of emails * @@ -85,9 +86,9 @@ class mailing_thirdparties_services_expired extends MailingTargets * @param array $filtersarray If you used the formFilter function. Empty otherwise. * @return int <0 if error, number of emails added if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id,$filtersarray=array()) { + // phpcs:enable $target = array(); // ----- Your code start here ----- diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php index 3053230a6a9..e6a688e97e8 100644 --- a/htdocs/core/modules/project/modules_project.php +++ b/htdocs/core/modules/project/modules_project.php @@ -37,16 +37,17 @@ abstract class ModelePDFProjects extends CommonDocGenerator public $error=''; - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Return list of active generation modules * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='project'; diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php index 1f0593e3083..60612e90259 100644 --- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php +++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php @@ -143,6 +143,7 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la reference de commande suivante non utilisee * @@ -150,9 +151,9 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders * @param Object $object Object * @return string Texte descripif */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function commande_get_num($objsoc=0,$object='') { + // phpcs:enable return $this->getNextValue($objsoc,$object); } } diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 12d7f2c9391..4823e109658 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -196,6 +196,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build pdf onto disk * @@ -207,9 +208,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders * @param int $hideref Do not show ref * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs='',$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$hookmanager,$mysoc,$nblignes; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -705,6 +706,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show payments table * @@ -714,12 +716,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders * @param Translate $outputlangs Object langs for output * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _tableau_versements(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show miscellaneous information (payment mode, payment term, ...) * @@ -729,9 +732,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders * @param Translate $outputlangs Langs object * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _tableau_info(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable global $conf; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -784,6 +787,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders return $posy; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show total to pay * @@ -794,9 +798,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders * @param Translate $outputlangs Objet langs * @return int Position pour suite */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) { + // phpcs:enable global $conf,$mysoc; $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/user/modules_user.class.php b/htdocs/core/modules/user/modules_user.class.php index 8ba2b638c38..e7f071f01fd 100644 --- a/htdocs/core/modules/user/modules_user.class.php +++ b/htdocs/core/modules/user/modules_user.class.php @@ -44,6 +44,7 @@ abstract class ModelePDFUser extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -51,9 +52,9 @@ abstract class ModelePDFUser extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='user'; From e4afd4af0084c6d0599f58fd44154ffa45665e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 22:05:06 +0200 Subject: [PATCH 099/255] Create index.html --- htdocs/product/dynamic_price/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/product/dynamic_price/index.html diff --git a/htdocs/product/dynamic_price/index.html b/htdocs/product/dynamic_price/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/product/dynamic_price/index.html @@ -0,0 +1 @@ + From 2015268b7e0e0fb66311cd153cefddaa51657d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 22:06:24 +0200 Subject: [PATCH 100/255] Create index.html --- htdocs/product/dynamic_price/class/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 htdocs/product/dynamic_price/class/index.html diff --git a/htdocs/product/dynamic_price/class/index.html b/htdocs/product/dynamic_price/class/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/product/dynamic_price/class/index.html @@ -0,0 +1 @@ + From 7799774ca1a8ad287bbce9648e1e8d2bab362867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 22:52:55 +0200 Subject: [PATCH 101/255] move phpcs:ignore --- htdocs/compta/bank/class/account.class.php | 21 ++-- htdocs/core/class/html.formfile.class.php | 12 ++- .../class/html.formsocialcontrib.class.php | 9 +- htdocs/core/class/rssparser.class.php | 18 ++-- htdocs/core/db/sqlite3.class.php | 84 +++++++++------ .../core/modules/bank/doc/pdf_ban.modules.php | 3 +- .../contract/doc/pdf_strato.modules.php | 5 +- .../modules/contract/mod_contract_serpis.php | 5 +- .../expedition/doc/pdf_rouget.modules.php | 12 ++- .../doc/pdf_standard.modules.php | 5 +- .../modules/mailings/thirdparties.modules.php | 101 +++++++++--------- .../core/modules/payment/mod_payment_ant.php | 3 +- .../product/mod_codeproduct_elephant.php | 6 +- .../stock/doc/pdf_standard.modules.php | 3 +- .../core/modules/stock/modules_movement.php | 3 +- htdocs/core/modules/stock/modules_stock.php | 5 +- 16 files changed, 173 insertions(+), 122 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 515f0d1170f..d55b0f10253 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -294,6 +294,7 @@ class Account extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add a link between bank line record and its source * @@ -304,9 +305,9 @@ class Account extends CommonObject * @param string $type Type of link ('payment', 'company', 'member', ...) * @return int <0 if KO, id line if OK */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_url_line($line_id, $url_id, $url, $label, $type) { + // phpcs:enable $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url ("; $sql.= "fk_bank"; $sql.= ", url_id"; @@ -334,6 +335,7 @@ class Account extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * TODO Move this into AccountLine * Return array with links from llx_bank_url @@ -343,9 +345,9 @@ class Account extends CommonObject * @param string $type To search using type * @return array|-1 Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_url($fk_bank='', $url_id='', $type='') { + // phpcs:enable $lines = array(); // Check parameters @@ -784,15 +786,16 @@ class Account extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update BBAN (RIB) account fields * * @param User $user Object user making update * @return int <0 if KO, >0 if OK */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_bban(User $user = null) { + // phpcs:enable global $conf,$langs; // Clean parameters @@ -1071,6 +1074,7 @@ class Account extends CommonObject return $this->LibStatut($this->clos,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return label of given object status * @@ -1078,9 +1082,9 @@ class Account extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto * @return string Label */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut, $mode = 0) { + // phpcs:enable global $langs; $langs->load('banks'); @@ -1109,14 +1113,15 @@ class Account extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi si un compte peut etre supprimer ou non (sans mouvements) * * @return boolean vrai si peut etre supprime, faux sinon */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function can_be_deleted() { + // phpcs:enable $can_be_deleted=false; $sql = "SELECT COUNT(rowid) as nb"; @@ -1177,6 +1182,7 @@ class Account extends CommonObject return $solde; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * @@ -1184,9 +1190,9 @@ class Account extends CommonObject * @param int $filteraccountid To get info for a particular account id * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board(User $user, $filteraccountid = 0) { + // phpcs:enable global $conf, $langs; if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe @@ -1233,14 +1239,15 @@ class Account extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * @param int $filteraccountid To get info for a particular account id * @return int <0 if ko, >0 if ok */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board($filteraccountid = 0) { + // phpcs:enable global $user; if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index aea6acd6661..c1bc479fc73 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -58,6 +58,7 @@ class FormFile } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show form to upload a new file. * @@ -77,9 +78,9 @@ class FormFile * @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be) * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='', $sectiondir='') { + // phpcs:enable global $conf,$langs, $hookmanager; $hookmanager->initHooks(array('formfile')); @@ -231,6 +232,7 @@ class FormFile } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show the box with list of available documents for object * @@ -253,9 +255,9 @@ class FormFile * @return int <0 if KO, number of shown files if OK * @deprecated Use print xxx->showdocuments() instead. */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') { + // phpcs:enable $this->numoffiles=0; print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang); return $this->numoffiles; @@ -981,6 +983,7 @@ class FormFile } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show list of documents in $filearray (may be they are all in same directory but may not) * This also sync database if $upload_dir is defined. @@ -1010,9 +1013,9 @@ class FormFile * @return int <0 if KO, nb of files shown if OK * @see list_of_autoecmfiles */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0) { + // phpcs:enable global $user, $conf, $langs, $hookmanager; global $sortfield, $sortorder, $maxheightmini; global $dolibarr_main_url_root; @@ -1379,6 +1382,7 @@ class FormFile } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show list of documents in a directory * @@ -1397,9 +1401,9 @@ class FormFile * @return int <0 if KO, nb of files shown if OK * @see list_of_documents */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0) { + // phpcs:enable global $user, $conf, $langs, $form; global $sortfield, $sortorder; global $search_doc_ref; diff --git a/htdocs/core/class/html.formsocialcontrib.class.php b/htdocs/core/class/html.formsocialcontrib.class.php index 653fe4b74b6..99e36878390 100644 --- a/htdocs/core/class/html.formsocialcontrib.class.php +++ b/htdocs/core/class/html.formsocialcontrib.class.php @@ -31,7 +31,7 @@ class FormSocialContrib * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -48,9 +48,10 @@ class FormSocialContrib $this->db = $db; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return list of social contributions. - * Use mysoc->country_id or mysoc->country_code so they must be defined. + * Return list of social contributions. + * Use mysoc->country_id or mysoc->country_code so they must be defined. * * @param string $selected Preselected type * @param string $htmlname Name of field in form @@ -60,9 +61,9 @@ class FormSocialContrib * @param string $morecss Add more CSS on select * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1, $morecss='minwidth300') { + // phpcs:enable global $conf,$db,$langs,$user,$mysoc; if (empty($mysoc->country_id) && empty($mysoc->country_code)) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 9b6dc2eee7d..23e888de0fc 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -30,7 +30,7 @@ class RssParser * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -461,6 +461,7 @@ class RssParser + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Triggered when opened tag is found * @@ -469,9 +470,9 @@ class RssParser * @param array $attrs Attributes of tags * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function feed_start_element($p, $element, &$attrs) { + // phpcs:enable $el = $element = strtolower($element); $attrs = array_change_key_case($attrs, CASE_LOWER); @@ -582,6 +583,7 @@ class RssParser } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Triggered when CDATA is found * @@ -589,9 +591,9 @@ class RssParser * @param string $text Tag * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function feed_cdata($p, $text) { + // phpcs:enable if ($this->_format == 'atom' and $this->incontent) { $this->append_content($text); @@ -603,6 +605,7 @@ class RssParser } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Triggered when closed tag is found * @@ -610,9 +613,9 @@ class RssParser * @param string $el Tag * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function feed_end_element($p, $el) { + // phpcs:enable $el = strtolower($el); if ($el == 'item' or $el == 'entry') @@ -673,15 +676,16 @@ class RssParser $str1 .= $str2; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Enter description here ... * * @param string $text Text * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function append_content($text) { + // phpcs:enable if ( $this->initem ) { $this->concat($this->current_item[ $this->incontent ], $text); } @@ -759,7 +763,7 @@ function xml2php($xml) } //Let see if the new child is not in the array - if($tab==false && in_array($key,array_keys($array))) + if ($tab==false && in_array($key,array_keys($array))) { //If this element is already in the array we will create an indexed array $tmp = $array[$key]; @@ -783,7 +787,7 @@ function xml2php($xml) } - if($fils==0) + if ($fils==0) { return (string) $xml; } diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index b62a6b2474f..6babfd881d4 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -296,17 +296,18 @@ class DoliDBSqlite3 extends DoliDB return $line; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Select a database * * @param string $database Name of database * @return boolean true if OK, false if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_db($database) { + // phpcs:enable dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG); - // sqlite_select_db() does not exist + // sqlite_select_db() does not exist //return sqlite_select_db($this->db,$database); return true; } @@ -491,15 +492,16 @@ class DoliDBSqlite3 extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la ligne courante (comme un objet) pour le curseur resultset * * @param SQLite3Result $resultset Curseur de la requete voulue * @return false|object Object result line or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_object($resultset) { + // phpcs:enable // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_object($resultset)) { $resultset=$this->_results; } //return $resultset->fetch(PDO::FETCH_OBJ); @@ -511,15 +513,16 @@ class DoliDBSqlite3 extends DoliDB } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param SQLite3Result $resultset Resultset of request * @return false|array Array or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_array($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } //return $resultset->fetch(PDO::FETCH_ASSOC); @@ -527,15 +530,16 @@ class DoliDBSqlite3 extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param SQLite3Result $resultset Resultset of request * @return false|array Array or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_row($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_bool($resultset)) { @@ -549,6 +553,7 @@ class DoliDBSqlite3 extends DoliDB } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return number of lines for result of a SELECT * @@ -556,10 +561,10 @@ class DoliDBSqlite3 extends DoliDB * @return int Nb of lines * @see affected_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function num_rows($resultset) { - // FIXME: SQLite3Result does not have a queryString member + // phpcs:enable + // FIXME: SQLite3Result does not have a queryString member // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } @@ -569,6 +574,7 @@ class DoliDBSqlite3 extends DoliDB return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return number of lines for result of a SELECT * @@ -576,10 +582,10 @@ class DoliDBSqlite3 extends DoliDB * @return int Nb of lines * @see affected_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function affected_rows($resultset) { - // FIXME: SQLite3Result does not have a queryString member + // phpcs:enable + // FIXME: SQLite3Result does not have a queryString member // If resultset not provided, we take the last used by connexion if (! is_object($resultset)) { $resultset=$this->_results; } @@ -698,6 +704,7 @@ class DoliDBSqlite3 extends DoliDB } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get last ID after an insert INSERT * @@ -705,9 +712,9 @@ class DoliDBSqlite3 extends DoliDB * @param string $fieldid Field name * @return int Id of row */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function last_insert_id($tab,$fieldid='rowid') { + // phpcs:enable return $this->db->lastInsertRowId(); } @@ -780,18 +787,20 @@ class DoliDBSqlite3 extends DoliDB } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return connexion ID * * @return string Id connexion */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLGetConnectId() { + // phpcs:enable return '?'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new database * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated @@ -803,9 +812,9 @@ class DoliDBSqlite3 extends DoliDB * @param string $owner Username of database owner * @return SQLite3Result resource defined if OK, null if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateDb($database,$charset='',$collation='',$owner='') { + // phpcs:enable if (empty($charset)) $charset=$this->forcecharset; if (empty($collation)) $collation=$this->forcecollate; @@ -825,6 +834,7 @@ class DoliDBSqlite3 extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List tables into a database * @@ -832,9 +842,9 @@ class DoliDBSqlite3 extends DoliDB * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLListTables($database, $table='') { + // phpcs:enable $listtables=array(); $like = ''; @@ -852,16 +862,17 @@ class DoliDBSqlite3 extends DoliDB return $listtables; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * List information of columns into a table. + * List information of columns into a table. * * @param string $table Name of table * @return array Tableau des informations des champs de la table * TODO modify for sqlite */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLInfoTable($table) { + // phpcs:enable $infotables=array(); $sql="SHOW FULL COLUMNS FROM ".$table.";"; @@ -878,6 +889,7 @@ class DoliDBSqlite3 extends DoliDB return $infotables; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a table into database * @@ -890,10 +902,10 @@ class DoliDBSqlite3 extends DoliDB * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) { - // FIXME: $fulltext_keys parameter is unused + // phpcs:enable + // FIXME: $fulltext_keys parameter is unused // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); @@ -957,15 +969,16 @@ class DoliDBSqlite3 extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a table into database * * @param string $table Name of table * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropTable($table) { + // phpcs:enable $sql = "DROP TABLE ".$table; if (! $this->query($sql)) @@ -974,6 +987,7 @@ class DoliDBSqlite3 extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a pointer of line with description of a table or field * @@ -981,9 +995,9 @@ class DoliDBSqlite3 extends DoliDB * @param string $field Optionnel : Name of field if we want description of field * @return SQLite3Result Resource */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDescTable($table,$field="") { + // phpcs:enable $sql="DESC ".$table." ".$field; dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG); @@ -991,6 +1005,7 @@ class DoliDBSqlite3 extends DoliDB return $this->_results; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new field into table * @@ -1000,9 +1015,9 @@ class DoliDBSqlite3 extends DoliDB * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLAddField($table,$field_name,$field_desc,$field_position="") { + // phpcs:enable // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); $sql= "ALTER TABLE ".$table." ADD ".$field_name." "; @@ -1035,6 +1050,7 @@ class DoliDBSqlite3 extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update format of a field into a table * @@ -1043,9 +1059,9 @@ class DoliDBSqlite3 extends DoliDB * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLUpdateField($table,$field_name,$field_desc) { + // phpcs:enable $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { @@ -1058,6 +1074,7 @@ class DoliDBSqlite3 extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a field from table * @@ -1065,9 +1082,9 @@ class DoliDBSqlite3 extends DoliDB * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropField($table,$field_name) { + // phpcs:enable $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG); if (! $this->query($sql)) @@ -1079,8 +1096,9 @@ class DoliDBSqlite3 extends DoliDB } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Create a user and privileges to connect to database (even if database does not exists yet) + * Create a user and privileges to connect to database (even if database does not exists yet) * * @param string $dolibarr_main_db_host Ip serveur * @param string $dolibarr_main_db_user Nom user a creer @@ -1088,9 +1106,9 @@ class DoliDBSqlite3 extends DoliDB * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) { + // phpcs:enable $sql = "INSERT INTO user "; $sql.= "(Host,User,password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)"; $sql.= " VALUES ('".$this->escape($dolibarr_main_db_host)."','".$this->escape($dolibarr_main_db_user)."',password('".addslashes($dolibarr_main_db_pass)."')"; @@ -1312,6 +1330,7 @@ class DoliDBSqlite3 extends DoliDB } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * calc_daynr * @@ -1320,9 +1339,9 @@ class DoliDBSqlite3 extends DoliDB * @param int $day Day * @return int Formatted date */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private static function calc_daynr($year, $month, $day) { + // phpcs:enable $y = $year; if ($y == 0 && $month == 0) return 0; $num = (365* $y + 31 * ($month - 1) + $day); @@ -1335,6 +1354,7 @@ class DoliDBSqlite3 extends DoliDB return $num + floor($y / 4) - $temp; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * calc_weekday * @@ -1342,25 +1362,27 @@ class DoliDBSqlite3 extends DoliDB * @param bool $sunday_first_day_of_week ??? * @return int */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private static function calc_weekday($daynr, $sunday_first_day_of_week) { - $ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7); - return $ret; + // phpcs:enable + $ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7); + return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * calc_days_in_year * * @param string $year Year * @return int Nb of days in year */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private static function calc_days_in_year($year) { - return (($year & 3) == 0 && ($year%100 || ($year%400 == 0 && $year)) ? 366 : 365); + // phpcs:enable + return (($year & 3) == 0 && ($year%100 || ($year%400 == 0 && $year)) ? 366 : 365); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * calc_week * @@ -1371,9 +1393,9 @@ class DoliDBSqlite3 extends DoliDB * @param string $calc_year ??? * @return string ??? */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year) { + // phpcs:enable $daynr=self::calc_daynr($year,$month,$day); $first_daynr=self::calc_daynr($year,1,1); $monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 9143d87ea73..6ecdc3b34dc 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -85,6 +85,7 @@ class pdf_ban extends ModeleBankAccountDoc } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction generant le projet sur le disque * @@ -92,9 +93,9 @@ class pdf_ban extends ModeleBankAccountDoc * @param Translate $outputlangs Lang output object * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs) { + // phpcs:enable global $conf, $hookmanager, $langs, $user; if (! is_object($outputlangs)) $outputlangs=$langs; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 843d6df8afe..c7c393c96e3 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -159,7 +159,8 @@ class pdf_strato extends ModelePDFContract $this->posxdesc=$this->marge_gauche+1; } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Function to build pdf onto disk * * @param CommonObject $object Id of object to generate @@ -170,9 +171,9 @@ class pdf_strato extends ModelePDFContract * @param int $hideref Do not show ref * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$hookmanager,$mysoc; if (! is_object($outputlangs)) $outputlangs=$langs; diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php index beeabd6b140..ca7ba32184f 100644 --- a/htdocs/core/modules/contract/mod_contract_serpis.php +++ b/htdocs/core/modules/contract/mod_contract_serpis.php @@ -135,16 +135,17 @@ class mod_contract_serpis extends ModelNumRefContracts } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next value * * @param Societe $objsoc third party object - * @param Object $objforref contract object + * @param Object $objforref contract object * @return string Value if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function contract_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 65866306f06..8086667a4f5 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -36,17 +36,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_rouget extends ModelePdfExpedition { - /** + /** * @var DoliDb Database handler */ public $db; - /** + /** * @var string model name */ public $name; - /** + /** * @var string model description (short text) */ public $description; @@ -173,6 +173,7 @@ class pdf_rouget extends ModelePdfExpedition } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build pdf onto disk * @@ -184,9 +185,9 @@ class pdf_rouget extends ModelePdfExpedition * @param int $hideref Do not show ref * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$conf,$langs,$hookmanager; $object->fetch_thirdparty(); @@ -652,6 +653,7 @@ class pdf_rouget extends ModelePdfExpedition } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show total to pay * @@ -662,9 +664,9 @@ class pdf_rouget extends ModelePdfExpedition * @param Translate $outputlangs Objet langs * @return int Position pour suite */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) { + // phpcs:enable global $conf,$mysoc; $sign=1; diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 43c76a2c497..ec06221e5de 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -190,7 +190,8 @@ class pdf_standard extends ModeleExpenseReport } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Function to build pdf onto disk * * @param Object $object Object to generate @@ -201,9 +202,9 @@ class pdf_standard extends ModeleExpenseReport * @param int $hideref Do not show ref * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$db,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 7a0744e7c65..ad19264620a 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -31,7 +31,7 @@ class mailing_thirdparties extends MailingTargets var $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated var $picto='company'; - + /** * @var DoliDB Database handler. */ @@ -52,6 +52,7 @@ class mailing_thirdparties extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This is the main function that returns the array of emails * @@ -59,9 +60,9 @@ class mailing_thirdparties extends MailingTargets * @param array $filtersarray If you used the formFilter function. Empty otherwise. * @return int <0 if error, number of emails added if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function add_to_target($mailing_id,$filtersarray=array()) + function add_to_target($mailing_id, $filtersarray=array()) { + // phpcs:enable global $conf, $langs; $cibles = array(); @@ -96,53 +97,53 @@ class mailing_thirdparties extends MailingTargets $sql.= " AND c.rowid='".$this->db->escape($_POST['filter'])."'"; } - $addDescription= ""; - if (isset($_POST["filter_client"]) && $_POST["filter_client"] <> '-1') - { - $sql.= " AND s.client=" . $_POST["filter_client"]; - $addDescription= $langs->trans('ProspectCustomer')."="; - if ($_POST["filter_client"] == 0) - { - $addDescription.= $langs->trans('NorProspectNorCustomer'); - } - else if ($_POST["filter_client"] == 1) - { - $addDescription.= $langs->trans('Customer'); - } - else if ($_POST["filter_client"] == 2) - { - $addDescription.= $langs->trans('Prospect'); - } - else if ($_POST["filter_client"] == 3) - { - $addDescription.= $langs->trans('ProspectCustomer'); - } - else - { - $addDescription.= "Unknown status ".$_POST["filter_client"]; - } - } - if (isset($_POST["filter_status"])) - { - if (strlen($addDescription) > 0) - { - $addDescription.= ";"; - } - $addDescription.= $langs->trans("Status")."="; - if ($_POST["filter_status"] == '1') - { - $sql.= " AND s.status=1"; - $addDescription.= $langs->trans("Enabled"); - } - else - { - $sql.= " AND s.status=0"; - $addDescription.= $langs->trans("Disabled"); - } - } - $sql.= " ORDER BY email"; + $addDescription= ""; + if (isset($_POST["filter_client"]) && $_POST["filter_client"] <> '-1') + { + $sql.= " AND s.client=" . $_POST["filter_client"]; + $addDescription= $langs->trans('ProspectCustomer')."="; + if ($_POST["filter_client"] == 0) + { + $addDescription.= $langs->trans('NorProspectNorCustomer'); + } + elseif ($_POST["filter_client"] == 1) + { + $addDescription.= $langs->trans('Customer'); + } + elseif ($_POST["filter_client"] == 2) + { + $addDescription.= $langs->trans('Prospect'); + } + elseif ($_POST["filter_client"] == 3) + { + $addDescription.= $langs->trans('ProspectCustomer'); + } + else + { + $addDescription.= "Unknown status ".$_POST["filter_client"]; + } + } + if (isset($_POST["filter_status"])) + { + if (strlen($addDescription) > 0) + { + $addDescription.= ";"; + } + $addDescription.= $langs->trans("Status")."="; + if ($_POST["filter_status"] == '1') + { + $sql.= " AND s.status=1"; + $addDescription.= $langs->trans("Enabled"); + } + else + { + $sql.= " AND s.status=0"; + $addDescription.= $langs->trans("Disabled"); + } + } + $sql.= " ORDER BY email"; - // Stock recipients emails into targets table + // Stock recipients emails into targets table $result=$this->db->query($sql); if ($result) { @@ -313,7 +314,7 @@ class mailing_thirdparties extends MailingTargets } - /** + /** * Can include an URL link on each record provided by selector shown on target page. * * @param int $id ID diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php index 1bd19c5e43c..d059f0ccebc 100644 --- a/htdocs/core/modules/payment/mod_payment_ant.php +++ b/htdocs/core/modules/payment/mod_payment_ant.php @@ -124,6 +124,7 @@ class mod_payment_ant extends ModeleNumRefPayments } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -131,9 +132,9 @@ class mod_payment_ant extends ModeleNumRefPayments * @param string $objforref Object for number to search * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function commande_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index 3f8796927d9..f55595a63d5 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -198,14 +198,15 @@ class mod_codeproduct_elephant extends ModeleProductCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Check if mask/numbering use prefix * * @return int 0 or 1 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_prefixIsUsed() { + // phpcs:enable global $conf; $mask = $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT; @@ -274,6 +275,7 @@ class mod_codeproduct_elephant extends ModeleProductCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi si un code est pris ou non (par autre tiers) * @@ -282,9 +284,9 @@ class mod_codeproduct_elephant extends ModeleProductCode * @param Product $product Objet product * @return int 0 if available, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_dispo($db, $code, $product) { + // phpcs:enable $sql = "SELECT ref FROM ".MAIN_DB_PREFIX."product"; $sql.= " WHERE ref = '".$code."'"; if ($product->id > 0) $sql.= " AND rowid <> ".$product->id; diff --git a/htdocs/core/modules/stock/doc/pdf_standard.modules.php b/htdocs/core/modules/stock/doc/pdf_standard.modules.php index a9a55e75cfc..66799612d8f 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard.modules.php @@ -146,6 +146,7 @@ class pdf_standard extends ModelePDFStock } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -157,9 +158,9 @@ class pdf_standard extends ModelePDFStock * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$db,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; diff --git a/htdocs/core/modules/stock/modules_movement.php b/htdocs/core/modules/stock/modules_movement.php index e6a3f0dcf03..33672e415ea 100644 --- a/htdocs/core/modules/stock/modules_movement.php +++ b/htdocs/core/modules/stock/modules_movement.php @@ -36,6 +36,7 @@ abstract class ModelePDFMovement extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -43,9 +44,9 @@ abstract class ModelePDFMovement extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='mouvement'; diff --git a/htdocs/core/modules/stock/modules_stock.php b/htdocs/core/modules/stock/modules_stock.php index 914facb4ed0..a74df6198ce 100644 --- a/htdocs/core/modules/stock/modules_stock.php +++ b/htdocs/core/modules/stock/modules_stock.php @@ -29,16 +29,17 @@ abstract class ModelePDFStock extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='stock'; From ecc6c118a6f78da1fa4881fc540ae1cbcf24b2ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 23:26:37 +0200 Subject: [PATCH 102/255] move phpcs:ignore --- htdocs/core/class/dolgraph.class.php | 3 +- htdocs/core/class/html.formbarcode.class.php | 18 +++--- htdocs/core/db/mssql.class.php | 62 ++++++++++++------- .../core/modules/mailings/fraise.modules.php | 9 +-- .../doc/doc_generic_project_odt.modules.php | 27 +++++--- .../project/doc/pdf_beluga.modules.php | 3 +- .../modules/project/task/modules_task.php | 3 +- 7 files changed, 80 insertions(+), 45 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index f3d6041515c..28ab38bf56d 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -682,6 +682,7 @@ class DolGraph } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Build a graph onto disk using Artichow library and return img string to it * @@ -689,9 +690,9 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk * @return void */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function draw_artichow($file,$fileurl) { + // phpcs:enable global $artichow_defaultfont; dol_syslog(get_class($this)."::draw_artichow this->type=".join(',',$this->type)); diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 6780f01735a..bcc6e2646fc 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -32,17 +32,17 @@ class FormBarCode * @var DoliDB Database handler. */ public $db; - + /** - * @var string Error code (or message) - */ - public $error=''; + * @var string Error code (or message) + */ + public $error=''; /** - * Constructor + * Constructor * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler */ function __construct($db) { @@ -103,6 +103,7 @@ class FormBarCode return $select_encoder; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return form to select type of barcode * @@ -111,9 +112,9 @@ class FormBarCode * @param int $useempty Affiche valeur vide dans liste * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_barcode_type($selected='',$htmlname='barcodetype_id',$useempty=0) { + // phpcs:enable global $langs,$conf; $sql = "SELECT rowid, code, libelle"; @@ -163,6 +164,7 @@ class FormBarCode } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show form to select type of barcode * @@ -171,9 +173,9 @@ class FormBarCode * @param string $htmlname Nom du formulaire select * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_barcode_type($page, $selected='', $htmlname='barcodetype_id') { + // phpcs:enable global $langs,$conf; if ($htmlname != "none") { diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index 9561747caf3..dd1553ec12f 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -139,15 +139,16 @@ class DoliDBMssql extends DoliDB return $line; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Select a database * * @param string $database Name of database * @return boolean true if OK, false if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_db($database) { + // phpcs:enable return @mssql_select_db($database, $this->db); } @@ -460,49 +461,53 @@ class DoliDBMssql extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la ligne courante (comme un objet) pour le curseur resultset * * @param resource $resultset Curseur de la requete voulue * @return object|false Object result line or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_object($resultset) { + // phpcs:enable // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return mssql_fetch_object($resultset); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return array|false Array or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_array($resultset) { + // phpcs:enable // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return mssql_fetch_array($resultset); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return array|false Array or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_row($resultset) { + // phpcs:enable // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return @mssql_fetch_row($resultset); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return number of lines for result of a SELECT * @@ -510,14 +515,15 @@ class DoliDBMssql extends DoliDB * @return int Nb of lines * @see affected_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function num_rows($resultset) { + // phpcs:enable // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return mssql_num_rows($resultset); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * @@ -525,9 +531,9 @@ class DoliDBMssql extends DoliDB * @return int Nombre de lignes * @see num_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function affected_rows($resultset) { + // phpcs:enable // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_resource($resultset)) { $resultset=$this->_results; } // mssql necessite un link de base pour cette fonction contrairement @@ -645,6 +651,7 @@ class DoliDBMssql extends DoliDB } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get last ID after an insert INSERT * @@ -652,9 +659,9 @@ class DoliDBMssql extends DoliDB * @param string $fieldid Field name * @return int Id of row or -1 on error */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function last_insert_id($tab,$fieldid='rowid') { + // phpcs:enable $res = $this->query("SELECT @@IDENTITY as id"); if ($res && $data = $this->fetch_array($res)) { @@ -709,14 +716,15 @@ class DoliDBMssql extends DoliDB } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return connexion ID * * @return string Id connexion */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLGetConnectId() { + // phpcs:enable $resql=$this->query('SELECT CONNECTION_ID()'); if ($resql) { @@ -726,6 +734,7 @@ class DoliDBMssql extends DoliDB else return '?'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new database * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated @@ -737,9 +746,9 @@ class DoliDBMssql extends DoliDB * @param string $owner Username of database owner * @return false|resource|true resource defined if OK, false if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateDb($database,$charset='',$collation='',$owner='') { + // phpcs:enable /*if (empty($charset)) $charset=$this->forcecharset; if (empty($collation)) $collation=$this->forcecollate; */ @@ -763,6 +772,7 @@ class DoliDBMssql extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List tables into a database * @@ -770,22 +780,23 @@ class DoliDBMssql extends DoliDB * @param string $table Nmae of table filter ('xxx%') * @return array List of tables in an array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLListTables($database,$table='') { + // phpcs:enable $this->_results = mssql_list_tables($database, $this->db); return $this->_results; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List information of columns into a table. * * @param string $table Name of table * @return array Tableau des informations des champs de la table */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLInfoTable($table) { + // phpcs:enable // FIXME: Dummy method // TODO: Implement @@ -795,6 +806,7 @@ class DoliDBMssql extends DoliDB return $infotables; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a table into database * @@ -807,9 +819,9 @@ class DoliDBMssql extends DoliDB * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) { + // phpcs:enable // FIXME: $fulltext_keys parameter is unused // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra @@ -875,15 +887,16 @@ class DoliDBMssql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a table into database * * @param string $table Name of table * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropTable($table) { + // phpcs:enable $sql = "DROP TABLE ".$table; if (! $this->query($sql)) @@ -892,6 +905,7 @@ class DoliDBMssql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a pointer of line with description of a table or field * @@ -899,9 +913,9 @@ class DoliDBMssql extends DoliDB * @param string $field Optionnel : Name of field if we want description of field * @return false|resource|true Resource */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDescTable($table,$field="") { + // phpcs:enable $sql="DESC ".$table." ".$field; dol_syslog($sql); @@ -909,6 +923,7 @@ class DoliDBMssql extends DoliDB return $this->_results; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new field into table * @@ -918,9 +933,9 @@ class DoliDBMssql extends DoliDB * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLAddField($table,$field_name,$field_desc,$field_position="") { + // phpcs:enable // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); $sql= "ALTER TABLE ".$table." ADD ".$field_name." "; @@ -946,6 +961,7 @@ class DoliDBMssql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update format of a field into a table * @@ -954,9 +970,9 @@ class DoliDBMssql extends DoliDB * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLUpdateField($table,$field_name,$field_desc) { + // phpcs:enable $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { @@ -970,6 +986,7 @@ class DoliDBMssql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a field from table * @@ -977,9 +994,9 @@ class DoliDBMssql extends DoliDB * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropField($table,$field_name) { + // phpcs:enable $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; dol_syslog($sql,LOG_DEBUG); if (! $this->query($sql)) @@ -990,6 +1007,7 @@ class DoliDBMssql extends DoliDB else return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a user and privileges to connect to database (even if database does not exists yet) * @@ -999,10 +1017,10 @@ class DoliDBMssql extends DoliDB * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) { - $sql = "CREATE LOGIN ".$this->EscapeFieldName($dolibarr_main_db_user)." WITH PASSWORD='$dolibarr_main_db_pass'"; + // phpcs:enable + $sql = "CREATE LOGIN ".$this->EscapeFieldName($dolibarr_main_db_user)." WITH PASSWORD='$dolibarr_main_db_pass'"; dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log $resql=$this->query($sql); if (! $resql) @@ -1150,19 +1168,21 @@ class DoliDBMssql extends DoliDB return array(); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Escape a field name according to escape's syntax * * @param string $fieldname Field's name to escape * @return string field's name escaped */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function EscapeFieldName($fieldname) { + // phpcs:enable return "[".$fieldname."]"; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get information on field * @@ -1170,9 +1190,9 @@ class DoliDBMssql extends DoliDB * @param mixed $fields String for one field or array of string for multiple field * @return false|object */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetFieldInformation($table,$fields) { + // phpcs:enable $sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME"; if (is_array($fields)) { diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index ab0cca6e0d4..817de256a1d 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -53,7 +53,7 @@ class mailing_fraise extends MailingTargets */ function __construct($db) { - $this->db=$db; + $this->db = $db; } @@ -219,6 +219,7 @@ class mailing_fraise extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Ajoute destinataires dans table des cibles * @@ -226,9 +227,9 @@ class mailing_fraise extends MailingTargets * @param array $filtersarray Param to filter sql request. Deprecated. Should use $_POST instead. * @return int < 0 si erreur, nb ajout si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id,$filtersarray=array()) { + // phpcs:enable // Deprecation warning if ($filtersarray) { dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING); @@ -269,8 +270,8 @@ class mailing_fraise extends MailingTargets // Filter on type if ($_POST['filter_type']) $sql.= " AND ta.rowid='".$_POST['filter_type']."'"; // Filter on category - if ($_POST['filter_category']) $sql.= " AND c.rowid='".$_POST['filter_category']."'"; - $sql.= " ORDER BY a.email"; + if ($_POST['filter_category']) $sql.= " AND c.rowid='".$_POST['filter_category']."'"; + $sql.= " ORDER BY a.email"; //print $sql; // Add targets into table diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index c86f0186811..219b3821ce3 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -103,6 +103,7 @@ class doc_generic_project_odt extends ModelePDFProjects } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -111,9 +112,9 @@ class doc_generic_project_odt extends ModelePDFProjects * @param string $array_key Name of the key for return array * @return array Array of substitution */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_object($object,$outputlangs,$array_key='object') { + // phpcs:enable global $conf; $resarray=array( @@ -141,6 +142,7 @@ class doc_generic_project_odt extends ModelePDFProjects return $resarray; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -148,9 +150,9 @@ class doc_generic_project_odt extends ModelePDFProjects * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_tasks($task,$outputlangs) { + // phpcs:enable global $conf; $resarray = array( @@ -181,6 +183,7 @@ class doc_generic_project_odt extends ModelePDFProjects return $resarray; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -188,9 +191,9 @@ class doc_generic_project_odt extends ModelePDFProjects * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_project_contacts($contact,$outputlangs) { + // phpcs:enable global $conf; $pc='projcontacts_'; // prefix to avoid typos @@ -238,6 +241,7 @@ class doc_generic_project_odt extends ModelePDFProjects return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -245,9 +249,9 @@ class doc_generic_project_odt extends ModelePDFProjects * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_project_file($file,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -257,6 +261,7 @@ class doc_generic_project_odt extends ModelePDFProjects ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -264,9 +269,9 @@ class doc_generic_project_odt extends ModelePDFProjects * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_project_reference($refdetail,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -280,6 +285,7 @@ class doc_generic_project_odt extends ModelePDFProjects ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -287,9 +293,9 @@ class doc_generic_project_odt extends ModelePDFProjects * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_tasksressource($taskressource,$outputlangs) { + // phpcs:enable global $conf; //dol_syslog(get_class($this).'::get_substitutionarray_tasksressource taskressource='.var_export($taskressource,true),LOG_DEBUG); return array( @@ -303,6 +309,7 @@ class doc_generic_project_odt extends ModelePDFProjects ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -310,9 +317,9 @@ class doc_generic_project_odt extends ModelePDFProjects * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_taskstime($tasktime,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -331,6 +338,7 @@ class doc_generic_project_odt extends ModelePDFProjects ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -338,9 +346,9 @@ class doc_generic_project_odt extends ModelePDFProjects * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_task_file($file,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -440,6 +448,7 @@ class doc_generic_project_odt extends ModelePDFProjects return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -448,9 +457,9 @@ class doc_generic_project_odt extends ModelePDFProjects * @param string $srctemplatepath Full path of source filename for generator using a template file * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index f4542cac67b..d2a678047ab 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -110,6 +110,7 @@ class pdf_beluga extends ModelePDFProjects } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fonction generant le projet sur le disque * @@ -117,9 +118,9 @@ class pdf_beluga extends ModelePDFProjects * @param Translate $outputlangs Lang output object * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs) { + // phpcs:enable global $conf, $hookmanager, $langs, $user; $formproject=new FormProjets($this->db); diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php index 8857d4fbd81..c9d7aa52bf4 100644 --- a/htdocs/core/modules/project/task/modules_task.php +++ b/htdocs/core/modules/project/task/modules_task.php @@ -38,6 +38,7 @@ abstract class ModelePDFTask extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * @@ -45,9 +46,9 @@ abstract class ModelePDFTask extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='project_task'; From aa74d2ac38cb398ce9ae3ea3ded9a1ea037035f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Sep 2018 23:53:37 +0200 Subject: [PATCH 103/255] Update api_agendaevents.class.php --- htdocs/comm/action/class/api_agendaevents.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index dedc515f61c..677e477cd89 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -219,7 +219,7 @@ class AgendaEvents extends DolibarrApi /** - * Update Agenda Event general fields (won't touch lines of expensereport) + * Update Agenda Event general fields * * @param int $id Id of Agenda Event to update * @param array $request_data Datas @@ -236,20 +236,20 @@ class AgendaEvents extends DolibarrApi throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } - $result = $this->expensereport->fetch($id); + $result = $this->actioncomm->fetch($id); if ( ! $result ) { - throw new RestException(404, 'expensereport not found'); + throw new RestException(404, 'actioncomm not found'); } - if ( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { + if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } foreach($request_data as $field => $value) { if ($field == 'id') continue; - $this->expensereport->$field = $value; + $this->actioncomm->$field = $value; } - if ($this->expensereport->update($id, DolibarrApiAccess::$user,1,'','','update')) + if ($this->actioncomm->update($id, DolibarrApiAccess::$user,1,'','','update')) return $this->get($id); return false; From 57be6a752e3c1a0682adfde92d7add31a081e9da Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 5 Sep 2018 10:00:33 +0200 Subject: [PATCH 104/255] Fix: Expedition not showing extrafields on creation --- htdocs/expedition/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 56744c08e44..26b2d729f82 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -9,7 +9,7 @@ * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2014-2017 Francis Appels * Copyright (C) 2015 Claudio Aschieri - * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2016 Yasser Carreón * * This program is free software; you can redistribute it and/or modify @@ -1041,7 +1041,7 @@ if ($action == 'create') if ($object->fetch_optionals() > 0) { $expe->array_options = array_merge($expe->array_options, $object->array_options); } - print $object->showOptionals($extrafields, 'edit'); + print $expe->showOptionals($extrafields, 'edit'); } From 38ca6096b2ce23bdcc5aa299ba57449f4ea079ff Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 5 Sep 2018 10:31:12 +0200 Subject: [PATCH 105/255] Standardize and update code --- htdocs/commande/class/commande.class.php | 3 ++ htdocs/compta/bank/class/account.class.php | 6 +++ htdocs/compta/bank/class/bankcateg.class.php | 5 ++- .../bank/class/paymentvarious.class.php | 3 ++ .../facture/class/facture-rec.class.php | 3 ++ htdocs/compta/facture/class/facture.class.php | 3 ++ .../compta/localtax/class/localtax.class.php | 19 +++++---- .../cheque/class/remisecheque.class.php | 9 +++-- .../compta/paiement/class/paiement.class.php | 40 +++++++++++-------- .../class/bonprelevement.class.php | 39 +++++++++--------- .../salaries/class/paymentsalary.class.php | 3 ++ .../sociales/class/chargesociales.class.php | 35 ++++++++-------- .../class/paymentsocialcontribution.class.php | 5 +++ htdocs/compta/tva/class/tva.class.php | 21 +++++----- 14 files changed, 122 insertions(+), 72 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6dc3bdc639d..6f525837648 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -64,6 +64,9 @@ class Commande extends CommonOrder */ public $fk_element = 'fk_commande'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'order'; /** diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 7681434bdfe..e66d6f73731 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -46,6 +46,9 @@ class Account extends CommonObject */ public $table_element = 'bank_account'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'account'; /** @@ -1664,6 +1667,9 @@ class AccountLine extends CommonObject */ public $table_element='bank'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'generic'; /** diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index 10bcd9a07c4..cc291c6be64 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -30,7 +30,10 @@ class BankCateg // extends CommonObject { //public $element='bank_categ'; //!< Id that identify managed objects //public $table_element='bank_categ'; //!< Name of table without prefix where object is stored - public $picto='generic'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='generic'; /** * @var int ID diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 3a6fe74ab37..f5271e40694 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -40,6 +40,9 @@ class PaymentVarious extends CommonObject */ public $table_element='payment_various'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'bill'; /** diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 012dac4a274..95fa81c9e7e 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -59,6 +59,9 @@ class FactureRec extends CommonInvoice */ public $fk_element='fk_facture'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='bill'; public $entity; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 498118c30fc..984e206ea66 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -73,6 +73,9 @@ class Facture extends CommonInvoice */ public $fk_element = 'fk_facture'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='bill'; /** diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 2b53770183d..45efdf69c83 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -39,22 +39,25 @@ class Localtax extends CommonObject */ public $table_element='localtax'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='payment'; - var $ltt; - var $tms; - var $datep; - var $datev; - var $amount; + public $ltt; + public $tms; + public $datep; + public $datev; + public $amount; /** * @var string local tax */ public $label; - var $fk_bank; - var $fk_user_creat; - var $fk_user_modif; + public $fk_bank; + public $fk_user_creat; + public $fk_user_modif; /** * Constructor diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index b28ca9dcb18..719c8cdcac8 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -43,12 +43,15 @@ class RemiseCheque extends CommonObject */ public $table_element='bordereau_cheque'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'payment'; - var $num; - var $intitule; + public $num; + public $intitule; //! Numero d'erreur Plage 1024-1279 - var $errno; + public $errno; public $amount; public $date_bordereau; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 1fd2ad8bbef..4e536e7ba6b 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -40,40 +40,46 @@ class Paiement extends CommonObject * @var string ID to identify managed object */ public $element='payment'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='paiement'; - - public $picto = 'payment'; - var $facid; - var $datepaye; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; + + public $facid; + public $datepaye; + /** * @deprecated * @see amount, amounts */ - var $total; + public $total; + /** * @deprecated * @see amount, amounts */ - var $montant; - var $amount; // Total amount of payment - var $amounts=array(); // Array of amounts - var $multicurrency_amounts=array(); // Array of amounts - var $author; - var $paiementid; // Type de paiement. Stocke dans fk_paiement + public $montant; + + public $amount; // Total amount of payment + public $amounts=array(); // Array of amounts + public $multicurrency_amounts=array(); // Array of amounts + public $author; + public $paiementid; // Type de paiement. Stocke dans fk_paiement // de llx_paiement qui est lie aux types de //paiement de llx_c_paiement - var $num_paiement; // Numero du CHQ, VIR, etc... - var $num_payment; // Numero du CHQ, VIR, etc... - var $bank_account; // Id compte bancaire du paiement - var $bank_line; // Id de la ligne d'ecriture bancaire + public $num_paiement; // Numero du CHQ, VIR, etc... + public $num_payment; // Numero du CHQ, VIR, etc... + public $bank_account; // Id compte bancaire du paiement + public $bank_line; // Id de la ligne d'ecriture bancaire // fk_paiement dans llx_paiement est l'id du type de paiement (7 pour CHQ, ...) // fk_paiement dans llx_paiement_facture est le rowid du paiement - var $fk_paiement; // Type of paiment + public $fk_paiement; // Type of paiment /** diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 7eba6afec29..29750d9d55d 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -43,33 +43,36 @@ class BonPrelevement extends CommonObject * @var string ID to identify managed object */ public $element='widthdraw'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='prelevement_bons'; - + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'payment'; - var $date_echeance; - var $raison_sociale; - var $reference_remise; - var $emetteur_code_guichet; - var $emetteur_numero_compte; - var $emetteur_code_banque; - var $emetteur_number_key; + public $date_echeance; + public $raison_sociale; + public $reference_remise; + public $emetteur_code_guichet; + public $emetteur_numero_compte; + public $emetteur_code_banque; + public $emetteur_number_key; - var $emetteur_iban; - var $emetteur_bic; - var $emetteur_ics; + public $emetteur_iban; + public $emetteur_bic; + public $emetteur_ics; - var $total; - var $_fetched; - var $statut; // 0-Wait, 1-Trans, 2-Done - var $labelstatut=array(); + public $total; + public $_fetched; + public $statut; // 0-Wait, 1-Trans, 2-Done + public $labelstatut=array(); - var $invoice_in_error=array(); - var $thirdparty_in_error=array(); + public $invoice_in_error=array(); + public $thirdparty_in_error=array(); /** diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 48877412d76..7c68b673ac1 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -41,6 +41,9 @@ class PaymentSalary extends CommonObject */ public $table_element='payment_salary'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='payment'; public $tms; diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index bad851450a7..1fe5d448d6e 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -36,33 +36,36 @@ class ChargeSociales extends CommonObject * @var string ID to identify managed object */ public $element='chargesociales'; - + public $table='chargesociales'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='chargesociales'; - - public $picto = 'bill'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'bill'; /** * {@inheritdoc} */ protected $table_ref_field = 'ref'; - var $date_ech; - var $lib; - var $type; - var $type_libelle; - var $amount; - var $paye; - var $periode; - var $date_creation; - var $date_modification; - var $date_validation; - var $fk_account; - var $fk_project; + public $date_ech; + public $lib; + public $type; + public $type_libelle; + public $amount; + public $paye; + public $periode; + public $date_creation; + public $date_modification; + public $date_validation; + public $fk_account; + public $fk_project; /** diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 4a989554b69..d66fb0e56c2 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -41,17 +41,22 @@ class PaymentSocialContribution extends CommonObject */ public $table_element='paiementcharge'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'payment'; public $fk_charge; public $datec=''; public $tms=''; public $datep=''; + /** * @deprecated * @see amount */ public $total; + public $amount; // Total amount of payment public $amounts=array(); // Array of amounts public $fk_typepaiement; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 6b1211cd1fc..7517ecbdbe8 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -43,23 +43,26 @@ class Tva extends CommonObject */ public $table_element='tva'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto='payment'; - var $tms; - var $datep; - var $datev; - var $amount; - var $type_payment; - var $num_payment; + public $tms; + public $datep; + public $datev; + public $amount; + public $type_payment; + public $num_payment; /** * @var string label */ public $label; - var $fk_bank; - var $fk_user_creat; - var $fk_user_modif; + public $fk_bank; + public $fk_user_creat; + public $fk_user_modif; /** * Constructor From 11d75573be67ef555f9806028c3c23e98835da67 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 5 Sep 2018 12:21:13 +0200 Subject: [PATCH 106/255] Standardize and update code --- htdocs/contact/class/contact.class.php | 10 ++++-- htdocs/contrat/class/contrat.class.php | 5 ++- .../interface_20_all_Logevents.class.php | 4 +++ ...e_20_modWorkflow_WorkflowManager.class.php | 4 +++ ...terface_50_modAgenda_ActionsAuto.class.php | 4 +++ ..._modBlockedlog_ActionsBlockedLog.class.php | 4 +++ ...interface_50_modLdap_Ldapsynchro.class.php | 4 +++ ...odMailmanspip_Mailmanspipsynchro.class.php | 4 +++ ..._50_modNotification_Notification.class.php | 6 +++- htdocs/cron/class/cronjob.class.php | 5 ++- htdocs/don/class/don.class.php | 6 +++- htdocs/don/class/paymentdonation.class.php | 5 ++- htdocs/ecm/class/ecmdirectory.class.php | 3 ++ htdocs/ecm/class/ecmfiles.class.php | 3 ++ htdocs/expedition/class/expedition.class.php | 4 +++ .../class/paymentexpensereport.class.php | 33 ++++++++++--------- htdocs/fichinter/class/fichinter.class.php | 3 ++ 17 files changed, 84 insertions(+), 23 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 4cd6fe81820..ddb9acfe39f 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -41,13 +41,17 @@ class Contact extends CommonObject * @var string ID to identify managed object */ public $element='contact'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='socpeople'; - + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'contact'; @@ -726,7 +730,7 @@ class Contact extends CommonObject $this->date_creation = $this->db->jdate($obj->date_creation); $this->date_modification = $this->db->jdate($obj->date_modification); - + $this->fk_departement = $obj->fk_departement; // deprecated $this->state_id = $obj->fk_departement; $this->departement_code = $obj->state_code; // deprecated diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 053d51905df..c64402777e7 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -61,7 +61,10 @@ class Contrat extends CommonObject */ public $fk_element='fk_contrat'; - public $picto='contract'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto='contract'; /** * 0=No test on entity, 1=Test with field entity, 2=Test with link by societe diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php index c08df837eb2..a8de26e713b 100644 --- a/htdocs/core/triggers/interface_20_all_Logevents.class.php +++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php @@ -31,7 +31,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; */ class InterfaceLogevents extends DolibarrTriggers { + /** + * @var string Image of the trigger + */ public $picto = 'technic'; + public $family = 'core'; public $description = "Triggers of this module allows to add security event records inside Dolibarr."; public $version = self::VERSION_DOLIBARR; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 4bd95caeb58..a719ef0b4fc 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -32,7 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; class InterfaceWorkflowManager extends DolibarrTriggers { + /** + * @var string Image of the trigger + */ public $picto = 'technic'; + public $family = 'core'; public $description = "Triggers of this module allows to manage workflows"; public $version = self::VERSION_DOLIBARR; diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 0c509a1d5b3..6994aa6f3e6 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -37,6 +37,10 @@ class InterfaceActionsAuto extends DolibarrTriggers public $family = 'agenda'; public $description = "Triggers of this module add actions in agenda according to setup made in agenda setup."; public $version = self::VERSION_DOLIBARR; + + /** + * @var string Image of the trigger + */ public $picto = 'action'; /** diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index a4ac9361a29..82e6b9e56eb 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -33,6 +33,10 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers public $family = 'system'; public $description = "Triggers of this module add action for BlockedLog module."; public $version = self::VERSION_DOLIBARR; + + /** + * @var string Image of the trigger + */ public $picto = 'technic'; /** diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 9ed11f41b97..376ed47c486 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -34,6 +34,10 @@ class InterfaceLdapsynchro extends DolibarrTriggers public $family = 'ldap'; public $description = "Triggers of this module allows to synchronize Dolibarr toward a LDAP database."; public $version = self::VERSION_DOLIBARR; + + /** + * @var string Image of the trigger + */ public $picto = 'technic'; /** diff --git a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php index ea3ae2c67aa..e551086f9e8 100644 --- a/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modMailmanspip_Mailmanspipsynchro.class.php @@ -32,6 +32,10 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers public $family = 'mailmanspip'; public $description = "Triggers of this module allows to synchronize Mailman an Spip."; public $version = self::VERSION_DOLIBARR; + + /** + * @var string Image of the trigger + */ public $picto = 'technic'; /** diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 8b4351499ce..0daf141a208 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -33,9 +33,13 @@ class InterfaceNotification extends DolibarrTriggers public $family = 'notification'; public $description = "Triggers of this module send email notifications according to Notification module setup."; public $version = self::VERSION_DOLIBARR; + + /** + * @var string Image of the trigger + */ public $picto = 'email'; - var $listofmanagedevents=array( + public $listofmanagedevents=array( 'BILL_VALIDATE', 'BILL_PAYED', 'ORDER_VALIDATE', diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index e18d918d56a..e1c49809f7c 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -40,7 +40,10 @@ class Cronjob extends CommonObject */ public $table_element='cronjob'; - public $picto = 'cron'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'cron'; /** * @var int Entity diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 8c4fca9d008..1ed604b56f2 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -50,7 +50,11 @@ class Don extends CommonObject public $fk_element = 'fk_donation'; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe - public $picto = 'generic'; + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'generic'; public $date; public $amount; diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index e85cb410cd5..c5a32cc3fd6 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -39,7 +39,10 @@ class PaymentDonation extends CommonObject */ public $table_element='payment_donation'; - public $picto = 'payment'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; /** * @var int ID diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 97885bf2430..a5cc091a336 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -37,6 +37,9 @@ class EcmDirectory // extends CommonObject */ //public $table_element='ecm_directories'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'dir'; /** diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index cf2d58c7ee5..2e441254acd 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -46,6 +46,9 @@ class EcmFiles extends CommonObject */ public $table_element = 'ecm_files'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'generic'; /** diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 4c337825822..bd8f5901d36 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -62,6 +62,10 @@ class Expedition extends CommonObject public $table_element_line="expeditiondet"; public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'sending'; public $socid; diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 0dceeae4808..522177c64b2 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -40,24 +40,27 @@ class PaymentExpenseReport extends CommonObject */ public $table_element='payment_expensereport'; - public $picto = 'payment'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ + public $picto = 'payment'; - var $rowid; + public $rowid; - var $fk_expensereport; - var $datec=''; - var $tms=''; - var $datep=''; - var $amount; // Total amount of payment - var $amounts=array(); // Array of amounts - var $fk_typepayment; - var $num_payment; - var $fk_bank; - var $fk_user_creat; - var $fk_user_modif; + public $fk_expensereport; + public $datec=''; + public $tms=''; + public $datep=''; + public $amount; // Total amount of payment + public $amounts=array(); // Array of amounts + public $fk_typepayment; + public $num_payment; + public $fk_bank; + public $fk_user_creat; + public $fk_user_modif; //Unknow field - var $chid; - var $total; + public $chid; + public $total; /** * Constructor diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index bce5f81c339..3029306d1f2 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -55,6 +55,9 @@ class Fichinter extends CommonObject */ public $table_element_line='fichinterdet'; + /** + * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png + */ public $picto = 'intervention'; /** From 51901108ad35879c0577537c88de969bc24d4a24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 14:26:12 +0200 Subject: [PATCH 107/255] FIX #9412 --- htdocs/contact/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 848535ce424..b60fdd8886b 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -307,7 +307,7 @@ if ($search_societe) $sql.= natural_search('s.nom', $search_socie if ($search_country) $sql .= " AND p.fk_pays IN (".$search_country.')'; if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_poste); if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso); -if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone); +if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone_pro); if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile); if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax); if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype); From 19431a94bafa4b31f1f9f0ad6e6c37e9cac07071 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 14:37:44 +0200 Subject: [PATCH 108/255] Code style --- htdocs/product/reassort.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 2e8dfcb36fa..7fd7ba813de 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -319,11 +319,12 @@ if ($resql) { $objp = $db->fetch_object($resql); - print ''; - print ''; + print ''; @@ -360,15 +361,13 @@ if ($resql) } } - - // Virtual stock if ($virtualdiffersfromphysical) { - print ''; + print $product->stock_theorique; + print ''; } print ''; print ''; From f1cb13634bb97d14582adcc3b1681fe87647a531 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 14:55:45 +0200 Subject: [PATCH 109/255] FIX Entering negative price on order --- htdocs/commande/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0fe49cf9f12..c10591b4e45 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -679,7 +679,7 @@ if (empty($reshook)) setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); $error++; } - if ($prod_entry_mode == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && (! ($price_ht_devise >= 0) || $price_ht_devise == '')) // Unit price can be 0 but not '' + if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '' && $price_ht_devise == '') // Unit price can be 0 but not ''. Also price can be negative for order. { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; From 3650dc3ec9562478446ae743713b1975723c74d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 15:25:47 +0200 Subject: [PATCH 110/255] FIX #8452 --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 3 +-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 2 +- .../core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index b19c35435e6..53327aa94cb 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -849,7 +849,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ab2c5120501..d258c6db4a2 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1079,7 +1079,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (! empty($object->remise)?$object->remise:0)), 0, $outputlangs), 0, 'R', 1); @@ -1304,7 +1304,6 @@ class pdf_crabe extends ModelePDFFactures } $pdf->SetTextColor(0,0,0); - $creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received $depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); //print "x".$creditnoteamount."-".$depositsamount;exit; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 53b79864063..ca463b9e3fc 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -68,7 +68,7 @@ class pdf_azur extends ModelePDFPropales function __construct($db) { global $conf,$langs,$mysoc; - + // Translations $langs->loadLangs(array("main", "bills")); @@ -1002,7 +1002,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0), 0, $outputlangs), 0, 'R', 1); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 37e0cf64f15..ab89756de38 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -591,7 +591,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + $object->remise), 0, 'R', 1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 9c99fb7f478..1645d649c23 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -763,7 +763,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($col1x, $tab2_top + 0); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - $total_ht = ($conf->multicurrency->enabled && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht); + $total_ht = (($conf->multicurrency->enabled && isset($object->mylticurrency_tx) && $object->mylticurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + 0); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1); From 056b0b26ccf86e2a498751604b989c23bd9a2f6c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Wed, 5 Sep 2018 15:39:04 +0200 Subject: [PATCH 111/255] fix : Public member variable _fetched must not be prefixed with an underscore --- htdocs/compta/prelevement/class/bonprelevement.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 29750d9d55d..acb9dcf2444 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -67,7 +67,7 @@ class BonPrelevement extends CommonObject public $emetteur_ics; public $total; - public $_fetched; + public $fetched; public $statut; // 0-Wait, 1-Trans, 2-Done public $labelstatut=array(); @@ -109,7 +109,7 @@ class BonPrelevement extends CommonObject $this->methodes_trans[0] = "Internet"; - $this->_fetched = 0; + $this->fetched = 0; } /** @@ -315,7 +315,7 @@ class BonPrelevement extends CommonObject $this->statut = $obj->statut; - $this->_fetched = 1; + $this->fetched = 1; return 1; } @@ -423,7 +423,7 @@ class BonPrelevement extends CommonObject $error = 0; - if ($this->_fetched == 1) + if ($this->fetched == 1) { if ($date >= $this->date_trans) { From cb89942bfbf267d7bbb93759d089eec4b156164b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 16:03:10 +0200 Subject: [PATCH 112/255] Add option capture on input file for photo --- htdocs/core/class/html.form.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 550ecea4867..27d7fe521fe 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6674,16 +6674,17 @@ class Form * @param string $imagesize 'mini', 'small' or '' (original) * @param int $addlinktofullsize Add link to fullsize image * @param int $cache 1=Accept to use image in cache + * @param string $forcecapture Force parameter capture on HTML input file element to ask a smartphone to allow to open camera to take photo. Auto if empty. * @return string HTML code to output photo */ - static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0) + static function showphoto($modulepart, $object, $width=100, $height=0, $caneditfield=0, $cssclass='photowithmargin', $imagesize='', $addlinktofullsize=1, $cache=0, $forcecapture='') { global $conf,$langs; $entity = (! empty($object->entity) ? $object->entity : $conf->entity); $id = (! empty($object->id) ? $object->id : $object->rowid); - $ret='';$dir='';$file='';$originalfile='';$altfile='';$email=''; + $ret='';$dir='';$file='';$originalfile='';$altfile='';$email='';$capture=''; if ($modulepart=='societe') { $dir=$conf->societe->multidir_output[$entity]; @@ -6707,6 +6708,7 @@ class Form $originalfile=get_exdir(0, 0, 0, 0, $object, 'contact').'/photos/'.$object->photo; } $email=$object->email; + $capture='user'; } else if ($modulepart=='userphoto') { @@ -6720,6 +6722,7 @@ class Form } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; + $capture='user'; } else if ($modulepart=='memberphoto') { @@ -6733,6 +6736,7 @@ class Form } if (! empty($conf->global->MAIN_OLD_IMAGE_LINKS)) $altfile=$object->id.".jpg"; // For backward compatibility $email=$object->email; + $capture='user'; } else { @@ -6749,6 +6753,8 @@ class Form $email=$object->email; } + if ($forcecapture) $capture = $forcecapture; + if ($dir) { if ($file && file_exists($dir."/".$file)) @@ -6805,7 +6811,7 @@ class Form if ($object->photo) $ret.="
    \n"; $ret.='
    '.$langs->trans("CsvOptions").''; - print $langs->trans("Separator").' : '; - print htmlentities($separator); - print '    '.$langs->trans("Enclosure").' : '; - print htmlentities($enclosure); + print $langs->trans("Separator").' : '.dol_escape_htmltag($separator); + print '    '.$langs->trans("Enclosure").' : '.dol_escape_htmltag($enclosure); print '
    '.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").'
    '; print ''; print ''; + print ''; print ''; print ''; print ''; @@ -570,6 +570,7 @@ if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titr if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],'d.rowid','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'],$_SERVER["PHP_SELF"],'d.civility','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.societe','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'],$_SERVER["PHP_SELF"],'d.login','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['d.morphy']['checked'])) print_liste_field_titre($arrayfields['d.morphy']['label'],$_SERVER["PHP_SELF"],'d.morphy','',$param,'',$sortfield,$sortorder); @@ -605,6 +606,7 @@ while ($i < min($num, $limit)) $datefin=$db->jdate($obj->datefin); $memberstatic->id=$obj->rowid; $memberstatic->ref=$obj->rowid; + $memberstatic->civility_id=$obj->civility; $memberstatic->lastname=$obj->lastname; $memberstatic->firstname=$obj->firstname; $memberstatic->statut=$obj->statut; @@ -648,6 +650,13 @@ while ($i < min($num, $limit)) print $obj->lastname; print ""; + print $obj->civility; + print "'; + print ''; @@ -438,11 +447,6 @@ if (! empty($arrayfields['d.lastname']['checked'])) print ''; print ''; - print ''; @@ -568,9 +572,9 @@ print "
    "; + print ""; print $memberstatic->getNomUrl(-1, 0, 'card', 'ref'); print ""; + print $obj->civility; + print ""; - print $obj->civility; - print "".$obj->login."".$obj->login."".$memberstatic->getmorphylib($obj->morphy)."".$memberstatic->getmorphylib($obj->morphy)."
    '.$langs->trans("HighlightLinesColor").''; @@ -837,6 +841,50 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); print ''; print '
    '.$langs->trans("HighlightLinesOnMouseHover").'global->THEME_ELDY_USE_HOVER?" checked":"").'> '.$langs->trans("UsePersonalValue").''; + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '
    '.$langs->trans("HighlightLinesChecked").''; + //print ''; + //print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + if ($edit) + { + if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color='ffefbb'; + else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED,array()),''); + print $formother->selectColor($color,'THEME_ELDY_USE_CHECKED','formcolor',1).' '; + } + else + { + if ($conf->global->THEME_ELDY_USE_CHECKED == '1') $color='ffefbb'; + else $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_USE_CHECKED,array()),''); + if ($color) + { + if ($color != 'ffefbb') print ''; + else print $langs->trans("Default"); + } + else print $langs->trans("None"); + } + print '   ('.$langs->trans("Default").': ffefbb) '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); + print ''; + print '
    '; if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print '
    '; $product=new Product($db); $product->fetch($objp->rowid); $product->load_stock(); + + print '
    '; print $product->getNomUrl(1,'',16); //if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow")); print ''; + print ''; if ($objp->seuil_stock_alerte != '' && ($product->stock_theorique < $objp->seuil_stock_alerte)) print img_warning($langs->trans("StockTooLow")).' '; - print $product->stock_theorique; - print ''.$langs->trans("Movements").''.$product->LibStatut($objp->statut,5,0).'
    '; if ($object->photo) $ret.=''; - $ret.=''; + $ret.=''; $ret.='
    '.$langs->trans("Delete").'

    '; } From 0bd4bc39dd028ce060bfa80ae55f7b2d5e0f91a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Sep 2018 16:03:43 +0200 Subject: [PATCH 113/255] Fix responsive --- htdocs/user/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index c1faacb14ef..6e1e80223f6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1005,7 +1005,7 @@ if ($action == 'create' || $action == 'adduserldap') } else { - print ''; + print ''; } print '
    '; print ''; - $var=false; print ''; - print ''; + print ''; print '
    '.$langs->trans("Parameter").''.$langs->trans("Value").'
    '.$langs->trans("MAIN_DISABLE_METEO").'' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '
    '.$langs->trans("MAIN_DISABLE_METEO").''; + print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (empty($conf->global->MAIN_DISABLE_METEO)?0:$conf->global->MAIN_DISABLE_METEO)); + print '
    '; } @@ -241,7 +249,9 @@ else print ''.$langs->trans("Parameter").''.$langs->trans("Value").''; print ''; - print ''.$langs->trans("MAIN_DISABLE_METEO").'' . yn($conf->global->MAIN_DISABLE_METEO) . ''; + print ''.$langs->trans("MAIN_DISABLE_METEO").''; + print $labelmeteo[$conf->global->MAIN_DISABLE_METEO]; + print ''; print ''; diff --git a/htdocs/index.php b/htdocs/index.php index bbdac41aad6..e8162dc95ea 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -358,7 +358,7 @@ print '
    '; /* * Dolibarr Working Board with weather */ -$showweather=empty($conf->global->MAIN_DISABLE_METEO)?1:0; +$showweather=(empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0; //Array that contains all WorkboardResponse classes to process them $dashboardlines=array(); @@ -536,7 +536,7 @@ $boxwork.=''."\n"; if ($showweather) { $boxwork.=''; - $boxwork.=''; + $boxwork.=''; $text=''; if ($totallate > 0) $text=$langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",$totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')'; else $text=$langs->transnoentitiesnoconv("NoItemLate"); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 16ca7cc7201..e9fd709f6dc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1809,3 +1809,4 @@ UseSearchToSelectResource=Use a search form to choose a resource (rather than a DisabledResourceLinkUser=Disable feature to link a resource to users DisabledResourceLinkContact=Disable feature to link a resource to contacts ConfirmUnactivation=Confirm module reset +OnMobileOnly=On small screen (smartphone) only \ No newline at end of file From da4e9026453367196c30d9ea160ba6d089f4f28f Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 6 Sep 2018 11:35:19 +0200 Subject: [PATCH 124/255] Fix error when delete stripe customer --- htdocs/societe/paymentmodes.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 89aad30e2f5..aabc9ae7bed 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -550,13 +550,17 @@ if (empty($reshook)) $db->begin(); + if (empty($newcu)) { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_account WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; + } else { $sql = 'UPDATE '.MAIN_DB_PREFIX."societe_account"; $sql.= " SET key_account = '".$db->escape(GETPOST('key_account', 'alpha'))."'"; $sql.= " WHERE site = 'stripe' AND fk_soc = ".$object->id." AND status = ".$servicestatus." AND entity = ".$conf->entity; // Keep = here for entity. Only 1 record must be modified ! - + } + $resql = $db->query($sql); $num = $db->num_rows($resql); - if (empty($num)) + if (empty($num) && !empty($newcu)) { $societeaccount = new SocieteAccount($db); $societeaccount->fk_soc = $object->id; From a5f4a74ecce4e0e8bcc6478289018ded2c4c7d4e Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 6 Sep 2018 14:49:48 +0200 Subject: [PATCH 125/255] FIX : Homepage links were using wrong topmenus --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/fourn/class/fournisseur.facture.class.php | 2 +- htdocs/index.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 7f26f3cdb53..1ebd9fedfd6 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3742,7 +3742,7 @@ class Facture extends CommonInvoice $response = new WorkboardResponse(); $response->warning_delay=$conf->facture->client->warning_delay/60/60/24; $response->label=$langs->trans("CustomerBillsUnpaid"); - $response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=customers_bills'; + $response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=billing&leftmenu=customers_bills'; $response->img=img_object('',"bill"); $generic_facture = new Facture($this->db); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 040bbb49bfa..7f5496094f7 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2080,7 +2080,7 @@ class FactureFournisseur extends CommonInvoice $response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24; $response->label=$langs->trans("SupplierBillsToPay"); - $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=suppliers_bills'; + $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=billing&leftmenu=suppliers_bills'; $response->img=img_object($langs->trans("Bills"),"bill"); $facturestatic = new FactureFournisseur($this->db); diff --git a/htdocs/index.php b/htdocs/index.php index 2843289c557..9ca5585d0ca 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -270,11 +270,11 @@ if (empty($user->societe_id)) DOL_URL_ROOT.'/product/list.php?type=1&mainmenu=products', DOL_URL_ROOT.'/comm/propal/list.php?mainmenu=commercial&leftmenu=propals', DOL_URL_ROOT.'/commande/list.php?mainmenu=commercial&leftmenu=orders', - DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=accountancy&leftmenu=customers_bills', + DOL_URL_ROOT.'/compta/facture/list.php?mainmenu=billing&leftmenu=customers_bills', DOL_URL_ROOT.'/contrat/list.php?mainmenu=commercial&leftmenu=contracts', DOL_URL_ROOT.'/fichinter/list.php?mainmenu=commercial&leftmenu=ficheinter', DOL_URL_ROOT.'/fourn/commande/list.php?mainmenu=commercial&leftmenu=orders_suppliers', - DOL_URL_ROOT.'/fourn/facture/list.php?mainmenu=accountancy&leftmenu=suppliers_bills', + DOL_URL_ROOT.'/fourn/facture/list.php?mainmenu=billing&leftmenu=suppliers_bills', DOL_URL_ROOT.'/supplier_proposal/list.php?mainmenu=commercial&leftmenu=', DOL_URL_ROOT.'/projet/list.php?mainmenu=project', DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&leftmenu=expensereport', From ff05997f0aee0f13092f41e006399ac26a2c1198 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 6 Sep 2018 17:37:02 +0200 Subject: [PATCH 126/255] FIX Several fixes on the management of minimal amount for orders --- htdocs/comm/card.php | 24 ++++++++++++------- htdocs/commande/card.php | 2 +- htdocs/fourn/card.php | 22 +++++++++-------- htdocs/fourn/commande/card.php | 2 +- htdocs/societe/list.php | 5 ++-- .../tpl/linesalesrepresentative.tpl.php | 4 ++-- 6 files changed, 33 insertions(+), 26 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 83db0e0f1d2..bc7ea0cd67d 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -181,7 +181,7 @@ if (empty($reshook)) if ($action == 'setorder_min_amount') { $object->fetch($id); - $object->order_min_amount=GETPOST('order_min_amount'); + $object->order_min_amount=price2num(GETPOST('order_min_amount','alpha')); $result=$object->update($object->id, $user); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } @@ -423,15 +423,21 @@ if ($object->id > 0) print ''; print ''; + } - print ''; - print ''; - print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer); - print ''; - print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : '')); - - print ''; - print ''; + if ($object->client) + { + if (! empty($conf->commande->enabled) && ! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) + { + print ''."\n"; + print ''; + print ''; + print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer); + print ''; + print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : '')); + print ''; + print ''; + } } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c10591b4e45..fff45f59bf5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2387,7 +2387,7 @@ if ($action == 'create' && $user->rights->commande->creer) // Total HT $alert = ''; - if($object->total_ht < $object->thirdparty->order_min_amount) { + if (! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->order_min_amount) { $alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount)); } print '' . $langs->trans('AmountHT') . ''; diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 906dbda4f6e..b295355bdc9 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -109,7 +109,7 @@ if (empty($reshook)) if ($action == 'setsupplier_order_min_amount') { $object->fetch($id); - $object->supplier_order_min_amount=GETPOST('supplier_order_min_amount'); + $object->supplier_order_min_amount=price2num(GETPOST('supplier_order_min_amount','alpha')); $result=$object->update($object->id, $user); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } @@ -298,15 +298,17 @@ if ($object->id > 0) print ''; print ''; - print ''; - print ''; - print $form->editfieldkey("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer); - print ''; - $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; - print $form->editfieldval("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->supplier_order_min_amount != '' ? price($object->supplier_order_min_amount) : '')); - - print ''; - print ''; + if (! empty($conf->fournisseur->enabled) && ! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)) + { + print ''; + print ''; + print $form->editfieldkey("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer); + print ''; + $limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount'; + print $form->editfieldval("OrderMinAmount",'supplier_order_min_amount',$object->supplier_order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->supplier_order_min_amount != '' ? price($object->supplier_order_min_amount) : '')); + print ''; + print ''; + } // Categories if (! empty($conf->categorie->enabled)) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index e1670e0c4d0..09310deb2fc 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2116,7 +2116,7 @@ elseif (! empty($object->id)) // Total $alert = ''; - if($object->total_ht < $object->thirdparty->supplier_order_min_amount) { + if (! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->supplier_order_min_amount) { $alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->supplier_order_min_amount)); } print ''.$langs->trans("AmountHT").''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 72071919a9b..8ea73b73884 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -424,11 +424,10 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region // We'll need this table joined to the select in order to filter by categ if (! empty($search_categ_cus)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ if (! empty($search_categ_sup)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ -$sql.= " ,".MAIN_DB_PREFIX."c_stcomm as st"; +$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id"; // We'll need this table joined to the select in order to filter by sale if ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE s.fk_stcomm = st.id"; -$sql.= " AND s.entity IN (".getEntity('societe').")"; +$sql.= " WHERE s.entity IN (".getEntity('societe').")"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 2f325f3001f..c2ea3d987a5 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -23,10 +23,10 @@ if (empty($conf) || ! is_object($conf)) } // Sale representative -print ''; +print ''; print $langs->trans('SalesRepresentatives'); print ''; -print ''; +print ''; $listsalesrepresentatives=$object->getSalesRepresentatives($user); $nbofsalesrepresentative=count($listsalesrepresentatives); From 3ecf78843870954e58d8431073e70d8d80b713be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 6 Sep 2018 18:29:01 +0200 Subject: [PATCH 127/255] move phpcs:ignore --- .../accountancy/class/bookkeeping.class.php | 16 ++++--- .../core/class/commondocgenerator.class.php | 45 ++++++++++++------- htdocs/core/class/html.formmail.class.php | 18 +++++--- htdocs/core/modules/action/rapport.pdf.php | 3 +- .../modules/commande/mod_commande_saphir.php | 5 ++- .../printsheet/doc/pdf_tcpdflabel.class.php | 3 +- .../task/doc/doc_generic_task_odt.modules.php | 27 +++++++---- .../project/task/mod_task_universal.php | 5 ++- 8 files changed, 78 insertions(+), 44 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index cacf9b0a641..00bf3c15dcb 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1553,15 +1553,16 @@ class BookKeeping extends CommonObject return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Export bookkeping * * @param string $model Model * @return int Result */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function export_bookkeping($model = 'ebp') { + // phpcs:enable global $conf; $sql = "SELECT rowid, doc_date, doc_type,"; @@ -1706,11 +1707,12 @@ class BookKeeping extends CommonObject */ } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of accounts with label by chart of accounts * - * @param string $selectid Preselected chart of accounts - * @param string $htmlname Name of field in html form + * @param string $selectid Preselected chart of accounts + * @param string $htmlname Name of field in html form * @param int $showempty Add an empty field * @param array $event Event options * @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1) @@ -1718,9 +1720,9 @@ class BookKeeping extends CommonObject * @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '') { + // phpcs:enable global $conf; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; @@ -1777,15 +1779,16 @@ class BookKeeping extends CommonObject return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Description of a root accounting account * * @param string $account Accounting account * @return string Root account */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_compte_racine($account = null) { + // phpcs:enable global $conf; $pcgver = $conf->global->CHARTOFACCOUNTS; @@ -1818,15 +1821,16 @@ class BookKeeping extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Description of accounting account * * @param string $account Accounting account * @return string Account desc */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_compte_desc($account = null) { + // phpcs:enable global $conf; $pcgver = $conf->global->CHARTOFACCOUNTS; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 5a1bcd8440d..a818bfe7a2f 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -48,6 +48,7 @@ abstract class CommonDocGenerator } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple subtitution key => subtitution value * @@ -55,9 +56,9 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_user($user,$outputlangs) { + // phpcs:enable global $conf; $logotouse=$conf->user->dir_output.'/'.get_exdir($user->id, 2, 0, 1, $user, 'user').'/'.$user->photo; @@ -85,6 +86,7 @@ abstract class CommonDocGenerator } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple subtitution key => subtitution value * @@ -92,9 +94,9 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_mysoc($mysoc,$outputlangs) { + // phpcs:enable global $conf; if (empty($mysoc->forme_juridique) && ! empty($mysoc->forme_juridique_code)) @@ -144,6 +146,7 @@ abstract class CommonDocGenerator } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple subtitution key => subtitution value * @@ -151,9 +154,9 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_thirdparty($object,$outputlangs) { + // phpcs:enable global $conf; if (empty($object->country) && ! empty($object->country_code)) @@ -224,6 +227,7 @@ abstract class CommonDocGenerator return $array_thirdparty; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple subtitution key => subtitution value * @@ -232,9 +236,9 @@ abstract class CommonDocGenerator * @param array_key $array_key Name of the key for return array * @return array of substitution key->code */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') { + // phpcs:enable global $conf; if(empty($object->country) && ! empty($object->country_code)) @@ -297,15 +301,16 @@ abstract class CommonDocGenerator } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple subtitution key => subtitution value * * @param Translate $outputlangs Language object for output * @return array Array of substitution key->code */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_other($outputlangs) { + // phpcs:enable global $conf; $now=dol_now('gmt'); // gmt @@ -334,6 +339,7 @@ abstract class CommonDocGenerator } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -342,9 +348,9 @@ abstract class CommonDocGenerator * @param string $array_key Name of the key for return array * @return array Array of substitution */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_object($object,$outputlangs,$array_key='object') { + // phpcs:enable global $conf; $sumpayed=$sumdeposit=$sumcreditnote=''; @@ -481,6 +487,7 @@ abstract class CommonDocGenerator return $resarray; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -488,9 +495,9 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_lines($line,$outputlangs) { + // phpcs:enable global $conf; $resarray= array( @@ -559,6 +566,7 @@ abstract class CommonDocGenerator return $resarray; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -567,9 +575,9 @@ abstract class CommonDocGenerator * @param array_key $array_key Name of the key for return array * @return array Array of substitution */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_shipment($object,$outputlangs,$array_key='object') { + // phpcs:enable global $conf; dol_include_once('/core/lib/product.lib.php'); $object->list_delivery_methods($object->shipping_method_id); @@ -621,6 +629,7 @@ abstract class CommonDocGenerator } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -628,10 +637,10 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Lang object to use for output * @return array Substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_shipment_lines($line, $outputlangs) { - global $conf; + // phpcs:enable + global $conf; dol_include_once('/core/lib/product.lib.php'); $resarray = array( @@ -668,6 +677,7 @@ abstract class CommonDocGenerator } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple subtitution key => subtitution value * @@ -676,17 +686,17 @@ abstract class CommonDocGenerator * @param boolean $recursive Want to fetch child array or child object * @return array Array of substitution key->code */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) { + // phpcs:enable $array_other = array(); - if(!empty($object)) { + if (!empty($object)) { foreach($object as $key => $value) { - if(!empty($value)) { - if(!is_array($value) && !is_object($value)) { + if (!empty($value)) { + if (!is_array($value) && !is_object($value)) { $array_other['object_'.$key] = $value; } - if(is_array($value) && $recursive){ + if (is_array($value) && $recursive) { $array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value,$outputlangs,false); } } @@ -696,6 +706,7 @@ abstract class CommonDocGenerator } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Fill array with couple extrafield key => extrafield value * @@ -706,9 +717,9 @@ abstract class CommonDocGenerator * @param Translate $outputlangs Lang object to use for output * @return array Substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function fill_substitutionarray_with_extrafields($object,$array_to_fill,$extrafields,$array_key,$outputlangs) + function fill_substitutionarray_with_extrafields($object,$array_to_fill,$extrafields,$array_key,$outputlangs) { + // phpcs:enable global $conf; foreach($extrafields->attribute_label as $key=>$label) { diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index cdc6a20ffa1..f648712e43c 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -136,14 +136,15 @@ class FormMail extends Form return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Clear list of attached files in send mail form (also stored in session) * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function clear_attached_files() { + // phpcs:enable global $conf,$user; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -158,6 +159,7 @@ class FormMail extends Form unset($_SESSION["listofmimes".$keytoavoidconflict]); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Add a file into the list of attached files (stored in SECTION array) * @@ -166,9 +168,9 @@ class FormMail extends Form * @param string $type Mime type (can be dol_mimetype($file)) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_attached_files($path, $file='', $type='') { + // phpcs:enable $listofpaths=array(); $listofnames=array(); $listofmimes=array(); @@ -191,15 +193,16 @@ class FormMail extends Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Remove a file from the list of attached files (stored in SECTION array) * * @param string $keytodelete Key in file array (0, 1, 2, ...) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function remove_attached_files($keytodelete) { + // phpcs:enable $listofpaths=array(); $listofnames=array(); $listofmimes=array(); @@ -220,14 +223,15 @@ class FormMail extends Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of attached files (stored in SECTION array) * * @return array array('paths'=> ,'names'=>, 'mimes'=> ) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_attached_files() { + // phpcs:enable $listofpaths=array(); $listofnames=array(); $listofmimes=array(); @@ -239,6 +243,7 @@ class FormMail extends Form return array('paths'=>$listofpaths, 'names'=>$listofnames, 'mimes'=>$listofmimes); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files @@ -248,12 +253,13 @@ class FormMail extends Form * @param string $removefileaction Name of action when removing file attachments * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function show_form($addfileaction='addfile',$removefileaction='removefile') { + // phpcs:enable print $this->get_form($addfileaction,$removefileaction); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files @@ -264,9 +270,9 @@ class FormMail extends Form * @param string $removefileaction Name of action when removing file attachments * @return string Form to show */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_form($addfileaction='addfile', $removefileaction='removefile') { + // phpcs:enable global $conf, $langs, $user, $hookmanager, $form; if (! is_object($form)) $form=new Form($this->db); diff --git a/htdocs/core/modules/action/rapport.pdf.php b/htdocs/core/modules/action/rapport.pdf.php index 8fb183a2446..ae7e6cd63c6 100644 --- a/htdocs/core/modules/action/rapport.pdf.php +++ b/htdocs/core/modules/action/rapport.pdf.php @@ -92,6 +92,7 @@ class CommActionRapport $this->subject=$langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Write the object to document file to disk * @@ -100,9 +101,9 @@ class CommActionRapport * @param Translate $outputlangs Lang object for output language * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($socid = 0, $catid = 0, $outputlangs='') { + // phpcs:enable global $user,$conf,$langs,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php index 21235229793..ae856072049 100644 --- a/htdocs/core/modules/commande/mod_commande_saphir.php +++ b/htdocs/core/modules/commande/mod_commande_saphir.php @@ -132,16 +132,17 @@ class mod_commande_saphir extends ModeleNumRefCommandes } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * * @param Societe $objsoc Object third party - * @param string $objforref Object for number to search + * @param string $objforref Object for number to search * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function commande_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index 659cb8e07f6..de1aa1b5d5e 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -266,6 +266,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build PDF on disk, then output on HTTP strem. * @@ -276,9 +277,9 @@ class pdf_tcpdflabel extends CommonStickerGenerator * @param string $filename Short file name of PDF output file * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir='',$filename='tmp_address_sheet.pdf') { + // phpcs:enable global $user,$conf,$langs,$mysoc,$_Avery_Labels; $this->code=$srctemplatepath; diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index b0d0d7d5069..5dcd7586472 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -104,6 +104,7 @@ class doc_generic_task_odt extends ModelePDFTask } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -112,9 +113,9 @@ class doc_generic_task_odt extends ModelePDFTask * @param string $array_key Name of the key for return array * @return array Array of substitution */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_object($object,$outputlangs,$array_key='object') { + // phpcs:enable global $conf; $resarray=array( @@ -148,6 +149,7 @@ class doc_generic_task_odt extends ModelePDFTask return $resarray; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -155,9 +157,9 @@ class doc_generic_task_odt extends ModelePDFTask * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_tasks($task,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -178,6 +180,7 @@ class doc_generic_task_odt extends ModelePDFTask ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -185,9 +188,9 @@ class doc_generic_task_odt extends ModelePDFTask * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_project_contacts($contact,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -202,6 +205,7 @@ class doc_generic_task_odt extends ModelePDFTask ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -209,9 +213,9 @@ class doc_generic_task_odt extends ModelePDFTask * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_project_file($file,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -221,6 +225,7 @@ class doc_generic_task_odt extends ModelePDFTask ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -228,9 +233,9 @@ class doc_generic_task_odt extends ModelePDFTask * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_project_reference($refdetail,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -244,6 +249,7 @@ class doc_generic_task_odt extends ModelePDFTask ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -251,9 +257,9 @@ class doc_generic_task_odt extends ModelePDFTask * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_tasksressource($taskressource,$outputlangs) { + // phpcs:enable global $conf; //dol_syslog(get_class($this).'::get_substitutionarray_tasksressource taskressource='.var_export($taskressource,true),LOG_DEBUG); return array( @@ -267,6 +273,7 @@ class doc_generic_task_odt extends ModelePDFTask ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -274,9 +281,9 @@ class doc_generic_task_odt extends ModelePDFTask * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_taskstime($tasktime,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -291,6 +298,7 @@ class doc_generic_task_odt extends ModelePDFTask ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define array with couple substitution key => substitution value * @@ -298,9 +306,9 @@ class doc_generic_task_odt extends ModelePDFTask * @param Translate $outputlangs Lang object to use for output * @return array Return a substitution array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_task_file($file,$outputlangs) { + // phpcs:enable global $conf; return array( @@ -400,6 +408,7 @@ class doc_generic_task_odt extends ModelePDFTask return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -408,9 +417,9 @@ class doc_generic_task_odt extends ModelePDFTask * @param string $srctemplatepath Full path of source filename for generator using a template file * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php index cc3175be159..6a6f90b1523 100644 --- a/htdocs/core/modules/project/task/mod_task_universal.php +++ b/htdocs/core/modules/project/task/mod_task_universal.php @@ -127,6 +127,7 @@ class mod_task_universal extends ModeleNumRefTask } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next reference not yet used as a reference * @@ -134,9 +135,9 @@ class mod_task_universal extends ModeleNumRefTask * @param Task $object Object task * @return string Next not used reference */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function project_get_num($objsoc=0,$object='') { - return $this->getNextValue($objsoc,$object); + // phpcs:enable + return $this->getNextValue($objsoc, $object); } } From cbf4a20a1322393fc4cac8767919fbe3cfbe8893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 6 Sep 2018 19:03:09 +0200 Subject: [PATCH 128/255] move phpcs:ignore --- .../bank/doc/pdf_sepamandate.modules.php | 13 ++++---- .../modules/commande/modules_commande.php | 9 +++--- .../livraison/doc/pdf_typhon.modules.php | 10 +++--- .../modules/printing/printgcp.modules.php | 31 ++++++++++--------- .../modules/societe/mod_codeclient_monkey.php | 6 ++-- .../societe/mod_codecompta_aquarium.php | 3 +- .../modules_facturefournisseur.php | 11 ++++--- .../doc/pdf_standard.modules.php | 8 +++-- .../doc/doc_generic_usergroup_odt.modules.php | 3 +- 9 files changed, 54 insertions(+), 40 deletions(-) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index 44a3ed233db..f7d0ce19f61 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -83,8 +83,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc } - /** - * Fonction generant le projet sur le disque + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Fonction generant le projet sur le disque * * @param Project $object Object project a generer * @param Translate $outputlangs Lang output object @@ -95,7 +96,6 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param null|array $moreparams More parameters * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) { global $conf, $hookmanager, $langs, $user, $mysoc; @@ -427,6 +427,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show miscellaneous information (payment mode, payment term, ...) * @@ -436,10 +437,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param Translate $outputlangs Langs object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _tableau_info(&$pdf, $object, $posy, $outputlangs) { - global $conf, $mysoc; + // phpcs:enable + global $conf, $mysoc; $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -472,7 +473,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param Translate $outputlangs Objet langs * @return int Position pour suite */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _signature_area(&$pdf, $object, $posy, $outputlangs) { $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php index e3a755fa523..1a4b732246d 100644 --- a/htdocs/core/modules/commande/modules_commande.php +++ b/htdocs/core/modules/commande/modules_commande.php @@ -44,16 +44,17 @@ abstract class ModelePDFCommandes extends CommonDocGenerator */ public $error=''; - /** - * Return list of active generation modules - * + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Return list of active generation modules + * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db, $maxfilenamelength=0) { + // phpcs:enable global $conf; $type = 'order'; diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 8705d985661..ae0dcb6a74f 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -174,7 +174,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Function to build pdf onto disk * * @param Object $object Object to generate @@ -184,10 +185,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder * @param int $hidedesc Do not show desc * @param int $hideref Do not show ref * @return int 1=OK, 0=KO - */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + */ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -630,6 +631,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show miscellaneous information (payment mode, payment term, ...) * @@ -639,9 +641,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder * @param Translate $outputlangs Langs object * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _tableau_info(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable global $conf,$mysoc; $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php index d0a1497c0a0..5b78a8d61c7 100644 --- a/htdocs/core/modules/printing/printgcp.modules.php +++ b/htdocs/core/modules/printing/printgcp.modules.php @@ -1,6 +1,6 @@ + * Copyright (C) 2014-2018 Frederic France * * 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 @@ -35,24 +35,24 @@ use OAuth\OAuth2\Service\Google; */ class printing_printgcp extends PrintingDriver { - var $name = 'printgcp'; - var $desc = 'PrintGCPDesc'; - var $picto = 'printer'; - var $active = 'PRINTING_PRINTGCP'; - var $conf = array(); - var $google_id = ''; - var $google_secret = ''; - + public $name = 'printgcp'; + public $desc = 'PrintGCPDesc'; + public $picto = 'printer'; + public $active = 'PRINTING_PRINTGCP'; + public $conf = array(); + public $google_id = ''; + public $google_secret = ''; + /** * @var string Error code (or message) */ public $error=''; - + /** * @var string[] Error codes (or messages) */ public $errors = array(); - + /** * @var DoliDB Database handler. */ @@ -227,14 +227,15 @@ class printing_printgcp extends PrintingDriver } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of available printers * * @return array list of printers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function getlist_available_printers() { + // phpcs:enable // Token storage $storage = new DoliStorage($this->db, $this->conf); // Setup the credentials for the requests @@ -292,6 +293,7 @@ class printing_printgcp extends PrintingDriver return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Print selected file * @@ -300,9 +302,9 @@ class printing_printgcp extends PrintingDriver * @param string $subdir subdir for file * @return int 0 if OK, >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function print_file($file, $module, $subdir='') { + // phpcs:enable require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; global $conf, $user; @@ -412,14 +414,15 @@ class printing_printgcp extends PrintingDriver } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List jobs print * * @return int 0 if OK, >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_jobs() { + // phpcs:enable global $conf, $db, $langs, $bc; $error = 0; diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index d9f65560705..eb7fb0184f4 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -210,6 +210,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi si un code est pris ou non (par autre tiers) * @@ -219,9 +220,9 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if available, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_dispo($db, $code, $soc, $type=0) { + // phpcs:enable global $conf, $mc; $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; @@ -250,15 +251,16 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi si un code respecte la syntaxe * * @param string $code Code a verifier * @return int 0 si OK, <0 si KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_syntax($code) { + // phpcs:enable $res = 0; if (dol_strlen($code) < 11) diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php index baf1978ceae..f6a2a08bee7 100644 --- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php +++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php @@ -107,6 +107,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set accountancy account code for a third party into this->code * @@ -115,9 +116,9 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode * @param string $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_code($db, $societe, $type='') { + // phpcs:enable global $conf; $i = 0; diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php index 3423c4b2547..064be2e1f41 100644 --- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php +++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php @@ -1,8 +1,8 @@ - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2016 Philippe Grand - * Copyright (C) 2014 Marcos García +/* Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2013-2016 Philippe Grand + * Copyright (C) 2014 Marcos García * * 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 @@ -40,6 +40,7 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation models * @@ -47,9 +48,9 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of numbers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db, $maxfilenamelength=0) { + // phpcs:enable global $conf; $type = 'invoice_supplier'; diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index fe225447e3b..5c409559491 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -176,7 +176,8 @@ class pdf_standard extends ModelePDFSuppliersPayments } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Function to build pdf onto disk * * @param PaiementFourn $object Id of object to generate @@ -187,9 +188,9 @@ class pdf_standard extends ModelePDFSuppliersPayments * @param int $hideref Do not show ref * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object, $outputlangs='', $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -513,6 +514,7 @@ class pdf_standard extends ModelePDFSuppliersPayments } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show total to pay * @@ -522,9 +524,9 @@ class pdf_standard extends ModelePDFSuppliersPayments * @param Translate $outputlangs Objet langs * @return int Position pour suite */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _tableau_cheque(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable global $conf,$mysoc; $default_font_size = pdf_getPDFFontSize($outputlangs); diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 100fa286763..887a4cda084 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -192,6 +192,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -203,9 +204,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) From 70ba223788856f9104d0dfde65bb822bd177ec0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 6 Sep 2018 21:27:18 +0200 Subject: [PATCH 129/255] move phpcs:ignore --- htdocs/core/class/html.formcompany.class.php | 44 +++++---- htdocs/core/class/smtps.class.php | 21 +++-- htdocs/core/db/pgsql.class.php | 93 ++++++++++++------- .../bank/doc/pdf_sepamandate.modules.php | 4 +- .../modules/commande/mod_commande_marbre.php | 5 +- .../modules/contract/mod_contract_magre.php | 5 +- .../modules/export/export_tsv.modules.php | 31 ++++--- .../fichinter/doc/pdf_soleil.modules.php | 3 +- htdocs/core/modules/import/modules_import.php | 9 +- .../modules/mailings/contacts1.modules.php | 5 +- .../core/modules/mailings/example.modules.php | 11 ++- .../core/modules/mailings/pomme.modules.php | 5 +- .../modules/printing/modules_printing.php | 4 +- .../modules/printing/printipp.modules.php | 46 ++++----- .../modules/printsheet/modules_labels.php | 10 +- .../modules/project/mod_project_simple.php | 5 +- .../modules/project/task/mod_task_simple.php | 10 +- .../societe/doc/doc_generic_odt.modules.php | 3 +- .../modules/societe/modules_societe.class.php | 33 ++++--- .../modules_supplier_proposal.php | 9 +- 20 files changed, 213 insertions(+), 143 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 78b06048ee4..5c39bc0cef4 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -35,7 +35,7 @@ class FormCompany * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -54,6 +54,7 @@ class FormCompany } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of labels (translated) of third parties type * @@ -61,9 +62,9 @@ class FormCompany * @param string $filter Add a SQL filter to select * @return array Array of types */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function typent_array($mode=0, $filter='') { + // phpcs:enable global $langs,$mysoc; $effs = array(); @@ -96,6 +97,7 @@ class FormCompany return $effs; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la liste des types d'effectifs possibles (pas de traduction car nombre) * @@ -103,9 +105,9 @@ class FormCompany * @param string $filter Add a SQL filter to select * @return array Array of types d'effectifs */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function effectif_array($mode=0, $filter='') { + // phpcs:enable $effs = array(); $sql = "SELECT id, code, libelle"; @@ -135,6 +137,7 @@ class FormCompany } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Affiche formulaire de selection des modes de reglement * @@ -144,9 +147,9 @@ class FormCompany * @param int $empty Add empty value in list * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0) { + // phpcs:enable global $user, $langs; print '
    '; @@ -185,6 +188,7 @@ class FormCompany print '
    '; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. @@ -197,12 +201,13 @@ class FormCompany * @param string $htmlname Id of department * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_departement($selected='',$country_codeid=0, $htmlname='state_id') { + // phpcs:enable print $this->select_state($selected,$country_codeid, $htmlname); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. @@ -216,9 +221,9 @@ class FormCompany * @return string String with HTML select * @see select_country */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_state($selected='',$country_codeid=0, $htmlname='state_id') { + // phpcs:enable global $conf,$langs,$user; dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid,LOG_DEBUG); @@ -318,6 +323,7 @@ class FormCompany } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des regions actives dont le pays est actif * La cle de la liste est le code (il peut y avoir plusieurs entree pour @@ -328,9 +334,9 @@ class FormCompany * @param string $htmlname Name of HTML select field * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_region($selected='',$htmlname='region_id') { + // phpcs:enable global $conf,$langs; $langs->load("dict"); @@ -385,6 +391,7 @@ class FormCompany } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return combo list with people title * @@ -393,9 +400,9 @@ class FormCompany * @param string $morecss Add more css on SELECT element * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100') { + // phpcs:enable global $conf,$langs,$user; $langs->load("dict"); @@ -442,6 +449,7 @@ class FormCompany return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays. @@ -453,12 +461,13 @@ class FormCompany * @deprecated Use print xxx->select_juridicalstatus instead * @see select_juridicalstatus() */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_forme_juridique($selected='', $country_codeid=0, $filter='') { + // phpcs:enable print $this->select_juridicalstatus($selected, $country_codeid, $filter); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays @@ -469,9 +478,9 @@ class FormCompany * @param string $htmlname HTML name of select * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code') { + // phpcs:enable global $conf,$langs,$user; $langs->load("dict"); @@ -754,6 +763,7 @@ class FormCompany } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a select list with zip codes and their town * @@ -766,9 +776,9 @@ class FormCompany * @param string $morecss More css * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='') { + // phpcs:enable global $conf; $out=''; @@ -786,6 +796,7 @@ class FormCompany return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML string to use as input of professional id into a HTML page (siren, siret, etc...) * @@ -796,9 +807,9 @@ class FormCompany * @param string $morecss More css * @return string HTML string with prof id */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_input_id_prof($idprof,$htmlname,$preselected,$country_code,$morecss='maxwidth100onsmartphone quatrevingtpercent') { + // phpcs:enable global $conf,$langs; $formlength=0; @@ -837,6 +848,7 @@ class FormCompany return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a HTML select with localtax values for thirdparties * @@ -845,13 +857,13 @@ class FormCompany * @param string $htmlname HTML select name * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_localtax($local, $selected, $htmlname) { - $tax=get_localtax_by_third($local); + // phpcs:enable + $tax=get_localtax_by_third($local); - $num = $this->db->num_rows($tax); - $i = 0; + $num = $this->db->num_rows($tax); + $i = 0; if ($num) { $valors=explode(":", $tax); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 2481e9b457b..113f5a6f278 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -344,14 +344,15 @@ class SMTPs $_aryToList = $this->getTO(); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Attempt a connection to mail server * * @return mixed $_retVal Boolean indicating success or failure on connection */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _server_connect() { + // phpcs:enable // Default return value $_retVal = true; @@ -407,14 +408,15 @@ class SMTPs return $_retVal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Attempt mail server authentication for a secure connection * * @return boolean|null $_retVal Boolean indicating success or failure of authentication */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _server_authenticate() { + // phpcs:enable global $conf; // Send the RFC2554 specified EHLO. @@ -1038,6 +1040,7 @@ class SMTPs $this->_msgRecipients = $aryHost; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array of the various parts of an email address * This assumes a well formed address: @@ -1054,9 +1057,9 @@ class SMTPs * @param string $_strAddr Email address * @return array An array of the various parts of an email address */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _strip_email($_strAddr) { + // phpcs:enable // Keep the orginal $_aryEmail['org'] = $_strAddr; @@ -1090,6 +1093,7 @@ class SMTPs return $_aryEmail; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array of bares addresses for use with 'RCPT TO:' * This is a "build as you go" method. Each time this method is called @@ -1097,9 +1101,9 @@ class SMTPs * * @return array Returns an array of bares addresses */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_RCPT_list() { + // phpcs:enable /** * An array of bares addresses for use with 'RCPT TO:' */ @@ -1121,15 +1125,16 @@ class SMTPs return $_RCPT_list; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array of addresses for a specific type; TO, CC or BCC * * @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc') * @return string|false Array of emaill address */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_email_list($_which = null) { + // phpcs:enable // We need to know which address segment to pull if ( $_which ) { @@ -1750,6 +1755,7 @@ class SMTPs else if ($type == 'alternative') return $this->_smtpsAlternativeBoundary; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This function has been modified as provided by SirSir to allow multiline responses when * using SMTP Extensions @@ -1758,9 +1764,9 @@ class SMTPs * @param string $response Response. Example: "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3" * @return boolean True or false */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function server_parse($socket, $response) { + // phpcs:enable /** * Returns constructed SELECT Object string or boolean upon failure * Default value is set at true @@ -1792,6 +1798,7 @@ class SMTPs return $_retVal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Send str * @@ -1800,9 +1807,9 @@ class SMTPs * @param string $CRLF CRLF * @return boolean|null True or false */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" ) { + // phpcs:enable if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log fputs($this->socket, $_strSend . $CRLF); if ($this->_debug) $this->log.=' ('.$_returnCode.')' . $CRLF; diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index be6bb0888d2..78a3b91279e 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -359,20 +359,24 @@ class DoliDBPgsql extends DoliDB return $line; } - /** - * Select a database + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Select a database * Ici postgresql n'a aucune fonction equivalente de mysql_select_db * On compare juste manuellement si la database choisie est bien celle activee par la connexion * * @param string $database Name of database * @return bool true if OK, false if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_db($database) { - if ($database == $this->database_name) return true; - else return false; - } + // phpcs:enable + if ($database == $this->database_name) { + return true; + } else { + return false; + } + } /** * Connexion to server @@ -541,63 +545,68 @@ class DoliDBPgsql extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la ligne courante (comme un objet) pour le curseur resultset * * @param resource $resultset Curseur de la requete voulue * @return false|object Object result line or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_object($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return pg_fetch_object($resultset); } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Return datas as an array * * @param resource $resultset Resultset of request * @return false|array Array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_array($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return pg_fetch_array($resultset); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return false|array Array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_row($resultset) { + // phpcs:enable // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return pg_fetch_row($resultset); } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Return number of lines for result of a SELECT * * @param resourse $resultset Resulset of requests * @return int Nb of lines, -1 on error * @see affected_rows - */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + */ function num_rows($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return pg_num_rows($resultset); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * @@ -605,9 +614,9 @@ class DoliDBPgsql extends DoliDB * @return int Nb of lines * @see num_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function affected_rows($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_resource($resultset)) { $resultset=$this->_results; } // pgsql necessite un resultset pour cette fonction contrairement @@ -760,6 +769,7 @@ class DoliDBPgsql extends DoliDB return pg_last_error($this->db); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get last ID after an insert INSERT * @@ -767,9 +777,9 @@ class DoliDBPgsql extends DoliDB * @param string $fieldid Field name * @return string Id of row */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function last_insert_id($tab,$fieldid='rowid') { + // phpcs:enable //$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab); $result = pg_query($this->db,"SELECT currval('".$tab."_".$fieldid."_seq')"); if (! $result) @@ -826,19 +836,21 @@ class DoliDBPgsql extends DoliDB } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return connexion ID * * @return string Id connexion */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLGetConnectId() { + // phpcs:enable return '?'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new database * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated @@ -850,9 +862,9 @@ class DoliDBPgsql extends DoliDB * @param string $owner Username of database owner * @return false|resource resource defined if OK, null if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateDb($database,$charset='',$collation='',$owner='') { + // phpcs:enable if (empty($charset)) $charset=$this->forcecharset; if (empty($collation)) $collation=$this->forcecollate; @@ -865,6 +877,7 @@ class DoliDBPgsql extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List tables into a database * @@ -872,9 +885,9 @@ class DoliDBPgsql extends DoliDB * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLListTables($database, $table='') - { + { + // phpcs:enable $listtables=array(); $like = ''; @@ -890,6 +903,7 @@ class DoliDBPgsql extends DoliDB return $listtables; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List information of columns into a table. * @@ -897,9 +911,9 @@ class DoliDBPgsql extends DoliDB * @return array Tableau des informations des champs de la table * */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLInfoTable($table) { + // phpcs:enable $infotables=array(); $sql="SELECT "; @@ -931,6 +945,7 @@ class DoliDBPgsql extends DoliDB } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a table into database * @@ -943,9 +958,9 @@ class DoliDBPgsql extends DoliDB * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) { + // phpcs:enable // FIXME: $fulltext_keys parameter is unused // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra @@ -1011,15 +1026,16 @@ class DoliDBPgsql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a table into database * * @param string $table Name of table * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropTable($table) { + // phpcs:enable $sql = "DROP TABLE ".$table; if (! $this->query($sql)) @@ -1028,6 +1044,7 @@ class DoliDBPgsql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a user to connect to database * @@ -1037,9 +1054,9 @@ class DoliDBPgsql extends DoliDB * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) { + // phpcs:enable // Note: using ' on user does not works with pgsql $sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'"; @@ -1053,6 +1070,7 @@ class DoliDBPgsql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a pointer of line with description of a table or field * @@ -1060,9 +1078,9 @@ class DoliDBPgsql extends DoliDB * @param string $field Optionnel : Name of field if we want description of field * @return false|resource Resultset x (x->attname) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDescTable($table,$field="") { + // phpcs:enable $sql ="SELECT attname FROM pg_attribute, pg_type WHERE typname = '".$table."' AND attrelid = typrelid"; $sql.=" AND attname NOT IN ('cmin', 'cmax', 'ctid', 'oid', 'tableoid', 'xmin', 'xmax')"; if ($field) $sql.= " AND attname = '".$field."'"; @@ -1072,6 +1090,7 @@ class DoliDBPgsql extends DoliDB return $this->_results; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new field into table * @@ -1081,37 +1100,38 @@ class DoliDBPgsql extends DoliDB * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLAddField($table,$field_name,$field_desc,$field_position="") { + // phpcs:enable // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); $sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql .= $field_desc['type']; - if(preg_match("/^[^\s]/i",$field_desc['value'])) + if (preg_match("/^[^\s]/i",$field_desc['value'])) if (! in_array($field_desc['type'],array('int','date','datetime'))) { $sql.= "(".$field_desc['value'].")"; } if (preg_match("/^[^\s]/i",$field_desc['attribute'])) - $sql .= " ".$field_desc['attribute']; + $sql .= " ".$field_desc['attribute']; if (preg_match("/^[^\s]/i",$field_desc['null'])) - $sql .= " ".$field_desc['null']; + $sql .= " ".$field_desc['null']; if (preg_match("/^[^\s]/i",$field_desc['default'])) - if (preg_match("/null/i",$field_desc['default'])) - $sql .= " default ".$field_desc['default']; - else - $sql .= " default '".$field_desc['default']."'"; + if (preg_match("/null/i",$field_desc['default'])) + $sql .= " default ".$field_desc['default']; + else + $sql .= " default '".$field_desc['default']."'"; if (preg_match("/^[^\s]/i",$field_desc['extra'])) - $sql .= " ".$field_desc['extra']; + $sql .= " ".$field_desc['extra']; $sql .= " ".$field_position; dol_syslog($sql,LOG_DEBUG); - if(! $this -> query($sql)) + if (! $this -> query($sql)) return -1; return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update format of a field into a table * @@ -1120,9 +1140,9 @@ class DoliDBPgsql extends DoliDB * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLUpdateField($table,$field_name,$field_desc) { + // phpcs:enable $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { @@ -1156,6 +1176,7 @@ class DoliDBPgsql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a field from table * @@ -1163,9 +1184,9 @@ class DoliDBPgsql extends DoliDB * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropField($table,$field_name) { + // phpcs:enable $sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name; dol_syslog($sql,LOG_DEBUG); if (! $this->query($sql)) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index f7d0ce19f61..0e954cfc28e 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -98,6 +98,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc */ function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) { + // phpcs:enable global $conf, $hookmanager, $langs, $user, $mysoc; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -464,6 +465,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show area for the customer to sign * @@ -473,9 +475,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param Translate $outputlangs Objet langs * @return int Position pour suite */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _signature_area(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable $default_font_size = pdf_getPDFFontSize($outputlangs); $tab_top = $posy + 4; $tab_hl = 4; diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index a66c2c9f985..8ff489cc5fa 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -131,13 +131,14 @@ class mod_commande_marbre extends ModeleNumRefCommandes $yymm = strftime("%y%m",$date); if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + else $num = sprintf("%04s", $max+1); dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -145,9 +146,9 @@ class mod_commande_marbre extends ModeleNumRefCommandes * @param string $objforref Object for number to search * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function commande_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index ffa75f4f3ba..72c8c5bef23 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -117,16 +117,17 @@ class mod_contract_magre extends ModelNumRefContracts return $numFinal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return next value + * Return next value * * @param Societe $objsoc third party object * @param Object $objforref contract object * @return string Value if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function contract_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index db96382a04a..4b57d5f7fcf 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -145,6 +145,7 @@ class ExportTsv extends ModeleExports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Open output file * @@ -152,14 +153,14 @@ class ExportTsv extends ModeleExports * @param Translate $outputlangs Output language object * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function open_file($file,$outputlangs) + function open_file($file,$outputlangs) { + // phpcs:enable global $langs; dol_syslog("ExportTsv::open_file file=".$file); - $ret=1; + $ret=1; $outputlangs->load("exports"); $this->handle = fopen($file, "wt"); @@ -173,20 +174,22 @@ class ExportTsv extends ModeleExports return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output header into file * * @param Translate $outputlangs Output language object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_header($outputlangs) { + // phpcs:enable return 0; } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Output title line into file * * @param array $array_export_fields_label Array with list of label of fields @@ -195,9 +198,9 @@ class ExportTsv extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs,$array_types) { + // phpcs:enable foreach($array_selected_sorted as $code => $value) { $newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]); // newvalue is now $outputlangs->charset_output encoded @@ -210,6 +213,7 @@ class ExportTsv extends ModeleExports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output record line into file * @@ -219,9 +223,9 @@ class ExportTsv extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_record($array_selected_sorted,$objp,$outputlangs,$array_types) { + // phpcs:enable global $conf; $this->col=0; @@ -253,40 +257,43 @@ class ExportTsv extends ModeleExports return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output footer into file * * @param Translate $outputlangs Output language object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_footer($outputlangs) { + // phpcs:enable return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close file handle * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function close_file() { + // phpcs:enable fclose($this->handle); return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Clean a cell to respect rules of TSV file cells * * @param string $newvalue String to clean - * @param string $charset Input AND Output character set + * @param string $charset Input AND Output character set * @return string Value cleaned */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function tsv_clean($newvalue, $charset) { + // phpcs:enable // Rule Dolibarr: No HTML $newvalue=dol_string_nohtmltag($newvalue, 1, $charset); @@ -300,6 +307,6 @@ class ExportTsv extends ModeleExports $newvalue=str_replace("\t"," ",$newvalue); } - return $newvalue; + return $newvalue; } } diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index aaec15d6672..c51e0452481 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -151,6 +151,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->posxdesc=$this->marge_gauche+1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build pdf onto disk * @@ -162,9 +163,9 @@ class pdf_soleil extends ModelePDFFicheinter * @param int $hideref Do not show ref * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$db,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index 5bf74ba48d1..a5d73031b7a 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -143,16 +143,17 @@ class ModeleImports } - /** - * Charge en memoire et renvoie la liste des modeles actifs - * + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Charge en memoire et renvoie la liste des modeles actifs + * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable dol_syslog(get_class($this)."::liste_modeles"); $dir=DOL_DOCUMENT_ROOT."/core/modules/import/"; diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 45f404f276e..ace0c97401a 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -327,16 +327,17 @@ class mailing_contacts1 extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Ajoute destinataires dans table des cibles * - * @param int $mailing_id Id of emailing + * @param int $mailing_id Id of emailing * @param array $filtersarray Optional filter data (deprecated) * @return int <0 si erreur, nb ajout si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id,$filtersarray=array()) { + // phpcs:enable global $conf, $langs; $filter = GETPOST('filter','alpha'); diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php index af4073038cd..0af52dc5bd2 100644 --- a/htdocs/core/modules/mailings/example.modules.php +++ b/htdocs/core/modules/mailings/example.modules.php @@ -37,7 +37,7 @@ class mailing_example extends MailingTargets var $require_module=array(); var $picto=''; - + /** * @var DoliDB Database handler. */ @@ -56,6 +56,7 @@ class mailing_example extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This is the main function that returns the array of emails * @@ -63,9 +64,9 @@ class mailing_example extends MailingTargets * @param array $filtersarray If you used the formFilter function. Empty otherwise. * @return int <0 if error, number of emails added if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id,$filtersarray=array()) { + // phpcs:enable $target = array(); // CHANGE THIS @@ -112,7 +113,7 @@ class mailing_example extends MailingTargets */ function getNbOfRecipients($sql='') { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optionnal // Example: return parent::getNbOfRecipients("SELECT count(*) as nb from dolibarr_table"); // Example: return 500; @@ -127,7 +128,7 @@ class mailing_example extends MailingTargets */ function formFilter() { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optionnal $s=''; return $s; @@ -143,7 +144,7 @@ class mailing_example extends MailingTargets */ function url($id) { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optionnal return ''; } diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 29e8de8bb98..11ff4812d67 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -146,6 +146,7 @@ class mailing_pomme extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Ajoute destinataires dans table des cibles * @@ -153,9 +154,9 @@ class mailing_pomme extends MailingTargets * @param array $filtersarray Requete sql de selection des destinataires * @return int < 0 si erreur, nb ajout si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function add_to_target($mailing_id,$filtersarray=array()) + function add_to_target($mailing_id, $filtersarray=array()) { + // phpcs:enable // Deprecation warning if ($filtersarray) { dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING); diff --git a/htdocs/core/modules/printing/modules_printing.php b/htdocs/core/modules/printing/modules_printing.php index 97cd483e680..afd46919598 100644 --- a/htdocs/core/modules/printing/modules_printing.php +++ b/htdocs/core/modules/printing/modules_printing.php @@ -1,6 +1,6 @@ + * Copyright (C) 2014-2018 Frederic France * * 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 @@ -35,7 +35,7 @@ class PrintingDriver * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 3363755139f..e70cfd76211 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -1,6 +1,6 @@ + * Copyright (C) 2014-2018 Frederic France * * 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 @@ -19,7 +19,7 @@ /** * \file htdocs/core/modules/printing/printipp.modules.php - * \ingroup mailing + * \ingroup printing * \brief File to provide printing with PrintIPP */ @@ -40,17 +40,17 @@ class printing_printipp extends PrintingDriver var $userid; /* user login */ var $user; var $password; - + /** - * @var string Error code (or message) - */ - public $error=''; - + * @var string Error code (or message) + */ + public $error=''; + /** - * @var string[] Error codes (or messages) - */ - public $errors = array(); - + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** * @var DoliDB Database handler. */ @@ -78,6 +78,7 @@ class printing_printipp extends PrintingDriver $this->conf[] = array('enabled'=>1, 'type'=>'submit'); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Print selected file * @@ -87,9 +88,9 @@ class printing_printipp extends PrintingDriver * * @return int 0 if OK, >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function print_file($file, $module, $subdir='') { + // phpcs:enable global $conf, $user; $error = 0; @@ -118,11 +119,11 @@ class printing_printipp extends PrintingDriver { if (! empty($conf->global->PRINTIPP_URI_DEFAULT)) { - dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT); + dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT); $ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT); } else - { + { $this->errors[] = 'NoDefaultPrinterDefined'; $error++; return $error; @@ -195,24 +196,25 @@ class printing_printipp extends PrintingDriver $html.= img_picto($langs->trans("Default"),'on'); } else - { - $html.= ''.img_picto($langs->trans("Disabled"),'off').''; - } - $html.= ''; + { + $html.= ''.img_picto($langs->trans("Disabled"),'off').''; + } + $html.= ''; $html.= ''."\n"; } $this->resprint = $html; return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of available printers * * @return array list of printers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function getlist_available_printers() { + // phpcs:enable global $conf,$db; include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; $ipp = new CupsPrintIPP(); @@ -225,15 +227,16 @@ class printing_printipp extends PrintingDriver return $ipp->available_printers; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get printer detail * * @param string $uri URI * @return array List of attributes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_printer_detail($uri) { + // phpcs:enable global $conf,$db; include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; @@ -248,6 +251,7 @@ class printing_printipp extends PrintingDriver return $ipp->printer_attributes; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List jobs print * @@ -255,9 +259,9 @@ class printing_printipp extends PrintingDriver * * @return int 0 if OK, >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_jobs($module) { + // phpcs:enable global $conf, $db, $bc; $error = 0; $html = ''; diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php index 8c86e4ec5d1..ddf061d95e9 100644 --- a/htdocs/core/modules/printsheet/modules_labels.php +++ b/htdocs/core/modules/printsheet/modules_labels.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; /** - * Parent class of document generator for address sheet. + * Parent class of document generator for address sheet. */ class ModelePDFLabels { @@ -40,16 +40,17 @@ class ModelePDFLabels public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='members_labels'; @@ -63,6 +64,7 @@ class ModelePDFLabels } +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a document onto disk according to template module. * @@ -75,9 +77,9 @@ class ModelePDFLabels * @param string $filename Short file name of PDF output file * @return int <0 if KO, >0 if OK */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outputdir='', $template='standardlabel', $filename='tmp_address_sheet.pdf') { + // phpcs:enable global $conf,$langs; $langs->load("members"); diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index adb0c821390..33fce830397 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -143,16 +143,17 @@ class mod_project_simple extends ModeleNumRefProjects } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return next reference not yet used as a reference + * Return next reference not yet used as a reference * * @param Societe $objsoc Object third party * @param Project $project Object project * @return string Next not used reference */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function project_get_num($objsoc=0,$project='') { + // phpcs:enable return $this->getNextValue($objsoc,$project); } } diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index 539683e8c18..76cade72785 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -143,14 +143,14 @@ class mod_task_simple extends ModeleNumRefTask } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return next reference not yet used as a reference + * Return next reference not yet used as a reference * - * @param Societe $objsoc Object third party - * @param Task $object Object task - * @return string Next not used reference + * @param Societe $objsoc Object third party + * @param Task $object Object task + * @return string Next not used reference */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function task_get_num($objsoc=0,$object='') { return $this->getNextValue($objsoc,$object); diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 285b7b2db82..ebefc97da43 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -164,6 +164,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -175,9 +176,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index c0ff3b0e5fc..692dcbf185c 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -38,23 +38,24 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator */ public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='company'; $liste=array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste=getListOfModels($db,$type,$maxfilenamelength); + $liste = getListOfModels($db,$type,$maxfilenamelength); return $liste; } @@ -67,7 +68,7 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator abstract class ModeleThirdPartyCode { /** - * @var string Error code (or message) + * @var string Error code (or message) */ public $error=''; @@ -144,6 +145,7 @@ abstract class ModeleThirdPartyCode return $langs->trans("NotAvailable"); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la liste des modeles de numérotation * @@ -151,9 +153,9 @@ abstract class ModeleThirdPartyCode * @param integer $maxfilenamelength Max length of value to show * @return array List of numbers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable $liste=array(); $sql =""; @@ -177,12 +179,12 @@ abstract class ModeleThirdPartyCode } /** - * Return description of module parameters + * Return description of module parameters * - * @param Translate $langs Output language - * @param Societe $soc Third party object - * @param int $type -1=Nothing, 0=Customer, 1=Supplier - * @return string HTML translated description + * @param Translate $langs Output language + * @param Societe $soc Third party object + * @param int $type -1=Nothing, 0=Customer, 1=Supplier + * @return string HTML translated description */ function getToolTip($langs,$soc,$type) { @@ -243,14 +245,15 @@ abstract class ModeleThirdPartyCode return $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Check if mask/numbering use prefix * * @return int 0=no, 1=yes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_prefixIsUsed() { + // phpcs:enable return 0; } } @@ -355,6 +358,7 @@ abstract class ModeleAccountancyCode return $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set accountancy account code for a third party into this->code * @@ -363,10 +367,10 @@ abstract class ModeleAccountancyCode * @param int $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_code($db, $societe, $type='') { - global $langs; + // phpcs:enable + global $langs; return $langs->trans("NotAvailable"); } @@ -374,6 +378,7 @@ abstract class ModeleAccountancyCode +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a document onto disk according to template module. * @@ -389,9 +394,9 @@ abstract class ModeleAccountancyCode * @deprecated Use the new function generateDocument of Facture class * @see Societe::generateDocument() */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function thirdparty_doc_create(DoliDB $db, Societe $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { + // phpcs:enable dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref); diff --git a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php index da9b826cab3..df7c5ba7553 100644 --- a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php +++ b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php @@ -42,16 +42,17 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator public $error=''; - /** - * Return list of active generation modules - * + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Return list of active generation modules + * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='supplier_proposal'; From 7e0ef3ad7e15752a4ad57e250f6f10a4c09edc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 6 Sep 2018 22:10:19 +0200 Subject: [PATCH 130/255] Update fiscalyear_card.php --- htdocs/accountancy/admin/fiscalyear_card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 389b835e38e..cc3d65fcad8 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -169,12 +169,12 @@ if ($action == 'create') // Date start print '' . $langs->trans("DateStart") . ''; - print $form->select_date(($date_start ? $date_start : ''), 'fiscalyear'); + $form->select_date(($date_start ? $date_start : ''), 'fiscalyear'); print ''; // Date end print '' . $langs->trans("DateEnd") . ''; - print $form->select_date(($date_end ? $date_end : - 1), 'fiscalyearend'); + $form->select_date(($date_end ? $date_end : - 1), 'fiscalyearend'); print ''; /* @@ -225,12 +225,12 @@ if ($action == 'create') // Date start print '' . $langs->trans("DateStart") . ''; - print $form->select_date($object->date_start ? $object->date_start : - 1, 'fiscalyear'); + $form->select_date($object->date_start ? $object->date_start : - 1, 'fiscalyear'); print ''; // Date end print '' . $langs->trans("DateEnd") . ''; - print $form->select_date($object->date_end ? $object->date_end : - 1, 'fiscalyearend'); + $form->select_date($object->date_end ? $object->date_end : - 1, 'fiscalyearend'); print ''; // Statut From a6d13b06b0f8f6ea04145bccaa654ea22fea7a32 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 7 Sep 2018 10:40:36 +0200 Subject: [PATCH 131/255] Standardize and update call to --- htdocs/adherents/admin/adherent.php | 4 ++-- htdocs/adherents/admin/adherent_emails.php | 4 ++-- htdocs/adherents/admin/adherent_extrafields.php | 4 ++-- htdocs/adherents/admin/adherent_type_extrafields.php | 4 ++-- htdocs/adherents/admin/website.php | 4 ++-- htdocs/adherents/agenda.php | 4 ++-- htdocs/adherents/document.php | 6 +++--- htdocs/adherents/index.php | 4 ++-- htdocs/adherents/ldap.php | 6 ++---- htdocs/adherents/note.php | 5 ++--- htdocs/adherents/stats/byproperties.php | 4 ++-- htdocs/adherents/stats/geo.php | 4 ++-- htdocs/adherents/stats/index.php | 4 ++-- htdocs/adherents/subscription/card.php | 6 ++---- htdocs/adherents/subscription/info.php | 6 ++---- htdocs/adherents/type_ldap.php | 5 ++--- 16 files changed, 33 insertions(+), 41 deletions(-) diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 2abc3b10841..ba43b6d47a6 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -33,8 +33,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; -$langs->load("admin"); -$langs->load("members"); +// Load translation files required by the page +$langs->loadLangs(array("admin","members")); if (! $user->admin) accessforbidden(); diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index 76d40e57c17..60e0b2c3b48 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -33,8 +33,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; -$langs->load("admin"); -$langs->load("members"); +// Load translation files required by the page +$langs->loadLangs(array("admin","members")); if (! $user->admin) accessforbidden(); diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/adherent_extrafields.php index f47f92faa4c..0ec1968ab34 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/adherent_extrafields.php @@ -28,8 +28,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("members"); -$langs->load("admin"); +// Load translation files required by the page +$langs->loadLangs(array("admin","members")); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index e78c4ef29e5..3a5226d00f4 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -31,8 +31,8 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("members"); -$langs->load("admin"); +// Load translation files required by the page +$langs->loadLangs(array("admin","members")); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 75a3c4ee0d7..91df8e59ea5 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; -$langs->load("members"); -$langs->load("admin"); +// Load translation files required by the page +$langs->loadLangs(array("admin","members")); $action=GETPOST('action', 'alpha'); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index 8fb1851e021..f22070107ca 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; -$langs->load("companies"); -$langs->load("members"); +// Load translation files required by the page +$langs->loadLangs(array("companies","members")); $id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('rowid','int'); diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 46b2b827d73..7e46b7864f8 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -33,9 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; -$langs->load("members"); -$langs->load("companies"); -$langs->load('other'); +// Load translation files required by the page +$langs->loadLangs(array("companies","members","other")); + $id=GETPOST('id','int'); $action=GETPOST('action','alpha'); diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 030700bb0f6..931e9323904 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; -$langs->load("companies"); -$langs->load("members"); +// Load translation files required by the page +$langs->loadLangs(array("companies","members")); // Security check $result=restrictedArea($user,'adherent'); diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index f7389e9fbbc..5b830623a4b 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -29,10 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; -$langs->load("companies"); -$langs->load("members"); -$langs->load("ldap"); -$langs->load("admin"); +// Load translation files required by the page +$langs->loadLangs(array("companies","members","ldap","admin")); $rowid = GETPOST('id','int'); $action = GETPOST('action','aZ09'); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index ae278b5dbb5..8cd12cd6ca2 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -28,9 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; -$langs->load("companies"); -$langs->load("members"); -$langs->load("bills"); +// Load translation files required by the page +$langs->loadLangs(array("companies","members","bills")); $action=GETPOST('action','alpha'); $id=GETPOST('id','int'); diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 7ae29a7eeb9..defbde2dce2 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -44,8 +44,8 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; -$langs->load("members"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array("companies","members")); /* diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 9de537ed39a..2175569b7ce 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -45,8 +45,8 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; -$langs->load("members"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array("companies","members")); /* diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 902c2d35359..e3bc7287864 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -46,8 +46,8 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; -$langs->load("members"); -$langs->load("companies"); +// Load translation files required by the page +$langs->loadLangs(array("companies","members")); /* diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 34b58c5b04d..0bacc8cf863 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -29,10 +29,8 @@ if (! empty($conf->banque->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } -$langs->load("companies"); -$langs->load("bills"); -$langs->load("members"); -$langs->load("users"); +// Load translation files required by the page +$langs->loadLangs(array("companies","members","bills","users")); $adh = new Adherent($db); $object = new Subscription($db); diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 649a1e22996..eb8f8e4eab3 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -28,10 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; -$langs->load("companies"); -$langs->load("bills"); -$langs->load("members"); -$langs->load("users"); +// Load translation files required by the page +$langs->loadLangs(array("companies","members","bills","users")); if (!$user->rights->adherent->lire) accessforbidden(); diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index 5d60beb2a4d..c18074130aa 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -29,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; -$langs->load("members"); -$langs->load("admin"); -$langs->load("ldap"); +// Load translation files required by the page +$langs->loadLangs(array("admin","members","ldap")); $id = GETPOST('rowid', 'int'); $action = GETPOST('action','alpha'); From e5058a251dac8416760d7d01726483c9ac45eff8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Sep 2018 12:27:08 +0200 Subject: [PATCH 132/255] Use colored gradient background on login page --- htdocs/core/tpl/login.tpl.php | 11 ++++++++++- htdocs/core/tpl/passwordforgotten.tpl.php | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 02fdedb7f2a..ccac70f4081 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -19,6 +19,7 @@ // Need global variable $title to be defined by caller (like dol_loginfunction) // Caller can also set $morelogincontent = array(['options']=>array('js'=>..., 'table'=>...); + // Protection to avoid direct call of template if (empty($conf) || ! is_object($conf)) { @@ -27,6 +28,8 @@ if (empty($conf) || ! is_object($conf)) } +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + header('Cache-Control: Public, must-revalidate'); header("Content-type: text/html; charset=".$conf->file->character_set_client); @@ -55,10 +58,16 @@ if (! preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) $disablenof print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disablenofollow); + +$colorbackhmenu1='60,70,100'; // topmenu +if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=$colorbackhmenu1; +$colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1); +$colorbackhmenu1=join(',',colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z' + ?> -global->MAIN_LOGIN_BACKGROUND)?'':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> +global->MAIN_LOGIN_BACKGROUND)?' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.'), rgb(240,240,240));"':' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>> dol_use_jmobile)) { ?> -