Rename tips to reminder_tips.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 14 Mar 2010 17:45:08 +0000 (18:45 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 14 Mar 2010 17:45:08 +0000 (18:45 +0100)
Also fix a few naming issues in the table (titre -> title, priorite ->
priority) and some SQL syntax error in 20_naming_convention.sql.

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
modules/events.php
templates/include/tips.tpl
upgrade/account/20_naming_convention.sql
upgrade/account/copy_tables.sh

index d333d0c..eebfa82 100644 (file)
@@ -64,11 +64,11 @@ class EventsModule extends PLModule
         do {
             $priority = (int)($priority/2);
             $res = XDB::query("SELECT  *
-                                 FROM  tips
+                                 FROM  reminder_tips
                                 WHERE  (expiration = '0000-00-00' OR expiration > CURDATE())
                                        AND (promo_min = 0 OR promo_min <= {?})
                                        AND (promo_max = 0 OR promo_max >= {?})
-                                       AND (priorite >= {?})
+                                       AND (priority >= {?})
                                        AND (state = 'active')
                                        $exclude
                              ORDER BY  RAND()
@@ -307,7 +307,7 @@ class EventsModule extends PLModule
     {
         $page->setTitle('Administration - Astuces');
         $page->assign('title', 'Gestion des Astuces');
-        $table_editor = new PLTableEditor('admin/tips', 'tips', 'id');
+        $table_editor = new PLTableEditor('admin/tips', 'reminder_tips', 'id');
         $table_editor->describe('expiration', 'date de pĂ©remption', true);
         $table_editor->describe('promo_min', 'promo. min (0 aucune)', false);
         $table_editor->describe('promo_max', 'promo. max (0 aucune)', false);
index f7bbd8e..2d4f5f3 100644 (file)
@@ -25,7 +25,7 @@
 <fieldset id="tod">
 {/if}
   <legend>{icon name=lightbulb} {if !$tips.special}
-    Astuce&nbsp;: {$tips.titre}
+    Astuce&nbsp;: {$tips.title}
     {if hasPerm('admin') && !$tips.special && !$nochange}
     <a href="admin/tips/edit/{$tips.id}">{icon name="page_edit" title="Editer"}</a>
     {/if}
index b245877..c5cf76c 100644 (file)
@@ -30,12 +30,16 @@ CHANGE COLUMN  user_id uid INT(11) not null;
 
 # announces
   ALTER TABLE  announces
-CHANGE COLUMN  user_id uid INT(11) not null;
+CHANGE COLUMN  user_id uid INT(11) not null,
 CHANGE COLUMN  peremption expiration DATE NOT NULL;
+
   ALTER TABLE  announce_read
 CHANGE COLUMN  user_id uid INT(11) not null;
-  ALTER TABLE  tips
-CHANGE COLUMN  peremption expiration DATE NOT NULL;
+
+  ALTER TABLE  reminder_tips
+CHANGE COLUMN  peremption expiration DATE NOT NULL,
+CHANGE COLUMN  titre title VARCHAR(64) NOT NULL,
+CHANGE COLUMN  priorite priority TINYINT(2) UNSIGNED NOT NULL DEFAULT 127;
 
 # profile
   ALTER TABLE  profile_photos
index 7df0a20..8c5abf5 100755 (executable)
@@ -93,7 +93,7 @@ copyTable '#x4dat#.search_autocomplete' 'search_autocomplete'
 copyTable '#x4dat#.search_name' 'search_name'
 
 copyTable '#x4dat#.skins' 'skins'
-copyTable '#x4dat#.tips' 'tips'
+copyTable '#x4dat#.tips' 'reminder_tips'
 
 copyTable '#x4dat#.survey_surveys' 'surveys'
 copyTable '#x4dat#.survey_answers' 'survey_answers'