1 | <?php |
---|
2 | /***************************************************************************\ |
---|
3 | * Associaspip, extension de SPIP pour gestion d'associations * |
---|
4 | * * |
---|
5 | * Copyright (c) 2007 Bernard Blazin & François de Montlivault (V1) * |
---|
6 | * Copyright (c) 2010-2011 Emmanuel Saint-James & Jeannot Lapin (V2) * |
---|
7 | * * |
---|
8 | * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * |
---|
9 | * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * |
---|
10 | \***************************************************************************/ |
---|
11 | |
---|
12 | |
---|
13 | if (!defined("_ECRIRE_INC_VERSION")) return; |
---|
14 | |
---|
15 | include_spip('inc/presentation'); |
---|
16 | include_spip ('inc/navigation_modules'); |
---|
17 | |
---|
18 | function exec_association() { |
---|
19 | |
---|
20 | include_spip('inc/autoriser'); |
---|
21 | if (!autoriser('associer')) { |
---|
22 | include_spip('inc/minipres'); |
---|
23 | echo minipres(); |
---|
24 | } else { |
---|
25 | $commencer_page = charger_fonction('commencer_page', 'inc'); |
---|
26 | echo $commencer_page(_T('asso:association')) ; |
---|
27 | |
---|
28 | association_onglets(); |
---|
29 | |
---|
30 | echo debut_gauche("",true); |
---|
31 | echo debut_boite_info(true); |
---|
32 | echo propre(_T('asso:info_doc')); |
---|
33 | echo fin_boite_info(true); |
---|
34 | |
---|
35 | $res=association_icone(_T('asso:profil_de_lassociation'), '?exec=configurer_association', 'assoc_qui.png'); |
---|
36 | $res.=association_icone(_T('asso:categories_de_cotisations'), generer_url_ecrire("categories"), 'cotisation.png', ''); |
---|
37 | $res.=association_icone(_T('asso:plan_comptable'), generer_url_ecrire("plan"), 'plan_compte.png', ''); |
---|
38 | if ($GLOBALS['association_metas']['destinations']=="on") $res.=association_icone(_T('asso:destination_comptable'), generer_url_ecrire("destination"), 'plan_compte.png', ''); |
---|
39 | |
---|
40 | echo bloc_des_raccourcis($res); |
---|
41 | echo debut_droite("",true); |
---|
42 | echo debut_cadre_formulaire("",true); |
---|
43 | # echo gros_titre(_T('asso:votre_asso'),'',false); |
---|
44 | # echo "<br />\n"; |
---|
45 | echo '<strong>'.$GLOBALS['association_metas']['nom'].'</strong><br/>'; |
---|
46 | echo $GLOBALS['association_metas']['rue']."<br />\n"; |
---|
47 | echo $GLOBALS['association_metas']['cp'].' '; |
---|
48 | echo $GLOBALS['association_metas']['ville']."<br />\n"; |
---|
49 | echo $GLOBALS['association_metas']['telephone']."<br />\n"; |
---|
50 | echo $GLOBALS['association_metas']['email']."<br />\n"; |
---|
51 | echo $GLOBALS['association_metas']['siret']."<br />\n"; |
---|
52 | echo $GLOBALS['association_metas']['declaration']."<br />\n"; |
---|
53 | echo $GLOBALS['association_metas']['prefet']."<br />\n"; |
---|
54 | echo fin_cadre_formulaire(true); |
---|
55 | |
---|
56 | /* Provisoirement supprimé en attendant 1.9.3*/ |
---|
57 | |
---|
58 | echo '<br />'; |
---|
59 | echo gros_titre(_T('asso:votre_equipe'),'',false); |
---|
60 | echo '<br />'; |
---|
61 | |
---|
62 | echo debut_cadre_relief('', true); |
---|
63 | |
---|
64 | echo "<table border='0' cellpadding='2' cellspacing='0' width='100%' class='arial2' style='border: 1px solid #aaaaaa;'>\n"; |
---|
65 | echo "<tr style='background-color: #DBE1C5;'>\n"; |
---|
66 | echo '<th>' . _T('asso:nom') . "</th>\n"; |
---|
67 | echo '<th>' . _T('asso:fonction') . "</th>\n"; |
---|
68 | echo '<th>' . _T('asso:portable') . "</th>\n"; |
---|
69 | echo '<th>' . _T('asso:telephone') . ' / ' . _T('asso:email') . "</th>\n"; |
---|
70 | echo '</tr>'; |
---|
71 | $query = sql_select("a.id_auteur, a.mobile, a.telephone, a.statut_interne, a.fonction, b.email, a.nom_famille, a.prenom, a.sexe",'spip_asso_membres' . " a INNER JOIN spip_auteurs AS b ON a.id_auteur=b.id_auteur", "a.fonction !='' AND a.statut_interne != 'sorti'", '', "a.nom_famille"); |
---|
72 | while ($data = sql_fetch($query)) { |
---|
73 | $id_auteur=$data['id_auteur']; |
---|
74 | $nom_affiche = association_calculer_nom_membre($data['sexe'], $data['prenom'], $data['nom_famille']); |
---|
75 | $mob = print_tel($data['mobile']); |
---|
76 | $tel = print_tel($data['telephone']); |
---|
77 | if ($email = $data['email']) |
---|
78 | $tel = "<a href='mailto:$email' title='" |
---|
79 | . _L('Ecrire à') . ' ' . $email . "'>" |
---|
80 | . ($tel ? $tel : 'mail') |
---|
81 | . '</a>'; |
---|
82 | $auteur = generer_url_ecrire('auteur_infos',"id_auteur=$id_auteur"); |
---|
83 | $adh = generer_url_ecrire('voir_adherent',"id=$id_auteur"); |
---|
84 | echo "\n<tr style='background-color: #EEEEEE;'>\n"; |
---|
85 | |
---|
86 | echo "<td class='arial11 border1'>", |
---|
87 | "<a href='$auteur' title=\"", |
---|
88 | _T('lien_voir_auteur'), |
---|
89 | '">', |
---|
90 | htmlspecialchars($nom_affiche), |
---|
91 | "</a></td>\n"; |
---|
92 | |
---|
93 | echo "<td class='arial11 border1'>", |
---|
94 | "<a href='$adh' title=\"", |
---|
95 | _T('asso:adherent_label_voir_membre'), |
---|
96 | "\">", |
---|
97 | htmlspecialchars($data['fonction']), |
---|
98 | "</a></td>\n"; |
---|
99 | |
---|
100 | echo '<td class="arial1 border1">'.$mob.'</td>'; |
---|
101 | echo '<td class="arial1 border1" style="text-align:center">'.$tel.'</td>'; |
---|
102 | echo "</tr>\n"; |
---|
103 | } |
---|
104 | echo '</table>'; |
---|
105 | |
---|
106 | echo fin_cadre_relief(true); |
---|
107 | echo fin_page_association(); |
---|
108 | |
---|
109 | //Petite routine pour mettre à jour les statuts de cotisation "échu" |
---|
110 | sql_updateq('spip_asso_membres', |
---|
111 | array("statut_interne"=> 'echu'), |
---|
112 | "statut_interne = 'ok' AND validite < CURRENT_DATE() "); |
---|
113 | } |
---|
114 | } |
---|
115 | |
---|
116 | function print_tel($n) |
---|
117 | { |
---|
118 | $n = preg_replace('/\D/', '', $n); |
---|
119 | if (!intval($n)) return ''; |
---|
120 | return preg_replace('/(\d\d)/', '\1 ', $n); |
---|
121 | } |
---|
122 | |
---|
123 | ?> |
---|