Include field(s) from another module in SugarCRM Dashlet - module

I have created a custom module that tracks callbacks pertaining to a specific account. I need to know how to build a dashlet that can pull that account information based on the foreign key given. Can someone help me understand how to modify a dashlet to reference data from another module?

Take a look at the dashlet definitions in modules/Home/dashlets folder. What kind on view you want to achieve will depend how to do it. I allways used custom html view that i populated with data using php. Another option is to use generate listview functions and query's to utilize the SugarCRM function.
There is no simple explanation here.

Related

Shopware 6 add entity extension fields to admin search

I wonder how to make some fields of an entity extension searchable in the administration through the "/api/search/my-entity" api-endpoint. By default they are not considered during search as it looks like.
I found the answer by debugging the search-endpoint:
The association-Field of the EntityExtension needs to have a SearchRanking-flag:
...->addFlags(new SearchRanking(SearchRanking::ASSOCIATION_SEARCH_RANKING))
Then you can add SearchRanking-flags in the EntityExtensionDefinition as you like, e.g.:
(new StringField('test', 'test'))->addFlags(new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING)),
After that the fields are searchable via the search-endpoint :)
As far as the API is concerned, search functionality should automatically be generated following your custom entity definitions.
When it comes to facilitate Admin search for your entity, you need to add some code to the administration component as described in the docs: https://developer.shopware.com/docs/guides/plugins/plugins/administration/search-custom-data (even though it looks not fully up-to-date w.r.t to the current Shopware versions).

Where to put database Model for extensions?

I want to write a small extension that is able to take some informations from the database, based on some user filter preference, and show them on the main page.
I have read: PHPBB extensions development and took a look at: ACME DEMO extension but i didn't find an answer to where the database handling should be placed. Normally this should go into a Model that will handle the data to a Controller, in this case I was not able to figure out where the Model should be placed in to the structure and how it should work.
How should an extension database model should be handled? Where should it sit in to the extension structure?
I'm guessing you would need an event listener.
PHP event listeners work with core events to inject code into phpBB.
Core events are like hooks, and they can be found throughout phpBB’s
codebase at key points. They give your extension access to phpBB’s
variables and allow you to use and modify them or to inject additional
PHP code during phpBB’s execution. -per the Skeleton Extension
Page

Model in Module In Prestashop

I was just creating a form in prestashop.So, I need to store the data from ront in end in the database. Please anyone tell me how to implement Models in module or for module. As I was enable to find any related article regarding this. Please help.
Just look at one of the default modules provided by prestashop. Take an example that creates a form in front. Then look at how the view of that specific model was created and how was data treated via controller.
examples: blockserach, blockmanufacturer..

ActiveCollab Project management section - adding extra custom fields while add/edit

I'm trying to develop a custom module inside ActiveCollab(4.0.11) for adding some extra fields while adding/editing projects. ActiveCollab itself has ability to add only 3 custom fields, but I need to add more fields(text,dropdown etc). I have gone through the documentation of creating modules and started working on it, but did not get much details. I have used "on_project_created" event to trigger my custom module to capture the Project form data(added the required custom fields in to ActiveCollab database tables tables and it started showing on project add/edit form automatically). Now I'm stuck with not knowing how to pass the posted values from Handler function to Controller.
Any help would be greatly appreciated.
activeCollab supports only three custom fields and there is no officially supported way to programatically add more fields. Exploiting internal API-s may work, but it is not recommended. These API-s may change or even disappear at any point, without prior notice.

Best approach to build a DYNAMIC query-by-example form in AngularJS?

I'm relatively experienced with Angular having written many directives, but I have a new requirement where I have to build a query-by-example form into which a user can enter different search criteria. My problem is that I do not know ahead of time what the possible criteria will be. This criteria information will be coming from the server via an ajax request and can differ per user. Thus I will need to dynamically construct a suitable user interface based on the information I get from the server.
I have built individual directives suitable for capturing the search criteria (for example a custom calendar control for date criteria) but I am unsure of the best approach to adding these directives to a form dynamically. Is this even possible in Angular?
I have built something like this before in jQuery but its not so clear to me how I would best do this in an 'Angular way'?
Any suggestions would be most appreciated!
Everything that you can express as a model-to-view projection can be implemented in AngularJS.
I think here you can make a model consisting of "query params". Each of them has name, type and data for filter builder. For example, for the "select" type a data can contain a list of all possible values to choose from.
Then you iterate through the list of "query params" with ng-repeat, rendering each control differently according to its type. That's all.
If I understood the task wrong, please provide more info.