Pastell doc list and infos update

e_collectivites-version
Romain_L 2 years ago
parent 4567d5d514
commit 67072a770d
  1. 4
      api_pastell_pleiade/api_pastell_pleiade.info.yml
  2. 13
      api_pastell_pleiade/js/api_pastell_documents.js
  3. 47
      api_pastell_pleiade/js/api_pastell_entites.js

@ -1,13 +1,15 @@
name: API Pléiade SSO Pastell
type: module
description: 'API connector Pastell for Pléiade dashboard'
package: Pleiade Pastell
# package: Pleiade Pastell
package: Pleiade
# version: 8.x +
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
- api_lemon_pleiade
- module_api_pleiade
# Information
version: '1.0.x-dev'

@ -20,9 +20,10 @@
var donnees = xhr.response;
// debug
//console.log(donnees);
var document_coll =
if(donnees){
var document_coll =
'\
<div class="col-lg-12 mt-2" id="pastell_block"> \
<div class="col-lg-12" id="pastell_block"> \
<div class="mb-2 shadow-lg">\
<div class="card mb-2">\
<div class="card-header rounded-top bg-white border-bottom rounded-top">\
@ -191,6 +192,8 @@
</div>\
"
document.getElementById("pastell_block_id").innerHTML = document_coll;
}
}
};
xhr.onerror = function () {
@ -226,11 +229,9 @@
{ "width": "18%", "targets": 2 },
{ "width": "25%", "targets": 1 },
{ "width": "30%", "targets": 0 },
// { "width": "2%", "targets": 4 },
// { "width": "2%", "targets": 5 },
// { "width": "2%", "targets": 6 },
],
"order": [[2, 'asc']],
"order": [[2, 'desc']],
"paging": true,
"language": {
"url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/French.json"

@ -4,7 +4,7 @@
attach: function (context, settings) {
// only on frontpage
if (drupalSettings.path.isFront) {
if (drupalSettings.path.isFront && drupalSettings.api_pastell_pleiade.field_pastell_entities_url) {
once("APIpastellEntitesBehavior", "#collectiviteChoice", context).forEach(
function () {
// le nom du groupe LDAP pour pastell doit etre renseigné dans l'admin
@ -30,27 +30,30 @@
// debug
// console.log(donnees);
// construct menu
donnees.forEach(function (value) {
if (value.entite_mere == 0) {
var option = document.createElement("option");
option.id = "entitie_number_" + value.id_e;
option.className = "dropdown-item text-uppercase";
option.value = value.id_e;
option.text = unescape(value.denomination);
linkEntitie.appendChild(option);
donnees.forEach(function (value_child) {
if (value_child.entite_mere == value.id_e) {
var option_child = document.createElement("option");
option_child.id = "entitie_number_" + value_child.id_e;
option_child.className = "dropdown-item ";
option_child.value = value_child.id_e;
option_child.text = "—" + unescape(value_child.denomination);
linkEntitie.appendChild(option_child);
}
});
}
});
if(donnees){
donnees.forEach(function (value) {
if (value.entite_mere == 0) {
var option = document.createElement("option");
option.id = "entitie_number_" + value.id_e;
option.className = "dropdown-item text-uppercase";
option.value = value.id_e;
option.text = unescape(value.denomination);
linkEntitie.appendChild(option);
donnees.forEach(function (value_child) {
if (value_child.entite_mere == value.id_e) {
var option_child = document.createElement("option");
option_child.id = "entitie_number_" + value_child.id_e;
option_child.className = "dropdown-item ";
option_child.value = value_child.id_e;
option_child.text = "—" + unescape(value_child.denomination);
linkEntitie.appendChild(option_child);
}
});
}
});
}
};
xhr.onerror = function () {

Loading…
Cancel
Save