Skip to content

Commit

Permalink
Merged in CRM-17364 (pull request civicrm#7)
Browse files Browse the repository at this point in the history
Add in Status Override to Membeship Search options
  • Loading branch information
seamuslee001 committed Oct 15, 2015
2 parents 789a95f + 3f0bb08 commit a7cc53c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CRM/Member/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,12 @@ public static function whereClauseSingle(&$values, &$query) {
$query->_tables['civicrm_membership'] = $query->_whereTables['civicrm_membership'] = 1;
return;

case 'member_is_override':
$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_membership.is_override", $op, $value, "Boolean");
$query->_qill[$grouping][] = $value ? ts("Is Membership Status overriden? Yes") : ts("Is Membership Status overriden? No");
$query->_tables['civicrm_membership'] = $query->_whereTables['civicrm_membership'] = 1;
return;

case 'member_campaign_id':
if (CRM_Utils_Array::value($op, $value)) {
$value = $value[$op];
Expand Down Expand Up @@ -396,6 +402,7 @@ public static function defaultReturnProperties(
'max_related' => 1,
'membership_recur_id' => 1,
'member_campaign_id' => 1,
'member_is_override' => 1,
);

if ($includeCustomFields) {
Expand Down Expand Up @@ -444,6 +451,7 @@ public static function buildSearchForm(&$form) {
$form->addYesNo('member_pay_later', ts('Pay Later?'), TRUE);
$form->addYesNo('member_auto_renew', ts('Auto-Renew?'), TRUE);
$form->addYesNo('member_test', ts('Membership is a Test?'), TRUE);
$form->addYesNo('member_is_override', ts('Membership Status Is Override?'), TRUE);

// add all the custom searchable fields
$extends = array('Membership');
Expand Down
10 changes: 10 additions & 0 deletions templates/CRM/Member/Form/Search.hlp
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,13 @@
<li>{ts}Select neither to show all members, regardless of whether they are the direct member or inherit it through a relationship,{/ts}</li>
</ul>
{/htxt}
{htxt id="id-member_is_override-title"}
{ts}Membership Status Is Override?{/ts}
{/htxt}
{htxt id="id-member_is_override"}
<ul>
<li>{ts}Select "Yes" to display only membership with Status Override set (membership is manually forced to a specific status){/ts}</li>
<li>{ts}Select "No" to display only memberships without Status Override set (membership is subject to the normal status rules){/ts}</li>
<li>{ts}Select neither to show all memberships{/ts}</li>
</ul>
{/htxt}
5 changes: 5 additions & 0 deletions templates/CRM/Member/Form/Search/Common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
<p>
{$form.member_auto_renew.label}&nbsp;{$form.member_auto_renew.html}
</p>
<p>
{$form.member_is_override.label}
{help id="id-member_is_override" file="CRM/Member/Form/Search.hlp"}
{$form.member_is_override.html}
</p>
</td>
</tr>

Expand Down

0 comments on commit a7cc53c

Please sign in to comment.