pat icon indicating copy to clipboard operation
pat copied to clipboard

Radiogram form data does not get handled properly

Open sit opened this issue 2 years ago • 2 comments

In trying to send a Radiogram via Standard_Forms/RADIOGRAM & RRI Forms/Radiogram.html template, the compose window does not properly populate with the data provided by the form.

For example: image Gets rendered as: image

The form data sent back to the javascript client from pat looks like this:

{
    "target_form": {
        "name": "Radiogram",
        "txt_file_uri": "RADIOGRAM & RRI Forms/Radiogram.txt",
        "initial_uri": "RADIOGRAM & RRI Forms/Radiogram.html",
        "viewer_uri": "RADIOGRAM & RRI Forms/Radiogram.html",
        "reply_txt_file_uri": "",
        "reply_initial_uri": "",
        "reply_viewer_uri": ""
    },
    "fields": {
        "address": "",
        "archivethis": "RRI-ARCHIVE",
        "callsign": "AA1BB",
        "check": "1",
        "check2": "1",
        "city": "ANYTIME",
        "country": "",
        "date": "APR 11",
        "email": "",
        "filenamefld": "file:///{FormFolder}RadioGram Work Sheet.html",
        "finalphone": "NO PHONE",
        "h_info": "",
        "hphone": "",
        "instructions": "NONE",
        "mailthisto": "RRI-Region2;",
        "messagetxt": "HELLO ",
        "msgbody": "",
        "msgcc": "",
        "msgisacknowledgement": "False",
        "msgisforward": "False",
        "msgisreply": "False",
        "msgp2p": "",
        "msgsender": "AA1BB",
        "msgseqnum": "0",
        "msgsubject": "",
        "msgto": "",
        "msgtosend": "1 R AA1BB 1 INTERNET 0301Z APR 11\r\nJOHN DOE \r\nANYTIME NY 10001 \r\nNO PHONE \r\nBT\r\nHELLO\r\nBT\r\nTEST\r\nAR",
        "opnote1": "",
        "opnote2": "",
        "phoneextention": "",
        "place": "INTERNET",
        "priority": "R",
        "radiobutton": "RRI-Region2;",
        "seqnum": "1",
        "sig": "TEST",
        "state": "NY",
        "subjectline": "QTC 1 R ANYTIME NY 10001",
        "submit": "Submit",
        "svc": "",
        "t2": "{FormFolder}",
        "textfield": "{FormFolder}",
        "tformat": "UTC",
        "time1": "0301Z",
        "to1": "JOHN DOE",
        "tocall": "",
        "txtstr": "",
        "zip": "10001"
    },
    "msg_subject": "QTC 1 R ANYTIME NY 10001",
    "msg_body": "Cc: RRI-ARCHIVE\r\nSeqInc:",
    "msg_xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RMS_Express_Form>\n  <form_parameters>\n    <xml_file_version>1.0</xml_file_version>\n    <rms_express_version>v0.12.1 (ccb4934)</rms_express_version>\n    <submission_datetime>20220411030232</submission_datetime>\n    <senders_callsign>AA1BB</senders_callsign>\n    <grid_square>AA11aa</grid_square>\n    <display_form>Radiogram.html</display_form>\n    <reply_template></reply_template>\n  </form_parameters>\n  <variables>\n    <svc></svc>\n    <msgsender>AA1BB</msgsender>\n    <hphone></hphone>\n    <radiobutton>RRI-Region2;</radiobutton>\n    <tocall></tocall>\n    <city>ANYTIME</city>\n    <priority>R</priority>\n    <msgsubject></msgsubject>\n    <msgp2p></msgp2p>\n    <msgisacknowledgement>False</msgisacknowledgement>\n    <zip>10001</zip>\n    <callsign>AA1BB</callsign>\n    <address></address>\n    <messagetxt>HELLO </messagetxt>\n    <check>1</check>\n    <country></country>\n    <place>INTERNET</place>\n    <msgto></msgto>\n    <archivethis>RRI-ARCHIVE</archivethis>\n    <t2>{FormFolder}</t2>\n    <check2>1</check2>\n    <date>APR 11</date>\n    <phoneextention></phoneextention>\n    <textfield>{FormFolder}</textfield>\n    <submit>Submit</submit>\n    <instructions>NONE</instructions>\n    <email></email>\n    <filenamefld>file:///{FormFolder}RadioGram Work Sheet.html</filenamefld>\n    <seqnum>1</seqnum>\n    <state>NY</state>\n    <time1>0301Z</time1>\n    <mailthisto>RRI-Region2;</mailthisto>\n    <subjectline>QTC 1 R ANYTIME NY 10001</subjectline>\n    <finalphone>NO PHONE</finalphone>\n    <h_info></h_info>\n    <msgbody></msgbody>\n    <txtstr></txtstr>\n    <opnote1></opnote1>\n    <msgtosend>1 R AA1BB 1 INTERNET 0301Z APR 11&#xD;&#xA;JOHN DOE &#xD;&#xA;ANYTIME NY 10001 &#xD;&#xA;NO PHONE &#xD;&#xA;BT&#xD;&#xA;HELLO&#xD;&#xA;BT&#xD;&#xA;TEST&#xD;&#xA;AR</msgtosend>\n    <sig>TEST</sig>\n    <msgisreply>False</msgisreply>\n    <msgseqnum>0</msgseqnum>\n    <opnote2></opnote2>\n    <to1>JOHN DOE</to1>\n    <msgcc></msgcc>\n    <msgisforward>False</msgisforward>\n    <tformat>UTC</tformat>\n\n  </variables>\n</RMS_Express_Form>\n",
    "is_reply": false,
    "submitted": "2022-04-10T20:02:32.259593294-07:00"
}

This is using a locally built version of 0.12.1 and the latest forms.

$ ./pat version
Pat v0.12.1 (ccb4934) linux/arm64 - go1.18

I think the expected behavior would be to set the To and Cc fields as specified by the form, the body to be the contents of msgtosend and for the msg_xml value to be added as an attachment.

sit avatar Apr 11 '22 03:04 sit

I tested this and it works for me. I'm sure there was a lot of consternation about this after the last winlink wednesday here where they use the radiogram form. It still doesn't put the callsign into the "To:" field, but I guess that's a separate issue.

cminyard avatar Jun 16 '22 13:06 cminyard

Actually, I found a few bugs after working on this. I have created pull request #355 which has the patch from @sit and a new patch that fixes a couple of other things. This fills out the To field for me now. So that wasn't a separate issue after all.

@sit, you can take this change, or the pull can come from #355.

I have not regenerated the compiled code in the patch, as that makes things hard to merge.

cminyard avatar Jun 17 '22 00:06 cminyard