diff --git a/resources/templates/provision/grandstream/grp2613/phonebook.xml b/resources/templates/provision/grandstream/grp2613/phonebook.xml index 62c745db9f..deb211d001 100644 --- a/resources/templates/provision/grandstream/grp2613/phonebook.xml +++ b/resources/templates/provision/grandstream/grp2613/phonebook.xml @@ -1,49 +1,151 @@ - + + -1 -{foreach $contacts as $contact} -{if $contact.contact_type == "group"} - -{$contact.id} -{$contact.group_description|truncate:10} - -{/if} -{/foreach} -{$i=0} -{foreach $contacts as $contact} -{if $contact.contact_name_given != "" && $contact.contact_type == "contact"} - -{$contact.contact_name_given} -{$contact.contact_name_family} -{if $contact.contact_role != "" } -{$contact.contact_role} -{/if} -{if $contact.contact_category != "" } -{$contact.contact_category} -{/if} - -{$contact.contact_work} -1 - -{if $contact.contact_home != "" } - -{$contact.contact_home} -1 - -{/if} -{if $contact.contact_cell != "" } - -{$contact.contact_cell} -1 - -{/if} -{if $contact.contact_organization != "" } -{$contact.contact_organization} -{/if} -{foreach $contact.groups as $group} -{$group} -{/foreach} - -{/if} -{/foreach} + + + 1 + Users + default ringtone + + + 2 + Groups + default ringtone + + + 3 + Extensions + system + + + {$start_id=0} + {foreach $contacts as $row} + {if $row.category == "users"} + + {$start_id++} + {if $row.contact_name_given != ""} + {if $row.contact_organization != ""} + {$row.contact_name_given} {$row.contact_name_family} + {$row.contact_name_given} {$row.contact_name_family} + {$row.contact_organization} + {else} + {$row.contact_name_given} + {$row.contact_name_family} + {/if} + {else} + {$row.effective_caller_id_name} + {/if} + + 0 + {foreach $row.numbers as $number} + {if $number.phone_number != ""} + {if $number.phone_label == "work"} + + {$number.phone_number} + 0 + + {/if} + {if $number.phone_label == "home"} + + {$number.phone_number} + 0 + + {/if} + {if $number.phone_label == "mobile"} + + {$number.phone_number} + 0 + + {/if} + {/if} + {/foreach} + 1 + 0 + + + + + {elseif $row.category == "groups"} + + {$start_id++} + {if $row.contact_name_given != ""} + {if $row.contact_organization != ""} + {$row.contact_name_given} {$row.contact_name_family} + {$row.contact_name_given} {$row.contact_name_family} + {$row.contact_organization} + {else} + {$row.contact_name_given} + {$row.contact_name_family} + {/if} + {else} + {$row.effective_caller_id_name} + {/if} + + + 0 + {foreach $row.numbers as $number} + {if $number.phone_number != ""} + {if $number.phone_label == "work"} + + {$number.phone_number} + 0 + + {/if} + {if $number.phone_label == "home"} + + {$number.phone_number} + 0 + + {/if} + {if $number.phone_label == "mobile"} + + {$number.phone_number} + 0 + + {/if} + {/if} + {/foreach} + 2 + 0 + + + + + {elseif $row.category == "extensions"} + + {$start_id++} + {if $row.contact_name_given != ""} + {if $row.contact_organization != ""} + {$row.contact_name_given} {$row.contact_name_family} + {$row.contact_name_given} {$row.contact_name_family} + {$row.contact_organization} + {else} + {$row.contact_name_given} + {$row.contact_name_family} + {/if} + {else} + {$row.effective_caller_id_name} + {/if} + + 0 + {if $row.phone_number != ""} + + {$row.phone_number} + 0 + + {else} + + {$row.phone_extension} + 0 + + {/if} + 3 + 0 + + + + + {/if} + {/foreach} +