X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=www%2Fplugins%2Fagenda_3_5%2Fagenda_administrations.php;fp=www%2Fplugins%2Fagenda_3_5%2Fagenda_administrations.php;h=c40462a7c268f1fa76b34be00baea3b38c996650;hb=6fc965ae42a0a1843dd0f0f6f2af0289dc475b7f;hp=0000000000000000000000000000000000000000;hpb=f3f5eb6827d60b23f80ac46527708b1644476dd2;p=ptitvelo%2Fweb%2Fwww.git diff --git a/www/plugins/agenda_3_5/agenda_administrations.php b/www/plugins/agenda_3_5/agenda_administrations.php new file mode 100644 index 0000000..c40462a --- /dev/null +++ b/www/plugins/agenda_3_5/agenda_administrations.php @@ -0,0 +1,103 @@ +"concat(tables_liees,'evenements,')"), "evenements='oui'"), + array('sql_alter',"TABLE spip_groupes_mots DROP evenements"), + ); + + $maj['0.20'] = array( + array('sql_alter',"TABLE spip_rubriques ADD agenda tinyint(1) DEFAULT 0 NOT NULL"), + ); + + $maj['0.21'] = array( + array('sql_alter',"TABLE spip_evenements ADD adresse text NOT NULL"), + array('sql_alter',"TABLE spip_evenements ADD inscription text NOT NULL"), + array('sql_alter',"TABLE spip_evenements ADD places text NOT NULL"), + ); + + $maj['0.22'] = array( + array('maj_tables',array('spip_evenements_participants')), + ); + + $maj['0.23'] = array( + array('sql_alter',"TABLE spip_evenements CHANGE titre titre text NOT NULL DEFAULT ''"), + array('sql_alter',"TABLE spip_evenements CHANGE descriptif descriptif text NOT NULL DEFAULT ''"), + array('sql_alter',"TABLE spip_evenements CHANGE lieu lieu text NOT NULL DEFAULT ''"), + array('sql_alter',"TABLE spip_evenements CHANGE adresse adresse text NOT NULL DEFAULT ''"), + ); + include_spip('maj/svn10000'); + $maj['0.24.0'] = array( + array('maj_liens','mot','evenement'), + array('sql_drop_table',"spip_mots_evenements"), + array('sql_alter',"TABLE spip_evenements ADD statut varchar(10) DEFAULT 0 NOT NULL"), + ); + $maj['0.25.0'] = array( + array('upgrade_evenements_statut_025'), + ); + + include_spip('base/upgrade'); + maj_plugin($nom_meta_base_version, $version_cible, $maj); +} + +function agenda_vider_tables($nom_meta_base_version) { + sql_drop_table("spip_evenements"); + #sql_drop_table("spip_mots_evenements"); // au cas ou ? + sql_alter("TABLE spip_rubriques DROP COLUMN agenda"); + effacer_meta($nom_meta_base_version); +} + +function upgrade_evenements_articles_012(){ + $res = sql_select("*", "spip_evenements_articles"); + while ($row = sql_fetch($res)){ + $id_article = $row['id_article']; + $id_evenement = $row['id_evenement']; + sql_update("spip_evenements", array('id_article'=>$id_article),'id_evenement='.intval($id_evenement)); + } +} + +function upgrade_evenements_statut_025(){ + include_spip('action/editer_evenement'); + $res = sql_select('id_evenement','spip_evenements',"statut='0'"); + while ($row = sql_fetch($res)){ + evenement_modifier($row['id_evenement'],array()); + } +} + +?>