// Si on enregistre et qu'il y a des erreurs
$theme['the_id'] = $the_id;
$theme['the_nom'] = $_POST['ed_the_nom'];
+ $theme['the_confidentiel'] = $_POST['ed_confidentiel'] ? true : false;
if (count ($_POST['ed_portail'])) {
foreach ($_POST['ed_portail'] as $s) {
$theme_portails[] = array ('por_id' => $s);
} else {
if (count ($erreur)) {
$theme['the_nom'] = $_POST['ed_the_nom'];
+ $theme['the_confidentiel'] = $_POST['ed_confidentiel'] ? true : false;
} else {
$theme = array ();
}
$portails[] = $portail;
}
}
- $base->notes_theme_update ($_SESSION['token'], $_GET['the'], $post['ed_the_nom'], $portails);
+ $base->notes_theme_update ($_SESSION['token'], $_GET['the'], $post['ed_the_nom'], $portails, $post['ed_confidentiel'] ? true : false);
}
function set_erreur ($code) {
echo '</tr>';
echo '<tr class="pair">';
+echo '<td>Confidentialité</td>';
+echo '<td>';
+echo '<input type="checkbox" id="ed_confidentiel" name="ed_confidentiel" value="true"'.($theme['the_confidentiel'] ? ' checked' : '').'> <label for="ed_confidentiel">Contenu confidentiel</label>';
+echo '</td>';
+echo '</tr>';
+
+echo '<tr class="impair">';
echo '<td>Portails</td>';
echo '<td>';
liste_portails_cb ($theme_portails);
FOR row IN
select DISTINCT note.* FROM notes.note
inner join notes.note_usager using(not_id)
+ INNER JOIN notes.note_theme USING(not_id)
+ INNER JOIN notes.theme USING (the_id)
inner join login.utilisateur_usagers_liste (prm_token, prm_grp_id, false) on utilisateur_usagers_liste.per_id = note_usager.per_id
WHERE ((prm_start ISNULL OR prm_end ISNULL) OR not_date_evenement BETWEEN p_start AND p_end)
+ AND (NOT the_confidentiel)
LOOP
RETURN NEXT row;
END LOOP;
FOR row IN
SELECT note.* FROM notes.note
INNER JOIN notes.note_usager USING(not_id)
+ INNER JOIN notes.note_theme USING(not_id)
+ INNER JOIN notes.theme USING (the_id)
WHERE per_id = prm_per_id
AND ((prm_start ISNULL AND prm_end ISNULL) OR not_date_evenement BETWEEN p_start AND p_end OR not_date_saisie BETWEEN p_start AND p_end)
+ AND (NOT the_confidentiel)
LOOP
RETURN NEXT row;
Remarque :
Nécessite le droit de configuration "Réseau"';
-CREATE OR REPLACE FUNCTION notes_theme_update(prm_token integer, prm_the_id integer, prm_the_nom character varying, prm_portails integer[]) RETURNS integer
+CREATE OR REPLACE FUNCTION notes_theme_update(prm_token integer, prm_the_id integer, prm_the_nom character varying, prm_portails integer[], prm_confidentiel boolean) RETURNS integer
LANGUAGE plpgsql
AS $$
DECLARE
BEGIN
PERFORM login._token_assert (prm_token, FALSE, TRUE);
IF prm_the_id ISNULL THEN
- INSERT INTO notes.theme (the_nom) VALUES (prm_the_nom) RETURNING the_id INTO ret;
+ INSERT INTO notes.theme (the_nom, the_confidentiel) VALUES (prm_the_nom, prm_confidentiel) RETURNING the_id INTO ret;
ELSE
- UPDATE notes.theme SET the_nom = prm_the_nom WHERE the_id = prm_the_id;
+ UPDATE notes.theme SET the_nom = prm_the_nom, the_confidentiel = prm_confidentiel WHERE the_id = prm_the_id;
ret = prm_the_id;
END IF;
DELETE FROM notes.theme_portail WHERE the_id = ret;
RETURN ret;
END;
$$;
-COMMENT ON FUNCTION notes_theme_update(prm_token integer, prm_the_id integer, prm_the_nom character varying, prm_portails integer[]) IS
+COMMENT ON FUNCTION notes_theme_update(prm_token integer, prm_the_id integer, prm_the_nom character varying, prm_portails integer[], prm_confidentiel boolean) IS
'Modifie les informations d''une boîte thématique.
Entrées :
- prm_token : Token d''authentification
- prm_the_id : Identifiant de la boîte thématique à modifier
- prm_the_nom : Nom de la boîte thématique
- prm_portails : Tableau d''identifiants de portails auxquels affecter la boîte thématique
+ - prm_confidentiel : Le contenu de la boite ne sera accessible que si une vue l''utilise explicitement
Remarque :
Nécessite le droit de configuration "Réseau"';