From 5cd955731814aaab6f2eb88159f836ff26fd94a9 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 1 Sep 2018 23:12:20 +0200 Subject: [PATCH] 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;