Overview
Comment: | Corrections et vérifications à l'ajout de cotisation |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
4c4c3db24daa72cdea0515eaca340996 |
User & Date: | bohwaz on 2014-04-07 16:26:19 |
Other Links: | manifest | tags |
Context
2014-04-10
| ||
17:50 | rc2 check-in: 1bb750bae9 user: bohwaz tags: trunk | |
2014-04-07
| ||
16:26 | Corrections et vérifications à l'ajout de cotisation check-in: 4c4c3db24d user: bohwaz tags: trunk | |
16:09 | Correction export des membres check-in: b46f155397 user: bohwaz tags: trunk | |
Changes
Modified src/include/class.cotisations_membres.php from [f2efd7acab] to [1e76b69c3c].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | - + | <?php namespace Garradin; class Cotisations_Membres { const ITEMS_PER_PAGE = 100; /** * Vérification des champs fournis pour la modification de donnée * @param array $data Tableau contenant les champs à ajouter/modifier * @return void */ |
︙ | |||
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - - - - + - + - + | if (empty($data['id_membre']) || !$db->simpleQuerySingle('SELECT 1 FROM membres WHERE id = ?;', false, (int) $data['id_membre'])) { throw new UserException('Membre inconnu ou invalide.'); } $data['id_membre'] = (int) $data['id_membre']; if ($compta) { if (!isset($data['moyen_paiement']) || trim($data['moyen_paiement']) === '') { throw new UserException('Moyen de paiement inconnu ou invalide.'); } if ($data['moyen_paiement'] != 'ES') { if (trim($data['banque']) == '') { throw new UserException('Le compte bancaire choisi est invalide.'); } if (!$db->simpleQuerySingle('SELECT 1 FROM compta_comptes_bancaires WHERE id = ?;', false, $data['banque'])) { throw new UserException('Le compte bancaire choisi n\'existe pas.'); } } } } /** * Enregistrer un événement de cotisation * @param array $data Tableau des champs à insérer * @return integer ID de l'événement créé */ public function add($data) { $db = DB::getInstance(); $co = $db->simpleQuerySingle('SELECT * FROM cotisations WHERE id = ?;', true, (int)$data['id_cotisation']); |
︙ | |||
139 140 141 142 143 144 145 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | - - - - - - - - - - - + - - - - - - - - - - - | if (!isset($data['montant']) || !is_numeric($data['montant']) || (float)$data['montant'] < 0) { throw new UserException('Le montant doit être un nombre positif et valide.'); } $data['montant'] = (float) $data['montant']; |
︙ |
Modified src/templates/admin/membres/cotisations/ajout.tpl from [4ac3bc61b8] to [ef40dcb0a6].
︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | - - - - - - + + + + + | {csrf_field key="add_cotisation"} {if $membre}<input type="hidden" name="id_membre" value="{$membre.id|escape}" />{/if} <input type="submit" name="add" value="Enregistrer →" /> </p> </form> <script type="text/javascript"> |
Modified src/www/admin/membres/cotisations/ajout.php from [47528a9ba2] to [a67846c779].
︙ | |||
44 45 46 47 48 49 50 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - - + - - - - - - - + + + + + - | else { try { $data = [ 'date' => utils::post('date'), 'id_cotisation' => utils::post('id_cotisation'), 'id_membre' => utils::post('id_membre'), |
︙ |