ok so I have tried a couple ways here.
First - created in /custom/include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateAuthServiceButton.php
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
class SugarWidgetSubPanelTopCreateAuthServiceButton extends SugarWidgetSubPanelTopButtonQuickCreate
{
public function getWidgetId($buttonSuffix = true)
{
return parent::getWidgetId();
}
public function display($defines, $additionalFormFields = null, $nonbutton = false)
{
global $app_strings;
global $currentModule;
$title = $app_strings['LBL_NEW_BUTTON_TITLE'];
//$accesskey = $app_strings['LBL_NEW_BUTTON_KEY'];
$value = $app_strings['LBL_NEW_BUTTON_LABEL'];
$this->module = 'SVCS_Auth_Svcs';
if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) {
$button = "<input title='$title'class='button' type='button' name='button' value=' $value ' disabled/>\n";
return $button;
}
$additionalFormFields = array();
if (isset($defines['focus']->name_tag)) {
$additionalFormFields['name_tag'] = $defines['focus']->name_tag;
}
/*
if (isset($defines['focus']->billing_address_city)) {
$additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city;
}
if (isset($defines['focus']->billing_address_state)) {
$additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state;
}
if (isset($defines['focus']->billing_address_country)) {
$additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country;
}
if (isset($defines['focus']->billing_address_postalcode)) {
$additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode;
}
if (isset($defines['focus']->phone_office)) {
$additionalFormFields['phone_work'] = $defines['focus']->phone_office;
}
*/
$button = $this->_get_form($defines, $additionalFormFields);
$button .= "<input title='$title' class='button' type='submit' name='{$this->getWidgetId()}' id='{$this->getWidgetId()}' value=' $value '/>\n";
$button .= "</form>";
return $button;
}
}
Then in /custom/modules/CLNTS_Clients/metadata/subpaneldefs.php
<?php
$module_name = 'CLNTS_Clients';
$layout_defs[$module_name]['subpanel_setup']['securitygroups'] = array(
'top_buttons' => array(
array('widget_class'=>'SugarWidgetSubPanelTopCreateAuthServiceButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'SecurityGroups', 'mode' => 'MultiSelect')),
'order' => 900,
'sort_by' => 'name',
'sort_order' => 'asc',
'module' => 'SecurityGroups',
'refresh_page' => 1,
'subpanel_name' => 'default',
'get_subpanel_data' => 'SecurityGroups',
'add_subpanel_data' => 'securitygroup_id',
'title_key' => 'LBL_SECURITYGROUPS_SUBPANEL_TITLE',
);
I then went into one of our clients, to the subpanel for SVCS_Auth_Svcs and clicked the Actions drop down - create.
name_tag did not pull over to the SVCS_Auth_Svcs screen from the create. I did also try placing the Widget file in the /include/generic/SugarWidgets folder… I did a rebuild and repair after as well.
Is there any syntax issue here, or logic issue? the CLNTS_Clients is a 1:M to the SVCS_Auth_Svcs module, I did notice that the Accounts:Clients is M:M so I’m unsure if that is causing a different reaction here.
I have also read that the Subpanel create follows the QuickCreate process (and doesn’t access pre-display and some other things - not fully applicable here), but should I be doing an over ride on the SugarWidgetSubPanelTopButtonQuickCreate.php instead?