From 61f659c95a5c2672b9e60504924ea3c47b1d4bac Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 7 Jul 2016 09:09:06 -0400 Subject: [PATCH] Solved issue with php notice Was giving an notice about undefined stuff in smarty template. Adding selected key to the groups array fixed this. --- models/admin/settings/leads.php | 12 +++++-- views/admin/settings/leads.html | 58 ++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/models/admin/settings/leads.php b/models/admin/settings/leads.php index 5c2068e..30efa3c 100644 --- a/models/admin/settings/leads.php +++ b/models/admin/settings/leads.php @@ -143,13 +143,13 @@ class GlmMembersAdmin_settings_leads extends GlmDataInterests case 'updateGroup': if ( $id > 0 ) { $groupData->updateEntry( $id ); - } + } break; case 'deleteGroup': if ( $id > 0 ) { $groupData->deleteEntry( $id, true ); - } + } break; default: @@ -165,6 +165,14 @@ class GlmMembersAdmin_settings_leads extends GlmDataInterests $groups = $groupData->getList(); + // If we have groups, add "selected" element default false; + if (is_array($groups)) { + reset($groups); + while (list($k, $v) = each($groups)) { + $groups[$k]['selected'] = false; + } + } + // Get a current list of interests $where = null; if ( isset( $_REQUEST['filterGroups'] ) ) { diff --git a/views/admin/settings/leads.html b/views/admin/settings/leads.html index 125611b..ba5c2a7 100644 --- a/views/admin/settings/leads.html +++ b/views/admin/settings/leads.html @@ -5,20 +5,24 @@ Groups -
- -

- Filter by Groups: - - -

-
+ + +
+
+ +

+ Filter by Groups: + + +

+
+
Add an Interest
@@ -54,7 +58,7 @@

* Required

Cancel - + @@ -101,11 +105,11 @@

* Required

Cancel - + - - + +

Interests

@@ -149,7 +153,7 @@
- - + + {include file='admin/footer.html'} -- 2.17.1