How to edit an existing controller in Ckan through a plugin? - plugins

1 of the adjustments I want to make is to edit the admin.py file in the controllers list. For example, the function def _get_config_form_items(self):
I want to remove some of the default items, but i don't know how to edit the file without changing it in the core.
Thanks in advance!

If you want to remove some items from the config, I don't recommend you to overwrite that part of the code. First, go through the tutorial for writing an extension. Add to your plugin the iConfigurer interface and now you can remove or update config items.

Related

Create our own module to display switching views and infinite tab bar

We want to remove some external dependencies in our project to clean it.
what I am asking is how to create a module to display my data like XLPagerTabStrip.
Do you have any idea?
Thank you for your help.

how to add a class to symfony widget root element

i was able to add a class to the form itself and for example to a form_row like you can see on the screenshot by adding a second parameter to form_start/form_row and so on. but i was not able to find a solution to add a class to the parent of div.choice-box which already has the class form-group. whats the correct solution right here?
thanks guys
it was quite a simple solution - we have our own template file called fields.html.twig - i just opened the vendor file bootstrap_3_layout.html.twig and copied the necessary parts over into our template file were i was able to apply the needed changes.
have a nice one.

How to programmatically change help contents in Eclipse?

I have an eclipse plugin and I would like to programmatically disable help content TOC's based on a variable I define. In a nut shell, I want to prevent some help docs from showing up in the help contents if a specific type of user is accessing the plugin.
Preferably I would like to do this in the ApplicationWorkbenchAdvisor somewhere.
One thought would be to modify the "primary" value to be false if the variable were set.
Not sure if it would work, but try using the org.eclipse.ui.activities extension point. The tutorial from Vogella tells it is possible to hide only UI elements like wizards, views and so on, but it is from 2009.. Not sure if hiding TOC is now possible. If you try it out, would be nice to give a feedback ;)

SugarCRM installable changes in detailview

I have a simple problem but may be serious for me , I made custom fields and added them all in the custom\modules\Leads\metadata\detailviewdefs.php (detailview layout) of Leads module but problem is that i have to make a installer package of changes. I managed with custom fields and copied them in the custom\Extension\modules\Leads\Ext\Vardefs through manifest. Now i don't know how to apply detailviewdefs changes through manifest (add new fields panel in detailview). The point is that the existing detailview layout should not be changed but only add a new panel in it.
Possible solution in my mind is like I should add code in $layout_defs array $layout_defs["Leads"]["DetailView"] ['panels']['panel_name'] and place it in custom\Extension\modules\Leads\Ext\Layoutdefs\ and copy Layoutdefs file through manifest. I tried this but not seems working one.
Looking for a smart solution share if you can.
Addition:
Even if i export module changes from Studio ->export Customizations and import in other instance with module builder. It override all the previous custom files(customizations) in newer instance (Is it not a limitation in SugarCRM) but my requirement is to add only changes in newer instance's detailview.
That's a tough one. There are two options that I know of. 1) Provide directions to the user for how to add the fields to the layouts using Studio 2) In a post_install.php script mimic how a Studio layout deploy works to insert your fields into any given layout (best practice would be to create a new panel for all of your fields if mass distributing).
I had found following functions of sugar's ModuleInstaller class to add or remove fields from layouts through manifest script. These functions will add/remove fields to both editview and detail view at the same time. Just add following lines in post_install / pre_install no need to require anything,
$installer_func = new ModuleInstaller();
$layoutAdditions = array('Users' => 'users_access');
To add users_access field in Users module:
$installer_func->addFieldsToLayout($layoutAdditions);
To remove users_access field from Users module:
$installer_func->removeFieldsFromLayout($layoutAdditions);
Hope it's helping.
mansoor

SugarCRM 6.2 - Adding a custom field in user profile

Yeah. As the title says, I am tasked with creating custom field in user profile, and sort of hit a wall on this one. It is a very small customisation, add a yearly_target field to user edit and detail view.
I was happy to stumble on this article to add a custom field in sugar.
Although it's a huge help, it seems to be missing one or 2 minor points.
To have the fields show in edit and detail views, one apparently needs to create and edits EditView.php and EditView.tpl and DetailView.php and DetailView.tpl, except I am not too sure where these files go. The yearly target field shows up in user list view, but not in edit/detail views. I tried custom/modules/Users , custom/modules/Users/ext , but changes made in the templates (static html changes) have no effect.
Anyone know where these files should go?
Thanks SO'ers!
They should go in the custom/modules/Users/ directory. Do make sure you change the references inside the EditView.php and DetailView.php files to reference the templates you have in the custom/modules/Users/ directory instead of the default ones in the modules/Users/ directory.