mail receiver and information collection

Author Message

Eric Bourgain

Friday 25 August 2006 10:41:32 am

Hi everybody,

I'm designing a form designer. Everything works fine, but with the mail.
I've a receiver chooser, so that the user can choose to whom the mail will be send. I am able to retrieve the mail, but I can't set it!

If I have something like that:

{section name=Attribute loop=$collection.attributes}{if eq($Attribute:item.contentclass_attribute.identifier, 'iag_recipient_choice')}{foreach $Attribute:item.contentclass_attribute.content.options as $option}{if eq($option.name, $Attribute:item.data_text)}
{set-block scope=root variable=email_receiver}MY_EMAIL{/set-block}
{break}{/if}{/foreach}{break}{/if}{/section}

or if I indent it:

{section name=Attribute loop=$collection.attributes}
  {if eq($Attribute:item.contentclass_attribute.identifier, 'iag_recipient_choice')}
    {foreach $Attribute:item.contentclass_attribute.content.options as $option}
      {if eq($option.name, $Attribute:item.data_text)}
{set-block scope=root variable=email_receiver}MY_EMAIL{/set-block}
        {break}
      {/if}
    {/foreach}
    {break}
  {/if}
{/section}

the mariable email_receiver is empty in the collectinformation.php file

Now, if I only write

{set-block scope=root variable=email_receiver}MY_EMAIL{/set-block}

without the loop stuff, it works fine!
I know the look is OK, it is able to retrieve the mail.

Can anyone help me? Thanx

Eric

Claudia Kosny

Monday 28 August 2006 11:05:11 am

Hello Eric

are you sure that the variable is not overwritten in the loop? You break the inner loop (the foreach) once the variable is set but the outer loop (the section loop) is still there.

Otherwise your code looks fine to me, except that I would use a foreach for the outer loop as well.

Greetings from Luxembourg

Claudia

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

Main resources:

Total runtime0.0168 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 588.0469152.6406
Module start 'layout' 0.00590.0032 740.687539.4766
Module start 'content' 0.00910.0053 780.164189.3828
Module end 'content' 0.01440.0023 869.546930.3047
Script end 0.0167  899.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002715.9921140.0002
Check MTime0.00126.8666140.0001
Mysql Total
Database connection0.00116.485310.0011
Mysqli_queries0.002816.848530.0009
Looping result0.00000.082510.0000
Template Total0.001810.910.0018
Template load0.00095.637510.0009
Template processing0.00095.178010.0009
Override
Cache load0.00073.978810.0007
General
dbfile0.00021.303080.0000
String conversion0.00000.041340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs