Commit 231fce46 authored by THEO GUILLON's avatar THEO GUILLON
Browse files

Merge branch '370-aipd-non-requise' into '1.2.0'

Resolve "AIPD non requise"

See merge request libriciel/pole-citoyens/web-DPO/web-DPO!338
parents 9c144bc8 c97e67ab
......@@ -280,15 +280,21 @@ class WebdpoFiche extends AppModel {
]
],
// ---------------------------------------------------------------------
'criteres' => [
'checkNotBlankIfMultiple' => [
'rule' => ['checkMultipleIf', 'localisation_large_echelle', true, ['Non'], ['min' => 1]]
],
'checkBlankIf' => [
'rule' => ['checkBlankIf', 'localisation_large_echelle', true, ['Oui']]
]
],
// 'criteres' => [
// 'checkNotBlankIfMultiple' => [
// 'rule' => ['checkMultipleIf', 'localisation_large_echelle', true, ['Non'], ['min' => 1]]
// ],
// 'checkNotBlankIf' => [
// 'rule' => ['checkNotBlankIf', 'localisation_large_echelle', true, ['Non']]
// ],
// 'checkBlankIf' => [
// 'rule' => ['checkBlankIf', 'localisation_large_echelle', true, ['Oui']]
// ]
// ],
'traitement_considere_risque' => [
'checkBlankIfCountOptionsChecked' => [
'rule' => ['checkBlankIfCountOptionsChecked', 'criteres', 0]
],
'checkNotBlankIfCountOptionsChecked' => [
'rule' => ['checkNotBlankIfCountOptionsChecked', 'criteres', 1]
],
......
......@@ -123,7 +123,7 @@ echo $this->Html->script('Fiches/pia');
'text' => __d('fiche', 'fiche.champCriteres')
],
'multiple' => 'checkbox',
'required' => true,
// 'required' => true,
'class' => 'checkbox',
'options' => Fiche::LISTE_CRITERES,
'div' => "input select"
......
......@@ -582,7 +582,6 @@ if ($this->request->params['action'] == 'add'){
'text' => __d('fiche', 'fiche.champCriteres')
],
'multiple' => 'checkbox',
'required' => true,
'class' => 'checkbox',
'options' => Fiche::LISTE_CRITERES,
'div' => "input select"
......
......@@ -5,61 +5,73 @@ $(document).ready(function () {
displayFieldPiaListNotRequired(($('#ressources_humaines').attr('id')), ($('#ressources_humaines').val()));
$('#ressources_humaines').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#relation_fournisseurs').attr('id'), $('#relation_fournisseurs').val());
$('#relation_fournisseurs').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#gestion_electoral').attr('id'), $('#gestion_electoral').val());
$('#gestion_electoral').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#comites_entreprise').attr('id'), $('#comites_entreprise').val());
$('#comites_entreprise').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#association').attr('id'), $('#association').val());
$('#association').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#sante_prise_patient').attr('id'), $('#sante_prise_patient').val());
$('#sante_prise_patient').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#avocats').attr('id'), $('#avocats').val());
$('#avocats').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired(($('#greffiers').attr('id')), ($('#greffiers').val()));
$('#greffiers').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#notaires').attr('id'), $('#notaires').val());
$('#notaires').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#collectivites_affaires_scolaires').attr('id'), $('#collectivites_affaires_scolaires').val());
$('#collectivites_affaires_scolaires').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#controles_acces').attr('id'), $('#controles_acces').val());
$('#controles_acces').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListNotRequired($('#ethylotests').attr('id'), $('#ethylotests').val());
$('#ethylotests').change(function () {
displayFieldPiaListNotRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
//
......@@ -67,83 +79,100 @@ $(document).ready(function () {
displayFieldPiaListRequired($('#sante_medicosociaux').attr('id'), $('#sante_medicosociaux').val());
$('#sante_medicosociaux').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#donnees_genetiques').attr('id'), $('#donnees_genetiques').val());
$('#donnees_genetiques').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#profils_personnes_gestion_rh').attr('id'), $('#profils_personnes_gestion_rh').val());
$('#profils_personnes_gestion_rh').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#surveiller_constante_employes').attr('id'), $('#surveiller_constante_employes').val());
$('#surveiller_constante_employes').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#gestion_alertes_sociale_sanitaire').attr('id'), $('#gestion_alertes_sociale_sanitaire').val());
$('#gestion_alertes_sociale_sanitaire').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#gestion_alertes_professionnelle').attr('id'), $('#gestion_alertes_professionnelle').val());
$('#gestion_alertes_professionnelle').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#donnees_sante_registre').attr('id'), $('#donnees_sante_registre').val());
$('#donnees_sante_registre').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#profilage_rupture_contrat').attr('id'), $('#profilage_rupture_contrat').val());
$('#profilage_rupture_contrat').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#mutualises_manquements_rupture_contrat').attr('id'), $('#mutualises_manquements_rupture_contrat').val());
$('#mutualises_manquements_rupture_contrat').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#profilage_donnees_externes').attr('id'), $('#profilage_donnees_externes').val());
$('#profilage_donnees_externes').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#biometriques').attr('id'), $('#biometriques').val());
$('#biometriques').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#gestion_logements_sociaux').attr('id'), $('#gestion_logements_sociaux').val());
$('#gestion_logements_sociaux').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#accompagnement_social').attr('id'), $('#accompagnement_social').val());
$('#accompagnement_social').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
scrollEnd();
});
displayFieldPiaListRequired($('#localisation_large_echelle').attr('id'), $('#localisation_large_echelle').val());
$('#localisation_large_echelle').change(function () {
displayFieldPiaListRequired($(this).attr('id'), $(this).val());
displayFieldRisque();
scrollEnd();
});
//
displayFieldRisque();
displayFieldRisque(false);
$('#info_pia input[type=checkbox]').change(function () {
displayFieldRisque();
scrollEnd();
});
displayFieldTraitementConsidereRisque($('#traitement_considere_risque').val())
$('#traitement_considere_risque').change(function () {
displayFieldTraitementConsidereRisque($(this).val());
scrollEnd();
});
});
......@@ -160,9 +189,9 @@ function displayFieldTraitementConsidereRisque(val)
}
}
function displayFieldRisque()
function displayFieldRisque(showFirst = true)
{
var nbChecked = $("#info_pia :checkbox:checked").length;
let nbChecked = $("#info_pia :checkbox:checked").length;
if (nbChecked >= 2 ){
// alert("PIA OBLIGATOIRE");
......@@ -176,6 +205,10 @@ function displayFieldRisque()
} else if (nbChecked == 0) {
$('#traitement_considere_risque').parent().parent().hide();
$('#traitement_considere_risque').val('');
if (showFirst === true) {
$('#obligation_pia').val('0');
}
}
}
......@@ -194,6 +227,7 @@ function displayFieldPiaListNotRequired(id, val) {
}
$('#obligation_pia').val('');
// scrollEnd();
} else {
if (val == 'Oui') {
......@@ -233,6 +267,8 @@ function displayFieldPiaListRequired(id, val)
$('#obligation_pia').val('');
// scrollEnd();
} else {
if (val == 'Oui') {
// alert("PIA OBILGATOIRE");
......@@ -256,3 +292,8 @@ function showCriteres()
$('#criteres').parent().parent().show();
$('#traitement_considere_risque').parent().parent().hide();
}
function scrollEnd()
{
$(document).scrollTop($(document).height());
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment