The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
XML Export - Templating Smarty Question - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8) +--- Forum: Modules (https://forums.formtools.org/forumdisplay.php?fid=16) +--- Thread: XML Export - Templating Smarty Question (/showthread.php?tid=1773) |
XML Export - Templating Smarty Question - waizen - Nov 21st, 2011 Hi, I'm new to smarty templating, so please bear with me. I have a form that needs to collect info then report each entry in XML form. According to requirements, the report should follow this format: Code: <mw> I accomplished this successfully by modifying my smarty template to look like this: Code: <mw> All of that would be great if I only had one form submission, but with multiple submission, such as the two submissions illustrated below, the XML report looks like this: Code: <mw> As you can imagine, I would need the reporting to come out looking like this: Code: <mw> I assume that the modifications required would need to take place within the smarty template? If so, exactly what template code would I need to accomplish that? Thank you in advance. RE: XML Export - Templating Smarty Question - Ben - Nov 21st, 2011 Hi Waizen, No worries, you were almost there. Just move the opening & closing <request_merchant_account> node to inside the first loop. That will then be outputted for every submission: Code: <mw> I confess I haven't checked it, but that should work fine. Let me know if you have any trouble! - Ben RE: XML Export - Templating Smarty Question - waizen - Nov 21st, 2011 It worked perfect, Ben! Thank you! ...however... The client now has a new request, which I have a feeling Form Tools may not be able to help, but here goes anyway: It seems that the client now needs to have form data get converted to XML, in the exact format above, but then get passed immediately and directly to a remote server (FTP address, with login requirements) in XML form. One XML record per form entry. In other words, one XML file per every form entry site visitors fill out. Hope I made sense. Would that be asking too much of your incredible application? (big fan, here, by the way) If not, any other suggestions? Thank you so much for your help. RE: XML Export - Templating Smarty Question - Ben - Nov 22nd, 2011 Hi Waizen, Thanks! Interesting problem... but the short answer is no, as you expected. For that, you'd need some additional code. You could certainly extend the Core with a module to allow for it, but it would take some custom work. Just out of curiosity, do they want the XML files to be submitted via FTP after every submission, or just every once in a while (e.g. when the administrator requests it)? If the latter, presumably you'd want an "Export via FTP" button/page? - Ben RE: XML Export - Templating Smarty Question - waizen - Nov 23rd, 2011 (Nov 22nd, 2011, 10:28 PM)Ben Wrote: Hi Waizen, Hi, Ben. Thank you for your response. Believe it or not, my client now finds out that he is to send XML forms of visitors submitting information to a third party but needs to have each submission go through as its own record (XML file). The files need to go up to an FTP site, through login procedures. The third party is not a technical type person and has no idea how other clients of his does the same thing, nor does he have a dedicated technical person to answer my questions. So, to my client's benefit, I set him up with Form Tools so that he could have his own database of form submissions, as well. Unfortunately, this means that my client is going to have to download the XML file off the server with multiple records and copy/paste each submission, in the proper format, into separate files and submit each separately. Really not a big deal when done a couple of times but I'm thinking that's not something he should need to do. Since I'm not a php guru, I have been spending way too much time doing R&D to try to come up with a solution. Internet searches have resulted in very limited successes. Anyway, thank you for your help and for your incredible application. I'm a big fan of it. BTW: why am I not seeing a PayPal contribution button on your site somewhere? Weren't you going to take contributions at some point? Am I missing it in plain sight? RE: XML Export - Templating Smarty Question - Ben - Nov 24th, 2011 Hi Waizen, Yeesh, separate FTP uploads per submission is quite the process...! I think you'd really need a custom module written to do it properly, though - so that the code is attached to the appropriate hook & executed when the submission is first put through. (What about updates made within Form Tools? Are they re-FTPd over?). And regarding donations, we're actually slowly moving to selling premium modules! Once the first one was out, I removed the donation link. We've only a few out now, like the Data Visualization and Report Builder modules, but it's a start! All the best - Ben |