Select recipient for feedback form

Author Message

paul bolger

Thursday 06 January 2011 2:41:15 am

I'm trying to modify the ezwebin feedback form to allow the user to select a recipient from a list of users derived from a fetch of the user folder.

It seems to me that a way to do this would be to define the recipient in a global variable in

/full/feedback_form.tpl

and call that variable in

/content/collectedinfomail/feedback.tpl

- replace recipient.content in this code block with the variable

 {if and( is_set( $object.data_map.recipient ), $object.data_map.recipient.has_content )}
{set-block scope=root variable=email_receiver}{$object.data_map.recipient.content}{/set-block}
{/if}

So, fetching the users is easy, but how to set the variable on the form submission? Or is there a better way?

Paul Bolger

Bertrand Dunogier

Friday 07 January 2011 3:17:20 am

You can make the selected recipient a collection attribute, and make sure some kind of ID for the selected recipient is sent along with the collected data. In the feedback template, you can read the variable, fetch the associated email address, and set it as the recipient like you demonstrated with your code.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

paul bolger

Saturday 08 January 2011 12:51:42 pm

Thanks. It's the first part I'm unclear about. How would I go about making the selection a collection attribute? I took a look at using object relations to select an object but that datatype doesn't seem to work as an information collector.

regards

Pb

Paul Bolger

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 04:31:56
Script start
Timing: Jan 18 2025 04:31:56
Module start 'layout'
Timing: Jan 18 2025 04:31:56
Module start 'content'
Timing: Jan 18 2025 04:31:57
Module end 'content'
Timing: Jan 18 2025 04:31:57
Script end

Main resources:

Total runtime1.5593 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 588.0156152.6250
Module start 'layout' 0.00710.0034 740.640639.4531
Module start 'content' 0.01051.5471 780.0938541.3516
Module end 'content' 1.55760.0016 1,321.445312.1563
Script end 1.5593  1,333.6016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2139160.0002
Check MTime0.00130.0842160.0001
Mysql Total
Database connection0.00090.058310.0009
Mysqli_queries1.504796.4990570.0264
Looping result0.00070.0435550.0000
Template Total1.521597.620.7607
Template load0.00170.110920.0009
Template processing1.519797.462920.7599
Template load and register function0.00010.006710.0001
states
state_id_array0.00110.069110.0011
state_identifier_array0.00140.087620.0007
Override
Cache load0.00140.0902200.0001
Sytem overhead
Fetch class attribute can translate value0.00070.046320.0004
Fetch class attribute name0.00120.079150.0002
XML
Image XML parsing0.00120.074620.0006
class_abstraction
Instantiating content class attribute0.00000.000760.0000
General
dbfile0.00110.0710220.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs