I have a custom search extension for contacts. Search result shows by default "VIEW EDIT" option in "ACTION" Column.
How Can I bring the "MORE" option just like the one appears if I use built in Basic search function from Search menu?
Content of my customsearch.php
<?php
class CRM_Guestsearch_Form_Search_Guestsearch extends CRM_Contact_Form_Search_Custom_Base implements CRM_Contact_Form_Search_Interface {
function __construct(&$formValues) {
parent::__construct($formValues);
}
function buildForm(&$form) {
CRM_Utils_System::setTitle(ts('Recently Registered Guest (Unassigned)'));
$form->assign('elements', array('name'));
}
function summary() {
return NULL;
// return array(
// 'summary' => 'This is a summary',
// 'total' => 50.0,
// );
}
function &columns() {
// return by reference
$columns = array(
ts('Contact Type') => 'contact_sub_type',
ts('Name') => 'sort_name',
ts('Phone') => 'phone',
ts('Email') => 'email',
ts('Date of visit') => CIVICRM_GUESTSEARCH_CUSTOM_COLUMN_NAME,
);
return $columns;
}
function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) {
return $this->sql($this->select(), $offset, $rowcount, null, $includeContactIDs, NULL);
}
function select() {
return "
contact_a.id as contact_id ,
contact_a.contact_sub_type as contact_sub_type,
contact_a.sort_name as sort_name,
phone.phone ,
email.email ,
date.
" . CIVICRM_GUESTSEARCH_CUSTOM_COLUMN_NAME;
}
function from() {
return "
FROM civicrm_contact contact_a
LEFT JOIN civicrm_activity_contact a ON (a.contact_id = contact_a.id)
LEFT JOIN civicrm_phone phone ON (phone.contact_id = contact_a.id)
LEFT JOIN civicrm_email email ON (email.contact_id = contact_a.id)
LEFT JOIN " . CIVICRM_GUESTSEARCH_CUSTOM_TABLE_NAME . " date ON (date.entity_id = contact_a.id)
";
}
function where($includeContactIDs = false) {
$params = array();
$where = "contact_a.contact_sub_type = 'Guest' AND activity_id IS NULL ORDER BY date." . CIVICRM_GUESTSEARCH_CUSTOM_COLUMN_NAME . " ASC ";
return $where;
}
function templateFile() {
return 'CRM/Contact/Form/Search/Custom.tpl';
}
}