2016-04-20 00:59:32 +00:00
|
|
|
|
2016-07-26 07:09:40 +00:00
|
|
|
<div id="contacts" class="generic-page-wrapper">
|
2016-04-20 00:59:32 +00:00
|
|
|
|
|
|
|
{{$tabs}}
|
|
|
|
|
2016-05-19 23:50:56 +00:00
|
|
|
{{* The page heading with it's contacts counter *}}
|
|
|
|
<h2 class="heading">{{$header}} {{if $total}} ({{$total}}) {{/if}}</h2>
|
2016-04-20 00:59:32 +00:00
|
|
|
|
|
|
|
{{if $finding}}<h4>{{$finding}}</h4>{{/if}}
|
|
|
|
|
2016-04-20 01:15:35 +00:00
|
|
|
{{* The search input field to search for contacts *}}
|
2016-04-20 00:59:32 +00:00
|
|
|
<div id="contacts-search-wrapper">
|
2016-04-20 22:00:58 +00:00
|
|
|
<form id="contacts-search-form" class="navbar-form" role="search" action="{{$cmd}}" method="get" >
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-2"></div>
|
|
|
|
<div class="col-md-8 ">
|
|
|
|
<div class="form-group form-group-search">
|
|
|
|
<input type="text" name="search" id="contacts-search" class="search-input form-control form-search" onfocus="this.select();" value="{{$search|escape:'html'}}" placeholder="{{$desc}}"/>
|
|
|
|
<button class="btn btn-default btn-sm form-button-search" type="submit" name="submit" id="contacts-search-submit" value="{{$submit|escape:'html'}}">{{$submit}}</button>
|
|
|
|
</div>
|
2016-04-20 00:59:32 +00:00
|
|
|
</div>
|
2016-04-20 22:00:58 +00:00
|
|
|
<div class="col-md-2"></div>
|
2016-04-20 00:59:32 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
<div id="contacts-search-end"></div>
|
|
|
|
|
2016-04-20 01:15:35 +00:00
|
|
|
{{* we need the form container to make batch actions work *}}
|
2016-04-20 21:08:01 +00:00
|
|
|
<form name="batch_actions_submit" action="{{$baseurl}}/contacts/batch/" method="POST">
|
|
|
|
|
|
|
|
{{* we put here a hidden input element. This is needed to transmit the batch actions with javascript*}}
|
|
|
|
<input type="hidden" class="batch-action no-input fakelist" name="batch_submit" value="{{$l|escape:'html'}}">
|
|
|
|
|
2016-04-20 01:15:35 +00:00
|
|
|
{{* We put the contact batch actions in a dropdown menu *}}
|
2016-04-20 00:59:32 +00:00
|
|
|
<ul class="nav nav-pills preferences">
|
|
|
|
<li class="dropdown pull-right">
|
2016-04-29 15:03:34 +00:00
|
|
|
<a class="btn btn-link btn-sm dropdown-toggle" type="button" id="BatchActionDropdownMenuTools" data-toggle="dropdown" aria-expanded="true">
|
2016-06-25 10:21:13 +00:00
|
|
|
<i class="fa fa-angle-down"></i> {{$h_batch_actions}}
|
2016-04-20 00:59:32 +00:00
|
|
|
</a>
|
|
|
|
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="BatchActionDropdownMenuTools">
|
|
|
|
{{foreach $batch_actions as $n=>$l}}
|
2016-04-20 21:08:01 +00:00
|
|
|
<li role="menuitem">
|
|
|
|
{{* call the js batch_submit_handler. Have a look at the buttom of this file *}}
|
|
|
|
<a onclick="batch_submit_handler('{{$n}}', '{{$l}}')">{{$l}}</a>
|
2016-04-20 00:59:32 +00:00
|
|
|
</li>
|
|
|
|
{{/foreach}}
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2016-04-28 19:35:33 +00:00
|
|
|
<div class="clear"></div>
|
|
|
|
<div id="contact-list">
|
|
|
|
{{* format each contact with the contact_template.tpl *}}
|
|
|
|
<ul id="viewcontact_wrapper" class="viewcontact_wrapper media-list">
|
|
|
|
{{foreach $contacts as $contact}}
|
|
|
|
<li>{{include file="contact_template.tpl"}}</li>
|
|
|
|
{{/foreach}}
|
|
|
|
</ul>
|
|
|
|
</div>
|
2016-04-20 00:59:32 +00:00
|
|
|
<div id="contact-edit-end"></div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
{{$paginate}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
// javascript dialog to batch actions
|
|
|
|
$(".batch-action").click(function(e){
|
|
|
|
if (confirm($(this).attr('value')+" ?")) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
e.preventDefault();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// add javascript confirm dialog to "drop" links. Plain html url have "?confirm=1" to show confirmation form, we need to remove it
|
|
|
|
$(".drop").each(function() {
|
|
|
|
$(this).attr('href', $(this).attr('href').replace("confirm=1","") );
|
|
|
|
$(this).click(function(e){
|
|
|
|
if (confirm("{{$contact_drop_confirm}}")) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
e.preventDefault();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
2016-04-20 21:08:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief This function submits the form with the batch action values
|
|
|
|
*
|
|
|
|
* @param string name The name of the batch action
|
|
|
|
* @param string value If it isn't empty the action will be posted
|
|
|
|
*/
|
|
|
|
function batch_submit_handler(name, value) {
|
|
|
|
// set the value of the hidden input element with the name batch_submit
|
|
|
|
document.batch_actions_submit.batch_submit.value=value;
|
|
|
|
// change the name of the input element from batch_submit according to the
|
|
|
|
// name which is transmitted to this function
|
|
|
|
document.batch_actions_submit.batch_submit.name=name;
|
|
|
|
// transmit the form
|
|
|
|
document.batch_actions_submit.submit() ;
|
|
|
|
}
|
2016-04-20 00:59:32 +00:00
|
|
|
</script>
|
|
|
|
|