* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: deces_promo.php,v 1.5 2004-10-31 16:39:04 x2000chevalier Exp $
+ $Id: deces_promo.php,v 1.6 2004-11-04 20:19:36 x2000habouzit Exp $
***************************************************************************/
require("auto.prepend.inc.php");
$page->assign('promo',$promo);
if (isset($_REQUEST["valider"]) && $_REQUEST["valider"] == "Valider") {
- $res = $globals->db->query("SELECT matricule FROM auth_user_md5 WHERE promo = $promo");
- while (list($mat) = mysql_fetch_row($res)) {
- $globals->db->query("UPDATE auth_user_md5 SET deces='".$_REQUEST[$mat]."' WHERE matricule = '".$mat."'");
+ $res = $globals->db->query("SELECT user_id,matricule,deces FROM auth_user_md5 WHERE promo = $promo");
+ while (list($uid,$mat,$deces) = mysql_fetch_row($res)) {
+ if($_REQUEST[$mat] == $deces) continue;
+ $globals->db->query("UPDATE auth_user_md5 SET deces='".$_REQUEST[$mat]."' WHERE matricule = '".$mat."'");
+ if($deces=='0000-00-00' or empty($deces)) {
+ require_once('notifs.inc.php');
+ register_watch_op($uid,'death');
+ }
}
}
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: step4.php,v 1.7 2004-11-03 15:55:23 x2000habouzit Exp $
+ $Id: step4.php,v 1.8 2004-11-04 20:19:36 x2000habouzit Exp $
***************************************************************************/
require("auto.prepend.inc.php");
// insérer l'inscription dans la table des inscriptions confirmé
$globals->db->query("INSERT INTO ins_confirmees SET id=$uid");
+ require_once('notifs.inc.php');
+ register_watch_op($uid,'ins');
// insérer une ligne dans user_changes pour que les coordonnées complè
// soient envoyées a l'
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: profil.php,v 1.10 2004-09-04 21:04:25 x2000habouzit Exp $
+ $Id: profil.php,v 1.11 2004-11-04 20:19:35 x2000habouzit Exp $
***************************************************************************/
require("auto.prepend.inc.php");
if ($web_public) $bits_reply .= 'web_public,';
if ($libre_public) $bits_reply .= 'libre_public,';
if (!empty($bits_reply)) $bits_reply = substr($bits_reply, 0, -1);
- $sql = "UPDATE auth_user_md5 set bits = '$bits_reply'";
- // si on est en suid on ne met pas à jour la date
- if(isset($_SESSION['suid'])) {
- $sql = $sql." WHERE user_id={$_SESSION['uid']}";
- } else {
+ $sql = "UPDATE auth_user_md5 set bits = '$bits_reply' WHERE user_id={$_SESSION['uid']}";
+ $globals->db->query($sql);
+
+ if(empty($_SESSION['suid'])) {
$sql = $sql.",date='$date' WHERE user_id={$_SESSION['uid']}";
+ require_once('notifs.inc.php');
+ register_watch_op($this->uid,'fiche');
}
- $globals->db->query($sql);
// mise a jour des champs relatifs au tab ouvert
require_once("profil/update_{$opened_tab}.inc.php");
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: notifs.inc.php,v 1.1 2004-11-04 19:57:43 x2000habouzit Exp $
+ $Id: notifs.inc.php,v 1.2 2004-11-04 20:19:36 x2000habouzit Exp $
***************************************************************************/
require_once('diogenes.flagset.inc.php');
-
+
+function register_watch_op($uid, $type) {
+ global $globals;
+ if(in_array($type, Array('fiche','death','photo','ins'))) {
+ $globals->db->query("REPLACE INTO watch_ops (user_id,op) VALUES('$uid','$type')");
+ }
+ if($type == 'fiche') {
+ $globals->db->query("UPDATE auth_user_md5 SET DATE=NOW() WHERE user_id='$uid'");
+ }
+}
+
class Notifs {
var $uid;
var $flags;
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: valid_photos.inc.php,v 1.13 2004-11-02 08:10:55 x2000habouzit Exp $
+ $Id: valid_photos.inc.php,v 1.14 2004-11-04 20:19:36 x2000habouzit Exp $
***************************************************************************/
$globals->db->query("REPLACE INTO photo set uid='".$this->uid."', attachmime = '".$this->mimetype."', attach='"
.addslashes($this->data)."', x='".$this->x."', y='".$this->y."'");
- $globals->db->query("UPDATE auth_user_md5 SET date=NOW() WHERE user_id='{$this->uid}'");
+ require('notifs.inc.php');
+ register_watch_op($this->uid,'fiche');
}
}
create table watch_ops (
user_id smallint not null,
- op enum('fiche','death','photo','ins') not null,
+ op enum('fiche','death','ins') not null,
primary key (user_id,op)
);
* Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************
- $Id: deces_promo.tpl,v 1.5 2004-08-31 11:25:39 x2000habouzit Exp $
+ $Id: deces_promo.tpl,v 1.6 2004-11-04 20:19:37 x2000habouzit Exp $
***************************************************************************}
-<form action="{$smarty.server.PHP_SELF}" method="post">
-<table class="tinybicol">
- <tr>
- <td><input type="submit" value="<<" name="sub10" /></td>
- <td><input type="submit" value="<" name="sub01" /></td>
- <td>
- Promotion :
{dynamic}
- <input type="text" name="promo" value="{$promo}" size="4" maxlength="4" />
-{/dynamic}
- <input type="submit" value="GO" />
- </td>
- <td><input type="submit" value=">" name="add01" /></td>
- <td><input type="submit" value=">>" name="add10" /></td>
- </tr>
-</table>
+
+<form action="{$smarty.server.PHP_SELF}" method="get">
+ <table class="tinybicol">
+ <tr>
+ <td><input type="submit" value="<<" name="sub10" /></td>
+ <td><input type="submit" value="<" name="sub01" /></td>
+ <td>
+ Promotion :
+ <input type="text" name="promo" value="{$promo}" size="4" maxlength="4" />
+ <input type="submit" value="GO" />
+ </td>
+ <td><input type="submit" value=">" name="add01" /></td>
+ <td><input type="submit" value=">>" name="add10" /></td>
+ </tr>
+ </table>
</form>
-<form action="{$smarty.server.PHP_SELF}" method="post">
-<table class="bicol" summary="liste des dates de décès">
- <tr>
- <th>Nom</th>
- <th>Date de décès</th>
- </tr>
-{dynamic}
-{foreach item=x from=$decedes}
- <tr class="{cycle values="impair,pair"}">
- <td>{$x.nom} {$x.prenom}</td>
- <td class="center">
- <input type="text" name="{$x.matricule}" value="{$x.deces}" size="10" maxlength="10" />
- </td>
- </tr>
-{/foreach}
-{/dynamic}
- <tr>
- <td class="center" colspan="2">
- <input type="hidden" name="promo" value="{$promo}" />
- <input type="submit" name="valider" value="Valider" />
- </td>
- </tr>
-</table>
+<form action="{$smarty.server.REQUEST_URI}" method="post">
+ <table class="bicol" summary="liste des dates de décès">
+ <tr>
+ <th>Nom</th>
+ <th>Date de décès</th>
+ </tr>
+ {foreach item=x from=$decedes}
+ <tr class="{cycle values="impair,pair"}">
+ <td>{$x.nom} {$x.prenom}</td>
+ <td class="center">
+ <input type="text" name="{$x.matricule}" value="{$x.deces}" size="10" maxlength="10" />
+ </td>
+ </tr>
+ {/foreach}
+ <tr>
+ <td class="center" colspan="2">
+ <input type="hidden" name="promo" value="{$promo}" />
+ <input type="submit" name="valider" value="Valider" />
+ </td>
+ </tr>
+ </table>
</form>
-
+
+{/dynamic}
+
{* vim:set et sw=2 sts=2 sws=2: *}