/_plugins_/Associaspip/branches/v2.0/base/association.php

https://bitbucket.org/pombredanne/spip-zone-treemap · PHP · 244 lines · 204 code · 20 blank · 20 comment · 1 complexity · 1dbe81846eb10ff29ed60197cc95397d MD5 · raw file

  1. <?php
  2. /**
  3. * Plugin Association
  4. *
  5. * Copyright (c) 2007
  6. * Bernard Blazin & François de Montlivault
  7. * http://www.plugandspip.com
  8. * Ce programme est un logiciel libre distribue sous licence GNU/GPL.
  9. * Pour plus de details voir le fichier COPYING.txt.
  10. *
  11. **/
  12. if (!defined("_ECRIRE_INC_VERSION")) return;
  13. // Declaration des tables
  14. global $association_tables_principales;
  15. //-- Table CATEGORIES COTISATION ------------------------------------------
  16. $spip_asso_categories = array(
  17. "id_categorie" => "int(10) unsigned NOT NULL auto_increment",
  18. "valeur" => "tinytext NOT NULL",
  19. "libelle" => "text NOT NULL",
  20. "duree" => "text NOT NULL",
  21. "cotisation" => "float NOT NULL default '0'",
  22. "commentaires" => "text NOT NULL",
  23. "maj" => "timestamp(14) NOT NULL"
  24. );
  25. $spip_asso_categories_key = array(
  26. "PRIMARY KEY" => "id_categorie"
  27. );
  28. $association_tables_principales['spip_asso_categories'] = array(
  29. 'field' => &$spip_asso_categories,
  30. 'key' => &$spip_asso_categories_key
  31. );
  32. //-- Table DONS ------------------------------------------
  33. $spip_asso_dons = array(
  34. "id_don" => "bigint(21) NOT NULL auto_increment",
  35. "date_don" => "date NOT NULL default '0000-00-00'",
  36. "bienfaiteur" => "text NOT NULL",
  37. "id_adherent" => "int(11) NOT NULL",
  38. "argent" => "tinytext",
  39. "colis" => "text",
  40. "valeur" => "text NOT NULL",
  41. "contrepartie" => "tinytext",
  42. "commentaire" => "text",
  43. "maj" => "timestamp(14) NOT NULL"
  44. );
  45. $spip_asso_dons_key = array(
  46. "PRIMARY KEY" => "id_don"
  47. );
  48. $association_tables_principales['spip_asso_dons'] = array(
  49. 'field' => &$spip_asso_dons,
  50. 'key' => &$spip_asso_dons_key
  51. );
  52. //-- Table VENTES ------------------------------------------
  53. $spip_asso_ventes = array(
  54. "id_vente" => "BIGINT(21) AUTO_INCREMENT",
  55. "article" => "TINYTEXT NOT NULL",
  56. "code" => "TEXT NOT NULL",
  57. "acheteur" => "TINYTEXT NOT NULL",
  58. "id_acheteur" => "BIGINT(20) NOT NULL",
  59. "quantite" => "TINYTEXT NOT NULL",
  60. "date_vente" => "DATE NOT NULL DEFAULT '0000-00-00'",
  61. "date_envoi" => "DATE DEFAULT '0000-00-00'",
  62. "don" => "TINYTEXT",
  63. "prix_vente" => "TINYTEXT",
  64. "frais_envoi" => "float NOT NULL default '0'",
  65. "commentaire" => "TEXT",
  66. "maj" => "timestamp(14) NOT NULL"
  67. );
  68. $spip_asso_ventes_key = array(
  69. "PRIMARY KEY" => "id_vente"
  70. );
  71. $association_tables_principales['spip_asso_ventes'] = array(
  72. 'field' => &$spip_asso_ventes,
  73. 'key' => &$spip_asso_ventes_key
  74. );
  75. //-- Table COMPTES ------------------------------------------
  76. $spip_asso_comptes = array(
  77. "id_compte" => "bigint(21) NOT NULL auto_increment",
  78. "date" => "date default NULL",
  79. "recette" => "float NOT NULL default '0'",
  80. "depense" => "float NOT NULL default '0'",
  81. "justification" => "text",
  82. "imputation" => "text",
  83. "journal" => "tinytext",
  84. "id_journal" => "int(11) NOT NULL default '0'",
  85. "vu" => "boolean default 0",
  86. "maj" => "timestamp(14) NOT NULL"
  87. );
  88. $spip_asso_comptes_key = array(
  89. "PRIMARY KEY" => "id_compte"
  90. );
  91. $association_tables_principales['spip_asso_comptes'] = array(
  92. 'field' => &$spip_asso_comptes,
  93. 'key' => &$spip_asso_comptes_key
  94. );
  95. //-- Table PLAN COMPTABLE ------------------------------------------
  96. $spip_asso_plan = array(
  97. "id_plan" => "int(11) NOT NULL auto_increment",
  98. "code" => "text NOT NULL",
  99. "intitule" => "text NOT NULL",
  100. "classe" =>"text NOT NULL",
  101. "reference" => "text NOT NULL",
  102. "solde_anterieur" => "float NOT NULL default '0'",
  103. "date_anterieure" => "date NOT NULL default '0000-00-00'",
  104. "commentaire" => "text NOT NULL",
  105. "actif" => "text NOT NULL",
  106. "maj" => "timestamp(14) NOT NULL"
  107. );
  108. $spip_asso_plan_key = array(
  109. "PRIMARY KEY" => "id_plan"
  110. );
  111. $association_tables_principales['spip_asso_plan'] = array(
  112. 'field' => &$spip_asso_plan,
  113. 'key' => &$spip_asso_plan_key
  114. );
  115. //-- Table RESSOURCES ------------------------------------------
  116. $spip_asso_ressources = array(
  117. "id_ressource" => "bigint(20) NOT NULL auto_increment",
  118. "code" => "text NOT NULL",
  119. "intitule" => "text NOT NULL",
  120. "date_acquisition" => "date NOT NULL default '0000-00-00'",
  121. "id_achat" => "tinyint(4) NOT NULL default '0'",
  122. "pu" => "float NOT NULL default '0'",
  123. "statut" => "text NOT NULL",
  124. "commentaire" => "text NOT NULL",
  125. "maj" => "timestamp(14) NOT NULL"
  126. );
  127. $spip_asso_ressources_key = array(
  128. "PRIMARY KEY" => "id_ressource"
  129. );
  130. $association_tables_principales['spip_asso_ressources'] = array(
  131. 'field' => &$spip_asso_ressources,
  132. 'key' => &$spip_asso_ressources_key
  133. );
  134. //-- Table PRETS ------------------------------------------
  135. $spip_asso_prets = array(
  136. "id_pret" => "bigint(20) NOT NULL auto_increment",
  137. "id_ressource" => "varchar(20) NOT NULL",
  138. "date_sortie" => "date NOT NULL default '0000-00-00'",
  139. "duree" => "int(11) NOT NULL default '0'",
  140. "date_retour" => "date NOT NULL default '0000-00-00'",
  141. "id_emprunteur" => "text NOT NULL",
  142. "statut" => "text NOT NULL",
  143. "commentaire_sortie" => "text NOT NULL",
  144. "commentaire_retour" => "text NOT NULL",
  145. "maj" => "timestamp(14) NOT NULL"
  146. );
  147. $spip_asso_prets_key = array(
  148. "PRIMARY KEY" => "id_pret"
  149. );
  150. $association_tables_principales['spip_asso_prets'] = array(
  151. 'field' => &$spip_asso_prets,
  152. 'key' => &$spip_asso_prets_key
  153. );
  154. //-- Table ACTIVITES ------------------------------------------
  155. $spip_asso_activites = array(
  156. "id_activite" => "bigint(20) NOT NULL auto_increment",
  157. "id_evenement" => "bigint(20) NOT NULL",
  158. "nom" => "text NOT NULL",
  159. "id_adherent" => "bigint(20) NOT NULL",
  160. "membres" => "text NOT NULL",
  161. "non_membres" => "text NOT NULL",
  162. "inscrits" => "int(11) NOT NULL default '0'",
  163. "date" => "date NOT NULL default '0000-00-00'",
  164. "telephone" => "text NOT NULL",
  165. "adresse" => "text NOT NULL",
  166. "email" => "text NOT NULL",
  167. "commentaire" => "text NOT NULL",
  168. "montant" => "float NOT NULL default '0'",
  169. "date_paiement" => "date NOT NULL default '0000-00-00'",
  170. "statut" => "text NOT NULL",
  171. "maj" => "timestamp(14) NOT NULL"
  172. );
  173. $spip_asso_activites_key = array(
  174. "PRIMARY KEY" => "id_activite"
  175. );
  176. $association_tables_principales['spip_asso_activites'] = array(
  177. 'field' => &$spip_asso_activites,
  178. 'key' => &$spip_asso_activites_key
  179. );
  180. //
  181. $spip_asso_membres= array(
  182. "id_auteur" => "bigint(21) NOT NULL auto_increment",
  183. "id_asso" => "text NOT NULL",
  184. "nom_famille" => "text NOT NULL",
  185. "prenom" => "text NOT NULL",
  186. "sexe" => "tinytext NOT NULL",
  187. "fonction" => "text",
  188. "email" => "tinytext NOT NULL",
  189. "adresse" => "text NOT NULL",
  190. "code_postal" => "tinytext NOT NULL",
  191. "ville" => "text NOT NULL",
  192. "telephone" => "tinytext",
  193. "mobile" => "tinytext",
  194. "categorie" => "text NOT NULL",
  195. "statut_interne" => "text NOT NULL",
  196. "commentaire" => "text NOT NULL",
  197. "validite" => "date NOT NULL default '0000-00-00'"
  198. );
  199. $spip_asso_membres_key= array(
  200. "PRIMARY KEY" => "id_auteur"
  201. );
  202. $association_tables_principales['spip_asso_membres'] = array(
  203. 'field' => &$spip_asso_membres,
  204. 'key' => &$spip_asso_membres_key
  205. );
  206. global $association_tables_auxiliaires;
  207. $spip_asso_metas = array(
  208. "nom" => "VARCHAR (255) NOT NULL",
  209. "valeur" => "text DEFAULT ''",
  210. "impt" => "ENUM('non', 'oui') DEFAULT 'oui' NOT NULL",
  211. "maj" => "TIMESTAMP");
  212. $spip_asso_metas_key = array(
  213. "PRIMARY KEY" => "nom");
  214. $association_tables_auxiliaires['spip_association_metas'] = array(
  215. 'field' => &$spip_asso_metas,
  216. 'key' => &$spip_asso_metas_key
  217. );
  218. global $tables_principales;
  219. include_spip('base/serial');
  220. $tables_principales = array_merge($tables_principales, $association_tables_principales);
  221. global $tables_auxiliaires;
  222. include_spip('base/auxiliaires');
  223. $tables_auxiliaires = array_merge($tables_auxiliaires, $association_tables_auxiliaires);
  224. ?>