Phone class: new class to access profile_phones.
[platal.git] / include / reminder.inc.php
index bc1334b..715d2d5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -69,12 +69,12 @@ abstract class Reminder
     // Updates (or creates) the reminder line for the pair (|user|, |reminder_id|)
     // using the |status| as status, and the |next_ask| as the delay between now
     // and the next ask (if any).
-    private static function UpdateStatus($user_id, $type_id, $status, $next_ask)
+    private static function UpdateStatus($uid, $type_id, $status, $next_ask)
     {
         XDB::execute('REPLACE INTO  reminder
                                SET  uid = {?}, type_id = {?}, status = {?},
                                     remind_last = NOW(), remind_next = FROM_UNIXTIME({?})',
-                     $user_id, $type_id, $status,
+                     $uid, $type_id, $status,
                      ($next_ask > 0 ? time() + $next_ask * 24 * 60 * 60 : null));
     }
 
@@ -105,7 +105,7 @@ abstract class Reminder
     // has been taken into account.
     public function NotifiesAction(&$page)
     {
-        header('Content-Type: text/html; charset=utf-8');
+        pl_content_headers("text/html");
         $page->changeTpl('reminder/notification.tpl', NO_SKIN);
         $page->assign('previous_reminder', $this->title());
     }
@@ -114,7 +114,7 @@ abstract class Reminder
     // when the reminder is the only output of a page.
     public function DisplayStandalone(&$page, $previous_reminder = null)
     {
-        header('Content-Type: text/html; charset=utf-8');
+        pl_content_headers("text/html");
         $page->changeTpl('reminder/base.tpl', NO_SKIN);
         $this->Prepare($page);
         if ($previous_reminder) {
@@ -148,14 +148,17 @@ abstract class Reminder
         return 'ajax/reminder/' . $this->name;
     }
 
+    // Returns the url for the information page.
+    public function info() { return ''; }
+
     // Static status update methods -------------------------------------------
 
-    // Marks the candidate reminder as having been accepted for user |user_id|.
+    // Marks the candidate reminder as having been accepted for user |uid|.
     // It is intended to be used when a reminder box has been bypassed, and when
     // it should behave as if the user had clicked on 'yes'.
-    protected static function MarkCandidateAsAccepted($user_id, $candidate)
+    protected static function MarkCandidateAsAccepted($uid, $candidate)
     {
-        Reminder::UpdateStatus($user_id, $candidate['type_id'],
+        Reminder::UpdateStatus($uid, $candidate['type_id'],
                                'yes', $candidate['remind_delay_yes']);
     }