From b50f8eee4281d90093ace1a609cc2e2908ae46c4 Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Wed, 15 Nov 2006 20:42:49 +0000
Subject: [PATCH] more of the same... :(

---
 .../models/tables/GroupImpliedMemberships.php       |  6 ++++--
 application/views/user_admin.xhtml                  | 13 +++++++------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/application/models/tables/GroupImpliedMemberships.php b/application/models/tables/GroupImpliedMemberships.php
index ccb83b4d..76c07bbc 100644
--- a/application/models/tables/GroupImpliedMemberships.php
+++ b/application/models/tables/GroupImpliedMemberships.php
@@ -109,7 +109,8 @@ class GroupImpliedMemberships extends Nmc_Db_Table
         }
 
         $groupIds[] = -1;
-        $where = $db->quoteInto('id IN(?)', $groupIds);
+        $groupPrimaryKeyName = Groups::getInstance()->getPrimaryKeyName();
+        $where = $db->quoteInto('`' . $groupPrimaryKeyName . '` IN(?)', $groupIds);
         $groups = Groups::getInstance()->fetchAllWithoutPrimaries($where);
         return $groups;
     }
@@ -145,7 +146,8 @@ class GroupImpliedMemberships extends Nmc_Db_Table
         $userIds = $this->_db->fetchCol($select);
 
         $userIds[] = -1;
-        $where = $this->_db->quoteInto('id IN(?)', $userIds);
+        $userPrimaryKeyName = Users::getInstance()->getPrimaryKeyName();
+        $where = $this->_db->quoteInto('`' . $userPrimaryKeyName . '` IN(?)', $userIds);
         $users = Users::getInstance()->fetchAll($where);
         return $users;
     }
diff --git a/application/views/user_admin.xhtml b/application/views/user_admin.xhtml
index 957cef65..8b36b4f4 100644
--- a/application/views/user_admin.xhtml
+++ b/application/views/user_admin.xhtml
@@ -51,9 +51,9 @@
                                    array('size' => 32)); ?>
         <label for="groups">Groups:</label>
         <?php echo $this->formSelect('groups',
-                                     $this->user->getGroups(false)->columnToArray('id'),
+                                     $this->user->getGroups(false)->columnToArray(Groups::getInstance()->getPrimaryKeyName(true)),
                                      array('multiple' => 'multiple'),
-                                     $this->groups->columnToArray('name', 'id')); ?>
+                                     $this->groups->columnToArray('name', Groups::getInstance()->getPrimaryKeyName(true))); ?>
         <?php echo $this->formSubmit('Submit', 'Submit'); ?>
     </form>
 </div>
@@ -73,15 +73,16 @@
                                        $this->group->description,
                                        array('rows' => 5, 'cols' => 50)); ?>
         <label for="groups">Groups:</label>
+        <?php print_r($this->group->getGroups(false)); ?>
         <?php echo $this->formSelect('groups',
-                                     $this->group->getGroups(false)->columnToArray('id'),
+                                     $this->group->getGroups(false)->columnToArray(Groups::getInstance()->getPrimaryKeyName(true)),
                                      array('multiple' => 'multiple'),
-                                     $this->groups->columnToArray('name', 'id')); ?>
+                                     $this->groups->columnToArray('name', Groups::getInstance()->getPrimaryKeyName(true))); ?>
         <label for="users">Users:</label>
         <?php echo $this->formSelect('users',
-                                     $this->group->getUsers(false)->columnToArray('id'),
+                                     $this->group->getUsers(false)->columnToArray(Users::getInstance()->getPrimaryKeyName(true)),
                                      array('multiple' => 'multiple'),
-                                     $this->users->columnToArray('userName', 'id')); ?>
+                                     $this->users->columnToArray('userName', Users::getInstance()->getPrimaryKeyName(true))); ?>
         <?php echo $this->formSubmit('Submit', 'Submit'); ?>
     </form>
 </div>
-- 
GitLab