Enhanced Selection as recepient for feedback form

Author Message

laurent le cadet

Thursday 21 September 2006 6:09:21 am

Hi,

I'm have a class (a feedback form) with the Enhanced Selection datatype. 4 items in a single choice list :

Europe
Asia
Africa
USA

I want to associate those geographical area with a e-mail address to use this address as recipient.

I looked in the standard feedback_form.tpl:

{set-block scope=root variable=email_receiver}{$object.data_map.recipient.content}{/set-block}

and tryed this:

{set-block scope=root variable=email_receiver}
	{switch match=$object.data_map.geographical_area.content}
		{case match="Europe"}
			first@domain.com
		{/case}
		{case match="Asia"}
			second@domain.com
		{/case}
		{case match="Africa"}
			third@domain.com
		{/case}
		{case match="USA"}
			fourth@domain.com
		{/case}
	{/switch}
{/set-block}

But this doesn't seems to work as this is the .ini default AdminEmail which is used.

Any hint ?

Reagrds.

Laurent

laurent le cadet

Thursday 21 September 2006 6:38:02 am

as is an array, I also tryed this :

{set-block scope=root variable=email_receiver}
{let selected_id_array=$node.object.data_map.zone_geographique.attribute.content}
		{section var=Options loop=$node.object.data_map.zone_geographique.attribute.class_content.options}
			{section show=$selected_id_array|contains( $Options.item.id )}
				{switch match=$Options.item.id}
				{case match=0}first@domain.com{/case}
				{case match=1}second@domain.com{/case}
				{case match=2}third@domain.com{/case}
				{case match=3}fourth@domain.com{/case}
				{case}{/case}
				{/switch}
			{/section}
		{/section}
{/let}
{/set-block}

Till no result :(

laurent le cadet

Thursday 21 September 2006 7:17:25 am

based on ezenhancedselection.tpl :

{let selected_id_array=$node.object.data_map.zone_geographique.attribute.content
     selected_array=array()}

{section name=Option loop=$node.object.data_map.zone_geographique.attribute.class_content.options}
{section-exclude match=$selected_id_array|contains($Option:item.identifier)|not}
    {$Option:item.name|wash(xhtml)}{delimiter}{cond($node.object.data_map.zone_geographique.attribute.class_content.delimiter|ne(""),$node.object.data_map.zone_geographique.attribute.class_content.delimiter,", ")}{/delimiter}
{/section}

{/let}

But I always have the first item of the list even if it's another one that is choiced.

:(((

laurent le cadet

Thursday 21 September 2006 8:06:05 am

pfuuuu...

{let email=$collection.attributes[9]}
{switch match=$email.data_text|wash(xhtml)}
{case match="Europe"}{set-block scope=root variable=email_receiver}europe@domain.com{/set-block}{/case}
{case match="USA"}{set-block scope=root variable=email_receiver}usa@domain.com{/set-block}{/case}
{case match="Asia"}{set-block scope=root variable=email_receiver}asia@domain.com{/set-block}{/case}
{case match="Africa"}{set-block scope=root variable=email_receiver}africa@domain.com{/set-block}{/case}
{/switch}
{/let}

It wasn't so hard Laurent !

Hope this help.

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 15:55:37
Script start
Timing: Jan 18 2025 15:55:37
Module start 'layout'
Timing: Jan 18 2025 15:55:37
Module start 'content'
Timing: Jan 18 2025 15:55:38
Module end 'content'
Timing: Jan 18 2025 15:55:38
Script end

Main resources:

Total runtime0.7340 sec
Peak memory usage4,096.0000 KB
Database Queries58

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 589.1953152.6406
Module start 'layout' 0.00740.0032 741.835939.4766
Module start 'content' 0.01060.7216 781.3125492.6953
Module end 'content' 0.73220.0018 1,274.007812.1250
Script end 0.7340  1,286.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.3955160.0002
Check MTime0.00130.1715160.0001
Mysql Total
Database connection0.00190.256710.0019
Mysqli_queries0.676192.1070580.0117
Looping result0.00050.0653560.0000
Template Total0.704095.920.3520
Template load0.00230.307920.0011
Template processing0.701895.604720.3509
Template load and register function0.00010.015110.0001
states
state_id_array0.00070.100010.0007
state_identifier_array0.00080.107820.0004
Override
Cache load0.00160.2129360.0000
Sytem overhead
Fetch class attribute can translate value0.00040.059810.0004
Fetch class attribute name0.00090.119950.0002
XML
Image XML parsing0.00430.588710.0043
class_abstraction
Instantiating content class attribute0.00000.002380.0000
General
dbfile0.00530.7173160.0003
String conversion0.00000.001440.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/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: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs