<table class="col2btn">
    <tr>
        <td>{$i.opentasks_project}</td>
        <td>{$opentask->project}</td>
    </tr>
    <tr>
        <td>{$i.opentasks_purpose}</td>
        <td>{$opentask->purpose|truncate:120:"..."}</td>
    </tr>
    {if $opentask->description neq ''}
        <tr>
            <td>{$i.opentasks_description}</td>
            <td>{$opentask->description|truncate:120:"..."}</td>
        </tr>
    {/if}
    <tr>
        <td>{$i.opentasks_todo_name}</td>
        <td>{$opentask->todo_name}</td>
    </tr>
    <tr>
        <td>{$i.opentasks_todo_date}</td>
        <td>{$opentask->todo_date->us_date()}</td>
    </tr>
    <tr>
        <td>{$i.opentasks_creator_name}</td>
        <td>{$opentask->creator_name}</td>
    </tr>
    <tr>
        <td>{$i.opentasks_created_date}</td>
        <td>{$opentask->created_date->us_date_time()}</td>
    </tr>
    <tr>
        <td>{$i.basic_change_date}</td>
        <td>{$opentask->change_date->us_date()}</td>
    </tr>
    <tr>
        <td>{$i.basic_changed_by}</td>
        <td>{$opentask->changed_by_id_name}</td>
    </tr>
    {if $opentask->is_private}
        <tr>
            <td>{$i.opentasks_is_private}</td>
            <td>{boolview value=$opentask->is_private}</td>
        </tr>
    {/if}
    {if $opentask->need_mgmt_right}
        <tr>
            <td>{$i.opentasks_need_mgmt_right}</td>
            <td>{boolview value=$opentask->need_mgmt_right}</td>
        </tr>
    {/if}
    {if $opentask->is_urgent neq 0}
        <tr>
            <td>{$i.opentasks_is_urgent}</td>
            <td>{urgent value=$opentask->is_urgent}</td>
        </tr>
    {/if}
    {if $opentask->working_hours neq 0}
        <tr>
            <td>{$i.opentasks_working_hours}</td>
            <td>{isfloat value=$opentask->working_hours}</td>
        </tr>
    {/if}
    {if $opentask->work_package_name neq ''}
        <tr>
            <td>{$i.opentasks_work_package_name}</td>
            <td>{$opentask->work_package_name}</td>
        </tr>
    {/if}
    <tr>
        <td colspan="2"></td>
    </tr>
    <tr>
        <td>{$i.opentasks_is_done}</td>
        <td>{boolview value=$opentask->is_done}</td>
    </tr>
    {if $opentask->is_new}
        <tr>
            <td>{$i.opentasks_is_new}</td>
            <td>{isnew value=$opentask->is_new}</td>
        </tr>
    {/if}
    {if !empty($opentask->done_date) && !$opentask->done_date->is_null()}
        <tr>
            <td>{$i.opentasks_done_date}</td>
            <td>{$opentask->done_date->us_date()}</td>
        </tr>
    {/if}
    {if $opentask->done_staff_name neq ''}
        <tr>
            <td>{$i.opentasks_done_staff_name}</td>
            <td>{$opentask->done_staff_name}</td>
        </tr>
    {/if}
    {if $opentask->done_annotation neq ''}
        <tr>
            <td>{$i.opentasks_done_annotation}</td>
            <td>
                <div class="many">
                    {$opentask->done_annotation}
                </div>
            </td>
        </tr>
    {/if}
    {if !empty($opentask->notify_date) && !$opentask->notify_date->is_null()}
        <tr>
            <td>{$i.opentasks_notify}</td>
            <td>
                {if $opentask->is_notify}
                    {$opentask->notify_date->us_date_time()}
                {else}
                    {boolview value=FALSE}
                {/if}
            </td>
        </tr>
    {/if}
    {if !empty($opentask->active_from) && !$opentask->active_from->is_null()}
        <tr>
            <td>{$i.opentasks_active_from}</td>
            <td>
                {if !$opentask->active_from->is_null()}
                    {$opentask->active_from->us_date()}
                {else}
                    {boolview value=FALSE}
                {/if}
            </td>
        </tr>
    {/if}

    {if !empty($opentask->module_id)}
        <tr>
            <td colspan="2"></td>
        </tr>
        <tr>
            <td>{$i.basic_to_module}</td>
            <td>
                {include file='Opentasks/_module_list.tpl' small=false}
            </td>
        </tr>
    {/if}
    {if $opentask->msg_file_path neq ''}
        <tr>
            <td>{$i.opentasks_msg_file}</td>
            <td>{filelink value=$opentask->msg_file_path type='msg'}</td>
        </tr>
    {/if}

    {foreach from=$opentask->addi_fields item=field}
        <tr>
            {if $field->type eq US_exmodel::T_BLOCK}
                <th colspan="2" style="text-align:center; {if isset($field->color)}background:{$field->color}{/if}">{$field->name}</th>
            {else}
                <td style="{if isset($field->color)}background:{$field->color}{/if}">{$field->name}</td>
                <td>
                    {assign var='field_id' value=$field->field}
                    {addiview field=$field value=$opentask->$field_id item=$opentask}
                </td>
            {/if}
        </tr>
    {/foreach}
    
    <tr>
        <td colspan="2">
            <details class="small-info">
                <summary>CalDAV</summary>
                <p>
                    Sync token: <kbd>{$opentask->sabre_synctoken}</kbd><br />
                    URI: <kbd>{$opentask->sabre_uri}</kbd><br />
                    UUID: <kbd>{$opentask->sabre_uid}</kbd><br />
                    ETag: <kbd>{$opentask->sabre_etag}</kbd><br />
                </p>
                <p style="font-size: 8px;">
                    <kbd>{$opentask->sabre_calendar_data}</kbd>
                </p>
            </details>
        </td>
    </tr>
</table>
