Sugarcrm : modify actions on Dashlet quickEdit button - edit

I have a very specific question on Sugarcrm.
I'm using version Enterprise 6.5.16, and i'm coming to a dead-end.
What i currently have :
When the user is on his homepage, he has a Dashlet called "My open Cases", which displays every open Cases assigned to/or created by him.
For each row of this dashlet, we have a quickEdit icon displayed. (you know, the little pen).
When the user clicks on that little icon, it opens the quickcreate (or quickedit?) popup.
What i want to achieve is :
I want, when the user clicks on the icon, that Sugar does not open a popup, but opens a new browser tab on EditView.
So basically, when on Home, when the user wants to edit "Case01--Issue" from the dashlet, instead of poping the quickcreate (or quickedit) form, i want to open a new browser tab with the complete edit view of "Case01 -- Issue".
What do i have to do? I did not see the definition of the icon in custom/modules/Cases/metadata/dashletviewdefs.php nor elsewhere.
Thanks by advance for your help and time!
Gaƫlle

The "My Cases" dashlet, and most dashlets, extend the DashletGeneric class, found in /include/Dashlets/DashletGeneric.php. This uses the template file DashletGenericDisplay.tpl in the same directory, and this is the template that displays the quick edit button.
To remove or alter the quick edit button, you would extend My Cases and insist that it use a custom smarty template of your own creation. In /custom/modules/Cases/Dashlets/CustomMyCasesDashlet/CustomMyCasesDashlet.php you might have the following:
<?php
require_once('modules/Cases/Dashlets/MyCasesDashlet/MyCasesDashlet.php');
class CustomMyCasesDashlet extends MyCasesDashlet{
$displayTpl = 'custom/modules/Cases/Dashlets/CustomMyCasesDashlet/CustomMyCasesDashlet.tpl';
}
You would then copy the original template to the new file and location referenced by CustomMyCasesDashlet::displayTpl and adjust as desired.
For your Dashlet to register correctly with the system, you'll also need your CustomMyCasesDashlet.meta.php file. Copy the original to your custom directory and adjust labels as necessary -- the key is to replace references to MyCasesDashlet with CustomMyCasesDashlet.

You should create your own dashlet (with copying existing one in "custom" folder), replace all standart entries to your own. Add copy of DashletGenericDisplay.tpl too and name it like CustomMyCasesDashlet.tpl.
It's not necessary to extend MyCasesDashlet class. You can leave "extends DashletGeneric".
In constructor function CustomMyCasesDashlet() just add the line:
$this->displayTpl = 'custom/modules/Cases/Dashlets/CustomMyCasesDashlet/CustomMyCasesDashlet.tpl';
Pay attention to $this->. Its necessary to override DashletGeneric field.

