[Devel] r346 - trunk

svn at agendadulibre.org svn at agendadulibre.org
Mer 9 Juil 23:34:45 CEST 2008


Author: thomas
Date: Wed Jul  9 23:28:53 2008
New Revision: 346

Log:
Sauvegarde de la date/heure à laquelle un évènement est soumis et de
la date/heure à laquelle un évènement est validé. Pour l'instant, ça
ne sert à rien, mais ça pourra être utile pour faire quelques
statistiques.



Modified:
   trunk/UPGRADE
   trunk/submit.php
   trunk/validateevent.php

Modified: trunk/UPGRADE
==============================================================================
--- trunk/UPGRADE	(original)
+++ trunk/UPGRADE	Wed Jul  9 23:28:53 2008
@@ -28,3 +28,14 @@
 that, use the following SQL commands:
 
  ALTER TABLE events ADD secret VARCHAR(255) NOT NULL DEFAULT ''
+
+Revisions lower than 345
+========================
+
+If you have an installation of the Agenda du Libre software of
+revision lower than 345 and you want to upgrade to a more recent
+version, then you must change the database schema. In order to do
+that, use the following SQL commands:
+
+ alter table events add decision_time datetime not null default '0000-00-00 00:00:00';
+ alter table events add submission_time datetime not null default '0000-00-00 00:00:00';

Modified: trunk/submit.php
==============================================================================
--- trunk/submit.php	(original)
+++ trunk/submit.php	Wed Jul  9 23:28:53 2008
@@ -163,7 +163,7 @@
     $submitter = $contact;
 
   /* Checks are done, add to database */
-  $sql = "INSERT INTO events (title,description,start_time,end_time,city,region,locality,url,contact,submitter,tags,moderated,secret) values (" .
+  $sql = "INSERT INTO events (title,description,start_time,end_time,city,region,locality,url,contact,submitter,tags,moderated,secret,submission_time) values (" .
     $db->quote_smart($title)                        . "," .
     $db->quote_smart($description)                  . "," .
     $db->quote_smart(date_timestamp2mysql ($start)) . "," .
@@ -176,7 +176,8 @@
     $db->quote_smart($submitter)                    . "," .
     $db->quote_smart($tags)                         . "," .
     "'0'"                                           . "," .
-    "'" . md5(uniqid(rand(), true)) . "'"                 .
+    "'" . md5(uniqid(rand(), true)) . "'"           . "," .
+    "NOW()"                                               .
     ")";
 
   $ret = $db->query ($sql);

Modified: trunk/validateevent.php
==============================================================================
--- trunk/validateevent.php	(original)
+++ trunk/validateevent.php	Wed Jul  9 23:28:53 2008
@@ -53,7 +53,7 @@
   $link = calendar_absolute_url("showevent.php?id=".$id);
 
   /* Accept event */
-  $sql = "update events set moderated=1 where id=" . $db->quote_smart($id);
+  $sql = "update events set moderated=1, decision_time=NOW() where id=" . $db->quote_smart($id);
   $ret = $db->query ($sql);
   if ($ret == FALSE)
     {


Plus d'informations sur la liste de diffusion Devel