<meta charset="UTF-8">
<style>
.form-check input[type="radio"]:not(:checked), .form-check input[type="radio"]:checked{
display: block;
}
.form-check input[type="radio"] + label {
font-weight: 400;
padding-left: 0;
}
label{
font-weight: 400 !important;
}
.form-check input[type="radio"] + label::before{
content: none;
}
.form-check input[type="radio"] + label::after{
content: none;
display: none;
}
</style>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4"
crossorigin="anonymous"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.24/datatables.min.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/jquery-migrate-1.4.1.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.24/datatables.min.js"></script>
<script>
//SIREN de la collectivité à changer, pour afficher toutes les collectivites de l'instance Stela3 remplacer par var siren = "";
var siren = '218601581';
var affichercollectivite = false;
if (siren == "") {
affichercollectivite = true
}
//URL API ACTE, changer l'URL par environnement / partenaire
var myUrlCustom = 'https://stela3.at86.fr' + '/api/acte/public/?siren=' + '218601581';
var urlstela3 = 'https://stela3.at86.fr' + '/registre-des-deliberations/';
// Adresse proxy CORS, permet d'appeler les appels STELA 3 sans avoir de souci avec la politique CORS.
var proxy = 'https://proxy-cross.sictiam.fr/proxy?url=';
//URL API ACTE document, changer l'URL par environnement / partenaire
var myUrlARDownload = 'https://stela3.at86.fr' + '/api/acte/public/';
var objet = '';
var number = '';
/*
*
* Pour avoir juste les actes "“affichage sur site internet” il faut modifier la variable website par true
*/
var website = true;
$(document).ready(function () {
if (website == true) {
myUrlCustom = 'https://stela3.at86.fr' + '/api/acte/public/website/?siren=' + '218601581';
$('#typeaffichage').text("Affichage site web")
}
initTable();
$('#recherchechamps').keyup(function () {
objet = this.value;
initTable();
});
$('#objetcheckbox').click(
function () {
objet = $('#recherchechamps').val();
number = '';
initTable();
});
$('#numerocheckbox').click(
function () {
number = $('#recherchechamps').val();
objet = '';
initTable();
});
});
function isAck(history) {
return history.status === 'ACK_RECEIVED';
}
function initTable() {
$('#table_id').DataTable().destroy();
if ($.fn.DataTable.isDataTable('#table_id')) {
$('#table_id').DataTable().columns.adjust();
return;
}
$('#table_id').dataTable({
"language": {
"url": proxy + "https://cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/French.json"
},
"searching": false,
"bLengthChange": false,
"processing": true,
"serverSide": true,
"bPaginate": true,
"ajax": function (data, callback, settings) {
$.get(proxy + myUrlCustom, {
limit: data.length,
offset: data.start,
objet: objet,
number: number
}, function (res) {
callback({
recordsTotal: res.totalCount,
recordsFiltered: res.totalCount,
data: res.results
});
});
},
"columns": [{
"title": "Date de décision",
"width": "10%",
"visible": true,
"render": function (data, type, full, meta) {
return formatDate(full.decision);
}
}, {
"title": "Date de publication",
"width": "10%",
"visible": true,
"render": function (data, type, full, meta) {
if (full.published == null) {
let ack = full.acteHistories.find(isAck);
return formatDate(ack.date);
} else {
return formatDate(full.published);
}
}
}, {
"data": "number",
"title": "Numéro",
"width": "10%",
"visible": true
}, {
"data": "objet",
"title": "Objet",
"width": "40%",
"visible": true
}, {
"data": "localAuthority.name",
"title": "Collectivité",
"width": "60%",
"visible": affichercollectivite
}, {
"title": "Nature",
"width": "10%",
"visible": true,
"render": function (data, type, full, meta) {
if (full.nature == "ARRETES_REGLEMENTAIRES") {
return "Acte réglementaire";
}
if (full.nature == "DELIBERATIONS") {
return "Délibération";
}
if (full.nature == "DOCUMENTS_BUDGETAIRES_ET_FINANCIERS") {
return "Documents budgétaires et financiers";
}
return full.nature;
}
}, {
"title": "",
"width": "5%",
"visible": true,
"render": function (data, type, full, meta) {
return '<a href="' + myUrlARDownload + full.uuid + '/filewp/stamped" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-download" viewBox="0 0 16 16"><path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/><path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/></svg></a>'
}
}, {
"title": "",
"width": "5%",
"visible": true,
"render": function (data, type, full, meta) {
return '<a href="' + urlstela3 + full.uuid + '"" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16"><path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/><path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/></svg></a>'
}
}]
});
}
function formatDate(input) {
var datePart = input.match(/\d+/g),
year = datePart[0].substring(0),
month = datePart[1], day = datePart[2];
return day + '/' + month + '/' + year;
}
</script>