Skip to content
Snippets Groups Projects
Unverified Commit 231c1c13 authored by colemanw's avatar colemanw Committed by GitHub
Browse files

Merge pull request #20762 from eileenmcnaughton/mem2

#2115 prep - Remove silly if, silly rename
parents 82e4e2c3 8f90bd14
No related branches found
No related tags found
No related merge requests found
......@@ -123,7 +123,6 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page {
$value, $relationshipName
);
}
$membershipType[$dao->id]['maxRelated'] = $membershipType[$dao->id]['max_related'] ?? NULL;
}
if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus() && !CRM_Core_Permission::check('edit contributions of type ' . CRM_Contribute_PseudoConstant::financialType($dao->financial_type_id))) {
unset($links[CRM_Core_Action::UPDATE], $links[CRM_Core_Action::ENABLE], $links[CRM_Core_Action::DISABLE]);
......@@ -134,24 +133,22 @@ class CRM_Member_Page_MembershipType extends CRM_Core_Page {
// form all action links
$action = array_sum(array_keys($this->links()));
// update enable/disable links depending on if it is is_reserved or is_active
if (!isset($dao->is_reserved)) {
if ($dao->is_active) {
$action -= CRM_Core_Action::ENABLE;
}
else {
$action -= CRM_Core_Action::DISABLE;
}
$membershipType[$dao->id]['order'] = $membershipType[$dao->id]['weight'];
$membershipType[$dao->id]['action'] = CRM_Core_Action::formLink($links, $action,
['id' => $dao->id],
ts('more'),
FALSE,
'membershipType.manage.action',
'MembershipType',
$dao->id
);
// update enable/disable links depending on if it is_active
if ($dao->is_active) {
$action -= CRM_Core_Action::ENABLE;
}
else {
$action -= CRM_Core_Action::DISABLE;
}
$membershipType[$dao->id]['order'] = $membershipType[$dao->id]['weight'];
$membershipType[$dao->id]['action'] = CRM_Core_Action::formLink($links, $action,
['id' => $dao->id],
ts('more'),
FALSE,
'membershipType.manage.action',
'MembershipType',
$dao->id
);
}
$returnURL = CRM_Utils_System::url('civicrm/admin/member/membershipType', "reset=1&action=browse");
......
......@@ -45,7 +45,7 @@
<td class="crmf-duration_interval_unit">{$row.duration_interval} {$row.duration_unit}</td>
<td class="crmf-auto_renew">{if $row.auto_renew EQ 2}{ts}Required{/ts}{elseif $row.auto_renew EQ 1}{ts}Optional{/ts}{else}{ts}No{/ts}{/if}</td>
<td class="crmf-relationship_type">{$row.relationshipTypeName}</td>
<td class="crmf-max_related" align="right">{$row.maxRelated}</td>
<td class="crmf-max_related" align="right">{$row.max_related}</td>
<td class="crmf-visibility crm-editable" data-type="select">{$row.visibility}</td>
<td class="nowrap crmf-weight">{$row.weight}</td>
<td class="crmf-is_active">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment