diff --git a/application/models/tables/GroupImpliedMemberships.php b/application/models/tables/GroupImpliedMemberships.php index ccb83b4dcdf33d5231cfef65b69a01c3da3b3bc2..76c07bbc0e672e9767a27091411cdda106aa13fe 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 957cef653cda2f5a324cfe06a50460cad304d893..8b36b4f4cbd5950f970c800986e5754cdeeb90ae 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>