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

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.

Related

Typo3 - How to add dynamic value in TCA MM table

I'm trying to add a column to the relation table (MM table) in Typo3. Let's say I have my tables user, wanted_car and wanted_car_mm which is my relation table. So in wanted_car_mm I'll know what user want which car, but I want to add the column need_faster in wanted_car_mm, which is a boolean, that tells me who should have it faster. A lot of users could need it faster, there's no order.
How do I add this column, map the value and correctly retrieve this information when I get all my users?
I currently have this in my TCA config for user:
'wanted_cars' => array(
'exclude' => 1,
'label' => 'LLL:EXT:caa_my_plugin/Resources/Private/Language/locallang_db.xlf:my_title',
'l10n_mode' => 'exclude',
'config' => array(
'type' => 'select',
'foreign_table' => 'wanted_car',
'MM' => 'wanted_car_mm',
'MM_insert_fields' => array('need_faster' => '???'),
'MM_table_where' => ' AND wanted_car_mm.need_faster = ???',
'maxitems' => 9999,
'multiple' => 0,
'renderType' => 'selectCheckBox',
),
),
I feel like this is how I should add the column and retrieve it correctly, but I have no clue how to map the correct value.. that I should also put in my where clause.. I don't know how this can be possible going like this, but I can't find any other way of doing it.
The value must be specified when creating a user.
You need an intermediate table for that. The full docs for that can be found on https://docs.typo3.org/m/typo3/reference-tca/master/en-us/ColumnsConfig/Type/Inline.html
a screenshot and old example which still should work can also be found on https://wiki.typo3.org/Inline_Relational_Record_Editing_Attributes

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

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!

SuiteCRM setting initial_filter of the aos_products popup

I need to add a custom filter to the aos_products popup where you can choose the line items from the aos_quotes edit view.
What the filter should look like is equal to WHERE aos_procucts_cstm.remaining_capacity_c > 0.
What I have so far is in editviewdefs.php of the aos_product module:
array(
'name' => 'remaining_capacity_c',
'label' => 'LBL_RESTKAPAZITAET',
'displayParams' =>
array(
'initial_filter' => array(
'&remaining_capacity_c > 0',
),
),
),
but this does not work as intended. I believe that it is not possible to set up the filter like I did. So any suggestions are highly appreciated.
Following below steps:
remaining_capacity_c needs to be a field type that where you can "Enable Range Search" in studio. So I would suggest using "Integer" type in this case.
Second, you will need to add the field into the popup search definition.
you will need to set the variables required to do a range search.
Example:
'initial_filter' => array(
'&remaining_capacity_c_advanced_range_choice=greater_than&range_remaining_capacity_c_advanced=0&start_range_remaining_capacity_c_advanced=&end_remaining_range_capacity_c_advanced=',
),
EDIT
You can use the keys found in date_range_search_dom dropdown. just set the [fieldname]_advanced_range_choice to one of the keys and range_[fieldname]_advanced to the value you wish to compare. When you wish to edit the start and end. You need to specify the start_range_[fieldname]_advanced and end_range_[fieldname]_advanced values.

Restrict output of typo3 extbase backend module

I wrote a backendmodule with extbase in typo3 4.5 and I would like to show different extbase models for different usergroups, but I don't know how. My idea was to register one backendmodul per usergroup, but i think its too laborious. I don't want to check the user group and their rights in my extension. Is there a way to get this?
Example:
models | usergroup: editor could see
specific models | usergroup: specific_editor could see
Please explain the scenario in details. From this i can say this is possible . All you do see to check the user group and according to this you can create a switchable actions in your controller .
What about having a few checkboxes in extension manager - extension configuration tab for selecting the user group and their rights in your extension?
I try to show different extbase-model-entries to different users in my own backend-modul. For example user 'editor' only see 'entry1' and 'special_editor' see 'entry2' and 'entry3'. My idea was to extend the usergroup tca and add a selectfield for my models. My backend-modul will check the current backenduser to get his usergroup and than i want to check the assigned model. It seems to be laborious, but i think its the best and the only way.
I get one solution:
At first i add a field to be_users.
$tempColumns = array(
'model' => array(
'exclude' => 0,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:extensionResources/Private/Language/locallang_db.xml:tx_extension_domain_model_ownmodel',
'config' => array(
'type' => 'select',
'foreign_table' => 'tx_extension_domain_model_ownmodel',
'size' => 10,
'width' => 20,
'minitems' => 0,
'maxitems' => 9999,
'allowNonIdValues' => 0,
'eval' => 'required',
),
),
);
t3lib_div::loadTCA('be_users');
t3lib_extMgm::addTCAcolumns('be_users',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('be_users','model;;;;1-1-1');
in my backend-modul i check the current backenduser
$GLOBALS['BE_USER']->user['model']
so i get a list of my modelids separated by commas.
thats it.

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
));