This makes it possible to have an arbitrary number of homephone values.
CSV export will only use the first one, as before.
VCF importer should also correctly recognize multiple TEL;HOME;VOICE
fields.
}elseif(empty($entry['homephone']) &&
my_array_search('HOME',(array) $tel['param']['TYPE']) !== false &&
my_array_search('VOICE',(array) $tel['param']['TYPE']) !== false){
- $entry['homephone'] = $tel['value'][0][0];
+ $entry['homephone'][] = $tel['value'][0][0];
}
}
foreach((array) $vcf['EMAIL'] as $mail){
'fax' => 'facsimileTelephoneNumber',
'mobile' => 'mobile', // aka. cell phone
'pager' => 'pager',
- 'homephone' => 'homePhone',
+ '_homephone' => 'homePhone',
'homestreet' => 'homePostalAddress',
'photo' => 'jpegPhoto',
'url' => 'labeledURI',
<td><textarea name="entry[homestreet]" class="input" rows="2" cols="30">{$entry.homestreet|h}</textarea></td>
</tr>
{/if}
-{if $fields.homephone}
+{if $fields._homephone}
+ {foreach from=$entry.homephone|smarty:nodefaults item=homephone}
<tr>
- <th>{$lang.homephone}:</th>
- <td><input type="text" class="input" name="entry[homephone]" value="{$entry.homephone|h}" /></td>
+ <th>{$lang.homephone} {counter name=homephone}:</th>
+ <td><input type="text" class="input" name="entry[homephone][]" value="{$homephone|h}" /></td>
+ </tr>
+ {/foreach}
+ <tr>
+ <th>{$lang.homephone} {counter name=homephone}:</th>
+ <td><input type="text" class="input" name="entry[homephone][]" value="" /></td>
</tr>
{/if}
{if $fields.mobile}
{if $entry.homephone}
<tr>
<th>{$lang.homephone}:</th>
- <td><a href="callto://{$entry.homephone|escape:phone}">{$entry.homephone|h}</a></td>
+ <td>
+ {foreach from=$entry.homephone item=homephone}
+ <a href="callto://{$homephone|escape:phone}">{$homephone|h}</a><br />
+ {/foreach}
+ </td>
</tr>
{/if}
{if $entry.mobile}
ORG;ENCODING=QUOTED-PRINTABLE:{$entry.organisation|escape:qp};{$entry.office|escape:qp}
NOTE;ENCODING=QUOTED-PRINTABLE:{$entry.note|escape:qp}
TEL;WORK;VOICE;ENCODING=QUOTED-PRINTABLE:{$entry.phone|escape:qp}
-TEL;HOME;VOICE;ENCODING=QUOTED-PRINTABLE:{$entry.homephone|escape:qp}
+{foreach from=$entry.homephone item=homephone}
+TEL;HOME;VOICE;ENCODING=QUOTED-PRINTABLE:{$homephone|escape:qp}
+{/foreach}
TEL;CELL;VOICE;ENCODING=QUOTED-PRINTABLE:{$entry.mobile|escape:qp}
TEL;WORK;FAX;ENCODING=QUOTED-PRINTABLE:{$entry.fax|escape:qp}
TEL;WORK;PAGER;ENCODING=QUOTED-PRINTABLE:{$entry.pager|escape:qp}
<input type="hidden" name="entry[fax]" value="{$entry.fax|h}" />
<input type="hidden" name="entry[pager]" value="{$entry.pager|h}" />
<input type="hidden" name="entry[homestreet]" value="{$entry.homestreet|h}" />
- <input type="hidden" name="entry[homephone]" value="{$entry.homephone|h}" />
+ {foreach from=$entry.homephone item=homephone}
+ <input type="hidden" name="entry[homephone][]" value="{$homephone|h}" />
+ {/foreach}
<input type="hidden" name="entry[mobile]" value="{$entry.mobile|h}" />
<input type="hidden" name="entry[url]" value="{$entry.url|h}" />
<input type="hidden" name="photo" value="{$entry.photo|h}" />
-{$entry.name|csv};{$entry.givenname|csv};{$entry.title|csv};{$entry.organization|csv};{$entry.office|csv};{$entry.street|csv};{$entry.zip|csv};{$entry.location|csv};{$entry.country|csv};{$entry.phone|csv};{$entry.fax|csv};{$entry.pager|csv};{$entry.homestreet|csv};{$entry.homephone|csv};{$entry.mobile|csv};{$lang.url|csv};{$entry.note|csv};{$entry.mail[0]|csv};{$entry.mail[1]|csv};{$entry.mail[2]|csv};{$entry.markers|csv}
+{$entry.name|csv};{$entry.givenname|csv};{$entry.title|csv};{$entry.organization|csv};{$entry.office|csv};{$entry.street|csv};{$entry.zip|csv};{$entry.location|csv};{$entry.country|csv};{$entry.phone|csv};{$entry.fax|csv};{$entry.pager|csv};{$entry.homestreet|csv};{$entry.homephone[0]|csv};{$entry.mobile|csv};{$lang.url|csv};{$entry.note|csv};{$entry.mail[0]|csv};{$entry.mail[1]|csv};{$entry.mail[2]|csv};{$entry.markers|csv}