$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object);
How do you use the printFieldListOption hook on list pages so that you can populate a dropdown in a new column and filter the results? I’m having trouble finding a good example.
public function printFieldListOption($parameters, &$object, &$action, $hookmanager)
{
global $langs, $conf, $user;
$this->resprints .= '<td class="liste_titre">Dropdown</td>';
return 0;
}
I sent you direct messages for utilizing this hook. It is intended to be used in conjunction with the following hooks.
printFieldListSelect - extend the column(s) returned by the search results
printFieldListFrom - extend the query associations e.g. JOIN|LEFT JOIN|etc
printFieldListWhere - extend the query conditions to account for the submitted filter parameters
printFieldListTitle - [column header I believe]
printFieldListOption - [Search filter function - maybe preselect the value submittted; Provides the form field for filtering]
printFieldListValue - [code-logic for printing the value for the column for each row]