(Each project requires you to login separately)

formicula

Ticket #10 (new enhancement)

Opened 5 months ago

Last modified 6 weeks ago

Please change formicula so that it's forms post data objects/arrays

Reported by: rgasch Owned by: Landseer
Priority: major Milestone: not yet defined
Version: Severity: high severity
Keywords: Cc:

Description

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

Changed 3 months ago by Landseer

This would break existing form templates. To be backwards compatible both ways need to be supported.

Changed 6 weeks ago by Landseer

  • milestone set to not yet defined
Note: See TracTickets for help on using tickets.
 
 
Powered by Trac
Design by Arcsin