diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index c1584085f12..5e0a853eaa8 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -365,7 +365,10 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
print '
'.$langs->trans("MembersNature").' | ';
$totalarray['nbfield']++;
}
- print ''.$langs->trans("MembershipDuration").' | ';
+ if (!empty($arrayfields['t.duration']['checked'])) {
+ print ''.$langs->trans("MembershipDuration").' | ';
+ $totalarray['nbfield']++;
+ }
print ''.$langs->trans("SubscriptionRequired").' | ';
print ''.$langs->trans("Amount").' | ';
print ''.$langs->trans("CanEditAmountShort").' | ';
@@ -437,19 +440,20 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
}
print '';
}
-
- print '';
- if ($objp->duration) {
- $duration_value = intval($objp->duration);
- if ($duration_value > 1) {
- $dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
- } else {
- $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year"));
+ if (!empty($arrayfields['t.duration']['checked'])) {
+ print ' | ';
+ if ($objp->duration) {
+ $duration_value = intval($objp->duration);
+ if ($duration_value > 1) {
+ $dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years"));
+ } else {
+ $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year"));
+ }
+ $unit = preg_replace("/[^a-zA-Z]+/", "", $objp->duration);
+ print max(1, $duration_value).' '.$dur[$unit];
}
- $unit = preg_replace("/[^a-zA-Z]+/", "", $objp->duration);
- print max(1, $duration_value).' '.$dur[$unit];
+ print ' | ';
}
- print '';
print ''.yn($objp->subscription).' | ';