jordanlev / c5_boilerplate_crud

Boilerplate code for basic dashboard CRUD operations in Concrete5
35 stars 16 forks source link

Added Save& Add New #9

Closed cryophallion closed 10 years ago

cryophallion commented 10 years ago

Allows a user to save current form and immediately go to a new form without going back to the list view

jordanlev commented 10 years ago

I added the duplicate functionality, and having that in place meant I could do the "add and duplicate" function in a much simpler way. Even though I didn't merge your request, I did use it to see how I should do things -- so thank you for submitting it (and for suggesting the idea in the first place).

Note that I do not like having the "save and add" / "save and duplicate" buttons on the edit form... only the add form. But I understand where you're coming from and that it's probably a matter of tasted (or what's appropriate for your users or the project in question). Functionality-wise, it should work regardless of whether it's an add or an edit form, so all you should have to do to enable those buttons on your edit forms is remove the if ($is_new): statement around them in the single_page output. (Since this is boilerplate code, the assumption is that it's only a starting point anyway, and most things need to be changed as you work through customizing it to your specific project).

Thanks again for helping out.

cryophallion commented 10 years ago

Always willing to try and help out (as I'm sure you can see). Thanks for being willing to have someone else help out!