[Devel] r385 - trunk

svn at agendadulibre.org svn at agendadulibre.org
Mar 23 Sep 22:51:53 CEST 2008


Author: thomas
Date: Tue Sep 23 22:51:53 2008
New Revision: 385

Log:
Ajout d'une nouvelle action de modération permettant de demander à un
soumetteur d'évènement d'ajouter des informations complémentaires.

 * moderation.php:

  - Lien vers la nouvelle action.

 * requestinfosevent.php:

  - Implémentation de la nouvelle action.



Added:
   trunk/requestinfosevent.php
Modified:
   trunk/moderation.php

Modified: trunk/moderation.php
==============================================================================
--- trunk/moderation.php	(original)
+++ trunk/moderation.php	Tue Sep 23 22:51:53 2008
@@ -84,7 +84,8 @@
   echo "<td>";
   echo "<a href=\"editevent.php?id=" . $row->id . "\">Éditer</a>&nbsp;-&nbsp;";
   echo "<a href=\"validateevent.php?id=" . $row->id . "\">Valider</a>&nbsp;-&nbsp;";
-  echo "<a href=\"rejectevent.php?id=" . $row->id . "\">Refuser</a>";
+  echo "<a href=\"rejectevent.php?id=" . $row->id . "\">Refuser</a><br/>";
+  echo "<a href=\"requestinfosevent.php?id=" . $row->id . "\">Demander des infos</a>";
   echo "</td>\n";
   echo "</tr>\n";
 

Added: trunk/requestinfosevent.php
==============================================================================
--- (empty file)
+++ trunk/requestinfosevent.php	Tue Sep 23 22:51:53 2008
@@ -0,0 +1,135 @@
+<?php
+
+/* Copyright 2008
+ * - Thomas Petazzoni <thomas POINT petazzoni CHEZ enix POINT org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+include("bd.inc.php");
+include("funcs.inc.php");
+include("session.inc.php");
+include("user.inc.php");
+
+$db = new db();
+$user = new user($db);
+
+if ($_POST['__event_requestinfo_cancel'])
+{
+  header("Location: moderation.php");
+  exit;
+}
+else if ($_POST['__event_requestinfo_send'])
+{
+  $id = get_safe_integer('id', 0);
+
+  $event = fetch_event($db, $id);
+  if (! $event || $event->moderated)
+    {
+      put_header();
+      echo "<p>Opération interdite</p>";
+      put_footer();
+      exit;
+    }
+
+  $text =
+    "Bonjour,\n\n" .
+    "Nous avons bien reçu votre proposition d'évènement '" .
+    stripslashes($event->title) . "', et celui-ci a toute sa " .
+    "place dans l'Agenda du Libre. Néanmoins, avant d'être " .
+    " validé, nous avons besoin de quelques informations " .
+    "complémentaires sur cet évènement :\n\n" .
+    $_POST["__text"] . "\n\n" .
+    "Nous vous invitons à ajouter ces informations en éditant " .
+    "directement l'évènement à l'adresse suivante : \n\n" .
+    calendar_absolute_url("editevent.php?id=" . $event->id
+			  . "&secret=" . $event->secret) . "\n\n" .
+    "Avec tous nos remerciements pour votre contribution,\n\n" .
+    "-- \n" .
+    "L'équipe des modérateurs de l'Agenda du Libre";
+
+  $text = wordwrap($text);
+
+
+  calendar_mail($event->submitter, $moderatorlist,
+		"Demande d'informations sur l'évènement '" .
+		stripslashes($event->title) . "'", $text);
+
+  header("Location: moderation.php");
+}
+
+$id = get_safe_integer('id', 0);
+
+put_header("Demande d'informations sur un évènement");
+
+$event = fetch_event($db, $id);
+if (! $event)
+{
+  echo "<p>Pas d'évènement avec cet ID</p>";
+  put_footer();
+  exit;
+}
+
+if ($event->moderated)
+{
+  echo "<p>Évènement déjà modéré</p>";
+  put_footer();
+  exit;
+}
+
+echo '<p class="moderationheader">';
+echo "<a href=\"moderation.php\">Modération</a>&nbsp;&gt;&gt;&gt&nbsp;Demande d'informations de l'évènement";
+echo "</p>";
+
+?>
+
+<div class="moderationbox">
+<form action="requestinfosevent.php?id=<?php echo $id ?>" method="post">
+<p>Bonjour,</p>
+
+<p>Nous avons bien reçu votre proposition d'évènement '<? echo
+$event->title; ?>', et celui-ci a toute sa place dans l'Agenda du
+Libre. Néanmoins, avant d'être validé, nous avons besoin de quelques
+informations complémentaires sur cet évènement :</p>
+
+<textarea id="__text" cols="80" rows="10" name="__text"></textarea>
+
+<p>Nous vous invitons à ajouter ces informations en éditant directement
+l'évènement à l'adresse suivante :</p>
+
+<p><?php echo calendar_absolute_url("editevent.php?id=" . $event->id
+. "&secret=" . $event->secret) ?></p>
+
+<p>Avec tous nos remerciements pour votre contribution,</p>
+
+<p>L'équipe des modérateurs de l'Agenda du Libre</p>
+
+<input name="__event_requestinfo_send" type="submit" value="Envoyer"/>
+<input name="__event_requestinfo_cancel" type="submit" value="Annuler"/>
+</form>
+</div>
+
+<?php
+echo '<div class="moderationbox">';
+echo format_event ($db, $event->title, strtotime($event->start_time),
+		   strtotime($event->end_time), $event->description,
+		   $event->city, $event->region, $event->locality,
+		   $event->url, $event->contact, $event->submitter,
+		   $event->tags);
+echo '</div>';
+
+put_footer();
+?>
\ No newline at end of file


Plus d'informations sur la liste de diffusion Devel