Filter in Subpanel suitecrm 7.10

Hey All!

I know this is an old thread but there aren’t many on this topic.

I’m trying to use this to filter project tasks by status. I’m pretty close except that it’s not actually filtering. Is there something else I need to do besides this? (the button works but doesn’t actually filter the records)…

<?php
unset($layout_defs["Project"]["subpanel_setup"]['projecttask']);
// key in "subpanel_setup" should be the name of relationship
$layout_defs["Project"]["subpanel_setup"]['projects_project_tasks'] = array (
		'order' => 10,
		'sort_by' => 'project_task_id',
		'sort_order' => 'asc',
		'module' => 'ProjectTask',
		'subpanel_name' => 'default',
		'get_subpanel_data' => 'projecttask',
		'title_key' => 'LBL_PROJECT_TASKS_SUBPANEL_TITLE',
		'top_buttons' => array(
			array('widget_class' => 'SubPanelTopButtonQuickCreate'),
			array('widget_class' => 'SubPanelTopSelectButton','mode'=>'MultiSelect'),
            array('widget_class' => 'SubPanelTopFilterButton'),
		),
);
$layout_defs["Project"]["subpanel_setup"]['projects_project_tasks']['searchdefs'] = array ( 
	'name' => array (
            	'Status' => 'status',
            	'default' => true,
				'type' => 'enum',
                'options' => $GLOBALS['app_list_strings']['project_task_status_options'],
            	'width' => '10%',
        ),
);

Ok with a little more trial and error, I got it to work! This is cool!

The part that messed it up is defining the type and the options. If you leave that out it works like this:

$layout_defs["Project"]["subpanel_setup"]['projects_project_tasks']['searchdefs'] = array ( 
	'name' => array (
            	'name' => 'status',
				'default' => true,
				'width' => '10%',
        ),
);

2 Likes