From eaffefbb0a864d5816c44dd4f792944e62436d86 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Tue, 4 Apr 2017 15:33:32 -0400 Subject: [PATCH] Added warnings for no counties to members dashboard and main dashboard GLM Associate widget --- models/admin/dashboardWidget/index.php | 7 ++++++ models/admin/members/index.php | 7 ++++++ views/admin/dashboardWidget/index.html | 31 +++++++++++++++----------- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/models/admin/dashboardWidget/index.php b/models/admin/dashboardWidget/index.php index 25c22a40..73a355b3 100644 --- a/models/admin/dashboardWidget/index.php +++ b/models/admin/dashboardWidget/index.php @@ -156,6 +156,12 @@ class GlmMembersAdmin_dashboardWidget_index extends GlmDataMembers $citiesStats = $Cities->getStats(); $haveCities = ($citiesStats > 0); + // Check for required Counties + require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCounties.php'; + $Counties = new GlmDataCounties($this->wpdb, $this->config); + $countiesStats = $Counties->getStats(); + $haveCounties = ($countiesStats > 0); + // Check for required Regions require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataRegions.php'; $Regions = new GlmDataRegions($this->wpdb, $this->config); @@ -190,6 +196,7 @@ class GlmMembersAdmin_dashboardWidget_index extends GlmDataMembers 'haveAmenities' => $haveAmenities, 'haveRegions' => $haveRegions, 'haveCities' => $haveCities, + 'haveCounties' => $haveCounties, 'pendingList' => $pendingList // 'addOns' => $this->config['addOns'] ); diff --git a/models/admin/members/index.php b/models/admin/members/index.php index 1f72d466..959b233f 100644 --- a/models/admin/members/index.php +++ b/models/admin/members/index.php @@ -132,6 +132,12 @@ class GlmMembersAdmin_members_index extends GlmDataMembers $citiesStats = $Cities->getStats(); $haveCities = ($citiesStats > 0); + // Check for required Counties + require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataCounties.php'; + $Counties = new GlmDataCounties($this->wpdb, $this->config); + $countiesStats = $Counties->getStats(); + $haveCounties = ($countiesStats > 0); + // Check for required Regions require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataRegions.php'; $Regions = new GlmDataRegions($this->wpdb, $this->config); @@ -167,6 +173,7 @@ class GlmMembersAdmin_members_index extends GlmDataMembers 'haveMemberTypes' => $haveMemberTypes, 'haveCategories' => $haveCategories, 'haveAmenities' => $haveAmenities, + 'haveCounties' => $haveCounties, 'haveRegions' => $haveRegions, 'haveCities' => $haveCities, 'pendingList' => $pendingList diff --git a/views/admin/dashboardWidget/index.html b/views/admin/dashboardWidget/index.html index 1de6800d..6101a0da 100644 --- a/views/admin/dashboardWidget/index.html +++ b/views/admin/dashboardWidget/index.html @@ -61,41 +61,46 @@ {if $settings.enable_members && apply_filters('glm_members_permit_admin_widget_warnings', true)} - {if !$haveMemberTypes || !$haveCategories || !$haveAmenities || !$haveCities || !$haveRegions || $numbMembers == 0} - + {if !$haveMemberTypes || !$haveCategories || !$haveAmenities || !$haveCities || !$haveCounties || !$haveRegions || $numbMembers == 0} {if !$haveMemberTypes} - - + + {/if} {if !$haveCategories} - - + + {/if} {if !$haveAmenities} - - + + {/if} {if !$haveCities} - - + + + + {/if} + {if !$haveCounties} + + + {/if} {if !$haveRegions} - - + + {/if} {if $numbMembers == 0} - + {/if} -- 2.17.1

Pending {$terms.term_member_cap} Information

No {$terms.term_member_cap} TypesAddNo {$terms.term_member_cap} Types ListedAdd
No {$terms.term_member_cap} CategoriesAddNo {$terms.term_member_cap} Categories ListedAdd
No AmenitiesAddNo Amenities ListedAdd
No CitiesAddNo Cities ListedAdd
No {$terms.term_county_plur_cap} ListedAdd
No RegionsAddNo Regions ListedAdd
No {$terms.term_member_plur_cap} No {$terms.term_member_plur_cap} Listed Add a {$terms.term_member_cap}