• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Complex form validations ?

Incremental

Member
Hello,
for a contact Form, I have 2 groups :
  • contact : with public elements for contacting
  • reply : with admin answering elements
My idea is to have only one form performing different validation actions, when used in public or admin (ACL + templating)
At the moment, my validation is working for public with a few Forms Plugins :
  • email : send a mail to Admin, when there is a contact,
  • receipt : allows user to receive a copy by mail,
  • redirect : redirect or display a message when Contact is submitted
Now, I would like to add some actions for admin :
  • store the Reply group element contents in DB,
  • send an email to the user, with the reply.
1) Storing is always done by the submit button, but I would like to control it.
Do I just need some PHP run OnBeforeStore ?

2) Sending an email, I tried to add another email plugin with the condition "Answer message not empty".
I added the condition :
PHP:
return '{contacts___Answer}' != "";
but it doesn't work ! Any idea ???

3) I'm wondering if it's not simpler to have only one full PHP plugin performing validations and email sending.
Are there any limitations in plugins accumulation ?
For sending emails what is the best PHP code ?

Thanks
 
1) I guess so - you'd need to be more specific in what you wanted to do for me to be more sure about my answer though.

The text area has a default value of 'Ma r?ponse !' - probably why your test is not working?

There's not specific limitation with plugin accumulation.

For sending mails you should use the email plugin, if that really isn't what you want then you should use the Joomla mail class to do so - you can see that code in the email plugin
 
1) Public Form is filled by.... public.
Contact group elements are filled and Reply group elements are still empty.

When the admin see a contact message, he should view/modify it,
and also Reply to it :
- click on a Reply button or the Reply group makes elements appearing
- he can fill Reply Group elements for the answer to original contact
- click on "Save" to :
  • store Reply elements (answer + automatic answer date) and modify Contact status to "replied"
  • then send a mail to the customer with Answer field
Of course this has to be done only when the Admin filled a Reply (answer date is only filled at this time) and not when the Admin Edit the Contact.
I'm wondering if a separate PHP "Email answer" button would be simpler (and possible) ?
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top