Model in Module In Prestashop - 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..

Related

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

Saving Sitefinity Forms Module Data to separate Database

I'm working with Sitefinity CMS and trying to figure out how to save the data from a "Forms Module" form to a separate database in the backend. Currently all the responses are saved into a table that is created when the form is built. What I want to do is re-route the save request to go through my code behind instead and save the data to Azure table storage. Is there a way to do this or by using the Forms Module am I stuck to saving the data to the table that is auto-created when the form is built? I've tried creating my own FormsSubmitRouteHandler as explained here (http://docs.sitefinity.com/for-developers-submit-forms-using-ajax-call#register-a-form-submit-route-handler) but I must be doing something wrong cause my code doesn't ever get hit.
Any help would be greatly appreciated. If I didn't explain myself well please let me know.
You should create a new provider that implements the FormsDataProvider class.
Currently Sitefinity uses OpenAccessFormsProvider - so you can use JustDecompile to see how that was implemented and probably do something similar.
Then you need to register your custom provider in the Administration > Settings > Advanced > Forms
If you don't mind having the form responses in the Sitefinity database and in your custom storage, then you can subscribe to the IFormEntryCreatedEvent and in your event handler you can write the logic of saving the form respose somewhere else.
See this article for more details: http://docs.sitefinity.com/for-developers-forms-events#iformentrycreatedevent
Have in mind that this will result in form responses being saved in both, the SF datbase and your custom storage. Also, you won't be able to manage the entries stored in the custyom storage through Sitefinity backend. If that's your goal, then Vesselin's answer is the correct way to go, but more complicated.

SugarCrm create custom module without Studio

I am building a custom module for Sugar v.6.5.16. This module works with data of other modules so my module does not need database table, I do not want beens, not importable, I actually do not want anything. I have my own controller, own classes, etc and end of the story. It works. Now I want to create an installable package and NO, I DO NOT WANT TO MAKE A PACKAGE IN STUDIO. I have become quite frustrated because everyone suggests to create the package in studio where it is obbligatory to select a type(basic, company, etc) which will add data structure, bean, db table - which is really handsome but I do not want all that stuff. I actually made a test package with studio and I removed all bean info from manifest file and killed vardefs content and I managed to install it but then my module does not get listed in the "module=Administration&action=ConfigureTabs".
So, the question is what do i put where to be able to see my module listed?
Old post, but I think this page is really worth reading: http://alanstorm.com/sugar_crm_hello_world.
Excellent example of minimal module coding without studio and at the same time a very nice introduction to Sugar logic.
i Do agree with Rupesh shingh Create custom module fully in sugarcrm is not a good approach until and unless u understand the complete flow !
for understanding the flow you can go through this :-
1)understand controller,views and how it we can use it
Hello module
And try to complete 2-3 chapter of this book definitive guide by John Mertic
2)create costume module from studio and first try to do customization with edit and detail view
Flow how customize edit and details view
3)After this try to customize list view based on condition and try to customize additional details popup add where clause default listview try to create you own list view Add custom button in list view to overwrite the list view search
4)go through chapter 10 of definitive guide by John Mertic which shows how to create custom module with out creating package in studio ( manually ) !
I hope this will help !!!
please check link
http://techs.studyhorror.com/sugarcrm-manually-create-custom-modules-i-95
Create custom module in sugarcrm is not a good approach so avoid this process, as per understanding coding and logic for sugarcrm development practice is good to create module from custom code.

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.

Include field(s) from another module in SugarCRM Dashlet

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.