$option2 = $_REQUEST['option2'];
}
+ $groups = $groupData->getList();
+
// Get a current list of interests
- $interests = $this->getList();
+ $where = null;
+ if ( isset( $_REQUEST['filterGroups'] ) ) {
+ // For each selected category
+ foreach($_REQUEST['filterGroups'] as $c) {
+ $groups[$c]['selected'] = true;
+ }
+ $where = "group_id in (" . implode( ',', $_REQUEST['filterGroups'] ) . ")";
+ }
+ $order = "title";
+ $interests = $this->getList( $where, $order );
+
//echo '<pre>$interests: ' . print_r($interests, true) . '</pre>';
if ( GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) {
}
}
- $groups = $groupData->getList();
if ( GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE ) {
glmMembersAdmin::addNotice( $groups, 'DataBlock', 'Interest Groups Data' );
<a id="glm-groups-list" data-show-table="glm-table-groups" class="glm-settings-tab nav-tab">Groups</a>
</h2>
+<form action="{$thisUrl}?page={$thisPage}" method="post" id="searchForm">
+ <input type="hidden" name="glm_action" value="leads">
+ <p class="right">
+ <b>Filter by Groups:</b>
+ <select id="filterGroups" name="filterGroups[]" multiple="multiple">
+ {foreach $groups as $group}
+ <option value="{$group.id}"{if $group.selected} selected{/if}>{$group.title}</option>
+ {/foreach}
+ </select>
+ <input type="submit" value="Submit" style="margin-right: 2em;">
+ </p>
+</form>
+
<table id="glm-table-interests" class="glm-admin-table glm-settings-table{if $option2!=''} glm-hidden{/if}">
<tr><td colspan="2">
<!-- Add Interests Button and Dialog Box -->
<thead>
<tr>
<th>Interest</th>
- <th>Used With</th>
<th>Groups</th>
<th> </th>
</tr>
<tr class="alternate">
{/if}
<td>
- <a class="editInterest" data-interestID="{$t.id}" data-refTypeID="{$t.ref_type.value}" data-interestUsesValue="{$t.uses_value.value}" data-group_id='{$t.group_id.value}'>{$t.title}</a>
- </td>
- <td id="editInterestRefType_{$t.id}">
- {$t.ref_type.title}
+ <a class="editInterest" data-interestID="{$t.id}" data-group_id='{$t.group_id.value}'>{$t.title}</a>
</td>
<td id="editInterestGroups">
{foreach $t.group_id.list as $group}
});
+ /*
+ * For the multiple select
+ */
+ $('#filterGroups').multiselect();
+
});
</script>
<table id="glm-table-groups" class="glm-admin-table glm-settings-table{if $option2!='group'} glm-hidden{/if}">