I'm hoping one of the wiser and more experienced Symfony experts will be kind enough to help me with this.
Running Symfony 1.1 with the new forms.
I am able to pull up a list of users into the sfWidgetFormPropelSelect, but I'd like to be able to "filter out" certain groups.
For example, I have 4 groups: Admin, SuperUsers, Associates & Customers.
sf_Guard_User Table (condensed)
ID | Their name/access
ID | Description
I have a page where a user can create a support ticket. If the person viewing this page has an access level above customer, they can select who to assign the ticket to.
- All users (including customers) are in the sf_Guard_User table.
- In the sf_Guard_Group table I have set up the 4 levels of access and the sf_Guard_User_Group table has linked these together.
user_id | group_id
And both permission tables appear the same as the group tables.
I have tried the following code in the TicketForm.class.php file to control my form results when creating/editing a ticket:
In the $this->setWidgets(array(... section
'assignedto' => new sfWidgetFormPropelSelect(array('model' => 'sfGuardUser', 'add_empty' => false)),
And just below the setWidgets secion:
$assignedtoCriteria = new Criteria;
$assignedtoCriteria->add(sfGuardUserGroupPeer::GROUP_ID, '4', Criteria::NOT_EQUAL);
I'm trying to filter out the customers from the "assigned to" pull down. While no errors are thrown, no filtering is taking place either. What am I missing?