How to add custom action button in suiteCRM module sub panel list? - sugarcrm

I need some suggestion in my suite CRM module integration.
I have a sub-panel in one of my modules and required to add one more edit button to redirect to a custom form to take some input from the user for each row separately.
Below is a sample image of my sub-panel list view.
In the above image on click of the edit button of a row, there is a remove button, I want to add one more custom button after remove and need to redirect from there to my new form.
I have checked some of forums and blogs but didn't found the solution.

To add a button you will need to modify the metadata of that sub-panel. In metadata, you will see the following code for the Edit and Remove buttons:
'edit_button' =>
array (
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'module' => 'Contacts',
'width' => '5%',
'default' => true,
),
'remove_button' =>
array (
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Contacts',
'width' => '5%',
'default' => true,
),
You can add your new button using same array syntax. As you can see that every button use specific widget class(defined as widget_class) therefore you will need to add new widget_class class for that. You can find existing widget classes in this folder: include/generic/SugarWidgets.
Cheers!

Related

How to unmerge edit and remove buttons in sugarCRM?

When in SugarCRM CE when I insert an edit button into a custom sub panel meta file for some reason it merges it with the "remove" button as per attach. So the edit button gets a dropdown arrow and 'remove' button appears when we click on the arrow.
The code I use to show the buttons is
// Edit button
'edit_button'=>array(
'widget_class' => 'SubPanelEditUsersprjct_projectsButton',
'projects_users_id'=>'projects_users_id',
'module' => 'Users',
'width' => '5%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'module' => 'Users',
'width' => '4%',
'linked_field' => 'users',
),
How do I get the 2 buttons to show up next to each other.
Exact same issue as described here: http://wiki-crm-forum.com/forum/viewtopic.php?f=2&t=9632&p=33429&sid=e82d1abbf9f4d0b39f01137dd9e4c913#p33429 but there's no solution it seems
I see the problem but I have a workaround.
You may remove "Remove" from subpanels and use this free plugin to add "Remove" button in subpanel in front of each row.
https://store.outrightcrm.com/product/outright-listview-delete/

Adding new main menu item to Moodle Mobile 3.5

I am trying to develop a new plugin to add an item to the main menu more items in Moodle Mobile 3.5 using PHP and Angular/Ionic 3. I want to display a new main menu item "Agenda" with icon.
After creating the db\mobile.php file and define the delegate as "CoreMainMenuDelegate", the problem now is showing the name in the main menu as "plugin.local_parentagenda.Agenda", and without icon.
What can I try to resolve this?
Moodle site version: 3.3.1
Moodle Mobile version: 3.5
You must add a valid key string from lang definition in displaydata as a title, and the icon is a string from ionicicons. Search for ion-md, only those work.
Here an example plugin local/example/db/mobile.php
$addons = array(
"local_example" => array( // Plugin identifier
'handlers' => array( // Different places where the plugin will display content.
'localexample' => array( // Handler unique name (alphanumeric).
'displaydata' => array(
'title' => 'pluginname',
'icon' => 'bluetooth',
'class' => '',
),
'delegate' => 'CoreMainMenuDelegate', // Delegate (where to display the link to the plugin)
'method' => 'mobile_test_view', // Main function in \local_example\output\mobile
)
),
'lang' => array( // Language strings that are used in all the handlers.
array('pluginname', 'local_example'),
array('example:viewexample', 'local_example')
),
));
Note the title property in displaydata array and the pluginname definition in lang array, both are required.

SugarCRM Filter From Related Module

I am trying to make a custom filter based on another module in sugarCRM 8.0.1.
I have a module Ev_Registrations that has one Ev_Event and one Contact, the tables are:
ev_registrations
ev_registrations_contacts_c
ev_registrations_ev_events_c
How do I make a dropdown for event or contact on the list page as highlighted below?
I've tried making a custom filter, and managed to get it showing up in the list, however, it doesn't seem to be actually filtering by the event name.
$viewdefs['EV_Registrations']['base']['filter']['basic']['filters'][] = array(
'id' => 'filterRegistrationByEvent',
'name' => 'LBL_FILTER_REGISTRATION_BY_EVENT',
'filter_definition' => array(
array(
'ev_registrations_ev_events_c.ev_events.name' => '2019 Foo Bar Event',
),
),
'editable' => false,
'is_template' => false,
);

How to change the default order of the sub panels in the opportunities module

I have a need to change the default order of the sub panels in the opportunities module. I have been looking for a solution for a while and have not found a solution that works.
I am using SugarCRM CE 6.5.13
Thanks in advance.
Your question is actually unclear. Are you asking for the order of a subpanel meaning how to place one subpanel above another. Or is your question concerning the order of the data inside a subpanel?
A fast response to both is:
in {MainModule}/metadata/subpaneldefs.php there should be the sort order declared for the subpanel like this:
$layout_defs[{MainModule}] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' => array(
'{TheSubpanel}' => array(
'order' => 1, // influences the place of the subpanel relative to the other subpanels
'module' => '{TheSubpanel}',
'subpanel_name' => 'default', // attention please check the subpanel module to make sure there is not another setting overriding this setting
'sort_order' => 'desc',
'sort_by' => 'date_entered',
...
check also the file defined above that contains the subpanels fields. In this case it can be found in {TheSubpanel}/metadata/subpanels/default.php
$module_name = '{TheSubpanel}';
$subpanel_layout = array(
'top_buttons' => array(
'where' => '',
'sort_order' => 'desc',
'sort_by' => 'date_entered',
Please consider that after a change you need to run 'rebuild & repair' and if you manually clicked on a sort field then you should clear your cookie cache and log in again too.
There are other questions on stack overflow concering this like how-to-change-default-sort-in-custom-subpanel-sugarcrm
If you do not want code level customization then you can just drag and drop the sequence of subpanels on detail view of record. The sequence of subpanel will be saved.

Magento Custom Module - WYSIWYG image browse issue

I have a custom module with a content field (WYSIWYG editor)
When I select the insert image button, the following popup appears. For some reason the 'browse' button at the side of the Image URL has disappeared. Can someone point me in the right direction to get the image icon back? (what block/controller etc)
What is required when adding the full featured WYSIWYG editor to a custom magento module?
This is my form field element within Form.php (block)
$fieldset->addField('post_content', 'editor', array(
'name' => 'post_content',
'label' => Mage::helper('faqs')->__('Answer'),
'title' => Mage::helper('faqs')->__('Answer'),
'style' => 'width:700px; height:500px;',
'wysiwyg' => true,
));
Thank you.
Jonny
Had to find out the hard way, but the solution is quite simple:
Please check the permissions of your Role your Admin is in unser System=>Permissions=>Roles
There you can find in the Tab "Role Resources" the Checkbox "Media Gallery". Make sure this checkbox is ticked!
Then, clean cache, log out and in again and it should work.
Cheers!
I managed to sort this by adding some configuration options to the field,
Add the following code above the addField() of your WYSIWYG,
$configSettings = Mage::getSingleton('cms/wysiwyg_config')->getConfig(
array( 'add_widgets' => false, 'add_variables' => false, 'add_images' => false, 'files_browser_window_url'=> $this->getBaseUrl().'admin/cms_wysiwyg_images/index/'));
Once you've added the code, you need to add another param to the addField called 'config' calling your $configSettings variable.
$fieldset->addField('post_content', 'editor', array(
'name' => 'post_content',
'label' => Mage::helper('faqs')->__('Answer'),
'title' => Mage::helper('faqs')->__('Answer'),
'style' => 'width:700px; height:500px;',
'wysiwyg' => true,
'config' => $configSettings
));