From c32b96c20721bdc4555d11db1752e244ec97246d Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 4 Oct 2018 09:15:15 +0200 Subject: [PATCH 1/4] Standardize and update code --- .../class/accountancysystem.class.php | 12 ++--- htdocs/projet/class/task.class.php | 52 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/htdocs/accountancy/class/accountancysystem.class.php b/htdocs/accountancy/class/accountancysystem.class.php index d126bd84acc..444079f5239 100644 --- a/htdocs/accountancy/class/accountancysystem.class.php +++ b/htdocs/accountancy/class/accountancysystem.class.php @@ -38,18 +38,18 @@ class AccountancySystem */ public $error=''; - var $rowid; - var $fk_pcg_version; - var $pcg_type; - var $pcg_subtype; + public $rowid; + public $fk_pcg_version; + public $pcg_type; + public $pcg_subtype; /** * @var string Accountancy System label */ public $label; - var $account_number; - var $account_parent; + public $account_number; + public $account_parent; /** * Constructor diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index aec0f40443e..a3fd5fb1703 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -61,37 +61,37 @@ class Task extends CommonObject */ public $description; - var $duration_effective; // total of time spent on this task - var $planned_workload; - var $date_c; - var $date_start; - var $date_end; - var $progress; - var $fk_statut; - var $priority; - var $fk_user_creat; - var $fk_user_valid; - var $rang; + public $duration_effective; // total of time spent on this task + public $planned_workload; + public $date_c; + public $date_start; + public $date_end; + public $progress; + public $fk_statut; + public $priority; + public $fk_user_creat; + public $fk_user_valid; + public $rang; - var $timespent_min_date; - var $timespent_max_date; - var $timespent_total_duration; - var $timespent_total_amount; - var $timespent_nblinesnull; - var $timespent_nblines; + public $timespent_min_date; + public $timespent_max_date; + public $timespent_total_duration; + public $timespent_total_amount; + public $timespent_nblinesnull; + public $timespent_nblines; // For detail of lines of timespent record, there is the property ->lines in common // Var used to call method addTimeSpent(). Bad practice. - var $timespent_id; - var $timespent_duration; - var $timespent_old_duration; - var $timespent_date; - var $timespent_datehour; // More accurate start date (same than timespent_date but includes hours, minutes and seconds) - var $timespent_withhour; // 1 = we entered also start hours for timesheet line - var $timespent_fk_user; - var $timespent_note; + public $timespent_id; + public $timespent_duration; + public $timespent_old_duration; + public $timespent_date; + public $timespent_datehour; // More accurate start date (same than timespent_date but includes hours, minutes and seconds) + public $timespent_withhour; // 1 = we entered also start hours for timesheet line + public $timespent_fk_user; + public $timespent_note; - var $comments = array(); + public $comments = array(); public $oldcopy; From d2ec703b5117b3913aa354e9db561c3053802935 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 4 Oct 2018 09:24:57 +0200 Subject: [PATCH 2/4] Standardize and update code --- htdocs/core/class/events.class.php | 10 ++-- htdocs/holiday/class/holiday.class.php | 48 +++++++++---------- htdocs/product/stock/class/entrepot.class.php | 16 +++---- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 436a708d312..d8d71513cd9 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -59,10 +59,10 @@ class Events // extends CommonObject */ public $error=''; - var $tms; - var $type; - var $entity; - var $dateevent; + public $tms; + public $type; + public $entity; + public $dateevent; /** * @var string description @@ -70,7 +70,7 @@ class Events // extends CommonObject public $description; // List of all Audit/Security events supported by triggers - var $eventstolog=array( + public $eventstolog=array( /*array('id'=>'USER_LOGIN', 'test'=>1), array('id'=>'USER_LOGIN_FAILED', 'test'=>1), array('id'=>'USER_LOGOUT', 'test'=>1),*/ diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index d75c90e2b64..5107ffb09ab 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -43,50 +43,50 @@ class Holiday extends CommonObject 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 $fk_element = 'fk_holiday'; public $picto = 'holiday'; /** * @deprecated * @see id */ - var $rowid; + public $rowid; /** * @var int User ID */ public $fk_user; - var $date_create=''; + public $date_create=''; /** * @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 - var $date_fin_gmt=''; // Date end in GMT - var $halfday=''; // 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning - var $statut=''; // 1=draft, 2=validated, 3=approved - var $fk_validator; - var $date_valid=''; - var $fk_user_valid; - var $date_refuse=''; - var $fk_user_refuse; - var $date_cancel=''; - var $fk_user_cancel; - var $detail_refuse=''; - var $fk_type; + public $date_debut=''; // Date start in PHP server TZ + public $date_fin=''; // Date end in PHP server TZ + public $date_debut_gmt=''; // Date start in GMT + public $date_fin_gmt=''; // Date end in GMT + public $halfday=''; // 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning + public $statut=''; // 1=draft, 2=validated, 3=approved + public $fk_validator; + public $date_valid=''; + public $fk_user_valid; + public $date_refuse=''; + public $fk_user_refuse; + public $date_cancel=''; + public $fk_user_cancel; + public $detail_refuse=''; + public $fk_type; - var $holiday = array(); - var $events = array(); - var $logs = array(); + public $holiday = array(); + public $events = array(); + public $logs = array(); - var $optName = ''; - var $optValue = ''; - var $optRowid = ''; + public $optName = ''; + public $optValue = ''; + public $optRowid = ''; /** * Draft status diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 9f205580444..59e3f2fb057 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -60,23 +60,23 @@ class Entrepot extends CommonObject */ const STATUS_OPEN_INTERNAL = 2; - var $libelle; + public $libelle; /** * @var string description */ public $description; - var $statut; - var $lieu; - var $address; + public $statut; + public $lieu; + public $address; //! Code Postal - var $zip; - var $town; - var $fk_parent; + public $zip; + public $town; + public $fk_parent; // List of short language codes for status - var $statuts = array(); + public $statuts = array(); /** * Constructor From 8bee69277d95b1d873a708f60cad0644276580ec Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 4 Oct 2018 09:33:30 +0200 Subject: [PATCH 3/4] Standardize and update code --- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/core/class/commoninvoice.class.php | 2 +- htdocs/expedition/class/expedition.class.php | 12 +++++++++++- htdocs/expensereport/class/expensereport.class.php | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 048f686df3b..d264bbc5200 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -216,7 +216,7 @@ class Facture extends CommonInvoice const TYPE_SITUATION = 5; /** - * Draft + * Draft status */ const STATUS_DRAFT = 0; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 9b1cb8776c3..1688682abe5 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -62,7 +62,7 @@ abstract class CommonInvoice extends CommonObject const TYPE_SITUATION = 5; /** - * Draft + * Draft status */ const STATUS_DRAFT = 0; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index bd575511d61..dee8184ee18 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -117,9 +117,19 @@ class Expedition extends CommonObject public $meths; public $listmeths; // List of carriers - + /** + * Draft status + */ const STATUS_DRAFT = 0; + + /** + * Validated status + */ const STATUS_VALIDATED = 1; + + /** + * Closed status + */ const STATUS_CLOSED = 2; diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 3b6b9628f6a..f5d2a4145e2 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -104,8 +104,8 @@ class ExpenseReport extends CommonObject END ACTIONS */ - /** - * Draft + /** + * Draft status */ const STATUS_DRAFT = 0; From e045d0e9ac866f26fae0a7d4698121d6dd824b70 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 4 Oct 2018 09:55:05 +0200 Subject: [PATCH 4/4] Translation --- .../default/actions_adherentcard_default.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php index be7af41e894..c841f83b297 100644 --- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php +++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2011 Laurent Destailleur - * Copyright (C) 2012 Philippe Grand + * Copyright (C) 2012-2018 Philippe Grand * * 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 @@ -20,20 +20,20 @@ /** * \file htdocs/adherents/canvas/default/actions_adherentcard_default.class.php * \ingroup member - * \brief Fichier de la classe Thirdparty adherent card controller (default canvas) + * \brief File of class Thirdparty member card controller (default canvas) */ include_once DOL_DOCUMENT_ROOT.'/adherents/canvas/actions_adherentcard_common.class.php'; /** * \class ActionsAdherentCardDefault - * \brief Classe permettant la gestion des adherents par defaut + * \brief Class allowing the management of the members by default */ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon { /** * Constructor * - * @param DoliDB $db Handler acces base de donnees + * @param DoliDB $db Handler acces data base * @param string $dirmodule Name of directory of module * @param string $targetmodule Name of directory of module where canvas is stored * @param string $canvas Name of canvas @@ -51,7 +51,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon /** * Return the title of card * - * @param string $action Code action + * @param string $action Action code * @return string Title */ private function getTitle($action)