Vineet Sawant Posted June 13, 2023 Share Posted June 13, 2023 Hi, I've been tasked to create an internal payroll, invoices, employees and other data management web application for my client's business. There's going to be lots of forms, input validations and calculations. I wanted to know what would be the best way to approach this project as I want to reduce the time taken to create forms in HTML, validate them with JS and then submit those using php & processwire; instead, I want to focus on writing logic for actual calculations and creating meaningful reports out of it and saving time for my client. Please suggest if I should be using any plugins (FormBuilder??) that can take care of the forms/validations and submission. Thank you :) Link to comment Share on other sites More sharing options...
Jim Bailie Posted June 13, 2023 Share Posted June 13, 2023 Obviously this can be done with PW, but it's hard to even know how to re-invent this wheel without spending a day or two interviewing your client and sketching out a stack of wire-frames. Probably not what you want to hear, but I'll just throw this one out there: We've *HIGHLY* customized this gem for 3 mid-sized B2B clients needing pretty much the general functionality you've mentioned. It's based on CodeIgnitor (sp?) and is pretty simple to trick out. https://codecanyon.net/item/perfex-powerful-open-source-crm/14013737 1 Link to comment Share on other sites More sharing options...
cwsoft Posted June 13, 2023 Share Posted June 13, 2023 @Vineet SawantForm Builder Pro from Ryan (commercial) or at least with FrontendForms from Jürgen (free), if the project will be realized with processwire. However as Jim already pointed out, you should take some time to invest in the requirements and the best tool around to achieve what you want. That may involve another framework, coding language etc. Link to comment Share on other sites More sharing options...
bernhard Posted June 13, 2023 Share Posted June 13, 2023 2 hours ago, Vineet Sawant said: There's going to be lots of forms, input validations and calculations. I've built a commercial module RockForms that can be of huge help here. It uses https://doc.nette.org/en/forms which is the only library on earth that I know where you define all rules from within PHP and get the same exact validation rules also on the client side for live validation. You have tons of options regarding validation and you can even create nested validation rules: https://doc.nette.org/en/forms/validation The drawback of using Nette Forms is that it makes it very hard to customise the created markup of your forms to your needs. That's where RockForms jumps in. Also it integrates everything very well with PW and creates pages from submitted forms, provides hookable methods to do custom stuff at custom events and handles redirects to prevent double form submissions etc.; Basically it handles all the tedious things for you that you'd have to think of upfront or that you have to fix later if you didn't think of them ? A simple form could look like this: // create form with a unique name $form = new RockForm("demo"); // field setup $form ->addText("forename", "Enter your first name") ->setRequired("We need your first name to show it!"); $form ->addText("surname", "Enter your given name"); $form ->addSubmit("submit", "Submit your name"); // render output if ($form->showSuccess($values)) { $name = $values->forename; if($values->surname) $name .= " " . $values->surname; echo "<strong>Thank you for submitting the form, $name!</strong>"; } else { echo $form->render(); } Or for more complex forms you can define everything in OOP style. Extensive docs are in the works and provide live examples that you can play around with: https://www.baumrock.com/modules/rockforms/docs/ Compared to FormBuilder the module does not (yet) have a UI to build forms. That's done in code, but it seems that this is what you want anyhow?! Single Site License will be 49€ - if you are interested write me a PM ? 4 1 Link to comment Share on other sites More sharing options...
dotnetic Posted June 13, 2023 Share Posted June 13, 2023 You can also build the whole application in the admin and have all of ProcessWire´s form validation and possibilities there, like dependend showing and hiding of form fields. I have built several projects for example a job application management system. room management. E-Commerce site with management from order to production inside of the admin. Some of my edit pages even have AJAX calculation fields in them. PDF and chart generation is another thing. I use the edit form of pages to manage different stuff. I also use CustomPageClasses to modify the forms inside of the admin. It depends, if the forms should be customer facing (to the public) or are they just for your client? 4 Link to comment Share on other sites More sharing options...
MarkE Posted June 13, 2023 Share Posted June 13, 2023 2 minutes ago, dotnetic said: You can also build the whole application in the admin I’ve done several quite complex apps like that. Not quite the same as your requirements, though. Lots of complex calculations and relationships. A clear spec and entity model are absolute musts. But as @dotneticsays 5 minutes ago, dotnetic said: It depends, if the forms should be customer facing (to the public) or are they just for your client? If it’s just for the client then the admin is fine. However a key issue is whether there are likely to be concurrent users. If there are only a very small number of users then you can use ProDevTools to handle edit collisions. Otherwise it’s a whole lot more complex and you may be better buying an accounting package. 1 Link to comment Share on other sites More sharing options...
Vineet Sawant Posted June 14, 2023 Author Share Posted June 14, 2023 16 hours ago, dotnetic said: You can also build the whole application in the admin and have all of ProcessWire´s form validation and possibilities there, like dependend showing and hiding of form fields. Hey, Can you please elaborate how you did that? It sounds like a perfect way of doing things but my worry is PW's need for first adding title and then proceeding to take rest of the data. In my case, most of the titles will be autogenerated hence I'd need a way to bypass the title screen in PW's admin. 16 hours ago, dotnetic said: It depends, if the forms should be customer facing (to the public) or are they just for your client? The whole application is for internal use only, no public/customer facing forms are involved. Link to comment Share on other sites More sharing options...
Vineet Sawant Posted June 14, 2023 Author Share Posted June 14, 2023 16 hours ago, MarkE said: If it’s just for the client then the admin is fine. However a key issue is whether there are likely to be concurrent users. If there are only a very small number of users then you can use ProDevTools to handle edit collisions. They've a team of 5 people actively working on things and they're planning to expand to a 10 people team hence I need to keep that in mind. (May be)Using sessions, I'll need to lock the pages currently being edited by one user. Link to comment Share on other sites More sharing options...
Vineet Sawant Posted June 14, 2023 Author Share Posted June 14, 2023 @dotnetic & @MarkE Both of you mentioned about using PW's admin panel for building such an application. It'd be very kind of you can explain how you managed to customise the admin panel as per your requirements. Also how did you manage to add Ajax to it? I'd love to know. @bernhard Thanks for the detailed answer. Somehow silly me has never been able to work with composer, it's too complex for me. I'm a simple developer who likes simpler things but your solution is really intriguing so it seems I can't run away from composer for too long, let me give it a try. Thank you all for your suggestions. Link to comment Share on other sites More sharing options...
bernhard Posted June 14, 2023 Share Posted June 14, 2023 1 minute ago, Vineet Sawant said: @bernhard Thanks for the detailed answer. Somehow silly me has never been able to work with composer, it's too complex for me. I'm a simple developer who likes simpler things but your solution is really intriguing so it seems I can't run away from composer for too long, let me give it a try. Thank you all for your suggestions. You don't need composer for RockForms. But if you are building some intranet-like app as @dotnetic mentioned the most efficient way is to stay in the PW backend. To understand the backend better you can read my blog post here: https://processwire.com/talk/topic/17709-how-to-create-custom-admin-pages-aka-processmodules-yes-its-that-simple/ But creating a complex app with lots of calculations is not an easy task - so if composer is out of your league I'm not sure if it's a good idea to take over such a project. Maybe it's better to build on an existing solution as @Jim Bailie mentioned. But that's of course your decision ? Just wanted to mention that you can achieve anything you want with PW and with the PW backend, but it's definitely more complex than using composer. And your comment about PW needing a page title does not sound like you know a lot about hooks or the inner workings of PW. It's of course your decision, just be aware that if you price it with a flat rate then you might end up with a lot more work than you'd expect ? 2 Link to comment Share on other sites More sharing options...
dotnetic Posted June 14, 2023 Share Posted June 14, 2023 2 hours ago, Vineet Sawant said: I'll need to lock the pages currently being edited by one user For this functionality take a look at ProcessWire User Activity, part of the ProDevTools as @MarkE mentioned. Link to comment Share on other sites More sharing options...
MarkE Posted June 14, 2023 Share Posted June 14, 2023 7 hours ago, Vineet Sawant said: It'd be very kind of you can explain how you managed to customise the admin panel as per your requirements. Process modules as per @bernhard’s post are the main tool. If you don’t feel confident with that (and do have a try, it’s not that hard) then I suggest you avoid a custom solution. 7 hours ago, Vineet Sawant said: Also how did you manage to add Ajax to it? I'd love to know. I really like HTMX for that. There are quite a few forum posts about it. 1 Link to comment Share on other sites More sharing options...
netcarver Posted June 14, 2023 Share Posted June 14, 2023 Runtime-only fields and/or the dashboard module may also be helpful. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now