Written Communications Plugin Sender/Recipient Address Configuration

If you aren't speaking german, you can ask for support or post your request here.
Antworten
TenX
Beiträge: 54
Registriert: 11. Sep 2015, 13:22

Written Communications Plugin Sender/Recipient Address Configuration

Beitrag von TenX »

I am trying to configure the Sender and Recipient addresses to show in the US format:

John Doe
123 Any Street
Anytown, State Zipcode

To this end, I added a custom profile field named 'State' to have a complete US address like shown above.
How do I configure the plugin to add the parameters for both the Sender and Recipient 'State' fields to show up and work in the 'Create written communication' form? Is it possible to add custom parameters to the config.php file to pick up and differentiate between the Sender and the Recipient "State" field?
Subsequently, I want to use the "State" placeholder on the MS Word Template as well.
I have little to zero knowledge of PHP and have tried a few variations of the code (best as I know how) but without much success.
Anyone that has the answer, can you please provide some help? Appreciate the help, for sure!
Benutzeravatar
Thomas-RCV
Former team member
Beiträge: 786
Registriert: 1. Aug 2011, 15:06

Re: Written Communications Plugin Sender/Recipient Address Configuration

Beitrag von Thomas-RCV »

Hi TenX,

How to register custom profile fields you can find in the readme file of the Plugin and also in our Wiki now:

http://www.admidio.org/dokuwiki/doku.ph ... briefmodul

One issue at this time:
Currently, custom profile fields can only be handled for recipient label options. The profile fields for the sender profile fields are hard coded in the class adm_getRoleMembers.php.
There you would need to add your "STATE" Profile field to the SQL Statement in two sections. First you would need to register at the beginning of the SQL SELECT block and then also define the further JOIN to the datatable.
At the end it is of course an issue to make the class more flexible in future to handle the custom profilefields as well.
I hope it helps you getting started.

Best,
Thomas
TenX
Beiträge: 54
Registriert: 11. Sep 2015, 13:22

Re: Written Communications Plugin Sender/Recipient Address Configuration

Beitrag von TenX »

Thomas,
Appreciate the quick reply!
Yesterday I upgraded Amidio to version 3.0.3 which was just released. Have not made any alteration to the Written_Communications plugin yet as you suggested, but have a new problem.
I can open the 'Create written communication' form, fill it out (using built in demo template) and click on the 'Download document' button.
The dialog box from MS Word opens and asks to either open or save the file. When I open the file, Word opens to a blank document, however, the file is automatically saved in the directory Written_Communications > templates.
That was not the default behavior prior to the Amidio upgrade, not sure what changed?

https://www.flickr.com/photos/tony_hund ... otostream/
https://www.flickr.com/photos/tony_hund ... otostream/
Benutzeravatar
Thomas-RCV
Former team member
Beiträge: 786
Registriert: 1. Aug 2011, 15:06

Re: Written Communications Plugin Sender/Recipient Address Configuration

Beitrag von Thomas-RCV »

Which version of the plugin are you using? The latest release? I did some bugfixes.
Is it posible to send me the output file via PM? Normally the Admidio core update should not be the problem.
Anyway a file is obviously created. We need to figure out the problem ...

Best,
Thomas
Benutzeravatar
Thomas-RCV
Former team member
Beiträge: 786
Registriert: 1. Aug 2011, 15:06

Re: Written Communications Plugin Sender/Recipient Address Configuration

Beitrag von Thomas-RCV »

Hi TenX,

got your file and it is working fine. Can open it with MS Office 2007 without Trouble.

Best,
Thomas
TenX
Beiträge: 54
Registriert: 11. Sep 2015, 13:22

Re: Written Communications Plugin Sender/Recipient Address Configuration

Beitrag von TenX »

Thomas,
The issue was not that the file would not open in MS Word, but rather how I described it previously. I can fill out the W_C form and click on the Download button. The MS Word dialog box opens giving you the option of either opening it or saving it.
If I decide to open it......instead of opening the downloaded letter, it opens a blank Word document. The letter that is created automatically gets saved on the server in the 'templates' folder, alongside where the templates are kept (reference the screen shots I linked earlier).
The letter should should open in Word like it used to....so it can be printed for all the members of the role selected.
Regards,
Tony

P.S. The original question I had posted at the top of this thread in regards to formatting the Sender and Recipient addresses in the US format and including the custom Sate field....with the answer you provided I was able to add the correct code in the right places and have it function as I needed. Thank you for the help.
Benutzeravatar
Thomas-RCV
Former team member
Beiträge: 786
Registriert: 1. Aug 2011, 15:06

Re: Written Communications Plugin Sender/Recipient Address Configuration

Beitrag von Thomas-RCV »

Hi TenX,

I answered your Email.
The created file is temporary stored in this folder and should automatically be unlinked after the download to the Client proceed. This obviously doesn´t work in the Moment. I will fix later.
This is not the problem with your white document.

Best,
Thomas
Antworten