);
}
- //does membership have auto renew CRM-7137.
- if (!empty($membership[$dao->id]['contribution_recur_id']) &&
- !CRM_Member_BAO_Membership::isSubscriptionCancelled($membership[$dao->id]['membership_id'])
- ) {
- $membership[$dao->id]['auto_renew'] = 1;
+ // Display Auto-renew status on page (0=disabled, 1=enabled, 2=enabled, but error
+ if (!empty($membership[$dao->id]['contribution_recur_id'])) {
+ if (CRM_Member_BAO_Membership::isSubscriptionCancelled($membership[$dao->id]['membership_id'])) {
+ $membership[$dao->id]['auto_renew'] = 2;
+ }
+ else {
+ $membership[$dao->id]['auto_renew'] = 1;
+ }
}
else {
$membership[$dao->id]['auto_renew'] = 0;
* @param string $output
* What should the result set include (web/email/csv).
*
- * @return int
+ * @return array
* the total number of rows for this action
*/
public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
);
}
- //does membership have auto renew CRM-7137.
- $autoRenew = FALSE;
- if (isset($result->membership_recur_id) && $result->membership_recur_id &&
- !CRM_Member_BAO_Membership::isSubscriptionCancelled($row['membership_id'])
- ) {
- $autoRenew = TRUE;
+ // Display Auto-renew status on page (0=disabled, 1=enabled, 2=enabled, but error
+ if (!empty($result->membership_recur_id)) {
+ if (CRM_Member_BAO_Membership::isSubscriptionCancelled($row['membership_id'])) {
+ $row['auto_renew'] = 2;
+ }
+ else {
+ $row['auto_renew'] = 1;
+ }
+ }
+ else {
+ $row['auto_renew'] = 0;
}
- $row['auto_renew'] = $autoRenew;
$row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
);
<td class="crm-membership-end_date">{$row.membership_end_date|truncate:10:''|crmDate}</td>
<td class="crm-membership-source">{$row.membership_source}</td>
<td class="crm-membership-status crm-membership-status_{$row.membership_status}">{$row.membership_status}</td>
- <td class="crm-membership-auto_renew">{if $row.auto_renew}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Auto-renew{/ts}" /> {/if}</td>
+ <td class="crm-membership-auto_renew">
+ {if $row.auto_renew eq 1}
+ <i class="fa fa-check" aria-hidden="true" title="{ts}Auto-renew active{/ts}"></i>
+ {elseif $row.auto_renew eq 2}
+ <i class="fa fa-exclamation" aria-hidden="true" title="{ts}Auto-renew error{/ts}"></i>
+ {/if}
+ </td>
<td>
{$row.action|replace:'xx':$row.membership_id}
{if $row.owner_membership_id}
<td class="crm-membership-end_date" data-order="{$activeMember.end_date}">{$activeMember.end_date|crmDate}</td>
<td class="crm-membership-status">{$activeMember.status}</td>
<td class="crm-membership-source">{$activeMember.source}</td>
- <td class="crm-membership-auto_renew">{if $activeMember.auto_renew}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Auto-renew{/ts}" /> {/if}</td>
+ <td class="crm-membership-auto_renew">
+ {if $activeMember.auto_renew eq 1}
+ <i class="fa fa-check" aria-hidden="true" title="{ts}Auto-renew active{/ts}"></i>
+ {elseif $activeMember.auto_renew eq 2}
+ <i class="fa fa-exclamation" aria-hidden="true" title="{ts}Auto-renew error{/ts}"></i>
+ {/if}
+ </td>
<td class="crm-membership-related_count">{$activeMember.related_count}</td>
<td>
{$activeMember.action|replace:'xx':$activeMember.id}
<td class="crm-membership-end_date" data-order="{$inActiveMember.end_date}">{$inActiveMember.end_date|crmDate}</td>
<td class="crm-membership-status">{$inActiveMember.status}</td>
<td class="crm-membership-source">{$inActiveMember.source}</td>
- <td class="crm-membership-auto_renew">{if $inActiveMember.auto_renew}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Auto-renew{/ts}" /> {/if}</td>
+ <td class="crm-membership-auto_renew">
+ {if $inActiveMember.auto_renew eq 1}
+ <i class="fa fa-check" aria-hidden="true" title="{ts}Auto-renew active{/ts}"></i>
+ {elseif $inActiveMember.auto_renew eq 2}
+ <i class="fa fa-exclamation" aria-hidden="true" title="{ts}Auto-renew error{/ts}"></i>
+ {/if}
+ </td>
<td>{$inActiveMember.action|replace:'xx':$inActiveMember.id}
{if $inActiveMember.owner_membership_id}
<a href="{crmURL p='civicrm/membership/view' q="reset=1&id=`$inActiveMember.owner_membership_id`&action=view&context=membership&selectedChild=member"}" title="{ts}View Primary member record{/ts}" class="crm-hover-button action-item">{ts}View Primary{/ts}