Also if not documented, it is possible to add a partial filter completely managed from the developer.
Define in config/generator.yml
generator: param: list: fields: filter_on_account: {name: Account, filter_criteria_disabled: true } filters: [_filter_on_account]
Now define in templates/_filter_on_account.php something like
<?php if ($sf_user->hasCredential('admin')) { $c = new Criteria(); $c->addAscendingOrderByColumn(ArAsteriskAccountPeer::NAME); $accounts = ArAsteriskAccountPeer::doSelect($c); $options = array(""=>""); foreach($accounts as $account) { $options[$account->getId()] = $account->getName(); } $defaultChoice = ""; if (isset($filters['filter_on_account'])) { $defaultChoice = $filters['filter_on_account']; } echo select_tag('filters[filter_on_account]', options_for_select($options, $defaultChoice)); } ?>
And then in actions/actions.class.php redefine the function
protected function addFiltersCriteria($c) { if (isset($this->filters['filter_on_account'])) { $accountId = $this->filters['filter_on_account']; if ($accountId != "") { $c->add(ArAsteriskAccountPeer::ID, $accountId); } } parent::addFiltersCriteria($c); }
documented on: 2007-02-07, Massimo Zaniboni