From 24bcf50c5f36f0770e2f7c279e7cd1077a4acead Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Tue, 7 Nov 2006 15:09:25 +0000 Subject: [PATCH] Add a announce system on X.net It is connected with X.org announces (NL and front page events). git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1057 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 1 + include/rss.inc.php | 8 +- include/xnet/page.inc.php | 1 + modules/xnetgrp.php | 232 ++++++++++++++++++++++++++++++- templates/xnet/groupe/announce-admin.tpl | 50 +++++++ templates/xnet/groupe/announce-edit.tpl | 188 +++++++++++++++++++++++++ templates/xnet/groupe/announce-rss.tpl | 46 ++++++ templates/xnet/groupe/asso.tpl | 51 ++++++- templates/xnet/groupe/form.announce.tpl | 70 ++++++++++ templates/xnet/skin.tpl | 6 +- templates/xnetlists/index.tpl | 2 +- upgrade/0.9.12/01_xnet.sql | 23 +++ 12 files changed, 668 insertions(+), 10 deletions(-) create mode 100644 templates/xnet/groupe/announce-admin.tpl create mode 100644 templates/xnet/groupe/announce-edit.tpl create mode 100644 templates/xnet/groupe/announce-rss.tpl create mode 100644 templates/xnet/groupe/form.announce.tpl diff --git a/ChangeLog b/ChangeLog index f4b7de1..6a99003 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ New: * Xnet: - Add a vcard of all the members of a group -FRU + - Add a full announce system -FRU * Xnet/Events: - Events can be archived -FRU diff --git a/include/rss.inc.php b/include/rss.inc.php index 5bfcffa..42ffb49 100644 --- a/include/rss.inc.php +++ b/include/rss.inc.php @@ -37,7 +37,7 @@ function to_rss ($s) } } -function init_rss($template, $alias, $hash) +function init_rss($template, $alias, $hash, $require_uid = true) { global $page; $page->changeTpl($template, NO_SKIN); @@ -52,7 +52,11 @@ function init_rss($template, $alias, $hash) $uid = $res->fetchOneCell(); if (empty($uid)) { - exit; + if ($require_uid) { + exit; + } else { + $uid = null; + } } header('Content-Type: application/rss+xml; charset=utf8'); diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php index e41a0e0..56a382f 100644 --- a/include/xnet/page.inc.php +++ b/include/xnet/page.inc.php @@ -100,6 +100,7 @@ class XnetPage extends PlatalPage if (S::logged() && may_update()) { $sub = array(); $sub['modifier l\'accueil'] = "$dim/edit"; + $sub['gérer les annonces'] = "$dim/admin/announces"; if ($globals->asso('mail_domain')) { $sub['envoyer un mail'] = "$dim/mail"; $sub['créer une liste'] = "$dim/lists/create"; diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index de80da7..4c624b7 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -84,23 +84,86 @@ class XnetGrpModule extends PLModule => $this->make_hook('admin_member_new', AUTH_MDP), '%grp/member/del' => $this->make_hook('admin_member_del', AUTH_MDP), + + '%grp/rss' => $this->make_hook('rss', AUTH_PUBLIC), + '%grp/announce/new' => $this->make_hook('edit_announce', AUTH_MDP), + '%grp/announce/edit' => $this->make_hook('edit_announce', AUTH_MDP), + '%grp/admin/announces' => $this->make_hook('admin_announce', AUTH_MDP), ); } function handler_index(&$page, $arg = null) { - global $globals; + global $globals, $platal; if (!is_null($arg)) { return PL_NOT_FOUND; } $page->changeTpl('xnet/groupe/asso.tpl'); - $page->useMenu(); $page->setType($globals->asso('cat')); + $page->assign('is_admin', may_update()); $page->assign('is_member', is_member()); $page->assign('logged', S::logged()); + if (S::logged()) { + if (Env::has('read')) { + XDB::query('DELETE r.* + FROM groupex.announces_read AS r + INNER JOIN groupex.announces AS a ON a.id = r.announce_id + WHERE peremption < CURRENT_DATE()'); + XDB::query('INSERT INTO groupex.announces_read + VALUES ({?}, {?})', + Env::i('read'), S::i('uid')); + pl_redirect(""); + } + if (Env::has('unread')) { + XDB::query('DELETE FROM groupex.announces_read + WHERE announce_id={?} AND user_id={?}', + Env::i('unread'), S::i('uid')); + pl_redirect("#art" . Env::i('unread')); + } + $arts = XDB::iterator("SELECT a.*, u.nom, u.prenom, u.promo, l.alias AS forlife + FROM groupex.announces AS a + INNER JOIN auth_user_md5 AS u USING(user_id) + INNER JOIN aliases AS l ON (u.user_id = l.id AND l.type = 'a_vie') + LEFT JOIN groupex.announces_read AS r ON (r.user_id = {?} AND r.announce_id = a.id) + WHERE asso_id = {?} AND peremption >= CURRENT_DATE() + AND (promo_min = 0 OR promo_min <= {?}) + AND (promo_max = 0 OR promo_max >= {?}) + AND r.announce_id IS NULL + ORDER BY a.peremption", + S::i('uid'), $globals->asso('id'), S::i('promo'), S::i('promo')); + $index = XDB::iterator("SELECT a.id, a.titre, r.user_id IS NULL AS nonlu + FROM groupex.announces AS a + LEFT JOIN groupex.announces_read AS r ON (a.id = r.announce_id AND r.user_id = {?}) + WHERE asso_id = {?} AND peremption >= CURRENT_DATE() + AND (promo_min = 0 OR promo_min <= {?}) + AND (promo_max = 0 OR promo_max >= {?}) + ORDER BY a.peremption", + S::i('uid'), $globals->asso('id'), S::i('promo'), S::i('promo')); + $page->assign('article_index', $index); + } else { + $arts = XDB::iterator("SELECT a.*, u.nom, u.prenom, u.promo + FROM groupex.announces AS a + INNER JOIN auth_user_md5 AS u USING(user_id) + WHERE asso_id = {?} AND peremption >= CURRENT_DATE() + AND FIND_IN_SET(u.flags, 'public')", + $globals->asso('id')); + } + + if (!S::has('core_rss_hash')) { + $page->setRssLink("Polytechnique.net :: {$globals->asso("nom")} :: News publiques", + "rss/rss.xml"); + } else { + $page->setRssLink("Polytechnique.net :: {$globals->asso("nom")} :: News", + 'rss/'.S::v('forlife') .'/'.S::v('core_rss_hash').'/rss.xml'); + } + + require_once('url_catcher.inc.php'); + $page->register_modifier('url_catcher', 'url_catcher'); + $page->assign('articles', $arts); + $page->assign('asso', $globals->asso()); } @@ -109,8 +172,8 @@ class XnetGrpModule extends PLModule global $globals; $res = XDB::query("SELECT logo, logo_mime - FROM groupex.asso WHERE id = {?}", - $globals->asso('id')); + FROM groupex.asso WHERE id = {?}", + $globals->asso('id')); list($logo, $logo_mime) = $res->fetchOneRow(); if (!empty($logo)) { @@ -346,7 +409,6 @@ class XnetGrpModule extends PLModule $page->changeTpl('xnet/groupe/inscrire.tpl'); - $page->useMenu(); $page->setType($globals->asso('cat')); $page->assign('asso', $globals->asso()); $page->assign('admin', may_update()); @@ -777,6 +839,166 @@ class XnetGrpModule extends PLModule $user['email'], '%@'.$globals->asso('mail_domain')); $page->assign('alias', $res->fetchAllAssoc()); } + + function handler_rss(&$page, $user = null, $hash = null) + { + global $globals; + require_once('rss.inc.php'); + require_once('url_catcher.inc.php'); + $uid = init_rss('xnet/groupe/announce-rss.tpl', $user, $hash, false); + $page->register_modifier('url_catcher', 'url_catcher'); + + if ($uid) { + $rss = XDB::iterator("SELECT a.id, a.titre, a.texte, a.contacts, a.create_date, + IF(u2.nom_usage != '', u2.nom_usage, u2.nom) AS nom, u2.prenom, u2.promo + FROM auth_user_md5 AS u + INNER JOIN groupex.announces AS a ON ( (a.promo_min = 0 OR a.promo_min <= u.promo) + AND (a.promo_max = 0 OR a.promo_max <= u.promo)) + INNER JOIN auth_user_md5 AS u2 ON (u2.user_id = a.user_id) + WHERE u.user_id = {?} AND peremption >= NOW()", $uid); + } else { + $rss = XDB::iterator("SELECT a.id, a.titre, a.texte, a.create_date, + IF(u.nom_usage != '', u.nom_usage, u.nom) AS nom, u.prenom, u.promo + FROM groupex.announces AS a + INNER JOIN auth_user_md5 AS u USING(user_id) + WHERE FIND_IN_SET(a.flags, 'public') AND peremption >= NOW()"); + } + $page->assign('asso', $globals->asso()); + $page->assign('rss', $rss); + } + + function handler_edit_announce(&$page, $aid = null) + { + global $globals, $platal; + new_groupadmin_page('xnet/groupe/announce-edit.tpl'); + $page->assign('new', is_null($aid)); + $art = array(); + + if (Post::v('valid') == 'Visualiser' || Post::v('valid') == 'Enregistrer') { + if (!is_null($aid)) { + $art['id'] = $aid; + } + $art['titre'] = Post::v('titre'); + $art['texte'] = Post::v('texte'); + $art['contacts'] = Post::v('contacts'); + $art['promo_min'] = Post::i('promo_min'); + $art['promo_max'] = Post::i('promo_max'); + $art['nom'] = S::v('nom'); + $art['prenom'] = S::v('prenom'); + $art['promo'] = S::v('promo'); + $art['forlife'] = S::v('forlife'); + $art['peremption'] = Post::v('peremption'); + $art['public'] = Post::has('public'); + $art['xorg'] = Post::has('xorg'); + $art['nl'] = Post::has('nl'); + $art['event'] = Post::v('event'); + + $art['contact_html'] = $art['contacts']; + if (@$art['event']) { + $art['contact_html'] .= "\n{$globals->baseurl}/{$platal->ns}events/sub/{$art['event']}"; + } + } + + if (Post::v('valid') == 'Enregistrer') { + if (is_null($aid)) { + XDB::query("INSERT INTO groupex.announces + (user_id, asso_id, create_date, titre, texte, contacts, + peremption, promo_min, promo_max, flags) + VALUES ({?}, {?}, NOW(), {?}, {?}, {?}, {?}, {?}, {?}, {?})", + S::i('uid'), $globals->asso('id'), $art['titre'], $art['texte'], $art['contact_html'], + $art['peremption'], $art['promo_min'], $art['promo_max'], $art['public'] ? 'public' : ''); + $aid = mysql_insert_id(); + if ($art['xorg']) { + require_once('validations.inc.php'); + require_once('url_catcher.inc.php'); + $article = new EvtReq($art['titre'], + url_catcher($art['texte'] . (!empty($art['contacts']) ? "\n\nContacts :\n" . $art['contacts'] : "")), + $art['promo_min'], $art['promo_max'], $art['peremption'], "", S::v('uid')); + $article->submit(); + $page->trig("L'affichage sur la page d'accueil de Polytechnique.org est en attente de validation"); + } + if ($art['nl']) { + require_once('validations.inc.php'); + $article = new NLReq(S::v('uid'), $art['titre'], $art['texte'], $art['contact_html']); + $article->submit(); + $page->trig("La parution dans la Lettre Mensuelle est en attente de validation"); + } + } else { + XDB::query("UPDATE groupex.announces + SET titre={?}, texte={?}, contacts={?}, peremption={?}, + promo_min={?}, promo_max={?}, flags={?} + WHERE id={?} AND asso_id={?}", + $art['titre'], $art['texte'], $art['contacts'], $art['peremption'], + $art['promo_min'], $art['promo_max'], $art['public'] ? 'public' : '', + $art['id'], $globals->asso('id')); + } + pl_redirect(""); + } + + if (empty($art) && !is_null($aid)) { + $res = XDB::query("SELECT a.*, u.nom, u.prenom, u.promo, l.alias AS forlife, + FIND_IN_SET(a.flags, 'public') AS public + FROM groupex.announces AS a + INNER JOIN auth_user_md5 AS u USING(user_id) + INNER JOIN aliases AS l ON (l.id = u.user_id AND l.type = 'a_vie') + WHERE asso_id = {?} AND a.id = {?}", + $globals->asso('id'), $aid); + if ($res->numRows()) { + $art = $res->fetchOneAssoc(); + $art['contact_html'] = $art['contacts']; + } else { + $page->kill("Aucun article correspond à l'identifiant indiqué"); + } + } + + $select = ''; + for ($i = 1 ; $i < 30 ; $i++) { + $time = time() + 3600 * 24 * $i; + $p_stamp = date('Ymd', $time); + $year = date('Y', $time); + $month = date('m', $time); + $day = date('d', $time); + + $select .= "\n"; + } + $page->assign('select', $select); + + if (is_null($aid)) { + $events = XDB::iterator("SELECT * + FROM groupex.evenements + WHERE asso_id = {?} AND archive = 0", + $globals->asso('id')); + if ($events->total()) { + $page->assign('events', $events); + } + } + + require_once('url_catcher.inc.php'); + $art['contact_html'] = url_catcher($art['contact_html']); + $page->assign('art', $art); + } + + function handler_admin_announce(&$page) + { + global $globals; + new_groupadmin_page('xnet/groupe/announce-admin.tpl'); + + if (Env::has('del')) { + XDB::execute("DELETE FROM groupex.announces + WHERE id = {?} AND asso_id = {?}", + Env::i('del'), $globals->asso('id')); + } + $res = XDB::iterator("SELECT a.id, a.titre, a.peremption, a.peremption < CURRENT_DATE() AS perime + FROM groupex.announces AS a + WHERE a.asso_id = {?} + ORDER BY a.peremption DESC", + $globals->asso('id')); + $page->assign('articles', $res); + } } ?> diff --git a/templates/xnet/groupe/announce-admin.tpl b/templates/xnet/groupe/announce-admin.tpl new file mode 100644 index 0000000..45ae5f8 --- /dev/null +++ b/templates/xnet/groupe/announce-admin.tpl @@ -0,0 +1,50 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +

{$asso.nom} : Administration des announces

+ + + + + + + + {iterate item=art from=$articles} + + + + + + {/iterate} + + + +
TitrePéremption
{$art.titre}{$art.peremption|date_format} + Supprimer l'annonce {icon name=cross} + +
+ + {icon name=add title="Nouvelle annonce"} Ecrire une nouvelle annonce + +
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/groupe/announce-edit.tpl b/templates/xnet/groupe/announce-edit.tpl new file mode 100644 index 0000000..927b3d6 --- /dev/null +++ b/templates/xnet/groupe/announce-edit.tpl @@ -0,0 +1,188 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + +

{$asso.nom} : Edition d'une annonce

+ +{if $art.texte} +
+{include file="xnet/groupe/form.announce.tpl" admin=true} +
+
+{/if} + +
+
+ + + + + + + + + + + + + + + + + + + + + + +
Editer une annonce
Titre :
Contenu de l'annonce : + + Le contenu est destiné à recevoir la descriptioin de ce qui est annoncé. + Il faut éviter d'y mettre des adresses mails ou web (surtout si l'annonce est publique), + qui devront être placées dans la section "contacts". + +
+ +
+ + + Essaie de faire un texte court, une annonce ne doit pas excéder 600 caractères soit une dizaine de ligne. + Tu en es déjà à caractères. + Si tu veux proposer cette annonce pour la Lettre Mensuelle, il faut te limiter à 8 lignes. + +
Contacts : + + La section "contacts" sert à noter les informations telles que les adresses mails de contact, les sites web. + Elle n'est accessible qu'aux personnes authentifiées. Si l'annonce est attachée à une événement, un lien vers + la page d'inscription est automatiquement ajouté. + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + {if $events} + + + + + {/if} + + + + + {if $new} + + + + + + + + + + + + + {/if} +
Promotions cibles
Promotion minimale : + + incluse* (ex : 1980) +
Promotion minimale : + + incluse* (ex : 2000) +
+ * 0 signifie qu'il n'y a pas de limite +
Options
Date de péremption : + +
Attacher à un événement : + +
Visibilité : + + Rendre cette annonce publique +
Demandes de publication
+ + sur la page d'accueil de Polytechnique.org +
+ + dans la Lettre Mensuelle de Polytechnique.org +
+ Les demandes de publication sont soumises à validation par l'équipe + de Polytechnique.org +
+ +
+ {if $art.id} + + {/if} +
+ {if $art.texte} + + {if !$new} + + {/if} + {/if} +
+
+
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/groupe/announce-rss.tpl b/templates/xnet/groupe/announce-rss.tpl new file mode 100644 index 0000000..c4353d5 --- /dev/null +++ b/templates/xnet/groupe/announce-rss.tpl @@ -0,0 +1,46 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + + + + + Polytechnique.net :: {$asso.nom} :: News + fr + {#globals.baseurl#}/{$asso.diminutif}/ + L'actualite polytechnicienne... + + {#globals.core.sitename#} + {#globals.baseurl#}/images/logo.png + {#globals.baseurl#}/{$asso.diminutif}/ + + {iterate item=line from=$rss} + + {$line.titre|strip_tags} + {#globals.baseurl#}/{$asso.diminutif}/#art{$line.id} +
Contacts :
{$line.contacts|url_catcher|nl2br}{/if}]]>
+ {$line.prenom} {$line.nom} (X{$line.promo}) + {$line.creation_date|rss_date} +
+ {/iterate} +
+
+{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/groupe/asso.tpl b/templates/xnet/groupe/asso.tpl index f144b0d..7ba1550 100644 --- a/templates/xnet/groupe/asso.tpl +++ b/templates/xnet/groupe/asso.tpl @@ -81,8 +81,57 @@
-
+
{$asso.descr|smarty:nodefaults}
+
+ +{if $articles->total()} +
+{iterate item=art from=$articles} +{include file="xnet/groupe/form.announce.tpl"} +
+{/iterate} +
+{/if} + +{if $article_index && $article_index->total()} + + + + + {iterate item=art from=$article_index} + + + + {/iterate} +
+ {if $smarty.session.core_rss_hash} + + {icon name=feed title='fil rss'} + + {else} + + {icon name=feed_add title='Activer mon fil rss'} + + {/if} + Sommaire des annonces du groupe +
• + {if $art.nonlu} + + {else} + + {/if} + {tidy}{$art.titre}{/tidy} + {if !$art.nonlu}{/if} +
+{/if} + +{if $is_admin} + +{/if} + {* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/groupe/form.announce.tpl b/templates/xnet/groupe/form.announce.tpl new file mode 100644 index 0000000..d1bb90a --- /dev/null +++ b/templates/xnet/groupe/form.announce.tpl @@ -0,0 +1,70 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2006 Polytechnique.org *} +{* http://opensource.polytechnique.org/ *} +{* *} +{* This program is free software; you can redistribute it and/or modify *} +{* it under the terms of the GNU General Public License as published by *} +{* the Free Software Foundation; either version 2 of the License, or *} +{* (at your option) any later version. *} +{* *} +{* This program is distributed in the hope that it will be useful, *} +{* but WITHOUT ANY WARRANTY; without even the implied warranty of *} +{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *} +{* GNU General Public License for more details. *} +{* *} +{* You should have received a copy of the GNU General Public License *} +{* along with this program; if not, write to the Free Software *} +{* Foundation, Inc., *} +{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *} +{* *} +{**************************************************************************} + + + + + + + + + {if ($logged || $admin) && $art.contacts} + + + + + + + {/if} + + + +
+ {if $logged && !$admin} + + {/if} + {tidy} + {if $admin}Aperçu de : {/if}{$art.titre} + {/tidy} +
+ {tidy} + {$art.texte|nl2br} + {/tidy} +
Contacts :
+ {tidy} + {$art.contacts|url_catcher|nl2br|smarty:nodefaults} + {/tidy} +
+ + Annonce proposée par + + {$art.prenom} {$art.nom} (X{$art.promo}) + + +
+ +{* vim:set et sw=2 sts=2 sws=2: *} diff --git a/templates/xnet/skin.tpl b/templates/xnet/skin.tpl index 61d4401..a5aa901 100644 --- a/templates/xnet/skin.tpl +++ b/templates/xnet/skin.tpl @@ -46,7 +46,11 @@ {/foreach} - + + {if $xorg_rss} + + {/if} + {if $xorg_extra_header} {$xorg_extra_header|smarty:nodefaults} {/if} diff --git a/templates/xnetlists/index.tpl b/templates/xnetlists/index.tpl index e8bc6bc..eaf7cbc 100644 --- a/templates/xnetlists/index.tpl +++ b/templates/xnetlists/index.tpl @@ -88,7 +88,7 @@ croix verte te permet de t'inscrire, apr {foreachelse} - Pas de listes pour ce groupe + Pas de listes pour ce groupe {/foreach} diff --git a/upgrade/0.9.12/01_xnet.sql b/upgrade/0.9.12/01_xnet.sql index 62cf075..28fd09d 100644 --- a/upgrade/0.9.12/01_xnet.sql +++ b/upgrade/0.9.12/01_xnet.sql @@ -1,4 +1,27 @@ use groupex; alter table evenements add column accept_nonmembre tinyint(1) not null default 0; alter table evenements add column archive tinyint(1) not null default 0; + +create table announces ( + id smallint(4) unsigned not null auto_increment, + user_id smallint(4) unsigned not null default 0, + asso_id smallint(4) unsigned not null default 0, + create_date timestamp(14) default null, + titre varchar(255) not null, + texte mediumtext not null, + contacts mediumtext not null, + peremption date not null default '0000-00-00', + promo_min smallint(4) unsigned not null default 0, + promo_max smallint(4) unsigned not null default 0, + flags set('public') not null default '', + + primary key (id) +); + +create table announces_read ( + announce_id smallint(4) unsigned not null default 0, + user_id smallint(4) unsigned not null default 0, + primary key (announce_id, user_id) +); + use x4dat; -- 2.1.4