{**
  #!/view_line2.php?table= &line=
  if $set_bt == 2 {
    происходит парсинг html контента
    где проверяется наличие <!-- Page Content -->
    и исходя из этого происходит рендер верстки
  }
*}
</div> <!-- Page Content -->

{* tips *}
{if $set_bt==8}
    <div class="toolbar">
        <div class="toolbar-inner">
            <table style="width: 100%;">
                <tr>
                    <td align="left" style="width: 20%; text-align: left;"><a href="#" style="float: left;"
                                                                              class="link open-additional-tab"></a></td>
                    <td align="center" style="width: 60%; text-align: center;"><a href="#"
                                                                                  class="link icon-only close-calendar-tab">{$lang.Close_all}</a></td>
                    <td align="right" style="width: 20%; text-align: right;"><a href="#" style="float: right;"
                                                                                class="m-cb-toolbar-edit-mode-on link"
                                                                                data-active-mode="0"></a></td>
                </tr>
            </table>
        </div>
    </div>
{/if}

{* calendars *}
{if $set_bt==7}
    <div class="toolbar">
        <div class="toolbar-inner">
            <table style="width: 100%;">
                <tr>
                    <td align="left" style="width: 40%; text-align: left;"><a href="#" style="float: left;"
                                                                              class="link open-additional-tab"></a></td>
                    <td align="center" style="width: 20%; text-align: center;"><a href="#"
                                                                                  class="link icon-only open-calendar-tab"><img
                                    src="mobile/ui/img/i-form-add-number3.png" width="32" height="32"/></a></td>
                    <td align="right" style="width: 40%; text-align: right;"><a href="#" style="float: right;"
                                                                                class="m-cb-toolbar-edit-mode-on link"
                                                                                data-active-mode="0"></a></td>
                </tr>
            </table>
        </div>
    </div>
{/if}

{if $set_bt==1}
    <div class="toolbar">
        <div class="toolbar-inner">
            <table style="width: 100%;">
                <tr id="fast_edit-buttons">
                    <td align="left" style="width: 40%; text-align: left;" id="circle-dots-btn">
                        <a href="#" style="float: left;" class="link open-additional-tab">
                            <button class="m__circle-yellow  m__circle-dots" >
                                <div>
                                        <span>
                                            •••
                                        </span>
                                </div>
                            </button>
                        </a>
                    </td>
                    <td align="center" style="width: 20%; text-align: center;">
                        {if $can_add and !$archive and !$deleted}
                            <a
                            href="view_line{$config.vlm}.php?table={$table_id}{if $rel_table}&rel_table={$rel_table}&rel_line={$rel_line}&rel_field={$rel_field}{/if}{if $filter_id}&filter={$filter_id}{/if}{if $page}&page={$page}{/if}&line=new&back_url={$base64_current_url}"
                            class="link icon-only add-button-href external">
                                <button class="m__circle-yellow  m__circle-plus" >
                                    <div>
                                        <span>
                                            +
                                        </span>
                                    </div>
                                </button>
                            </a>
                        {/if}
                    </td>
                    <td align="right" style="width: 40%; text-align: right; display: none">
                        <a href="#" style="float: right;"
                        class="m-cb-toolbar-edit-mode-on link"
                        data-active-mode="0">
                            {$lang.Select}
                        </a>
                    </td>
                </tr>
            </table>
        </div>
    </div>
{elseif $set_bt==2}
    <div class="toolbar {if $edit_mode}m-cb-border-green-top{/if}">
        <div class="toolbar-inner">
            <table style="width: 100%;">
                <tr id="fast_edit-buttons">
                    <td align="left" style="width: 40%; text-align: left;" id="circle-dots-btn">
                        {if !$edit_mode}
                            <a href="#" style="float: left;" class="link open-additional-tab">
                                <button id="m__circle-dots" class="m__circle-yellow  m__circle-dots" >
                                    <div>
                                        <span>
                                            •••
                                        </span>
                                    </div>
                                </button>
                            </a>
                        {else}&nbsp;
                        {/if}
                    </td>
                    <td align="center"
                        style="width: 20%; text-align: center; display: none">
                        {if !$edit_mode}
                            {if $can_add and !$archive and !$deleted}
                            <a
                            href="view_line{$config.vlm}.php?table={$table_id}{if $rel_table}&rel_table={$rel_table}&rel_line={$rel_line}&rel_field={$rel_field}{/if}{if $filter_id}&filter={$filter_id}{/if}{if $page}&page={$page}{/if}&line=new&back_url={$base64_current_url}"
                            class="link icon-only add-button-href external">
                                <button class="m__circle-yellow  m__circle-plus" >
                                    <div>
                                        <span>
                                            +
                                        </span>
                                    </div>
                                </button>
                            </a>
                            {else}&nbsp;
                            {/if}
                        {/if}
                    </td>
                    <td align="right" style="width: 40%;">
                        {if $can_edit}<a href="#" style="" class="m-cb-toolbar-view-line-edit-mode-on link" data-active-mode="{if $edit_mode}1{else}0{/if}">
                            {if $edit_mode}
                                <button id="m__circle-edit" class="m__circle-green m__circle-save" >
                                    <div>
                                        <span>
                                        </span>
                                    </div>
                                </button>
                            {else}
                                <button id="m__circle-edit" class="m__circle-yellow  m__circle-pencil" onclick="checkRights();initInputsRightChange()">
                                    <div>
                                        <span>
                                        </span>
                                    </div>
                                </button>
                            {/if}</a>
                        {/if}
                    </td>
                </tr>
            </table>
        </div>
    </div>
{elseif $set_bt==6}
    <div class="toolbar">
        <form class="toolbar-inner">
            <input type="text" placeholder="{$lang.Message}" class="message-text">
            <a href="#" class="link sent-message">{$lang.Send}</a>
        </form>
    </div>
{/if}

