117 lines
3.6 KiB
XML
117 lines
3.6 KiB
XML
<metal:block use-macro="main_template">
|
|
<div metal:fill-slot="content">
|
|
|
|
<div class="alert alert-danger" tal:condition="message" tal:content="message" />
|
|
|
|
<div class="row">
|
|
|
|
<form id="site-search-form" class="form-horizontal" role="form" action="${url}" method="post"
|
|
data-fv-framework="bootstrap"
|
|
data-fv-icon-valid="glyphicon glyphicon-ok"
|
|
data-fv-icon-invalid="glyphicon glyphicon-remove"
|
|
data-fv-icon-validating="glyphicon glyphicon-refresh">
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">Société</label>
|
|
<div class="col-xs-8">
|
|
<label class="radio-inline"><input type="radio" name="societe" value="PE"
|
|
tal:attributes="checked societe=='PE'">PE</label>
|
|
<label class="radio-inline"><input type="radio" name="societe" value="ME"
|
|
tal:attributes="checked societe=='ME'">ME</label>
|
|
<label class="radio-inline"><input type="radio" name="societe" value="PL"
|
|
tal:attributes="checked societe=='PL'">PL</label>
|
|
<label class="radio-inline"><input type="radio" name="societe" value="PO"
|
|
tal:attributes="checked societe=='PO'">PO</label>
|
|
<label class="radio-inline"><input type="radio" name="societe" value="CD"
|
|
tal:attributes="checked societe=='CD'">CD</label>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-4 control-label">Nom ou numéro du chantier</label>
|
|
<div class="col-sm-7 input-group">
|
|
<input type="text" class="form-control" name="name" value="${name}"
|
|
placeholder="Le nom ou le numéro doit avoir de 2 à 30 caractères de long" >
|
|
<div class="input-group-btn">
|
|
<button id="submitButton" class="btn btn-primary" type="submit" name="form.submitted">
|
|
<i class="glyphicon glyphicon-search"></i> Rechercher</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
</div><!-- row -->
|
|
|
|
<div class="row">
|
|
<table id="dossiers_list" class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Numéro</th>
|
|
<th>Date</th>
|
|
<th>Client</th>
|
|
<th>Chantier</th>
|
|
<th class="text-right">Montant</th>
|
|
<th>Sinistre</th>
|
|
<th class="text-center">Statut</th>
|
|
<th>Uti.</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
<br />
|
|
<br />
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var dataSet = ${dt_data};
|
|
var goto_url = '${goto_url}';
|
|
var order_option = '${order_option}'
|
|
|
|
$(document).ready(function() {
|
|
$.fn.dataTable.moment('DD-MM-YYYY');
|
|
$('#dossiers_list').DataTable({
|
|
data: dataSet,
|
|
pageLength: 100,
|
|
bLengthChange: false,
|
|
language: {
|
|
url: 'https://cdn.datatables.net/plug-ins/1.10.16/i18n/French.json'
|
|
},
|
|
order: [[0, order_option]],
|
|
columnDefs: [
|
|
{ className: "text-right", "targets": [4] },
|
|
{ "targets": 0,
|
|
"render": function (data, type, full, meta) {
|
|
// ajouter un link vers le formulaire
|
|
return '<a href="' + goto_url + data + '">' + data + '</a>';
|
|
},
|
|
},
|
|
],
|
|
createdRow: function( row, data, dataIndex ){
|
|
if ( data[6] == "Humidité" ) {
|
|
$('td', row).eq(6).css('background-color', 'Crimson').css('color', 'white');
|
|
}
|
|
if ( data[6] == "Devis" || data[6] == "Commandé") {
|
|
$('td', row).eq(6).css('background-color', 'Orange');
|
|
}
|
|
if ( data[6] == "Facturé") {
|
|
$('td', row).eq(6).css('background-color', 'LightBlue');
|
|
}
|
|
if ( data[6] == "Réglée" || data[6] == "Régl part.") {
|
|
$('td', row).eq(6).css('background-color', 'LightGreen');
|
|
}
|
|
},
|
|
});
|
|
|
|
});
|
|
$('form input').on('keypress', function(e) {
|
|
var code = e.keyCode || e.which;
|
|
if (code === 13) {
|
|
e.preventDefault();
|
|
// simuler clic bouton submit
|
|
document.getElementById("submitButton").click();
|
|
}
|
|
});
|
|
</script>
|
|
|
|
</div>
|
|
</metal:block>
|