{$_title = "[`Create funnel`]"} {if !empty($funnel.id)} {$_title = "[`Edit funnel`]"} {/if}
{* HEADER *}

[`Funnels`]

{* FUNNELS *}
    {if empty($funnel.id)} {$_new_funnel = [ "0" => [ "id" => false, "name" => "[`New funnel`]", "color" => "#f0f0f0" ] ]} {$funnels = $_new_funnel + $funnels} {/if} {foreach $funnels as $_funnel} {$_is_selected = ($funnel.id == $_funnel.id)}
  • {$_funnel.name|escape}
  • {/foreach}
{* FUNNEL *}
{$_colors = ["#cc5252","#cc8f52","#cccc52","#52cc52","#52cc8f","#52cccc","#528fcc","#5252cc","#8f52cc","#cc52cc","#cc528f"]} {$_toggle_color = $_colors[0]} {if !empty($funnel.color)} {$_toggle_color = $funnel.color} {/if}
    {strip} {foreach $_colors as $_color}
  • {/foreach} {/strip}
    {for $i = 1 to 7}
  • {/for}
{function _renderStage}
  • {if empty($_stage.deals_count)} [`remove stage`] {else} {_w('%d deal in stage', '%d deals in stage', $_stage.deals_count)} {/if}
  • {/function} {capture assign="_stage_template"}{_renderStage _stage=[]}{/capture}

    [`Stages`]

    {sprintf_wp('Use the %s link to set how long a deal is allowed to remain in each of the stages. To learn about overdue deals, set up a notification for the “%s” event.', _w('add time limit'), _w('Stage time limit expired for deal'))}

    {if $deal_fields}

    [`Deal fields`]

    [`Field name`] [`Required`] [`Filter`]
    {foreach $deal_fields as $deal_field} {$_deal_field_id = $deal_field->getId()|escape} {$_funnel_params = []} {if $funnel && $funnel.id > 0 } {$_funnel_params = $deal_field->getFunnelParameters($funnel.id)} {/if} {if $deal_field->getType() === 'Checkbox'} {continue} {/if}
    {$deal_field->getName()|escape}
    {if $deal_field->getType() === 'Select'}
    {else}
    {/if}
    {/foreach}
    {/if}

    [`Access`]

    {function name="_groupList" _g=[]}
    {$_g.name|escape}
    {if $_g.rights > crmRightConfig::RIGHT_FUNNEL_ALL} {elseif $_g.rights === null} {elseif $_g.rights < 0} {else} {/if}
    {/function} {if $groups.backend} {foreach $groups.backend as $_g}{_groupList _g = $_g}{/foreach} {/if} {if $groups.no_access}
    {foreach $groups.no_access as $_g}{_groupList _g = $_g}{/foreach}
    {/if}
    [`or`] [`cancel`]
    {if !empty($funnel.id)}
    {if empty($funnel.deals_count)} [`delete`] {else} {_w('%d deal in funnel', '%d deals in funnel', $funnel.deals_count)} {/if}
    {/if}