Accéder au contenu.
Menu Sympa

devel - [Devel] r188 - trunk

Objet : devel-adl

Archives de la liste

[Devel] r188 - trunk


Chronologique Discussions 
  • From: svn AT agendadulibre.org
  • To: devel AT agendadulibre.org
  • Subject: [Devel] r188 - trunk
  • Date: Mon, 18 Sep 2006 23:23:57 +0200 (CEST)
  • List-archive: <http://lolut.utbm.info/pipermail/devel>
  • List-id: Developpement de l'Agenda du Libre <devel.agendadulibre.org>

Author: thomas
Date: Mon Sep 18 23:23:56 2006
New Revision: 188

Modified:
trunk/funcs.inc.php
trunk/moderate.php
trunk/rss.php
trunk/showevent.php
trunk/submit.php
trunk/testevent.php

Log:
Ajout de l'information "soumetteur" pour chaque évènement. Ainsi,
l'adresse e-mail de contact pour un évènement peut être différente de
l'adresse de la personne ayant soumis l'évènement et souhaitant suivre
sa modération.

Par défaut, si le champ "soumetteur" n'est pas rempli, on suppose que
l'adresse à utiliser est celle de contact.

Cette modification a impliqué une modification de la base, réalisable
via les commandes:

mysql> alter table events add submitter varchar(255) not null
default '' after contact;

mysql> update events set submitter=contact;



Modified: trunk/funcs.inc.php
==============================================================================
--- trunk/funcs.inc.php (original)
+++ trunk/funcs.inc.php Mon Sep 18 23:23:56 2006
@@ -445,7 +445,7 @@
*/
function format_event ($db, $title, $start, $end, $description,
$city, $region, $locality, $url, $contact,
- $moderation = FALSE)
+ $submitter, $moderation = FALSE)
{
$title = stripslashes($title);
$region = stripslashes(region_find($db, $region));
@@ -486,7 +486,8 @@
* @return An ASCII description of the event
*/
function format_ascii_event ($db, $title, $start, $end, $description,
- $city, $region, $locality, $url, $contact)
+ $city, $region, $locality, $url, $contact,
+ $submitter)
{
$title = stripslashes($title);
$start = date_timestamp2humanreadable($start);
@@ -496,6 +497,7 @@
$description = stripslashes($description);
$url = stripslashes($url);
$contact = scramble_email(stripslashes($contact));
+ $submitter = scramble_email(stripslashes($submitter));

$str =
"Titre : " . $title . "\n" .
@@ -505,6 +507,7 @@
"Ville : " . $city . "\n" .
"URL : " . $url . "\n".
"Contact : " . $contact . "\n" .
+ "Soumetteur : " . $submitter . "\n" .
"Description : \n " . preg_replace ("/\n/", "\n ", $description);

return $str;
@@ -585,13 +588,14 @@

function edit_event ($db, $title, $start, $end, $description,
$city, $region, $locality, $url, $contact,
- $wants_preview = FALSE)
+ $submitter, $wants_preview = FALSE)
{
$title = escape_form_string($title);
$description = escape_form_string($description,
"<p><b><i><br/><a><ul><li><ol>");
$city = escape_form_string($city);
$url = escape_form_string($url);
$contact = escape_form_string($contact);
+ $submitter = escape_form_string($submitter);

?>
<table>
@@ -696,6 +700,16 @@
</td>
</tr>

+ <tr>
+ <td>
+ Soumetteur:
+ </td>
+ <td>
+ <i>Adresse e-mail du soumetteur de l'�v�nement. Elle ne sera utilis�e
que par les mod�rateurs pour contacter la personne ayant propos� l'�v�nement,
pour lui informer de sa validation ou de son rejet. Si cette adresse n'est
pas pr�sente, l'adresse de contact sera utilis�e</i><br/>
+ <input type="text" size="70" name="__event_submitter" value="<?php echo
$submitter;?>"/><br/>
+ </td>
+ </tr>
+
<tr>
<td>
</td>

Modified: trunk/moderate.php
==============================================================================
--- trunk/moderate.php (original)
+++ trunk/moderate.php Mon Sep 18 23:23:56 2006
@@ -43,7 +43,7 @@
}

