diff --git a/resources/templates/provision/fanvil/w611w/directory.xml b/resources/templates/provision/fanvil/w611w/directory.xml new file mode 100644 index 0000000000..f4fe5b3d60 --- /dev/null +++ b/resources/templates/provision/fanvil/w611w/directory.xml @@ -0,0 +1,210 @@ + + +{if $smarty.get.contacts == "users"} +Users Directory +{elseif $smarty.get.contacts == "groups"} +Groups Directory +{elseif $smarty.get.contacts == "extensions"} +Extensions Directory +{else} +Complete Directory +{/if} + +{foreach $contacts as $row} +{if $smarty.get.contacts == "users" && $row.category == "users"} + + {if $row.contact_organization && $row.contact_name_given && $row.contact_name_family} + {$row.contact_organization}, {$row.contact_name_given} {$row.contact_name_family} + {elseif $row.contact_organization && $row.contact_name_given == "" && $row.contact_name_family == ""} + {$row.contact_organization} + {elseif $row.contact_name_given && $row.contact_name_family && $row.contact_organization == ""} + {$row.contact_name_given} {$row.contact_name_family} + {elseif $row.contact_name_given && $row.contact_name_family} + {$row.contact_name_given} {$row.contact_name_family} + {elseif $row.contact_name_given} + {$row.contact_name_given} + {elseif $row.contact_name_family} + {$row.contact_name_family} + {else} + {$row.effective_caller_id_name} + {/if} + + {foreach $row.numbers as $number} + {if $number.phone_label == "work" && $number.phone_number != ""} + {$number.phone_number} + {elseif !isset($telephone_set) && $number.phone_number != ""} + {$number.phone_number} + {$telephone_set = true} + {/if} + + {if $number.phone_label == "mobile" && $number.phone_number != ""} + {$number.phone_number} + {elseif !isset($mobile_set) && $number.phone_number != "" && !isset($telephone_set)} + {$number.phone_number} + {$mobile_set = true} + {/if} + + {if $number.phone_label == "home" && $number.phone_number != ""} + {$number.phone_number} + {elseif !isset($other_set) && $number.phone_number != "" && !isset($telephone_set) && !isset($mobile_set)} + {$number.phone_number} + {$other_set = true} + {/if} + {/foreach} + + 0 + Users + + + {* Reset variables for next contact *} + {$telephone_set = null} + {$mobile_set = null} + {$other_set = null} + + +{elseif $smarty.get.contacts == "groups" && $row.category == "groups"} + + {if $row.contact_organization && $row.contact_name_given && $row.contact_name_family} + {$row.contact_organization}, {$row.contact_name_given} {$row.contact_name_family} + {elseif $row.contact_organization && $row.contact_name_given == "" && $row.contact_name_family == ""} + {$row.contact_organization} + {elseif $row.contact_name_given && $row.contact_name_family && $row.contact_organization == ""} + {$row.contact_name_given} {$row.contact_name_family} + {elseif $row.contact_name_given && $row.contact_name_family} + {$row.contact_name_given} {$row.contact_name_family} + {elseif $row.contact_name_given} + {$row.contact_name_given} + {elseif $row.contact_name_family} + {$row.contact_name_family} + {else} + {$row.effective_caller_id_name} + {/if} + + {foreach $row.numbers as $number} + {if $number.phone_label == "work" && $number.phone_number != ""} + {$number.phone_number} + {elseif !isset($telephone_set) && $number.phone_number != ""} + {$number.phone_number} + {$telephone_set = true} + {/if} + + {if $number.phone_label == "mobile" && $number.phone_number != ""} + {$number.phone_number} + {elseif !isset($mobile_set) && $number.phone_number != "" && !isset($telephone_set)} + {$number.phone_number} + {$mobile_set = true} + {/if} + + {if $number.phone_label == "home" && $number.phone_number != ""} + {$number.phone_number} + {elseif !isset($other_set) && $number.phone_number != "" && !isset($telephone_set) && !isset($mobile_set)} + {$number.phone_number} + {$other_set = true} + {/if} + {/foreach} + + 0 + Groups + + + {* Reset variables for next contact *} + {$telephone_set = null} + {$mobile_set = null} + {$other_set = null} + + +{elseif $smarty.get.contacts == "extensions" && $row.category == "extensions"} + + {if $row.contact_name_given} + {$row.contact_name_given} {$row.contact_name_family} + {else} + {$row.effective_caller_id_name} + {/if} + + {if $row.phone_number} + {$row.phone_number} + {else} + {$row.phone_extension} + {/if} + + + 0 + Extensions + + + +{elseif $smarty.get.contacts == "all" || !$smarty.get.contacts} + + {if $row.contact_organization && $row.contact_name_given && $row.contact_name_family} + {$row.contact_organization}, {$row.contact_name_given} {$row.contact_name_family} + {elseif $row.contact_organization && $row.contact_name_given == "" && $row.contact_name_family == ""} + {$row.contact_organization} + {elseif $row.contact_name_given && $row.contact_name_family && $row.contact_organization == ""} + {$row.contact_name_given} {$row.contact_name_family} + {elseif $row.contact_name_given && $row.contact_name_family} + {$row.contact_name_given} {$row.contact_name_family} + {elseif $row.contact_name_given} + {$row.contact_name_given} + {elseif $row.contact_name_family} + {$row.contact_name_family} + {else} + {$row.effective_caller_id_name} + {/if} + + {if $row.category == "extensions"} + {if $row.phone_number} + {$row.phone_number} + {else} + {$row.phone_extension} + {/if} + + + {elseif isset($row.numbers)} + {foreach $row.numbers as $number} + {if $number.phone_label == "work" && $number.phone_number != ""} + {$number.phone_number} + {elseif !isset($telephone_set) && $number.phone_number != ""} + {$number.phone_number} + {$telephone_set = true} + {/if} + + {if $number.phone_label == "mobile" && $number.phone_number != ""} + {$number.phone_number} + {elseif !isset($mobile_set) && $number.phone_number != "" && !isset($telephone_set)} + {$number.phone_number} + {$mobile_set = true} + {/if} + + {if $number.phone_label == "home" && $number.phone_number != ""} + {$number.phone_number} + {elseif !isset($other_set) && $number.phone_number != "" && !isset($telephone_set) && !isset($mobile_set)} + {$number.phone_number} + {$other_set = true} + {/if} + {/foreach} + {else} + {$row.phone_extension} + + + {/if} + + 0 + {if $row.category == "users"} + Users + {elseif $row.category == "groups"} + Groups + {elseif $row.category == "extensions"} + Extensions + {else} + + {/if} + + + {* Reset variables for next contact *} + {$telephone_set = null} + {$mobile_set = null} + {$other_set = null} + +{/if} +{/foreach} +