{% extends 'MDS/EventsBundle/base-events2.html.twig' %}
{% block breadcrumbs %}
<ul class="breadcrumb">
<li><a href="/"><i class="icon-home2 position-left"></i>{% trans %}Home{% endtrans %}</a></li>
<li class="active">
<i class="icon-calendar3 position-left"></i>
{% trans %}Proposal List{% endtrans %}
{% if unassigned is not empty %}
{{ unassigned|trans }}
{% endif %}
</li>
</ul>
{% endblock %}
{% block contentProposal %}
{% for flashMessage in app.session.flashbag.get('mensajeproposal') %}
<div class="hidden alertFlashMensaje" data-mensaje="{{ flashMessage }}"></div>
{% endfor %}
{% for flashMessage in app.session.flashbag.get('mensajeproposalerror') %}
<div class="hidden alertFlashMensajeError" data-mensajeerror="{{ flashMessage }}"></div>
{% endfor %}
<div class="row proposals" id="proposal-list">
<div class="row">
{#<-- Inicio buscador -->#}
<div class="col-md-12 margen-15">
<div class="panel">
<div class="panel-heading">
<h6 class="panel-title">{% trans %} Proposal search engine by event start date {% endtrans %}: <a class="heading-elements-toggle"><i class="icon-more"></i></a></h6>
</div>
<div class="panel-body border-blue">
<form name="lounge" method="post" action="/events/proposal/list">
<div class="col-sm-9">
<div class="form-group">
<div class="col-sm-3">
<label class="control-label" for="buscarFecha_desde">Desde: </label>
<input type="date" id="buscarFecha_desde" name="buscarFecha[desde]" placeholder="" class="form-control ">
</div>
<div class="col-sm-3">
<label class="control-label" for="buscarFecha_hasta">Hasta: </label>
<input type="date" id="buscarFecha_hasta" name="buscarFecha[hasta]" placeholder="" class="form-control">
</div>
<div class="col-sm-4">
<label class="control-label" for="buscarFecha_client" >{% trans %}Client{% endtrans %}</label>
<div class="input-group col-lg-12 InputClientSpinner ">
<select class="form-control" name="buscarFecha[clientid]" id="buscarFecha_client">
<option value="" selected="selected">Select a Client</option>
</select>
</div>
</div>
<div class="col-sm-2">
<label class="control-label" for="statistics_invoice_agent">{% trans %}Agent{% endtrans %}:</label>
<select id="statistics_invoice_agent" name="data[agent]" class="form-control">
<option value="">{% trans %}Select Agent{% endtrans %}</option>
{% for agent in agents %}
<option value="{{ agent.id }}">{{ agent.username }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div class="col-sm-3" style="padding-top: 26px; padding-left: 15px;padding-right: 15px">
<div class="form-group form-group-material">
<div class="input-group">
<span class="input-group-addon bg-info"><i class="icon-search4"></i></span>
<button type="submit" name="buscarFecha[save]" class="btn bg-info-300 btn-block">{% trans %}Search{% endtrans %}</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
{#<-- /Fin buscador -->#}
<div class="col-md-12 margen-15">
<div class="panel">
{#<div class="panel-heading">#}
{#<h6 class="panel-title">{% trans %} Proposal Available {% endtrans %}<a class="heading-elements-toggle"><i class="icon-more"></i></a></h6>#}
{#</div>#}
<div class="panel-body border-blue">
<table id="table-proposal" class="col-sm-12 datatable-responsive table-bordered table-hover datatable-highlight">
<thead>
<tr>
<th class="no-sort">{% trans %}<i class="icon-eye"></i>{% endtrans %}</th>
<th>{% trans %}Create{% endtrans %}</th>
<th>{% trans %}Ref.{% endtrans %}</th>
<th>{% trans %}Name{% endtrans %}</th>
<th>{% trans %}Client{% endtrans %}</th>
<th>{% trans %}Commercial{% endtrans %}</th>
{#<th>{% trans %}Team{% endtrans %}</th>#}
<th>{% trans %}Hierarchy{% endtrans %}</th>
<th>{% trans %}Agent{% endtrans %}</th>
<th>{% trans %}Start{% endtrans %}</th>
<th>{% trans %}End{% endtrans %}</th>
<th id="targets" class="text-center no-sort actions">{% trans %}Actions{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% for proposal in proposals %}
<tr>
<td class="text-center">
{% autoescape %}
{% if proposal.iconsent is not empty %}
<span data-placement="right">{{ proposal.iconsent|raw }}</span>
{% endif %}
<span data-popup="tooltip-custom" title="{{ proposal.status }}" data-placement="right">{{ proposal.iconstatus|raw }}</span>
<span data-popup="tooltip-custom" title="
{% trans %}Last viewed by Customer{% endtrans %}:<br>
{{ proposal.viewedAt }}<br>
<b class='text-orange'>{{ proposal.novisto }}</b>"
data-placement="right">
{% if proposal.novisto != "No ha sido visto" %} <i class='icon-eye text-green'></i> {% endif %} </span>
{% endautoescape %}
</td>
<td>{{ proposal.create }}</td>
<td>#{{ proposal.id }}</td>
<td ><a href="/events/proposal/edit/{{ proposal.id }}">{{ proposal.name }}</a></td>
<td style="white-space:nowrap; padding:5px;">
<span class="label border-left-info label-striped"
data-popup="popover-custom"
title="{{ proposal.client }}"
data-content="
<i class='icon-user-tie position-left'></i>: {{ proposal.contact }}<br>
<i class='icon-office position-left'></i>: {{ proposal.contactdepartment }}<br>
<i class='icon-envelop4 position-left'></i>: <a href='mailto:{{ proposal.contactmail }}'>{{ proposal.contactmail }}</a><br>
<i class='icon-phone position-left'></i>: {{ proposal.contactphone }}<br>
<i class='icon-mobile position-left'></i>: {{ proposal.contactmovil }}<br>
"
data-placement="right">{{ proposal.client|slice('0', '10') ~ '...' }} <i class="icon-arrow-right22"></i>
</span>
{% if proposal.list_client=="si" %}
<a href="/events/proposal/listclient/{{ proposal.client_id }}"><i class='icon-add-to-list position-left'></i></a>
{% endif %}
</td>
<td>{{ proposal.commercial }}</td>
{#<td>{{ proposal.team }}</td>#}
<td>
{% if proposal.refagent %}
{{ proposal.refagent }}
{% else %}
0
{% endif %}
</td>
<td>
{% if proposal.agent is not empty %}
{{ proposal.agent }}
{% else %}
<span class="label bg-danger parpadea">{% trans %}Unassigned{% endtrans %}</span>
{#{% if unassigned is not empty %}#}
{#{% endif %}#}
{% endif %}
{% if is_granted('ROLE_ADMIN') or app.user.id == "57" or app.user.id == "22" or app.user.id == "27" %}
<br>
<form id="{{ proposal.id }}" action="/events/proposal/assigned/{{ proposal.id }}" method="POST">
<select id="unassigned_agent_select" onchange="this.form.submit()" name="agent[agent]" class="form-control">
<option value="">{% trans %}Select Agent{% endtrans %}</option>
{% for agent in agents %}
<option value="{{ agent.id }}">{{ agent.username }}</option>
{% endfor %}
</select>
</form>
{% endif %}
</td>
<td>{{ proposal.event_star }}</td>
<td>{{ proposal.event_end }}</td>
<td class="text-center">
<ul class="icons-list">
<li class="dropdown">
<a class="btn text-info btn-icon btn-lg" href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="icon-menu9"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right bg-teal-400">
<li><a href="/events/proposal/edit/{{ proposal.id }}"><i class="icon-pencil5 pull-right"></i> {% trans %}General Edit{% endtrans %}</a></li>
<li><a href="/events/proposal/destination/add/{{ proposal.id }}"><i class="icon-pencil5 pull-right"></i> {% trans %}Services Edit{% endtrans %}</a></li>
<li><a href="/presentation/home/{{ proposal.token }}" target="_blank"><i class="icon-presentation pull-right"></i> {% trans %}Presentation{% endtrans %}</a></li>
<li><a href="/presentation/homethree/{{ proposal.token }}" target="_blank"><i class="icon-presentation pull-right"></i> {% trans %}PresentaciĆ³n Nueva{% endtrans %}</a></li>
<li><a href="/events/proposal/duplicate/{{ proposal.id }}" target="_blank"><i class="icon-copy4 pull-right"></i> {% trans %}Duplicate Proposal{% endtrans %}</a></li>
<li class="divider"></li>
<li><a href="/events/proposal/cancel/{{ proposal.id }}"><i class="icon-trash pull-right"></i> {% trans %}Cancel{% endtrans %}</a></li>
</ul>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script type="text/javascript" src="{{ asset('assets/js/pages/proposal/list-order.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/tables/datatables/datatables.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/tables/datatables/extensions/responsive.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/datatables_responsive.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/datatables_advanced.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/proposal/list-proposal.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/pages/components_popups.js') }}"></script>
<script type="text/javascript" src="{{ asset('assets/js/plugins/forms/selects/select2.min.js') }}"></script>
{% endblock %}