{if $set_bt==1 || $set_bt==2}
    <div class="m-cb-action-dummy" style="display: none;">
        {if $set_bt>0}
            {if $set_bt==1} {* для просмотра таблицы *}

                {if $deleted or $archive}
                    <i data-title="{$lang.Restore}" data-onclick="sel_alert('restore', $current_page);"
                       data-is-custom="0"></i>
                    <i data-title="{$lang.Delete}" data-onclick="sel_alert('delete', $current_page);"
                       data-is-custom="0"></i>
                {else}
                    {if $can_del}
                        <i data-title="{$lang.Delete_into_recycle}" data-onclick="sel_alert('delete', $current_page);"
                           data-is-custom="0"></i>
                    {/if}
                    {if $can_arc and !$archive}
                        <i data-title="{$lang.Move_to_arhive}" data-onclick="sel_alert('archive', $current_page);"
                           data-is-custom="0"></i>
                    {/if}
                {/if}

                {if $can_print}
                    <i data-title="{$lang.Save_to_file}" data-onclick="sel_alert('print', $current_page);"
                       data-is-custom="0"></i>
                {/if}
                {if $can_send}
                    <i data-title="{$lang.Send_email_title}" data-onclick="sel_alert('send', $current_page);"
                       data-is-custom="0"></i>
                {/if}
                {if $can_sms}
                    <i data-title="{$lang.Send_sms_title}" data-onclick="sel_alert('sms', $current_page);"
                       data-is-custom="0"></i>
                {/if}

                {if $can_copy}
                    <i data-title="{$lang.Copy}" data-onclick="sel_alert('copy', $current_page);"
                       data-is-custom="0"></i>
                {/if}

                {if $can_edit and $can_bed}
                    <i data-title="{$lang.Edit}" data-onclick="sel_alert('edit', $current_page);"
                       data-is-custom="0"></i>
                {/if}

                {if $all_buttons}
                    <i data-title="{$lang.Additional}" data-onclick="open_add_actions($current_page);"
                       data-is-custom="0"></i>
                {/if}
            {elseif $set_bt==2} {* для просмотра строки *}

                {if $deleted or $archive}
                    <i data-title="{$lang.Restore}"
                       data-url="view_line2.php?table={$table_id}&main_table={$main_table}&main_line={$main_line}{if $rel_table}&rel_table={$rel_table}&rel_line={$rel_line}&rel_field={$rel_field}{/if}{if $all_filters_on}&all_filters_on{elseif $filter_id}&filter={$filter_id}{/if}{if $archive}&archive{/if}{if $deleted}&deleted{/if}{if $page}&page={$page}{/if}&line={$line_id}&op=restore"
                       data-is-custom="0" data-method="script"></i>
                    <i data-title="{$lang.Delete}"
                       data-url="view_line2.php?table={$table_id}&main_table={$main_table}&main_line={$main_line}{if $rel_table}&rel_table={$rel_table}&rel_line={$rel_line}&rel_field={$rel_field}{/if}{if $all_filters_on}&all_filters_on{elseif $filter_id}&filter={$filter_id}{/if}{if $archive}&archive{/if}{if $deleted}&deleted{/if}{if $page}&page={$page}{/if}&line={$line_id}&op=delete"
                       data-is-custom="0" data-method="script"></i>
                {else}
                    {if $can_del || $can_del_act}
                        <i data-title="{$lang.Delete_into_recycle}"
                           data-url="view_line2.php?table={$table_id}&main_table={$main_table}&main_line={$main_line}{if $rel_table}&rel_table={$rel_table}&rel_line={$rel_line}&rel_field={$rel_field}{/if}{if $all_filters_on}&all_filters_on{elseif $filter_id}&filter={$filter_id}{/if}{if $archive}&archive{/if}{if $deleted}&deleted{/if}{if $page}&page={$page}{/if}&line={$line_id}&op=delete"
                           data-is-custom="0" data-method="script"></i>
                    {/if}
                    {if ($can_arc || $can_arc_act) and !$archive}
                        <i data-title="{$lang.Move_to_arhive}"
                           data-url="view_line2.php?table={$table_id}&main_table={$main_table}&main_line={$main_line}{if $rel_table}&rel_table={$rel_table}&rel_line={$rel_line}&rel_field={$rel_field}{/if}{if $all_filters_on}&all_filters_on{elseif $filter_id}&filter={$filter_id}{/if}{if $archive}&archive{/if}{if $deleted}&deleted{/if}{if $page}&page={$page}{/if}&line={$line_id}&op=archive"
                           data-is-custom="0"></i>
                    {/if}
                {/if}

                {if $can_print_act || $can_print}
                    <i data-title="{$lang.Save_to_file}" data-onclick="open_dialog('print', $current_page);"
                       data-is-custom="0"></i>
                {/if}
                {if $can_send_act || $can_send}
                    <i data-title="{$lang.Send_email_title}" data-onclick="open_dialog('send', $current_page);"
                       data-is-custom="0"></i>
                {/if}
                {if $can_sms_act || $can_sms}
                    <i data-title="{$lang.Send_sms_title}" data-onclick="open_dialog('sms', $current_page);"
                       data-is-custom="0"></i>
                {/if}

                {if $can_copy_act || $can_copy}
                    <i data-title="{$lang.Copy}"
                       data-url="view_line2.php?table={$table_id}{if $rel_table}&rel_table={$rel_table}&rel_line={$rel_line}&rel_field={$rel_field}{/if}{if $all_filters_on}&all_filters_on{elseif $filter_id}&filter={$filter_id}{/if}{if $archive}&archive{/if}{if $deleted}&deleted{/if}{if $page}&page={$page}{/if}&line={$line_id}&op=copy"
                       data-is-custom="0" data-method="script"></i>
                {/if}

                {if $all_buttons || $all_act_buttons}
                    <i data-title="{$lang.Additional}" data-onclick="open_add_actions($current_page);"
                       data-is-custom="0"></i>
                {/if}
            {/if}
        {/if}
        {* --- всплывающее доп меню по кнопкам --- *}
        {if $set_bt==2} {* для view_line2.tpl *}
            {foreach from=$all_act_buttons item=one_button}
                {if $lang.conf.{$one_button.name}}
                    {assign var="name" value=$lang.conf.{$one_button.name}}
                {else}
                    {assign var="name" value={$one_button.name}}
                {/if}
                <i data-title="{$one_button.help}" data-onclick="user_button({$one_button.id}, $current_page, {$one_button.type}, {$line_id});"
                   data-is-custom="1" data-name="{$name}"></i>
            {/foreach}
        {/if}
        {if $set_bt==1 or $set_bt==2}
            {foreach from=$all_buttons item=one_button}
                {if $lang.conf.{$one_button.name}}
                    {assign var="name" value=$lang.conf.{$one_button.name}}
                {else}
                    {assign var="name" value={$one_button.name}}
                {/if}
                {if $set_bt==1} {* для fields.tpl *}
                    <i data-title="{$one_button.help}"
                       data-onclick="sel_alert('additional', $current_page, '{$one_button.id}');" data-is-custom="1"
                       data-name="{$name}"></i>
                {/if}
                {if $set_bt==2} {* для view_line2.tpl *}
                    <i data-title="{$one_button.help}" data-onclick="user_button({$one_button.id}, $current_page, {$one_button.type}, {$line_id});"
                       data-is-custom="1" data-name="{$name}"></i>
                {/if}
                {foreachelse}
                <p align="center">{$lang.no_buttons}</p>
            {/foreach}
        {/if}
        {* === всплывающее доп меню по кнопкам === *}
    </div>
    {* send *}
    <div class="popup dialog_send">
        <div class="content-block">
            <p>{$lang.select_mail_template}</p>
        </div>
        <div class="list-block">
            <ul>
                {foreach from=$dialog_button.send item=form name=buttons}
                    <li>
                        <a href="#"
                           onclick="dial_form('send',{$form.id},{$form.type_form},'{$form.warning}', '{$line_id}');"
                           class="list-button item-link">{$form.name_form|escape:'html'}</a>
                    </li>
                {/foreach}
                <li>
                    <a href="#" class="close-popup list-button item-link">{$lang.Cancel}</a>
                </li>
            </ul>
        </div>
    </div>
    {* sms *}
    <div class="popup dialog_sms">
        <div class="content-block">
            <p>{$lang.select_sms_template}</p>
        </div>
        <div class="list-block">
            <ul>
                {foreach from=$dialog_button.sms item=form name=buttons}
                    <li>
                        <a href="#" onclick="dial_form('sms',{$form.id},{$form.type_form},'', '{$line_id}');"
                           class="list-button item-link">{$form.name_form}</a>
                    </li>
                {/foreach}
                <li>
                    <a href="#" class="close-popup list-button item-link">{$lang.Cancel}</a>
                </li>
            </ul>
        </div>
    </div>
    {* print *}
    <div class="popup dialog_print">
        <div class="content-block">
            <p>{$lang.Select_template2}</p>
        </div>
        <div class="list-block">
            <ul>
                {foreach from=$dialog_button.print item=form name=buttons}
                    <li>
                        <a href="#" onclick="event.preventDefault(); downloadMobilePdf({$table_id}, {$form.id}, {$line_id});"
                           class="list-button item-link">{$form.name_form|escape:'html'}</a>
                    </li>
                {/foreach}
                <li>
                    <a href="#" class="close-popup list-button item-link">{$lang.Cancel}</a>
                </li>
            </ul>
        </div>
    </div>
{/if}

</div> <!-- Page -->
</div> <!-- Pages -->

</div> <!-- View -->
</div> <!-- Views -->


{* $set_bt = 0 - отсутствие footer
= 1 для fields.tpl
= 2     viev_line2.tpl / view
= 3     viev_line2.tpl / edit
= 4     forms.tpl
= 5     search.tpl
= 6     messages.tpl
= 7     calendars.tpl
= 8     tips.tpl
*}

<script type="text/javascript" src="mobile/ui/js/subtable-color.js?{$revision}"></script>
<!-- Path to Framework7 Library JS-->

<script type="text/javascript" src="mobile/ui/lib/framework7.min.js?{$revision}"></script>
<!-- Path to your app js-->
<script type="text/javascript" src="mobile/ui/js/my-app.js?{$revision}"></script>
<script type="text/javascript" src="checkByMask.js?{$revision}"></script>
</body>
</html>
