Hello,
everyday I'm better in Form Tools coding and formatting, but here is the problem I can't handle.
I need to print specific output of submissions (one submission per page). "Additional text here" is not a part of field title and I need to be able to change it in different views. I made new export type and I'm trying to change smarty template to work for me. Here is my code:
1. The field "country" is dropdown field type and I need it to show selected option display text not field value. I know it has something to do with function.smart_display_field_values.php, but how to do it?
The code:
does display it correctly, but only positioned in "foreach" function, but I need it between <td> tags.
2. The field "client number" is field from clients table stored with each submission in submissions table. Could I somehow include in this output additional fields from clients "on the fly" (I suppose the right expression is "from session"
) or it should be better to store them in submission table?
Administrator doesn't need this output, just clients, so maybe it could be done?
Thanks for any help!
Lina
everyday I'm better in Form Tools coding and formatting, but here is the problem I can't handle.
I need to print specific output of submissions (one submission per page). "Additional text here" is not a part of field title and I need to be able to change it in different views. I made new export type and I'm trying to change smarty template to work for me. Here is my code:
Code:
{* loop through all submissions in the current result set *}
{foreach from=$submissions item=submission name=row}
<table cellpadding="2" cellspacing="0" width="610" class="print_table2">
{* loop through all submissions in the current View *}
{foreach from=$display_fields item=field name=col_row}
{assign var=field_id value=$field.field_id}
{assign var=field_type value=$field.field_info.field_type}
{assign var=col_name value=$field.col_name}
{assign var=value value=$submission.$col_name}
{if $col_name == "country"}
{smart_display_field_values field_id=$field_id selected=$submission.country}{/if}
{/foreach}
<tr>
<td width="243" valign="top">Last name (additional text here)</td>
<td width="347" class="big">{$submission.last_name}</td>
</tr>
<tr>
<td valign="top">Name (additional text here)</td>
<td class="big">{$submission.name}</td>
</tr>
<tr>
<td valign="top">Country (additional text here)</td>
<td class="big">{$submission.country}</td>
</tr>
<tr>
<td valign="top">Client number (additional text here)</td>
<td class="big">{$submission.client_number}</td>
</tr>
</table>
{if !$smarty.foreach.row.last}
<br />
<div class="no_print"><i>- {$LANG.phrase_new_page} -</i></div>
<br class="page_break" />
{/if}
{/foreach}
1. The field "country" is dropdown field type and I need it to show selected option display text not field value. I know it has something to do with function.smart_display_field_values.php, but how to do it?
The code:
Code:
{if $col_name == "country"}
{smart_display_field_values field_id=$field_id selected=$submission.country}{/if}
does display it correctly, but only positioned in "foreach" function, but I need it between <td> tags.
2. The field "client number" is field from clients table stored with each submission in submissions table. Could I somehow include in this output additional fields from clients "on the fly" (I suppose the right expression is "from session"
![Smile Smile](https://forums.formtools.org/images/smilies/smile.gif)
Administrator doesn't need this output, just clients, so maybe it could be done?
Thanks for any help!
Lina