{$wrapper_id = uniqid('crm-contact-segment-list-edit-wrapper-')} {$segment.icon = $segment.icon|default:'contact'} {$segment.type = $segment.type|default:crmSegmentModel::TYPE_CATEGORY}

{strip} {if $segment.id > 0} [`Edit segment`] {else} [`Create segment`] {/if} {/strip}

[`Name`]
{if $segment.id <= 0} {if $segment.type === crmSegmentModel::TYPE_CATEGORY}

{else} {/if} {/if}
[`Icon`]
[`Access`]
{if $segment.id > 0}
{if $segment.type === crmSegmentModel::TYPE_SEARCH}

[`This list is the search result:`] {$segment.search_info.title} {if $segment.contact_id && $segment.contact_id !== '0'}
[`Created by`] {$segment.contact.name|escape}, {$segment.create_datetime|wa_date:'humandatetime'} {/if}

{elseif ($segment.type === 'category')} {if $segment.system_id}

[`This list is based on a category transferred from the standard version of the Contacts app.`] {sprintf('[`Contact entries in this category are created and updated automatically by the %s app.`]', $segment.app_name|default:'')}

{elseif $segment.app_id}

{sprintf('[`This list is based on a category created in the %s app.`]', $segment.app_name|default:'')} {sprintf('[`To change settings or delete this category use appropriate tools of the %s app.`]', $segment.app_name|default:'')}

{else} [`This list consists of selected contacts. To add/remove contacts use “Actions with selected” menu.`]
[`Created by`] {$segment.contact.name|escape}, {$segment.create_datetime|wa_date:'humandatetime'} {/if} {/if}
{/if}
{if $segment.id > 0} {else} {/if} [`or`] {* Default close link, need in all cases except one, see below comment *} [`cancel`] {* This link special treated in double-dialog case, see CRMContactsOperationAddToSegments class *}
{* Delete segment link, see CRMContactSegmentEdit *} {if $segment.id > 0} [`Delete segment`] {/if}