From 1e565486d88d908d6bd54b0390026e29df6e0525 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 6 Jul 2018 19:17:11 +0200 Subject: [PATCH 1/5] fix : typo and update code --- htdocs/product/document.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 34337218a62..83d59a26a90 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -288,11 +288,11 @@ if ($object->id) print ''; - $delauft_lang = empty($lang_id) ? $langs->getDefaultLang() : $lang_id; + $default_lang = empty($lang_id) ? $langs->getDefaultLang() : $lang_id; $langs_available = $langs->get_available_languages(DOL_DOCUMENT_ROOT, 12); - print Form::selectarray('lang_id', $langs_available, $delauft_lang, 0, 0, 0, '', 0, 0, 0, 'ASC'); + print Form::selectarray('lang_id', $langs_available, $default_lang, 0, 0, 0, '', 0, 0, 0, 'ASC'); if ($conf->global->MAIN_MULTILANGS) { print ''; @@ -301,25 +301,18 @@ if ($object->id) print ''; } - $style = 'impair'; foreach ($filearray as $filetoadd) { if ($ext = pathinfo($filetoadd['name'], PATHINFO_EXTENSION) == 'pdf') { - if ($style == 'pair') { - $style = 'impair'; - } else { - $style = 'pair'; - } - $checked = ''; $filename = $filetoadd['name']; if ($conf->global->MAIN_MULTILANGS) { - if (array_key_exists($filetoadd['name'] . '_' . $delauft_lang, $filetomerge->lines)) + if (array_key_exists($filetoadd['name'] . '_' . $default_lang, $filetomerge->lines)) { - $filename = $filetoadd['name'] . ' - ' . $langs->trans('Language_' . $delauft_lang); + $filename = $filetoadd['name'] . ' - ' . $langs->trans('Language_' . $default_lang); $checked = ' checked '; } } @@ -331,7 +324,7 @@ if ($object->id) } } - print ''; + print ''; print '' . $filename . ''; print ''; } From 1e1ed485f5ee2be4749e434457f8e7c0054432ae Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 7 Jul 2018 10:47:56 +0200 Subject: [PATCH 2/5] Docs : update comments --- .../doc/pdf_standard.modules.php | 87 +++++++++++++++---- 1 file changed, 71 insertions(+), 16 deletions(-) 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 f9567a32a5c..bda0170397d 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -38,23 +38,78 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functionsnumtoword.lib.php'; */ class pdf_standard extends ModelePDFSuppliersPayments { - var $db; - var $name; - var $description; - var $type; + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + + /** + * @var string document type + */ + public $type; - var $phpmin = array(4,3,0); // Minimum version of PHP required by module - var $version = 'dolibarr'; - - var $page_largeur; - var $page_hauteur; - var $format; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; - - var $emetteur; // Objet societe qui emet + /** + * @var array() Minimum version of PHP required by module. + * e.g.: PHP ≥ 5.4 = array(5, 4) + */ + public $phpmin = array(5, 4); + + /** + * Dolibarr version of the loaded document + * @public string + */ + public $version = 'dolibarr'; + + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + + /** + * Issuer + * @var Societe + */ + public $emetteur; /** From fe5bfe3aaf0e94f7e44e94d7627a5088b1f68878 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 7 Jul 2018 10:51:09 +0200 Subject: [PATCH 3/5] Docs : update comments --- .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index bca4ae8425f..5f971cab2d1 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -60,9 +60,9 @@ class pdf_aurore extends ModelePDFSupplierProposal /** * @var array() Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.3 = array(5, 3) + * e.g.: PHP ≥ 5.4 = array(5, 4) */ - public $phpmin = array(5, 2); + public $phpmin = array(5, 4); /** * Dolibarr version of the loaded document From 4b1e9e3fafd477fa380cd008d8ac93b6281186e5 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 7 Jul 2018 11:03:22 +0200 Subject: [PATCH 4/5] Docs : translation --- htdocs/holiday/class/holiday.class.php | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 03b2491ab59..c8b64790061 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -346,12 +346,12 @@ class Holiday extends CommonObject $sql.= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid"; // Hack pour la recherche sur le tableau $sql.= " AND cp.fk_user IN (".$user_id.")"; - // Filtre de séléction + // Selection filter if(!empty($filter)) { $sql.= $filter; } - // Ordre d'affichage du résultat + // Order of display of the result if(!empty($order)) { $sql.= $order; } @@ -359,19 +359,19 @@ class Holiday extends CommonObject dol_syslog(get_class($this)."::fetchByUser", LOG_DEBUG); $resql=$this->db->query($sql); - // Si pas d'erreur SQL + // If no SQL error if ($resql) { $i = 0; $tab_result = $this->holiday; $num = $this->db->num_rows($resql); - // Si pas d'enregistrement + // If no registration if(!$num) { return 2; } - // Liste les enregistrements et les ajoutent au tableau + // List the records and add them to the table while($i < $num) { $obj = $this->db->fetch_object($resql); @@ -412,13 +412,13 @@ class Holiday extends CommonObject $i++; } - // Retourne 1 avec le tableau rempli + // Returns 1 with the filled array $this->holiday = $tab_result; return 1; } else { - // Erreur SQL + // SQL Error $this->error="Error ".$this->db->lasterror(); return -1; } @@ -471,12 +471,12 @@ class Holiday extends CommonObject $sql.= " WHERE cp.entity IN (".getEntity('holiday').")"; $sql.= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau - // Filtrage de séléction + // Selection filtering if(!empty($filter)) { $sql.= $filter; } - // Ordre d'affichage + // order of display if(!empty($order)) { $sql.= $order; } @@ -484,19 +484,19 @@ class Holiday extends CommonObject dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG); $resql=$this->db->query($sql); - // Si pas d'erreur SQL + // If no SQL error if ($resql) { $i = 0; $tab_result = $this->holiday; $num = $this->db->num_rows($resql); - // Si pas d'enregistrement + // If no registration if(!$num) { return 2; } - // On liste les résultats et on les ajoutent dans le tableau + // List the records and add them to the table while($i < $num) { $obj = $this->db->fetch_object($resql); @@ -536,13 +536,13 @@ class Holiday extends CommonObject $i++; } - // Retourne 1 et ajoute le tableau à la variable + // Returns 1 and adds the array to the variable $this->holiday = $tab_result; return 1; } else { - // Erreur SQL + // SQL Error $this->error="Error ".$this->db->lasterror(); return -1; } From 47e80123d5cbd4b7180ae40be393e72f77aad76c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 7 Jul 2018 11:36:46 +0200 Subject: [PATCH 5/5] Docs : update code --- htdocs/core/modules/modApi.class.php | 2 +- htdocs/core/modules/modAsset.class.php | 2 +- .../modulebuilder/template/core/modules/modMyModule.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index c8dc7ae84ba..71374e136e5 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -82,7 +82,7 @@ class modApi extends DolibarrModules $this->depends = array(); // List of modules id that must be enabled if this module is enabled $this->requiredby = array(); // List of modules id to disable if this one is disabled $this->conflictwith = array(); // List of modules id this module is in conflict with - $this->phpmin = array(5,3); // Minimum version of PHP required by module + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index 9b82a6015c4..d6a50ab9b07 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -96,7 +96,7 @@ class modAsset extends DolibarrModules $this->requiredby = array(); // List of module ids to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("assets"); - $this->phpmin = array(5,3); // Minimum version of PHP required by module + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->need_dolibarr_version = array(7,0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php index 675271a2947..8169cd9961f 100644 --- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php +++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php @@ -116,7 +116,7 @@ class modMyModule extends DolibarrModules $this->requiredby = array(); // List of module class names to disable if this one is disabled $this->conflictwith = array(); // List of module class names as string this module is in conflict with $this->langfiles = array("mymodule@mymodule"); - $this->phpmin = array(5,3); // Minimum version of PHP required by module + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->need_dolibarr_version = array(4,0); // Minimum version of Dolibarr required by module $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)