<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2011 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
// Base class for a reminder; it offers the factory for creating valid reminders
// tailored for a given user, as well as base methods for reminder impls.
// Sub-classes should define at least the abstract methods, and the static
-// IsCandidate method (prototype: (User &$user)).
+// IsCandidate method (prototype: (User $user)).
//
// Usage:
// // Instantiates and returns a valid Reminder object for the user.
// Constructs the Reminder object from a mandatory User instance, a list of
// key-value pairs from the `reminder_type` and `reminder` tables.
- function __construct(User &$user, array $type)
+ function __construct(User $user, array $type)
{
$this->user = &$user;
private static function UpdateStatus($uid, $type_id, $status, $next_ask)
{
XDB::execute('INSERT INTO reminder (uid, type_id, status, remind_last, remind_next)
- VALUES ({?}, {?}, {?}, {?}, {?})
- ON DUPLICATE KEY UPDATE status = VALUES(status), remind_last = NOW(), remind_next = VALUES(remind_next)',
+ VALUES ({?}, {?}, {?}, NOW(), {?})
+ ON DUPLICATE KEY UPDATE status = VALUES(status), remind_last = VALUES(remind_last), remind_next = VALUES(remind_next)',
$uid, $type_id, $status,
($next_ask > 0 ? time() + $next_ask * 24 * 60 * 60 : null));
}
// Displays a reduced version of the reminder and notifies that the action
// has been taken into account.
- public function NotifiesAction(&$page)
+ public function NotifiesAction($page)
{
pl_content_headers("text/html");
$page->changeTpl('reminder/notification.tpl', NO_SKIN);
// Displays the reminder as a standalone html snippet. It should be used
// when the reminder is the only output of a page.
- public function DisplayStandalone(&$page, $previous_reminder = null)
+ public function DisplayStandalone($page, $previous_reminder = null)
{
pl_content_headers("text/html");
$page->changeTpl('reminder/base.tpl', NO_SKIN);
}
// Prepares the display by assigning template variables.
- public function Prepare(&$page)
+ public function Prepare($page)
{
$page->assign_by_ref('reminder', $this);
}
// Static factories -------------------------------------------------------
// Returns a chosen class using the user data from |user|, and from the database.
- public static function GetCandidateReminder(User &$user)
+ public static function GetCandidateReminder(User $user)
{
$res = XDB::query('SELECT rt.*, r.status, r.remind_last
FROM reminder_type AS rt
// Returns an instantiation of the reminder class which name is |name|, using
// user data from |user|, and from the database.
- public static function GetByName(User &$user, $name)
+ public static function GetByName(User $user, $name)
{
if (!($class = self::GetClassName($name))) {
return null;