la5nta/pat

Forms and file attachments

Closed this issue ยท 6 comments

Mihara commented

Consider the following form definition file:

Form: FFWN.html
Subject: FFWN
Readonly:True
Msg:
<var Callsign>,<var Name>,<var City>,<var Region>,<var Country>,<var Username>,<var Connection>
<var Question>

(see https://github.com/Mihara/ffwn for more details)

RMS Express, when working with this file, produces an email without an XML file attachment, and puts the form data into the message body as expected. Pat, however, insists on attaching the XML file anyway.

There is no whiff of a formal specification of how forms should work -- I didn't find one myself, at least -- but I think this goes against the defacto standard.

Do you know what indicates if we should include the XML or not?

Mihara commented

In RMS Express, the presence of a html file for displaying form data (Form: <entry.html>,<display.html>) in the form definition file is what indicates whether an XML file needs to be attached or not. If there's only one file on the Form: line, nothing is attached.

Thanks!

What's the Readonly:True?

It appears our code regards a single Form file reference as if the same file should be used for composing and viewing ๐Ÿค”

Do you by any chance know what we should do with forms like GENERAL Forms/Windshield Damage Worksheet.txt? It too contains only a single entry in the Form line (Form: Windshield Damage Worksheet), but it's missing the file extension. There is an associated html file, but without any HTML input fields ๐Ÿ˜• ๐Ÿคท.

Regarding the Windshield Damage Worksheet without .html - I went with the assumption that we should default to adding the html extension. Not sure if it's correct, but it's my best guess.

I've pushed a branch which omits XML if no viewer file is referenced in the Forms: line. It would be great if you could test that against your form file. Thanks! ๐Ÿ™‚

Mihara commented

What's the Readonly:True?

This is a flag that prevents subsequent editing of form-generated message text, and is for cases where message text is the data carrier, rather than an attached file. See for example the DYFI form which creates a json block inside the message body, which is a smarter way to do it than an attached XML file, if you ask me -- byte savings are significant. ๐Ÿ™‚

I wouldn't say supporting this is critical, (might be more hassle than it's worth, with the way Pat handles forms -- you'd need to create a per-message readonly flag, etc) but it would be nice to have.

Regarding the Windshield Damage Worksheet without .html - I went with the assumption that we should default to adding the html extension. Not sure if it's correct, but it's my best guess.

RMS Express loads the html file in this case. That the HTML file doesn't work -- at least it doesn't let me enter any data -- is beside the point, I presume. :)

I've pushed a branch which omits XML if no viewer file is referenced in the Forms: line. It would be great if you could test that against your form file.

Gimme a moment...

Mihara commented

I've pushed a branch which omits XML if no viewer file is referenced in the Forms: line. It would be great if you could test that against your form file. Thanks! ๐Ÿ™‚

Works as expected with my form file, thank you very much!