Copy the file from modules/Cases/Dashlets/MyCasesDashlet/MyCasesDashlet.php and paste it to custom/modules/Cases/Dashlets/MyCasesDashlet/MyCasesDashlet
If you don't have Cases folder inside the custom directory, create one.
After copying the file, add a property to load your custom TPL file.
Default DashletGenericDisplay.tpl file located at include/Dashlets/
class MyCasesDashlet extends DashletGeneric {
var $displayTpl = "custom/modules/Cases/Dashlets/DashletGenericDisplay.tpl";

Related

Changing default dropdown value in sap crm web ui

I want to change default values which gets populated in the below picture.
I tried modifying get_v_role method but it didn't serve my purpose.
Please help.
In personalize->personalize settings, there is sort option. It sometimes overwrites this arrangement of values of get_v method.
Also code can be written in inbound plug of this view. I did it for overview page drop down and it worked. You can try for your search page.
For filtering/changing drop-down value of search parameter, You've to Re-define GET_DQUERY_DEFINITIONS method of ZCL_XXX_IMPL class of component. GET_V_XX methods are only used to modify drop-down/F4 help of view pages not the search view.
STEPS:
Click F2 while placing the cursor on Account ID(for which parameter you want
to modify) drop-down.
Go to BSP Component using t-code - BSP_WD_CMPWB
Enter the component name and Enhancement set
Select the view.
Go to Implementation class .
If your component is enhanced then it will be having ZCL_XXX_IMPL class. otherwise you've to enhance that component. Click on that class.
After that find GET_DQUERY_DEFINITIONS method and implement same way as
GET_V_XXX.

Altering the check-in dialogue in ICN (IBM Content Navigator)

In IBM Content Navigator, The "Check In" dialogue contains a Properties Pane, that in turn contains a Class Selector drop down box.
ClassSelector image
I want to keep the check-in functionality, but would like to have that Class Selector box not appear (There is no use case where a user would need to change the document class).
What would be the proper way to achieve this?
Is there a way to extend the ecm/widget/CheckInDialogue.js file AND make the default checkIn action use my new js?
Do I need to create a brand new checkIn action that references a new js?
Do I just change the ICN shipped js/html?
Just to clarify, I do know how to create a plugin, and how to create a js extension to the checkinDialogue.js, and how to remove the classSelector; however I don't know how to make the checkin action use my new script, or the best way to accomplish this.
Thanks!
Before answering your question, I would like to say that I think there is other options to do this without customizing ICN. The two easiest I can see would be:
Use entry templates, that way class selector will be disable on check in by default
Remove the privChangeClass privilege, that should hide the Class Selector (might be difficult if you want to leave full priv.)
Now if you want to hide it without using entry templates or privileges.
Yes, extend the ecm.widget.layout.CommonActionHandler and overwrite the actionCheckIn function and use your CheckInDialog instead of the default one. Then use your CommonActionHandler instead of the default one in your desktop. I don't think there is a way to change the ActionHandler from the admin desktop UI yet (if I missed it please let me know), although it's loaded by the client on the _loadDesktop function and set by the appearance tab but the value is hard-coded, so you might have to inject it after the load of better, call ecm.model.desktop.setActionHander(actionhandler) where actionhandler is the instance, not the class name (string) in a plugin.
You can, this will make things easier to manage if you have several desktops and you want some to use your new Check In dialog and some not.
No, that's a terrible idea :) Future upgrade of ICN and your code will be a nightmare and the delivery process a lot more complex than a simple configuration trick or ICN plug-in, that's what plug-ins are for.
Also a not so clean but really simple solution would be to aspect after the CheckInDialog.prototype on the postCreate function and do a domStyle.set(this.addContentItemPropertiesPane._contentClassSelectorDiv, "display", "none"); to just hide it on all CheckInDialogs.

Ektron PageBuilder - define default name for custom widget

I'm hoping this is a simple question. I have a custom widget. Let's say it is "SuperAwesomeWidget.ascx". When I'm editing a PageBuilder wireframe, I can see my widget in the little pulldown widget tray at the top of the screen. Thing is, the name under my icon is "SuperAwesomeWidget".
Now, I know that I can go to the widgets settings in the WorkArea and define a custom name, but what if I want Ektron to just "know" what the name should be? I'm hoping there is some config file somewhere that I can add my widget name to. I'd like to be able to drop this widget along with maybe a config file or something into a second Ektron install and not need to define the name via the workarea.
For anyone in the future googling this issue, there is a better answer than my previous one, particularly better than a workarea modification.
To update the display title of a widget in the widget bar:
Go to Workarea > Settings > Configuration > Personalization > Widgets
Find your widget in this list and click the edit icon to the left of its name
Modify the display title in the second text field in the modal that pops up.
Confirmed working in 8.6.1, likely works in all 8+ versions.
Edit: While this answer is still partially correct, I have discovered the actual way to do this. The correction has been marked as the accepted answer.
Set your IWidgethost's title property:
IWidgetHost _host;
...
_host.Title = "Hello World Widget";
From the esteemed eGandalf's tutorial on widget development:
http://www.ektron.com/Blogs/eGandalf/Break-it-down!-Widget-Development-How-To-(Part-1)/

Sencha Architect 2 - how to edit code

I am using Sencha Architect 2. I need to know how i could edit the code using the IDE. i clicked on the code tab but the code is in readonly format. How can i edit this code ?
sencha architect code cannot be manually edited if you wish to do so then go to the metadata folder where you saved the project and over there you can manually edit the files then come back and save in architect which will overwrite the existing files
There are 2 set's of code in SA. The code that's generated for you and the code that you add. To add you need to drop in event handlers (basic event bindings), functions, controller references, etc ...
In the code view there is a drop down with all of the items that contain code. Some of them may be editable depending on what type of class your looking at (view, controller, store, model).
I imagine your looking at the generated class (not directly editable). You add things to it by dropping behaviors http://cl.ly/0A0J1v1Q2O3C17233w10
Building on what Phil has said Sencha Architect only allows you to edit configs... If you are looking to edit properties in views you additionally need to create overrides and in the override you can modify the property like this
config: {property-name: {
//whatever you want to change}}

Adding a custom field type to SugarCRM?

I'm trying to add a custom field type to our SugarCRM 6.2 instance. I want to add an "email link" type field. I want it to function like the URL field, but prefix every address with "mailto://" prefix instead of "http://".
It will be good if that field type is available in studio while creating new fields or in minimum, some custom code to achieve it.
What I did up to now:
- I've copied include/SugarFields/Fields/URL to include/SugarFields/Fields/Email
- In modules/ModuleBuilder/language/en_us.lang.php I've added a title for the email field
But unable to get anything working. Any help?
First of all you do not want to make any coding changes outside of the custom directory. Doing so outside of this directory is not upgrade safe.
Create a custom fields directory in your custom folder
Create new template files (.tpl) for your custom field
then you can just add a regular textfield in studio
then edit your viewdefs in your custom directory
in your tpl file concatenate the mailto:// to your text and just add the persons email address and it will take care of the rest for you
why you need custom field type for such small functionality? Just add your custom JS file in editviewdef.php. Then use some jQuery selector to perform certain action. For detail view, you can use view.detail.php to add required text in run time.
This will help you to store less data in database and display more in frontend.