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 | include_spip('inc/presentation'); |
---|
14 | include_spip ('inc/navigation_modules'); |
---|
15 | |
---|
16 | function exec_edit_plan(){ |
---|
17 | |
---|
18 | include_spip('inc/autoriser'); |
---|
19 | if (!autoriser('associer', 'comptes')) { |
---|
20 | include_spip('inc/minipres'); |
---|
21 | echo minipres(); |
---|
22 | } else { |
---|
23 | |
---|
24 | $url_asso = generer_url_ecrire('association'); |
---|
25 | $url_plan = generer_url_ecrire('plan'); |
---|
26 | $url_action_plan=generer_url_ecrire('action_plan'); |
---|
27 | |
---|
28 | $id_plan= intval(_request('id')); |
---|
29 | |
---|
30 | $commencer_page = charger_fonction('commencer_page', 'inc'); |
---|
31 | echo $commencer_page(_T('asso:edition_plan_comptable')) ; |
---|
32 | association_onglets(); |
---|
33 | echo debut_gauche("",true); |
---|
34 | echo debut_boite_info(true); |
---|
35 | echo association_date_du_jour(); |
---|
36 | echo fin_boite_info(true); |
---|
37 | echo association_retour(); |
---|
38 | echo debut_droite("",true); |
---|
39 | |
---|
40 | debut_cadre_relief( "", false, "", $titre = _T('asso:edition_plan_comptable')); |
---|
41 | |
---|
42 | $data = !$id_plan ? '' : sql_fetsel("*", "spip_asso_plan", "id_plan=$id_plan"); |
---|
43 | if ($data) { |
---|
44 | $code=$data['code']; |
---|
45 | $classe=$data['classe']; |
---|
46 | $intitule=$data['intitule']; |
---|
47 | $reference=$data['reference']; |
---|
48 | $actif=$data['actif']; |
---|
49 | $commentaire=$data["commentaire"]; |
---|
50 | $solde_anterieur=$data['solde_anterieur']; |
---|
51 | $date_anterieure=$data['date_anterieure']; |
---|
52 | $action = 'modifier'; |
---|
53 | } else { |
---|
54 | $code=$classe=$intitule=$reference=$actif=$commentaire=$solde_anterieur=''; |
---|
55 | $date_anterieure= date('Y-m-d'); |
---|
56 | $action = 'ajouter'; |
---|
57 | } |
---|
58 | $checked = ($actif=="oui" || $action=="ajouter"); |
---|
59 | |
---|
60 | $res = '<label for="code"><strong>' . _T('asso:code') . '</strong></label>' |
---|
61 | . '<input name="code" type="text" value="' |
---|
62 | . $code |
---|
63 | . '" id="code" class="formo" />' |
---|
64 | . '<label for="classe"><strong>' . _T('asso:classe') . ' :</strong></label>' |
---|
65 | . '<input name="classe" type="text" value="' |
---|
66 | . $classe |
---|
67 | . '" id="classe" class="formo" />' |
---|
68 | . '<label for="intitule"><strong>' . _T('asso:intitule') . ' ;</strong></label>' |
---|
69 | . '<input name="intitule" type="text" value="' |
---|
70 | . $intitule |
---|
71 | . '" id="intitule" class="formo" />' |
---|
72 | . '<label for="reference"><strong>' . _T('asso:reference') . ' :</strong></label>' |
---|
73 | . '<input name="reference" type="text" value="' |
---|
74 | . $reference |
---|
75 | . '" id="reference" class="formo" />' |
---|
76 | . '<label for="solde_anterieur"><strong>' . _T('asso:solde_reporte_en_euros') . '</strong></label>' |
---|
77 | . '<input name="solde_anterieur" type="text" value="' |
---|
78 | . $solde_anterieur |
---|
79 | . '" id="solde_anterieur" class="formo" />' |
---|
80 | . '<label for="date_anterieure"><strong>' . _T('asso:date_report_aaa_mm_jj') . '</strong></label>' |
---|
81 | . '<input name="date_anterieure" type="text" value="' |
---|
82 | . $date_anterieure |
---|
83 | . '" id="date_anterieure" class="formo" />' |
---|
84 | . '<label for="actif"><strong>' . _T('asso:compte_active') . '</strong></label>' |
---|
85 | . '<input name="actif" type="radio" value="oui" id="actif"'; |
---|
86 | if ($checked) {$res .= ' checked="checked"';} |
---|
87 | $res .= ' />'._T('asso:plan_libelle_oui') |
---|
88 | . '<input name="actif" type="radio" value="non"'; |
---|
89 | if (!$checked) {$res .= ' checked="checked"';} |
---|
90 | $res .= ' />'._T('asso:plan_libelle_non') |
---|
91 | . '<br /><label for="commentaire"><strong>' . _T('asso:commentaires') . ' :</strong></label>' |
---|
92 | . '<textarea name="commentaire" id="commentaire" class="formo" rows="4" cols="80">' |
---|
93 | . $commentaire |
---|
94 | . "</textarea>\n" |
---|
95 | . '<div style="float:right;">' |
---|
96 | . '<input type="submit" value="' |
---|
97 | . _T('asso:bouton_envoyer') |
---|
98 | . '" class="fondo" /></div>'; |
---|
99 | |
---|
100 | echo redirige_action_post($action . '_plans' , $id_plan, 'plan', "", "<div>$res</div>"); |
---|
101 | |
---|
102 | fin_cadre_relief(); |
---|
103 | echo fin_page_association(); |
---|
104 | } |
---|
105 | } |
---|
106 | ?> |
---|