Accéder au contenu.
Menu Sympa

devel - [Devel] r333 - trunk

Objet : devel-adl

Archives de la liste

[Devel] r333 - trunk


Chronologique Discussions 
  • From: svn AT agendadulibre.org
  • To: devel AT agendadulibre.org
  • Subject: [Devel] r333 - trunk
  • Date: Fri, 9 May 2008 14:15:26 +0200 (CEST)
  • List-archive: <http://agendadulibre.org/pipermail/devel>
  • List-id: Developpement de l'Agenda du Libre <devel.agendadulibre.org>

Author: thomas
Date: Fri May 9 14:11:55 2008
New Revision: 333

Log:
Édition des évènements déjà validés. Désormais, lorsqu'un modérateur
est connecté, un lien « Éditer cet évènement » s'affiche sur la page
de chaque évènement, permettant de l'éditer.



Modified:
trunk/calendar.css
trunk/editevent.php
trunk/showevent.php

Modified: trunk/calendar.css
==============================================================================
--- trunk/calendar.css (original)
+++ trunk/calendar.css Fri May 9 14:11:55 2008
@@ -445,4 +445,5 @@
width: 70%;
padding: 1em;
margin: auto;
+ margin-bottom: 10px;
}
\ No newline at end of file

Modified: trunk/editevent.php
==============================================================================
--- trunk/editevent.php (original)
+++ trunk/editevent.php Fri May 9 14:11:55 2008
@@ -30,7 +30,7 @@
{
global $moderatorlist;

- $sql = "SELECT * FROM events WHERE id=" . $db->quote_smart($id);
+ $sql = "select * from events where id=" . $db->quote_smart($id);
$ret = $db->query($sql);
if ($ret == FALSE)
{
@@ -74,16 +74,31 @@

$diff = arr_diff (split ("\n", $oldevent_str), split ("\n",
$newevent_str), 1);

- calendar_mail ($moderatorlist, "",
- "�dition de l'�v�nement '" . $title . "'",
- "Bonjour,\n\n" .
- "L'�v�nement '" . stripslashes($title) . "' a �t� modifi�
par " . $user->get_login() . ".\n".
- "Modifications apport�es:\n\n" .
- $diff . "\n\n".
- "Bonne journ�e\n\n".
- "-- L'�quipe de mod�ration");
+ if ($oldevent->moderated)
+ {
+ calendar_mail ($moderatorlist, "",
+ "�dition de l'�v�nement valid� '" . $title . "'",
+ "Bonjour,\n\n" .
+ wordwrap("L'�v�nement valid� '" . stripslashes($title) .
"' a �t� modifi� par " . $user->get_login() . ".\n") .
+ "Modifications apport�es:\n\n" .
+ $diff . "\n\n".
+ "Bonne journ�e\n\n".
+ "-- L'�quipe de mod�ration");

- return 0;
+ return "showevent.php?id=" . $oldevent->id;
+ }
+ else
+ {
+ calendar_mail ($moderatorlist, "",
+ "�dition de l'�v�nement '" . $title . "'",
+ "Bonjour,\n\n" .
+ wordwrap("L'�v�nement '" . stripslashes($title) . "' a
�t� modifi� par " . $user->get_login() . ".\n") .
+ "Modifications apport�es:\n\n" .
+ $diff . "\n\n".
+ "Bonne journ�e\n\n".
+ "-- L'�quipe de mod�ration");
+ return "moderation.php";
+ }
}

$db = new db();
@@ -93,7 +108,7 @@

if ($_POST['__event_save'])
{
- $ret = save_event ($db, $user, $id,
+ $returnaddr = save_event ($db, $user, $id,
$_POST['__event_title'],
mktime($_POST['__event_start_hour'],
$_POST['__event_start_minute'],
@@ -115,7 +130,8 @@
$_POST['__event_contact'],
$_POST['__event_submitter'],
$_POST['__event_tags']);
- header("Location: moderation.php");
+
+ header("Location: " . $returnaddr);
}

put_header("�dition d'un �v�nement");
@@ -171,6 +187,13 @@
echo "<a
href=\"moderation.php\">Mod�ration</a>&nbsp;&gt;&gt;&gt&nbsp;Pr�visualisation
de l'�v�nement";
echo "</p>";

+if ($event->moderated)
+{
+ echo '<div class="moderationbox">';
+ echo '<p style="font-weight: bold;">Attention, cet �v�nement est d�j�
mod�r�. Toute modification sera imm�diatement visible sur le site.</p>';
+ echo '</div>';
+}
+
echo '<div class="moderationbox">';
echo format_event ($db, $title, $start, $end, $description, $city,
$region, $locality, $url, $contact, $submitter,

Modified: trunk/showevent.php
==============================================================================
--- trunk/showevent.php (original)
+++ trunk/showevent.php Fri May 9 14:11:55 2008
@@ -22,85 +22,98 @@

include("bd.inc.php");
include("funcs.inc.php");
+include("session.inc.php");

$db = new db();
+$session = new session();

put_header("Informations sur un �v�nement");

-$event = fetch_event ($db, get_safe_integer('id', 0));
+$event_id = get_safe_integer('id', 0);
+$event = fetch_event ($db, $event_id);

-if ($event)
+if (! $event)
{
- echo "<div id=\"lug-list\"><h1>Groupes d'utilisateurs de la r�gion</h1>";
+ echo "<p class=\"error\">Pas d'�v�nement avec cet identifiant.</p>";
+ put_footer();
+ exit;
+}

- $lugs = $db->query ("select distinct region, name, url from lugs where
region = '" .
- $event->region . "'");
+echo "<div id=\"lug-list\"><h1>Groupes d'utilisateurs de la r�gion</h1>";

- if (mysql_num_rows ($lugs) == 0)
- {
- echo "Pas de groupes d'utilisateur.<br/>";
- }
- else
- {
- echo " <ul>";
+$lugs = $db->query ("select distinct region, name, url from lugs where
region = '" .
+ $event->region . "'");

- while ($lug = mysql_fetch_object ($lugs))
- {
- echo "<li><a href=\"" . $lug->url . "\">" . $lug->name . "</a> (";
- $dpts = $db->query ("select distinct department from lugs where
name = '" . $lug->name . "'");
- $i = 1;
- while ($dpt = mysql_fetch_object ($dpts))
- {
- echo $dpt->department;
- if ($i != mysql_num_rows($dpts))
- echo ", ";
- $i++;
- }
- echo ")</li>";
- }
- echo " </ul>";
- }
+if (mysql_num_rows ($lugs) == 0)
+{
+ echo "Pas de groupes d'utilisateur.<br/>";
+}
+else
+{
+ echo " <ul>";

- if (in_array("libre-en-fete-2007", split(" ", $event->tags)))
+ while ($lug = mysql_fetch_object ($lugs))
{
- echo "<hr/>";
- echo "<h1>Libre en F�te 2007</h1>";
- echo "<p>";
- echo "<a href=\"http://www.libre-en-fete.net\";>";
- echo "<img src=\"lef-2007.png\" width=\"100\" style=\"float: right;
margin-left: 5px; border: 0;\"/>";
- echo "</a>";
- echo "Cet �v�nement s'inscrit dans le cadre de la sixi�me �dition du
<a href=\"http://2007.libre-en-fete.net\";>Libre en F�te 2007</a>.";
- echo "</p>";
+ echo "<li><a href=\"" . $lug->url . "\">" . $lug->name . "</a> (";
+ $dpts = $db->query ("select distinct department from lugs where name =
'" . $lug->name . "'");
+ $i = 1;
+ while ($dpt = mysql_fetch_object ($dpts))
+ {
+ echo $dpt->department;
+ if ($i != mysql_num_rows($dpts))
+ echo ", ";
+ $i++;
+ }
+ echo ")</li>";
}
+ echo " </ul>";
+}

- if (in_array("libre-en-fete-2008", split(" ", $event->tags)))
- {
- echo "<hr/>";
- echo "<h1>Libre en F�te 2008</h1>";
- echo "<p>";
- echo "<a href=\"http://www.libre-en-fete.net\";>";
- echo "<img src=\"lef-2007.png\" width=\"100\" style=\"float: right;
margin-left: 5px; border: 0;\"/>";
- echo "</a>";
- echo "Cet �v�nement s'inscrit dans le cadre de la septi�me �dition du
<a href=\"http://www.libre-en-fete.net\";>Libre en F�te</a>.";
- echo "</p>";
- }
+if (in_array("libre-en-fete-2007", split(" ", $event->tags)))
+{
+ echo "<hr/>";
+ echo "<h1>Libre en F�te 2007</h1>";
+ echo "<p>";
+ echo "<a href=\"http://www.libre-en-fete.net\";>";
+ echo "<img src=\"lef-2007.png\" width=\"100\" style=\"float: right;
margin-left: 5px; border: 0;\"/>";
+ echo "</a>";
+ echo "Cet �v�nement s'inscrit dans le cadre de la sixi�me �dition du <a
href=\"http://2007.libre-en-fete.net\";>Libre en F�te 2007</a>.";
+ echo "</p>";
+}

- echo "</div>";
+if (in_array("libre-en-fete-2008", split(" ", $event->tags)))
+{
+ echo "<hr/>";
+ echo "<h1>Libre en F�te 2008</h1>";
+ echo "<p>";
+ echo "<a href=\"http://www.libre-en-fete.net\";>";
+ echo "<img src=\"lef-2007.png\" width=\"100\" style=\"float: right;
margin-left: 5px; border: 0;\"/>";
+ echo "</a>";
+ echo "Cet �v�nement s'inscrit dans le cadre de la septi�me �dition du <a
href=\"http://www.libre-en-fete.net\";>Libre en F�te</a>.";
+ echo "</p>";
+}

- echo format_event ($db,
- $event->title,
- date_mysql2timestamp($event->start_time),
- date_mysql2timestamp($event->end_time),
- $event->description,
- $event->city,
- $event->region,
- $event->locality,
- $event->url,
- $event->contact,
- $event->submitter,
- $event->tags);
+if ($session->exists("agenda_libre_id"))
+{
+ echo "<h1>Actions</h1>";
+ echo "<a href=\"editevent.php?id=" . $event_id . "\">�diter �v�nement</a>";
}

+echo "</div>";
+
+echo format_event ($db,
+ $event->title,
+ date_mysql2timestamp($event->start_time),
+ date_mysql2timestamp($event->end_time),
+ $event->description,
+ $event->city,
+ $event->region,
+ $event->locality,
+ $event->url,
+ $event->contact,
+ $event->submitter,
+ $event->tags);
+
put_footer();

?>
\ No newline at end of file




  • [Devel] r333 - trunk, svn, 09/05/2008

Archives gérées par MHonArc 2.6.16.

Haut de le page