SuiteCRM : How to Add Dashlet which renders external project - sugarcrm

Anybody knows how to create dashlet that render an external app in suiteCRM/sugarCRM ?
Thanx.

SuiteCRM:
What you need to do is create your module using module builder. Then edit the default dashlet see modules/your_module/Dashlets/your_module_name/your_module_name.php.
You need to override the display() so that it returns the code that you wish to use. Typically you would return the HTML from an external file.
function display()
{
$path = 'modules/your_module_name/Dashlets/your_module_name/your_module_name.html';
parent::display();
return file_get_contents($path);
}

you can configure a new dashboard in suitecrm and while adding new dashboard, select "Web" type of dashboard and enter URL of you external app there. SuiteCRM will load this in iframe. Give it a try and let me know if you face any issue.
Creating new module and custom dashboard is to much work for something which is already available in suiteCRM.

Related

Is there a way to integrate TinyMCE and EasyAdmin 3.x Bundle in Symfony 5.1

I'm trying to integrate stfalcon/TinymceBundle with EasyAdmin 3. I tried to create custom form template which works on Index and Details page, but not on the Edit/Create pages. I'm interested in knowing if someone realized that WYSIWYG in easyadmin3.
You just need to add to your DashboardController this:
public function configureCrud(): Crud
{
return Crud::new()
// add your form theme here
->addFormTheme('#BundleName/Form/wysiwyg_widget.html.twig')
;
}

Unable to fetch page properties in the head script

I am trying to get a page property in the head of my page basically to make it universally available so that the front end developers can use it in their scripts as they will.
This is on AEM 6.3. And I've already tried to include a script in the head.html but it can't read the page properties in a script tag.
<script>
window.myAppEndpoint = {
baseURL: "${properties.myappendpoint}"
};
</script>
I expect the window object to populate with my endpoint value be able to use it anywhere in the application.
You should be able to do this provided:
The myappendpoint property is defined for the page jcr:content node
You are using the proper display context: baseURL: "${properties.myappendpoint # context='uri'}"
You can create a global object in js and include that js in the clientlib at the template level.
Or use the global objects available in HTL. Please have a look here.

How do I know I am being called from a progresive web app?

I've been following the guidance on google to create a PWA, but I am interested if there are any conventions to communicate with your data server that you are being called by a PWA. Is the easiest thing to add a parameter to the request i.e.
var dataUrl = 'https://query.myapi.com/v1/get?source=pwa';
and then check the source parameter? Or should I add to the request header?
In your code
if (window.matchMedia('(display-mode: standalone)').matches) {
// do things here
// set a variable to be used when calling something
// e.g. call Google Analytics to track standalone use
}
** Assumption made that you are also setting up your app to be added to the users home screen as a shortcut
You have to pass in the traffic source to Google Analytics indicating its from PWA. Refer this answer on more details.

Load select options dynamically from external service in Touch UI dialog in AEM?

My problem is to load a select field in touch UI dialog with dynamic options. These options are coming from a external URL via webservices, I am consuming this RESTful services using url defined in one of our global javascript objects like
$.get(mec.serviceConfig.baseUrl + '/movies';
Please understand that the options are coming from third party webservice please do not mention datasource. Whenever I search for loading select options dynamically I get this tutorial
Link to Tutorial
This is is not what I want.
In classic UI it is easy with optionsProvider.
In touch UI I am trying to write a script that fetches the data from the external webservice via AJAX ON DIALOG load and set these options in the select field.
Is there any better easier approach ? Can someone please share code snippets?
you should create JS listener for your component.
$document.on("dialog-ready", function() {
// there you should find your select field
//for example
var language = $("[name='./language']").closest(".coral-Select");
//then append to your select field new options from your datasource
});
please see doc: Dynamically updating AEM TouchUI Dialog Select Fields

Alfresco Share: Using ALfresco.Util.PopupManager in my customized Login page

I am working on customizing Alfresco Share for Business purpose. So I have Customized and Overridden the default login page. But now I want to show the pop up a message for invalid logins in the same way as ALfresco Share does. Going through the core files I found it makes use of ALfresco.Util.Popupmanager and Alfresco.Util.Message. So I included the alfresco.js file and copied the portion of the code from slingshot-login.ftl where it uses ALfresco.Util.Popupmanager.displayprompt, but when I deploy it, rendered the page and issued an invalid login I got the following error:
Alfresco.messages.global is null var globalMsg =
Alfresco.messages.global[p_messageId];
Kindly help.
What is your p_messageId?
This is should work:
Alfresco.util.PopupManager.displayPrompt(
{
text: "My message here"
});