{% import "template.html.twig" as template %}
<div class="modal-dialog modal-lg" role="document" id="task_modal">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">{{ title }}</h4>
</div>
<form id="contract_modal_form">
<div class="modal-body">
<div class="alert alert-danger message-alert message-foil-error" role="alert" style="display: none">
</div>
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-12">
{# project#}
{% set value = (task.project.id is defined)? task.project.id:0 %}
{{ template.select2('project','project',value,'Project',project) }}
</div>
</div>
<div class="row">
<div class="col-md-12">
{# task_type_id#}
{% set value = (task.taskType.id is defined)? task.taskType.id:0 %}
{{ template.select2('task_type','task_type',value,'taskType',taskType) }}
</div>
</div>
<div class="row">
<div class="col-md-12">
{# task_status#}
{% set value = (task is defined)?task.taskStatus.id:constant('App\\Entity\\TaskStatus::TASK_STATUS_LETREHOZOTT') %}
{{ template.select2('task_status','task_status',value,'task_status',taskStatus) }}
</div>
</div>
<div class="row" id="finished_date_row" style="{{(task.taskStatus.id is defined)?((task.taskStatus.id==constant('App\\Entity\\TaskStatus::TASK_STATUS_BEFEJEZETT'))?(''):('display:none')):('display:none') }}" >
<div class="col-md-12">
{# finish_date#}
{% set value = (task is defined)? task.scheduleDate|date("Y-m-d") : lastWorkedDay %}
{{ template.datapicker('finished_date','finished_date',value,'finished_date') }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{# user#}
{% set value = (task.assignedUser.id is defined)? task.assignedUser.id:0 %}
{{ template.select2('user','user',value,'assigned_user',user) }}
</div>
<div class="col-md-6">
{# schedule_date#}
{% set value = (task is defined)? task.scheduleDate|date("Y-m-d") : lastWorkedDay %}
{{ template.datapicker('schedule_date','schedule_date',value,'schedule_date') }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{# priotity#}
{% set value = (task.priotity is defined)? task.priotity:1 %}
{{ template.input('priotity','priotity',value,'priotity') }}
</div>
<div class="col-md-6">
{# scheduled_hours#}
{% set value = (task.scheduledHours is defined)? task.scheduledHours:0 %}
{% set readonly = (task.offerBody is defined and task.offerBody is not null)?'readonly':'' %}
{{ template.input('scheduled_hours','scheduled_hours',value,'scheduled_hours','',readonly) }}
</div>
</div>
<div class="row">
<div class="col-md-6">
{# scheduled_hours#}
{% set value = (task.notUsedMinutes is defined)? task.notUsedMinutes:0 %}
{% set readonly = (is_granted('ROLE_SUPER_ADMIN'))?'':'readonly' %}
{{ template.input('not_used_minutes','not_used_minutes',value,'not_used_minutes','',readonly) }}
</div>
<div class="col-md-6">
</div>
</div>
{% if(edited==false) %}
<div class="row" id="add_task_log_box">
<div class="col-md-12">
<h5>{% trans from 'messages' %}Task Log{% endtrans %}</h5>
</div>
<div class="col-md-12">
{# worked_minutes#}
{% set value ="00:00" %}
{{ template.datapicker('worked_minutes','worked_minutes',value,'worked_minutes') }}
</div>
<div class="col-md-12">
{# description#}
{% set value = (taskLog.description is defined)? taskLog.description:"" %}
{{ template.textarea('log_description','log_description',value,'Observation',4) }}
</div>
</div>
{% endif %}
</div>
<div class="col-md-6 task_textarea_col">
<div class="row">
<div class="col-md-12">
{# denumire#}
{% set value = (task.name is defined)? task.name:'' %}
{{ template.textarea('name','name',value,'Description',7,'tinymce') }}
</div>
</div>
<div class="row">
<div class="col-md-12">
{# technical_description#}
{% set value = (task.technicalDescription is defined)? task.technicalDescription:"" %}
{{ template.textarea('technical_description','technical_description',value,'technical_description',7,'tinymce') }}
</div>
</div>
</div>
</div> {# end modal body#}
<div class="modal-footer modal-buttons-align-custom">
{% set id = (task is defined)? task.id :0 %}
<button type="button"
id="saveTask"
data-id="{{ id }}"
class="btn btn-success">
<i class="fa fa-save"></i> {% trans from 'messages' %}Save{% endtrans %}
</button>
<button type="button" class="btn btn-secondary"
data-bs-dismiss="modal">{% trans from 'messages' %}Close{% endtrans %}
</button>
</div>
</div>
</form>
</div>
</div>