projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add tests for UFC_EducationField
[platal.git]
/
include
/
notifs.inc.php
diff --git
a/include/notifs.inc.php
b/include/notifs.inc.php
index
dae7b78
..
fd952cb
100644
(file)
--- a/
include/notifs.inc.php
+++ b/
include/notifs.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-20
09
Polytechnique.org *
+ * Copyright (C) 2003-20
10
Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-35,7
+35,7
@@
abstract class WatchOperation
public function getCondition(PlUser &$user, $date)
{
$this->date = $date;
public function getCondition(PlUser &$user, $date)
{
$this->date = $date;
- if (!$user->watch($this->flag)) {
+ if (!$user->watch
Type
($this->flag)) {
return new PFC_False();
} else {
return $this->buildCondition($user);
return new PFC_False();
} else {
return $this->buildCondition($user);
@@
-69,14
+69,14
@@
class WatchProfileUpdate extends WatchOperation
public static function register(Profile &$profile, $field)
{
public static function register(Profile &$profile, $field)
{
- XDB::execute('REPLACE INTO watch_profile (
u
id, ts, field)
+ XDB::execute('REPLACE INTO watch_profile (
p
id, ts, field)
VALUES ({?}, NOW(), {?})',
$profile->id(), $field);
}
protected function buildCondition(PlUser &$user)
{
VALUES ({?}, NOW(), {?})',
$profile->id(), $field);
}
protected function buildCondition(PlUser &$user)
{
- return new
U
FC_And(new UFC_ProfileUpdated('>', $this->date),
+ return new
P
FC_And(new UFC_ProfileUpdated('>', $this->date),
new UFC_WatchContact($user));
}
new UFC_WatchContact($user));
}
@@
-109,11
+109,11
@@
class WatchProfileUpdate extends WatchOperation
'photo' => 'Sa photographie');
public function getData(PlUser &$user)
{
'photo' => 'Sa photographie');
public function getData(PlUser &$user)
{
- $data = XDB::fetchColumn(
'
SELECT field
+ $data = XDB::fetchColumn(
"
SELECT field
FROM watch_profile
FROM watch_profile
- WHERE
uid = {?} AND ts > FROM_UNIXTIME({?}) AND field != \'\
'
- ORDER BY ts
'
,
- $user->id(), $this->date);
+ WHERE
pid = {?} AND ts > FROM_UNIXTIME({?}) AND field != '
'
+ ORDER BY ts
"
,
+ $user->
profile()->
id(), $this->date);
if (count($data) == 0) {
return null;
} else {
if (count($data) == 0) {
return null;
} else {
@@
-252,12
+252,13
@@
class Watch
{
$obj = new $class();
$uf = new UserFilter($obj->getCondition($user, $date),
{
$obj = new $class();
$uf = new UserFilter($obj->getCondition($user, $date),
- array($obj->getOrder(), new UFO_Name(
UserFilter
::DN_SORT)));
+ array($obj->getOrder(), new UFO_Name(
Profile
::DN_SORT)));
$users = $uf->getUsers();
if (count($users) == 0) {
return null;
} else {
$users = $uf->getUsers();
if (count($users) == 0) {
return null;
} else {
- return array('operation' => $obj,
+ return array('type' => $obj->flag,
+ 'operation' => $obj,
'title' => $obj->getTitle(count($users)),
'users' => $users);
}
'title' => $obj->getTitle(count($users)),
'users' => $users);
}