Fixed problems with adding categories and selecting active status for a member info...
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 24 Mar 2015 19:49:03 +0000 (15:49 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 24 Mar 2015 19:49:03 +0000 (15:49 -0400)
classes/data/dataCategories.php
classes/data/dataCategoryMemberInfo.php
lib/GlmDataAbstract/GlmDataAbstract_Programmers_Manual.pdf
misc/notes.txt
models/admin/member/index.php
models/admin/member/memberInfo.php

index 40db513..dca59b4 100644 (file)
@@ -221,7 +221,7 @@ class GlmDataCategories extends GlmDataAbstract
             // Check if the name already exists
             $sql = "
                 SELECT id
-                  FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."cateogries
+                  FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."categories
                  WHERE name = '$parent'
             ;";
             $parentCategory = $this->wpdb->get_row($sql, ARRAY_A);
index 55d7632..821a576 100644 (file)
@@ -294,6 +294,27 @@ class GlmDataCategoryMemberInfo extends GlmDataAbstract
 
         return $current;
     }
+
+    /**
+     * Clear all categories for a specific member info record
+     *
+     * @param integer $memberInfoID Member Information Record ID
+     *
+     * @return null
+     *
+     * @access public
+     */
+
+    public function clearMemberInfoCategories($memberInfoID) {
+
+        $sql = "
+            DELETE FROM ".GLM_MEMBERS_PLUGIN_DB_PREFIX."category_member_info
+             WHERE member_info = $memberInfoID
+        ;";
+        $this->wpdb->query($sql);
+
+
+    }
 }
 
 ?>
\ No newline at end of file
index 8cb9e4a..51b1643 100644 (file)
Binary files a/lib/GlmDataAbstract/GlmDataAbstract_Programmers_Manual.pdf and b/lib/GlmDataAbstract/GlmDataAbstract_Programmers_Manual.pdf differ
index 053e7aa..968827c 100644 (file)
@@ -3,9 +3,6 @@ Development Notes
 
 ADMIN AREA
 
-* Member Info Add/Edit
-    - When editing a member info record, if the user specifies a new main category more than once with the "Add a new Category" button, the category is created multiple times.
-
 * Consider paginating certain lists
 
 * On all admin lists - add sort order links to headers
@@ -18,12 +15,8 @@ ADMIN AREA
 
 FRONT-END
 
-* Add amenities to member lists and maps, and member detail pages
-
 
 DATA ABSTRACT
 
-* Add option to build alpha lists
-
 * Add pagenation, option to return total number of entries and number returned for display for getList()
 
index 8e26efb..30b7c88 100644 (file)
@@ -278,7 +278,8 @@ class GlmMembersAdmin_member_index extends GlmDataMembers
                      $sql = "
                          UPDATE ".GLM_MEMBERS_PLUGIN_DB_PREFIX."member_info
                             SET status = ".$this->config['status_numb']['Inactive']."
-                          WHERE status = ".$this->config['status_numb']['Active']."
+                          WHERE member = $memberID
+                            AND status = ".$this->config['status_numb']['Active']."
                      ;";
                      $this->wpdb->query($sql);
 
index 20a03f8..3361d89 100644 (file)
@@ -469,7 +469,10 @@ class GlmMembersAdmin_member_memberInfo extends GlmDataMemberInfo
 
                 } // For each category being submitted
 
-            } // If there's any categories selected
+            // Otherwise there's no categories submitted, so make sure there's none stored
+            } else {
+                $CategoryMemberInfo->clearMemberInfoCategories($memberInfoID);
+            }
 
             // Now get the (possibly updated) category list for this member info record
             $categoryMemberInfo = $CategoryMemberInfo->getListWithParents($memberInfoID);