* @access public
*/
- public function getListSortedParentChild($forEdit = true, $forActiveMembers = false, $regionList = false) {
+ public function getListSortedParentChild($forEdit = true, $forActiveMembers = false, $regionList = false, $countyList = false) {
$regionWhere = '';
if ($regionList !== false && trim($regionList) != '') {
$regionWhere = " AND MI.region in ($regionList)";
}
+ $countyWhere = '';
+ if ( $countyList !== false && trim( $countyList ) != '' ) {
+ $countyWhere = " AND MI.county in ($countyList) ";
+ }
$where = '';
// If we only want categories for active and visible members - and we want any of their parents (i know it's messy)
AND MI.status = 10
AND M.id = MI.member
$regionWhere
+ $countyWhere
AND M.access IN (
".$this->config['access_numb']['NoAccess'].",
".$this->config['access_numb']['Moderated'].",
AND MI.status = 10
AND M.id = MI.member
$regionWhere
+ $countyWhere
AND M.access IN (
".$this->config['access_numb']['NoAccess'].",
".$this->config['access_numb']['Moderated'].",
}
}
- $counties = array();
+ $counties = array();
+ $countyList = '';
if ($actionData['request']['county-search']) {
// Convert comma separated list to an array
}
if ( isset( $counties ) && !empty( $counties ) ) {
- $where .= $whereSep." T.county IN (" . implode( ',', $counties ) . ")";
- $whereSep = ' AND ';
+ $where .= $whereSep." T.county IN (" . implode( ',', $counties ) . ")";
+ $whereSep = ' AND ';
+ $countyList = implode( ',', $counties );
}
}
// Get category data for possible use in search pick list for categories used in active member info records.
require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCategories.php';
$Categories = new GlmDataCategories($this->wpdb, $this->config);
- $categoryData = $Categories->getListSortedParentChild(false, true, $categoryRegionList); // Get only categories that are used in active member data
+ $categoryData = $Categories->getListSortedParentChild(false, true, $categoryRegionList, $countyList); // Get only categories that are used in active member data
// Get any numeric categories selected in the submitted shortcode and add to $cats array.
// This sets categories that are available for selection by the user