Can anyone guide me on how we can edit or customize activities sub-panel options of the account module?
Actually I want to open a full form on click of log call, meeting, and task button.
Thanks in Advance
Can anyone guide me on how we can edit or customize activities sub-panel options of the account module?
Actually I want to open a full form on click of log call, meeting, and task button.
Thanks in Advance
Hi there,
Ill take a look for a guide/post that will help you out. Just bare-with and ill get back to you
Looks like you’ve found the post i was going to link and then i remembered that method doesn’t work for activity. Lets see if we here back from the gent on there and go from there - Why every time i saw this button "Full Form" to see my custom Form?
Hi @Mac-Rae
Yeah I am stuck into this issue for over a month now.
In few custom subpanels I am able to open full form directly, but not in activities sub panel.
I hope we will get the solution soon.
If I’m not mistaken, there was an option that allows you to do this, but I can’t remember what it was called
Hi
Thanks for the Patience
Copy file from include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateTaskButton.php path and paste into the custom/include/generic/SugarWidgets/SugarWidgetSubPanelTopCreateTaskButton.php
After copying file to custom folder following below steps,
Line No. 89 : Remove form onsubmit event
Line No. 100 : Change hidden parameter to_pdf value(true to false)
Line No : 101 : Remove hidden parameter tpl
Line No : 138 : Change hidden parameter action value(SubpanelCreates to EditView)
Line No. 139 : Change hidden parameter module value(Home to Tasks)
Line No. 140 : Remove hidden parameter target_action
Copy file from include/generic/SugarWidgets/SugarWidgetSubPanelTopScheduleCallButton.php path and paste into the custom/include/generic/SugarWidgets/SugarWidgetSubPanelTopScheduleCallButton.php
After copying file to custom folder following below steps,
Line No. 89 : Remove form onsubmit event
Line No. 100 : Change hidden parameter to_pdf value(true to false)
Line No. 101 : Remove hidden parameter tpl
Line No. 138 : Change hidden parameter action value(SubpanelCreates to EditView)
Line No. 139 : Change hidden parameter module value(Home to Calls)
Line No. 140 : Remove hidden parameter target_action
Copy file from include/generic/SugarWidgets/SugarWidgetSubPanelTopScheduleMeetingButton.php path and paste into the custom/include/generic/SugarWidgets/SugarWidgetSubPanelTopScheduleMeetingButton.php
After copying file to custom folder following below steps,
Line No. 89 : Remove form onsubmit event
Line No. 100 : Change hidden parameter to_pdf value(true to false)
Line No. 101 : Remove hidden parameter tpl
Line No. 138 : Change hidden parameter action value(SubpanelCreates to EditView)
Line No. 139 : Change hidden parameter module value(Home to Meetings)
Line No. 140 : Remove hidden parameter target_action
Note : Above changes have been applied to all the modules where Activities Subpanel is available. If you want to apply only on Account Module then you can add module condition in each change.
I hope it help you
Thanks
Urvi
Not tested this yet but looks amazing, really appreciate the detail and i hope it works for those who need it @jyotip let us know
Hi Urvi
You are awesome @Urvi and your solution worked flawlessly as expected.
Thanks for the detailed explanation and solution.
Thank you for your kind words
Very good hack Urvi!
Here is a full code for Task Button only. Posting for sloppy devs who can’t read the full post.
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
class SugarWidgetSubPanelTopCreateTaskButton extends
SugarWidgetSubPanelTopButtonQuickCreate
{
public function &_get_form($defines, $additionalFormFields = null, $asUrl = false)
{
global $app_strings;
global $currentModule;
$this->module="Tasks";
$this->subpanelDiv = "activities";
// Create the additional form fields with real values if they were not passed in
if (empty($additionalFormFields) && $this->additional_form_fields) {
foreach ($this->additional_form_fields as $key=>$value) {
if (!empty($defines['focus']->$value)) {
$additionalFormFields[$key] = $defines['focus']->$value;
} else {
$additionalFormFields[$key] = '';
}
}
}
if (!empty($this->module)) {
$defines['child_module_name'] = $this->module;
} else {
$defines['child_module_name'] = $defines['module'];
}
if (empty($defines['subpanelDiv'])) {
$defines['subpanelDiv'] = $this->subpanelDiv;
}
$defines['parent_bean_name'] = get_class($defines['focus']);
$form = 'form' . $defines['child_module_name'];
//BK Removed Onsubmit Event
$button = '<form action="index.php" method="post" name="form" id="form' . $form . "\">\n";
//module_button is used to override the value of module name
$button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n";
$button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n";
if (isset($defines['focus']->name)) {
$button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>";
}
$button .= '<input type="hidden" name="to_pdf" value="false" />';
//BK $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />';
$button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n";
$button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n";
$button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n";
$button .= '<input type="hidden" name="record" value="" />';
// TODO: move this out and get $additionalFormFields working properly
if (empty($additionalFormFields['parent_type'])) {
if ($defines['focus']->object_name=='Contact') {
$additionalFormFields['parent_type'] = 'Accounts';
} else {
$additionalFormFields['parent_type'] = $defines['focus']->module_dir;
}
}
if (empty($additionalFormFields['parent_name'])) {
if ($defines['focus']->object_name=='Contact') {
$additionalFormFields['parent_name'] = $defines['focus']->account_name;
$additionalFormFields['account_name'] = $defines['focus']->account_name;
} else {
$additionalFormFields['parent_name'] = $defines['focus']->name;
}
}
if (empty($additionalFormFields['parent_id'])) {
if ($defines['focus']->object_name=='Contact') {
$additionalFormFields['parent_id'] = $defines['focus']->account_id;
$additionalFormFields['account_id'] = $defines['focus']->account_id;
} else {
$additionalFormFields['parent_id'] = $defines['focus']->id;
}
}
// BK changed value from SubpanelCreates to EditView
$button .= '<input type="hidden" name="action" value="EditView" />' . "\n";
$button .= '<input type="hidden" name="module" value="Tasks" />' . "\n";
//BK$button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n";
// fill in additional form fields for all but action
foreach ($additionalFormFields as $key => $value) {
if ($key != 'action') {
$button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n";
}
}
return $button;
}
public function display($defines, $additionalFormFields = null, $nonbutton = false)
{
$focus = new Task;
if (!$focus->ACLAccess('EditView')) {
return '';
}
return parent::display($defines, $additionalFormFields);
}
}
Thank you for your kind word