projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updates implementation of User class to handle fields 'gender' and 'email_format'.
[platal.git]
/
modules
/
profile
/
decos.inc.php
diff --git
a/modules/profile/decos.inc.php
b/modules/profile/decos.inc.php
index
ebd8f12
..
df97147
100644
(file)
--- a/
modules/profile/decos.inc.php
+++ b/
modules/profile/decos.inc.php
@@
-1,6
+1,6
@@
<?php
/***************************************************************************
<?php
/***************************************************************************
- * Copyright (C) 2003-200
7
Polytechnique.org *
+ * Copyright (C) 2003-200
8
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 *
@@
-33,7
+33,7
@@
class ProfileDeco implements ProfileSetting
S::i('uid'));
$value = array();
while (list($id, $grade) = $res->next()) {
S::i('uid'));
$value = array();
while (list($id, $grade) = $res->next()) {
- $value[$id] = array('grade' => $grade,
+ $value[$id] = array('grade' => $grade,
'valid' => '1');
}
'valid' => '1');
}
@@
-92,21
+92,20
@@
class ProfileDecos extends ProfilePage
parent::__construct($wiz);
$this->settings['medals'] = new ProfileDeco();
$this->settings['medals_pub'] = new ProfilePub();
parent::__construct($wiz);
$this->settings['medals'] = new ProfileDeco();
$this->settings['medals_pub'] = new ProfilePub();
+ $this->watched['medals'] = true;
}
}
- protected function fetchData()
+ protected function
_
fetchData()
{
$res = XDB::query("SELECT profile_medals_pub
FROM auth_user_quick
WHERE user_id = {?}",
S::i('uid'));
$this->values['medals_pub'] = $res->fetchOneCell();
{
$res = XDB::query("SELECT profile_medals_pub
FROM auth_user_quick
WHERE user_id = {?}",
S::i('uid'));
$this->values['medals_pub'] = $res->fetchOneCell();
- parent::fetchData();
}
}
- protected function saveData()
+ protected function
_
saveData()
{
{
- parent::saveData();
if ($this->changed['medals_pub']) {
XDB::execute("UPDATE auth_user_quick
SET profile_medals_pub = {?}
if ($this->changed['medals_pub']) {
XDB::execute("UPDATE auth_user_quick
SET profile_medals_pub = {?}
@@
-115,18
+114,8
@@
class ProfileDecos extends ProfilePage
}
}
}
}
- public function
prepare(PlatalPage &$page
)
+ public function
_prepare(PlPage &$page, $id
)
{
{
- parent::prepare($page);
- $res = XDB::iterator("SELECT *
- FROM profile_medals_grades
- ORDER BY mid, pos");
- $grades = array();
- while ($tmp = $res->next()) {
- $grades[$tmp['mid']][] = $tmp;
- }
- $page->assign('grades', $grades);
-
$res = XDB::iterator("SELECT *, FIND_IN_SET('validation', flags) AS validate
FROM profile_medals
ORDER BY type, text");
$res = XDB::iterator("SELECT *, FIND_IN_SET('validation', flags) AS validate
FROM profile_medals
ORDER BY type, text");
@@
-135,7
+124,6
@@
class ProfileDecos extends ProfilePage
$mlist[$tmp['type']][] = $tmp;
}
$page->assign('medal_list', $mlist);
$mlist[$tmp['type']][] = $tmp;
}
$page->assign('medal_list', $mlist);
-
$trad = Array('ordre' => 'Ordres',
'croix' => 'Croix',
'militaire' => 'Médailles militaires',
$trad = Array('ordre' => 'Ordres',
'croix' => 'Croix',
'militaire' => 'Médailles militaires',