jyma...@adullact.net
unread,Mar 24, 2017, 1:56:26 PM3/24/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to openmairi...@googlegroups.com
Author: jymadier
Date: 2017-03-24 18:56:23 +0100 (Fri, 24 Mar 2017)
New Revision: 6422
Modified:
branches/contentieux_surcharge_actions_di/app/js/script.js
branches/contentieux_surcharge_actions_di/data/pgsql/contentieux.sql
branches/contentieux_surcharge_actions_di/obj/donnees_techniques.class.php
branches/contentieux_surcharge_actions_di/obj/donnees_techniques_contexte_ctx.class.php
branches/contentieux_surcharge_actions_di/obj/dossier_contentieux.class.php
branches/contentieux_surcharge_actions_di/sql/pgsql/donnees_techniques_contexte_ctx.inc.php
Log:
* Corrections : - les dossiers contentieux n'ont pas de rapport d'instruction
- le filtre ne fonctionnait pas sur les actions de donn?\195?\169es techniques
Modified: branches/contentieux_surcharge_actions_di/app/js/script.js
===================================================================
--- branches/contentieux_surcharge_actions_di/app/js/script.js 2017-03-24 17:02:48 UTC (rev 6421)
+++ branches/contentieux_surcharge_actions_di/app/js/script.js 2017-03-24 17:56:23 UTC (rev 6422)
@@ -161,10 +161,6 @@
$('a[id^=action-form-dossier_instruction][id$=-rapport_instruction]').each(function(){
$(this).bind_action_for_overlay("rapport_instruction");
});
- // Bind actions rapport d'instruction depuis dossier contentieux
- $('a[id^=action-form-dossier_contentieux][id$=-rapport_instruction]').each(function(){
- $(this).bind_action_for_overlay("rapport_instruction_contexte_ctx");
- });
// Bind actions geolocalisation depuis dossier instruction
$('a[id^=action-form-dossier_instruction][id$=-geolocalisation]').each(function(){
$(this).bind_action_for_overlay("geolocalisation_sig");
Modified: branches/contentieux_surcharge_actions_di/data/pgsql/contentieux.sql
===================================================================
--- branches/contentieux_surcharge_actions_di/data/pgsql/contentieux.sql 2017-03-24 17:02:48 UTC (rev 6421)
+++ branches/contentieux_surcharge_actions_di/data/pgsql/contentieux.sql 2017-03-24 17:56:23 UTC (rev 6422)
@@ -12181,10 +12181,10 @@
--
--
--- START - Surcharge des classes donnees_techniques et rapport_instruction
+-- START - Surcharge de la classe donnees_techniques
--
--- Ajout du droit de consultation des demandeurs pour les dossiers contentieux
+-- Ajout des droits liés aux données techniques des dossiers contentieux
INSERT INTO om_droit (om_droit, libelle, om_profil)
SELECT nextval('om_droit_seq'),'donnees_techniques_contexte_ctx',(SELECT om_profil FROM om_profil WHERE libelle = 'ASSISTANTE')
WHERE
@@ -12255,7 +12255,29 @@
SELECT om_droit FROM om_droit WHERE libelle = 'donnees_techniques_contexte_ctx_consulter' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'DIRECTION INFRACTION')
);
+INSERT INTO om_droit (om_droit, libelle, om_profil)
+SELECT nextval('om_droit_seq'),'donnees_techniques_contexte_ctx_consulter',(SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR')
+WHERE
+NOT EXISTS (
+ SELECT om_droit FROM om_droit WHERE libelle = 'donnees_techniques_contexte_ctx_consulter' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR')
+);
+INSERT INTO om_droit (om_droit, libelle, om_profil)
+SELECT nextval('om_droit_seq'),'donnees_techniques_contexte_ctx_consulter',(SELECT om_profil FROM om_profil WHERE libelle = 'DIVISIONNAIRE')
+WHERE
+NOT EXISTS (
+ SELECT om_droit FROM om_droit WHERE libelle = 'donnees_techniques_contexte_ctx_consulter' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'DIVISIONNAIRE')
+);
+
+INSERT INTO om_droit (om_droit, libelle, om_profil)
+SELECT nextval('om_droit_seq'),'donnees_techniques_contexte_ctx_consulter',(SELECT om_profil FROM om_profil WHERE libelle = 'CHEF DE SERVICE')
+WHERE
+NOT EXISTS (
+ SELECT om_droit FROM om_droit WHERE libelle = 'donnees_techniques_contexte_ctx_consulter' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'CHEF DE SERVICE')
+);
+
--
--- END - Surcharge des classes donnees_techniques et rapport_instruction
+-- END - Surcharge de la classe donnees_techniques
--
+
+
Modified: branches/contentieux_surcharge_actions_di/obj/donnees_techniques.class.php
===================================================================
--- branches/contentieux_surcharge_actions_di/obj/donnees_techniques.class.php 2017-03-24 17:02:48 UTC (rev 6421)
+++ branches/contentieux_surcharge_actions_di/obj/donnees_techniques.class.php 2017-03-24 17:56:23 UTC (rev 6422)
@@ -56,12 +56,16 @@
//
$this->class_actions[2]["condition"] = "is_deletable";
- // ACTION - 10 - champs_donnees_techniques
+ // ACTION - 003 - consulter
+ $this->class_actions[3]["condition"] = "can_user_access_dossier_contexte_modification";
+
+ // ACTION - 100 - champs_donnees_techniques
// Affiche dans un overlay les champs et libellés des données techniques
$this->class_actions[100] = array(
"identifier" => "champs_donnees_techniques",
"view" => "view_champs_donnees_techniques",
"permission_suffix" => "consulter",
+ "condition" => "can_user_access_dossier_contexte_modification",
);
}
@@ -242,6 +246,9 @@
// XXX Créer une nouvelle méthode au même endroit que l'appel a checkAccessibility()
function checkAccessibility() {
+
+ parent::checkAccessibility();
+
if(file_exists ("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc.php"))
include ("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc.php");
elseif(file_exists ("../sql/".OM_DB_PHPTYPE."/".$this->table.".form.inc"))
@@ -1715,6 +1722,25 @@
return $dossier;
}
+ /*
+ * CONDITION - can_user_access_dossier
+ *
+ * Vérifie que l'utilisateur a bien accès au dossier lié à l'instruction instanciée.
+ * Cette méthode vérifie que l'utilisateur est lié au groupe du dossier, et si le
+ * dossier est confidentiel qu'il a accès aux confidentiels de ce groupe.
+ *
+ */
+ function can_user_access_dossier_contexte_modification() {
+ $id_dossier = $this->getVal('dossier_instruction');
+ //
+ if ($id_dossier !== "" && $id_dossier !== null) {
+ require_once "../obj/dossier_instruction.class.php";
+ $dossier = new dossier_instruction($id_dossier, $f->db, DEBUG);
+ //
+ return $dossier->can_user_access_dossier();
+ }
+ return false;
+ }
}// fin classe
?>
Modified: branches/contentieux_surcharge_actions_di/obj/donnees_techniques_contexte_ctx.class.php
===================================================================
--- branches/contentieux_surcharge_actions_di/obj/donnees_techniques_contexte_ctx.class.php 2017-03-24 17:02:48 UTC (rev 6421)
+++ branches/contentieux_surcharge_actions_di/obj/donnees_techniques_contexte_ctx.class.php 2017-03-24 17:56:23 UTC (rev 6422)
@@ -1,6 +1,6 @@
<?php
/**
- * Surcharge de l'objet pour gérer l'affichage de l'onglet selon le contexte.
+ * Surcharge de l'objet pour gérer l'affichage des données techniques selon le contexte.
*
* @package openads
* @version SVN : $Id$
Modified: branches/contentieux_surcharge_actions_di/obj/dossier_contentieux.class.php
===================================================================
--- branches/contentieux_surcharge_actions_di/obj/dossier_contentieux.class.php 2017-03-24 17:02:48 UTC (rev 6421)
+++ branches/contentieux_surcharge_actions_di/obj/dossier_contentieux.class.php 2017-03-24 17:56:23 UTC (rev 6422)
@@ -17,6 +17,10 @@
// d'initialisation de la classe parente
parent::init_class_actions();
+ // ACTION - 002 - supprimer
+ // Désactivation de l'action supprimer
+ $this->class_actions[2] = null;
+
// ACTION - 100 - donnees_techniques
// Affiche dans un overlay les données techniques
$this->class_actions[100] = array(
@@ -37,24 +41,10 @@
);
// ACTION - 110 - rapport_instruction
- // Affiche dans un overlay le rapport d'instruction
- $this->class_actions[110] = array(
- "identifier" => "rapport_instruction",
- "portlet" => array(
- "type" => "action-self",
- "libelle" => _("Rapport d'instruction"),
- "order" => 110,
- "class" => "rediger-16",
- ),
- "view" => "view_rapport_instruction",
- "permission_suffix" => "rapport_instruction_rediger",
- "condition" => array(
- "is_user_from_allowed_collectivite",
- "check_context",
- "can_open_rapport_instruction",
- ),
- );
+ // Désactivation de l'action ouvrant l'overlay de rapport d'instruction
+ $this->class_actions[110] = null;
+
// ACTION - 130 - view_edition
// Désactivation de l'action permettant d'éditer le récapitulatif du dossier
$this->class_actions[130] = null;
@@ -80,27 +70,6 @@
);
}
- /**
- * VIEW - view_rapport_instruction.
- *
- * Ouvre le sous-formulaire en ajaxIt dans un overlay.
- * Cette action est bindée pour utiliser la fonction popUpIt.
- *
- * @return void
- */
- function view_rapport_instruction() {
-
- // Vérification de l'accessibilité sur l'élément
- $this->checkAccessibility();
- //
- $this->display_overlay(
- $this->getVal($this->clePrimaire),
- "rapport_instruction_contexte_ctx",
- "rapport_instruction"
- );
- }
-
-
}
?>
Modified: branches/contentieux_surcharge_actions_di/sql/pgsql/donnees_techniques_contexte_ctx.inc.php
===================================================================
--- branches/contentieux_surcharge_actions_di/sql/pgsql/donnees_techniques_contexte_ctx.inc.php 2017-03-24 17:02:48 UTC (rev 6421)
+++ branches/contentieux_surcharge_actions_di/sql/pgsql/donnees_techniques_contexte_ctx.inc.php 2017-03-24 17:56:23 UTC (rev 6422)
@@ -1,6 +1,6 @@
<?php
/**
- * Script de paramétrage de l'overlay des données techniques.
+ * Script de paramétrage de la classe des données techniques.
*
* Dans le contexte d'un dossier contentieux.
*