This makes it possible to have an arbitrary number of (office) phone
values. CSV export will only use the first one, as before.
VCF importer should also correctly recognize multiple TEL;WORK;VOICE
fields.
my_array_search('VOICE',(array) $tel['param']['TYPE']) != false))
{
// Work phone
my_array_search('VOICE',(array) $tel['param']['TYPE']) != false))
{
// Work phone
- $entry['phone'] = $tel['value'][0][0];
+ $entry['phone'][] = $tel['value'][0][0];
}elseif(empty($entry['fax']) &&
my_array_search('FAX',(array) $tel['param']['TYPE']) !== false){
$entry['fax'] = $tel['value'][0][0];
}elseif(empty($entry['fax']) &&
my_array_search('FAX',(array) $tel['param']['TYPE']) !== false){
$entry['fax'] = $tel['value'][0][0];
'street' => 'postalAddress',
'zip' => 'postalCode',
'location' => 'l', // aka. city
'street' => 'postalAddress',
'zip' => 'postalCode',
'location' => 'l', // aka. city
- 'phone' => 'telephoneNumber',
+ '_phone' => 'telephoneNumber',
'fax' => 'facsimileTelephoneNumber',
'mobile' => 'mobile', // aka. cell phone
'pager' => 'pager',
'fax' => 'facsimileTelephoneNumber',
'mobile' => 'mobile', // aka. cell phone
'pager' => 'pager',
+{if $fields._phone}
+ {foreach from=$entry.phone|smarty:nodefaults item=phone}
- <th>{$lang.phone}:</th>
- <td><input type="text" class="input" name="entry[phone]" value="{$entry.phone|h}" /></td>
+ <th>{$lang.phone} {counter name=phone}:</th>
+ <td><input type="test" class="input" name="entry[phone][]" value="{$phone|h}" /></td>
+ </tr>
+ {/foreach}
+ <tr>
+ <th>{$lang.phone} {counter name=phone}:</th>
+ <td><input type="text" class="input" name="entry[phone][]" value="" /></td>
</tr>
{/if}
{if $fields.switchboard}
</tr>
{/if}
{if $fields.switchboard}
{if $entry.phone}
<tr>
<th>{$lang.phone}:</th>
{if $entry.phone}
<tr>
<th>{$lang.phone}:</th>
- <td><a href="callto://{$entry.phone|escape:phone}">{$entry.phone|h}</a></td>
+ <td>
+ {foreach from=$entry.phone item=phone}
+ <a href="callto://{$phone|escape:phone}">{$phone|h}</a><br />
+ {/foreach}
+ </td>
</tr>
{/if}
{if $entry.switchboard}
</tr>
{/if}
{if $entry.switchboard}
FN:{$entry.givenname} {$entry.name}
ORG;ENCODING=QUOTED-PRINTABLE:{$entry.organisation|escape:qp};{$entry.office|escape:qp}
NOTE;ENCODING=QUOTED-PRINTABLE:{$entry.note|escape:qp}
FN:{$entry.givenname} {$entry.name}
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}
+{foreach from=$entry.phone item=phone}
+TEL;WORK;VOICE;ENCODING=QUOTED-PRINTABLE:{$phone|escape:qp}
+{/foreach}
{foreach from=$entry.homephone item=homephone}
TEL;HOME;VOICE;ENCODING=QUOTED-PRINTABLE:{$homephone|escape:qp}
{/foreach}
{foreach from=$entry.homephone item=homephone}
TEL;HOME;VOICE;ENCODING=QUOTED-PRINTABLE:{$homephone|escape:qp}
{/foreach}
<input type="hidden" name="entry[location]" value="{$entry.location|h}" />
<input type="hidden" name="entry[country]" value="{$entry.country|h}" />
<input type="hidden" name="entry[state]" value="{$entry.state|h}" />
<input type="hidden" name="entry[location]" value="{$entry.location|h}" />
<input type="hidden" name="entry[country]" value="{$entry.country|h}" />
<input type="hidden" name="entry[state]" value="{$entry.state|h}" />
- <input type="hidden" name="entry[phone]" value="{$entry.phone|h}" />
+ {foreach from=$entry.phone item=phone}
+ <input type="hidden" name="entry[phone][]" value="{$phone|h}" />
+ {/foreach}
<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[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}" />
-{$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}
+{$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[0]|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}
<a href="index.php?org={$entry.organization|escape:url}">{$entry.organization|h}</a>
</td>
<td>
<a href="index.php?org={$entry.organization|escape:url}">{$entry.organization|h}</a>
</td>
<td>
- <a href="callto://{$entry.phone|escape:phone}">{$entry.phone|h}</a>
+ <a href="callto://{$entry.phone[0]|escape:phone}">{$entry.phone[0]|h}</a>
</td>
<td>
<a href="mailto:{$entry.mail[0]|h}">{$entry.mail[0]|h}</a>
</td>
<td>
<a href="mailto:{$entry.mail[0]|h}">{$entry.mail[0]|h}</a>