{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
{% import "macro_functions.phtml" as mf %}
{% block meta_title %}Help desks{% endblock %}
{% set active_menu = 'system' %}
{% block content %}
<div class="widget first">
    
    <div class="head">
        <h5 class="iFrames">{% trans 'Support help desks' %}</h5>
    </div>

    <div class="help">
        <h3>{% trans 'Support help desk' %}</h3>
        <p>{% trans 'Help desk name will be visible for clients when submitting new ticket. Define very large number of hours to disable auto close ticket option' %}</p>
    </div>

    <form method="post" action="admin/support/helpdesk_update" class="mainForm save api-form" data-api-msg="Help desk updated">
        <fieldset>
            <div class="rowElem">
                <label>{% trans 'Title' %}</label>
                <div class="formRight noborder">
                    <input type="text" name="name" value="{{ helpdesk.name }}" required="required"/>
                </div>
                <div class="fix"></div>
            </div>
            <div class="rowElem">
                <label>{% trans 'Email' %}</label>
                <div class="formRight">
                    <input type="text" name="email" value="{{ helpdesk.email }}" required="required"/>
                </div>
                <div class="fix"></div>
            </div>
            <div class="rowElem">
                <label>{% trans 'Signature' %}</label>
                <div class="formRight">
                    <textarea name="signature" cols="5" rows="5">{{ helpdesk.signature }}</textarea>
                </div>
                <div class="fix"></div>
            </div>
            <div class="rowElem">
                <label>{% trans 'Close after' %}</label>
                <div class="formRight">
                    <input type="text" name="close_after" value="{{ helpdesk.close_after }}" required="required"/>
                </div>
                <div class="fix"></div>
            </div>
            <div class="rowElem">
                <label>{% trans 'Can reopen' %}</label>
                <div class="formRight">
                    <input type="radio" name="can_reopen" value="1"{% if helpdesk.can_reopen == 'draft' %} checked="checked"{% endif %}/><label>{% trans 'Yes' %}</label>
                    <input type="radio" name="can_reopen" value="0"{% if not helpdesk.can_reopen == 'active' %} checked="checked"{% endif %} /><label>{% trans 'No' %}</label>
                </div>
                <div class="fix"></div>
            </div>
            
            <input type="submit" value="{% trans 'Update' %}" class="greyishBtn submitForm" />
            <input type="hidden" name="id" value="{{ helpdesk.id }}"/>
        </fieldset>
    </form>
    <div class="body">
        <a href="{{ 'support/helpdesks'|alink }}"  title="" class="btnIconLeft mr10"><img src="images/icons/dark/arrowLeft.png" alt="" class="icon"><span>Go back</span></a>
    </div>
</div>

{% endblock %}