Hi pgr
I am trying to do it. I am a little concerned I might not put the right Notes or Tasks ref in the correct locations.
Can you tell me if these look correct.
custom/Extension/modules/Accounts/Ext/Layoutdefs/Notes.php
<?php
$layout_defs["Accounts"]["subpanel_setup"]['notes'] = array(
'order' => 80,
'module' => 'Notes',
'sort_order' => 'asc',
'sort_by' => 'first_name, last_name',
'subpanel_name' => 'default',
'get_subpanel_data' => 'function:getRelatedLeadsQueryData',
'function_parameters' => array(
'import_function_file' => 'custom/modules/Accounts/GetNotesSubpanelData.php',
'link' => 'leads'
),
'add_subpanel_data' => 'Note_id',
'title_key' => 'LBL_Notes_SUBPANEL_TITLE',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateLeadNameButton'),
array('widget_class' => 'SubPanelTopSelectButton',
'popup_module' => 'Opportunities',
'mode' => 'MultiSelect',
),
),
);
custom/modules/Accounts/GetNotesSubpanelData.php
<?php
require_once 'custom/modules/Accounts/BuildNotesSubpanelQueryService.php';
function getRelatedNotesQueryData($param){
$service = new BuildNotesSubpanelQueryService();
return $service->buildQuery($param);
new file
custom/modules/Accounts/BuildNotesSubpanelQueryService.php
<?php
class BuildNotesSubpanelQueryService
{
public function __construct()
{}
public function buildQuery($param)
{
global $app;
$controller = $app->controller;
$bean = $controller->bean;
$query = "
SELECT *
FROM leads
WHERE notes.account_id = '$bean->id'
AND notes.status not in ('converted')
AND notes.deleted = 0
";
return $query;
}
}
I used the label LBL_NOTES_SUBPANEL_TITLE, will this work?
If I replace NOTES for TASKS will that work?
Thank you for looking at my attempt
Princeps