This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » support » General discussion » master detail
master detail [message #83340] Fri, 07 August 2009 10:14 Go to next message
giuseppe500  is currently offline giuseppe500
Messages: 107
Registered: September 2008
Senior Member
Hy.
How i can implement a master/detil module in symfony?
Is possible to build this module automatically whit other module with admin generator?
How?
I must use a plugin?
Thanks
Re: master detail [message #83377 is a reply to message #83340 ] Fri, 07 August 2009 21:13 Go to previous messageGo to next message
giuseppe500  is currently offline giuseppe500
Messages: 107
Registered: September 2008
Senior Member
up up
Re: master detail [message #84001 is a reply to message #83377 ] Wed, 19 August 2009 14:50 Go to previous messageGo to next message
abunet  is currently offline abunet
Messages: 3
Registered: August 2009
Junior Member
HI giuseppe,

Have you find any informations about master detail developement?

Regards,
Marco Roello
Re: master detail [message #84074 is a reply to message #83340 ] Thu, 20 August 2009 16:25 Go to previous messageGo to next message
biggie_mac  is currently offline biggie_mac
Messages: 88
Registered: January 2009
Member
Can you be a little more specific? What do you mean by master/detail module? Try to give a practical example or tell us what exactly you are trying to do, maybe we'll understand better what you want to achieve.

Cheers
Re: master detail [message #84237 is a reply to message #84074 ] Mon, 24 August 2009 10:47 Go to previous messageGo to next message
abunet  is currently offline abunet
Messages: 3
Registered: August 2009
Junior Member
for master-detail management, I mean a form like a classic Sales Order or Invoice module, where I have a master table with a 1-n relationship with a detail table (Sales Order Detail).

In the UI I need to insert master data (Order Date, Account, Payment conditions).

For the line items (detail table), I need select many products and specify a quantity and a price (plus other information) for each product.

The problem is that the lines cannot be stored directly to the DB, but cached in the client browser or somewhere in temporary tables on the server, because the order can be cancelled in any moment.

Plus, It would be better if Master Data and Detail Data should be on the same page.

Can symfony generate something like this or can you give me any information on how to achieve this?

if you want, you can take a look to this link where theres an exact example of what I want to achieve with symfony:
http://en.vtiger.com/index.php?module=SalesOrder&action= EditView&return_action=DetailView&parenttab=Sales

u:admin
p:admin

the link takes you to a demo of an opensource crm project.

Thanks in advance
Marco Roello
Re: master detail [message #84244 is a reply to message #83340 ] Mon, 24 August 2009 12:26 Go to previous messageGo to next message
biggie_mac  is currently offline biggie_mac
Messages: 88
Registered: January 2009
Member
I think it can be done, no doubt about it. But obviously it requires implementation from your side. With Symfony, you only need to run a couple of basic commands and it will generate the forms based on the tables you have and also the functionality necessary to perform the form processing. From there, you have 2 choices: either you can create temporary tables where the data will be stored from the form...and once the user confirms the order the data is simply copied from the temporary table to the real one, or you can choose not to save the object in the database but save it as session attribute(maybe not the best solution) and once the user confirms order, you simpy call the save() method of the object. This cannot be done automatically by Symfony, it's something you have to implement yourself by changing small pieces of the generated code.

Regarding the master/detail view, if I understand right what you need, this can be easily achieved in Symfony.
After Symfony generates the form, you can easily insert one form in the other using embedForm command.

So let's say you have a sales page with master information called MasterInfoForm() and a product form which has name, price, quantity, etc called ProductForm(). When a user purchases a product, all you need to do is in MasterInfoForm() is to call

$this->embedForm('Harry Potter book', new ProductForm())


and then you would have both forms displayed together. I'm not sure if that's what you're trying to do but I hope it can help. Unfortunately I don't think there are such complex example in Symfony to show you exactly the steps to do this.

Cheers
Re: master detail [message #84277 is a reply to message #84244 ] Mon, 24 August 2009 16:48 Go to previous messageGo to next message
giuseppe500  is currently offline giuseppe500
Messages: 107
Registered: September 2008
Senior Member
Thanks , but if i have 2 form how manage the relation?
How i populate the embeed form using the foreign key?
I must add a partial with "detail" and if i click on detail i launch an action that populate the second form, but for the edit and the new how i do?.
They are action and can have the same name ? or not?
Thanks.
Master Detail Samples Needed [message #84293 is a reply to message #84244 ] Mon, 24 August 2009 17:42 Go to previous message
abunet  is currently offline abunet
Messages: 3
Registered: August 2009
Junior Member
I agree with you, Giuseppe.

I think that a tutorial / sample of Master Detail data entry will be appreciated from all the community.

I'm a newbye in symfony, and I'm very interested in the framework, but I think that documentation about this topic is a requirement on the choice of the right framework for my purposes.
Previous Topic:upload a form from autogenerated admin
Next Topic:Other decimal character
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software