- elseif ($short_name && !$infos['short_name']) {
- // if we have a first new short_name create the lists
- //
- $globals->xdb->execute("INSERT INTO virtual SET type = 'evt', alias = {?}",
- $short_name."-participants@".$globals->xnet->evts_domain);
-
- $res = $globals->xdb->query("SELECT LAST_INSERT_ID()");
- $globals->xdb->execute("INSERT INTO virtual_redirect (
- SELECT {?} AS vid, IF(u.nom IS NULL, m.email, CONCAT(a.alias, {?})) AS redirect
- FROM groupex.evenements_participants AS ep
- LEFT JOIN groupex.membres AS m ON (ep.uid = m.uid)
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = ep.uid)
- LEFT JOIN aliases AS a ON (a.id = ep.uid AND a.type = 'a_vie')
- WHERE ep.eid = {?}
- GROUP BY ep.uid)",
- $res->fetchOneCell(), "@".$globals->mail->domain, $eid);
-
- $globals->xdb->execute("INSERT INTO virtual SET type = 'evt', alias = {?}",
- $short_name."-absents@".$globals->xnet->evts_domain);
-
- $res = $globals->xdb->query("SELECT LAST_INSERT_ID()");
- $globals->xdb->execute("INSERT INTO virtual_redirect (
- SELECT {?} AS vid, IF(u.nom IS NULL, m.email, CONCAT(a.alias, {?})) AS redirect
- FROM groupex.membres AS m
- LEFT JOIN groupex.evenements_participants AS ep ON (ep.uid = m.uid)
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = m.uid)
- LEFT JOIN aliases AS a ON (a.id = m.uid AND a.type = 'a_vie')
- WHERE m.asso_id = {?} AND ep.uid IS NULL
- GROUP BY m.uid)",
- $res->fetchOneCell(), "@".$globals->mail->domain, $globals->asso('id'));
+ $evt = array(
+ 'eid' => $eid,
+ 'asso_id' => $globals->asso('id'),
+ 'paiement_id' => Post::v('paiement_id') > 0 ? Post::v('paiement_id') : null,
+ 'debut' => Post::v('deb_Year').'-'.Post::v('deb_Month')
+ .'-'.Post::v('deb_Day').' '.Post::v('deb_Hour')
+ .':'.Post::v('deb_Minute').':00',
+ 'fin' => Post::v('fin_Year').'-'.Post::v('fin_Month')
+ .'-'.Post::v('fin_Day').' '.Post::v('fin_Hour')
+ .':'.Post::v('fin_Minute').':00',
+ 'short_name' => $short_name,
+ );
+
+ $trivial = array('intitule', 'descriptif', 'noinvite',
+ 'show_participants', 'accept_nonmembre', 'organisateur_uid');
+ foreach ($trivial as $k) {
+ $evt[$k] = Post::v($k);