{% extends '::base.html.twig' %}
{% block title %} {{ app.session.get('user_full_name') }} {% endblock %}
{% block content %}
{% if success is defined and success is not null and success == true %}
<div class="nNote nSuccess">
<p>{{ 'action_success'|trans }}</p>
</div>
{% endif %}
{% if success is defined and success is not null and success == false %}
<div class="nNote nFailure">
<p>{{ 'action_error'|trans }}</p>
</div>
{% endif %}
{% if app.session.has('contact_filter') %}
<div class="nNote nWarning" onclick="location.href='{{ path('contact_search', {'clear': 'clear'}) }}';">
<p>
<span style="font-weight: normal;">{{ 'search_filters_active'|trans }}</span>
<br />
<strong>{{ 'clear_search_filters'|trans }}</strong>
</p>
</div>
{% endif %}
<div class="fluid">
<div class="widget grid12">
<div class="whead"><h6><span class="icon-users"></span>{{ 'contact_list'|trans }}</h6>
<div class="clear"></div>
</div>
<table cellpadding="0" cellspacing="0" width="100%" class="tDefault">
<thead>
<tr>
<td style="width: 20px;"></td>
<td style="width: 120px; border-left: 0;">{{ 'type'|trans }}</td>
<td>{{ 'name'|trans }}</td>
<td>{{ 'phone'|trans }}</td>
<td>{{ 'gsm'|trans }}</td>
<td>{{ 'email'|trans }}</td>
</tr>
</thead>
<tbody>
{% if total > 0 %}
{% for l in list %}
<tr>
<td>
<div class="btn-group">
<a href="#" class="tablectrl_small bLightBlue" data-toggle="dropdown"><span class="icon-curved_arrow" style="margin-right: 1px; line-height: 12px;"></span></a>
<ul class="dropdown-menu pull-right">
<li>
<a href="javascript:void(0);" class="a-send-email" data-contact-id="{{ l.contactId }}"><span class="icos-email"></span>{{ 'send_email'|trans }}
</a>
</li>
{% if app.session.get('user_options').priv_contact_delete == true %}
<li>
<a href="javascript:void(0);" onClick="if (confirm('{{ 'are_you_sure'|trans }}')) { location.href = '{{ path('contact_delete', {'contact_id': l.contactId}) }}'; }"><span class="icos-trash"></span>{{ 'delete'|trans }}</a>
</li>
{% endif %}
</ul>
</div>
</td>
<td style="border-left: 0; text-align: center;" class="curHand" onclick="location.href='{{ path('contact_view', {'contact_id': l.contactId}) }}';">
{% if l.contactType == 1 %}
<span class="label label-success" style="margin-left: 10px; font-size: 12px; font-weight: normal;">{{ 'individual'|trans }}</span>
{% elseif l.contactType == 2 %}
<span class="label label-warning" style="margin-left: 10px; font-size: 12px; font-weight: normal;">{{ 'corporate'|trans }}</span>
{% endif %}
</td>
<td class="curHand" onclick="location.href='{{ path('contact_view', {'contact_id': l.contactId}) }}';">
<a href="{{ path('contact_view', {'contact_id': l.contactId}) }}">{{ l.contactName }}</a>
</td>
<td class="curHand" onclick="location.href='{{ path('contact_view', {'contact_id': l.contactId}) }}';">{{ l.phone }}</td>
<td class="curHand" onclick="location.href='{{ path('contact_view', {'contact_id': l.contactId}) }}';">{{ l.gsm }}</td>
<td class="curHand" onclick="location.href='{{ path('contact_view', {'contact_id': l.contactId}) }}';">{{ l.email }}</td>
</tr>
{% endfor %}
{% else %}
<div style="text-align: center; padding: 20px 0;">{{ 'no_records_found'|trans }}</div>
{% endif %}
</tbody>
</table>
<div class="fg-toolbar tableFooter">
<div class="dataTables_info" id="DataTables_Table_0_info">
<strong>{{ total }}</strong> {{ 'records_found'|trans }}
</div>
<div class="dataTables_paginate paging_full_numbers" id="DataTables_Table_0_paginate">
{{ 'go_to_page'|trans }}
<select name="select_page" id="select_page">
{% for i in 1..pageCount %}
{% if i == page %}
{% set sel = ' selected="selected" ' %}
{% else %}
{% set sel = '' %}
{% endif %}
<option {{ sel }} value="{{ i }}">{{ i }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('body').on('click', '.a-send-email', function () {
var dialog1 = $("#email_dialog").dialog({
autoOpen: false,
height: 400,
width: 630
});
var eUrl = '{{ path('compose_email', {'type': 'contact', 'entity_id': '000'}) }}';
dialog1.load(eUrl.replace('000', $(this).data('contact-id'))).dialog('open');
});
});
</script>
{% endblock %}
|