function save_event ($db, $id, $title, $start, $end, $description, $city,
- $region, $locality, $url, $contact, $userid)
+ $region, $locality, $url, $contact, $submitter, $userid)
{
global $moderatorlist;

@@ -66,7 +66,8 @@
"region=" . $db->quote_smart ($region) . ", ".
"locality=" . $db->quote_smart ($locality) . ", ".
"url=" . $db->quote_smart ($url) . ", ".
- "contact=" . $db->quote_smart ($contact) . " "
.
+ "contact=" . $db->quote_smart ($contact) . ", ".
+ "submitter=" . $db->quote_smart ($submitter) . " ".
"where id=" . $db->quote_smart ($id);

$ret = $db->query ($sql);
@@ -81,11 +82,11 @@
format_ascii_event ($db, $oldevent->title,
date_mysql2timestamp($oldevent->start_time),
date_mysql2timestamp($oldevent->end_time),
$oldevent->description, $oldevent->city,
$oldevent->region, $oldevent->locality,
- $oldevent->url, $oldevent->contact);
+ $oldevent->url, $oldevent->contact,
$oldevent->submitter);
$newevent_str =
format_ascii_event ($db, $title, $start, $end,
$description, $city, $region, $locality,
- $url, $contact);
+ $url, $contact, $submitter);

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

@@ -132,7 +133,7 @@
}

/* Send email */
- calendar_mail ($row->contact, $moderatorlist,
+ calendar_mail ($row->submitter, $moderatorlist,
"�v�nement '" . $row->title . "' mod�r�",
"Bonjour,\n\n" .
"L'�v�nement que vous avez soumis a �t� mod�r� par " .
user_find_login($db, $userid) .
@@ -141,7 +142,7 @@
format_ascii_event ($db, $row->title,
date_mysql2timestamp($row->start_time),
date_mysql2timestamp($row->end_time),
$row->description, $row->city,
$row->region, $row->locality,
- $row->url, $row->contact) . "\n" .
+ $row->url, $row->contact,
$row->submitter) . "\n" .
"=====================================================\n\n" .
"Merci de votre contribution � l'Agenda du Libre et �
bient�t !\n\n".
"-- \nL'�quipe de mod�ration");
@@ -174,7 +175,7 @@
}

/* Send email */
- calendar_mail ($row->contact, $moderatorlist, "�v�nement '" . $row->title
. "' refus�",
+ calendar_mail ($row->submitter, $moderatorlist, "�v�nement '" .
$row->title . "' refus�",
"Bonjour,\n\n" .
"Vous avez soumis l'�v�nement suivant dans l'Agenda du
Libre, et nous\n" .
"vous remercions de cette contribution.\n\n" .
@@ -184,7 +185,7 @@
format_ascii_event ($db, $row->title,
date_mysql2timestamp($row->start_time),
date_mysql2timestamp($row->end_time),
$row->description, $row->city,
$row->region, $row->locality,
- $row->url, $row->contact) . "\n" .
+ $row->url, $row->contact,
$row->submitter) . "\n" .
"=====================================================\n\n" .
"Merci de votre contribution !\n\n" .
"-- \nL'�quipe de mod�ration");
@@ -281,7 +282,8 @@
$event->region,
$event->locality,
$event->url,
- $event->contact);
+ $event->contact,
+ $event->submitter);
echo "</form>\n";
}

@@ -314,6 +316,7 @@
$_POST['__event_locality'],
$_POST['__event_url'],
$_POST['__event_contact'],
+ $_POST['__event_submitter'],
$session->value ("agenda_libre_id"));

if ($ret == 0)
@@ -389,6 +392,7 @@
$row->locality,
$row->url,
$row->contact,
+ $row->submitter,
TRUE);
echo "<input type=\"submit\" name=\"__event_edit\" value=\"�diter\"/>";
echo "<input type=\"submit\" name=\"__event_accept\" value=\"Accepter\"/>";

Modified: trunk/rss.php
==============================================================================
--- trunk/rss.php (original)
+++ trunk/rss.php Mon Sep 18 23:23:56 2006
@@ -134,12 +134,12 @@
echo " <guid>" . $event->id . "@agendadulibre.org</guid>";
echo " <description>\n";

- echo xmlentities(strip_tags(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)));
+ echo xmlentities(strip_tags(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)));

echo " </description>\n";
echo " <content:encoded>\n";

- echo xmlentities(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));
+ echo xmlentities(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));

echo " </content:encoded>\n";
echo " </item>\n\n";

Modified: trunk/showevent.php
==============================================================================
--- trunk/showevent.php (original)
+++ trunk/showevent.php Mon Sep 18 23:23:56 2006
@@ -71,7 +71,8 @@
$event->region,
$event->locality,
$event->url,
- $event->contact);
+ $event->contact,
+ $event->submitter);
}

put_footer();

Modified: trunk/submit.php
==============================================================================
--- trunk/submit.php (original)
+++ trunk/submit.php Mon Sep 18 23:23:56 2006
@@ -26,7 +26,7 @@
$db = new db();

