From ff0da8c5b7c702793ecb010d6af37d6b053c09ba Mon Sep 17 00:00:00 2001 From: cy_altern Date: Wed, 2 Jul 2025 18:08:31 +0200 Subject: [PATCH] Feat : gamutable des messages : ajout du changement de statut en masse en utilisant un checkbox sur la colonne statut --- content/changer_statut_messages.html | 7 ++++ formulaires/changer_statut_messages.html | 30 ++++++++++++++ formulaires/changer_statut_messages.php | 50 ++++++++++++++++++++++++ inclure/inc_messages.html | 18 +++++++++ json_messages.json.html | 42 ++++++++++++-------- 5 files changed, 130 insertions(+), 17 deletions(-) create mode 100644 content/changer_statut_messages.html create mode 100644 formulaires/changer_statut_messages.html create mode 100644 formulaires/changer_statut_messages.php diff --git a/content/changer_statut_messages.html b/content/changer_statut_messages.html new file mode 100644 index 0000000..79f5b2f --- /dev/null +++ b/content/changer_statut_messages.html @@ -0,0 +1,7 @@ +#CACHE{0} +[(#AUTORISER{modifier,message}|sinon_interdire_acces)] + +

<:gamucontact:changer_statut_messages:>

+
+ [(#FORMULAIRE_CHANGER_STATUT_MESSAGES{#ENV*{data}})] +
diff --git a/formulaires/changer_statut_messages.html b/formulaires/changer_statut_messages.html new file mode 100644 index 0000000..ccaa4df --- /dev/null +++ b/formulaires/changer_statut_messages.html @@ -0,0 +1,30 @@ + +
+ [

(#ENV*{message_erreur})

] + [

(#ENV*{message_ok})

] + + [

(#ENV*{error_data})

] + +
+
+ #ACTION_FORMULAIRE{#ENV{action}} + + [(#REM) SAISIE{radio, statut, label=Statut, data=#ARRAY{}} ] + +
+ +
+
+ +
+
+
+ +
diff --git a/formulaires/changer_statut_messages.php b/formulaires/changer_statut_messages.php new file mode 100644 index 0000000..b8b3219 --- /dev/null +++ b/formulaires/changer_statut_messages.php @@ -0,0 +1,50 @@ + $statut], $sql_in); + + // Cache + include_spip('inc/invalideur'); + suivre_invalideur("id='messages/$data[0]"); + + $retour = []; + $retour['redirect'] = ""; + $retour['message_ok'] = gamutable_fermer_modalbox(); + + return $retour; +} diff --git a/inclure/inc_messages.html b/inclure/inc_messages.html index 31e841b..63a1f8d 100644 --- a/inclure/inc_messages.html +++ b/inclure/inc_messages.html @@ -15,3 +15,21 @@ env }> + \ No newline at end of file diff --git a/json_messages.json.html b/json_messages.json.html index 520a700..c673070 100644 --- a/json_messages.json.html +++ b/json_messages.json.html @@ -3,28 +3,33 @@ [(#ENV{id}|setenv{id_message})] [{ + "header_top":{ + "Infos": {"class":"header_infos", "colspan": 4}, + "Statut": {"class":"header_statut", "colspan" :3}, + "Expéditeur": {"class":"header_exp", "colspan": 3}, + "Message": {"class":"message", "colspan": 2} + }, "header":{ "id": "_", "date": "Date", - "origine": "Page origine", + "origine": "Origine", "formulaire": "Formulaire", [(#CONFIG{gamucontact/gamutable_afficher_type}|oui) "type": "Type", ] - "objet": "Objet", - "statut": "Statut", - "actions": "Actions", + "statut": " ", + "actions_masse": " ", + "actions": " ", "nom": "Expéditeur", "email_contact": "Email", "telephone": "Tel", + "objet": "Objet", "message": "Message" }, - "crayons": { - [(#REM) - "statut": "message", - "nom": "message" - ] + "checkbox": { + "actions_masse": [(#URL_PAGE{changer_statut_messages}|json_encode)] }, + "crayons": {}, "ordreCol" : { "date": "desc" }, @@ -40,19 +45,19 @@ "filtreColValeurs" : {}, "classes": { "id": "w80p", - "objet": "minw250p", - "statut": "minw100p", - "formulaire": "w150p" + "objet": "minw250p span_g", + "statut": "minw140p span_g", + "formulaire": "w150p", + "nom": "span_g" } } , -[(#SET{message, [(#TEXTE*|couper{100})]})] +[(#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{origine, [ <:gamucontact:acces_page:>]})] #SET{args,#ID_MESSAGE} [(#STATUT|!={publie}|oui) @@ -70,6 +75,7 @@ })] ] +[(#SET{actions_masse, dataid-#ID_MESSAGE})] { "html": { @@ -80,12 +86,13 @@ [(#CONFIG{gamucontact/gamutable_afficher_type}|oui) "type": [(#TYPE|json_encode)], ] - "objet": [(#OBJET|json_encode)], "statut": [(#GET{statut}|json_encode)], + "actions_masse": [(#GET{actions_masse}|json_encode)], "actions": [(#GET{actions}|json_encode)], "nom": [(#NOM|json_encode)], "email_contact": [(#EMAIL_CONTACT|json_encode)], "telephone": [(#TELEPHONE|json_encode)], + "objet": [(#OBJET|json_encode)], "message": [(#GET{message}|json_encode)] }, "search": { @@ -96,12 +103,13 @@ [(#CONFIG{gamucontact/gamutable_afficher_type}|oui) "type": [(#TYPE|json_encode)], ] - "objet": [(#OBJET|json_encode)], "statut": [(#STATUT|json_encode)], + "actions_masse": "", "actions": "", "nom": [(#NOM|json_encode)], "email_contact": [(#EMAIL_CONTACT|json_encode)], "telephone": [(#TELEPHONE|json_encode)], + "objet": [(#OBJET|json_encode)], "message": [(#GET{message}|json_encode)] } }