diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 72ea99ff18d..31ce9768de1 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -1,10 +1,11 @@ +/* Copyright (C) 2001-2002 Rodolphe Quiedeville * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2019 Thibault Foucart * * 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 @@ -57,6 +58,7 @@ if (! $sortorder) { $sortorder="DESC"; } if (! $sortfield) { $sortfield="d.lastname"; } $label=GETPOST("label", "alpha"); +$morphy=GETPOST("morphy","alpha"); $statut=GETPOST("statut", "int"); $subscription=GETPOST("subscription", "int"); $vote=GETPOST("vote", "int"); @@ -103,6 +105,7 @@ if ($cancel) { if ($action == 'add' && $user->rights->adherent->configurer) { $object->label = trim($label); + $object->morphy = trim($morphy); $object->statut = (int) $statut; $object->subscription = (int) $subscription; $object->note = trim($comment); @@ -157,6 +160,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) $object->oldcopy = clone $object; $object->label = trim($label); + $object->morphy = trim($morphy); $object->statut = (int) $statut; $object->subscription = (int) $subscription; $object->note = trim($comment); @@ -215,7 +219,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') { //dol_fiche_head(''); - $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote, d.statut"; + $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.vote, d.statut, d.morphy"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; $sql.= " WHERE d.entity IN (".getEntity('member_type').")"; @@ -256,6 +260,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''; print ''.$langs->trans("Ref").''; print ''.$langs->trans("Label").''; + print ''.$langs->trans("Nature").''; print ''.$langs->trans("SubscriptionRequired").''; print ''.$langs->trans("VoteAllowed").''; print ''.$langs->trans("Status").''; @@ -277,6 +282,11 @@ if (! $rowid && $action != 'create' && $action != 'edit') //'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.' print ''; print ''.dol_escape_htmltag($objp->label).''; + print ''; + if ($objp->morphy == 'phy') { print $langs->trans("Physical"); } + elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); } + else print $langs->trans("Physical & Morale"); + print ''; print ''.yn($objp->subscription).''; print ''.yn($objp->vote).''; print ''; @@ -330,6 +340,14 @@ if ($action == 'create') print ''.$langs->trans("Status").''; print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), 1); print ''; + + // Morphy + $morphys[""] = $langs->trans("Physical & Morale"); + $morphys["phy"] = $langs->trans("Physical"); + $morphys["mor"] = $langs->trans("Morale"); + print ''.$langs->trans("Nature").''; + print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy); + print ""; print ''.$langs->trans("SubscriptionRequired").''; print $form->selectyesno("subscription", 1, 1); @@ -411,6 +429,10 @@ if ($rowid > 0) print img_picto($langs->trans('TypeStatusInactive'), 'statut5').' '.$langs->trans("ActivityCeased"); } print ''; + + // Morphy + print ''.$langs->trans("Nature").''.$object->getmorphylib().''; + print ''; print ''.$langs->trans("SubscriptionRequired").''; print yn($object->subscription); @@ -751,6 +773,14 @@ if ($rowid > 0) print ''.$langs->trans("Status").''; print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut); print ''; + + // Morphy + $morphys[""] = $langs->trans("Physical & Morale"); + $morphys["phy"] = $langs->trans("Physical"); + $morphys["mor"] = $langs->trans("Morale"); + print ''.$langs->trans("Nature").''; + print $form->selectarray("morphy", $morphys, isset($_POST["morphy"])?$_POST["morphy"]:$object->morphy); + print ""; print ''.$langs->trans("SubscriptionRequired").''; print $form->selectyesno("subscription", $object->subscription, 1);