How to unmerge edit and remove buttons in sugarCRM? - 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/

Related

Is it possible to remove the 'Delete' and 'Add x' on the 'table' field for Laravel Backpack?

I'm currently setting up a backpack CRUD for languages/translations, and I'd like the translations to be bulk editable from the language CRUD. I've currently got that working through the update operation like so:
protected function setupUpdateOperation()
{
$this->setupCreateOperation();
CRUD::addField([
'name' => 'translations',
'label' => 'Translations',
'type' => 'table',
'entity_singular' => 'translation',
'columns' => [
'key' => 'Key',
'text' => 'Text'
]
]);
}
Which looks like this:
preview image
The problem I'm running into here is that all the 'keys' should be static (but still displayed), as well as that users shouldn't be able to 'add' translations or remove them. (Translation creation is handled by setting up default translations each time a language is created)
Is it possible to
Make it so that the 'key' column is uneditable but still displayed.
Remove the 'Add translation' button at the bottom of the table.
Remove the 'Delete' trashcan icon at the end of each translation line
Many thanks in advance!
Add these lines to your Controller. You can add it anywhere but I prefer to add in public function setup()
$this->crud->denyAccess('delete');
$this->crud->denyAccess('create');
However user cannot add Translation but this will not remove the + Add Translation button. So to remove that button also,
remove this line
use \Backpack\CRUD\app\Http\Controllers\Operations\CreateOperation;
Sources:
https://github.com/Laravel-Backpack/CRUD/issues/257
https://backpackforlaravel.com/docs/4.1/crud-operation-show

How to link this button to another route in Laravel Bacpack

So i have this view below :
The button view that i want to route to another page
Theres a button named Go To Question that i want to link to edit-question route. This is the code for the button.
[ // CustomHTML
'name' => 'separator',
'type' => 'custom_html',
'value' => '<a href="{{$this->crud->setEditView(`backpack::crud.question`,3);}}"
target="_blank">Go to question ></a>'
],
Does anyone know how to do this ?
You can easily link to a Backpack page using the backpack_url() helper instead of Laravel's standard url(). That will also add the admin prefix that you've set in your config/backpack/base.php (by default admin).
But take note that you cannot add a link to a particular view in Laravel. You should point to a route, that points to a controller, that loads a view. So your button should look more like this:
[ // CustomHTML
'name' => 'separator',
'type' => 'custom_html',
'value' => '<a href="{{ backpack_url('question/3/edit') }}"
target="_blank">Go to question ></a>'
],
This will point to the Questions CRUD route, which will load QuestionCrudController, which in its turn will load the edit view - assuming you do have that CRUD.

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!

"Theme Customizer" - different background image for different category

I'm trying to make setting in theme customizer which will allow me to choose different background image to different category. I have two settings working separately, but i don't know how to combine them to work together and it seems like there was no problem like this before.
In theme customizer it looks like
> this <.
How make it work together?
EDIT:
I was trying in many ways to acomplish this, but only thing that worked as i wanted was creating a section for each category and add background image there, like this:
$wp_customize->add_section( 'background_section_cat_a', array(
'title' => __( 'Category: cat_a', 'twentythirteen-child'),
'description' => 'Options prepared to change background settings', 'twentythirteen-child',
'priority' => 160,
'panel' => 'background_panel',
));
$wp_customize->add_setting( 'background_image_cat_a', array(
'default' => 'abc.jpg',
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'background_image_cat_a', array(
'label' => __( 'Select background image', 'twentythirteen-child' ),
'section' => 'background_section_cat_a',
'settings' => 'background_image_cat_a',
)));
and use this setting:
body.category-cat-a {
background-image: url(<?php echo get_theme_mod('background_image_cat_a'); ?>);}
But when I add new category, I have to enter my theme customizer options and add it there, and it is very time time consuming.
There is another way:
1. Add custom field with image to your Category taxonomy
2. call your image in category.php page.

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