Update dp750/phonebook.xml (#7151)

Fixes phonebook.xml to work with current contacts.
Sets contact_organization to FirstName if  contact_name_given and contact_name_family are not set but contact_organization is

sets Phone type for home and mobile, sets all others to work

Loads category == "extensions" as well
This commit is contained in:
ijaron 2024-11-09 19:42:19 -06:00 committed by GitHub
parent 40f78c3c28
commit 8f8caaede7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 32 additions and 12 deletions

View File

@ -1,26 +1,46 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<AddressBook> <AddressBook>
<version>1</version> <version>1</version>
{$i=0} {foreach $contacts as $contact}
{foreach $contacts as $contact} {if $contact.contact_name_given != "" || $contact.contact_name_family != "" || $contact.contact_organization != ""}
{if $contact.contact_name_given != "" && $contact.contact_type == "contact"}
<Contact> <Contact>
{if $contact.contact_name_given == "" && $contact.contact_name_family == "" && $contact.contact_organization != ""}
<FirstName>{$contact.contact_organization}</FirstName>
{else}
<FirstName>{$contact.contact_name_given}</FirstName> <FirstName>{$contact.contact_name_given}</FirstName>
<LastName>{$contact.contact_name_family}</LastName> <LastName>{$contact.contact_name_family}</LastName>
<Phone type="Work"> {/if}
<phonenumber>{$contact.contact_work}</phonenumber> {if $contact.category == "extensions"}
</Phone> <Phone type="Other">
{if $contact.contact_home != "" } <phonenumber>{$contact.phone_extension}</phonenumber>
<Phone type="Home">
<phonenumber>{$contact.contact_home}</phonenumber>
</Phone> </Phone>
{/if} {/if}
{if $contact.contact_cell != "" } {if $contact.phone_label == "work"}
<Phone type="Work">
<phonenumber>{$contact.phone_number}</phonenumber>
</Phone>
{elseif $contact.phone_label == "main"}
<Phone type="Work">
<phonenumber>{$contact.phone_number}</phonenumber>
</Phone>
{elseif $contact.phone_label == "home"}
<Phone type="Home">
<phonenumber>{$contact.phone_number}</phonenumber>
</Phone>
{elseif $contact.phone_label == "mobile"}
<Phone type="Mobile"> <Phone type="Mobile">
<phonenumber>{$contact.contact_cell}</phonenumber> <phonenumber>{$contact.phone_number}</phonenumber>
</Phone>
{else}
<Phone type="Work">
<phonenumber>{$contact.phone_number}</phonenumber>
</Phone> </Phone>
{/if} {/if}
</Contact> </Contact>
{/if} {/if}
{/foreach} {/foreach}
</AddressBook> </AddressBook>