zikula-modules / formicula Goto Github PK
View Code? Open in Web Editor NEWA template-driven form mailer for Zikula
Home Page: https://ziku.la
A template-driven form mailer for Zikula
Home Page: https://ziku.la
By default Formicula creates a Webmaster contact from the site admin. This contact becomes contact number one and is first in the drop-down list of "who to contact" in the default contact form even if you add other (more important) contacts.
The only way to make a different contact the default (selected) contact or to order multiple contacts is to change the contact ID numbers in the database directly.
Please consider adding the ability to order contacts by drag and drop so they can easily be placed on the form in the order desired.
Related with #19
In trying to upgrade a site from Zikula 1.2.8 to 1.3.3 I uploaded this version of Formicula.
In the Extensions module Formicula was labeled "New version (3.0.1)".
Clicked the upgrade icon and got these errors and no upgrade.
Error on Example
Could not load the 'extensions' module at 'upgrade'.
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'example_zikula133.zk_formcontacts' doesn't exist. Failing Query: "DESCRIBE zk_formcontacts"
Exception Trace
#0 Exception thrown in /home/example/public_html/zk133/lib/vendor/Doctrine/Doctrine/Connection.php, line 1082.
#1 /home/example/public_html/zk133/lib/vendor/Doctrine/Doctrine/Connection.php(862): Doctrine_Connection->execute('DESCRIBE zk_for...', Array)
#2 /home/example/public_html/zk133/lib/vendor/Doctrine/Doctrine/Import/Mysql.php(143): Doctrine_Connection->fetchAssoc('DESCRIBE zk_for...')
#3 /home/example/public_html/zk133/lib/util/DBUtil.php(3492): Doctrine_Import_Mysql->listTableColumns('zk_formcontacts')
#4 /home/example/public_html/zk133/lib/util/DBUtil.php(3159): DBUtil::metaColumnNames('formcontacts')
#5 /home/example/public_html/zk133/modules/Formicula/lib/Formicula/Installer.php(168): DBUtil::changeTable('formcontacts')
#6 [internal function]: Formicula_Installer->upgrade('2.0')
#7 /home/example/public_html/zk133/system/Extensions/lib/Extensions/Api/Admin.php(1021): call_user_func(Array, '2.0')
#8 [internal function]: Extensions_Api_Admin->upgrade(Array)
#9 /home/example/public_html/zk133/lib/util/ModUtil.php(1082): call_user_func(Array, Array)
#10 /home/example/public_html/zk133/lib/util/ModUtil.php(1187): ModUtil::exec('Extensions', 'admin', 'upgrade', Array, true, NULL)
#11 /home/example/public_html/zk133/system/Extensions/lib/Extensions/Controller/Admin.php(722): ModUtil::apiFunc('Extensions', 'admin', 'upgrade', Array)
#12 [internal function]: Extensions_Controller_Admin->upgrade(Array)
#13 /home/example/public_html/zk133/lib/util/ModUtil.php(1082): call_user_func(Array, Array)
#14 /home/example/public_html/zk133/lib/util/ModUtil.php(1161): ModUtil::exec('Extensions', 'admin', 'upgrade', Array, false, NULL)
#15 /home/example/public_html/zk133/index.php(78): ModUtil::func('Extensions', 'admin', 'upgrade', Array)
#16 {main}
Go back to previous page
Note: After I removed the old references to Formicula from the database so that the extension status was "not installed' the module installed correctly, but of course without any forms or contacts.
phenomenon
There is a new method for checking hte authorization key. Submitting a form also gives
Warning! Static call SecurityUtil::confirmAuthKey() is deprecated. Please use SecurityUtil::validateCsrfToken() instead.
background analysis
implementation recommendation
Update the auth keys as in Core and other 3rd party modules
Hi guys,
I found a bug in template nr. 4 (3_userform.html)
In this template there is a datepicker. In combination with short urls there is a problem.
If you answer the captcha once wrong, by the next try the system will tell you that your answer is wrong, even if it is right.
You only can send the form, if you reload the page and fill out all again.
The combination is: datepicker + short url + you answer the captcha once wrong.
best regards,
snowcrack
Formicula 3.1.1 in Zikula 1.4 gives the following error when using a form:
Fatal error: Call to undefined method DataUtil::censor() in
.../modules/Formicula/lib/Formicula/Api/User.php on line 306
Zikula 1.3.6 (last distribution I used) had: /lib/util/Datautil.php where starting on line 515 there is a 'public static function' censor ($var) that seems to be gone in 1.4.x and I can find no language anywhere in 1.4.x about this public static function or censor().
It looks to me as if Formicula is calling a missing function here:
/modules/Formicula/lib/Formicula/Api/User.php lines 306-313.
Zikula 1.4.0 includes webshim already, see zikula/core#2324
So for the first 1.4 release of Formicula it can be removed in the module.
See the project at
https://github.com/nathansmith/formalize
http://formalize.me/
it gives forms a generic look on various platforms and browsers
It would be cool if we could encrypt the form content that gets sent via email with a GPG/PGP key.
Seems like to upgrade to 4.00 broke the Content plugin functionality. Since the Formicula upgrade the Content pages using the plugin spit errors.
Error! Unable to load plugin [Form] in module [Formicula] since the class is not defined. Upgrade of Formicula module required.
Also trying to add a new Formicula Plugin on an existing Content page does not work any longer.
CSS is broken on that page and the "select content type" dropdown is completly empty.
When disabling Formicula extension, Content starts working again.
Ich habe die Aktivierung nur mit 2 Änderungen im Installer durch bekommen.
public function upgrade($oldversion)
{
// Get database information
ModUtil::dbInfoLoad('Formicula');
// perform a global db change for all versions >= 0.4
// if(version_compare($oldversion, '0.5', '>')) {
// if (!DBUtil::changeTable('formcontacts')) {
// return LogUtil::registerError($this->__('Database upgrade failed'));
// }
// }
case '3.0.0':
// remove table prefixes manually
$prefix = $this->serviceManager['prefix'];
$connection = Doctrine_Manager::getInstance()->getConnection('default');
$sqlStatements = array();
// N.B. statements generated with PHPMyAdmin
$sqlStatements[] = 'RENAME TABLE ' . $prefix . '_formcontacts' . " TO `formcontacts`";
// this removes the prefixes but also changes hideonindex to displayonindex and disallowcomments to allowcomments
// because 'from' and 'to' are reserved sql words, the column names are changed to ffrom and tto respectively
foreach ($sqlStatements as $sql) {
$stmt = $connection->prepare($sql);
try {
$stmt->execute();
} catch (Exception $e) {
}
}
if (!DBUtil::changeTable('formcontacts')) {
return '3.0.0';
}
// create the formicula table for storing submits
if (!DBUtil::createTable('formsubmits')) {
return LogUtil::registerError($this->__('The installer could not create the formsubmits table'));
}
$this->setVar('store_data', 0);
$this->setVar('store_data_forms', '');
// register handlers
EventUtil::registerPersistentModuleHandler('Formicula', 'module.content.gettypes', array('Formicula_Handlers', 'getTypes'));
// Call the update method for the Content plugin
if (ModUtil::available('Content')) {
Content_Installer::updateContentType('Formicula');
}
case '3.0.1':
It would be nice if we could change the order of the contacts/addresses.
Otherwise we must delete and create all contacts again if we want to change the sort order.
make it possible to choose one contact inside the content plugin so that the visitor can not change this contact
On Tue 25/10/11 3:23 PM , Captcha bypass [email protected] wrote:
formicula_admin_html_email
Hello,
A visitor of to your web site used the form for contact and sent the
following:Form # : 0
Contact or Theme : Mirrors
Your Name : Captcha bypass
E-Mail : [email protected]
Homepage : http://www.captchaking.com/
Company : Captcha bypass software
Phone Number : Captcha bypass software
Location : NetherlandsComment : yumvdbquptje, Car windshield snow cover, zwRpcCz,
[url=http://www.repairwindshield.com/]Repair Windshield[/url], mQqCCtl,
http://www.repairwindshield.com/ Sun shades for car windshield, gAkmDsv,
Compare viagra levitra celias, tveCoHT,
[url=http://buylevitrausa.ucoz.com/]Levitra[/url], ikSABfV,
http://buylevitrausa.ucoz.com/ 20mg levitra, YApYtju, Seo phoenix, bkLFgpo,
[url=http://www.daveshap.com/]Phoenix Seo[/url], StZaSzD,
http://www.daveshap.com/ Phoenix Seo, jGDtbbo, get rid of stretch marks,
uQoVTmq, [url=http://getcosmetyn.net/]Cosmetyn Review[/url], uaRwBUq,
http://getcosmetyn.net/ get rid of stretch marks, pmRybjZ, smile by glow
reviews, qwfZBBC, [url=http://smilebyglowspecialoffer.net/]smile by glow
reviews[/url], aZjhqGH, http://smilebyglowspecialoffer.net/ smile by glow
reviews, rPntNJB, Bypass Captcha, JvoExNY,
[url=http://www.captchaking.com/]Bypass Captcha[/url], NEfyfZc,
http://www.captchaking.com/ Bypass Captcha, EkGpPIL.The user has the following IP address/hostname: 193.34.144.193 /
193.144.34.193.static.giga-dns.com
Hello,
It be very good if there is a option to put some attachement file to reponse that user get from form.
exempl : In form n°1 we put or non one attachement file
In form n°2 we put another attachement files
thanks
When you have storing in the dbase enabled it would be nice to be able to remove certain submits
bug description
I can't send attachements with formicula.
bug analysis
I tried 2.2. and 3.0 from GIT with Zikula 1.3 in form of various builds and it just can't get attachements to work. I only get the file name in the confirmation mail. When I set formicula to not delete uploads I can't see the file in that directory.
fix recommendation
Change History
comment:1 Changed 10 months ago by arg
I see you assemble the attachements checking for is_array($custom[$i]data? (line 108, modules/Formicula/Api/User.php) - I found out that it's never an array but always only the file name. It might be related to that
comment:2 Changed 9 days ago by espaan
Status set to pending-review
I have never tried attachements. So have to test this then..
http://coding.smashingmagazine.com/2011/12/05/sisyphus-js-client-side-drafts-and-more/
this article describes the use of html5 and Sisyphus.js to autosave form inputs during filling out of the form.
We already have a solution for the captcha in place, but this could add another layer of user friendliness.
See also the github project https://github.com/simsalabim/sisyphus
today the user have a selctbox for a form where he can select wich contact we want. This could be restricted via permission or the template is directly linked to a contact id. This both is done inside the template.
It is more usefull to have this combination in the configuration for each available form.
e.g.
1.: select box with contacts (and the permission restriction like today)
and
: no selectbox and a descission which contact is given for the dedicated form.
Currently formicula forms post individual fields. If this were to be changed to post an array of fields, extending formicula forms for custom uses, would be much easier. This would be an easy change to make and would make formicula much easier to extend.
Currently formicula_user_send() does the following:
$uduname? = FormUtil::getPassedValue('uname', (isset($argsuname?)) ? $argsuname? : , 'GETPOST');
$uduemail? = FormUtil::getPassedValue('uemail', (isset($argsuemail?)) ? $argsuemail? : , 'GETPOST');
$udurl? = FormUtil::getPassedValue('url', (isset($argsurl?)) ? $argsurl? : , 'GETPOST');
$udphone? = FormUtil::getPassedValue('phone', (isset($argsphone?)) ? $argsphone? : , 'GETPOST');
$udcompany? = FormUtil::getPassedValue('company', (isset($argscompany?)) ? $argscompany? : , 'GETPOST');
$udlocation? = FormUtil::getPassedValue('location', (isset($argslocation?)) ? $argslocation? : , 'GETPOST');
$udcomment? = FormUtil::getPassedValue('comment', (isset($argscomment?)) ? $argscomment? : , 'GETPOST');
Would it not be much easier to do
$ud = FormUtil::getPassedValue ('userdata', array(), 'GETPOST');
and then do
$uduname? = isset($argsuname?) ? $argsuname? : $uduname?;
This would allow you to extend the posted values without having to worry about them being captured from POST. Any extensions with new fields could then be handled only by templates.
I've just seen that square brackets are not correctly displayed by in the examples above. I think/hope it's still clear what I mean though.
Change History
comment:1 Changed 3 years ago by Landseer
This would break existing form templates. To be backwards compatible both ways need to be supported.
comment:2 Changed 3 years ago by Landseer
Milestone set to not yet defined
comment:3 Changed 3 months ago by espaan
Milestone changed from not yet defined to 3.0.0
Status set to pending-review
I'm trying to get this on the road with a BW compatilibilty flag.
It would be fine, if there would be a possibility, to activate a optional step before sending the form.
So it's possible to have a look at his data before sending them.
It's possible to use for every installed language an seperat subject?
The Block "blockext" it is a good example.
english - Contact
german - Kontakt
italian - Contatti
I try it about the Language-File global.php in the Theme-Folder or in the Formicula-Folder with "define('_FORMULAR_KONTAKT','Kontaktaufnahme');" and define the subject "_FORMULAR_KONTAKT". But it doesn't work. And it is not realy practicabel for enduser.
Thanks! Jens.
Change History
comment:1 Changed 3 years ago by Landseer
Priority changed from major to minor
Version set to 2.0
Type changed from defect to enhancement
Severity changed from medium severity to low severity
Is this about emails or forms?
If the solution of the captcha calculation is wrong, all field-Valueas are depleted.
comment:3 Changed 5 months ago by espaan
BTW Still the case in the 30x version for zikula 1.3. I will try to take a look, cause that indeed is very uncomfortable for users :-)
comment:4 Changed 3 months ago by espaan
I have something implemented here for 3.0.x. Needs to be commited still
If file attachments are managed to work (added enctype attribute to userform, and uncommented attachment section), then in confirmation page, and in sent emails, we obtain "Array" instead of attached file name. To correct this:
change:
$custom.fileupload.data
to:
$custom.fileupload.data.name
At his moment the username (userdata.uname) is a required field always. But this may not be the case for all forms. Feedback forms without being logged in for instance.
You can achive this with userformat setting to none, but a general setting in which fields are obliged can also be thought of.
Formicula is currently not properly usable with SMTP because it uses different email addresses (of users and defined contacts) as sender address. This is not allowed when using a SMTP server. As a workaround I disabled the fromaddress
property from the Mailer
calls in the user api.
It would be nice to be able to export the stored submits in the dbase to e.g. excel or whatever.
hi,
the validation script support a lot of validations, but not all of them have a language contant already. I've listed the validation options below:
required (not blank): _FOR_ADVICE_MANDATORY
validate-number (a valid number): _FOR_ADVICE_NUMBER
validate-digits (digits only): _FOR_ADVICE_NUMBER
validate-alpha (letters only): ??
validate-alphanum (only letters and numbers): ??
validate-date (a valid date value): _FOR_ADVICE_DATE
validate-email (a valid email address): _FOR_ADVICE_EMAIL
validate-url (a valid URL): _FOR_ADVICE_URL
validate-date-au (a date formatted as; dd/mm/yyyy): _FOR_ADVICE_DATE
(I've made a remark about a date-eu in the google group dexagogo) and a suggestion on how to make it btw).
validate-currency-dollar (a valid dollar value): ??
validate-selection (first option e.g. 'Select one...' is not selected option): ??
validate-one-required (At least one textbox/radio element must be selected in a group - see below*): ??
Change History
comment:1 Changed 16 months ago by espaan
Most of these are already solved #63 with the new example form. And of course the above is still using the defines instead of gettext.
When the captcha is X - X then the result is 0, but the validation now gives an ok when hte captcha is not filled in at all.
Function send in controller/user.php
$captcha = (int)FormUtil::getPassedValue('captcha', (isset($args['captcha'])) ? $args['captcha'] : 0, 'GETPOST');
However this goes to integer 0 when captcha is not present, and then X-X is validated :-)
I have not really tried yet, but read in the forum a while back that ssl/https submissions do not work. It might be good to have it possible to enable ssl for certain forms.
The forum topic in which this was discussed: http://support.zikula.de/module-CMS_Support_Forum-viewtopic-topic-30843-start-0.htm
So with options:
A list of forms in the admin section with a short description would then also be very convenient, see #37
It would be good to have a read-only list of the available forms on the disk in the admin overview panel.
I sometimes want to see which form is which, but cant since that is on the disk, but I not always have access to the disk.
When there is a list of the available forms this would be solved,
But I think the forms would have to have some form of title in them otherwise you still dont know which is whic.
2 nice options: http://jqueryui.com/demos/datepicker/
or update the current datepicker http://jongsma.org/software/protoplasm/control/datepicker?page=datepicker
In Formicula 2.2, pnuser.php, function formicula_user_main() I found a misstyped variable name. Fortunately this doesn't cause a problem.
if (pnUserLoggedIn()) {
$uname = (pnUserGetVar('name') == '') ? pnUserGetVar('uname') : pnUserGetVar('name');
$uemail = pnUserGetVar('email');
} else {
$uname = '';
$email = ''; // This has to be $uemail = '';
}
The adminmail and usermail templates should check which fields are enabled and skip deactivated ones (like form and confirmation templates also do it).
In 0_userconfirm.tpl
:
{include file='forms/0_userfooter.html'}
Template extension is wrong (html => tpl).
Same is in confirmation for form 1, 2 and 3.
or skip the fields in the configuration.
Change History
comment:1 Changed 5 months ago by espaan
Status set to pending-review
hi what do you mean with configurations ?
comment:2 Changed 5 months ago by rallek
To long ago. I can't remember. Might be I will see it again when using formicula next time.
I checked the current code and I saw that the module is still using the table prefixes.
It was a fresh installation.
Tried the 4.00 update. What I did:
Disabled the old and activated the new, results in all Contacts being gone. Uninstalling the old will also brake the new as 4.00 cant find its databases any longer.
Had to remove the new, and re-installed it again. Then I was able to continue with fresh install.
When adding a new contact in Formicula via Extensions admin page the page loads and contains 2 fieldsets. The upper one is about the new contact while the bottom one contains a form about the sender.
These 3 input fields are marked "mandatory" which doesnt make too much sense for me when adding a new contact.
Just compared the behavior with the old 3.1.2 Formicula where these 3 input fields are NOT mandatory.
Thanks for checking.
There is a conflict between textarea HTML5 attribute required
and CKEditor with version prior 4.2. More info here:
http://dev.ckeditor.com/ticket/8031
The problem is solved in CKEditor 4.2 and later, but can lose some time for those using Scribite 4 or CKEditor with lower version, and upgrading to Formicula 3.1.
It seems there is noting to do now, as Scribite 5 will come with proper CKEditor version.
For now users can overwrite respective form template and then remove this attribute.
If user selects HTML type of e-mail, then HTML tags are striped and display is wrong.
To corect this:
In Formicula/lib/Controler/User.php, in function send, find:
$userdata['comment'] = strip_tags($userdata['comment'])
and comment or remove this line, then before line:
if(ModUtil::apiFunc('Formicula', 'user', 'sendtoContact',
add:
$userdata_comment = $userdata['comment'];
// remove tags from comment to avoid spam
if ($adminformat == 'plain') {
$userdata['comment'] = strip_tags($userdata_comment);
}
and before:
if(($this->getVar('send_user') == 1) && ($userformat <> 'none')) {
add:
// remove tags from comment to avoid spam
if ($userformat == 'plain') {
$userdata['comment'] = strip_tags($userdata_comment);
}
Right now only the user confirmation emails can have custom subject lines, but even they are connected to the contact, rather than to the specific form.
All emails to the contacts resulting from any form submission have the subject line "Site Name - "Contact Name". Which is coded into modules\Formicula\pnuserapi.php about line 235.
It would be an advantage to be able to customize the subject of the emails to match the purpose of the form. Right now if you have several forms like
General Contact
Job Application
Event Registration
which all have the same contact available, they all have the same subject line.
Couldn't the form subject be defined by a hidden field in the form template itself? You can already define other form specific options using hidden fields. The default could remain as it is, with the hidden value as an override where needed.
Change History
comment:1 Changed 3 months ago by espaan
Milestone changed from 2.2 to 3.0.0
Severity changed from blocker to medium severity
Status set to pending-review
This would indeed make a lot of sense. To make more configurable items in the forms possible.
This line causes a fatal error
$im = imagecreate ($box['width'], $box['height']);
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 33554434 bytes) in /www/htdocs/foo/demo/modules/Formicula/templates/plugins/function.simplecaptcha.php on line 114
Attachments possibility is provided (commented by default), but if user uncomment attachment section, attaching files doesn't work.
This is because in form tag is missing proper enctype attribute.
This can correct cahnging line:
<form id="contactform2" class="z-form" action="{modurl modname=Formicula type=user func=send}" method="post">
to:
<form id="contactform2" class="z-form" action="{modurl modname=Formicula type=user func=send}" method="post" enctype="multipart/form-data">
use the new adressbook of t_smiatek alternatively to the internal contactlist to get more fields like phone numbre or adresses
The module does not install on Zikula 1.4.0.
When setting up a form it's often desirable to require users to enter a piece of data twice, the two fields must match to avoid typos. You see this all the time on web forms where something like an email or contact number is very important to get right.
I'd like to be able to make fields like this in Formicula forms, is there a plugin for this?
It's even on the Zikula new user registration form for email, is the Javascript somewhere in the standard Zikula scripts?
Change History
comment:1 Changed 16 months ago by espaan
You can do this with the validation.js options. See http://tetlaw.id.au/view/javascript/really-easy-field-validation
for the options. You must make a validation yourself and include the equatToField in there.
See the example on that page where you have password matching check as below.
Validation.addAllThese('validate-password', 'Your password must be more than 6 characters and not be 'password' or the same as your name', {
minLength : 7,
notOneOf : ['password','PASSWORD','1234567','0123456'],
notEqualToField : 'username'
});
comment:2 Changed 5 months ago by espaan
Priority changed from major to minor
Severity changed from blocker to medium severity
Status set to pending-review
comment:3 Changed 3 months ago by espaan
Milestone changed from 2.2 to 3.0.0
It might make sense to put this in an example form somewhere.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.