{$_is_closed = false} {$_is_won = false} {$_is_lost = false} {if $deal.status_id == "WON"} {$_is_won = true} {$_is_closed = true} {elseif $deal.status_id == "LOST"} {$_is_lost = true} {$_is_closed = true} {/if} {$_show_stages_line = !$funnel || !empty($funnel.id)}
{* HEADER *}
{* BACK *}
{if $funnel && !empty($funnel.id) && $has_access_to_funnel} ← {$funnel.name|escape} {else} [`Funnel deleted`] {/if}
{* NAME *}

{strip_tags($deal.name)|escape}

{* ACTIONS *} {if !empty($can_edit_deal)}
{/if}
{* TAGS *}
{strip} {/strip}
{if $_is_closed} [`Reopen deal`] {elseif !$_show_stages_line} {/if} {* LOST REASON *} {if $_is_lost && $_show_stages_line && !empty($deal.lost_text)} {$deal.lost_text|escape} {/if}
{* FUNNEL *}
{if $_show_stages_line}
{$_undone = false} {$_last_stage = [ "id" => false, "color" => "#aaa", "name" => "[`Close`]" ]} {if $_is_won} {$_last_stage = [ "id" => false, "type" => "won", "color" => "#0f0", "class" => "is-won", "name" => "[`WON`]" ]} {elseif $_is_lost} {$_last_stage = [ "id" => false, "type" => "lost", "color" => "#f00", "class" => "is-lost", "name" => "[`LOST`]" ]} {/if} {$stages[] = $_last_stage} {$_stage_count = $stages|count} {$_selected_width = 1.5 * 100/$_stage_count} {$_gray_range = []} {$_undone_index = 0} {foreach $stages as $_stage} {$_is_active = false} {if !$_is_closed} {if $_stage.id == $deal.stage_id} {$_is_active = true} {/if} {else} {if $_stage@last} {$_is_active = true} {/if} {/if} {if $_stage.id == $deal.stage_id} {$_undone_count = $_stage_count - $_stage@iteration - 1} {if $_undone_count > 1} {foreach range(0xdd, 0xaa, (0xaa - 0xdd) / $_undone_count) as $part} {$part = intval($part)} {$_gray_range[] = "#{$part|dechex}{$part|dechex}{$part|dechex}"} {/foreach} {else} {$_gray_range[] = "#ddd"} {/if} {/if} {$_classes = []} {if $_is_active} {$_classes[] = "selected"} {elseif !$_is_closed} {if $_stage.id > 0} {$_classes[] = "js-set-state"} {else} {$_classes[] = "js-close-deal"} {/if} {/if} {if !empty($_stage.class)} {$_classes[] = $_stage.class} {/if} {if !empty($_undone) && $_stage.id > 0} {$_classes[] = "is-undone"} {$_stage.hover_color = $_stage.color} {$_stage.color = $_gray_range[$_undone_index]} {$_undone_index = $_undone_index + 1} {/if}
{if !empty($_stage.type)} {if $_stage.type == "won"}{/if} {if $_stage.type == "lost"}{/if} {/if} {$_stage.name|escape}
{if $_stage.id == $deal.stage_id} {$_undone = true} {/if} {/foreach}
{elseif $_is_closed} {if $_is_won}
[`WON`]
{elseif $_is_lost}
[`LOST`]
{if !empty($deal.lost_text)}
{$deal.lost_text|escape}
{/if} {/if} {/if}
{* BOARD *}
{* CONTENT *}
{if !empty($order)} {include file="./Deal.order.inc.html" order=$order inline} {elseif $can_create_order} {/if} {* DESCRIPTION *}
{if !$_is_closed} {if $can_edit_deal}
[`Add description`]
{$deal.description_sanitized}
[`or`] [`cancel`]
{/if} {else}
{$deal.description_sanitized}
{/if}
{* LOGS *}
{$log_html}
{strip} {capture assign="_create_order_dialog_html"} {$_title = _w('New order')} {if $can_edit_order}{$_title = _w('Edit order')}{/if} {include file="./Deal.editOrderDialog.inc.html" title=$_title inline} {/capture} {/strip} {$_locales = [ "remove_owner_title" => {_w("Remove owner")}, "remove_owner_text" => {_w("Remove owner %s from the deal?")}, "remove_owner_button" => {_w("Remove")}, "remove_contact_title" => {_w("Exclude contact")}, "remove_contact_text" => {_w("Exclude %s from the deal?")}, "remove_contact_button" => {_w("Exclude")}, "remove_file_title" => {_w("Remove file")}, "remove_file_text" => {sprintf("%s %s", _w("Remove file"), "%s")}, "remove_file_button" => {_w("Remove")}, "delete_deal_title" => {sprintf("%s %s", _w('Delete'), $deal.name)}, "delete_deal_text" => {_w("Are you sure to delete this deal?")}, "delete_deal_button" => {_w("Delete")}, "shop_alert_title" => {_w("Shop")}, "shop_in_welcome_stage" => {sprintf_wp('It looks like your online store is not set up yet.
Please make initial Shop-Script settings', "`$wa_backend_url`shop")} ]}