From 8afcf7f39cc407835f8586f4f0582ddc92a3fb04 Mon Sep 17 00:00:00 2001 From: cy_altern Date: Wed, 2 Jul 2025 01:03:56 +0200 Subject: [PATCH] WIP gamutable des messages : afficher le message complet en popin + ajout du changement de statut --- base/gamucontact.php | 2 +- content/message.html | 6 ++- gamucontact_autorisations.php | 1 - inclure/inc_messages.html | 3 +- inclure/vue_message.html | 28 +++++++++++++ json_messages.json.html | 75 ++++++++++++++++++++++++----------- paquet.xml | 2 +- 7 files changed, 87 insertions(+), 30 deletions(-) create mode 100644 inclure/vue_message.html diff --git a/base/gamucontact.php b/base/gamucontact.php index 04d5f99..6fcbc96 100644 --- a/base/gamucontact.php +++ b/base/gamucontact.php @@ -38,7 +38,7 @@ function gamucontact_declarer_tables_objets_sql($tables) { 'nom' => "varchar(255) NOT NULL", 'telephone' => "varchar(55) NOT NULL", 'email_contact' => "varchar(255) NOT NULL", - 'origine' => 'tinytext NOT NULL DEFAULT ""', + 'origine' => "tinytext NOT NULL", 'type' => "varchar(25) NOT NULL DEFAULT ''", 'date_heure' => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'", 'date_fin' => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'", diff --git a/content/message.html b/content/message.html index 119796b..4c4b18f 100644 --- a/content/message.html +++ b/content/message.html @@ -1,6 +1,8 @@ [(#REM) - neutraliser l'accès aux messages créés par le formulaire de contact + si pas 0minirezo neutraliser l'accès aux messages créés par le formulaire de contact via le scaffolding pour ?page=message -] +][(#AUTORISER{0minirezo}|non) +][(#AUTORISER{0minirezo}|oui) ] + diff --git a/gamucontact_autorisations.php b/gamucontact_autorisations.php index 8ac79f9..0f97582 100644 --- a/gamucontact_autorisations.php +++ b/gamucontact_autorisations.php @@ -26,4 +26,3 @@ function gamucontact_autoriser() { function gamucontact_autoriser_messages_voir_dist($faire, $type, $id, $qui, $opt) { return in_array($qui['statut'], ['0minirezo']); } - diff --git a/inclure/inc_messages.html b/inclure/inc_messages.html index 05b6030..2166ba4 100644 --- a/inclure/inc_messages.html +++ b/inclure/inc_messages.html @@ -1,9 +1,8 @@ [(#AUTORISER{voir,messages}|sinon_interdire_acces)] #SET{url,#URL_PAGE{json_messages.json}} -
[(#SET{titre_un, Messages envoyés sur le site})] - +
+ + [(#ENV{message_seul}|non) +

Message n°[(#ID_MESSAGE)] reçu le [(#DATE|affdate{d/m/Y à H:i:s})]

+
+ Objet : [(#OBJET)] +
+ + [
+ Formulaire : (#TITRE|replace{Formulaire de, ''}) +
] +
+ Expéditeur : [(#NOM)] + [
Email : (#EMAIL_CONTACT)] + [
Téléphone : (#TELEPHONE)] +
+ ] +
+ Message : [(#TEXTE)] +
+ +
diff --git a/json_messages.json.html b/json_messages.json.html index 5928d09..a7720e0 100644 --- a/json_messages.json.html +++ b/json_messages.json.html @@ -3,22 +3,26 @@ [(#ENV{id}|setenv{id_message})] [{ -"header":{ - "id": "_", - "date": "Date", - "formulaire": "Formulaire", - [(#CONFIG{gamucontact/gamutable_afficher_type}|oui) - "type": "Type", - ] - "objet": "Objet", - "statut": "Statut", - "nom": "Expéditeur", - "email_contact": "Email", - "telephone": "Tel", - "message": "Message" + "header":{ + "id": "_", + "date": "Date", + "origine": "Page origine", + "formulaire": "Formulaire", + [(#CONFIG{gamucontact/gamutable_afficher_type}|oui) + "type": "Type", + ] + "objet": "Objet", + "statut": "Statut", + "nom": "Expéditeur", + "email_contact": "Email", + "telephone": "Tel", + "message": "Message" }, - "crayons":{ - "statut": "" + "crayons": { + [(#REM) + "statut": "message", + "nom": "message" + ] }, "ordreCol" : { "date": "desc" @@ -32,7 +36,9 @@ ] "email_contact" : "input" }, - "filtreColValeurs" : {}, + "filtreColValeurs" : { + [(#REM) "statut": "prop" ] + }, "classes": { "id": "w80p", "objet": "minw150p", @@ -42,19 +48,41 @@ } , - -[(#SET{message,
[(#TEXTE*|couper{150})]
-
- [(#TEXTE*)] -
-})] + +[(#SET{message, [(#TEXTE*|couper{100})]})] #SET{statut, #LISTE{prepa,prop,publie,poubelle}|str_replace{#LISTE{Brouillon,Proposé,Publié,Poubelle}, #STATUT}} #SET{formulaire, #TITRE|replace{Formulaire de, ''}} +[(#SET{origine_, [(#ORIGINE|couper{35})...]})] +[(#SET{origine, article origine})] + +#SET{args,#ID_MESSAGE|concat{-}|concat{#STATUT}} +[(#SET{statut, + + [(#STATUT|!={publie}|oui) + + ] [(#STATUT|=={publie}|oui) + + ] + +})] { "html": { "id": #ID_MESSAGE, "date": [(#DATE_HEURE|affdate{d/m/Y H:i:s}|json_encode)], + "origine": [(#GET{origine}|json_encode)], "formulaire": [(#GET{formulaire}|json_encode)], [(#CONFIG{gamucontact/gamutable_afficher_type}|oui) "type": [(#TYPE|json_encode)], @@ -69,12 +97,13 @@ "search": { "id": #ID_MESSAGE, "date": [(#DATE_HEURE|affdate{Y-m-d H:i:s}|json_encode)], + "origine": [(#ORIGINE|json_encode)], "formulaire": [(#GET{formulaire}|json_encode)], [(#CONFIG{gamucontact/gamutable_afficher_type}|oui) "type": [(#TYPE|json_encode)], ] "objet": [(#OBJET|json_encode)], - "statut": [(#GET{statut}|json_encode)], + "statut": [(#STATUT|json_encode)], "nom": [(#NOM|json_encode)], "email_contact": [(#EMAIL_CONTACT|json_encode)], "telephone": [(#TELEPHONE|json_encode)], diff --git a/paquet.xml b/paquet.xml index 0f1f0e0..86764dd 100644 --- a/paquet.xml +++ b/paquet.xml @@ -6,7 +6,7 @@ compatibilite="[3.2.10;4.*]" logo="./gamucontact-xx.svg" documentation="" - schema="1.0.8" + schema="1.0.7" > GamuContact