From 6190e7813e6a435fe68f074ffd68b3ac1272103d Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 25 Apr 2019 09:14:51 +0200 Subject: [PATCH 1/2] Fix get morphy adherent type --- htdocs/adherents/class/adherent_type.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 936c33d6c0c..9c7d34ed569 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -410,6 +410,21 @@ class AdherentType extends CommonObject return -1; } } + + /** + * Return translated label by the nature of a adherent (physical or moral) + * + * @param string $morphy Nature of the adherent (physical or moral) + * @return string Label + */ + function getmorphylib($morphy='') + { + global $langs; + if ($morphy == 'phy') { return $langs->trans("Physical"); } + elseif ($morphy == 'mor') { return $langs->trans("Moral"); } + else return $langs->trans("Physical & Morale"); + //return $morphy; + } /** * Return clicable name (with picto eventually) From 65bb7d90318dd19b2eaa7b409f7ac888ec7c87d3 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Thu, 25 Apr 2019 09:37:07 +0200 Subject: [PATCH 2/2] Update adherent_type.class.php --- htdocs/adherents/class/adherent_type.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 9c7d34ed569..c310bb18627 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -417,14 +417,14 @@ class AdherentType extends CommonObject * @param string $morphy Nature of the adherent (physical or moral) * @return string Label */ - function getmorphylib($morphy='') + public function getmorphylib($morphy = '') { global $langs; if ($morphy == 'phy') { return $langs->trans("Physical"); } - elseif ($morphy == 'mor') { return $langs->trans("Moral"); } + elseif ($morphy == 'mor') { return $langs->trans("Moral"); } else return $langs->trans("Physical & Morale"); //return $morphy; - } + } /** * Return clicable name (with picto eventually)