function alert_moderators ($db, $id, $title, $start, $end, $description,
$city,
- $region, $locality, $url, $contact)
+ $region, $locality, $url, $contact, $submitter)
{
global $moderatorlist;

@@ -35,7 +35,7 @@
$mail_body = "Bonjour,\n\n" .
"Un nouvel �v�nement est � mod�rer sur\n" .
calendar_absolute_url("moderate.php#" . $id) . "\n\n".
format_ascii_event ($db, $title, $start, $end, $description, $city,
$region,
- $locality, $url, $contact) . "\n\n" .
+ $locality, $url, $contact, $submitter) . "\n\n" .
"Merci !\n" .
"-- Agenda du Libre";

@@ -44,7 +44,7 @@
return 0;
}

-function add_event ($db, $title, $start, $end, $description, $city, $region,
$locality, $url, $contact)
+function add_event ($db, $title, $start, $end, $description, $city, $region,
$locality, $url, $contact, $submitter)
{
$error_cnt = 0;

@@ -53,6 +53,7 @@
$city = stripslashes(strip_tags($city));
$url = stripslashes(strip_tags($url));
$contact = stripslashes(strip_tags($contact));
+ $submitter = stripslashes(strip_tags($submitter));

if (! $description)
{
@@ -107,17 +108,21 @@
return -1;
}

+ if (! $submitter)
+ $submitter = $contact;
+
/* Checks are done, add to database */
- $sql = "INSERT INTO events
(title,description,start_time,end_time,city,region,locality,url,contact,moderated)
values (" .
- $db->quote_smart($title) . "," .
- $db->quote_smart($description) . "," .
- $db->quote_smart(date_timestamp2mysql ($start)) . "," .
- $db->quote_smart(date_timestamp2mysql ($end)) . "," .
- $db->quote_smart($city) . "," .
- $db->quote_smart($region) . "," .
- $db->quote_smart($locality) . "," .
- $db->quote_smart($url) . "," .
- $db->quote_smart($contact) . "," .
+ $sql = "INSERT INTO events
(title,description,start_time,end_time,city,region,locality,url,contact,submitter,moderated)
values (" .
+ $db->quote_smart($title) . "," .
+ $db->quote_smart($description) . "," .
+ $db->quote_smart(date_timestamp2mysql ($start)) . "," .
+ $db->quote_smart(date_timestamp2mysql ($end)) . "," .
+ $db->quote_smart($city) . "," .
+ $db->quote_smart($region) . "," .
+ $db->quote_smart($locality) . "," .
+ $db->quote_smart($url) . "," .
+ $db->quote_smart($contact) . "," .
+ $db->quote_smart($submitter) . "," .
"'0')";

$ret = $db->query ($sql);
@@ -129,7 +134,7 @@
}

alert_moderators ($db, $db->insertid(), $title, $start, $end,
$description, $city,
- $region, $locality, $url, $contact);
+ $region, $locality, $url, $contact, $submitter);

echo "<p><b>Votre �v�nement a bien �t� ajout� � la liste des �v�nements en
attente de mod�ration. Il appara�tra en ligne d�s qu'un mod�rateur l'aura
valid�.</b></p>";

@@ -176,7 +181,8 @@
$_POST['__event_region'],
$_POST['__event_locality'],
$_POST['__event_url'],
- $_POST['__event_contact']);
+ $_POST['__event_contact'],
+ $_POST['__event_submitter']);

if ($ret == 0)
{
@@ -200,7 +206,8 @@
$_POST['__event_region'],
$_POST['__event_locality'],
$_POST['__event_url'],
- $_POST['__event_contact']);
+ $_POST['__event_contact'],
+ $_POST['__event_submitter']);
echo "<hr/>";
}
}
@@ -216,7 +223,8 @@
$_POST['__event_region'],
$_POST['__event_locality'],
$_POST['__event_url'],
- $_POST['__event_contact']);
+ $_POST['__event_contact'],
+ $_POST['__event_submitter']);
echo "<hr/>";
}

@@ -304,6 +312,7 @@
$_POST['__event_locality'],
$_POST['__event_url'],
$_POST['__event_contact'],
+ $_POST['__event_submitter'],
TRUE);

echo "</form>\n";

Modified: trunk/testevent.php
==============================================================================
--- trunk/testevent.php (original)
+++ trunk/testevent.php Mon Sep 18 23:23:56 2006
@@ -87,7 +87,8 @@
$_POST['__event_region'],
$_POST['__event_locality'],
$_POST['__event_url'],
- $_POST['__event_contact']);
+ $_POST['__event_contact'],
+ $_POST['__event_submitter']);

put_footer();





  • [Devel] r188 - trunk, svn, 18/09/2006

Archives gérées par MHonArc 2.6.16.

Haut de le page