Changes In Branch dev Through [400c8eb2df] Excluding Merge-Ins
This is equivalent to a diff from 73da92d6c9 to 400c8eb2df
2017-06-07
| ||
05:03 | Nouvelle version stable check-in: 51d79b2eee user: bohwaz tags: trunk, stable, 0.7.7 | |
2017-05-16
| ||
04:56 | Utilisation de KD2\Form pour le login check-in: a14a753be3 user: bohwaz tags: dev | |
2017-05-14
| ||
10:41 | Passage aux objets check-in: 400c8eb2df user: bohwaz tags: dev | |
2017-05-12
| ||
05:24 | Recette pour lancer un serveur de développement check-in: e8409c27d6 user: bohwaz tags: dev | |
2017-05-08
| ||
00:13 | Merge avec trunk check-in: 0e42b2b443 user: bohwaz tags: dev | |
00:12 | possibilité de créer des comptes directement à la racine d'une classe check-in: 73da92d6c9 user: bohwaz tags: trunk | |
2017-04-28
| ||
07:28 | Implémentation de l'utilisation d'un SMTP externe (optionnel) pour l'envoi de mails check-in: 2f39cf54bf user: bohwaz tags: trunk, stable | |
Added .travis.yml version [0926a200f2].
> > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | language: php php: - '5.4' - '5.5' - '5.6' - '7.0' - '7.1' - hhvm install: - make -C src deps script: - php tests/run.php notifications: irc: channels: - "chat.freenode.net#garradin" template: - "%{build_number} by %{author} on %{branch}: %{message} " - "Build details: %{build_url}" use_notice: false skip_join: true |
Modified src/.htaccess from [4336f57b39] to [2b3e1adfe6].
1 | <IfModule mod_alias.c> | > > > > | | | | | | | > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Désactiver le multiviews (conflit avec /admin/plugin.php) et les index (sécurité) Options -MultiViews -Indexes # Au cas où <IfModule mod_alias.c> RedirectMatch 403 /include/ RedirectMatch 403 /cache/ RedirectMatch 403 /plugins/ RedirectMatch 403 /templates/ RedirectMatch 403 /.*\.sqlite RedirectMatch 403 /.*\.log RedirectMatch 403 /(README|VERSION|COPYING) RedirectMatch 403 /config\.(.*)\.php </IfModule> # Redirection dynamique, pour les installations sans vhost dédié # Objectif: supprimer le /www/ de l'URL <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI}::$1 ^(.*?/)(.*)::\2$ RewriteRule ^(.*)$ - [E=BASE:%1] RewriteRule (.*) %{ENV:BASE}/www/$1 [QSA] </IfModule> |
Modified src/Makefile from [2766485477] to [aff0166871].
|
| | | | > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | KD2_BRANCH=dev deps: $(eval TMP_KD2=$(shell mktemp -d)) #cd ${TMP_KD2} wget --no-check-certificate https://fossil.kd2.org/kd2fw/zip/KD2+Framework-${KD2_BRANCH}.zip?uuid=${KD2_BRANCH} -O ${TMP_KD2}/kd2.zip unzip "${TMP_KD2}/kd2.zip" -d ${TMP_KD2} rm -rf "include/lib/KD2" mv "${TMP_KD2}/KD2 Framework-${KD2_BRANCH}/src/lib/kd2" "include/lib/KD2" rm -rf ${TMP_KD2} dev-server: php -S localhost:8082 -t www www/_route.php |
Modified src/VERSION from [62a409c97d] to [51107ddecc].
|
| | | 1 | 0.8.0 |
Modified src/config.dist.php from [c4a6b696de] to [21bbfcec16].
1 2 3 4 5 6 7 8 9 | <?php /** * Ce fichier représente un exemple des constantes de configuration * disponibles pour Garradin. * * NE PAS MODIFIER CE FICHIER! * * Pour configurer Garradin, copiez ce fichier en 'config.local.php' | | > > > > > > > > > > | > > | | < | > | < < | < < < < > | < < > > > | > > | < < < | < | < > > > | > | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > | > | > > > | > > > > > > | > > > > > > > > > > > > > > > > > > | | | > | > > | > | | | | > > > > | > | | | | > | > > | > > | | | | > | > | | > > > > | | > > > > | > | | > > > > | > | > > > > | > | > | > > > > | > | > | | | > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | <?php /** * Ce fichier représente un exemple des constantes de configuration * disponibles pour Garradin. * * NE PAS MODIFIER CE FICHIER! * * Pour configurer Garradin, copiez ce fichier en 'config.local.php' * puis décommentez et modifiez ce dont vous avez besoin. */ // Nécessaire pour situer les constantes dans le bon namespace namespace Garradin; /** * Clé secrète, doit être unique à chaque instance de Garradin * * Ceci est utilisé afin de sécuriser l'envoi de formulaires * (protection anti-CSRF). * * Si aucune valeur n'est définie, Garradin ajoutera automatiquement * une valeur au hasard dans le fichier config.local.php. */ const SECRET_KEY = '3xUhIgGwuovRKOjVsVPQ5yUMfXUSIOX2GKzcebsz5OINrYC50r'; /** * Se connecter automatiquement avec l'ID de membre indiqué * Exemple: LOCAL_LOGIN = 42 * * Défault : false (connexion automatique désactivée) */ const LOCAL_LOGIN = false; /** * Autoriser (ou non) l'import de sauvegarde qui a été modifiée ? * * Si mis à true, un avertissement et une confirmation seront demandés * Si mis à false, tout fichier SQLite importé qui ne comporte pas une signature * valide (hash SHA1) sera refusé. * * Ceci ne s'applique qu'à la page "Sauvegarde et restauration" de l'admin, * il est toujours possible de restaurer une base de données non signée en * la recopiant à la place du fichier association.sqlite * * Défaut : true */ const ALLOW_MODIFIED_IMPORT = true; /** * Doit-on suggérer à l'utilisateur d'utiliser la version chiffrée du site ? * * 1 ou true = affiche un message de suggestion sur l'écran de connexion invitant à utiliser le site chiffré * (conseillé si vous avez un certificat auto-signé ou peu connu type CACert) * 2 = rediriger automatiquement sur la version chiffrée pour l'administration (mais pas le site public) * 3 = rediriger automatiquement sur la version chiffrée pour administration et site public * false ou 0 = aucune version chiffrée disponible, donc ne rien proposer ni rediriger * * Défaut : false */ const PREFER_HTTPS = false; /** * Répertoire où se situe le code source de Garradin * * Défaut : répertoire racine de Garradin (__DIR__) */ const ROOT = __DIR__; /** * Répertoire où sont situées les données de Garradin * (incluant la base de données SQLite, le cache et les fichiers locaux) * * Défaut : identique à ROOT */ const DATA_ROOT = ROOT; /** * Emplacement du fichier de base de données de Garradin * * Défaut : ROOT . '/association.sqlite' */ const DB_FILE = ROOT . '/association.sqlite'; /** * Emplacement de stockage des plugins * * Défaut : DATA_ROOT . '/plugins' */ const PLUGINS_ROOT = DATA_ROOT . '/plugins'; /** * Plugins fixes qui ne peuvent être désinstallés par l'utilisateur * (séparés par une virgule) * * Exemple : PLUGINS_SYSTEM = 'gestion_emails,factures' * * Défaut : aucun (chaîne vide) */ const PLUGINS_SYSTEM = ''; /** * Adresse URI de la racine du site Garradin * (doit se terminer par un slash) * * Défaut : découverte automatique à partir de SCRIPT_NAME */ //const WWW_URI = '/asso/'; /** * Adresse URL HTTP(S) de Garradin * * Défaut : découverte à partir de HTTP_HOST ou SERVER_NAME + WWW_URI */ //const WWW_URL = 'http://garradin.chezmoi.tld' . WWW_URI; /** * Affichage des erreurs * Si "true" alors un message expliquant l'erreur et comment rapporter le bug s'affiche * en cas d'erreur. Sinon rien ne sera affiché. * * Défaut : true */ const SHOW_ERRORS = true; /** * Envoi des erreurs par e-mail * * Si renseigné, un email sera envoyé à l'adresse indiquée à chaque fois qu'une erreur * d'exécution sera rencontrée. * Si "false" alors aucun email ne sera envoyé. * Note : les erreurs sont déjà toutes loguées dans error.log à la racine de DATA_ROOT * * Défaut : false */ const MAIL_ERRORS = false; /** * Utilisation de cron pour les tâches automatiques * * Si "true" on s'attend à ce qu'une tâche automatisée appelle * le script cron.php à la racine toutes les 24 heures. Sinon Garradin * effectuera les actions automatiques quand quelqu'un se connecte à * l'administration ou visite le site. * * Défaut : false */ const USE_CRON = false; /** * Activation de l'envoi de fichier directement par le serveur web. * (X-SendFile) * * Permet d'améliorer la rapidité d'envoi des fichiers. * Supporte les serveurs web suivants : * - Apache avec mod_xsendfile (paquet libapache2-mod-xsendfile) * - Lighttpd * * N'activer que si vous êtes sûr que le module est installé et activé (sinon * les fichiers ne pourront être vus ou téléchargés). * Nginx n'est PAS supporté, car X-Accel-Redirect ne peut gérer que des fichiers * qui sont *dans* le document root du vhost, ce qui n'est pas le cas ici. * * Défaut : false */ const ENABLE_XSENDFILE = false; /** * Hôte du serveur SMTP, mettre à false (défaut) pour utiliser la fonction * mail() de PHP * * Défaut : false */ const SMTP_HOST = false; /** * Port du serveur SMTP * * 25 = port standard pour connexion non chiffrée (465 pour Gmail) * 587 = port standard pour connexion SSL * * Défaut : 587 */ const SMTP_PORT = 587; /** * Login utilisateur pour le server SMTP * * mettre à null pour utiliser un serveur local ou anonyme * * Défaut : null */ //const SMTP_USER = 'garradin@monserveur.com'; /** * Mot de passe pour le serveur SMTP * * mettre à null pour utiliser un serveur local ou anonyme * * Défaut : null */ //const SMTP_PASSWORD = 'abcd'; /** * Sécurité du serveur SMTP * * NONE = pas de chiffrement * SSL = connexion SSL (le plus sécurisé) * STARTTLS = utilisation de STARTTLS (moyennement sécurisé) * * Défaut : STARTTLS */ const SMTP_SECURITY = 'STARTTLS'; |
Added src/include/data/0.8.0.sql version [bdca802b40].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | -- Ajouter champ pour OTP ALTER TABLE membres ADD COLUMN secret_otp TEXT NULL; -- Ajouter champ clé PGP ALTER TABLE membres ADD COLUMN clef_pgp TEXT NULL; -------------------------------------------------------------------------------- -- Mise à jour des tables contenant un champ date pour ajouter la contrainte -- -- Ceci afin de forcer les champs à contenir un format de date correct -- -------------------------------------------------------------------------------- -- Renommage des tables qu'il faut mettre à jour ALTER TABLE cotisations_membres RENAME TO cotisations_membres_old; ALTER TABLE rappels_envoyes RENAME TO rappels_envoyes_old; ALTER TABLE wiki_pages RENAME TO wiki_pages_old; ALTER TABLE wiki_revisions RENAME TO wiki_revisions_old; ALTER TABLE compta_exercices RENAME TO compta_exercices_old; ALTER TABLE compta_journal RENAME TO compta_journal_old; ALTER TABLE compta_rapprochement RENAME TO compta_rapprochement_old; ALTER TABLE fichiers RENAME TO fichiers_old; -- Suppression des index pour que les nouveaux soient liés aux nouvelles tables DROP INDEX cm_unique; DROP INDEX wiki_uri; DROP INDEX wiki_revisions_id_page; DROP INDEX wiki_revisions_id_auteur; DROP INDEX compta_operations_exercice; DROP INDEX compta_operations_date; DROP INDEX compta_operations_comptes; DROP INDEX compta_operations_auteur; DROP INDEX fichiers_date; CREATE TABLE test (a, b); -- Création des tables mises à jour (et de leurs index) .import schema.sql -- Copie des données INSERT INTO cotisations_membres SELECT * FROM cotisations_membres_old; INSERT INTO rappels_envoyes SELECT * FROM rappels_envoyes_old; INSERT INTO wiki_pages SELECT * FROM wiki_pages_old; INSERT INTO wiki_revisions SELECT * FROM wiki_revisions_old; INSERT INTO compta_exercices SELECT * FROM compta_exercices_old; INSERT INTO compta_journal SELECT * FROM compta_journal_old; INSERT INTO compta_rapprochement SELECT * FROM compta_rapprochement_old; INSERT INTO fichiers SELECT * FROM fichiers_old; -- Suppression des anciennes tables DROP TABLE cotisations_membres_old; DROP TABLE rappels_envoyes_old; DROP TABLE wiki_pages_old; DROP TABLE wiki_revisions_old; DROP TABLE compta_exercices_old; DROP TABLE compta_journal_old; DROP TABLE compta_rapprochement_old; DROP TABLE fichiers_old; |
Added src/include/data/dictionary.fr version [df70718a94].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 | paysage lui-même erreur pénitence brûlant canon prudent débarrasser séparer retomber croix sauter nid grand-maman satisfait défense compter déboucher peintre tentation devant envie pleuvoir fièvre organiser persévérer ivre quart pourvu que tilleul barrière police pareil invention fer guerre cordialement campagnard infirmier crépuscule manier animal transporter mobile perfection marque joncher nouveau désespoir joindre cordonnier ruelle risquer janvier ménage couronne fusil loi page clou armée flacon blanc adresser maître caverne rentrée constant montre surface ruban cause division note luisant poche poursuite gazon ingratitude pré rose activité joyeux fâcher préoccuper obligeance rivière vache dessin but fond deux ceinture lorsque cantique tâcher expirer aviser gibecière lourd espiègle sommet carte vendeur opérer disparaître rire agréer visite précédent simplement dorer sagesse revivre manteau croûte intelligence lion chêne horreur grandeur saluer mauvais sentier estomac modeste nullement hâter millier saigner curé moineau fuite flaque crêpe gant s'emparer gare gentil sacrifice modérer brutal feuille pouvoir dossier clef terrain quarante actif fou réconforter gendarme ignorant grotte habiller stationner implorer chapitre soupir chaise rarement application s'écrier ressource ministre doyen jeu graisse chantre écho barre clouer bourgeon équipage commun obliger berceau outil coquille procureur germer séminaire partout agréablement énorme radieux retrousser sorte billet mademoiselle condamner aviateur tourbillonner boucher fumer décembre rang étouffer sens parcours tablier pleur bluet cesse papier bonté boucle avantageux tranche coller jeune drapeau gaieté chemin deviner auparavant orée passage souffle agir s'envoler apparition hors président deuil berger merveilleux clin d'oeil priver oser mariage forêt règne commode finir bosquet mouche tailleur essuyer téléphone couronner château tourbillon citoyen neveu paisible messager ci-joint ignorer sûrement tache dompteur préférence maison revêtir vicaire vendredi frapper chef bâiller seigneur appuyer livre complètement motif adjectif numéral train ruisselet arrêter danse blottir raisin raconter dahlia épauler réel morceau étudier amical mouchoir libre printanier voiture journal musée village charge pâquerette mari ombrage attention choc rapprocher prévoir bienveillance suprême sirène ceci giroflée gouverner fraîcheur circuler mélancolie exactement désireux commandement annoncer cueillette duc désobéissant chauffeur dessert murmurer exclamation formidable tant acclamer son désaltérer soeur fourrer industrie embarquer bienfaiteur mine joyeusement fidèle grès dictionnaire nuage miroir conscience équilibre tarder verdoyant parvenir boue refuser manuel grand réchauffer succéder bloc front père employé moissonneur là majesté réclamer auquel général obscurcir commerce singulier consolation passager mais événement administrer coucher rapidité respirer quai empereur farine préserver glisser ver sourd notaire citer débris habile qualité inerte football abri miel franchement essai production errer ah idéal agile tarte léger raisonnable projeter poésie massif pommier ensoleillé couvent sauver invitation métier poussière école fuir pleurer imaginer sautiller édifier multitude commerçant plat autel toujours craindre tuer cuisinière ingrat percher concert doubler trésor cimetière exercice savon éblouir éclat parc peau compléter escalier sous matinée recherche régner épreuve autrefois fauteuil apprendre pétale sujet lequel bien-être chauffage nerveux décision participer gronder aussi tombe éternité rejeter enveloppe habitude peut-être accabler confrère prêtre parfaitement soigneusement compliment d'après chéri oiseau coureur mentir faucheur héros arrêt graver intrigué plaine combler planche recouvrir imprudence brebis poule spectacle semblable anticiper mener hommage déshabiller moins volume poulet main imposant fendre paille résistance écrivain franchise casquette mien heure an oranger coucou plomb télégramme amende part combat applaudir rédaction exécution largement unique jardinier belge réserver colère lueur moyen coiffer guérir échec minute conseiller fontaine scier fabrique oisillon amicalement oreille laisser gosse tard autoriser emmener anxiété patron abbé désobéissance bazar destinée plume terrasse potager dessus régulièrement distinguer roseau malade éteindre pendule imperméable fougère pelage écriture journalier comprendre manoeuvre soudain dessous parmi aire bosselé goutte bateau veiller économiser intelligent ferveur avertir repousser ville convenable farce cultiver provenir acharner pic avril frontière patte merci prince précieux espoir allumette poumon bleu inutile proposer être attester couvert trou démontrer effroyable localité reverdir trop user ours locomotive ailleurs fournir piste béret profondément respecter lecture congrès ennuyer lendemain indigne eux détail compagne vérité capital bavarder grue sueur urgent habituel fragile ôter briller border souper marteau agent moisson mou repentir disperser commande situation atteindre musique voyage remettre écharpe fruit éclaircir particulier ardent foi bercer papa marbre guérison alcoolique apaiser marguerite hôpital séance bousculer aube cordial quelque chaque difficilement union inquiétude filleul ami explication toux limpide jeter réellement inquiéter activer capable résister reconnaissance troupe aussitôt niveau jeunesse meunier signature consulter bout périr amateur livrer rapide engloutir usage nombreux sagement tapis grossier bourgmestre demoiselle prodiguer limite clochette fortune échanger inquiet parapluie quelconque propos enquête réduire chance énergique source dent voilà féroce tasse envers capitaine contrée obstacle île plier moderne allemand muet introduction annuel habitation jambe mouton résoudre ferrer éclater sein naufrage galerie foule soulier voûte toutefois fourrure marquis punir féliciter discussion défiler dédaigner tailler tomber clé côté broder encore jambon poulailler habiter chauffer normal aventurer professeur approuver peur automobile conduire ardeur vôtre centime emporter fois moquer éducation fourmillière pieux copier étinceler regagner trait esclave géant attrait allonger rude santé bébé décharger obscur commercial battre partir parure mesure encombrer reflet reproche recueillir cathédrale illustrer chiffre timbre courir climat genre daigner tente gauche imagination chérir guichet bulletin classique poursuivre renseigner boisson ranimer sabot chute brillant volaille grandiose orgueil brun plaintif moqueur bruit jadis achat baigner accourir inscrire plancher religieux joue avec accident figurer surtout buis courageusement moine employer baguette foudre signaler succès parfumer découvrir bête sien corniche renoncer relever mérite résonner type tournée préparation sillon étable relation chasseur cas description porc pourrir blesser favori puisque laid calculer veine chameau indifférent dégager crucifix faine renouveler principe crayon revenir frémir élégant secret parce que opinion mélanger colonel utiliser soin cinquante sonore écouler tel colline seulement futur expédier tuile chapeau mouiller fureur grâce consentement fervent paletot vêtir manger étude ménager proie héroïque pli canal lin effectuer condoléances savoir instructif azuré cristal plus chemise jouer immobile achever quatrième serviteur spécial science rechercher alentours mont soyeux cruel service jugement négligence oie mortel voyager fourneau gâteau début ciseaux carrefour mobilier gambader arroser imiter redevenir rapporter gaz inviter fort hardi passé riche oeuvre souterrain créature tendre souvent ralentir agrément entasser faute scintiller peiner froid traiter gorge remarquable veston princesse peinture basse provision poteau guider plusieurs série mûr affectueux refuge salaire innocent véhicule style consacrer gardien retrouver coupable charmer créateur renard panorama couteau rêver confectionner appartement traîner astre appétit invisible détester raide réponse ceux creuser carré aujourd'hui ficelle trottoir moulin glacer vêtement hâte appeler mission renouvellement dernier missionnaire fille gratitude juillet vieil déchaîner commettre attraper parsemer quantité gazouiller blancheur foie satin serein salut connaître novembre avenue curiosité porte-plume merveille chaland article geler mansarde alcool monstre chanter océan ressort sifflet renoncule entrée balle monter effort introduire juin vaillant valoir voisin eh dresser dortoir sobre médecin répéter problème négliger bicyclette couche facile visiteur aise assiette aurore sincère magnifique estimer durée accorder reculer café fameux serviette ainsi voix protéger circulation agréable communier chrysanthème animation végétation justement cochon courant légume nation table jardin extérieur attentif important noeud décrire vivant merle vermeil forger comparer redoubler forcer incliner bien-aimé préau ériger gras dentelle rayon régime foncer avant célébrer générosité perle envoi sonnette suffire crever réfectoire indication paternel ronronner péril second grappe courageux lierre cuire cousin souhaiter trembler pas patronage mur mâchoire paresse garde ronce courber furieux dedans brouillard expression promener intention bille perte déception situer bonne désormais azur roulotte public gerbe crème isoler séjour repas donc madame vernir corridor périlleux fauvette encourir position fin vide jusque agrémenter autorité pauvre plage enfouir marché vraiment signifier portière griffe minuscule plonger messe impossibilité ouvrage paix ambulance petit vacances corriger engager humble longuement pratiquer jaunir salutation dérober bouche nécessaire causer dessein rouler huit villa façonner malgré sang alors silencieusement nettoyer dévouement conseil tunnel parent fauve cabane distraction opération fruitier poupée crier tapage soir sot sentiment prolonger grimper pur produit satisfaction rustique chambre excuse rouge protection désolation étendre crise pourtant communiant enseignement ample physique négligent lanterne recommencer conserver chaux menteur suffisant vivre abondant étagère douter glace liberté docile pensionnat debout abattre clairon noircir victoire épuiser tiroir chevalier considérer cuiller réunion reste depuis cortège heureusement panache poignée brin peser lettre naissance réunir lâcher venir rassurer porte resplendir taper associer doute promettre sourire surmonter bienveillant chaleur nièce flatter régaler moelleux surprise écurie danger distinction offrir travail exposer colis flot quotidien permettre ennemi invoquer voler artiste attrister linge tombeau répondre donner transmettre août seul planter acquitter lire horizon splendeur amour kilomètre jardinage ornement charme vers mineur tempête circonstance maint caresse oeillet dimension gâter immaculé veille baisser peuplier rouleau lilas lumineux laborieux gland écrire flocon parole cuillère favoriser composition gravure nature tantôt dominer boire fouet spécialement coquelicot fourniture lampe grange pétrir port retraite douloureux amusement bibelot enlever clément sabre lutter pluie musicien pie phrase aventure perspective solide vertu refaire apostolique orgue quinze réciter bordure débarquer cycliste randonnée renvoyer épargner volonté savoureux tous essayer aliment haleine côte humide obtenir complet onduler ressentir crime pigeon vapeur chaume cirque chiffon ferraille ramasser s'éloigner cent manche planer affreux jurer trimestre triomphe pénible grelotter rigole commander épine suivre gourmand confier hurler joujou dîner dévorer plafond parler enfermer avion bienheureux titre lien peine aucun riant dont admirable triompher conférence tiède mourir diriger terminer prononcer acier splendide image histoire céleste brigand résultat dos foin rayonner venger ensuite patience ébats allégresse rideau malin flatteur luire robuste ardoise sacoche menton bassin mai doux date bonbon dévouer enflammer goût instituteur habit lier sympathie naître marraine animer pourquoi chausser communication mouvement sève aubépine vif clos bal hasard trouble ménagère scolaire marche prouver comble couver théâtre affliger écouter contrarier lieu étoile frotter four caprice fixe puissant ménagerie croître culotte tort pelouse maudire confus occuper tournant angoisse fièrement exécuter commission servir poil catastrophe selon bord chose vaisselle rage louer étirer énormément entre juge poutre blanchir fréquent las mériter inconvénient fréquenter bourgeonner demi voie centre chevelure raccourcir affiche découper succulent impression architecte blouse procurer faner utilité vigne bêche vain reprise chair secouer anxieux recommander onze velours moindre sillonner cité évangile duvet quatre farouche noyer si caillou manoeuvrer négociant chou royaume attirer missel rougir limiter flanc dommage dehors difficile litière intime penser huile savant souhait piété calmer faiblesse bénir préparatif pinson goûter membre écarter défendre wagon gamin pain insigne valeur recommandation butiner hanneton redoutable consoler appartenir soupe mettre hausser chocolat aligner gracieux haillon niche bourdonner peindre briser quoi attaquer nuit paraître lisière cesser recevoir sport maire marin violence usine survenir meule proprement saint possession cinq dessiner quant falloir politesse trente fier épaule embaumer dès abaisser pécher noir accrocher tas vie interdire progrès sacrement rusé orgueilleux courrier déjà au-dessus guetter pâte vagabond plante rôle avoine voleur craquement taquiner affectueusement portée grain porteur buisson toile tressaillir intellectuel mordre bière dette apprêter camion net bravo groupe espace aimable épée dur menuisier précaution volée orphelin accepter estrade bambin célèbre bétail déborder univers tremper oeuf toit bec coiffure hauteur filer bouleverser réserve talus expédition fatiguer annonce acte vendre samedi appliquer conviction ranger pan camarade terrestre quelquefois poli voiler dépendre directeur unir suspendre paradis dormir décorer cadet plan saut national gémir gloire terme indiquer mélodie exactitude tacher douzaine répartir propice distance région mendier parterre flèche idée bref confondre couler verre oncle étalage familier fumée désirer boutique boîte industriel corde veuf refléter gaiement arrondissement refermer lèvre banque tableau s'écrouler instant pardon turbulent somme chrétien rompre vol concours enfin renaître loup envelopper commune bondir barbe paître outre corbeille exposition fleurir pension pays brusquement âne vue soulever recourir coussin avantage balancer cigarette nouvelle charité pitié suffisamment secourir cela long longer trouver doucement passant demander réalité demeure queue procession fondre aisément bonheur respect changement aiguille vaste centaine transformer prospérité sacrifier prochain geste lointain flamand tenter commencement là-bas diamant prier propriété hirondelle nécéssité continuellement fatigue rive travailleur kermesse quelqu'un solitude sursauter salir évidemment vieillard cadeau office acquérir péniblement environner grille grammaire végétal pipe fête semaine profondeur délicat détacher retour souffrir supporter gouvernement barque lambeau seuil étranger froisser tourment d'abord personnel prudence remède intéresser étudiant manque jacinthe villageois renfermer égarer herbe poire armoire présent prétendre joli signer plaindre offre sucer ressembler maladie tandis que caresser couleur électricité plaisir bras tonneau bruyant proclamer couture bienvenue cage calvaire connaissance tenir propre confesser degré maintenant droit lancer gelée reconnaissant ancien colonne nord maussade talent contempler fermer vélo ni garantir résigner brut blond reporter vite aisance gêner blé forge nourrir barquette abord teinte pardessus ravir emploi étage sauf frêle prêt lièvre créer pâture extrême victime tendresse rue inconnu possible croquer encre anglais chasser rester charbonnage sinistre carnet effrayer myosotis fouetter expliquer écorce ravage sublime revue entretien géographie boucler gravement quel or lis écolier dégât taire insister onde supplier chariot mécanique baiser vouloir fossé mois porter exercer puis poulain illusion sécurité marier gîte tapisser domestique amer étincelant garnir providence espérer cartable fonds alouette ébranler estime soleil valise entourer insecte armer sortir jouir éclore mécontent loyal primaire contenu généralement persuader infini anniversaire fenêtre action forgeron agiter fortement réveil accomplir disposition ordinairement embellir mesurer arme souci graine soirée robe proverbe manifester pantalon dictée bouleau illuminer fêter relatif certes élever mort natal drôle point modèle exister voeu beauté admirer redresser par cours varier envahir content retenir amuser s'efforcer obéir pondre logis avouer museau parti grandir promeneur enfance autour flamme durer adversaire préférer retirer informer mardi terreur étonner aimer tricot entrer consentir carrière aérer réaliser régiment renverser foire immédiatement chien accompagner traitement inondation combien épargne détruire faible champ aigu arranger monument baptême punition abandonner rez-de-chaussée troupeau sale rien afin famille agitation tabac coupe fillette sud carton file habituer triste catholique sévèrement permission match retentir fabriquer communal défunt rare remporter jour période sec labeur lenteur débattre montant bouger joie sac demeurer muraille sage facilement bas abîme attentivement tuyau munir tricoter raison nègre morne accueil exquis lisse apporter bise emballer examiner américain réformer admettre servante droite occasion église éléphant garniture établir récolter hésiter avance compassion égard sensible emplacement montrer docteur retourner comme acheter étincelle pont zèle déterminer continuer vieillesse attribuer enfoncer partager course rond trancher tourmenter ravissant migrateur odorant s'empresser malheureux dimanche barreau cependant drap haine importer attachement sacré croire discuter plumier bouton araignée romain groseillier diminuer convertir saisir interroger garder atelier respiration chaudement distribution collège société tromper roue réfugier patin remuer mignon corbeau statue perdrix croiser cygne exciter peu nager remords découverte demande paquet perche meuble pis ferme froment symbole tellement examen sable art rattraper charbon gonfler monde correspondance soumettre entendre cerise entraîner misérable admiration imprimer établissement brumeux bureau crèche tirelire infirme fils sinon mille oui charrette troisième viser arrière empressement péché acheminer grêle coton extraire maintenir chacun placer avancer soutenir preuve réjouir provoquer couvercle tulipe étourdi postal dépenser dater produire percer reprocher émouvoir cache-cache lait mémoire bonsoir étaler volontiers ouate tigre naturellement davantage richesse avaler brèche serrer conformément paisiblement marchandise vigueur caisse darder principalement racine cueillir bouquet ruine baptiser épouvantable cadran arriver aboyer rôder reconnaître chaussure apôtre attendre incident violent fromage muscle lutte pratique ange propreté studieux malle bossu femme repos reconduire spectateur accord observation grouper ruisseler figure charmant vitesse époux familial âme honorer enterrement monnaie éclabousser sapin désespérer juger opposer disputer menu arbuste lot bourrasque supérieur puissance cuivre payer papillon échantillon pièce composer incendie parcourir patrie calcul apprécier timide orage labourer appel vierge chasse recours embrasser salle cadre voile million moitié feuillage haut puits augmenter juste derrière blessure midi calendrier clair hiver fleur magique touffu violette libérer caractère choix plumage remonter étonnement impatiemment fixer proposition banc trois irriter coffre regret brise divin endormir précéder allée noisette tourner carotte mère boulevard faire règle témoin rame affectionner sans adresse chant cou hermine tordre chevet panier fleuve argent silence manquer bourgeois siège replier masse cime dépens excuser actuel mal apercevoir tribunal renouveau domicile abeille cher dépêcher malheur condition riz passion sermon pointe arrivée impatient sérieusement brave soif joueur muguet carrousel accueillir continuel contraire dicter vanter régulier sain encrier vallée canne tendrement imprudent décéder précipiter boule portefeuille réparer universel pâtisserie démarche neiger souriant branche narcisse étrange eau clown parrain jeudi février moudre fil affaire salon sauvage rôti ouverture poudre repasser perroquet mare rameau extrémité disparition réception coudre pardonner central observer dépouiller celle-ci absolument amitié inférieur tâche profit illustre honorable assembler sergent faciliter pupitre politique changer basse-cour spacieux officier délaisser exemple trouer accuser descente beau chaîne saison vérifier deuxième femelle abîmer tristement portrait entrouvrir défenseur redouter représenter parages endosser excellent bénédiction combattre récréation coup horrible ramage constater képi paroisse tranquille décider rencontre broyer maigre paire ombre matière obscurité scène envier chanson signal exprimer monotone s'absenter septembre utile enrichir matin catéchisme aumône marron taille canot projet parfum congé imposer départ mars vitre sucre semer coin tartine sommeil infiniment raccommoder hypocrite intérêt tournoyer prendre adoucir averse monseigneur pompier givre méchant stupéfaction aboutir genêt orange malette hangar ordonner crainte fiancé épi clarté meilleur prêcher brochure gagner calme sur hier dangereux pois défaire convenir indispensable vainqueur fabrication prière prisonnier aîné gigantesque vente s'évanouir envoyer charger pinceau pousser retard autant distrait arrondir simplicité pâle assez céder difficulté généreux perdre mousse franc redescendre siècle contribuer excursion marchander hygiène délivrer esprit dix objet néanmoins besoin diable verser éprouver marcher nul transport vrai dame exaucer présence quatorze étroit épanouir commandant force adroit rouiller réveiller conduite mélancolique communion sursaut borne conquérir clocher étoffe heurter confiture épais gris honteux quartier dépasser ronde distribuer facteur asseoir rencontrer méthode absence rappeler constituer sort enfant grossir mât seau offenser fatal honneur hérissé prêter différence soulager traverser pourvoir seconde adorer sévir odeur colorer malheureusement charitable nu mouvoir agacer loisir supposer oh tricolore appui approcher institut bûcheron laver religion respectueux avoir chercher flamber savourer tortue déclarer éclair honnête temps danser brusque même particulièrement humeur durant plupart réussir barrage maman cacher cheval absolu modestie nuisible pencher tour peupler plateau grippe quitter lever régler coffret celui-ci obéissant délice sortie vivement vin osier enthousiasme firmament déplacer prairie enterrer costume cave acide trajet manière discours dizaine bandit empêcher poêle profession mélodieux relativement cheminée soupirer convaincre faucher adopter peuple été méditer pénétrer passer rassembler trace façade façon attaque apparence solitaire voici échelle époque immense fâcheux ici principal étang bonnet kilogramme français mendiant aborder automne lunette marchand doigt air conséquence acheteur haie bâton probablement digne bleuet sécher enseigner mêler tige interruption coûter noix poirier os redire âgé vilain contact pourpre douceur lac ruiner aisé contenir lundi langage espérance direction température brique sûr cinéma raser sel primevère douze charlatan remarquer entreprendre parfait mer regarder bientôt piquer dérouler économie balayer autrui homme évêque sitôt échapper minuit vingt orner défaut colonial couvrir cuir chaud canard rafraîchir couper harmonieux poids bourse purifier différent amusant très marronnier pensionnaire bienfaisant médaille navire comte oeil interrompre miette charrue mauve violet guêpe endroit souverain former administration aide bizarre désigner tonnerre hache aspirer bougie rêve franchir bain regard journée cerisier pendre touffe attente ténèbres prodigieux songer forme révéler verdure monsieur intérieur cri plein appétissant soldat sévère écluse local beaucoup genou coq saule race géranium roi souiller pomme privation botte large bâtir rejoindre thé question devoir terre client noble sombre installer valet habileté presser risque lit mirer remerciement rocher élargir désastre impossible misère moment coutume loin bon frayeur cloche pâlir cadavre honte carreau jaillir souvenir vulgaire hôtel dispenser inspecteur prévenir élève mieux treize profond suc parer pâtre déployer laine condisciple lys influence déchirer après-midi inonder occasionner surveiller déranger disposer transformation verdâtre giboulée piano face allure écrit ton matinal remise vent paresseux flotter grave creux autrement plainte ruche hêtre louange alerte récompense intervenir rossignol visage six coude visible parquet mètre perpétuel pavé solliciter forestier exhaler don directement équipe choeur témoigner faveur différer friandise ennuyeux mince bois gaufre tôt bond tronc année tenue emplir rosier moustache bonjour pied humanité injure roux gravir descendre domaine pêcher souple voisinage ça faim reposer premier élancer argenter liste égal propriétaire subitement salade sincèrement serviable avenir concerner arbre déménager correction car cabine griffer poing aiguiser corps ligue nommer sol destination lutin métal assidu voyageur attacher successivement transparent abondamment cercle bijou sifflement encourager souffler machine atmosphère parfois royal ramener canif nez détourner boeuf soigner chèvre dans auteur décourager aveugle fréquemment soigneux douleur langue sentir assurer tracer mystérieux bâtiment lent certain nombre flûte taillis désagréable bourdonnement mensonge cérémonie larme constamment importance allumer fée bouder poste chat récompenser ciel ivoire amener vénérer quoique autre cultivateur ventre filet s'enfuir faux halte embarras brume vigoureux escalader dissiper miracle brouter gratter exact légèrement instruction photographie exprès classe cour compte longueur laboureur protecteur fonction sou s'agenouiller favorable dire loger toilette balançoire résolution jonquille dénudé nom satisfaire plutôt brûler court pour corolle hameau subir majestueux chagrin également habitant cirer jaune merveilleusement émerveiller campagne réflexion relire affection enchanté distraire boulangerie considérable mystère ordinaire soulagement coeur lumière glissant interpeller neige silencieux refrain ouvrir récolte lune éclatant jaloux besogne tête surprendre rapidement vague extraordinaire personnage foyer bouteille grive tante remarque tout matériel espèce finalement garçon betterave débiter voir rhume gymnastique multicolore serrure bien craquer suivant démolir guère entièrement poitrine conter bruyamment écraser ballon effacer délicieux courage retardataire contenter ennui rosée gibier nappe carabine déjeuner centimètre tram chef-d'oeuvre photographier sept sembler toucher exiger lasser présenter surgir suave grincer cuisine contre fermier calice verger arracher quand fleurette approche remplacer souris pendant non place civil hélas destiner bibliothèque éternel reprendre consister élan imprévu encadrer lors mot liquide désert gazouillement personne attarder boueux fouiller entonner devenir double abuser simple frissonner désordre voltiger communiquer instruire chanteur fourmi banquier bonhomme fait rendez-vous angle écureuil remercier pin renseignement pointu dernièrement cheveu rat conte électrique dépôt octobre promesse boulanger ensemble émotion rendre ordre poète couloir plaie actuellement tramway fraise arbitre aller conclure auprès auberge abriter travailler volet bataille frère occupation sérieux assaut rater intéressant instrument intense chapelet divers frais couverture neuf lui mélange soie plaire grenier désoler soutien paysan vaincre tambour visiter compliquer prime maîtresse sanglot ravin printemps certainement éveiller remplir état impatience déplaire environ confiance banane seize moyenne vider velouté pensée refroidir brindille morale profiter pot assister téléphoner poser affairé claquer entier dieu suite quinzaine plaque fléau solennel vitrine rigoureux leçon adieu détour collection gai lieue construire demain sincérité âge horloge avis apparaître trompette lugubre rapport abondance anneau programme viande pêcheur coquet lamentable lentement inspirer ronger témoignage lapin épouser poussin longtemps entretenir lécher pittoresque terrier chaussée murmure comment procéder répandre tissu cahier houille corne entrevoir jamais véritable menacer éclairer laitier reparaître casser pêche palais marquer tinter humidité compagnon tranquillement acclamation commencer représentant exemplaire étrennes bande prix facilité rapiécer conversation multiple embarrasser pompe prompt tirer comparaison vert compagnie gros prise yeux vice cerf ligne poisson choisir excellence troubler hôte absent camp mode reine près vieux trotter désobéir justice proche glissoire heureux route étendue jouet affaiblir prison poireau veau aile mûrir militaire moral boiteux tristesse chaumière préparer partie éviter rider secours clairière existence vêpres rétablir grenouille bagage construction représentation après sonner balcon torrent revoir montagne réfléchir aider posséder bienfait expérience feu ivresse naturel gentiment épouvanter développer récit souffrance regretter combattant grand-père siffler entrain superbe station moteur nourriture ajouter duquel presque beurre atteler guide cendre rentrer signe pierre numéro effet maternel promenade travers chapelle énergie ouvrier grand-mère humain milieu gens tacheter ruisseau leur vase précisément désir singe diviser soupçonner terrible curieux déposer traîneau culture mercredi goal chez magasin association chelou teuf ordinateur tablette smartphone garradin association asso comptabilité compta gestion |
Modified src/include/data/schema.sql from [5ab5416f01] to [68e5662649].
|
| | | | | | | | | | | | | | | | > > > > > > > > > > > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | CREATE TABLE IF NOT EXISTS config ( -- Configuration de Garradin cle TEXT PRIMARY KEY NOT NULL, valeur TEXT ); -- On stocke ici les ID de catégorie de compta correspondant aux types spéciaux -- compta_categorie_cotisations => id_categorie -- compta_categorie_dons => id_categorie CREATE TABLE IF NOT EXISTS membres_categories -- Catégories de membres ( id INTEGER PRIMARY KEY NOT NULL, nom TEXT NOT NULL, description TEXT NULL, droit_wiki INTEGER NOT NULL DEFAULT 1, droit_membres INTEGER NOT NULL DEFAULT 1, droit_compta INTEGER NOT NULL DEFAULT 1, droit_inscription INTEGER NOT NULL DEFAULT 0, droit_connexion INTEGER NOT NULL DEFAULT 1, droit_config INTEGER NOT NULL DEFAULT 0, cacher INTEGER NOT NULL DEFAULT 0, id_cotisation_obligatoire INTEGER NULL REFERENCES cotisations (id) ); -- Membres de l'asso -- Table dynamique générée par l'application -- voir Garradin\Membres\Champs.php CREATE TABLE membres_sessions -- Sessions ( selecteur TEXT NOT NULL, hash TEXT NOT NULL, id_membre INTEGER NOT NULL, expire TEXT NOT NULL CHECK (datetime(expire) IS NOT NULL AND datetime(expire) = expire), FOREIGN KEY (id_membre) REFERENCES membres (id), PRIMARY KEY (selecteur, id_membre) ); CREATE TABLE IF NOT EXISTS cotisations -- Types de cotisations et activités ( id INTEGER PRIMARY KEY NOT NULL, id_categorie_compta INTEGER NULL, -- NULL si le type n'est pas associé automatiquement à la compta intitule TEXT NOT NULL, description TEXT NULL, montant REAL NOT NULL, duree INTEGER NULL, -- En jours debut TEXT NULL, -- timestamp fin TEXT NULL, FOREIGN KEY (id_categorie_compta) REFERENCES compta_categories (id) ); CREATE TABLE IF NOT EXISTS cotisations_membres -- Enregistrement des cotisations et activités ( id INTEGER NOT NULL PRIMARY KEY, id_membre INTEGER NOT NULL REFERENCES membres (id), id_cotisation INTEGER NOT NULL REFERENCES cotisations (id), date TEXT NOT NULL DEFAULT CURRENT_DATE CHECK (date(date) IS NOT NULL AND date(date) = date) ); CREATE UNIQUE INDEX IF NOT EXISTS cm_unique ON cotisations_membres (id_membre, id_cotisation, date); CREATE TABLE IF NOT EXISTS membres_operations -- Liaision des enregistrement des paiements en compta ( id_membre INTEGER NOT NULL REFERENCES membres (id), id_operation INTEGER NOT NULL REFERENCES compta_journal (id), id_cotisation INTEGER NULL REFERENCES cotisations_membres (id), PRIMARY KEY (id_membre, id_operation) ); CREATE TABLE IF NOT EXISTS rappels -- Rappels de devoir renouveller une cotisation ( id INTEGER NOT NULL PRIMARY KEY, id_cotisation INTEGER NOT NULL REFERENCES cotisations (id), delai INTEGER NOT NULL, -- Délai en jours pour envoyer le rappel sujet TEXT NOT NULL, texte TEXT NOT NULL ); CREATE TABLE IF NOT EXISTS rappels_envoyes -- Enregistrement des rappels envoyés à qui et quand ( id INTEGER NOT NULL PRIMARY KEY, id_membre INTEGER NOT NULL REFERENCES membres (id), id_cotisation INTEGER NOT NULL REFERENCES cotisations (id), id_rappel INTEGER NULL REFERENCES rappels (id), date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(date) IS NOT NULL AND datetime(date) = date), media INTEGER NOT NULL -- Média utilisé pour le rappel : 1 = email, 2 = courrier, 3 = autre ); -- -- WIKI -- CREATE TABLE IF NOT EXISTS wiki_pages -- Pages du wiki ( id INTEGER PRIMARY KEY NOT NULL, uri TEXT NOT NULL, -- URI unique (équivalent NomPageWiki) titre TEXT NOT NULL, date_creation TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(date_creation) IS NOT NULL AND datetime(date_creation) = date_creation), date_modification TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(date_modification) IS NOT NULL AND datetime(date_modification) = date_modification), parent INTEGER NOT NULL DEFAULT 0, -- ID de la page parent revision INTEGER NOT NULL DEFAULT 0, -- Numéro de révision (commence à 0 si pas de texte, +1 à chaque changement du texte) droit_lecture INTEGER NOT NULL DEFAULT 0, -- Accès en lecture (-1 = public [site web], 0 = tous ceux qui ont accès en lecture au wiki, 1+ = ID de groupe) droit_ecriture INTEGER NOT NULL DEFAULT 0 -- Accès en écriture (0 = tous ceux qui ont droit d'écriture sur le wiki, 1+ = ID de groupe) ); CREATE UNIQUE INDEX IF NOT EXISTS wiki_uri ON wiki_pages (uri); CREATE VIRTUAL TABLE IF NOT EXISTS wiki_recherche USING fts4 -- Table dupliquée pour chercher une page ( id INT PRIMARY KEY NOT NULL, -- Clé externe obligatoire titre TEXT NOT NULL, contenu TEXT NULL, -- Contenu de la dernière révision FOREIGN KEY (id) REFERENCES wiki_pages(id) ); CREATE TABLE IF NOT EXISTS wiki_revisions -- Révisions du contenu des pages ( id_page INTEGER NOT NULL, revision INTEGER NULL, id_auteur INTEGER NULL, contenu TEXT NOT NULL, modification TEXT NULL, -- Description des modifications effectuées chiffrement INTEGER NOT NULL DEFAULT 0, -- 1 si le contenu est chiffré, 0 sinon date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(date) IS NOT NULL AND datetime(date) = date), PRIMARY KEY(id_page, revision), FOREIGN KEY (id_page) REFERENCES wiki_pages (id), -- Clé externe obligatoire FOREIGN KEY (id_auteur) REFERENCES membres (id) -- Clé externe non-obligatoire (peut être supprimée après en cas de suppression de membre) ); CREATE INDEX IF NOT EXISTS wiki_revisions_id_page ON wiki_revisions (id_page); CREATE INDEX IF NOT EXISTS wiki_revisions_id_auteur ON wiki_revisions (id_auteur); -- Triggers pour synchro avec table wiki_pages CREATE TRIGGER IF NOT EXISTS wiki_recherche_delete AFTER DELETE ON wiki_pages BEGIN DELETE FROM wiki_recherche WHERE id = old.id; END; CREATE TRIGGER IF NOT EXISTS wiki_recherche_update AFTER UPDATE OF id, titre ON wiki_pages BEGIN UPDATE wiki_recherche SET id = new.id, titre = new.titre WHERE id = old.id; END; -- Trigger pour mettre à jour le contenu de la table de recherche lors d'une nouvelle révision CREATE TRIGGER IF NOT EXISTS wiki_recherche_contenu_insert AFTER INSERT ON wiki_revisions WHEN new.chiffrement != 1 BEGIN UPDATE wiki_recherche SET contenu = new.contenu WHERE id = new.id_page; END; -- Si le contenu est chiffré, la recherche n'affiche pas de contenu CREATE TRIGGER IF NOT EXISTS wiki_recherche_contenu_chiffre AFTER INSERT ON wiki_revisions WHEN new.chiffrement = 1 BEGIN UPDATE wiki_recherche SET contenu = '' WHERE id = new.id_page; END; /* CREATE TABLE wiki_suivi -- Suivi des pages |
︙ | ︙ | |||
182 183 184 185 186 187 188 | ); */ -- -- COMPTA -- | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | ); */ -- -- COMPTA -- CREATE TABLE IF NOT EXISTS compta_exercices -- Exercices ( id INTEGER NOT NULL PRIMARY KEY, libelle TEXT NOT NULL, debut TEXT NOT NULL DEFAULT CURRENT_DATE CHECK (date(debut) IS NOT NULL AND date(debut) = debut), fin TEXT NULL DEFAULT NULL CHECK (fin IS NULL OR (date(fin) IS NOT NULL AND date(fin) = fin)), cloture INTEGER NOT NULL DEFAULT 0 ); CREATE TABLE IF NOT EXISTS compta_comptes -- Plan comptable ( id TEXT NOT NULL PRIMARY KEY, -- peut contenir des lettres, eg. 53A, 53B, etc. parent TEXT NOT NULL DEFAULT 0, libelle TEXT NOT NULL, position INTEGER NOT NULL, -- position actif/passif/charge/produit plan_comptable INTEGER NOT NULL DEFAULT 1, -- 1 = fait partie du plan comptable, 0 = a été ajouté par l'utilisateur desactive INTEGER NOT NULL DEFAULT 0 -- 1 = compte historique désactivé ); CREATE INDEX IF NOT EXISTS compta_comptes_parent ON compta_comptes (parent); CREATE TABLE IF NOT EXISTS compta_comptes_bancaires -- Comptes bancaires ( id TEXT NOT NULL PRIMARY KEY, banque TEXT NOT NULL, iban TEXT NULL, bic TEXT NULL, FOREIGN KEY(id) REFERENCES compta_comptes(id) ); CREATE TABLE IF NOT EXISTS compta_journal -- Journal des opérations comptables ( id INTEGER PRIMARY KEY, libelle TEXT NOT NULL, remarques TEXT NULL, numero_piece TEXT NULL, -- N° de pièce comptable montant REAL NOT NULL, date TEXT NOT NULL DEFAULT CURRENT_DATE CHECK (date(date) IS NOT NULL AND date(date) = date), moyen_paiement TEXT NULL, numero_cheque TEXT NULL, compte_debit TEXT NULL, -- N° du compte dans le plan, NULL est utilisé pour une opération qui vient d'un exercice précédent compte_credit TEXT NULL, -- N° du compte dans le plan id_exercice INTEGER NULL DEFAULT NULL, -- En cas de compta simple, l'exercice est permanent (NULL) id_auteur INTEGER NULL, id_categorie INTEGER NULL, -- Numéro de catégorie (en mode simple) FOREIGN KEY(moyen_paiement) REFERENCES compta_moyens_paiement(code), FOREIGN KEY(compte_debit) REFERENCES compta_comptes(id), FOREIGN KEY(compte_credit) REFERENCES compta_comptes(id), FOREIGN KEY(id_exercice) REFERENCES compta_exercices(id), FOREIGN KEY(id_auteur) REFERENCES membres(id), FOREIGN KEY(id_categorie) REFERENCES compta_categories(id) ); CREATE INDEX IF NOT EXISTS compta_operations_exercice ON compta_journal (id_exercice); CREATE INDEX IF NOT EXISTS compta_operations_date ON compta_journal (date); CREATE INDEX IF NOT EXISTS compta_operations_comptes ON compta_journal (compte_debit, compte_credit); CREATE INDEX IF NOT EXISTS compta_operations_auteur ON compta_journal (id_auteur); CREATE TABLE IF NOT EXISTS compta_moyens_paiement -- Moyens de paiement ( code TEXT NOT NULL PRIMARY KEY, nom TEXT NOT NULL ); --INSERT INTO compta_moyens_paiement (code, nom) VALUES ('AU', 'Autre'); INSERT OR IGNORE INTO compta_moyens_paiement (code, nom) VALUES ('CB', 'Carte bleue'); INSERT OR IGNORE INTO compta_moyens_paiement (code, nom) VALUES ('CH', 'Chèque'); INSERT OR IGNORE INTO compta_moyens_paiement (code, nom) VALUES ('ES', 'Espèces'); INSERT OR IGNORE INTO compta_moyens_paiement (code, nom) VALUES ('PR', 'Prélèvement'); INSERT OR IGNORE INTO compta_moyens_paiement (code, nom) VALUES ('TI', 'TIP'); INSERT OR IGNORE INTO compta_moyens_paiement (code, nom) VALUES ('VI', 'Virement'); CREATE TABLE IF NOT EXISTS compta_categories -- Catégories pour simplifier le plan comptable ( id INTEGER NOT NULL PRIMARY KEY, type INTEGER NOT NULL DEFAULT 1, -- 1 = recette, -1 = dépense, 0 = autre (utilisé uniquement pour l'interface) intitule TEXT NOT NULL, description TEXT NULL, compte TEXT NOT NULL, -- Compte affecté par cette catégorie FOREIGN KEY(compte) REFERENCES compta_comptes(id) ); CREATE TABLE IF NOT EXISTS plugins ( id TEXT NOT NULL PRIMARY KEY, officiel INTEGER NOT NULL DEFAULT 0, nom TEXT NOT NULL, description TEXT NULL, auteur TEXT NULL, url TEXT NULL, version TEXT NOT NULL, menu INTEGER NOT NULL DEFAULT 0, config TEXT NULL ); CREATE TABLE IF NOT EXISTS plugins_signaux -- Association entre plugins et signaux (hooks) ( signal TEXT NOT NULL, plugin TEXT NOT NULL REFERENCES plugins (id), callback TEXT NOT NULL, PRIMARY KEY (signal, plugin) ); CREATE TABLE IF NOT EXISTS compta_rapprochement -- Rapprochement entre compta et relevés de comptes ( id_operation INTEGER NOT NULL PRIMARY KEY REFERENCES compta_journal (id), date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(date) IS NOT NULL AND datetime(date) = date), id_auteur INTEGER NULL REFERENCES membres (id) ); CREATE TABLE IF NOT EXISTS fichiers -- Données sur les fichiers ( id INTEGER NOT NULL PRIMARY KEY, nom TEXT NOT NULL, -- nom de fichier (par exemple image1234.jpeg) type TEXT NULL, -- Type MIME image INTEGER NOT NULL DEFAULT 0, -- 1 = image reconnue datetime TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP CHECK (datetime(datetime) IS NOT NULL AND datetime(datetime) = datetime), -- Date d'ajout ou mise à jour du fichier id_contenu INTEGER NOT NULL REFERENCES fichiers_contenu (id) ); CREATE INDEX IF NOT EXISTS fichiers_date ON fichiers (datetime); CREATE TABLE IF NOT EXISTS fichiers_contenu -- Contenu des fichiers ( id INTEGER NOT NULL PRIMARY KEY, hash TEXT NOT NULL, -- Hash SHA1 du contenu du fichier taille INTEGER NOT NULL, -- Taille en octets contenu BLOB NULL ); CREATE UNIQUE INDEX IF NOT EXISTS fichiers_hash ON fichiers_contenu (hash); CREATE TABLE IF NOT EXISTS fichiers_membres -- Associations entre fichiers et membres (photo de profil par exemple) ( fichier INTEGER NOT NULL REFERENCES fichiers (id), id INTEGER NOT NULL REFERENCES membres (id), PRIMARY KEY(fichier, id) ); CREATE TABLE IF NOT EXISTS fichiers_wiki_pages -- Associations entre fichiers et pages du wiki ( fichier INTEGER NOT NULL REFERENCES fichiers (id), id INTEGER NOT NULL REFERENCES wiki_pages (id), PRIMARY KEY(fichier, id) ); CREATE TABLE IF NOT EXISTS fichiers_compta_journal -- Associations entre fichiers et journal de compta (pièce comptable par exemple) ( fichier INTEGER NOT NULL REFERENCES fichiers (id), id INTEGER NOT NULL REFERENCES compta_journal (id), PRIMARY KEY(fichier, id) ); |
Modified src/include/init.php from [187ff141bb] to [bfc98c00e2].
1 2 3 4 5 6 7 8 9 10 | <?php namespace Garradin; error_reporting(-1); /* * Version de Garradin */ | > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; use KD2\ErrorManager; use KD2\Security; error_reporting(-1); /* * Version de Garradin */ |
︙ | ︙ | |||
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | if (!defined('Garradin\WWW_URI')) { // Automagic URL discover $path = str_replace(ROOT . '/www', '', getcwd()); $path = str_replace($path, '', dirname($_SERVER['SCRIPT_NAME'])); $path = (!empty($path[0]) && $path[0] != '/') ? '/' . $path : $path; $path = (substr($path, -1) != '/') ? $path . '/' : $path; define('Garradin\WWW_URI', $path); } if (!defined('Garradin\WWW_URL')) { $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost'); define('Garradin\WWW_URL', 'http' . (!empty($_SERVER['HTTPS']) ? 's' : '') . '://' . $host . WWW_URI); } static $default_config = [ | > > > > | | | | | > | | | | | | | | | | | | > > < < < < < < < < < < < < < < < < < < < < < < < | < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | > > > > > > > | | < < < < | > > > | > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < > | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | if (!defined('Garradin\WWW_URI')) { // Automagic URL discover $path = str_replace(ROOT . '/www', '', getcwd()); $path = str_replace($path, '', dirname($_SERVER['SCRIPT_NAME'])); $path = (!empty($path[0]) && $path[0] != '/') ? '/' . $path : $path; $path = (substr($path, -1) != '/') ? $path . '/' : $path; // Pour installations sans vhost $path = str_replace('/www/', '', $path); define('Garradin\WWW_URI', $path); } if (!defined('Garradin\WWW_URL')) { $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost'); define('Garradin\WWW_URL', 'http' . (!empty($_SERVER['HTTPS']) ? 's' : '') . '://' . $host . WWW_URI); } static $default_config = [ 'CACHE_ROOT' => DATA_ROOT . '/cache', 'DB_FILE' => DATA_ROOT . '/association.sqlite', 'DB_SCHEMA' => ROOT . '/include/data/schema.sql', 'PLUGINS_ROOT' => DATA_ROOT . '/plugins', 'PREFER_HTTPS' => false, 'ALLOW_MODIFIED_IMPORT' => true, 'PLUGINS_SYSTEM' => '', 'SHOW_ERRORS' => false, 'MAIL_ERRORS' => false, 'USE_CRON' => false, 'ENABLE_XSENDFILE' => false, 'SMTP_HOST' => false, 'SMTP_USER' => null, 'SMTP_PASSWORD' => null, 'SMTP_PORT' => 587, 'SMTP_SECURITY' => 'STARTTLS', ]; foreach ($default_config as $const => $value) { $const = sprintf('Garradin\\%s', $const); if (!defined($const)) { define($const, $value); } } const WEBSITE = 'http://garradin.eu/'; const PLUGINS_URL = 'https://garradin.eu/plugins/list.json'; const NTP_SERVER = 'fr.pool.ntp.org'; // PHP devrait être assez intelligent pour chopper la TZ système mais nan // il sait pas faire (sauf sur Debian qui a le bon patch pour ça), donc pour // éviter le message d'erreur à la con on définit une timezone par défaut // Pour utiliser une autre timezone, il suffit de définir date.timezone dans // un .htaccess ou dans config.local.php if (!ini_get('date.timezone')) { if (($tz = @date_default_timezone_get()) && $tz != 'UTC') { ini_set('date.timezone', $tz); } else { ini_set('date.timezone', 'Europe/Paris'); } } /** * Auto-chargement des dépendances */ class Loader { /** * Liste des classes déjà chargées * @var array */ static protected $loaded = []; /** * Inclure un fichier de classe depuis le nom de la classe * @param string $classname * @return void */ static public function load($classname) { $classname = ltrim($classname, '\\'); if (array_key_exists($classname, self::$loaded)) { return true; } // Plugins if (substr($classname, 0, 16) == 'Garradin\\Plugin\\') { $classname = substr($classname, 16); $plugin_name = substr($classname, 0, strpos($classname, '\\')); $filename = str_replace('\\', '/', substr($classname, strpos($classname, '\\')+1)); $path = 'phar://' . PLUGINS_ROOT . '/' . strtolower($plugin_name) . '.tar.gz/lib/' . $filename . '.php'; } else { // PSR-0 autoload $filename = str_replace('\\', '/', $classname); $path = ROOT . '/include/lib/' . $filename . '.php'; } if (!file_exists($path)) { throw new \Exception('File '.$path.' doesn\'t exists'); } self::$loaded[$classname] = true; require $path; } } \spl_autoload_register(['Garradin\Loader', 'load'], true); /* * Gestion des erreurs et exceptions */ class UserException extends \LogicException { } // activer le gestionnaire d'erreurs/exceptions ErrorManager::enable(SHOW_ERRORS ? ErrorManager::DEVELOPMENT : ErrorManager::PRODUCTION); ErrorManager::setLogFile(DATA_ROOT . '/error.log'); // activer l'envoi de mails si besoin est if (MAIL_ERRORS) { ErrorManager::setEmail(MAIL_ERRORS); } ErrorManager::setExtraDebugEnv([ 'Garradin version' => garradin_version(), 'Garradin data root' => DATA_ROOT, ]); ErrorManager::setProductionErrorTemplate('<!DOCTYPE html><html><head><title>Erreur interne</title> <style type="text/css"> body {font-family: sans-serif; } code, p, h1 { max-width: 400px; margin: 1em auto; display: block; } code { text-align: right; color: #666; } a { color: blue; } </style></head><body><h1>Erreur interne</h1><p>Désolé mais le serveur a rencontré une erreur interne et ne peut répondre à votre requête. Merci de ré-essayer plus tard.</p> <p>Si vous suspectez un bug dans Garradin, vous pouvez suivre <a href="http://dev.kd2.org/garradin/Rapporter+un+bug">ces instructions</a> pour le rapporter.</p> <if(email)><p>Un-e responsable a été notifié-e et cette erreur sera corrigée dès que possible.</p></if> <if(log)><code>Référence : <b>{$ref}</b></code></if> <p><a href="' . WWW_URL . '">← Retour à la page d\'accueil</a></p> </body></html>'); ErrorManager::setHtmlFooter('<hr /><section><article>Cette erreur est peut-être un bug dans Garradin ? En ce cas vous pouvez le rapporter en suivant <a href="http://dev.kd2.org/garradin/Rapporter+un+bug">ces instructions</a>.</section></article>'); function user_error($e) { if (PHP_SAPI == 'cli') { echo $e->getMessage(); } else { $tpl = Template::getInstance(); $tpl->assign('error', $e->getMessage()); $tpl->display('error.tpl'); } exit; } // Message d'erreur simple pour les erreurs de l'utilisateur ErrorManager::setCustomExceptionHandler('\Garradin\UserException', '\Garradin\user_error'); ErrorManager::setCustomExceptionHandler('\KD2\MiniSkelMarkupException', '\Garradin\user_error'); // Clé secrète utilisée pour chiffrer les tokens CSRF etc. if (!defined('Garradin\SECRET_KEY')) { $key = base64_encode(Security::random_bytes(64)); Install::setLocalConfig('SECRET_KEY', $key); define('Garradin\SECRET_KEY', $key); } // Intégration du secret pour les tokens Security::tokenSetSecret(SECRET_KEY); /* * Vérifications pour enclencher le processus d'installation ou de mise à jour */ if (!defined('Garradin\INSTALL_PROCESS') && !defined('Garradin\UPGRADE_PROCESS')) { if (!file_exists(DB_FILE)) { Utils::redirect('/admin/install.php'); |
︙ | ︙ |
Modified src/include/lib/Garradin/Compta/Categories.php from [387c950f70] to [ae38db4253].
1 2 3 4 | <?php namespace Garradin\Compta; | | | | > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <?php namespace Garradin\Compta; use Garradin\DB; use Garradin\Utils; use Garradin\UserException; /** * Catégories comptables */ class Categories { const DEPENSES = -1; const RECETTES = 1; const AUTRES = 0; public function importCategories() |
︙ | ︙ | |||
27 28 29 30 31 32 33 | if (empty($data['compte']) || !trim($data['compte'])) { throw new UserException('Le compte associé ne peut rester vide.'); } $data['compte'] = trim($data['compte']); | | | | | > > > > | | | | | | | > > | | | 30 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | if (empty($data['compte']) || !trim($data['compte'])) { throw new UserException('Le compte associé ne peut rester vide.'); } $data['compte'] = trim($data['compte']); if (!$db->firstColumn('SELECT 1 FROM compta_comptes WHERE id = ?;', $data['compte'])) { throw new UserException('Le compte associé n\'existe pas.'); } if (!isset($data['type']) || ($data['type'] != self::DEPENSES && $data['type'] != self::RECETTES)) { // Catégories "autres" pas possibles pour le moment throw new UserException('Type de catégorie inconnu.'); } $db->insert('compta_categories', [ 'intitule' => $data['intitule'], 'description'=> $data['description'], 'compte' => $data['compte'], 'type' => (int)$data['type'], ]); return $db->lastInsertRowId(); } public function edit($id, $data) { $this->_checkFields($data); $db = DB::getInstance(); $db->update('compta_categories', [ 'intitule' => $data['intitule'], 'description'=> $data['description'], ], 'id = :id_select', ['id_select' => (int) $id] ); return true; } public function delete($id) { $db = DB::getInstance(); $id = (int) $id; // Ne pas supprimer une catégorie qui est utilisée ! if ($db->firstColumn('SELECT 1 FROM compta_journal WHERE id_categorie = ? LIMIT 1;', $id)) { throw new UserException('Cette catégorie ne peut être supprimée car des opérations comptables y sont liées.'); } $db->delete('compta_categories', 'id = ?', $id); return true; } public function get($id) { $db = DB::getInstance(); return $db->first('SELECT * FROM compta_categories WHERE id = ?;', (int)$id); } public function getList($type = null) { $db = DB::getInstance(); $where = is_null($type) ? '1' : 'cat.type = '.(int)$type; $query = sprintf('SELECT cat.id, cat.*, cc.libelle AS compte_libelle FROM compta_categories AS cat INNER JOIN compta_comptes AS cc ON cc.id = cat.compte WHERE %s ORDER BY cat.intitule;', $where); return $db->getAssocKey($query); } public function listMoyensPaiement() { $db = DB::getInstance(); return $db->getAssocKey('SELECT code, nom FROM compta_moyens_paiement ORDER BY nom COLLATE NOCASE;'); } public function getMoyenPaiement($code) { $db = DB::getInstance(); return $db->firstColumn('SELECT nom FROM compta_moyens_paiement WHERE code = ?;', $code); } protected function _checkFields(&$data) { if (empty($data['intitule']) || !trim($data['intitule'])) { throw new UserException('L\'intitulé ne peut rester vide.'); |
︙ | ︙ |
Modified src/include/lib/Garradin/Compta/Comptes.php from [a19b8ea425] to [5e4270a61a].
︙ | ︙ | |||
16 17 18 19 20 21 22 | const CHARGE = 0x08; public function importPlan() { $plan = json_decode(file_get_contents(\Garradin\ROOT . '/include/data/plan_comptable.json'), true); $db = DB::getInstance(); | | | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | const CHARGE = 0x08; public function importPlan() { $plan = json_decode(file_get_contents(\Garradin\ROOT . '/include/data/plan_comptable.json'), true); $db = DB::getInstance(); $db->begin(); $ids = []; foreach ($plan as $id=>$compte) { $ids[] = $id; if ($db->simpleQuerySingle('SELECT 1 FROM compta_comptes WHERE id = ?;', false, $id)) |
︙ | ︙ | |||
46 47 48 49 50 51 52 | 'plan_comptable' => 1, ]); } } $db->exec('DELETE FROM compta_comptes WHERE id NOT IN(\''.implode('\', \'', $ids).'\') AND plan_comptable = 1;'); | | | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | 'plan_comptable' => 1, ]); } } $db->exec('DELETE FROM compta_comptes WHERE id NOT IN(\''.implode('\', \'', $ids).'\') AND plan_comptable = 1;'); $db->commit(); return true; } public function add($data) { $this->_checkFields($data, true); |
︙ | ︙ |
Modified src/include/lib/Garradin/Compta/Exercices.php from [3af8248722] to [0831de6860].
︙ | ︙ | |||
83 84 85 86 87 88 89 | $db = DB::getInstance(); if (!Utils::checkDate($end)) { throw new UserException('Date de fin vide ou invalide.'); } | | | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | $db = DB::getInstance(); if (!Utils::checkDate($end)) { throw new UserException('Date de fin vide ou invalide.'); } $db->begin(); // Clôture de l'exercice $db->simpleUpdate('compta_exercices', [ 'cloture' => 1, 'fin' => $end, ], 'id = \''.(int)$id.'\''); |
︙ | ︙ | |||
115 116 117 118 119 120 121 | ]); // Ré-attribution des opérations de l'exercice à clôturer qui ne sont pas dans son // intervale au nouvel exercice $db->simpleExec('UPDATE compta_journal SET id_exercice = ? WHERE id_exercice = ? AND date >= ?;', $new_id, $id, $new_begin); | | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | ]); // Ré-attribution des opérations de l'exercice à clôturer qui ne sont pas dans son // intervale au nouvel exercice $db->simpleExec('UPDATE compta_journal SET id_exercice = ? WHERE id_exercice = ? AND date >= ?;', $new_id, $id, $new_begin); $db->commit(); return $new_id; } /** * Créer les reports à nouveau issus de l'exercice $old_id dans le nouvel exercice courant * @param integer $old_id ID de l'ancien exercice * @param integer $new_id ID du nouvel exercice * @param string $date Date Y-m-d donnée aux opérations créées * @return boolean true si succès */ public function doReports($old_id, $date) { $db = DB::getInstance(); $db->begin(); $report_crediteur = 110; $report_debiteur = 119; $comptes = new Comptes; if (!$comptes->isActive($report_crediteur)) |
︙ | ︙ | |||
193 194 195 196 197 198 199 | 'compte_credit' => $compte_credit, 'remarques' => 'Report de solde créé automatiquement à la clôture de l\'exercice précédent', ]); } // FIXME utiliser $diff pour équilibrer | | | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | 'compte_credit' => $compte_credit, 'remarques' => 'Report de solde créé automatiquement à la clôture de l\'exercice précédent', ]); } // FIXME utiliser $diff pour équilibrer $db->commit(); return true; } /** * Solder les comptes de charge et de produits de l'exercice N * et les inscrire au résultat de l'exercice N+1 |
︙ | ︙ |
Modified src/include/lib/Garradin/Compta/Import.php from [a96dfe987a] to [d0fb4b8ed7].
︙ | ︙ | |||
78 79 80 81 82 83 84 | if (!$fp) { return false; } $db = DB::getInstance(); | | | 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | if (!$fp) { return false; } $db = DB::getInstance(); $db->begin(); $comptes = new Comptes; $banques = new Comptes_Bancaires; $cats = new Categories; $journal = new Journal; $columns = array_flip($this->csv_header); $liste_comptes = $db->simpleStatementFetchAssoc('SELECT id, id FROM compta_comptes;'); |
︙ | ︙ | |||
125 126 127 128 129 130 131 | } continue; } if (count($row) != count($columns)) { | | | | | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | } continue; } if (count($row) != count($columns)) { $db->rollback(); throw new UserException('Erreur sur la ligne ' . $line . ' : le nombre de colonnes est incorrect.'); } if (trim($row[0]) !== '' && !is_numeric($row[0])) { $db->rollback(); throw new UserException('Erreur sur la ligne ' . $line . ' : la première colonne doit être vide ou contenir le numéro unique d\'opération.'); } $id = $col('Numéro mouvement'); $date = $col('Date'); if (!preg_match('!^\d{2}/\d{2}/\d{4}$!', $date)) { $db->rollback(); throw new UserException('Erreur sur la ligne ' . $line . ' : la date n\'est pas au format jj/mm/aaaa.'); } $date = explode('/', $date); $date = $date[2] . '-' . $date[1] . '-' . $date[0]; // En dehors de l'exercice courant |
︙ | ︙ | |||
207 208 209 210 211 212 213 | } else { $journal->edit($id, $data); } } | | | | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | } else { $journal->edit($id, $data); } } $db->commit(); fclose($fp); return true; } public function fromCitizen($path) { if (!file_exists($path) || !is_readable($path)) { throw new \RuntimeException('Fichier inconnu : '.$path); } $fp = fopen($path, 'r'); if (!$fp) { return false; } $db = DB::getInstance(); $db->begin(); $comptes = new Comptes; $banques = new Comptes_Bancaires; $cats = new Categories; $journal = new Journal; $columns = []; $liste_comptes = $db->simpleStatementFetchAssoc('SELECT id, id FROM compta_comptes;'); |
︙ | ︙ | |||
304 305 306 307 308 309 310 | continue; } $date = $col('Date'); if (!preg_match('!^\d{2}/\d{2}/\d{4}$!', $date)) { | | | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | continue; } $date = $col('Date'); if (!preg_match('!^\d{2}/\d{2}/\d{4}$!', $date)) { $db->rollback(); throw new UserException('Erreur sur la ligne ' . $line . ' : la date n\'est pas au format jj/mm/aaaa.'); } $date = explode('/', $date); $date = $date[2] . '-' . $date[1] . '-' . $date[0]; if ($db->simpleQuerySingle('SELECT 1 FROM compta_exercices |
︙ | ︙ | |||
377 378 379 380 381 382 383 | $data['numero_cheque'] = $col('Numéro de chèque'); $data['id_categorie'] = $liste_cats[$cat]; } $journal->add($data); } | | | 377 378 379 380 381 382 383 384 385 386 387 388 389 | $data['numero_cheque'] = $col('Numéro de chèque'); $data['id_categorie'] = $liste_cats[$cat]; } $journal->add($data); } $db->commit(); fclose($fp); return true; } } |
Modified src/include/lib/Garradin/Compta/Journal.php from [8da9330c29] to [9b02ce740c].
︙ | ︙ | |||
147 148 149 150 151 152 153 | // Vérification que l'on peut éditer cette opération if (!$this->_checkOpenExercice($db->simpleQuerySingle('SELECT id_exercice FROM compta_journal WHERE id = ?;', false, $id))) { throw new UserException('Cette opération fait partie d\'un exercice qui a été clôturé.'); } | | | | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | // Vérification que l'on peut éditer cette opération if (!$this->_checkOpenExercice($db->simpleQuerySingle('SELECT id_exercice FROM compta_journal WHERE id = ?;', false, $id))) { throw new UserException('Cette opération fait partie d\'un exercice qui a été clôturé.'); } $db->begin(); $db->simpleExec('DELETE FROM membres_operations WHERE id_operation = ?;', (int)$id); $db->simpleExec('DELETE FROM compta_rapprochement WHERE id_operation = ?;', (int)$id); $db->simpleExec('DELETE FROM compta_journal WHERE id = ?;', (int)$id); $db->commit(); return true; } public function get($id) { $db = DB::getInstance(); |
︙ | ︙ |
Modified src/include/lib/Garradin/Compta/Rapprochement.php from [883bfc5b12] to [b2268513dd].
︙ | ︙ | |||
63 64 65 66 67 68 69 | if (!is_array($cases) && empty($cases)) { $cases = []; } $db = DB::getInstance(); | | | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | if (!is_array($cases) && empty($cases)) { $cases = []; } $db = DB::getInstance(); $db->begin(); // Synchro des trucs cochés $st = $db->prepare('INSERT OR REPLACE INTO compta_rapprochement (id_operation, id_auteur) VALUES (:operation, :auteur);'); $st->bindValue(':auteur', (int)$auteur, \SQLITE3_INTEGER); foreach ($journal as $row) |
︙ | ︙ | |||
91 92 93 94 95 96 97 | if (array_key_exists($row['id'], $cases)) continue; $st->bindValue(':id', (int)$row['id'], \SQLITE3_INTEGER); $st->execute(); } | | | 91 92 93 94 95 96 97 98 99 100 101 | if (array_key_exists($row['id'], $cases)) continue; $st->bindValue(':id', (int)$row['id'], \SQLITE3_INTEGER); $st->execute(); } $db->commit(); return true; } } |
Modified src/include/lib/Garradin/Config.php from [0b6eaf88e0] to [1f5a25e628].
︙ | ︙ | |||
65 66 67 68 69 70 71 | 'champ_identite' => $string, 'version' => $string, ]; $db = DB::getInstance(); | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | 'champ_identite' => $string, 'version' => $string, ]; $db = DB::getInstance(); $this->config = $db->getAssoc('SELECT cle, valeur FROM config ORDER BY cle;'); foreach ($this->config as $key=>&$value) { if (!array_key_exists($key, $this->fields_types)) { // Ancienne clé de config qui n'est plus utilisée continue; |
︙ | ︙ | |||
107 108 109 110 111 112 113 | { if (empty($this->modified)) return true; $values = []; $db = DB::getInstance(); | | | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | { if (empty($this->modified)) return true; $values = []; $db = DB::getInstance(); $db->begin(); foreach ($this->modified as $key=>$modified) { $value = $this->config[$key]; if (is_array($value)) { |
︙ | ︙ | |||
137 138 139 140 141 142 143 | WHERE '.$this->get('champ_identifiant').' = "";'); // Création de l'index unique $db->exec('DROP INDEX IF EXISTS membres_identifiant;'); $db->exec('CREATE UNIQUE INDEX membres_identifiant ON membres ('.$this->get('champ_identifiant').');'); } | | | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | WHERE '.$this->get('champ_identifiant').' = "";'); // Création de l'index unique $db->exec('DROP INDEX IF EXISTS membres_identifiant;'); $db->exec('CREATE UNIQUE INDEX membres_identifiant ON membres ('.$this->get('champ_identifiant').');'); } $db->commit(); $this->modified = []; return true; } public function get($key) |
︙ | ︙ | |||
271 272 273 274 275 276 277 | break; } case 'categorie_cotisations': case 'categorie_dons': { return false; $db = DB::getInstance(); | | | | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | break; } case 'categorie_cotisations': case 'categorie_dons': { return false; $db = DB::getInstance(); if (!$db->firstColumn('SELECT 1 FROM compta_categories WHERE id = ?;', $value)) { throw new UserException('Champ '.$key.' : La catégorie comptable numéro \''.$value.'\' ne semble pas exister.'); } break; } case 'categorie_membres': { $db = DB::getInstance(); if (!$db->firstColumn('SELECT 1 FROM membres_categories WHERE id = ?;', $value)) { throw new UserException('La catégorie de membres par défaut numéro \''.$value.'\' ne semble pas exister.'); } break; } case 'monnaie': { |
︙ | ︙ |
Modified src/include/lib/Garradin/Cotisations.php from [3a4282d675] to [afff89c062].
︙ | ︙ | |||
83 84 85 86 87 88 89 | */ public function add($data) { $db = DB::getInstance(); $this->_checkFields($data); | | | < < | | | | > | | | > | | | | | | | | 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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | */ public function add($data) { $db = DB::getInstance(); $this->_checkFields($data); $db->insert('cotisations', $data); return $db->lastInsertRowId(); } /** * Modifier une cotisation * @param integer $id ID de la cotisation à modifier * @param array $data Tableau des champs à modifier * @return bool true si succès */ public function edit($id, $data) { $db = DB::getInstance(); $this->_checkFields($data); return $db->update('cotisations', $data, 'id = :id', ['id' => (int) $id]); } /** * Supprimer une cotisation * @param integer $id ID de la cotisation à supprimer * @return integer true en cas de succès */ public function delete($id) { $db = DB::getInstance(); $db->begin(); // Inscrire à NULL les opérations liées à cette cotisation, ainsi on conserve le lien avec les membres $db->update('membres_operations', ['id_cotisation' => null], 'id_cotisation IN (SELECT id FROM cotisations_membres WHERE id_cotisation = :id_select)', ['id_select' => (int) $id]); $db->delete('rappels', 'id_cotisation = ?', (int) $id); $db->delete('rappels_envoyes', 'id_cotisation = ?', (int) $id); $db->delete('cotisations_membres', 'id_cotisation = ?', (int) $id); $db->delete('cotisations', 'id = ?', (int) $id); $db->commit(); return true; } /** * Renvoie les infos sur une cotisation * @param integer $id Numéro de la cotisation * @return array Infos de la cotisation */ public function get($id) { $db = DB::getInstance(); return $db->first('SELECT co.*, (SELECT COUNT(DISTINCT id_membre) FROM cotisations_membres WHERE id_cotisation = co.id) AS nb_membres, (SELECT COUNT(DISTINCT id_membre) FROM cotisations_membres AS cm WHERE id_cotisation = co.id AND ((co.duree IS NOT NULL AND date(cm.date, \'+\'||co.duree||\' days\') >= date()) OR (co.fin IS NOT NULL AND co.debut <= cm.date AND co.fin >= cm.date))) AS nb_a_jour FROM cotisations AS co WHERE id = :id;', ['id' => (int) $id]); } public function listByName() { $db = DB::getInstance(); return $db->get('SELECT * FROM cotisations ORDER BY intitule;'); } public function listCurrent() { $db = DB::getInstance(); return $db->get('SELECT * FROM cotisations WHERE fin >= date(\'now\') OR fin IS NULL ORDER BY transliterate_to_ascii(intitule) COLLATE NOCASE;'); } public function listWithStats() { $db = DB::getInstance(); return $db->get('SELECT co.*, (SELECT COUNT(DISTINCT id_membre) FROM cotisations_membres WHERE id_cotisation = co.id) AS nb_membres, (SELECT COUNT(DISTINCT id_membre) FROM cotisations_membres AS cm WHERE id_cotisation = co.id AND ((co.duree IS NOT NULL AND date(cm.date, \'+\'||co.duree||\' days\') >= date()) OR (co.fin IS NOT NULL AND co.debut <= cm.date AND co.fin >= cm.date))) AS nb_a_jour FROM cotisations AS co ORDER BY transliterate_to_ascii(intitule) COLLATE NOCASE;'); } } |
Modified src/include/lib/Garradin/DB.php from [b1c44ce023] to [877e8d23cd].
1 2 3 4 | <?php namespace Garradin; | | < | > | < > | | | < | | > | > > | > > > > | > > > > | > > > > > > > > > > | | > > | > | > > > > > > > > > > > > > | | | | | | > | < < < | < < < < < < < < < | < | < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | > | | | | > | | | | > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | <?php namespace Garradin; class DB { /** * Application ID pour SQLite * @link https://www.sqlite.org/pragma.html#pragma_application_id */ const APPID = 0x5da2d811; static protected $_instance = null; /** * Instance SQLite3 * @var SQLite3 */ protected $db = null; /** * Options d'initialisation de SQLite3 * @var null */ protected $flags = null; /** * Transaction en cours? * @var integer */ protected $transaction = 0; /** * Modes de retour des résultats */ const NUM = \SQLITE3_NUM; const ASSOC = \SQLITE3_ASSOC; const BOTH = \SQLITE3_BOTH; const OBJ = 4; // SQLITE3_ASSOC, NUM and BOTH are 1, 2 and 3, so let's start at 4 /** * Format de date utilisé pour le stockage */ const DATE_FORMAT = 'Y-m-d H:i:s'; static public function getInstance($create = false) { return self::$_instance ?: self::$_instance = new DB($create); } private function __clone() { // Désactiver le clonage, car on ne veut qu'une seule instance } public function __construct($create = false) { $this->flags = \SQLITE3_OPEN_READWRITE; if ($create) { $this->flags |= \SQLITE3_OPEN_CREATE; } // Ne pas se connecter ici, on ne se connectera que quand une requête sera faite } public function close() { $this->db->close(); $this->db = null; } public function connect() { if ($this->db) { return true; } $this->db = new \SQLite3(DB_FILE, $this->flags); $this->db->enableExceptions(true); // Le timeout par défaut est 0, on le met à 1 seconde, si ça ne suffit pas on augmentera plus tard $this->db->busyTimeout(1000); // Activer les contraintes des foreign keys $this->db->exec('PRAGMA foreign_keys = ON;'); $this->db->createFunction('transliterate_to_ascii', ['Garradin\Utils', 'transliterateToAscii']); $this->db->createFunction('base64', 'base64_encode'); $this->db->createFunction('rank', ['\KD2\DB', 'sqlite_rank']); $this->db->createFunction('haversine_distance', ['\KD2\DB', 'sqlite_haversine']); } public function escape($str) { // escapeString n'est pas binary safe: https://bugs.php.net/bug.php?id=62361 $str = str_replace("\0", "\\0", $str); $this->connect(); return $this->db->escapeString($str); } public function quote($str) { return '\'' . $this->escape($str) . '\''; } public function begin() { if (!$this->transaction) { $this->connect(); $this->db->exec('BEGIN;'); } $this->transaction++; return $this->transaction == 1 ? true : false; } public function commit() { if ($this->transaction == 1) { $this->connect(); $this->db->exec('END;'); } if ($this->transaction > 0) { $this->transaction--; } return $this->transaction ? false : true; } public function rollback() { $this->connect(); $this->db->exec('ROLLBACK;'); $this->transaction = 0; return true; } public function getArgType(&$arg, $name = '') { switch (gettype($arg)) { |
︙ | ︙ | |||
172 173 174 175 176 177 178 179 180 181 182 183 | && in_array($arg[0], [\SQLITE3_FLOAT, \SQLITE3_INTEGER, \SQLITE3_NULL, \SQLITE3_TEXT, \SQLITE3_BLOB])) { $type = $arg[0]; $arg = $arg[1]; return $type; } default: throw new \InvalidArgumentException('Argument '.$name.' is of invalid type '.gettype($arg)); } } | > > > > > > > > > > > > > > > > > > > > | > > > > > > > | > > > > > | > > > > | | > > > > > > > > | > | > | > > > > | > | > > > > > > > > > > > > | | > | > | > > > > > > > > > > > > > > > > | < | | < | < < < < | < < < | < < | | < | < < < < < | < < | | < > > > > | | > > > > > | | > > > > > > > > > | > > > > > > > > > > > | | > | > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > | > > > > > > > > > > > > | > > > > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > < < < < | | | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | < | < < < < < < < < < < | | | < < < | < < < < < < < < < < < < < < < < < < < < < < < < | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | && in_array($arg[0], [\SQLITE3_FLOAT, \SQLITE3_INTEGER, \SQLITE3_NULL, \SQLITE3_TEXT, \SQLITE3_BLOB])) { $type = $arg[0]; $arg = $arg[1]; return $type; } case 'object': if ($arg instanceof \DateTime) { $arg = clone $arg; $arg->setTimezone(new \DateTimezone('UTC')); $arg = $arg->format(self::DATE_FORMAT); return \SQLITE3_TEXT; } default: throw new \InvalidArgumentException('Argument '.$name.' is of invalid type '.gettype($arg)); } } /** * Performe une requête en utilisant les arguments contenus dans le tableau $args * @param string $query Requête SQL * @param array|object $args Arguments à utiliser comme bindings pour la requête * @return \SQLite3Statement|boolean Retourne un booléen si c'est une requête * qui exécute une opération d'écriture, ou un statement si c'est une requête de lecture. * * Note: le fait que cette fonction retourne un booléen est un comportement * volontaire pour éviter un bug dans le module SQLite3 de PHP, qui provoque * un risque de faire des opérations en double en cas d'exécution de * ->fetchResult() sur un statement d'écriture. */ public function query($query, Array $args = []) { assert(is_string($query)); assert(is_array($args) || is_object($args)); // Forcer en tableau $args = (array) $args; $this->connect(); $statement = $this->db->prepare($query); $nb = $statement->paramCount(); if (!empty($args)) { if (is_array($args) && count($args) == 1 && is_array(current($args))) { $args = current($args); } if (count($args) != $nb) { throw new \LengthException('Arguments error: '.count($args).' supplied, but '.$nb.' are required by query.'); } reset($args); if (is_int(key($args))) { foreach ($args as $i=>$arg) { if (is_string($i)) { throw new \InvalidArgumentException(sprintf('%s requires argument to be a keyed array, but key %s is a string.', __FUNCTION__, $i)); } $type = $this->getArgType($arg, $i+1); $statement->bindValue((int)$i+1, $arg, $type); } } else { foreach ($args as $key=>$value) { if (is_int($key)) { throw new \InvalidArgumentException(sprintf('%s requires argument to be a named-associative array, but key %s is an integer.', __FUNCTION__, $key)); } $type = $this->getArgType($value, $key); $statement->bindValue(':'.$key, $value, $type); } } } try { // Return a boolean for write queries to avoid accidental duplicate execution // see https://bugs.php.net/bug.php?id=64531 $result = $statement->execute(); return $statement->readOnly() ? $result : (bool) $result; } catch (\Exception $e) { throw new \RuntimeException($e->getMessage() . "\n" . $query . "\n" . json_encode($args, true)); } } /** * Exécute une requête et retourne le résultat sous forme de tableau * @param string $query Requête SQL * @return array Tableau contenant des objets * * Accepte un ou plusieurs arguments supplémentaires utilisés comme bindings * pour la clause WHERE. */ public function get($query) { $args = array_slice(func_get_args(), 1); $out = []; foreach ($this->fetch($this->query($query, $args), self::OBJ) as $key=>$row) { $out[$key] = $row; } return $out; } /** * Exécute une requête et retourne le résultat sous forme de tableau associatif * en utilisant les deux premières colonnes retournées, * de la forme [colonne1 => colonne2, colonne1 => colonne2, ...] * @param string $query Requête SQL * @return array Tableau associatif * * Accepte un ou plusieurs arguments supplémentaires utilisés comme bindings * pour la clause WHERE. */ public function getAssoc($query) { $args = array_slice(func_get_args(), 1); $out = []; foreach ($this->fetchAssoc($this->query($query, $args)) as $key=>$row) { $out[$key] = $row; } return $out; } /** * Exécute une requête et retourne le résultat sous forme de tableau associatif * en utilisant la première colonne comme clé: * [colonne1 => (object) [colonne1 => valeur1, colonne2 => valeur2, ...], ...] * @param string $query Requête SQL * @return array Tableau associatif contenant des objets * * Accepte un ou plusieurs arguments supplémentaires utilisés comme bindings * pour la clause WHERE. */ public function getAssocKey($query) { $args = array_slice(func_get_args(), 1); $out = []; foreach ($this->fetchAssocKey($this->query($query, $args), self::OBJ) as $key=>$row) { $out[$key] = $row; } return $out; } /** * Insère une ligne dans la table $table, en remplissant avec les champs donnés * dans $fields (tableau associatif ou objet) * @param string $table Table où insérer * @param string $fields Champs à remplir * @return boolean */ public function insert($table, $fields) { assert(is_array($fields) || is_object($fields)); $fields = (array) $fields; $fields_names = array_keys($fields); $query = sprintf('INSERT INTO %s (%s) VALUES (:%s);', $table, implode(', ', $fields_names), implode(', :', $fields_names)); return $this->query($query, $fields); } /** * Met à jour une ou plusieurs lignes de la table * @param string $table Nom de la table * @param array|object $fields Liste des champs à mettre à jour * @param string $where Clause WHERE * @param array|object $args Arguments pour la clause WHERE * @return boolean */ public function update($table, $fields, $where = null, $args = []) { assert(is_string($table)); assert((is_string($where) && strlen($where)) || is_null($where)); assert(is_array($fields) || is_object($fields)); assert(is_array($args) || is_object($args)); // Forcer en tableau $fields = (array) $fields; $args = (array) $args; // No fields to update? no need to do a query if (empty($fields)) { return false; } $column_updates = []; foreach ($fields as $key=>$value) { // Append to arguments $args['field_' . $key] = $value; $column_updates[] = sprintf('%s = :field_%s', $key, $key); } if (is_null($where)) { $where = '1'; } // Assemblage de la requête $column_updates = implode(', ', $column_updates); $query = sprintf('UPDATE %s SET %s WHERE %s;', $table, $column_updates, $where); return $this->query($query, $args); } /** * Supprime une ou plusieurs lignes d'une table * @param string $table Nom de la table * @param string $where Clause WHERE * @return boolean * * Accepte un ou plusieurs arguments supplémentaires utilisés comme bindings * pour la clause WHERE. */ public function delete($table, $where) { $query = sprintf('DELETE FROM %s WHERE %s;', $table, $where); return $this->query($query, array_slice(func_get_args(), 2)); } /** * Exécute une requête SQL (alias pour query) * @param string $query Requête SQL * @return boolean * * Accepte un ou plusieurs arguments supplémentaires utilisés comme bindings. */ public function exec($query) { return $this->db->exec($query); } /** * Import a file containing SQL commands * Allows to use the statement ".import other_file.sql" to load other files * @param string $file Path to file containing SQL commands * @return boolean */ public function import($file) { $sql = file_get_contents($file); $dir = dirname($file); $sql = preg_replace_callback('/^\.import (.+\.sql)$/m', function ($match) use ($dir) { return file_get_contents($dir . DIRECTORY_SEPARATOR . $match[1]) . "\n"; }, $sql); return $this->db->exec($sql); } /** * Exécute une requête et retourne la première ligne * @param string $query Requête SQL * @return object * * Accepte un ou plusieurs arguments supplémentaires utilisés comme bindings. */ public function first($query) { $res = $this->query($query, array_slice(func_get_args(), 1)); $row = $res->fetchArray(SQLITE3_ASSOC); $res->finalize(); return is_array($row) ? (object) $row : false; } /** * Exécute une requête et retourne la première colonne de la première ligne * @param string $query Requête SQL * @return object * * Accepte un ou plusieurs arguments supplémentaires utilisés comme bindings. */ public function firstColumn($query) { $res = $this->query($query, array_slice(func_get_args(), 1)); $row = $res->fetchArray(\SQLITE3_NUM); return count($row) > 0 ? $row[0] : false; } /** * Récupère le résultat d'un statement * @param \SQLite3Result $result Résultat de statement * @param integer $mode Mode de récupération (BOTH, OBJ, NUM ou ASSOC) * @return array */ public function fetch(\SQLite3Result $result, $mode = null) { $as_obj = false; if ($mode === self::OBJ) { $as_obj = true; $mode = self::ASSOC; } while ($row = $result->fetchArray($mode)) { yield ($as_obj ? (object) $row : $row); } $result->finalize(); unset($result, $row); return; } /** * Récupère le résultat d'un statement sous forme de tableau associatif * avec colonne1 comme clé et colonne2 comme valeur. * * @param \SQLite3Result $result Résultat de statement * @param integer $mode Mode de récupération (BOTH, OBJ, NUM ou ASSOC) * @return array */ protected function fetchAssoc(\SQLite3Result $result) { while ($row = $result->fetchArray(\SQLITE3_NUM)) { yield $row[0] => $row[1]; } $result->finalize(); unset($result, $row); return; } /** * Récupère le résultat d'un statement sous forme de tableau associatif * avec colonne1 comme clé et la ligne comme valeur. * @param \SQLite3Result $result Résultat de statement * @param integer $mode Mode de récupération (BOTH, OBJ, NUM ou ASSOC) * @return array */ protected function fetchAssocKey(\SQLite3Result $result, $mode = null) { $as_obj = false; if ($mode === self::OBJ) { $as_obj = true; $mode = self::ASSOC; } while ($row = $result->fetchArray($mode)) { $key = current($row); yield $key => ($as_obj ? (object) $row : $row); } $result->finalize(); unset($result, $row, $key); return; } /** * Compte le nombre de lignes dans un résultat * @param \SQLite3Result $result Résultat SQLite3 * @return integer */ public function countRows(\SQLite3Result $result) { $i = 0; while ($result->fetchArray(\SQLITE3_NUM)) { $i++; } $result->reset(); return $i; } public function lastInsertRowId() { return $this->db->lastInsertRowId(); } /** * Préparer un statement SQLite3 * @param string $query Requête SQL * @return \SQLite3Statement */ public function prepare($query) { return $this->db->prepare($query); } /** * @deprecated */ public function simpleInsert($table, Array $fields) { return $this->insert($table, $fields); } /** * @deprecated */ public function simpleUpdate($table, Array $fields, $where) { return $this->update($table, $fields, $where); } /** * @deprecated */ public function simpleExec($query) { return $this->simpleStatement($query, array_slice(func_get_args(), 1)); } /** * @deprecated */ public function escapeString($str) { return $this->escape($str); } /** * @deprecated */ public function simpleStatement($query, Array $args = []) { return $this->query($query, $args); } /** * @deprecated */ public function simpleStatementFetch($query, $mode = null) { $args = array_slice(func_get_args(), 2); return $this->get($this->query($query, $args), $mode); } /** * @deprecated */ public function simpleStatementFetchAssoc($query) { $args = array_slice(func_get_args(), 1); return $this->getAssoc($this->query($query, $args)); } /** * @deprecated */ public function simpleStatementFetchAssocKey($query, $mode = null) { $args = array_slice(func_get_args(), 2); return $this->getAssocKey($this->query($query, $args), $mode); } /** * @deprecated */ public function queryFetch($query, $mode = null) { return $this->fetch($this->query($query), $mode); } /** * @deprecated */ public function queryFetchAssoc($query) { return $this->fetchAssoc($this->query($query)); } /** * @deprecated */ public function queryFetchAssocKey($query, $mode = null) { return $this->fetchAssocKey($this->query($query), $mode); } /** * @deprecated */ public function simpleQuerySingle($query, $all_columns = false) { $res = $this->query($query, array_slice(func_get_args(), 2)); $row = $res->fetchArray($all_columns ? SQLITE3_ASSOC : SQLITE3_NUM); $res->finalize(); if (!$all_columns) { if (isset($row[0])) { return $row[0]; } return false; } else { return $row; } } } |
Modified src/include/lib/Garradin/Fichiers.php from [2f1047e8fe] to [6317211824].
︙ | ︙ | |||
203 204 205 206 207 208 209 | /** * Supprime le fichier * @return boolean TRUE en cas de succès */ public function remove() { $db = DB::getInstance(); | | | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | /** * Supprime le fichier * @return boolean TRUE en cas de succès */ public function remove() { $db = DB::getInstance(); $db->begin(); $db->simpleExec('DELETE FROM fichiers_compta_journal WHERE fichier = ?;', (int)$this->id); $db->simpleExec('DELETE FROM fichiers_wiki_pages WHERE fichier = ?;', (int)$this->id); $db->simpleExec('DELETE FROM fichiers_membres WHERE fichier = ?;', (int)$this->id); $db->simpleExec('DELETE FROM fichiers WHERE id = ?;', (int)$this->id); // Suppression du contenu s'il n'est pas utilisé par un autre fichier |
︙ | ︙ | |||
226 227 228 229 230 231 232 | Static_Cache::remove($cache_id); foreach (self::$allowed_thumb_sizes as $size) { Static_Cache::remove($cache_id . '.thumb.' . (int)$size); } | | | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | Static_Cache::remove($cache_id); foreach (self::$allowed_thumb_sizes as $size) { Static_Cache::remove($cache_id . '.thumb.' . (int)$size); } return $db->commit(); } /** * Renvoie le chemin vers le fichier local en cache, et le crée s'il n'existe pas * @return string Chemin local */ protected function getFilePathFromCache() |
︙ | ︙ | |||
450 451 452 453 454 455 456 | $is_image = preg_match('/^image\//', $type); $hash = sha1_file($file['tmp_name']); $size = filesize($file['tmp_name']); $db = DB::getInstance(); | | | | 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | $is_image = preg_match('/^image\//', $type); $hash = sha1_file($file['tmp_name']); $size = filesize($file['tmp_name']); $db = DB::getInstance(); $db->begin(); // Il peut arriver que l'on renvoie ici un fichier déjà stocké, auquel cas, ne pas le re-stocker if (!($id_contenu = $db->simpleQuerySingle('SELECT id FROM fichiers_contenu WHERE hash = ?;', false, $hash))) { $db->simpleInsert('fichiers_contenu', [ 'hash' => $hash, 'taille' => (int)$size, 'contenu' => [\SQLITE3_BLOB, file_get_contents($file['tmp_name'])], ]); $id_contenu = $db->lastInsertRowID(); } $db->simpleInsert('fichiers', [ 'id_contenu' => (int)$id_contenu, 'nom' => $name, 'type' => $type, 'image' => (int)$is_image, ]); $db->commit(); return new Fichiers($db->lastInsertRowID()); } /** * Envoie un fichier déjà stocké * @param string $name Nom du fichier |
︙ | ︙ | |||
577 578 579 580 581 582 583 | * Callback utilisé pour l'extension <<fichier>> dans le wiki-texte * @param array $args Arguments passés à l'extension * @param string $content Contenu éventuel (en mode bloc) * @param object $skriv Objet SkrivLite */ static public function SkrivFichier($args, $content, $skriv) { | | | | > > > | | > | | > > > > > | < | > > > | | | | | | | < < < < < | | | | | | | | 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 | * Callback utilisé pour l'extension <<fichier>> dans le wiki-texte * @param array $args Arguments passés à l'extension * @param string $content Contenu éventuel (en mode bloc) * @param object $skriv Objet SkrivLite */ static public function SkrivFichier($args, $content, $skriv) { $id = $caption = null; foreach ($args as $value) { if (preg_match('/^\d+$/', $value) && !$id) { $id = (int)$value; break; } else { $caption = trim($value); } } if (empty($id)) { return $skriv->parseError('/!\ Tag fichier : aucun numéro de fichier indiqué.'); } try { $file = new Fichiers($id); } catch (\InvalidArgumentException $e) { return $skriv->parseError('/!\ Tag fichier : ' . $e->getMessage()); } if (empty($caption)) { $caption = $file->nom; } $out = '<aside class="fichier" data-type="'.$skriv->escape($file->type).'">'; $out.= '<a href="'.$file->getURL().'" class="internal-file">'.$skriv->escape($caption).'</a> '; $out.= '<small>('.$skriv->escape(($file->type ? $file->type . ', ' : '') . Utils::format_bytes($file->taille)).')</small>'; $out.= '</aside>'; return $out; } /** * Callback utilisé pour l'extension <<image>> dans le wiki-texte * @param array $args Arguments passés à l'extension * @param string $content Contenu éventuel (en mode bloc) * @param object $skriv Objet SkrivLite */ static public function SkrivImage($args, $content, $skriv) { static $align_values = ['droite', 'gauche', 'centre']; $align = ''; $id = $caption = null; foreach ($args as $value) { if (preg_match('/^\d+$/', $value) && !$id) { $id = (int)$value; } else if (in_array($value, $_align_values) && !$align) { $align = $value; } else { $caption = $value; } } if (!$id) { return $skriv->parseError('/!\ Tag image : aucun numéro de fichier indiqué.'); } try { $file = new Fichiers($id); } catch (\InvalidArgumentException $e) { return $skriv->parseError('/!\ Tag image : ' . $e->getMessage()); } if (!$file->image) { return $skriv->parseError('/!\ Tag image : ce fichier n\'est pas une image.'); } $out = '<a href="'.$file->getURL().'" class="internal-image">'; $out .= '<img src="'.$file->getURL($align == 'centre' ? 500 : 200).'" alt="'; if ($caption) { $out .= htmlspecialchars($caption, ENT_QUOTES, 'UTF-8'); } $out .= '" /></a>'; if (!empty($align)) { $out = '<figure class="image ' . $align . '">' . $out; if ($caption) { $out .= '<figcaption>' . htmlspecialchars($caption, ENT_QUOTES, 'UTF-8') . '</figcaption>'; } $out .= '</figure>'; } return $out; } } |
Modified src/include/lib/Garradin/Install.php from [a825b9a6de] to [2081420b50].
1 2 3 4 5 6 7 8 9 10 11 | <?php namespace Garradin; class Install { static public function install($nom_asso, $adresse_asso, $email_asso, $nom_categorie, $nom_membre, $email_membre, $passe_membre, $site_asso = WWW_URL) { $db = DB::getInstance(true); // Création de la base de données | > > > > > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <?php namespace Garradin; /** * Pour procéder à l'installation de l'instance Garradin * Utile pour automatiser l'installation sans passer par la page d'installation */ class Install { static public function install($nom_asso, $adresse_asso, $email_asso, $nom_categorie, $nom_membre, $email_membre, $passe_membre, $site_asso = WWW_URL) { $db = DB::getInstance(true); // Création de la base de données $db->begin(); $db->exec('PRAGMA application_id = ' . DB::APPID . ';'); $db->exec(file_get_contents(DB_SCHEMA)); $db->commit(); // Configuration de base // c'est dans Config::set que sont vérifiées les données utilisateur (renvoie UserException) $config = Config::getInstance(); $config->set('nom_asso', $nom_asso); $config->set('adresse_asso', $adresse_asso); $config->set('email_asso', $email_asso); |
︙ | ︙ | |||
108 109 110 111 112 113 114 | 'libelle' => 'Premier exercice', 'debut' => date('Y-01-01'), 'fin' => date('Y-12-31') ]); return $config->save(); } | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | 'libelle' => 'Premier exercice', 'debut' => date('Y-01-01'), 'fin' => date('Y-12-31') ]); return $config->save(); } static public function setLocalConfig($key, $value) { $path = ROOT . DIRECTORY_SEPARATOR . 'config.local.php'; $new_line = sprintf('const %s = %s;', $key, var_export($value, true)); if (file_exists($path)) { $config = file_get_contents($path); $pattern = sprintf('/^.*(?:const\s+%s|define\s*\(.*%1$s).*$/m', $key); $config = preg_replace($pattern, $new_line, $config, -1, $count); if (!$count) { $config = preg_replace('/\?>.*/s', '', $config); $config .= PHP_EOL . $new_line . PHP_EOL; } } else { $config = '<?php' . PHP_EOL . 'namespace Garradin;' . PHP_EOL . PHP_EOL . $new_line . PHP_EOL; } return file_put_contents($path, $config); } } |
Modified src/include/lib/Garradin/Membres.php from [ae840221ac] to [ad31ed57c8].
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; class Membres { const DROIT_AUCUN = 0; const DROIT_ACCES = 1; const DROIT_ECRITURE = 2; const DROIT_ADMIN = 9; const ITEMS_PER_PAGE = 50; | > > > | | < | < < < < < < | < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < | < | < | < < < < | < < < < < < < | < < < < < < < < < < < < | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < < < < < | < < | < < | < < < | < | < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < | < < < < < < | < < < < < < < < | < | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | <?php namespace Garradin; use KD2\Security; use Garradin\Membres\Session; class Membres { const DROIT_AUCUN = 0; const DROIT_ACCES = 1; const DROIT_ECRITURE = 2; const DROIT_ADMIN = 9; const ITEMS_PER_PAGE = 50; static protected function _getSalt($length) { static $str = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $out = ''; $max = strlen($str) - 1; for ($i = 0; $i < $length; $i++) { $random = Security::random_int(0, $max); $out .= $str[$random]; } return $out; } static public function hashPassword($password) { // Remove NUL bytes // see http://blog.ircmaxell.com/2015/03/security-issue-combining-bcrypt-with.html $password = str_replace("\0", '', $password); return password_hash($password, \PASSWORD_DEFAULT); } static public function checkPassword($password, $stored_hash) { // Remove NUL bytes // see http://blog.ircmaxell.com/2015/03/security-issue-combining-bcrypt-with.html $password = str_replace("\0", '', $password); return password_verify($password, $stored_hash); } // Gestion des données /////////////////////////////////////////////////////// public function _checkFields(&$data, $check_editable = true, $check_password = true) { $champs = Config::getInstance()->get('champs_membres'); foreach ($champs->getAll() as $key=>$config) { if (!$check_editable && (!empty($config->private) || empty($config->editable))) { unset($data[$key]); continue; } if (!isset($data[$key]) || (!is_array($data[$key]) && trim($data[$key]) === '') || (is_array($data[$key]) && empty($data[$key]))) { if (!empty($config->mandatory) && ($check_password || $key != 'passe')) { throw new UserException('Le champ "' . $config->title . '" doit obligatoirement être renseigné.'); } elseif (!empty($config->mandatory)) { continue; } } if (isset($data[$key])) { if ($config->type == 'email' && trim($data[$key]) !== '' && !filter_var($data[$key], FILTER_VALIDATE_EMAIL)) { throw new UserException('Adresse e-mail invalide dans le champ "' . $config->title . '".'); } elseif ($config->type == 'url' && trim($data[$key]) !== '' && !filter_var($data[$key], FILTER_VALIDATE_URL)) { throw new UserException('Adresse URL invalide dans le champ "' . $config->title . '".'); } elseif ($config->type == 'date' && trim($data[$key]) !== '' && !Utils::checkDate($data[$key])) { throw new UserException('Date invalide "' . $config->title . '", format attendu : AAAA-MM-JJ.'); } elseif ($config->type == 'datetime' && trim($data[$key]) !== '') { if (!Utils::checkDateTime($data[$key]) || !($dt = new DateTime($data[$key]))) { throw new UserException('Date invalide "' . $config->title . '", format attendu : AAAA-MM-JJ HH:mm.'); } $data[$key] = $dt->format('Y-m-d H:i'); } elseif ($config->type == 'tel') { $data[$key] = Utils::normalizePhoneNumber($data[$key]); } elseif ($config->type == 'country') { $data[$key] = strtoupper(substr($data[$key], 0, 2)); } elseif ($config->type == 'checkbox') { $data[$key] = empty($data[$key]) ? 0 : 1; } elseif ($config->type == 'number' && trim($data[$key]) !== '') { if (empty($data[$key])) { $data[$key] = 0; } if (!is_numeric($data[$key])) throw new UserException('Le champ "' . $config->title . '" doit contenir un chiffre.'); } elseif ($config->type == 'select' && !in_array($data[$key], $config->options)) { throw new UserException('Le champ "' . $config->title . '" ne correspond pas à un des choix proposés.'); } elseif ($config->type == 'multiple') { if (empty($data[$key]) || !is_array($data[$key])) { $data[$key] = 0; continue; } $binary = 0; foreach ($data[$key] as $k => $v) { if (array_key_exists($k, $config->options) && !empty($v)) { $binary |= 0x01 << $k; } } $data[$key] = $binary; } |
︙ | ︙ | |||
391 392 393 394 395 396 397 | { $this->_checkFields($data); $db = DB::getInstance(); $config = Config::getInstance(); $id = $config->get('champ_identifiant'); if (!empty($data[$id]) | | | | | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | { $this->_checkFields($data); $db = DB::getInstance(); $config = Config::getInstance(); $id = $config->get('champ_identifiant'); if (!empty($data[$id]) && $db->firstColumn('SELECT 1 FROM membres WHERE '.$id.' = ? LIMIT 1;', $data[$id])) { throw new UserException('La valeur du champ '.$id.' est déjà utilisée par un autre membre, hors ce champ doit être unique à chaque membre.'); } if (isset($data['passe']) && trim($data['passe']) != '') { $data['passe'] = self::hashPassword($data['passe']); } else { unset($data['passe']); } if (empty($data['id_categorie'])) { $data['id_categorie'] = Config::getInstance()->get('categorie_membres'); } $db->insert('membres', $data); $id = $db->lastInsertRowId(); Plugin::fireSignal('membre.nouveau', array_merge(['id' => $id], $data)); return $id; } |
︙ | ︙ | |||
432 433 434 435 436 437 438 | unset($data['id']); } $this->_checkFields($data, $check_editable, false); $champ_id = $config->get('champ_identifiant'); if (!empty($data[$champ_id]) | | | | | | | | | | | | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | unset($data['id']); } $this->_checkFields($data, $check_editable, false); $champ_id = $config->get('champ_identifiant'); if (!empty($data[$champ_id]) && $db->firstColumn('SELECT 1 FROM membres WHERE '.$champ_id.' = ? AND id != ? LIMIT 1;', $data[$champ_id], (int)$id)) { throw new UserException('La valeur du champ '.$champ_id.' est déjà utilisée par un autre membre, hors ce champ doit être unique à chaque membre.'); } if (!empty($data['id'])) { if (!preg_match('/^\d+$/', $data['id'])) { throw new UserException('Le numéro de membre ne doit contenir que des chiffres.'); } if ($db->firstColumn('SELECT 1 FROM membres WHERE id = ?;', (int)$data['id'])) { throw new UserException('Ce numéro est déjà attribué à un autre membre.'); } // Si on ne vérifie pas toutes les tables qui sont liées ici à un ID de membre // la requête de modification provoquera une erreur de contrainte de foreign key // ce qui est normal. Donc : il n'est pas possible de changer l'ID d'un membre qui // a participé au wiki, à la compta, etc. if ($db->firstColumn('SELECT 1 FROM wiki_revisions WHERE id_auteur = ?;', (int)$id) || $db->firstColumn('SELECT 1 FROM compta_journal WHERE id_auteur = ?;', (int)$id) || $db->firstColumn('SELECT 1 FROM compta_rapprochement WHERE id_auteur = ?;', (int)$id) || $db->firstColumn('SELECT 1 FROM membres_operations WHERE id_membre = ?;', (int)$id) || $db->firstColumn('SELECT 1 FROM cotisations_membres WHERE id_membre = ?;', (int)$id) || $db->firstColumn('SELECT 1 FROM rappels_envoyes WHERE id_membre = ?;', (int)$id) || $db->firstColumn('SELECT 1 FROM fichiers_membres WHERE id = ?;', (int)$id)) # FIXME || $db->simpleQuerySingle('SELECT 1 FROM wiki_suivi WHERE id_membre = ?;', false, (int)$id)) { throw new UserException('Le numéro n\'est pas modifiable pour ce membre car des contenus sont liés à ce numéro de membre (wiki, compta, etc.).'); } } if (!empty($data['passe']) && trim($data['passe'])) { $data['passe'] = self::hashPassword($data['passe']); } else { unset($data['passe']); } if (isset($data['id_categorie']) && empty($data['id_categorie'])) |
︙ | ︙ | |||
493 494 495 496 497 498 499 | } public function get($id) { $db = DB::getInstance(); $config = Config::getInstance(); | | | | | | | < < < < < < < < < < < < < < < < < < < | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | } public function get($id) { $db = DB::getInstance(); $config = Config::getInstance(); return $db->first('SELECT *, '.$config->get('champ_identite').' AS identite, strftime(\'%s\', date_inscription) AS date_inscription, strftime(\'%s\', date_connexion) AS date_connexion FROM membres WHERE id = ? LIMIT 1;', (int)$id); } public function delete($ids) { if (!is_array($ids)) { $ids = [(int)$ids]; } if ($session = Session::get()) { $user = $session->getUser(); foreach ($ids as $id) { if ($user->id == $id) { throw new UserException('Il n\'est pas possible de supprimer son propre compte.'); } } } return self::_deleteMembres($ids); } public function getNom($id) { $db = DB::getInstance(); $config = Config::getInstance(); return $db->firstColumn('SELECT '.$config->get('champ_identite').' FROM membres WHERE id = ? LIMIT 1;', (int)$id); } public function search($field, $query) { $db = DB::getInstance(); $config = Config::getInstance(); |
︙ | ︙ | |||
579 580 581 582 583 584 585 | $query = preg_replace('!^0+!', '', $query); if ($query == '') { return false; } | | | | | | > > | | < > | < < > > | 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | $query = preg_replace('!^0+!', '', $query); if ($query == '') { return false; } $where = sprintf('WHERE %s LIKE %s', $field, $db->quote('%' . $query . '%')); $order = $field; } elseif (!$champs->isText($field)) { $where = sprintf('WHERE %s = %s', $field, $db->quote($query)); $order = $field; } else { $where = sprintf('WHERE transliterate_to_ascii(%s) LIKE %s', $field, $db->quote('%' . Utils::transliterateToAscii($query) . '%')); $order = sprintf('transliterate_to_ascii(%s) COLLATE NOCASE', $field); } $fields = array_keys($champs->getListedFields()); if (!in_array($field, $fields)) { $fields[] = $field; } if (!in_array('email', $fields)) { $fields[] = 'email'; } $query = sprintf('SELECT id, id_categorie, %s, %s AS identite, strftime(\'%%s\', date_inscription) AS date_inscription FROM membres %s %s LIMIT 1000;', implode(', ', $fields), $config->get('champ_identite'), $where, $order ? 'ORDER BY ' . $order : '' ); return $db->get($query); } public function listByCategory($cat, $fields, $page = 1, $order = null, $desc = false) { $begin = ($page - 1) * self::ITEMS_PER_PAGE; $db = DB::getInstance(); |
︙ | ︙ | |||
636 637 638 639 640 641 642 | $where = ''; if (is_null($order) || !$champs->get($order)) $order = 'id'; if (!empty($fields) && $order != 'id' && $champs->isText($order)) { | | > > > | < | < | | | > > > | > > | > | | | | | | > > | < | | > | > | | | > | > > > | 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 | $where = ''; if (is_null($order) || !$champs->get($order)) $order = 'id'; if (!empty($fields) && $order != 'id' && $champs->isText($order)) { $order = sprintf('transliterate_to_ascii(%s) COLLATE NOCASE', $order); } if ($desc) { $order .= ' DESC'; } if (!in_array('email', $fields)) { $fields []= 'email'; } $query = sprintf('SELECT id, id_categorie, %s, %s AS identite, strftime(\'%%s\', date_inscription) AS date_inscription FROM membres %s ORDER BY %s LIMIT ?, ?;', implode(', ', $fields), $config->get('champ_identite'), $where, $order); return $db->get($query, (int) $begin, self::ITEMS_PER_PAGE); } public function countByCategory($cat = 0) { $db = DB::getInstance(); $query = 'SELECT COUNT(*) FROM membres '; if (is_int($cat) && $cat) { $query .= sprintf('WHERE id_categorie = %d', $cat); } elseif (is_array($cat)) { $query .= sprintf('WHERE id_categorie IN (%s)', implode(',', $cat)); } $query .= ';'; return $db->firstColumn($query); } public function countAllButHidden() { $db = DB::getInstance(); return $db->firstColumn('SELECT COUNT(*) FROM membres WHERE id_categorie NOT IN (SELECT id FROM membres_categories WHERE cacher = 1);'); } static public function changeCategorie($id_cat, $membres) { foreach ($membres as &$id) { $id = (int) $id; } $db = DB::getInstance(); return $db->update('membres', ['id_categorie' => (int)$id_cat], sprintf('id IN (%s)', implode(',', $membres)) ); } static protected function _deleteMembres($membres) { foreach ($membres as &$id) { $id = (int) $id; } Plugin::fireSignal('membre.suppression', $membres); $db = DB::getInstance(); $membres = implode(',', $membres); $where = sprintf('id_auteur IN (%s)', $membres); // Mise à jour des références, membre qui n'existe plus $db->update('wiki_revisions', ['id_auteur' => null], $where); $db->update('compta_journal', ['id_auteur' => null], $where); $db->update('compta_rapprochement', ['id_auteur' => null], $where); $where = sprintf('id_membre IN (%s)', $membres); // Suppression des données liées au membre $db->delete('rappels_envoyes', $where); $db->delete('membres_operations', $where); $db->delete('cotisations_membres', $where); //$db->exec('DELETE FROM wiki_suivi WHERE id_membre IN ('.$membres.');'); // Suppression du membre $where = sprintf('id IN (%s)', $membres); return $db->delete('membres', $where); } /** * @deprecated remplacer par envoyer message à tableau de membres */ public function sendMessageToCategory($dest, $sujet, $message, $subscribed_only = false) { $config = Config::getInstance(); $headers = [ 'From' => '"'.$config->get('nom_asso').'" <'.$config->get('email_asso').'>', ]; |
︙ | ︙ | |||
803 804 805 806 807 808 809 | } public function schemaSQL() { $db = DB::getInstance(); $tables = [ | | | < < | 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | } public function schemaSQL() { $db = DB::getInstance(); $tables = [ 'membres' => $db->firstColumn('SELECT sql FROM sqlite_master WHERE type = \'table\' AND name = \'membres\';'), 'categories'=> $db->firstColumn('SELECT sql FROM sqlite_master WHERE type = \'table\' AND name = \'membres_categories\';'), ]; return $tables; } } |
Modified src/include/lib/Garradin/Membres/Categories.php from [75e748283d] to [04d2da3478].
︙ | ︙ | |||
30 31 32 33 34 35 36 | if (!isset($data['nom']) || !trim($data['nom'])) { throw new UserException('Le nom de catégorie ne peut rester vide.'); } if (!empty($data['id_cotisation_obligatoire']) | | | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | if (!isset($data['nom']) || !trim($data['nom'])) { throw new UserException('Le nom de catégorie ne peut rester vide.'); } if (!empty($data['id_cotisation_obligatoire']) && !$db->firstColumn('SELECT 1 FROM cotisations WHERE id = ?;', (int)$data['id_cotisation_obligatoire'])) { throw new UserException('Numéro de cotisation inconnu.'); } if (isset($data['id_cotisation_obligatoire']) && empty($data['id_cotisation_obligatoire'])) { $data['id_cotisation_obligatoire'] = null; |
︙ | ︙ | |||
60 61 62 63 64 65 66 | if (!isset($data['droit_'.$key])) $data['droit_'.$key] = $value; else $data['droit_'.$key] = (int)$data['droit_'.$key]; } $db = DB::getInstance(); | | | | | | | | | | | | | < < | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | if (!isset($data['droit_'.$key])) $data['droit_'.$key] = $value; else $data['droit_'.$key] = (int)$data['droit_'.$key]; } $db = DB::getInstance(); $db->insert('membres_categories', $data); return $db->lastInsertRowId(); } public function edit($id, $data) { $this->_checkData($data); foreach ($this->droits as $key=>$value) { if (isset($data['droit_'.$key])) $data['droit_'.$key] = (int)$data['droit_'.$key]; } if (!isset($data['cacher']) || $data['cacher'] != 1) $data['cacher'] = 0; $db = DB::getInstance(); return $db->update('membres_categories', $data, 'id = '.(int)$id); } public function get($id) { $db = DB::getInstance(); return $db->first('SELECT * FROM membres_categories WHERE id = ?;', (int) $id); } public function remove($id) { $db = DB::getInstance(); $config = Config::getInstance(); if ($id == $config->get('categorie_membres')) { throw new UserException('Il est interdit de supprimer la catégorie définie par défaut dans la configuration.'); } if ($db->simpleQuerySingle('SELECT 1 FROM membres WHERE id_categorie = ?;', false, (int)$id)) { throw new UserException('La catégorie contient encore des membres, il n\'est pas possible de la supprimer.'); } $db->update( 'wiki_pages', [ 'droit_lecture' => Wiki::LECTURE_NORMAL, 'droit_ecriture' => Wiki::ECRITURE_NORMAL, ], 'droit_lecture = '.(int)$id.' OR droit_ecriture = '.(int)$id ); return $db->delete('membres_categories', 'id = ?', (int) $id); } public function listSimple() { $db = DB::getInstance(); return $db->getAssoc('SELECT id, nom FROM membres_categories ORDER BY nom;'); } public function listComplete() { $db = DB::getInstance(); return $db->get('SELECT * FROM membres_categories ORDER BY nom;'); } public function listCompleteWithStats() { $db = DB::getInstance(); return $db->get('SELECT *, (SELECT COUNT(*) FROM membres WHERE id_categorie = membres_categories.id) AS nombre FROM membres_categories ORDER BY nom;'); } public function listHidden() { $db = DB::getInstance(); return $db->getAssoc('SELECT id, nom FROM membres_categories WHERE cacher = 1;'); } public function listNotHidden() { $db = DB::getInstance(); return $db->getAssoc('SELECT id, nom FROM membres_categories WHERE cacher = 0;'); } } |
Modified src/include/lib/Garradin/Membres/Champs.php from [da0a542d80] to [ae54e63bd0].
︙ | ︙ | |||
76 77 78 79 80 81 82 | } return self::$presets; } static public function listUnusedPresets(Champs $champs) { | | | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | } return self::$presets; } static public function listUnusedPresets(Champs $champs) { return array_diff_key(self::importPresets(), (array) $champs->getAll()); } public function __construct($champs) { if ($champs instanceOf Champs) { $this->champs = $champs->getAll(); |
︙ | ︙ | |||
100 101 102 103 104 105 106 107 108 109 | } else { $champs = parse_ini_string((string)$champs, true); foreach ($champs as $key=>&$config) { $this->_checkField($key, $config); } | > | | | | | | | | | | | | < | > | | > | < | | | | | > > > > > > > > > > > > | > | | | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | } else { $champs = parse_ini_string((string)$champs, true); foreach ($champs as $key=>&$config) { $config = (object) $config; $this->_checkField($key, $config); } $this->champs = (object) $champs; } } public function getTypes() { return $this->types; } public function get($champ, $key = null) { if ($champ == 'id') { return (object) ['title' => 'Numéro unique', 'type' => 'number']; } if (!property_exists($this->champs, $champ)) return null; if ($key !== null) { if (property_exists($this->champs->$champ, $key)) return $this->champs->$champ->$key; else return null; } return $this->champs->$champ; } public function isText($champ) { if (!property_exists($this->champs, $champ)) return null; if (in_array($this->champs->$champ->type, $this->text_types)) return true; else return false; } public function getAll() { $this->champs->passe->title = 'Mot de passe'; return $this->champs; } public function getList($with_id = false) { $champs = clone $this->champs; unset($champs->passe); if ($with_id) { $champs->id = $this->get('id'); } return $champs; } public function getListedFields() { $champs = (array) $this->champs; $champs = array_filter($champs, function ($a) { return empty($a->list_row) ? false : true; }); uasort($champs, function ($a, $b) { if ($a->list_row == $b->list_row) return 0; return ($a->list_row > $b->list_row) ? 1 : -1; }); return (object) $champs; } public function getFirstListed() { foreach ($this->champs as $key=>$config) { if (empty($config->list_row)) { continue; } return $key; } } /** * Vérifie la cohérence et la présence des bons éléments pour un champ * @param string $name Nom du champ * @param array $config Configuration du champ * @return boolean true */ protected function _checkField($name, \stdClass &$config) { if (!preg_match('!^\w+(_\w+)*$!', $name)) { throw new UserException('Le nom du champ est invalide.'); } foreach ($config as $key=>&$value) { // Champ install non pris en compte if ($key == 'install') { unset($config->$key); continue; } if (!in_array($key, $this->config_fields)) { throw new \BadMethodCallException('Champ '.$key.' non valide.'); } |
︙ | ︙ | |||
234 235 236 237 238 239 240 | { unset($value[$option_key]); } } } } | | | | | | | | | | | | | 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | { unset($value[$option_key]); } } } } if (empty($config->title) && $name != 'passe') { throw new UserException('Champ "'.$name.'" : Le titre est obligatoire.'); } if (empty($config->type) || !array_key_exists($config->type, $this->types)) { throw new UserException('Champ "'.$name.'" : Le type est vide ou non valide.'); } if ($name == 'email' && $config->type != 'email') { throw new UserException('Le champ email ne peut être d\'un type différent de email.'); } if ($name == 'passe' && $config->type != 'password') { throw new UserException('Le champ mot de passe ne peut être d\'un type différent de mot de passe.'); } if (($config->type == 'multiple' || $config->type == 'select') && empty($config->options)) { throw new UserException('Le champ "'.$name.'" nécessite de comporter au moins une option possible.'); } if (!property_exists($config, 'editable')) { $config->editable = false; } if (!property_exists($config, 'mandatory')) { $config->mandatory = false; } if (!property_exists($config, 'private')) { $config->private = false; } return true; } /** * Ajouter un nouveau champ |
︙ | ︙ | |||
297 298 299 300 301 302 303 | if (!preg_match('!^[a-z][a-z0-9]*(_[a-z0-9]+)*$!', $name)) { throw new UserException('Le nom du champ est invalide : ne sont acceptés que les lettres minuscules et les chiffres (éventuellement séparés par un underscore).'); } $this->_checkField($name, $config); | | | | | | | 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | if (!preg_match('!^[a-z][a-z0-9]*(_[a-z0-9]+)*$!', $name)) { throw new UserException('Le nom du champ est invalide : ne sont acceptés que les lettres minuscules et les chiffres (éventuellement séparés par un underscore).'); } $this->_checkField($name, $config); $this->champs->$name = $config; return true; } /** * Modifie un champ particulier * @param string $champ Nom du champ * @param string $key Nom de la clé à modifier * @param mixed $value Valeur à affecter * @return boolean true */ public function set($champ, $key, $value) { if (!isset($this->champs->$champ)) { throw new \LogicException('Champ "'.$champ.'" inconnu.'); } // Vérification $config = clone $this->champs->$champ; $config->$key = $value; $this->_checkField($champ, $config); $this->champs->$champ = $config; return true; } /** * Modifie les champs en interne en vérifiant que tout va bien * @param array $champs Liste des champs * @return boolean true |
︙ | ︙ | |||
362 363 364 365 366 367 368 369 370 371 372 373 374 375 | { throw new UserException('Le champ '.$config->get('champ_identifiant') .' est défini comme identifiant à la connexion et ne peut donc être supprimé des fiches membres.'); } foreach ($champs as $name=>&$config) { $this->_checkField($name, $config); } $this->champs = $champs; return true; } | > | 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | { throw new UserException('Le champ '.$config->get('champ_identifiant') .' est défini comme identifiant à la connexion et ne peut donc être supprimé des fiches membres.'); } foreach ($champs as $name=>&$config) { $config = (object) $config; $this->_checkField($name, $config); } $this->champs = $champs; return true; } |
︙ | ︙ | |||
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | // Champs à créer $create = [ 'id INTEGER PRIMARY KEY, -- Numéro attribué automatiquement', 'id_categorie INTEGER NOT NULL, -- Numéro de catégorie', 'date_connexion TEXT NULL, -- Date de dernière connexion', 'date_inscription TEXT NOT NULL DEFAULT CURRENT_DATE, -- Date d\'inscription', ]; $create_keys = [ 'FOREIGN KEY (id_categorie) REFERENCES membres_categories (id)' ]; // Champs à recopier $copy = [ 'id', 'id_categorie', 'date_connexion', 'date_inscription', ]; $anciens_champs = $config->get('champs_membres'); $anciens_champs = is_null($anciens_champs) ? $this->champs : $anciens_champs->getAll(); foreach ($this->champs as $key=>$cfg) { | > > > > | | | | | | | | 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 | // Champs à créer $create = [ 'id INTEGER PRIMARY KEY, -- Numéro attribué automatiquement', 'id_categorie INTEGER NOT NULL, -- Numéro de catégorie', 'date_connexion TEXT NULL, -- Date de dernière connexion', 'date_inscription TEXT NOT NULL DEFAULT CURRENT_DATE, -- Date d\'inscription', 'secret_otp TEXT NULL, -- Code secret pour TOTP', 'clef_pgp TEXT NULL, -- Clé publique PGP' ]; $create_keys = [ 'FOREIGN KEY (id_categorie) REFERENCES membres_categories (id)' ]; // Champs à recopier $copy = [ 'id', 'id_categorie', 'date_connexion', 'date_inscription', 'secret_otp', 'clef_pgp', ]; $anciens_champs = $config->get('champs_membres'); $anciens_champs = is_null($anciens_champs) ? $this->champs : $anciens_champs->getAll(); foreach ($this->champs as $key=>$cfg) { if ($cfg->type == 'number') $type = 'FLOAT'; elseif ($cfg->type == 'multiple' || $cfg->type == 'checkbox') $type = 'INTEGER'; elseif ($cfg->type == 'file') $type = 'BLOB'; else $type = 'TEXT'; $line = $key . ' ' . $type . ','; if (!empty($cfg->title)) { $line .= ' -- ' . str_replace(["\n", "\r"], '', $cfg->title); } $create[] = $line; if (property_exists($anciens_champs, $key)) { $copy[] = $key; } } $create = array_merge($create, $create_keys); $create = 'CREATE TABLE membres_tmp (' . "\n\t" . implode("\n\t", $create) . "\n);"; $copy = 'INSERT INTO membres_tmp (' . implode(', ', $copy) . ') SELECT ' . implode(', ', $copy) . ' FROM membres;'; $db->exec('PRAGMA foreign_keys = OFF;'); $db->begin(); $db->exec($create); if ($enable_copy) { $db->exec($copy); } $db->exec('DROP TABLE IF EXISTS membres;'); |
︙ | ︙ | |||
457 458 459 460 461 462 463 | WHERE '.$config->get('champ_identifiant').' = "";'); // Création de l'index unique $db->exec('CREATE UNIQUE INDEX membres_identifiant ON membres ('.$config->get('champ_identifiant').');'); } // Création des index pour les champs affichés dans la liste des membres | | | | 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 | WHERE '.$config->get('champ_identifiant').' = "";'); // Création de l'index unique $db->exec('CREATE UNIQUE INDEX membres_identifiant ON membres ('.$config->get('champ_identifiant').');'); } // Création des index pour les champs affichés dans la liste des membres $listed_fields = array_keys((array) $this->getListedFields()); foreach ($listed_fields as $field) { if ($field === $config->get('champ_identifiant')) { // Il y a déjà un index continue; } $db->exec('CREATE INDEX membres_liste_' . $field . ' ON membres (' . $field . ');'); } $db->commit(); $db->exec('PRAGMA foreign_keys = ON;'); $config->set('champs_membres', $this); $config->save(); return true; } } |
Modified src/include/lib/Garradin/Membres/Cotisations.php from [09cc63eeae] to [720be42932].
︙ | ︙ | |||
74 75 76 77 78 79 80 | * @param array $data Tableau des champs à insérer * @return integer ID de l'événement créé */ public function add($data) { $db = DB::getInstance(); | | < | | | | | > > | | < | < | | | | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | * @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->first('SELECT * FROM cotisations WHERE id = ?;', (int)$data['id_cotisation']); $this->_checkFields($data, !empty($co->id_categorie_compta)); $check = $db->firstColumn('SELECT 1 FROM cotisations_membres WHERE id_cotisation = ? AND id_membre = ? AND date = ?;', (int)$data['id_cotisation'], (int)$data['id_membre'], $data['date']); if ($check) { throw new UserException('Cette cotisation a déjà été enregistrée pour ce jour-ci et ce membre-ci.'); } $db->begin(); $db->insert('cotisations_membres', [ 'date' => $data['date'], 'id_cotisation' => $data['id_cotisation'], 'id_membre' => $data['id_membre'], ]); $id = $db->lastInsertRowId(); if ($co['id_categorie_compta'] && $data['montant'] > 0) { try { $id_operation = $this->addOperationCompta($id, [ 'id_categorie' => $co->id_categorie_compta, 'libelle' => 'Cotisation (automatique)', 'montant' => $data['montant'], 'date' => $data['date'], 'moyen_paiement'=> $data['moyen_paiement'], 'numero_cheque' => isset($data['numero_cheque']) ? $data['numero_cheque'] : null, 'id_auteur' => $data['id_auteur'], 'banque' => isset($data['banque']) ? $data['banque'] : null, 'id_membre' => $data['id_membre'], ]); } catch (\Exception $e) { $db->rollback(); throw $e; } } $db->commit(); Plugin::fireSignal('cotisation.ajout', array_merge(['id' => $id], $data)); return $id; } /** * Supprimer un événement de cotisation * @param integer $id ID de l'événement à supprimer * @return integer true en cas de succès */ public function delete($id) { $db = DB::getInstance(); $db->update('membres_operations', ['id_cotisation' => null], 'id_cotisation = ' . (int)$id); return $db->delete('cotisations_membres', 'id = ' . (int)$id); } public function get($id) { return DB::getInstance()->first('SELECT * FROM cotisations_membres WHERE id = ?;', (int)$id); } /** * Renvoie une liste des écritures comptables liées à une cotisation * @param int $id Numéro de la cotisation membre * @return array Liste des écritures */ public function listOperationsCompta($id) { return DB::getInstance()->get('SELECT * FROM compta_journal WHERE id IN (SELECT id_operation FROM membres_operations WHERE id_cotisation = ?);', (int)$id); } /** * Compte les opérations comptables liées à cette cotisation */ public function countOperationsCompta($id) { return DB::getInstance()->firstColumn('SELECT COUNT(*) FROM membres_operations WHERE id_cotisation = ?;', (int)$id); } /** * Ajouter une écriture comptable pour un paiemement membre * @param int $id Numéro de la cotisation membre * @param array $data Données */ |
︙ | ︙ | |||
197 198 199 200 201 202 203 | $debit = $data['banque']; } else { $debit = \Garradin\Compta\Comptes::CAISSE; } | | | | | | | | | | 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | $debit = $data['banque']; } else { $debit = \Garradin\Compta\Comptes::CAISSE; } $credit = $db->firstColumn('SELECT compte FROM compta_categories WHERE id = ?;', $data['id_categorie']); $id_operation = $journal->add([ 'libelle' => $data['libelle'], 'montant' => $data['montant'], 'date' => $data['date'], 'moyen_paiement'=> $data['moyen_paiement'], 'numero_cheque' => isset($data['numero_cheque']) ? $data['numero_cheque'] : null, 'compte_debit' => $debit, 'compte_credit' => $credit, 'id_categorie' => (int)$data['id_categorie'], 'id_auteur' => (int)$data['id_auteur'], ]); $db->insert('membres_operations', [ 'id_operation' => $id_operation, 'id_membre' => $data['id_membre'], 'id_cotisation' => (int)$id, ]); return $id_operation; } /** * Nombre de membres pour une cotisation * @param integer $id Numéro de la cotisation * @return integer Nombre d'événements pour cette cotisation */ public function countMembersForCotisation($id) { $db = DB::getInstance(); return $db->firstColumn('SELECT COUNT(DISTINCT cm.id_membre) FROM cotisations_membres AS cm INNER JOIN membres AS m ON m.id = cm.id_membre WHERE cm.id_cotisation = ? AND m.id_categorie NOT IN (SELECT id FROM membres_categories WHERE cacher = 1);', (int)$id); } /** * Liste des membres qui sont inscrits à une cotisation * @param integer $id Numéro de la cotisation * @return array Liste des membres */ |
︙ | ︙ | |||
267 268 269 270 271 272 273 | default: $order = 'cm.id_membre'; break; } $desc = $desc ? 'DESC' : 'ASC'; | | | | | | | | | | | | | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | default: $order = 'cm.id_membre'; break; } $desc = $desc ? 'DESC' : 'ASC'; return $db->get('SELECT cm.id_membre, cm.date, cm.id, m.'.$champ_id.' AS nom, c.montant, CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') >= date() WHEN c.fin IS NOT NULL THEN c.fin >= date() ELSE 1 END AS a_jour FROM cotisations_membres AS cm INNER JOIN cotisations AS c ON c.id = cm.id_cotisation INNER JOIN membres AS m ON m.id = cm.id_membre WHERE cm.id_cotisation = ? AND m.id_categorie NOT IN (SELECT mc.id FROM membres_categories AS mc WHERE mc.cacher = 1) GROUP BY cm.id_membre ORDER BY '.$order.' '.$desc.' LIMIT ?,?;', (int)$id, $begin, self::ITEMS_PER_PAGE); } /** * Liste des événements d'un membre * @param integer $id Numéro de membre * @return array Liste des événements de cotisation fait par ce membre */ public function listForMember($id) { // TODO: récupérer ici le solde payé pour une cotisation, pour savoir si tout a été payé // (pour gérer par exemple les paiements effectués en plusieurs versements) // mais pour le moment le fonctionnement de compta_journal est trop compliqué pour arriver // à récupérer un solde dans une requête simple, la requête serait trop lourde donc on laisse tomber $db = DB::getInstance(); return $db->get('SELECT cm.*, c.intitule, c.duree, c.debut, c.fin, c.montant, (SELECT COUNT(*) FROM membres_operations WHERE id_cotisation = cm.id) AS nb_operations FROM cotisations_membres AS cm LEFT JOIN cotisations AS c ON c.id = cm.id_cotisation WHERE cm.id_membre = ? ORDER BY cm.date DESC;', (int)$id); } /** * Liste des cotisations / activités en cours pour ce membre * @param integer $id Numéro de membre * @return array Liste des cotisations en cours de validité */ public function listSubscriptionsForMember($id) { $db = DB::getInstance(); return $db->get('SELECT c.*, CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') >= date() WHEN c.fin IS NOT NULL THEN (cm.id IS NOT NULL AND c.fin >= date()) WHEN cm.id IS NOT NULL THEN 1 ELSE 0 END AS a_jour, CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') WHEN c.fin IS NOT NULL THEN c.fin ELSE 1 END AS expiration, (julianday(date()) - julianday(CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') WHEN c.fin IS NOT NULL THEN c.fin END)) AS nb_jours FROM cotisations_membres AS cm INNER JOIN cotisations AS c ON c.id = cm.id_cotisation WHERE cm.id_membre = ? GROUP BY cm.id_cotisation ORDER BY cm.date DESC;', (int)$id); } /** * Ce membre est-il à jour sur cette cotisation ? * @param integer $id Numéro de membre * @param integer $id_cotisation Numéro de cotisation * @return array Infos sur la cotisation, et champ expiration * (si NULL = cotisation jamais enregistrée, si 1 = cotisation ponctuelle enregistrée, sinon date d'expiration) */ public function isMemberUpToDate($id, $id_cotisation) { $db = DB::getInstance(); return $db->first('SELECT c.*, CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') >= date() WHEN c.fin IS NOT NULL THEN (cm.id IS NOT NULL AND c.fin >= date()) WHEN cm.id IS NOT NULL THEN 1 ELSE 0 END AS a_jour, CASE WHEN c.duree IS NOT NULL THEN date(cm.date, \'+\'||c.duree||\' days\') WHEN c.fin IS NOT NULL THEN c.fin ELSE 1 END AS expiration FROM cotisations AS c LEFT JOIN cotisations_membres AS cm ON cm.id_cotisation = c.id AND cm.id_membre = ? WHERE c.id = ? ORDER BY cm.date DESC;', (int)$id, (int)$id_cotisation); } public function countForMember($id) { $db = DB::getInstance(); return $db->firstColumn('SELECT COUNT(DISTINCT id_cotisation) FROM cotisations_membres WHERE id_membre = ?;', (int)$id); } } |
Modified src/include/lib/Garradin/Membres/Import.php from [59b1bc5be2] to [1629f5904f].
︙ | ︙ | |||
73 74 75 76 77 78 79 | if (!$fp) { return false; } $db = DB::getInstance(); | | | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | if (!$fp) { return false; } $db = DB::getInstance(); $db->begin(); $membres = new Membres; $columns = array_flip($this->galette_fields); $col = function($column) use (&$row, &$columns) { if (!isset($columns[$column])) |
︙ | ︙ | |||
104 105 106 107 108 109 110 | if (empty($row)) { continue; } if (count($row) != count($columns)) { | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | if (empty($row)) { continue; } if (count($row) != count($columns)) { $db->rollback(); throw new UserException('Erreur sur la ligne ' . $line . ' : le nombre de colonnes est incorrect.'); } $data = []; foreach ($translation_table as $galette=>$garradin) { |
︙ | ︙ | |||
128 129 130 131 132 133 134 | } try { $membres->add($data); } catch (UserException $e) { | | | | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | } try { $membres->add($data); } catch (UserException $e) { $db->rollback(); throw new UserException('Erreur sur la ligne ' . $line . ' : ' . $e->getMessage()); } } $db->commit(); fclose($fp); return true; } /** * Importer un CSV de la liste des membres depuis un export Garradin |
︙ | ︙ | |||
159 160 161 162 163 164 165 | if (!$fp) { return false; } $db = DB::getInstance(); | | | | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | if (!$fp) { return false; } $db = DB::getInstance(); $db->begin(); $membres = new Membres; // On récupère les champs qu'on peut importer $champs = Config::getInstance()->get('champs_membres')->getAll(); $champs = array_keys((array)$champs); $champs[] = 'date_inscription'; //$champs[] = 'date_connexion'; $champs[] = 'id'; //$champs[] = 'id_categorie'; $line = 0; $delim = Utils::find_csv_delim($fp); |
︙ | ︙ | |||
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | continue; } if ($line == 1) { if (is_numeric($row[0])) { throw new UserException('Erreur sur la ligne 1 : devrait contenir l\'en-tête des colonnes.'); } $columns = array_flip($row); continue; } if (count($row) != count($columns)) { | > | | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | continue; } if ($line == 1) { if (is_numeric($row[0])) { $db->rollback(); throw new UserException('Erreur sur la ligne 1 : devrait contenir l\'en-tête des colonnes.'); } $columns = array_flip($row); continue; } if (count($row) != count($columns)) { $db->rollback(); throw new UserException('Erreur sur la ligne ' . $line . ' : le nombre de colonnes est incorrect.'); } $data = []; foreach ($columns as $name=>$id) { |
︙ | ︙ | |||
234 235 236 237 238 239 240 | if ($id) $membres->edit($id, $data); else $membres->add($data); } catch (UserException $e) { | | | | 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | if ($id) $membres->edit($id, $data); else $membres->add($data); } catch (UserException $e) { $db->rollback(); throw new UserException('Erreur sur la ligne ' . $line . ' : ' . $e->getMessage()); } } $db->commit(); fclose($fp); return true; } public function toCSV() { |
︙ | ︙ |
Added src/include/lib/Garradin/Membres/Session.php version [ba5886b165].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 | <?php namespace Garradin\Membres; use Garradin\Config; use Garradin\DB; use Garradin\Utils; use Garradin\Membres; use \KD2\Security; use \KD2\Security_OTP; use \KD2\QRCode; class Session { const HASH_ALGO = 'sha256'; const REQUIRE_OTP = 'otp'; protected $cookie; protected $user; protected $id; const SESSION_COOKIE_NAME = 'gdin'; const PERMANENT_COOKIE_NAME = 'gdinp'; static protected function getSessionOptions() { $url = parse_url(\Garradin\WWW_URL); return [ 'name' => self::SESSION_COOKIE_NAME, 'cookie_path' => $url['path'], 'cookie_domain' => $url['host'], 'cookie_secure' => (\Garradin\PREFER_HTTPS >= 2) ? true : false, 'cookie_httponly' => true, ]; } static protected function start($write = false) { // Don't start session if it has been already started if (isset($_SESSION)) { return true; } // Only start session if it exists if ($write || isset($_COOKIE[self::SESSION_COOKIE_NAME])) { session_name(self::SESSION_COOKIE_NAME); return session_start(self::getSessionOptions()); } return false; } static public function refresh() { return self::start(true); } static public function get() { try { return new Session; } catch (\LogicException $e) { return false; } } static public function login($id, $passe, $permanent = false) { assert(is_bool($permanent)); assert(is_string($id)); assert(is_string($passe)); $db = DB::getInstance(); $champ_id = Config::getInstance()->get('champ_identifiant'); $query = 'SELECT id, passe, secret_otp, (SELECT droit_connexion FROM membres_categories AS mc WHERE mc.id = id_categorie) AS droit_connexion FROM membres WHERE %s = ? LIMIT 1;'; $query = sprintf($query, $champ_id); $membre = $db->first($query, trim($id)); // Membre non trouvé if (empty($membre)) { return false; } // vérification du mot de passe if (!Membres::checkPassword(trim($passe), $membre->passe)) { return false; } // vérification que le membre a le droit de se connecter if ($membre->droit_connexion == Membres::DROIT_AUCUN) { return false; } if ($membre->secret_otp) { self::start(true); $_SESSION = []; $_SESSION['otp'] = (object) [ 'id' => (int) $membre->id, 'secret' => $membre->secret_otp, 'permanent' => $permanent, ]; return self::REQUIRE_OTP; } else { $user = self::createUserSession($membre->id); if ($permanent) { self::createPermanentSession($membre); } return true; } } static protected function createUserSession($id) { $db = DB::getInstance(); $user = $db->first('SELECT * FROM membres WHERE id = ?;', (int)$id); if (!$user) { throw new \LogicException(sprintf('Aucun utilisateur trouvé avec l\'ID %s', $id)); } $user->droits = new \stdClass; // Récupérer les droits $droits = $db->first('SELECT * FROM membres_categories WHERE id = ?;', (int)$user->id_categorie); foreach ($droits as $key=>$value) { // Renommer pour simplifier $key = str_replace('droit_', '', $key, $found); // Si le nom de colonne contient droit_ c'est que c'est un droit ! if ($found) { $user->droits->$key = (int) $value; } } self::start(true); $_SESSION['user'] = $user; return $user; } /** * Créer une session permanente "remember me" * * @see autoLogin method * @param \stdClass $user * @return boolean */ static protected function createPermanentSession(\stdClass $user) { $selector = hash(self::HASH_ALGO, Security::random_bytes(10)); $verifier = hash(self::HASH_ALGO, Security::random_bytes(10)); $expire = (new \DateTime)->modify('+3 months'); $hash = hash(self::HASH_ALGO, $selector . $verifier . $user->passe . $expire->format(DATE_ATOM)); DB::getInstance()->insert('membres_sessions', [ 'selecteur' => $selector, 'hash' => $hash, 'expire' => $expire, 'id_membre' => $user->id, ]); $cookie = $selector . '|' . $verifier; $options = self::getSessionOptions(); setcookie(self::PERMANENT_COOKIE_NAME, $cookie, $expire->getTimestamp(), $options['cookie_path'], $options['cookie_domain'], $options['cookie_secure'], true); return true; } static public function isOTPRequired() { self::start(); return !empty($_SESSION['otp']); } static public function loginOTP($code) { self::start(); if (empty($_SESSION['otp'])) { return false; } $user = $_SESSION['otp']; if (empty($user->secret) || empty($user->id)) { return false; } if (!Security_OTP::TOTP($user->secret, $code)) { // Vérifier encore, mais avec le temps NTP // au cas où l'horloge du serveur n'est pas à l'heure $time = Security_OTP::getTimeFromNTP(NTP_SERVER); if (!Security_OTP::TOTP($user->secret, $code, $time)) { return false; } } $session = new Session($user->id); $session->updateLoginDate(); return $session; } static public function recoverPasswordCheck($id) { $db = DB::getInstance(); $config = Config::getInstance(); $champ_id = $config->get('champ_identifiant'); $membre = $db->first('SELECT id, email FROM membres WHERE '.$champ_id.' = ? LIMIT 1;', trim($id)); if (!$membre || trim($membre['email']) == '') { return false; } self::start(true); $hash = sha1($membre['email'] . $membre['id'] . 'recover' . ROOT . time()); $_SESSION['recover_password'] = [ 'id' => (int) $membre['id'], 'email' => $membre['email'], 'hash' => $hash ]; $message = "Bonjour,\n\nVous avez oublié votre mot de passe ? Pas de panique !\n\n"; $message.= "Il vous suffit de cliquer sur le lien ci-dessous pour recevoir un nouveau mot de passe.\n\n"; $message.= WWW_URL . 'admin/password.php?c=' . substr($hash, -10); $message.= "\n\nSi vous n'avez pas demandé à recevoir ce message, ignorez-le, votre mot de passe restera inchangé."; return Utils::mail($membre['email'], '['.$config->get('nom_asso').'] Mot de passe perdu ?', $message); } static public function recoverPasswordConfirm($hash) { self::start(); if (empty($_SESSION['recover_password']['hash'])) return false; if (substr($_SESSION['recover_password']['hash'], -10) != $hash) return false; $config = Config::getInstance(); $db = DB::getInstance(); $password = Utils::suggestPassword(); $dest = $_SESSION['recover_password']['email']; $id = (int)$_SESSION['recover_password']['id']; $message = "Bonjour,\n\nVous avez demandé un nouveau mot de passe pour votre compte.\n\n"; $message.= "Votre adresse email : ".$dest."\n"; $message.= "Votre nouveau mot de passe : ".$password."\n\n"; $message.= "Si vous n'avez pas demandé à recevoir ce message, merci de nous le signaler."; $password = $this->_hashPassword($password); $db->update('membres', ['passe' => $password], 'id = :id', ['id' => (int)$id]); return Utils::mail($dest, '['.$config->get('nom_asso').'] Nouveau mot de passe', $message); } public function __construct() { if (empty($_SESSION['user']) && defined('\Garradin\LOCAL_LOGIN') && is_int(\Garradin\LOCAL_LOGIN) && \Garradin\LOCAL_LOGIN > 0) { self::createUserSession(\Garradin\LOCAL_LOGIN); } // Démarrage session self::start(); if (empty($_SESSION['user'])) { $this->autoLogin(); } if (empty($_SESSION['user'])) { throw new \LogicException('Aucun utilisateur connecté.'); } $this->user = $_SESSION['user']; $this->id = $this->user->id; } protected function getPermanentCookie() { if (empty($_COOKIE[self::PERMANENT_COOKIE_NAME])) { return false; } $cookie = $_COOKIE[self::PERMANENT_COOKIE_NAME]; $data = explode('|', $cookie); if (count($data) !== 2) { return false; } return (object) [ 'selector' => $data[0], 'verifier' => $data[1], ]; } /** * Connexion automatique en utilisant un cookie permanent * (fonction "remember me") * * @link https://www.databasesandlife.com/persistent-login/ * @link https://paragonie.com/blog/2015/04/secure-authentication-php-with-long-term-persistence * @link https://paragonie.com/blog/2017/02/split-tokens-token-based-authentication-protocols-without-side-channels * @link http://jaspan.com/improved_persistent_login_cookie_best_practice * @return boolean */ protected function autoLogin() { $cookie = $this->getPermanentCookie(); if (!$cookie) { return false; } $db = DB::getInstance(); // Suppression des sessions qui ont expiré déjà $db->delete('membres_sessions', 'expire < strftime(\'%s\',\'now\')'); $row = $db->first('SELECT ms.hash, ms.id_membre AS id, strftime("%s", ms.expire) AS expire, membres.passe FROM membres_sessions AS ms INNER JOIN membres ON membres.id = ms.id_membre WHERE ms.selecteur = ?;', $cookie->selector); // Le sélecteur n'est pas valide: supprimons le cookie if (!$row) { return $this->logout(); } // La session stockée ne sert plus à rien à partir de maintenant, // et ça empêche de le rejouer $db->delete('membres_sessions', 'selecteur = ?', $cookie->selector); // On utilise le mot de passe: si l'utilisateur change de mot de passe // toutes les sessions précédentes sont invalidées $hash = hash(self::HASH_ALGO, $cookie->selector . $cookie->verifier . $row->passe . date(DATE_ATOM, $row->expire)); // Vérification du token if (!hash_equals($row->hash, $hash)) { // Le sélecteur est valide, mais pas le token ? // c'est probablement que le cookie a été volé, qu'un attaquant // a obtenu un nouveau token, et que l'utilisateur se représente // avec un token qui n'est plus valide. // Dans ce cas supprimons toutes les sessions de ce membre pour // le forcer à se re-connecter return $this->logout(); } // Re-générons un nouveau vérifieur et mettons à jour le cookie // car chaque vérifieur est à usage unique self::createPermanentSession($row); $this->id = $row->id; self::createUserSession($this->id); return true; } public function logout() { $url = parse_url(\Garradin\WWW_URL); if ($cookie = $this->getPermanentCookie()) { // Suppression de cette session permanente DB::getInstance()->delete('membres_sessions', 'selecteur = ?', $cookie->selector); setcookie(self::PERMANENT_COOKIE_NAME, null, -1, $url['path'], $url['host'], false, true); unset($_COOKIE[self::PERMANENT_COOKIE_NAME]); } self::start(true); session_destroy(); $_SESSION = []; setcookie(self::SESSION_COOKIE_NAME, null, -1, $url['path'], $url['host'], false, true); unset($_COOKIE[self::SESSION_COOKIE_NAME]); return true; } public function editUser($data) { return (new Membres)->edit($this->id, $data, false); } public function getUser($key = null) { if (null === $key) { return $this->user; } elseif (property_exists($key, $this->user)) { return $this->user->$key; } else { return null; } } public function canAccess($category, $permission) { if (!$this->user) { return false; } return ($this->user->droits->$category >= $permission); } public function requireAccess($category, $permission) { if (!$this->canAccess($category, $permission)) { throw new UserException('Vous n\'avez pas le droit d\'accéder à cette page.'); } } public function getNewOTPSecret() { $out = []; $out['secret'] = Security_OTP::getRandomSecret(); $out['secret_display'] = implode(' ', str_split($out['secret'], 4)); $out['url'] = Security_OTP::getOTPAuthURL(Config::getInstance()->get('nom_asso'), $out['secret']); $qrcode = new QRCode($out['url']); $out['qrcode'] = 'data:image/svg+xml;base64,' . base64_encode($qrcode->toSVG()); return $out; } public function sessionStore($key, $value) { if (!isset($_SESSION['storage'])) { $_SESSION['storage'] = []; } if ($value === null) { unset($_SESSION['storage'][$key]); } else { $_SESSION['storage'][$key] = $value; } return true; } public function sessionGet($key) { if (!isset($_SESSION['storage'][$key])) { return null; } return $_SESSION['storage'][$key]; } public function updateSessionData($membre = null, $droits = null) { if (is_null($membre)) { $membre = $this->get($_SESSION['logged_user']['id']); } elseif (is_int($membre)) { $membre = $this->get($membre); } if (is_null($droits)) { $droits = $this->getDroits($membre['id_categorie']); } $membre['droits'] = $droits; $_SESSION['logged_user'] = $membre; return true; } public function sendMessage($dest, $sujet, $message, $copie = false) { $from = $this->getLoggedUser(); $from = $from['email']; // Uniquement adresse email pour le moment car faudrait trouver comment // indiquer le nom mais qu'il soit correctement échappé FIXME $config = Config::getInstance(); $message .= "\n\n--\nCe message a été envoyé par un membre de ".$config->get('nom_asso'); $message .= ", merci de contacter ".$config->get('email_asso')." en cas d'abus."; if ($copie) { Utils::mail($from, $sujet, $message); } return Utils::mail($dest, $sujet, $message, ['From' => $from]); } public function checkPassword($password) { return Membres::checkPassword($password, $this->user->passe); } public function editSecurity(Array $data = []) { $user = $this->getLoggedUser(); if (!$user) { throw new \LogicException('Utilisateur non connecté.'); } $allowed_fields = ['passe', 'clef_pgp', 'secret_otp']; foreach ($data as $key=>$value) { if (!in_array($key, $allowed_fields)) { throw new \RuntimeException(sprintf('Le champ %s n\'est pas autorisé dans cette méthode.', $key)); } } if (isset($data['passe']) && trim($data['passe']) !== '') { if (strlen($data['passe']) < 5) { throw new UserException('Le mot de passe doit faire au moins 5 caractères.'); } $data['passe'] = $this->_hashPassword($data['passe']); } else { unset($data['passe']); } if (isset($data['clef_pgp'])) { $data['clef_pgp'] = trim($data['clef_pgp']); if (!$this->getPGPFingerprint($data['clef_pgp'])) { throw new UserException('Clé PGP invalide : impossible d\'extraire l\'empreinte.'); } } DB::getInstance()->simpleUpdate('membres', $data, 'id = '.(int)$user['id']); $this->updateSessionData(); return true; } public function getPGPFingerprint($key, $display = false) { if (!Security::canUseEncryption()) { return false; } $fingerprint = Security::getEncryptionKeyFingerprint($key); if ($display && $fingerprint) { $fingerprint = str_split($fingerprint, 4); $fingerprint = implode(' ', $fingerprint); } return $fingerprint; } } |
Modified src/include/lib/Garradin/Plugin.php from [9153e82c84] to [8256935348].
︙ | ︙ | |||
31 32 33 34 35 36 37 | * Construire un objet Plugin pour un plugin * @param string $id Identifiant du plugin * @throws UserException Si le plugin n'est pas installé (n'existe pas en DB) */ public function __construct($id) { $db = DB::getInstance(); | | | | | | | | 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 | * Construire un objet Plugin pour un plugin * @param string $id Identifiant du plugin * @throws UserException Si le plugin n'est pas installé (n'existe pas en DB) */ public function __construct($id) { $db = DB::getInstance(); $this->plugin = $db->first('SELECT * FROM plugins WHERE id = ?;', $id); if (!$this->plugin) { throw new UserException('Ce plugin n\'existe pas ou n\'est pas installé correctement.'); } $this->plugin->config = json_decode($this->plugin->config); if (!is_object($this->plugin->config)) { $this->plugin->config = new \stdClass; } $this->id = $id; } /** * Enregistrer les changements dans la config */ public function __destruct() { if ($this->config_changed) { $db = DB::getInstance(); $db->update('plugins', ['config' => json_encode($this->plugin->config)], 'id = \'' . $this->id . '\''); } } /** * Renvoie le chemin absolu vers l'archive du plugin * @return string Chemin PHAR vers l'archive |
︙ | ︙ | |||
81 82 83 84 85 86 87 | * @return mixed L'entrée demandée (mixed), ou l'intégralité de la config (array), * ou NULL si l'entrée demandée n'existe pas. */ public function getConfig($key = null) { if (is_null($key)) { | | | | | | | | | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | * @return mixed L'entrée demandée (mixed), ou l'intégralité de la config (array), * ou NULL si l'entrée demandée n'existe pas. */ public function getConfig($key = null) { if (is_null($key)) { return $this->plugin->config; } if (property_exists($this->plugin->config, $key)) { return $this->plugin->config->$key; } return null; } /** * Enregistre une entrée dans la configuration du plugin * @param string $key Clé à modifier * @param mixed $value Valeur à enregistrer, choisir NULL pour effacer cette clé de la configuration * @return boolean TRUE si tout se passe bien */ public function setConfig($key, $value = null) { if (is_null($value)) { unset($this->plugin->config->$key); } else { $this->plugin->config->$key = $value; } $this->config_changed = true; return true; } /** * Renvoie une information ou toutes les informations sur le plugin * @param string $key Clé de l'info à retourner, ou NULL pour recevoir toutes les infos * @return mixed Info demandée ou tableau des infos. */ public function getInfos($key = null) { if (is_null($key)) { return $this->plugin; } if (property_exists($this->plugin, $key)) { return $this->plugin->$key; } return null; } /** * Renvoie l'identifiant du plugin |
︙ | ︙ | |||
223 224 225 226 227 228 229 | $plugin = $this; include $this->path() . '/uninstall.php'; } unlink(PLUGINS_ROOT . '/' . $this->id . '.tar.gz'); $db = DB::getInstance(); | | | | | | | < | | > > | 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | $plugin = $this; include $this->path() . '/uninstall.php'; } unlink(PLUGINS_ROOT . '/' . $this->id . '.tar.gz'); $db = DB::getInstance(); $db->delete('plugins_signaux', 'plugin = ?', $this->id); return $db->delete('plugins', 'id = ?', $this->id); } /** * Renvoie TRUE si le plugin a besoin d'être mis à jour * (si la version notée dans la DB est différente de la version notée dans garradin_plugin.ini) * @return boolean TRUE si le plugin doit être mis à jour, FALSE sinon */ public function needUpgrade() { $infos = (object) parse_ini_file($this->path() . '/garradin_plugin.ini', false); if (version_compare($this->plugin->version, $infos->version, '!=')) return true; return false; } /** * Mettre à jour le plugin * Appelle le fichier upgrade.php dans l'archive si celui-ci existe. * @return boolean TRUE si tout a fonctionné */ public function upgrade() { if (file_exists($this->path() . '/upgrade.php')) { $plugin = $this; include $this->path() . '/upgrade.php'; } $infos = (object) parse_ini_file($this->path() . '/garradin_plugin.ini', false); return DB::getInstance()->update('plugins', ['version' => $infos->version], 'id = :id', ['id' => $this->id] ); } /** * Associer un signal à un callback du plugin * @param string $signal Nom du signal (par exemple boucle.agenda pour la boucle de type AGENDA) * @param mixed $callback Callback, sous forme d'un nom de fonction ou de méthode statique * @return boolean TRUE |
︙ | ︙ | |||
305 306 307 308 309 310 311 | /** * Liste des plugins installés (en DB) * @return array Liste des plugins triés par nom */ static public function listInstalled() { $db = DB::getInstance(); | | | | | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | /** * Liste des plugins installés (en DB) * @return array Liste des plugins triés par nom */ static public function listInstalled() { $db = DB::getInstance(); $plugins = $db->getAssocKey('SELECT id, * FROM plugins ORDER BY nom;'); $system = explode(',', PLUGINS_SYSTEM); foreach ($plugins as &$row) { $row->system = in_array($row->id, $system); } return $plugins; } /** * Liste les plugins qui doivent être affichés dans le menu * @return array Tableau associatif id => nom (ou un tableau vide si aucun plugin ne doit être affiché) */ static public function listMenu() { $db = DB::getInstance(); return $db->getAssoc('SELECT id, nom FROM plugins WHERE menu = 1 ORDER BY nom;'); } /** * Liste les plugins téléchargés mais non installés * @return array Liste des plugins téléchargés */ static public function listDownloaded() |
︙ | ︙ | |||
348 349 350 351 352 353 354 | if (!preg_match('!^([a-z0-9_.-]+)\.tar\.gz$!', $file, $match)) continue; if (array_key_exists($match[1], $installed)) continue; | | | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | if (!preg_match('!^([a-z0-9_.-]+)\.tar\.gz$!', $file, $match)) continue; if (array_key_exists($match[1], $installed)) continue; $list[$match[1]] = (object) parse_ini_file('phar://' . PLUGINS_ROOT . '/' . $match[1] . '.tar.gz/garradin_plugin.ini', false); } $dir->close(); return $list; } |
︙ | ︙ | |||
370 371 372 373 374 375 376 | if (Static_Cache::expired('plugins_list', 3600 * 24)) { $url = parse_url(PLUGINS_URL); $context_options = [ 'ssl' => [ 'verify_peer' => TRUE, | < < | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | if (Static_Cache::expired('plugins_list', 3600 * 24)) { $url = parse_url(PLUGINS_URL); $context_options = [ 'ssl' => [ 'verify_peer' => TRUE, 'verify_depth' => 5, 'CN_match' => $url['host'], 'SNI_enabled' => true, 'SNI_server_name' => $url['host'], 'disable_compression' => true, ] ]; |
︙ | ︙ | |||
504 505 506 507 508 509 510 | } if (!file_exists('phar://' . PLUGINS_ROOT . '/' . $id . '.tar.gz/garradin_plugin.ini')) { throw new UserException('L\'archive '.$id.'.tar.gz n\'est pas une extension Garradin : fichier garradin_plugin.ini manquant.'); } | | | | | | | | | | | | | | | | | | 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | } if (!file_exists('phar://' . PLUGINS_ROOT . '/' . $id . '.tar.gz/garradin_plugin.ini')) { throw new UserException('L\'archive '.$id.'.tar.gz n\'est pas une extension Garradin : fichier garradin_plugin.ini manquant.'); } $infos = (object) parse_ini_file('phar://' . PLUGINS_ROOT . '/' . $id . '.tar.gz/garradin_plugin.ini', false); $required = ['nom', 'description', 'auteur', 'url', 'version', 'menu', 'config']; foreach ($required as $key) { if (!property_exists($infos, $key)) { throw new \RuntimeException('Le fichier garradin_plugin.ini ne contient pas d\'entrée "'.$key.'".'); } } if (!empty($infos->min_version) && !version_compare(garradin_version(), $infos->min_version, '>=')) { throw new \RuntimeException('Le plugin '.$id.' nécessite Garradin version '.$infos->min_version.' ou supérieure.'); } if (!empty($infos->menu) && !file_exists('phar://' . PLUGINS_ROOT . '/' . $id . '.tar.gz/www/admin/index.php')) { throw new \RuntimeException('Le plugin '.$id.' ne comporte pas de fichier www/admin/index.php alors qu\'il demande à figurer au menu.'); } $config = ''; if ((bool)$infos->config) { if (!file_exists('phar://' . PLUGINS_ROOT . '/' . $id . '.tar.gz/config.json')) { throw new \RuntimeException('L\'archive '.$id.'.tar.gz ne comporte pas de fichier config.json alors que le plugin nécessite le stockage d\'une configuration.'); } if (!file_exists('phar://' . PLUGINS_ROOT . '/' . $id . '.tar.gz/www/admin/config.php')) { throw new \RuntimeException('L\'archive '.$id.'.tar.gz ne comporte pas de fichier www/admin/config.php alors que le plugin nécessite le stockage d\'une configuration.'); } $config = json_decode(file_get_contents('phar://' . PLUGINS_ROOT . '/' . $id . '.tar.gz/config.json')); if (is_null($config)) { throw new \RuntimeException('config.json invalide. Code erreur JSON: ' . json_last_error()); } $config = json_encode($config); } $db = DB::getInstance(); $db->insert('plugins', [ 'id' => $id, 'officiel' => (int)(bool)$official, 'nom' => $infos->nom, 'description'=> $infos->description, 'auteur' => $infos->auteur, 'url' => $infos->url, 'version' => $infos->version, 'menu' => (int)(bool)$infos->menu, 'config' => $config, ]); if (file_exists('phar://' . PLUGINS_ROOT . '/' . $id . '.tar.gz/install.php')) { $plugin = new Plugin($id); include 'phar://' . PLUGINS_ROOT . '/' . $id . '.tar.gz/install.php'; } return true; } /** * Renvoie la version installée d'un plugin ou FALSE s'il n'est pas installé * @param string $id Identifiant du plugin * @return mixed Numéro de version du plugin ou FALSE */ static public function getInstalledVersion($id) { return DB::getInstance()->first('SELECT version FROM plugins WHERE id = ?;', $id); } /** * Déclenche le signal donné auprès des plugins enregistrés * @param string $signal Nom du signal * @param array $params Paramètres du callback (array ou null) * @return NULL NULL si aucun plugin n'a été appelé, true sinon */ static public function fireSignal($signal, $params = null, &$return = null) { $list = DB::getInstance()->get('SELECT * FROM plugins_signaux WHERE signal = ?;', $signal); foreach ($list as $row) { if (!in_array($row['plugin'], self::$signal_files)) { require_once 'phar://' . PLUGINS_ROOT . '/' . $row['plugin'] . '.tar.gz/signals.php'; } |
︙ | ︙ |
Modified src/include/lib/Garradin/Rappels.php from [a07b8f1b57] to [c017a2b4d9].
︙ | ︙ | |||
50 51 52 53 54 55 56 | */ public function add($data) { $db = DB::getInstance(); $this->_checkFields($data); | | | | | | > | | | | | | | | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | */ public function add($data) { $db = DB::getInstance(); $this->_checkFields($data); $db->insert('rappels', $data); return $db->lastInsertRowId(); } /** * Modifier un rappel automatique * @param integer $id Numéro du rappel * @param array $data Données du rappel * @return boolean TRUE si tout s'est bien passé * @throws UserException En cas d'erreur dans une donnée à modifier */ public function edit($id, $data) { $db = DB::getInstance(); $this->_checkFields($data); return $db->update('rappels', $data, 'id = ' . (int)$id); } /** * Supprimer un rappel automatique * @param integer $id Numéro du rappel * @param boolean $delete_history Effacer aussi l'historique des rappels envoyés * @return boolean TRUE en cas de succès */ public function delete($id, $delete_history = false) { $db = DB::getInstance(); $db->begin(); if ($delete_history) { $db->delete('rappels_envoyes', 'id_rappel = ?', (int) $id); } else { $db->update('rappels_envoyes', ['id_rappel' => null], 'id_rappel = ' . (int)$id); } $db->delete('rappels', 'id = ?', (int) $id); $db->commit(); return true; } /** * Renvoie les données sur un rappel * @param integer $id Numéro du rappel * @return array Données du rappel */ public function get($id) { return DB::getInstance()->first('SELECT * FROM rappels WHERE id = ?;', (int)$id); } /** * Renvoie le nombre de rappels automatiques enregistrés * @return integer Nombre de rappels */ public function countAll() { return DB::getInstance()->firstColumn('SELECT COUNT(*) FROM rappels;'); } /** * Liste des rappels triés par cotisation * @return array Liste des rappels */ public function listByCotisation() { return DB::getInstance()->get('SELECT r.*, c.intitule, c.montant, c.duree, c.debut, c.fin FROM rappels AS r INNER JOIN cotisations AS c ON c.id = r.id_cotisation ORDER BY r.id_cotisation, r.delai, r.sujet;'); } /** * Liste des rappels pour une cotisation donnée * @param integer $id Numéro du rappel * @return array Liste des rappels */ public function listForCotisation($id) { return DB::getInstance()->get('SELECT * FROM rappels WHERE id_cotisation = ? ORDER BY delai, sujet;', (int)$id); } /** * Envoi des rappels automatiques par e-mail * @return boolean TRUE en cas de succès */ public function sendPending() |
︙ | ︙ | |||
188 189 190 191 192 193 194 | /* Pour ne pas spammer on n\'envoie pas de rappel antérieur au dernier rappel déjà effectué */ AND id NOT IN (SELECT id_membre FROM rappels_envoyes AS re WHERE id_cotisation = re.id_cotisation AND re.date >= date(expiration, delai || \' days\') ) ORDER BY nb_jours DESC;'; | | | | | 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | /* Pour ne pas spammer on n\'envoie pas de rappel antérieur au dernier rappel déjà effectué */ AND id NOT IN (SELECT id_membre FROM rappels_envoyes AS re WHERE id_cotisation = re.id_cotisation AND re.date >= date(expiration, delai || \' days\') ) ORDER BY nb_jours DESC;'; $db->begin(); $st = $db->prepare($query); $res = $st->execute(); $re = new Rappels_Envoyes; while ($row = $db->fetch($res)) { $re->sendAuto($row); } $db->commit(); return true; } } |
Modified src/include/lib/Garradin/Rappels_Envoyes.php from [2586be6ed0] to [4dd5416887].
︙ | ︙ | |||
136 137 138 139 140 141 142 | /** * Envoi de mail pour rappel automatisé * @param array $data Données du rappel automatisé * @return boolean TRUE */ public function sendAuto($data) { | | | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | /** * Envoi de mail pour rappel automatisé * @param array $data Données du rappel automatisé * @return boolean TRUE */ public function sendAuto($data) { $replace = (array) $data; $replace['date_rappel'] = Utils::sqliteDateToFrench($replace['date_rappel']); $replace['date_expiration'] = Utils::sqliteDateToFrench($replace['expiration']); $replace['nb_jours'] = abs($replace['nb_jours']); $replace['delai'] = abs($replace['delai']); $subject = $this->replaceTagsInContent($data['sujet'], $replace); $text = $this->replaceTagsInContent($data['texte'], $replace); |
︙ | ︙ | |||
160 161 162 163 164 165 166 167 168 169 170 171 172 173 | 'media' => Rappels_Envoyes::MEDIA_EMAIL, // On enregistre la date de mise en œuvre du rappel // et non pas la date d'envoi effective du rappel // car l'envoi du rappel peut ne pas être effectué // le jour où il aurait dû être envoyé (la magie des cron) 'date' => $data['date_rappel'], ]); return true; } /** * Liste des rappels envoyés à un membre * @param integer $id Numéro du membre | > > | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | 'media' => Rappels_Envoyes::MEDIA_EMAIL, // On enregistre la date de mise en œuvre du rappel // et non pas la date d'envoi effective du rappel // car l'envoi du rappel peut ne pas être effectué // le jour où il aurait dû être envoyé (la magie des cron) 'date' => $data['date_rappel'], ]); Plugin::fireSignal('rappels.auto', $data); return true; } /** * Liste des rappels envoyés à un membre * @param integer $id Numéro du membre |
︙ | ︙ |
Modified src/include/lib/Garradin/Sauvegarde.php from [e15be831b5] to [ace718c666].
1 2 3 4 5 6 | <?php namespace Garradin; class Sauvegarde { | | > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <?php namespace Garradin; class Sauvegarde { const NEED_UPGRADE = 0x01 << 2; const NOT_AN_ADMIN = 0x01 << 3; const INTEGRITY_FAIL = 41; const NOT_A_DB = 42; const NO_APP_ID = 43; /** * Renvoie la liste des fichiers SQLite sauvegardés * @param boolean $auto Si true ne renvoie que la liste des sauvegardes automatiques * @return array Liste des fichiers */ public function getList($auto = false) |
︙ | ︙ | |||
146 147 148 149 150 151 152 153 154 155 156 157 158 159 | while (!feof($in)) { fwrite($out, fread($in, 8192)); } fclose($in); fclose($out); return true; } /** * Restaure une sauvegarde locale * @param string $file Le nom de fichier à utiliser comme point de restauration | > > > > | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | while (!feof($in)) { fwrite($out, fread($in, 8192)); } fclose($in); // Ajout du hash pour vérification intégrité fwrite($out, sha1_file(DB_FILE)); fclose($out); return true; } /** * Restaure une sauvegarde locale * @param string $file Le nom de fichier à utiliser comme point de restauration |
︙ | ︙ | |||
172 173 174 175 176 177 178 | } return $this->restoreDB(DATA_ROOT . '/' . $file); } /** * Restaure une copie distante (fichier envoyé) | | > > > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > | | > > > > > > > | > > > > > > > > > > > > > > | < < > > > > > > > > > > > > | | | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | } return $this->restoreDB(DATA_ROOT . '/' . $file); } /** * Restaure une copie distante (fichier envoyé) * @param array $file Tableau provenant de $_FILES * @param integer $user_id ID du membre actuellement connecté, utilisé pour * vérifier qu'il est toujours administrateur dans la sauvegarde * @param boolean $check_integrity Vérifier l'intégrité de la sauvegarde avant de restaurer * @return boolean true */ public function restoreFromUpload($file, $user_id, $check_integrity = true) { if (empty($file['size']) || empty($file['tmp_name']) || !empty($file['error'])) { throw new UserException('Le fichier n\'a pas été correctement envoyé. Essayer de le renvoyer à nouveau.'); } if ($check_integrity) { $integrity = $this->checkIntegrity($file['tmp_name']); if ($integrity === null) { throw new UserException('Le fichier fourni n\'est pas une base de donnée SQLite3.', self::NOT_A_DB); } elseif ($integrity === false) { throw new UserException('Le fichier fourni a été modifié par un programme externe.', self::INTEGRITY_FAIL); } } $r = $this->restoreDB($file['tmp_name'], $user_id); if ($r) { unlink($file['tmp_name']); } return $r; } /** * Vérifie l'intégrité d'une sauvegarde Garradin * @param string $file Chemin absolu vers la base de donnée * @return boolean */ protected function checkIntegrity($file_path, $remove_hash = true) { $size = filesize($file_path); $fp = fopen($file_path, 'r+'); $header = fread($fp, 16); // Vérifie que le fichier est bien une base SQLite3 if ($header !== "SQLite format 3\000") { fclose($fp); return null; } fseek($fp, -40, SEEK_END); $hash = fread($fp, 40); // Ne ressemble pas à un hash sha1 if (!preg_match('/[a-f0-9]{40}/', $hash)) { fclose($fp); return false; } $max = $size - 40; // Suppression du hash if ($remove_hash) { ftruncate($fp, $max); } fclose($fp); $file_hash = sha1_file($file_path); // Vérification du hash return ($file_hash === $hash); } /** * Restauration de base de données, la fonction qui le fait vraiment * @param string $file Chemin absolu vers la base de données à utiliser * @return mixed true si rien ne va plus, ou self::NEED_UPGRADE si la version de la DB * ne correspond pas à la version de Garradin (mise à jour nécessaire). */ protected function restoreDB($file, $user_id = false) { $return = 1; // Essayons déjà d'ouvrir la base de données à restaurer en lecture try { $db = new \SQLite3($file, SQLITE3_OPEN_READONLY); } catch (\Exception $e) { throw new UserException('Le fichier fourni n\'est pas une base de données valide. ' . 'Message d\'erreur de SQLite : ' . $e->getMessage(), self::NOT_A_DB); } try { // Regardons ensuite si la base de données n'est pas corrompue $check = $db->querySingle('PRAGMA integrity_check;', false); } catch (\Exception $e) { // Ici SQLite peut rejeter un message type "file is encrypted or is not a db" throw new UserException('Le fichier fourni n\'est pas une base de données valide. ' . 'Message d\'erreur de SQLite : ' . $e->getMessage(), self::NOT_A_DB); } if (strtolower(trim($check)) != 'ok') { throw new UserException('Le fichier fourni est corrompu. SQLite a trouvé ' . $check . ' erreurs.'); } // On ne peut pas faire de vérifications très poussées sur la structure de la base de données, // celle-ci pouvant changer d'une version à l'autre et on peut vouloir importer une base // un peu vieille, mais on vérifie quand même que ça ressemble un minimum à une base garradin $table = $db->querySingle('SELECT 1 FROM sqlite_master WHERE type=\'table\' AND tbl_name=\'config\';', false); if (!$table) { throw new UserException('Le fichier fourni ne semble pas contenir de données liées à Garradin.'); } // On récupère la version $version = $db->querySingle('SELECT valeur FROM config WHERE cle=\'version\';'); // Vérification de l'AppID pour les versions récentes if (version_compare($version, '0.8.0', '>=')) { $appid = $db->querySingle('PRAGMA application_id;', false); if ($appid !== DB::APPID) { throw new UserException('Ce fichier n\'est pas une sauvegarde Garradin (application_id ne correspond pas).', self::NO_APP_ID); } } if ($user_id) { // Empêchons l'admin de se tirer une balle dans le pied $is_still_admin = $db->querySingle('SELECT 1 FROM membres_categories WHERE id = (SELECT id_categorie FROM membres WHERE id = ' . (int) $user_id . ') AND droit_config >= ' . Membres::DROIT_ADMIN . ' AND droit_connexion >= ' . Membres::DROIT_ACCES); if (!$is_still_admin) { $return |= self::NOT_AN_ADMIN; } } $db->close(); $backup = str_replace('.sqlite', date('.Y-m-d-His') . '.avant_restauration.sqlite', DB_FILE); DB::getInstance()->close(); if (!rename(DB_FILE, $backup)) { throw new \RuntimeException('Unable to backup current DB file.'); } if (!copy($file, DB_FILE)) { rename($backup, DB_FILE); throw new \RuntimeException('Unable to copy backup DB to main location.'); } if ($return & self::NOT_AN_ADMIN) { // Forcer toutes les catégories à pouvoir gérer les droits $db = DB::getInstance(); $db->update('membres_categories', [ 'droit_membres' => Membres::DROIT_ADMIN, 'droit_connexion' => Membres::DROIT_ACCES ]); } if ($version != garradin_version()) { $return |= self::NEED_UPGRADE; } return $return; } /** * Taille de la base de données actuelle * @return integer Taille en octets du fichier SQLite */ public function getDBSize() |
︙ | ︙ |
Modified src/include/lib/Garradin/Template.php from [291763512c] to [58ab6469f8].
1 2 3 4 | <?php namespace Garradin; | | | < < < < | | < | < < | < < | > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | <?php namespace Garradin; use KD2\Security; class Template extends \KD2\Smartyer { static protected $_instance = null; static public function getInstance() { return self::$_instance ?: self::$_instance = new Template; } private function __clone() { } public function __construct() { self::setCompileDir(CACHE_ROOT . '/compiled'); self::setTemplateDir(ROOT . '/templates'); parent::__construct(); $this->assign('www_url', WWW_URL); $this->assign('self_url', Utils::getSelfUrl()); $this->assign('self_url_no_qs', Utils::getSelfUrl(true)); $this->assign('is_logged', false); } } $tpl = Template::getInstance(); function tpl_csrf_field($params) { return Security::tokenHTML($params['key']); } function tpl_form_field($params) { if (!isset($params['name'])) throw new \BadFunctionCallException('name argument is mandatory'); $name = $params['name']; if (isset($_POST[$name])) $value = $_POST[$name]; elseif (isset($params['data']) && is_array($params['data']) && array_key_exists($name, $params['data'])) { $value = $params['data'][$name]; } elseif (isset($params['data']) && is_object($params['data']) && property_exists($params['data'], $name)) { $value = $params['data']->$name; } elseif (isset($params['default'])) $value = $params['default']; else $value = ''; if (is_array($value)) { |
︙ | ︙ | |||
106 107 108 109 110 111 112 | } function tpl_strftime_fr($ts, $format) { return Utils::strftime_fr($format, $ts); } | | | 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | } function tpl_strftime_fr($ts, $format) { return Utils::strftime_fr($format, $ts); } function tpl_date_fr($ts, $format = 'd/m/Y H:i:s') { return Utils::date_fr($format, $ts); } function tpl_format_droits($params) { $droits = $params['droits']; |
︙ | ︙ | |||
385 386 387 388 389 390 391 | function tpl_html_champ_membre($params) { if (empty($params['config']) || empty($params['name'])) throw new \BadFunctionCallException('Paramètres type et name obligatoires.'); $config = $params['config']; | | | > > | | > | > > > | < < < < < | | | | | 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | function tpl_html_champ_membre($params) { if (empty($params['config']) || empty($params['name'])) throw new \BadFunctionCallException('Paramètres type et name obligatoires.'); $config = $params['config']; $type = $config->type; if ($params['name'] == 'passe' || (!empty($params['user_mode']) && !empty($config->private))) { return ''; } $options = []; if ($type == 'select' || $type == 'multiple') { if (empty($config->options)) { throw new \BadFunctionCallException('Paramètre options obligatoire pour champ de type ' . $type); } $options = (array) $config->options; } elseif ($type == 'country') { $type = 'select'; $options = Utils::getCountryList(); $params['default'] = Config::getInstance()->get('pays'); } elseif ($type == 'date') { $params['pattern'] = '\d{4}-\d{2}-\d{2}'; } $field = ''; $value = tpl_form_field($params); $attributes = 'name="' . htmlspecialchars($params['name'], ENT_QUOTES, 'UTF-8') . '" '; $attributes .= 'id="f_' . htmlspecialchars($params['name'], ENT_QUOTES, 'UTF-8') . '" '; if (!empty($params['disabled'])) { $attributes .= 'disabled="disabled" '; } if (!empty($config->mandatory)) { $attributes .= 'required="required" '; } if (!empty($params['user_mode']) && empty($config->editable)) { $out = '<dt>' . htmlspecialchars($config->title, ENT_QUOTES, 'UTF-8') . '</dt>'; $out .= '<dd>' . (trim($value) === '' ? 'Non renseigné' : tpl_display_champ_membre($value, $config)) . '</dd>'; return $out; } if ($type == 'select') { $field .= '<select '.$attributes.'>'; foreach ($options as $k=>$v) { if (is_int($k)) $k = $v; $field .= '<option value="' . htmlspecialchars($k, ENT_QUOTES, 'UTF-8') . '"'; if ($value == $k || empty($value) && !empty($params['default'])) |
︙ | ︙ | |||
460 461 462 463 464 465 466 | { if (is_array($value)) { $binary = 0; foreach ($value as $k => $v) { | | | | 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | { if (is_array($value)) { $binary = 0; foreach ($value as $k => $v) { if (array_key_exists($k, $options) && !empty($v)) { $binary |= 0x01 << $k; } } $value = $binary; } foreach ($options as $k=>$v) { $b = 0x01 << (int)$k; $field .= '<label><input type="checkbox" name="' . htmlspecialchars($params['name'], ENT_QUOTES, 'UTF-8') . '[' . (int)$k . ']" value="1" ' . (($value & $b) ? 'checked="checked"' : '') . ' ' . $attributes . '/> ' . htmlspecialchars($v, ENT_QUOTES, 'UTF-8') . '</label><br />'; } |
︙ | ︙ | |||
506 507 508 509 510 511 512 | if ($type == 'checkbox') { $out .= $field . ' '; } $out .= '<label for="f_' . htmlspecialchars($params['name'], ENT_QUOTES, 'UTF-8') . '">' | | | | | | | > | < | < | < | < | < | < | < | < | < | < | | | | | | | < | < | < < | 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 | if ($type == 'checkbox') { $out .= $field . ' '; } $out .= '<label for="f_' . htmlspecialchars($params['name'], ENT_QUOTES, 'UTF-8') . '">' . htmlspecialchars($config->title, ENT_QUOTES, 'UTF-8') . '</label>'; if (!empty($config->mandatory)) { $out .= ' <b title="(Champ obligatoire)">obligatoire</b>'; } $out .= '</dt>'; if (!empty($config->help)) { $out .= ' <dd class="help">' . htmlspecialchars($config->help, ENT_QUOTES, 'UTF-8') . '</dd>'; } if ($type != 'checkbox') { $out .= ' <dd>' . $field . '</dd>'; } return $out; } function tpl_display_champ_membre($v, $config) { switch ($config->type) { case 'checkbox': return $v ? 'Oui' : 'Non'; case 'email': return '<a href="mailto:' . rawurlencode($v) . '">' . htmlspecialchars($v) . '</a>'; case 'tel': return '<a href="tel:' . rawurlencode($v) . '">' . htmlspecialchars($v) . '</a>'; case 'url': return '<a href="' . htmlspecialchars($v) . '">' . htmlspecialchars($v) . '</a>'; case 'country': return Utils::getCountryName($v); case 'multiple': $out = []; foreach ($config->options as $b => $name) { if ($v & (0x01 << $b)) $out[] = $name; } return implode(', ', $out); default: return htmlspecialchars($v); } } $tpl->register_function('csrf_field', 'Garradin\tpl_csrf_field'); $tpl->register_function('form_field', 'Garradin\tpl_form_field'); $tpl->register_function('select_compte', 'Garradin\tpl_select_compte'); $tpl->register_function('format_droits', 'Garradin\tpl_format_droits'); |
︙ | ︙ | |||
602 603 604 605 606 607 608 | $tpl->register_modifier('format_sqlite_date_to_french', ['Garradin\Utils', 'sqliteDateToFrench']); $tpl->register_modifier('format_bytes', ['Garradin\Utils', 'format_bytes']); $tpl->register_modifier('strftime_fr', 'Garradin\tpl_strftime_fr'); $tpl->register_modifier('date_fr', 'Garradin\tpl_date_fr'); | | > > > > > | 587 588 589 590 591 592 593 594 595 596 597 598 599 | $tpl->register_modifier('format_sqlite_date_to_french', ['Garradin\Utils', 'sqliteDateToFrench']); $tpl->register_modifier('format_bytes', ['Garradin\Utils', 'format_bytes']); $tpl->register_modifier('strftime_fr', 'Garradin\tpl_strftime_fr'); $tpl->register_modifier('date_fr', 'Garradin\tpl_date_fr'); $tpl->register_compile_function('continue', function ($pos, $block, $name, $raw_args) { if ($block == 'continue') { return 'continue;'; } }); |
Modified src/include/lib/Garradin/Utils.php from [34b8cc4485] to [fbd4916050].
1 2 3 4 5 6 7 8 9 10 11 | <?php namespace Garradin; class Utils { static protected $country_list = null; static protected $skriv = null; static private $french_date_names = [ | > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; use KD2\Security; class Utils { static protected $country_list = null; static protected $skriv = null; static private $french_date_names = [ |
︙ | ︙ | |||
177 178 179 180 181 182 183 | header("Location: " . $destination); if ($exit) exit(); } | < < < < < < < < < < < | < < < | < < < < < < < < < < < < < < < < < < < < < < < < | | | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | header("Location: " . $destination); if ($exit) exit(); } static public function CSRF_create($key) { return Security::tokenGenerate($key); } static public function CSRF_check($key, $hash=null) { return Security::tokenCheck($key, $hash); } static public function CSRF_field_name($key) { return Security::tokenFieldName($key); } static public function post($key) { return isset($_POST[$key]) ? $_POST[$key] : ''; } |
︙ | ︙ | |||
523 524 525 526 527 528 529 | $dir->close(); return true; } static public function suggestPassword() { | | | 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | $dir->close(); return true; } static public function suggestPassword() { return \KD2\Security::getRandomPassphrase(ROOT . '/include/data/dictionary.fr'); } static public function checkIBAN($iban) { $iban = substr($iban, 4) . substr($iban, 0, 4); $iban = str_replace(range('A', 'Z'), range(10, 35), $iban); return (bcmod($iban, 97) == 1); |
︙ | ︙ | |||
558 559 560 561 562 563 564 | { return $key . ' = ' . ($value ? 'true' : 'false'); } elseif (is_numeric($value)) { return $key . ' = ' . $value; } | | > | | 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 | { return $key . ' = ' . ($value ? 'true' : 'false'); } elseif (is_numeric($value)) { return $key . ' = ' . $value; } elseif (is_array($value) || is_object($value)) { $out = ''; $value = (array) $value; foreach ($value as $row) { $out .= $get_ini_line($key . '[]', $row) . "\n"; } return substr($out, 0, -1); } else { return $key . ' = "' . str_replace('"', '\\"', $value) . '"'; } }; foreach ($in as $key=>$value) { if ((is_array($value) || is_object($value)) && is_string($key)) { $out .= '[' . $key . "]\n"; foreach ($value as $row_key=>$row_value) { $out .= $get_ini_line($row_key, $row_value) . "\n"; } |
︙ | ︙ | |||
712 713 714 715 716 717 718 | arsort($delims); reset($delims); rewind($fp); return key($delims); } | | < | 677 678 679 680 681 682 683 684 | arsort($delims); reset($delims); rewind($fp); return key($delims); } } |
Modified src/index.php from [c3be9b45ef] to [77aa99b396].
1 2 3 4 5 6 7 | <?php // Ce fichier n'est pas censé être appelé sauf si l'installation de Garradin // n'est pas effectuée correctement avec le vhost pointant sur le répertoire www/ // auquel cas on limite les dégâts // Juste une vérification avant de continuer | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php // Ce fichier n'est pas censé être appelé sauf si l'installation de Garradin // n'est pas effectuée correctement avec le vhost pointant sur le répertoire www/ // auquel cas on limite les dégâts // Juste une vérification avant de continuer if (!version_compare(phpversion(), '5.6.0', '>=')) { die('PHP 5.6.0 ou supérieur est nécessaire au fonctionnement de Garradin.'); } header('Location: www/'); |
Modified src/templates/admin/_foot.tpl from [37807b9eb8] to [02e626a0f4].
1 2 3 4 5 | </div> <script type="text/javascript" defer="defer"> {literal} (function () { | > < < | > | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | </div> <script type="text/javascript" defer="defer"> var keep_session_url = "{$www_url}admin/login.php?keepSessionAlive&"; {literal} (function () { function refreshSession() { var i = new Image(1, 1); var d = +new Date; i.src = keep_session_url + d; } window.setInterval(refreshSession, 10 * 60 * 1000); } ()); {/literal} </script> </body> </html> |
Modified src/templates/admin/_head.tpl from [c9d36e4d61] to [f1204d56a3].
1 2 3 4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>{$title}</title> <link rel="icon" type="image/png" href="{$admin_url}static/icon.png" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, target-densitydpi=device-dpi" /> <link rel="stylesheet" type="text/css" href="{$admin_url}static/admin.css" media="all" /> <link rel="stylesheet" type="text/css" href="{$admin_url}static/print.css" media="print" /> <link rel="stylesheet" type="text/css" href="{$admin_url}static/handheld.css" media="handheld,screen and (max-width:981px)" /> {if isset($js) || isset($custom_js)} <script type="text/javascript" src="{$admin_url}static/scripts/global.js"></script> {/if} {if isset($custom_js)} {foreach from=$custom_js item="js"} <script type="text/javascript" src="{$admin_url}static/scripts/{$js}"></script> {/foreach} {/if} {if isset($plugin_css)} {foreach from=$plugin_css item="css"} <link rel="stylesheet" type="text/css" href="{plugin_url file=$css}" /> {/foreach} {/if} {if isset($plugin_js)} {foreach from=$plugin_js item="js"} <script type="text/javascript" src="{plugin_url file=$js}"></script> {/foreach} {/if} </head> <body{if !empty($body_id)} id="{$body_id}"{/if} data-url="{$admin_url}"> {if empty($is_popup)} <div class="header"> <ul class="menu"> {if !$is_logged} <li><a href="{$www_url}">← Retour au site</a></li> <li><a href="{$admin_url}">Connexion</a> <ul> <li><a href="{$admin_url}password.php">Mot de passe perdu</a> </ul> </li> {else} <li class="home{if $current == 'home'} current{/if}"><a href="{$admin_url}"><b class="icn">⌂</b> Accueil</a></li> {if !empty($plugins_menu)} <li class="plugins"> <ul> {foreach from=$plugins_menu key="id" item="name"} <li class="plugins {if $current == sprintf("plugin_%s", $id)} current{/if}"><a href="{plugin_url id=$id}">{$name}</a></li> {/foreach} </ul> </li> {/if} {if $user.droits.membres >= Garradin\Membres::DROIT_ACCES} <li class="member list{if $current == 'membres'} current{/if}"><a href="{$admin_url}membres/"><b class="icn">👪</b> Membres</a> {if $user.droits.membres >= Garradin\Membres::DROIT_ECRITURE} |
︙ | ︙ | |||
102 103 104 105 106 107 108 | </li> {if !defined('Garradin\LOCAL_LOGIN')} <li class="logout"><a href="{$admin_url}logout.php"><b class="icn">⤝</b> Déconnexion</a></li> {/if} {/if} </ul> | | | 102 103 104 105 106 107 108 109 110 111 112 113 | </li> {if !defined('Garradin\LOCAL_LOGIN')} <li class="logout"><a href="{$admin_url}logout.php"><b class="icn">⤝</b> Déconnexion</a></li> {/if} {/if} </ul> <h1>{$title}</h1> </div> {/if} <div class="page"> |
Modified src/templates/admin/compta/banques/index.tpl from [18ae6dc855] to [a86799ae10].
1 2 3 4 | {include file="admin/_head.tpl" title="Comptes bancaires" current="compta/banques"} <ul class="actions"> <li class="current"><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li> | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Comptes bancaires" current="compta/banques"} <ul class="actions"> <li class="current"><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li> <li><a href="{$www_url}admin/compta/comptes/journal.php?id={$id_caisse}&suivi">Journal de caisse</a></li> </ul> {if !empty($liste)} <table class="list"> <thead> <tr> <td>Banque</td> <th>Libellé</th> <td>Solde</td> <td>IBAN</td> <td>BIC</td> <td></td> </tr> </thead> <tbody> {foreach from=$liste item="compte"} <tr> <td>{$compte.banque}</td> <th>{$compte.libelle}</th> <td><strong>{$compte.solde|escape|html_money} {$config.monnaie}</strong></td> <td>{$compte.iban|escape|format_iban}</td> <td>{$compte.bic}</td> <td class="actions"> <a class="icn" href="{$www_url}admin/compta/comptes/journal.php?id={$compte.id}&suivi" title="Journal">𝍢</a> {if $user.droits.compta >= Garradin\Membres::DROIT_ECRITURE} <a class="icn" href="{$www_url}admin/compta/banques/rapprocher.php?id={$compte.id}" title="Rapprocher">☑</a> {/if} {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} <a class="icn" href="{$www_url}admin/compta/banques/modifier.php?id={$compte.id}" title="Modifier">✎</a> <a class="icn" href="{$www_url}admin/compta/banques/supprimer.php?id={$compte.id}" title="Supprimer">✘</a> {/if} </td> </tr> {/foreach} </tbody> </table> </dl> {/if} {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Ajouter un compte bancaire</legend> <dl> <dt><label for="f_libelle">Libellé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="libelle" id="f_libelle" value="{form_field name=libelle}" required="required" /></dd> <dt><label for="f_banque">Nom de la banque</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="banque" id="f_banque" value="{form_field name=banque}" required="required" /></dd> <dt><label for="f_solde">Solde initial</label></dt> <dd><input type="number" size="5" name="solde" id="f_solde" value="{form_field name=solde default=0.00}" step="0.01" /> {$config.monnaie}</dd> <dt><label for="f_iban">Numéro IBAN</label></dt> <dd><input type="text" size="30" name="iban" id="f_iban" value="{form_field name=iban}" /></dd> <dt><label for="f_bic">Code BIC/SWIFT de la banque</label></dt> <dd><input type="text" size="10" name="bic" id="f_bic" value="{form_field name=bic}" /></dd> </dl> </fieldset> |
︙ | ︙ |
Modified src/templates/admin/compta/banques/modifier.tpl from [09bb7ee2b1] to [9e2a94ee6b].
1 2 3 4 | {include file="admin/_head.tpl" title="Modifier un compte" current="compta/banques"} {if $error} <p class="error"> | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | {include file="admin/_head.tpl" title="Modifier un compte" current="compta/banques"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Modifier un compte bancaire</legend> <dl> <dt><label for="f_libelle">Libellé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="libelle" id="f_libelle" value="{form_field name=libelle data=$compte}" required="required" /></dd> <dt><label for="f_banque">Nom de la banque</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="banque" id="f_banque" value="{form_field name=banque data=$compte}" required="required" /></dd> <dt><label for="f_iban">Numéro IBAN</label></dt> <dd><input type="text" size="30" name="iban" id="f_iban" value="{form_field name=iban data=$compte}" /></dd> <dt><label for="f_bic">Code BIC/SWIFT de la banque</label></dt> <dd><input type="text" size="10" name="bic" id="f_bic" value="{form_field name=bic data=$compte}" /></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="compta_edit_banque_%d"|args:$compte.id} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/banques/rapprocher.tpl from [9929219aa3] to [c0b0802567].
|
| | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | {include file="admin/_head.tpl" title="Rapprochement — %s"|args:$compte.id current="compta/banques" js=1} <ul class="actions"> <li><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li> <li><a href="{$www_url}admin/compta/comptes/journal.php?id={$id_caisse}&suivi">Journal de caisse</a></li> <li class="current"><a href="{$self_url_no_qs}?id={$compte.id}">Rapprochement</a></li> </ul> <form method="get" action="{$self_url_no_qs}"> {if !empty($prev) && !empty($next)} <fieldset class="shortFormRight"> <legend>Rapprochement par mois</legend> <dl> <dd class="actions"> <a class="icn" href="{$self_url_no_qs}?id={$compte.id}&debut={$prev|date_fr:'Y-m-01'}&fin={$prev|date_fr:'Y-m-t'}">← {$prev|date_fr:'F Y'}</a> | <a class="icn" href="{$self_url_no_qs}?id={$compte.id}&debut={$next|date_fr:'Y-m-01'}&fin={$next|date_fr:'Y-m-t'}">{$next|date_fr:'F Y'} →</a> </dd> </dl> </fieldset> {/if} <fieldset> <legend>Période de rapprochement</legend> <p> Du <input type="date" name="debut" id="f_debut" value="{form_field name='debut' default=$debut}" /> au <input type="date" name="fin" id="f_fin" value="{form_field name='fin' default=$fin}" /> <input type="hidden" name="id" value="{$compte.id}" /> <input type="submit" value="Afficher" /> </p> </fieldset> </form> {if $error} <p class="error">{$error}</p> {/if} <form method="post" action="{$self_url}"> <table class="list"> <colgroup> <col width="3%" /> <col width="3%" /> <col width="3%" /> <col width="12%" /> <col width="10%" /> |
︙ | ︙ | |||
56 57 58 59 60 61 62 | <td>Solde cumulé</td> <th>Libellé</th> </tr> </thead> <tbody> <tr> <td colspan="5"></td> | | | | | | | | | | | | 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 | <td>Solde cumulé</td> <th>Libellé</th> </tr> </thead> <tbody> <tr> <td colspan="5"></td> <td>{$solde_initial|escape|html_money} {$config.monnaie}</td> <th>Solde au {$debut|format_sqlite_date_to_french}</th> </tr> {foreach from=$journal item="ligne"} <tr> <td class="check"><input type="checkbox" name="rapprocher[{$ligne.id}]" value="1" {if $ligne.date_rapprochement}checked="checked"{/if} /></td> <td class="num"><a href="{$admin_url}compta/operations/voir.php?id={$ligne.id}">{$ligne.id}</a></td> <td class="actions"> {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} <a class="icn" href="{$admin_url}compta/operations/modifier.php?id={$ligne.id}" title="Modifier cette opération">✎</a> {/if} </td> <td>{$ligne.date|date_fr:'d/m/Y'}</td> <td>{if $ligne.compte_credit == $compte.id}-{else}+{/if}{$ligne.montant|escape|html_money}</td> <td>{$ligne.solde|escape|html_money}</td> <th>{$ligne.libelle}</th> </tr> {/foreach} </tbody> <tfoot> <tr> <td colspan="5"></td> <td>{$solde_final|escape|html_money} {$config.monnaie}</td> <th>Solde au {$fin|format_sqlite_date_to_french}</th> </tr> </tfoot> </table> <p class="submit"> {csrf_field key="compta_rapprocher_%s"|args:$compte.id} <input type="submit" name="save" value="Enregistrer" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/banques/supprimer.tpl from [d5ad6ed54b] to [aca4962b79].
1 2 3 4 | {include file="admin/_head.tpl" title="Supprimer un compte" current="compta/banques"} {if $error} <p class="error"> | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | {include file="admin/_head.tpl" title="Supprimer un compte" current="compta/banques"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer le compte ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer le compte « {$compte.id} - {$compte.libelle} » ? </h3> <p class="help"> Attention, le compte ne pourra pas être supprimé si des opérations y sont affectées. </p> </fieldset> <p class="submit"> {csrf_field key="compta_delete_banque_%s"|args:$compte.id} <input type="submit" name="delete" value="Supprimer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/categories/ajouter.tpl from [5928bdf778] to [e6e518fb05].
1 2 3 4 | {include file="admin/_head.tpl" title="Ajouter une catégorie" current="compta/categories"} {if $error} <p class="error"> | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | {include file="admin/_head.tpl" title="Ajouter une catégorie" current="compta/categories"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Ajouter une catégorie</legend> <dl> <dt><label for="f_type">Type</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="type" id="f_type" required="required"> <option value="{$categories::RECETTES}"{if $type == $categories::RECETTES} selected="selected"{/if}>Recette</option> <option value="{$categories::DEPENSES}"{if $type == $categories::DEPENSES} selected="selected"{/if}>Dépense</option> </select> </dd> <dt><label for="f_intitule">Intitulé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="intitule" id="f_intitule" value="{form_field name=intitule}" required="required" /></dd> <dt><label for="f_description">Description</label></dt> <dd><textarea name="description" id="f_description" rows="4" cols="30">{form_field name=description}</textarea></dd> <dt><label for="f_compte">Compte affecté</label> <b title="(Champ obligatoire)">obligatoire</b></dt> |
︙ | ︙ |
Modified src/templates/admin/compta/categories/index.tpl from [6671b532f0] to [9acce7d48b].
1 2 3 4 5 6 7 8 9 10 11 12 | {include file="admin/_head.tpl" title="Catégories" current="compta/categories"} <ul class="actions"> <li{if $type == Garradin\Compta\Categories::RECETTES} class="current"{/if}><a href="?recettes">Recettes</a></li> <li{if $type == Garradin\Compta\Categories::DEPENSES} class="current"{/if}><a href="?depenses">Dépenses</a></li> <li><strong><a href="{$www_url}admin/compta/categories/ajouter.php">Ajouter une catégorie</a></strong></li> <li><em><a href="{$www_url}admin/compta/comptes/">Plan comptable</a></em></li> </ul> {if !empty($liste)} <dl class="catList"> {foreach from=$liste item="cat"} | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | {include file="admin/_head.tpl" title="Catégories" current="compta/categories"} <ul class="actions"> <li{if $type == Garradin\Compta\Categories::RECETTES} class="current"{/if}><a href="?recettes">Recettes</a></li> <li{if $type == Garradin\Compta\Categories::DEPENSES} class="current"{/if}><a href="?depenses">Dépenses</a></li> <li><strong><a href="{$www_url}admin/compta/categories/ajouter.php">Ajouter une catégorie</a></strong></li> <li><em><a href="{$www_url}admin/compta/comptes/">Plan comptable</a></em></li> </ul> {if !empty($liste)} <dl class="catList"> {foreach from=$liste item="cat"} <dt>{$cat.intitule}</dt> {if !empty($cat.description)} <dd class="desc">{$cat.description}</dd> {/if} <dd class="compte"><strong>{$cat.compte}</strong> - {$cat.compte_libelle}</dd> <dd class="actions"> <a class="icn" href="{$www_url}admin/compta/operations/?cat={$cat.id}" title="Lister les opérations de cette catégorie">𝍢</a> <a class="icn" href="{$www_url}admin/compta/categories/modifier.php?id={$cat.id}" title="Modifier">✎</a> <a class="icn" href="{$www_url}admin/compta/categories/supprimer.php?id={$cat.id}" title="Supprimer">✘</a> </dd> {/foreach} </dl> {else} <p class="alert"> Aucune catégorie trouvée. </p> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/categories/modifier.tpl from [e8ccb2e791] to [ab528c1c7f].
1 2 3 4 | {include file="admin/_head.tpl" title="Modifier une catégorie" current="compta/categories"} {if $error} <p class="error"> | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | {include file="admin/_head.tpl" title="Modifier une catégorie" current="compta/categories"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Modifier une catégorie</legend> <dl> <dt><label for="f_intitule">Intitulé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="intitule" id="f_intitule" value="{form_field name=intitule data=$cat}" required="required" /></dd> <dt><label for="f_description">Description</label></dt> <dd><textarea name="description" id="f_description" rows="4" cols="70">{form_field name=description data=$cat}</textarea></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="compta_edit_cat_%s"|args:$cat.id} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/categories/supprimer.tpl from [e76913c57c] to [bd5ca44d0b].
1 2 3 4 | {include file="admin/_head.tpl" title="Supprimer une catégorie" current="compta/categories"} {if $error} <p class="error"> | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | {include file="admin/_head.tpl" title="Supprimer une catégorie" current="compta/categories"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer la catégorie comptable ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer la catégorie « {$cat.intitule} » ? </h3> <p class="help"> Attention, la catégorie ne pourra pas être supprimée si des opérations y sont affectées. </p> </fieldset> |
︙ | ︙ |
Modified src/templates/admin/compta/comptes/ajouter.tpl from [7df65101c5] to [70b4d7b40b].
1 2 3 4 | {include file="admin/_head.tpl" title="Ajouter un compte" current="compta/categories"} {if $error} <p class="error"> | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | {include file="admin/_head.tpl" title="Ajouter un compte" current="compta/categories"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Ajouter un compte</legend> <dl> <dt><label for="f_parent">Compte parent</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> {select_compte comptes=$comptes name="parent" create=true} </dd> <dt><label for="f_numero">Numéro de compte</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" size="10" name="numero" id="f_numero" value="{form_field name=numero}" required="required" /></dd> <dt><label for="f_libelle">Libellé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="libelle" id="f_libelle" value="{form_field name=libelle}" required="required" /></dd> <dt><label for="f_position_1">Position</label> <b title="(Champ obligatoire)">obligatoire</b></dt> {foreach from=$positions item="pos" key="id"} <dd> <input type="radio" name="position" id="f_position_{$id}" value="{$id}" {if $position == $id}checked="checked"{/if} /> <label for="f_position_{$id}">{$pos}</label> </dd> {/foreach} </dl> </fieldset> <p class="submit"> {csrf_field key="compta_ajout_compte"} <input type="submit" name="add" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/comptes/index.tpl from [dab6039c7d] to [43f2dd33d5].
1 2 3 4 | {if empty($classe)} {include file="admin/_head.tpl" title="Comptes" current="compta/categories"} <ul class="accountList"> {foreach from=$classes item="_classe"} | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | {if empty($classe)} {include file="admin/_head.tpl" title="Comptes" current="compta/categories"} <ul class="accountList"> {foreach from=$classes item="_classe"} <li><h4><a href="{$www_url}admin/compta/comptes/?classe={$_classe.id}">{$_classe.libelle}</a></h4></li> {/foreach} </ul> {else} {include file="admin/_head.tpl" title=$classe_compte.libelle current="compta/categories"} <ul class="actions"> <li><a href="{$www_url}admin/compta/comptes/">Liste des classes</a></li> <li><a href="{$www_url}admin/compta/comptes/ajouter.php?classe={$classe}">Ajouter un compte dans cette classe</a></li> </ul> <p class="help"> Les comptes avec la mention <em>*</em> font partie du plan comptable standard et ne peuvent être modifiés ou supprimés. </p> {if !empty($liste)} <table class="list accountList"> {foreach from=$liste item="compte"} <tr class="niveau_{$compte.id|strlen}"> <th>{$compte.id}</th> <td class="libelle">{$compte.libelle}</td> <td> {if !empty($compte.desactive)} <em>Désactivé</em> {else} {$compte.position|get_position} {/if} </td> <td class="actions"> {if empty($compte.desactive)} {if !$compte.plan_comptable} <a class="icn" href="{$www_url}admin/compta/comptes/modifier.php?id={$compte.id}" title="Modifier">✎</a> <a class="icn" href="{$www_url}admin/compta/comptes/supprimer.php?id={$compte.id}" title="Supprimer">✘</a> {else} <em>*</em> {/if} {/if} </td> </tr> {/foreach} |
︙ | ︙ |
Modified src/templates/admin/compta/comptes/journal.tpl from [e28f6159a5] to [8a4a9b424e].
1 | {if isset($tpl.get.suivi)} | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | {if isset($tpl.get.suivi)} {include file="admin/_head.tpl" title="Journal : %s - %s"|args:$compte.id:$compte.libelle current="compta/banques" body_id="rapport"} <ul class="actions"> <li><a href="{$www_url}admin/compta/banques/">Comptes bancaires</a></li> <li><a href="{$www_url}admin/compta/comptes/journal.php?id={$id_caisse}">Journal de caisse</a></li> </ul> {else} {include file="admin/_head.tpl" title="Journal : %s - %s"|args:$compte.id:$compte.libelle current="compta/gestion" body_id="rapport"} {/if} <table class="list"> <colgroup> <col width="3%" /> <col width="3%" /> |
︙ | ︙ | |||
28 29 30 31 32 33 34 | <td>Solde cumulé</td> <th>Libellé</th> </tr> </thead> <tbody> {foreach from=$journal item="ligne"} <tr> | | | | | | | | | 28 29 30 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 | <td>Solde cumulé</td> <th>Libellé</th> </tr> </thead> <tbody> {foreach from=$journal item="ligne"} <tr> <td class="num"><a href="{$admin_url}compta/operations/voir.php?id={$ligne.id}">{$ligne.id}</a></td> <td class="actions"> {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} <a class="icn" href="{$admin_url}compta/operations/modifier.php?id={$ligne.id}" title="Modifier cette opération">✎</a> {/if} </td> <td>{$ligne.date|date_fr:'d/m/Y'}</td> <td>{if $ligne.compte_credit == $compte.id}{$credit}{else}{$debit}{/if}{$ligne.montant|escape|html_money}</td> <td>{$ligne.solde|escape|html_money}</td> <th>{$ligne.libelle}</th> </tr> {/foreach} </tbody> <tfoot> <tr> <td colspan="3"></td> <th>Solde</th> <td colspan="2">{$solde|escape|html_money} {$config.monnaie}</td> </tr> </tfoot> </table> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/comptes/modifier.tpl from [ea88a4cd9f] to [55777f2458].
1 2 3 4 | {include file="admin/_head.tpl" title="Modifier un compte" current="compta/categories"} {if $error} <p class="error"> | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | {include file="admin/_head.tpl" title="Modifier un compte" current="compta/categories"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Modifier un compte</legend> <dl> <dt><label for="f_libelle">Libellé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="libelle" id="f_libelle" value="{form_field name=libelle data=$compte}" required="required" /></dd> <dt><label for="f_position_1">Position</label> <b title="(Champ obligatoire)">obligatoire</b></dt> {foreach from=$positions item="pos" key="id"} <dd> <input type="radio" name="position" id="f_position_{$id}" value="{$id}" {if $position == $id}checked="checked"{/if} /> <label for="f_position_{$id}">{$pos}</label> </dd> {/foreach} </dl> </fieldset> <p class="submit"> {csrf_field key="compta_edit_compte_%s"|args:$compte.id} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/comptes/supprimer.tpl from [d1d14b48d3] to [2f8741c6f4].
1 2 3 4 | {include file="admin/_head.tpl" title="Supprimer un compte" current="compta/categories"} {if $error} <p class="error"> | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | {include file="admin/_head.tpl" title="Supprimer un compte" current="compta/categories"} {if $error} <p class="error"> {$error} </p> {/if} {if !$can_delete && !$can_disable} <p class="alert"> Ce compte ne peut être supprimé ou désactivé. Pour pouvoir supprimer ou désactiver un compte aucune catégorie ou écriture comptable ne doit y faire référence. Pour pouvoir désactiver un compte aucune écriture comptable ne doit y faire référence dans l'exercice en cours. </p> {elseif $can_disable && !$can_delete} <form method="post" action="{$self_url}"> <fieldset> <legend>Désactiver le compte ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir désactiver le compte « {$compte.id} - {$compte.libelle} » ? </h3> <p class="help"> Une fois désactivé il ne sera plus possible de l'utiliser, mais il pourra par contre être réactivé. </p> </fieldset> <p class="submit"> {csrf_field key="compta_disable_compte_%s"|args:$compte.id} <input type="submit" name="disable" value="Désactiver →" /> </p> </form> {else} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer le compte ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer le compte « {$compte.id} - {$compte.libelle} » ? </h3> </fieldset> <p class="submit"> {csrf_field key="compta_delete_compte_%s"|args:$compte.id} <input type="submit" name="delete" value="Supprimer →" /> </p> </form> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/exercices/ajouter.tpl from [3b4a84607e] to [8df71f6c27].
1 2 3 4 | {include file="admin/_head.tpl" title="Commencer un exercice" current="compta/exercices" js=1} {if $error} <p class="error"> | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | {include file="admin/_head.tpl" title="Commencer un exercice" current="compta/exercices" js=1} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Commencer un nouvel exercice</legend> <dl> <dt><label for="f_libelle">Libellé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="libelle" id="f_libelle" value="{form_field name=libelle}" required="required" /></dd> <dt><label for="f_debut">Début de l'exercice</label> <b title="(Champ obligatoire)">obligatoire</b></dt> |
︙ | ︙ |
Modified src/templates/admin/compta/exercices/bilan.tpl from [307b3bb00c] to [059e49c098].
1 2 3 | {include file="admin/_head.tpl" title="Bilan" current="compta/exercices" body_id="rapport"} <div class="exercice"> | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Bilan" current="compta/exercices" body_id="rapport"} <div class="exercice"> <h2>{$config.nom_asso}</h2> <p>Exercice comptable {if $exercice.cloture}clôturé{else}en cours{/if} du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'}, généré le {$cloture|date_fr:'d/m/Y'}</p> </div> <table> <colgroup> <col width="50%" /> <col width="50%" /> </colgroup> <tbody> <tr> <td> <table> <caption><h3>Actif</h3></caption> <tbody> {foreach from=$bilan.actif.comptes key="parent_code" item="parent"} <tr class="parent"> <th>{$parent_code|get_nom_compte}</th> <td>{$parent.solde|escape|html_money}</td> </tr> {foreach from=$parent.comptes item="solde" key="compte"} <tr class="compte"> <th>{$compte|get_nom_compte}</th> <td>{$solde|escape|html_money}</td> </tr> {/foreach} {/foreach} </tbody> </table> </td> <td> <table> <caption><h3>Passif</h3></caption> <tbody> {foreach from=$bilan.passif.comptes key="parent_code" item="parent"} <tr class="parent"> <th>{$parent_code|get_nom_compte}</th> <td>{$parent.solde|escape|html_money}</td> </tr> {foreach from=$parent.comptes item="solde" key="compte"} <tr class="compte"> <th>{$compte|get_nom_compte}</th> <td>{$solde|escape|html_money}</td> </tr> {/foreach} {/foreach} </tbody> </table> </td> </tr> </tbody> <tfoot> <tr> <td> <table> <tfoot> <tr> <th>Total actif</th> <td>{$bilan.actif.total|escape|html_money}</td> </tr> </tfoot> </table> </td> <td> <table> <tfoot> <tr> <th>Total passif</th> <td>{$bilan.passif.total|escape|html_money}</td> </tr> </tfoot> </table> </td> </tr> </tfoot> </table> <p class="help">Toutes les opérations sont libellées en {$config.monnaie}.</p> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/exercices/cloturer.tpl from [a8e685e955] to [f29deb24fb].
1 2 3 4 | {include file="admin/_head.tpl" title="Clôturer un exercice" current="compta/exercices" js=1} {if $error} <p class="error"> | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | {include file="admin/_head.tpl" title="Clôturer un exercice" current="compta/exercices" js=1} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Clôturer un exercice</legend> <h3 class="warning"> Êtes-vous sûr de vouloir clôturer l'exercice « {$exercice.libelle} » ? </h3> <p class="help"> Attention, une fois clôturé, les opérations de cet exercice ne pourront plus être supprimées ou modifiées. </p> <dl> <dt>Début de l'exercice</dt> <dd>{$exercice.debut|date_fr:'d/m/Y'}</dd> <dt><label for="f_fin">Fin de l'exercice</label></dt> <dd class="help">Si des opérations existent après cette date, elles seront automatiquement attribuées à un nouvel exercice.</dd> <dd><input type="date" name="fin" id="f_fin" value="{form_field name=fin default=$exercice.fin|date_fr:'Y-m-d'}" size="10" /></dd> <dt> <input type="checkbox" name="reports" {form_field name=reports default="1" checked=true} id="f_reports" /> <label for="f_reports">Exécuter automatiquement les reports à nouveau</label> </dt> <dd class="help">Les soldes créditeurs et débiteurs de chaque compte seront reportés automatiquement dans le nouvel exercice. Si vous ne cochez pas la case, vous devrez faire les reports à nouveau vous-même.</dd> </h3> </fieldset> <p class="submit"> {csrf_field key="compta_cloturer_exercice_%s"|args:$exercice.id} <input type="submit" name="close" value="Clôturer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/exercices/compte_resultat.tpl from [412aa1442e] to [8ca1ec22c9].
1 2 3 | {include file="admin/_head.tpl" title="Compte de résultat" current="compta/exercices" body_id="rapport"} <div class="exercice"> | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Compte de résultat" current="compta/exercices" body_id="rapport"} <div class="exercice"> <h2>{$config.nom_asso}</h2> <p>Exercice comptable {if $exercice.cloture}clôturé{else}en cours{/if} du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'}, généré le {$cloture|date_fr:'d/m/Y'}</p> </div> <table> <colgroup> <col width="50%" /> <col width="50%" /> </colgroup> <tbody> <tr> <td> <table> <caption><h3>Charges</h3></caption> <tbody> {foreach from=$compte_resultat.charges.comptes key="parent_code" item="parent"} <tr class="parent"> <th>{$parent_code|get_nom_compte}</th> <td>{$parent.solde|escape|html_money}</td> </tr> {foreach from=$parent.comptes item="solde" key="compte"} <tr class="compte"> <th>{$compte|get_nom_compte}</th> <td>{$solde|escape|html_money}</td> </tr> {/foreach} {/foreach} </tbody> </table> </td> <td> <table> <caption><h3>Produits</h3></caption> <tbody> {foreach from=$compte_resultat.produits.comptes key="parent_code" item="parent"} <tr class="parent"> <th>{$parent_code|get_nom_compte}</th> <td>{$parent.solde|escape|html_money}</td> </tr> {foreach from=$parent.comptes item="solde" key="compte"} <tr class="compte"> <th>{$compte|get_nom_compte}</th> <td>{$solde|escape|html_money}</td> </tr> {/foreach} {/foreach} </tbody> </table> </td> </tr> </tbody> <tfoot> <tr> <td> <table> <tfoot> <tr> <th>Total charges</th> <td>{$compte_resultat.charges.total|escape|html_money}</td> </tr> </tfoot> </table> </td> <td> <table> <tfoot> <tr> <th>Total produits</th> <td>{$compte_resultat.produits.total|escape|html_money}</td> </tr> </tfoot> </table> </td> </tr> <tr> <td> {if ($compte_resultat.resultat >= 0)} <table> <tfoot> <tr> <th>Résultat (excédent)</th> <td>{$compte_resultat.resultat|escape|html_money}</td> </tr> </tfoot> </table> {/if} </td> <td> {if ($compte_resultat.resultat < 0)} <table> <tfoot> <tr> <th>Résultat (déficit)</th> <td>{$compte_resultat.resultat|escape|html_money}</td> </tr> </tfoot> </table> {/if} </td> </tr> </tfoot> </table> <p class="help">Toutes les opérations sont libellées en {$config.monnaie}.</p> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/exercices/grand_livre.tpl from [961c7b63da] to [00c01f9217].
1 2 3 | {include file="admin/_head.tpl" title="Grand livre" current="compta/exercices" body_id="rapport"} <div class="exercice"> | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Grand livre" current="compta/exercices" body_id="rapport"} <div class="exercice"> <h2>{$config.nom_asso}</h2> <p>Exercice comptable {if $exercice.cloture}clôturé{else}en cours{/if} du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'}, généré le {$cloture|date_fr:'d/m/Y'}</p> </div> {foreach from=$livre.classes key="classe" item="comptes"} <h3>{$classe|get_nom_compte}</h3> {foreach from=$comptes item="compte" key="code"} {foreach from=$compte.comptes item="souscompte" key="souscode"} <table class="list"> <caption><h4>{$souscode} — {$souscode|get_nom_compte}</h4></caption> <colgroup> <col width="15%" /> <col width="55%" /> <col width="10%" /> <col width="10%" /> <col width="10%" /> </colgroup> <thead> <tr> <td>Date</td> <th>Intitulé</th> <td class="money">Débit</td> <td class="money">Crédit</td> <td class="money">Solde</td> </tr> </thead> <tbody> {foreach from=$souscompte.journal item="ligne"} <tr> <td>{$ligne.date|date_fr:'d/m/Y'}</td> <th>{$ligne.libelle}</th> <td class="money">{if $ligne.compte_debit == $souscode}{$ligne.montant|escape|html_money}{/if}</td> <td class="money">{if $ligne.compte_credit == $souscode}{$ligne.montant|escape|html_money}{/if}</td> <td class="money">{$ligne.solde|escape|html_money}</td> </tr> {/foreach} </tbody> <tfoot> <tr> <td></td> <th>Solde final</th> <td class="money">{if $souscompte.debit > 0}{$souscompte.debit|escape|html_money}{/if}</td> <td class="money">{if $souscompte.credit > 0}{$souscompte.credit|escape|html_money}{/if}</td> <td class="money">{$souscompte.solde|escape|html_money}</td> </tr> </tfoot> </table> {/foreach} <table class="list"> <colgroup> <col width="15%" /> <col width="65%" /> <col width="10%" /> <col width="10%" /> </colgroup> <tfoot> <tr> <td>Total</td> <th>{$code|get_nom_compte}</th> <td>{if $compte.total > 0}{$compte.total|abs|escape|html_money}{/if}</td> <td>{if $compte.total < 0}{$compte.total|abs|escape|html_money}{/if}</td> </tr> </tfoot> </table> {/foreach} {/foreach} <table class="list"> <colgroup> <col width="15%" /> <col width="65%" /> <col width="10%" /> <col width="10%" /> </colgroup> <tfoot> <tr> <td><strong>Total</strong></td> <th></th> <td>{$livre.debit|escape|html_money}</td> <td>{$livre.credit|escape|html_money}</td> </tr> </tfoot> </table> <p class="help">Toutes les opérations sont libellées en {$config.monnaie}.</p> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/exercices/index.tpl from [79d388901c] to [c27adc3262].
1 2 3 4 5 6 7 8 9 10 11 | {include file="admin/_head.tpl" title="Exercices" current="compta/exercices"} {if !$current} <ul class="actions"> <li><strong><a href="{$www_url}admin/compta/exercices/ajouter.php">Commencer un nouvel exercice</a></strong></li> </ul> {/if} {if !empty($liste)} <dl class="catList"> {foreach from=$liste item="exercice"} | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | {include file="admin/_head.tpl" title="Exercices" current="compta/exercices"} {if !$current} <ul class="actions"> <li><strong><a href="{$www_url}admin/compta/exercices/ajouter.php">Commencer un nouvel exercice</a></strong></li> </ul> {/if} {if !empty($liste)} <dl class="catList"> {foreach from=$liste item="exercice"} <dt>{$exercice.libelle}</dt> <dd class="desc"> {if $exercice.cloture}Clôturé{else}En cours{/if} | Du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'} </dd> <dd class="compte"> <strong>{$exercice.nb_operations}</strong> opérations enregistrées. </dd> <dd class="desc"> <a href="{$www_url}admin/compta/exercices/journal.php?id={$exercice.id}">Journal général</a> | <a href="{$www_url}admin/compta/exercices/grand_livre.php?id={$exercice.id}">Grand livre</a> | <a href="{$www_url}admin/compta/exercices/compte_resultat.php?id={$exercice.id}">Compte de résultat</a> | <a href="{$www_url}admin/compta/exercices/bilan.php?id={$exercice.id}">Bilan</a> </dd> {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} <dd class="actions"> {if !$exercice.cloture} <a class="icn" href="{$www_url}admin/compta/exercices/modifier.php?id={$exercice.id}" title="Modifier">✎</a> <a class="icn" href="{$www_url}admin/compta/exercices/supprimer.php?id={$exercice.id}" title="Supprimer">✘</a> <a class="icn" href="{$www_url}admin/compta/exercices/cloturer.php?id={$exercice.id}" title="Clôturer cet exercice">🔒</a> {/if} </dd> {/if} {/foreach} </dl> {else} <p class="alert"> Il n'y a pas d'exercice en cours. </p> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/exercices/journal.tpl from [bcf20608f1] to [5c52f09c4f].
1 2 3 | {include file="admin/_head.tpl" title="Journal général" current="compta/exercices" body_id="rapport"} <div class="exercice"> | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | {include file="admin/_head.tpl" title="Journal général" current="compta/exercices" body_id="rapport"} <div class="exercice"> <h2>{$config.nom_asso}</h2> <p>Exercice comptable {if $exercice.cloture}clôturé{else}en cours{/if} du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'}, généré le {$cloture|date_fr:'d/m/Y'}</p> </div> <table class="list multi"> <thead> <tr> <td>Date</td> <th>Intitulé</th> <td>Comptes</td> <td>Débit</td> <td>Crédit</td> </tr> </thead> <tbody> {foreach from=$journal item="ligne"} <tr> <td rowspan="2">{$ligne.date|date_fr:'d/m/Y'}</td> <th rowspan="2">{$ligne.libelle}</th> <td>{$ligne.compte_debit} - {$ligne.compte_debit|get_nom_compte}</td> <td>{$ligne.montant|escape|html_money}</td> <td></td> </tr> <tr> <td>{$ligne.compte_credit} - {$ligne.compte_credit|get_nom_compte}</td> <td></td> <td>{$ligne.montant|escape|html_money}</td> </tr> {/foreach} </tbody> </table> <p class="help">Toutes les opérations sont libellées en {$config.monnaie}.</p> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/exercices/modifier.tpl from [cf311fbcab] to [8545fe9bda].
1 2 3 4 | {include file="admin/_head.tpl" title="Modifier un exercice" current="compta/exercices" js=1} {if $error} <p class="error"> | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | {include file="admin/_head.tpl" title="Modifier un exercice" current="compta/exercices" js=1} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Modifier un exercice</legend> <dl> <dt><label for="f_libelle">Libellé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="libelle" id="f_libelle" value="{form_field name=libelle data=$exercice}" required="required" /></dd> <dt><label for="f_debut">Début de l'exercice</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="date" name="debut" id="f_debut" value="{form_field name=debut default=$exercice.debut|date_fr:'Y-m-d'}" size="10" required="required" /></dd> <dt><label for="f_fin">Fin de l'exercice</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="date" name="fin" id="f_fin" value="{form_field name=fin default=$exercice.fin|date_fr:'Y-m-d'}" size="10" required="required" /></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="compta_modif_exercice_%s"|args:$exercice.id} <input type="submit" name="edit" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/exercices/supprimer.tpl from [42cf41c810] to [74847df662].
1 2 3 4 | {include file="admin/_head.tpl" title="Supprimer un exercice" current="compta/exercices"} {if $error} <p class="error"> | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | {include file="admin/_head.tpl" title="Supprimer un exercice" current="compta/exercices"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer un exercice</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer l'exercice « {$exercice.libelle} » du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'} ? </h3> <p class="help"> Attention, l'exercice ne pourra pas être supprimé si des opérations y sont toujours affectées. </p> </fieldset> <p class="submit"> {csrf_field key="compta_supprimer_exercice_%s"|args:$exercice.id} <input type="submit" name="delete" value="Supprimer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/import.tpl from [2abf60c60b] to [e027e3b5ff].
1 2 3 4 | {include file="admin/_head.tpl" title="Import / Export" current="compta"} {if $error} <p class="error"> | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | {include file="admin/_head.tpl" title="Import / Export" current="compta"} {if $error} <p class="error"> {$error} </p> {elseif $ok} <p class="confirm"> L'import s'est bien déroulé. </p> {/if} <ul class="actions"> <li class="current"><a href="{$www_url}admin/compta/import.php">Importer</a></li> <li><a href="{$www_url}admin/compta/import.php?export">Exporter en CSV</a></li> </ul> <form method="post" action="{$self_url}" enctype="multipart/form-data"> <fieldset> <legend>Importer depuis un fichier</legend> <dl> <dt><label for="f_file">Fichier à importer</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="file" name="upload" id="f_file" required="required" /></dd> <dt><label for="f_type">Type de fichier</label> <b title="(Champ obligatoire)">obligatoire</b></dt> |
︙ | ︙ |
Modified src/templates/admin/compta/operations/cotisation.tpl from [195ebb5c04] to [74cd7367d1].
1 2 3 | {include file="admin/_head.tpl" title="Écritures liées à une cotisation" current="compta/gestion"} <ul class="actions"> | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | {include file="admin/_head.tpl" title="Écritures liées à une cotisation" current="compta/gestion"} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}"><b>{$membre.identite}</b></a></li> <li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> {if empty($journal)} <p class="alert">Aucune écriture comptable n'est associée à cette cotisation.</p> {else} <table class="list"> <colgroup> |
︙ | ︙ | |||
30 31 32 33 34 35 36 | <td>Compte débité</td> <td>Compte crédité</td> </tr> </thead> <tbody> {foreach from=$journal item="ligne"} <tr> | | | | | | | | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | <td>Compte débité</td> <td>Compte crédité</td> </tr> </thead> <tbody> {foreach from=$journal item="ligne"} <tr> <td><a href="{$admin_url}compta/operations/voir.php?id={$ligne.id}">{$ligne.id}</a></td> <td class="actions"> {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} <a class="icn" href="{$admin_url}compta/operations/modifier.php?id={$ligne.id}" title="Modifier cette opération">✎</a> {/if} </td> <td>{$ligne.date|format_sqlite_date_to_french}</td> <td>{$ligne.montant|escape|html_money}</td> <th>{$ligne.libelle}</th> <td>{$ligne.compte_debit} — {$ligne.compte_debit|get_nom_compte}</td> <td>{$ligne.compte_credit} — {$ligne.compte_credit|get_nom_compte}</td> </tr> {/foreach} </tbody> </table> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/operations/index.tpl from [b230956e89] to [bac1be6593].
︙ | ︙ | |||
13 14 15 16 17 18 19 | {if $type != Garradin\Compta\Categories::AUTRES} <form method="get" action="{$self_url}"> <fieldset> <legend>Filtrer par catégorie</legend> <select name="cat" onchange="if (!this.value) location.href = '?{if $type == Garradin\Compta\Categories::RECETTES}recettes{else}depenses{/if}'; else this.form.submit();"> <option value="">-- Toutes</option> {foreach from=$liste_cats item="cat"} | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | {if $type != Garradin\Compta\Categories::AUTRES} <form method="get" action="{$self_url}"> <fieldset> <legend>Filtrer par catégorie</legend> <select name="cat" onchange="if (!this.value) location.href = '?{if $type == Garradin\Compta\Categories::RECETTES}recettes{else}depenses{/if}'; else this.form.submit();"> <option value="">-- Toutes</option> {foreach from=$liste_cats item="cat"} <option value="{$cat.id}"{if $cat.id == $categorie.id} selected="selected"{/if}>{$cat.intitule}</option> {/foreach} </select> <input type="submit" value="OK" /> </fieldset> </form> {/if} |
︙ | ︙ | |||
35 36 37 38 39 40 41 | {if !$categorie && $type} <col width="20%" /> {/if} </colgroup> <tbody> {foreach from=$journal item="ligne"} <tr> | | | | | | | | | 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 | {if !$categorie && $type} <col width="20%" /> {/if} </colgroup> <tbody> {foreach from=$journal item="ligne"} <tr> <td class="num"><a href="{$admin_url}compta/operations/voir.php?id={$ligne.id}">{$ligne.id}</a></td> <td class="actions"> {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} <a class="icn" href="{$admin_url}compta/operations/modifier.php?id={$ligne.id}" title="Modifier cette opération">✎</a> {/if} </td> <td>{$ligne.date|date_fr:'d/m/Y'}</td> <td>{$ligne.montant|escape|html_money} {$config.monnaie}</td> <th>{$ligne.libelle}</th> {if !$categorie && $type} <td>{$ligne.categorie}</td> {/if} </tr> {foreachelse} <tr> <td colspan="3"></td> <td colspan="2"> Aucune opération. </td> {if !$categorie && $type}<td></td>{/if} </tr> {/foreach} </tbody> <tfoot> <tr> <td></td> <td></td> <th>Total</th> <td>{$total|escape|html_money} {$config.monnaie}</td> <td></td> {if !$categorie && $type}<td></td>{/if} </tr> </tfoot> </table> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/operations/membre.tpl from [ef3e99ced5] to [4d612153a4].
1 2 3 | {include file="admin/_head.tpl" title="Écritures réalisées par le membre" current="compta/gestion"} <ul class="actions"> | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | {include file="admin/_head.tpl" title="Écritures réalisées par le membre" current="compta/gestion"} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}"><b>{$membre.identite}</b></a></li> <li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> <form method="get" action="{$self_url}"> <fieldset> <legend>Exercice à visualiser</legend> <p> <input type="hidden" name="id" value="{$membre.id}" /> <select name="exercice" id="f_exercice" onchange="this.form.submit();"> {foreach from=$exercices item="e"} <option value="{$e.id}" {form_field name="exercice" selected=$e.id default=$exercice}>{$e.libelle} — {if $e.cloture}Clôturé{else}En cours{/if} — Du {$e.debut|date_fr:'d/m/Y'} au {$e.fin|date_fr:'d/m/Y'} </option> {/foreach} </select> </p> <noscript> |
︙ | ︙ | |||
52 53 54 55 56 57 58 | <td>Compte débité</td> <td>Compte crédité</td> </tr> </thead> <tbody> {foreach from=$journal item="ligne"} <tr> | | | | | | | | | 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 | <td>Compte débité</td> <td>Compte crédité</td> </tr> </thead> <tbody> {foreach from=$journal item="ligne"} <tr> <td><a href="{$admin_url}compta/operations/voir.php?id={$ligne.id}">{$ligne.id}</a></td> <td class="actions"> {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} <a class="icn" href="{$admin_url}compta/operations/modifier.php?id={$ligne.id}" title="Modifier cette opération">✎</a> {/if} </td> <td>{$ligne.date|format_sqlite_date_to_french}</td> <td>{$ligne.montant|escape|html_money}</td> <th>{$ligne.libelle}</th> <td>{$ligne.compte_debit} — {$ligne.compte_debit|get_nom_compte}</td> <td>{$ligne.compte_credit} — {$ligne.compte_credit|get_nom_compte}</td> </tr> {/foreach} </tbody> </table> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/operations/modifier.tpl from [b40f382e72] to [f211178bbc].
|
| | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Modification de l'opération n°%d"|args:$operation.id current="compta/saisie" js=1} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Informations sur l'opération</legend> <dl> <dt><label for="f_date">Date</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="date" name="date" id="f_date" value="{form_field name=date default=$operation.date|date_fr:'Y-m-d'}" size="10" required="required" /></dd> <dt><label for="f_libelle">Libellé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="libelle" id="f_libelle" value="{form_field name=libelle data=$operation}" required="required" /></dd> <dt><label for="f_montant">Montant</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="number" size="5" name="montant" id="f_montant" value="{form_field name=montant data=$operation}" min="0.00" step="0.01" required="required" /> {$config.monnaie}</dd> {if is_null($type)} <dt><label for="f_compte_debit">Compte débité</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> {select_compte comptes=$comptes name="compte_debit" data=$operation} </dd> <dt><label for="f_compte_credit">Compte crédité</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> {select_compte comptes=$comptes name="compte_credit" data=$operation} </dd> {else} <dt><label for="f_moyen_paiement">Moyen de paiement</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="moyen_paiement" id="f_moyen_paiement"> {foreach from=$moyens_paiement item="moyen"} <option value="{$moyen.code}"{if $moyen.code == $operation.moyen_paiement} selected="selected"{/if}>{$moyen.nom}</option> {/foreach} </select> </dd> <dt class="f_cheque"><label for="f_numero_cheque">Numéro de chèque</label></dt> <dd class="f_cheque"><input type="text" name="numero_cheque" id="f_numero_cheque" value="{form_field name=numero_cheque data=$operation}" /></dd> <dt class="f_banque"><label for="f_banque">Compte bancaire</label></dt> <dd class="f_banque"> <select name="banque" id="f_banque"> {foreach from=$comptes_bancaires item="compte"} <option value="{$compte.id}"{if ($type == Garradin\Compta\Categories::DEPENSES && $compte.id == $operation.compte_credit) || $compte.id == $operation.compte_debit} selected="selected"{/if}>{$compte.libelle} - {$compte.banque}</option> {/foreach} </select> </dd> {/if} <dt><label for="f_numero_piece">Numéro de pièce comptable</label></dt> <dd><input type="text" name="numero_piece" id="f_numero_piece" value="{form_field name=numero_piece data=$operation}" /></dd> <dt><label for="f_remarques">Remarques</label></dt> <dd><textarea name="remarques" id="f_remarques" rows="4" cols="30">{form_field name=remarques data=$operation}</textarea></dd> </dl> </fieldset> {if !is_null($type)} <fieldset> <legend>Catégorie</legend> <dl class="catList"> {foreach from=$categories item="cat"} <dt> <input type="radio" name="id_categorie" value="{$cat.id}" id="f_cat_{$cat.id}" {form_field name="id_categorie" checked=$cat.id data=$operation} /> <label for="f_cat_{$cat.id}">{$cat.intitule}</label> </dt> {if !empty($cat.description)} <dd class="desc">{$cat.description}</dd> {/if} {/foreach} </dl> </fieldset> <script type="text/javascript"> {literal} |
︙ | ︙ | |||
87 88 89 90 91 92 93 | $('#f_moyen_paiement').onchange = changeMoyenPaiement; } ()); {/literal} </script> {/if} <p class="submit"> | | | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | $('#f_moyen_paiement').onchange = changeMoyenPaiement; } ()); {/literal} </script> {/if} <p class="submit"> {csrf_field key="compta_modifier_%d"|args:$operation.id} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/operations/recherche_sql.tpl from [e691a509bb] to [49875969a9].
1 2 3 4 5 | {include file="admin/_head.tpl" title="Recherche par requête SQL" current="compta"} <form method="get" action="{$admin_url}compta/operations/recherche_sql.php"> <fieldset> <legend>Schéma des tables SQL</legend> | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | {include file="admin/_head.tpl" title="Recherche par requête SQL" current="compta"} <form method="get" action="{$admin_url}compta/operations/recherche_sql.php"> <fieldset> <legend>Schéma des tables SQL</legend> <pre class="sql_schema">{$schema.journal}</pre> <dl> <dt><label for="f_query">Requête SQL</label></dt> <dd class="help">Si aucune limite n'est précisée, une limite de 100 résultats sera appliquée.</dd> <dd><textarea name="query" id="f_query" cols="50" rows="7" required="required">{$query}</textarea></dd> </dl> <p class="submit"> <input type="submit" value="Exécuter →" /> </p> </fieldset> </form> {if !empty($error)} <p class="error"> <strong>Erreur dans la requête SQL :</strong><br /> {$error} </p> {/if} {if !empty($result)} <p class="alert">{$result|@count} résultats renvoyés.</p> <table class="list search"> <thead> {foreach from=$result[0] key="col" item="ignore"} <td>{$col}</td> {/foreach} {if array_key_exists('id', $result[0])} <td></td> {/if} </thead> <tbody> {foreach from=$result item="row"} <tr> {foreach from=$row item="col"} <td>{$col}</td> {/foreach} {if array_key_exists('id', $result[0])} <td class="actions"> {if !empty($row.id)} <a class="icn" href="voir.php?id={$row.id}" title="Fiche opération">❓</a> <a class="icn" href="modifier.php?id={$row.id}" title="Modifier cette opération">✎</a> {/if} </td> {/if} </tr> {/foreach} </tbody> </table> |
︙ | ︙ |
Modified src/templates/admin/compta/operations/saisir.tpl from [055da0f1df] to [f694808ea6].
1 2 3 4 | {include file="admin/_head.tpl" title="Saisie d'une opération" current="compta/saisie" js=1} {if $error} <p class="error"> | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 114 115 116 117 118 | {include file="admin/_head.tpl" title="Saisie d'une opération" current="compta/saisie" js=1} {if $error} <p class="error"> {$error} </p> {/if} {if $ok} <p class="confirm"> L'opération numéro <a href="{$www_url}admin/compta/operations/voir.php?id={$ok}">{$ok}</a> a été ajoutée. (<a href="{$www_url}admin/compta/operations/voir.php?id={$ok}">Voir l'opération</a>) </p> {/if} <ul class="actions"> <li{if $type == Garradin\Compta\Categories::RECETTES} class="current"{/if}><a href="{$www_url}admin/compta/operations/saisir.php?recette">Recette</a></li> <li{if $type == Garradin\Compta\Categories::DEPENSES} class="current"{/if}><a href="{$www_url}admin/compta/operations/saisir.php?depense">Dépense</a></li> <li{if $type === 'virement'} class="current"{/if}><a href="{$www_url}admin/compta/operations/saisir.php?virement">Virement interne</a></li> <li{if $type === 'dette'} class="current"{/if}><a href="{$www_url}admin/compta/operations/saisir.php?dette">Dette</a></li> <li{if is_null($type)} class="current"{/if}><a href="{$www_url}admin/compta/operations/saisir.php?avance">Saisie avancée</a></li> </ul> <form method="post" action="{$self_url}"> <fieldset> <legend>Informations sur l'opération</legend> <dl> <dt><label for="f_date">Date</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="date" name="date" id="f_date" value="{form_field name=date default=$date}" size="10" required="required" /></dd> <dt><label for="f_libelle">Libellé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="libelle" id="f_libelle" value="{form_field name=libelle}" required="required" /></dd> <dt><label for="f_montant">Montant</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="number" size="5" name="montant" id="f_montant" value="{form_field name=montant default=0.00}" min="0.00" step="0.01" required="required" /> {$config.monnaie}</dd> {if is_null($type)} <dt><label for="f_compte_debit">Compte débité</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> {select_compte comptes=$comptes name="compte_debit"} </dd> <dt><label for="f_compte_credit">Compte crédité</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> {select_compte comptes=$comptes name="compte_credit"} </dd> {elseif $type === 'virement'} <dt><label for="f_compte1">Compte débité</label></dt> <dd> <select name="compte1" id="f_compte1"> <option value="{$id_caisse}">Caisse</option> {foreach from=$comptes_bancaires item="compte"} <option value="{$compte.id}"{if $compte.id == $banque} selected="selected"{/if}>{$compte.libelle} - {$compte.banque}</option> {/foreach} </select> </dd> <dt><label for="f_compte2">Compte crédité</label></dt> <dd> <select name="compte2" id="f_compte2"> <option value="{$id_caisse}">Caisse</option> {foreach from=$comptes_bancaires item="compte"} <option value="{$compte.id}"{if $compte.id == $banque} selected="selected"{/if}>{$compte.libelle} - {$compte.banque}</option> {/foreach} </select> </dd> {elseif $type === 'dette'} <dt><label for="f_compte_usager">Type de dette</label></dt> <dd> <input type="radio" name="compte" id="f_compte_usager" value="4110" {form_field name=compte checked=4110 default=4110} /> <label for="f_compte_usager">Dette envers un membre ou usager</label> </dd> <dd> <input type="radio" name="compte" id="f_compte_fournisseur" value="4010" {form_field name=compte checked=4010} /> <label for="f_compte_fournisseur">Dette envers un fournisseur</label> </dd> {else} <dt><label for="f_moyen_paiement">Moyen de paiement</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="moyen_paiement" id="f_moyen_paiement" required="required"> {foreach from=$moyens_paiement item="moyen"} <option value="{$moyen.code}"{if $moyen.code == $moyen_paiement} selected="selected"{/if}>{$moyen.nom}</option> {/foreach} </select> </dd> <dt class="f_cheque"><label for="f_numero_cheque">Numéro de chèque</label></dt> <dd class="f_cheque"><input type="text" name="numero_cheque" id="f_numero_cheque" value="{form_field name=numero_cheque}" /></dd> <dt class="f_banque"><label for="f_banque">Compte bancaire</label></dt> <dd class="f_banque"> <select name="banque" id="f_banque"> {foreach from=$comptes_bancaires item="compte"} <option value="{$compte.id}"{if $compte.id == $banque} selected="selected"{/if}>{$compte.libelle} - {$compte.banque}</option> {/foreach} </select> </dd> {/if} <dt><label for="f_numero_piece">Numéro de pièce comptable</label></dt> <dd><input type="text" name="numero_piece" id="f_numero_piece" value="{form_field name=numero_piece}" /></dd> <dt><label for="f_remarques">Remarques</label></dt> <dd><textarea name="remarques" id="f_remarques" rows="4" cols="30">{form_field name=remarques}</textarea></dd> </dl> </fieldset> {if $type == Garradin\Compta\Categories::DEPENSES || $type == Garradin\Compta\Categories::RECETTES || $type == 'dette'} <fieldset> <legend>Catégorie</legend> <dl class="catList"> {foreach from=$categories item="cat"} <dt> <input type="radio" name="categorie" value="{$cat.id}" id="f_cat_{$cat.id}" {form_field name="categorie" checked=$cat.id} /> <label for="f_cat_{$cat.id}">{$cat.intitule}</label> </dt> {if !empty($cat.description)} <dd class="desc">{$cat.description}</dd> {/if} {/foreach} </dl> </fieldset> <script type="text/javascript"> {literal} |
︙ | ︙ |
Modified src/templates/admin/compta/operations/supprimer.tpl from [3f0e1d456c] to [1bac754e15].
1 2 3 4 | {include file="admin/_head.tpl" title="Supprimer une opération" current="compta/gestion"} {if $error} <p class="error"> | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | {include file="admin/_head.tpl" title="Supprimer une opération" current="compta/gestion"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer cette opération ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer l'opération n°{$operation.id} « {$operation.libelle} » du {$operation.date|date_fr:'d/m/Y'} ? </h3> </fieldset> <p class="submit"> {csrf_field key="compta_supprimer_"|args:$operation.id} <input type="submit" name="delete" value="Supprimer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/compta/operations/voir.tpl from [fee1fc22bd] to [00e31bbfe7].
|
| | | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Opération n°%d"|args:$operation.id current="compta/gestion"} {if $user.droits.compta >= Garradin\Membres::DROIT_ADMIN} <ul class="actions"> <li class="edit"><a href="{$admin_url}compta/operations/modifier.php?id={$operation.id}">Modifier cette opération</a></li> <li class="delete"><a href="{$admin_url}compta/operations/supprimer.php?id={$operation.id}">Supprimer cette opération</a></li> </ul> {/if} <dl class="describe"> <dt>Date</dt> <dd>{$operation.date|date_fr:'l j F Y (d/m/Y)'}</dd> <dt>Libellé</dt> <dd>{$operation.libelle}</dd> <dt>Montant</dt> <dd>{$operation.montant|escape|html_money} {$config.monnaie}</dd> <dt>Numéro pièce comptable</dt> <dd>{if trim($operation.numero_piece)}{$operation.numero_piece}{else}<em>Non renseigné</em>{/if}</dd> {if $operation.id_categorie} <dt>Moyen de paiement</dt> <dd>{if trim($operation.moyen_paiement)}{$moyen_paiement}{else}<em>Non renseigné</em>{/if}</dd> {if $operation.moyen_paiement == 'CH'} <dt>Numéro de chèque</dt> <dd>{if trim($operation.numero_cheque)}{$operation.numero_cheque}{else}<em>Non renseigné</em>{/if}</dd> {/if} {if $operation.moyen_paiement && $operation.moyen_paiement != 'ES'} <dt>Compte bancaire</dt> <dd>{$compte}</dd> {/if} <dt>Catégorie</dt> <dd> <a href="{$admin_url}compta/operations/?{if $categorie.type == Garradin\Compta\Categories::DEPENSES}depenses{else}recettes{/if}">{if $categorie.type == Garradin\Compta\Categories::DEPENSES}Dépense{else}Recette{/if}</a> : <a href="{$admin_url}compta/operations/?cat={$operation.id_categorie}">{$categorie.intitule}</a> </dd> {/if} <dt>Exercice</dt> <dd> <a href="{$admin_url}compta/exercices/">{$exercice.libelle}</a> | Du {$exercice.debut|date_fr:'d/m/Y'} au {$exercice.fin|date_fr:'d/m/Y'} | <strong>{if $exercice.cloture}Clôturé{else}En cours{/if}</strong> </dd> <dt>Opération créée par</dt> <dd> {if $operation.id_auteur} {if $user.droits.membres >= Garradin\Membres::DROIT_ACCES} <a href="{$admin_url}membres/fiche.php?id={$operation.id_auteur}">{$nom_auteur}</a> {else} {$nom_auteur} {/if} {else} <em>membre supprimé</em> {/if} </dd> <dt>Opération liée à</dt> <dd> {if empty($related_members)} Aucun membre n'est lié à cette opération. {else} {foreach from=$related_members item="membre"} <a href="{$admin_url}membres/{if $membre.id_cotisation}cotisations{else}fiche{/if}.php?id={$membre.id_membre}">{if $membre.id_cotisation}Cotisation pour {/if}{$membre.identite}</a> {/foreach} {/if} </dd> <dt>Remarques</dt> <dd>{if trim($operation.remarques)}{$operation.remarques}{else}Non renseigné{/if}</dd> </dl> <table class="list multi"> <thead> <tr> <th colspan="2">Comptes</th> <td>Débit</td> <td>Crédit</td> </tr> </thead> <tbody> <tr> <td><a href="{$admin_url}compta/comptes/journal.php?id={$operation.compte_debit}">{$operation.compte_debit}</a></td> <td>{$nom_compte_debit}</td> <td>{$operation.montant|escape|html_money} {$config.monnaie}</td> <td></td> </tr> <tr> <td><a href="{$admin_url}compta/comptes/journal.php?id={$operation.compte_credit}">{$operation.compte_credit}</a></td> <td>{$nom_compte_credit}</td> <td></td> <td>{$operation.montant|escape|html_money} {$config.monnaie}</td> </tr> </tbody> </table> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/config/donnees.tpl from [048774773b] to [815a847b92].
1 2 3 4 5 | {include file="admin/_head.tpl" title="Données — Sauvegarde et restauration" current="config"} {include file="admin/config/_menu.tpl" current="donnees"} {if $error} | | > > > > > > > > > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | {include file="admin/_head.tpl" title="Données — Sauvegarde et restauration" current="config"} {include file="admin/config/_menu.tpl" current="donnees"} {if $error} <p class="error">{$error}</p> {if $code == Garradin\Sauvegarde::INTEGRITY_FAIL && Garradin\ALLOW_MODIFIED_IMPORT} <p class="alert">Pour passer outre, renvoyez le fichier en cochant la case « Ignorer les erreurs ». Attention, si vous avez effectué des modifications dans la base de données, cela peut créer des bugs !</p> {/if} {elseif $ok} <p class="confirm"> {if $ok == 'config'}La configuration a bien été enregistrée. {elseif $ok == 'create'}Une nouvelle sauvegarde a été créée. {elseif $ok == 'restore'}La restauration a bien été effectuée. Si vous désirez revenir en arrière, vous pouvez utiliser la sauvegarde automatique nommée <em>date-du-jour.avant_restauration.sqlite</em>, sinon vous pouvez l'effacer. {if $ok_code & Garradin\Sauvegarde::NOT_AN_ADMIN} </p> <p class="alert"> <strong>Vous n'êtes pas administrateur dans cette sauvegarde.</strong> Garradin a donné les droits d'administration à toutes les catégories afin d'empêcher de ne plus pouvoir se connecter. Merci de corriger les droits des catégories maintenant. {/if} {elseif $ok == 'remove'}La sauvegarde a été supprimée. {/if} </p> {/if} <form method="post" action="{$self_url}"> <p class="help"> Info : la base de données fait actuellement {$db_size|format_bytes} (dont {$files_size|format_bytes} pour les documents et images). </p> <fieldset> <legend>Sauvegarde automatique</legend> |
︙ | ︙ | |||
55 56 57 58 59 60 61 | <p> {csrf_field key="backup_config"} <input type="submit" name="config" value="Enregistrer →" /> </p> </fieldset> </form> | | | | | | | > > > > > | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | <p> {csrf_field key="backup_config"} <input type="submit" name="config" value="Enregistrer →" /> </p> </fieldset> </form> <form method="post" action="{$self_url}"> <fieldset> <legend>Sauvegarde manuelle</legend> <p> {csrf_field key="backup_create"} <input type="submit" name="create" value="Créer une nouvelle sauvegarde des données →" /> </p> </fieldset> </form> <form method="post" action="{$self_url}"> <fieldset> <legend>Copies de sauvegarde disponibles</legend> {if empty($liste)} <p class="help">Aucune copie de sauvegarde disponible.</p> {else} <dl> <dt><label for="f_select">Sélectionner une sauvegarde</label></dt> <dd> <select name="file" id="f_select"> {foreach from=$liste key="f" item="d"} <option value="{$f}">{$f} — {$d|date_fr:'d/m/Y à H:i'}</option> {/foreach} </select> </dd> <dd class="help"> Attention, en cas de restauration, l'intégralité des données courantes seront effacées et remplacées par celles contenues dans la sauvegarde sélectionnée. Cependant, afin de prévenir toute erreur une sauvegarde des données sera réalisée avant la restauration. </dd> </dl> <p> {csrf_field key="backup_manage"} <input type="submit" name="restore" value="Restaurer cette sauvegarde" /> <input type="submit" name="remove" value="Supprimer cette sauvegarde" /> </p> {/if} </fieldset> </form> <form method="post" action="{$self_url}"> <fieldset> <legend>Téléchargement</legend> <p> {csrf_field key="backup_download"} <input type="submit" name="download" value="Télécharger une copie des données sur mon ordinateur" /> </p> </fieldset> </form> <form method="post" action="{$self_url}" enctype="multipart/form-data"> <fieldset> <legend><label for="f_file">Restaurer depuis un fichier</label></legend> <p class="alert"> Attention, l'intégralité des données courantes seront effacées et remplacées par celles contenues dans le fichier fourni. </p> <p class="help"> Une sauvegarde des données courantes sera effectuée avant le remplacement, en cas de besoin d'annuler cette restauration. </p> <p> {csrf_field key="backup_restore"} <input type="hidden" name="MAX_FILE_SIZE" value="{$max_file_size}" /> <input type="file" name="file" id="f_file" required="required" /> (maximum {$max_file_size|format_bytes}) <input type="submit" name="restore_file" value="Restaurer depuis le fichier sélectionné →" /> </p> {if $error && ($code == Garradin\Sauvegarde::INTEGRITY_FAIL && Garradin\ALLOW_MODIFIED_IMPORT)} <p> <label><input type="checkbox" name="force_import" value="1" /> Ignorer les erreurs, je sais ce que je fait</label> </p> {/if} </fieldset> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/config/index.tpl from [b6d2ccdb6d] to [c6633c21cb].
1 2 3 4 5 6 7 8 9 | {include file="admin/_head.tpl" title="Configuration" current="config"} {if $error} {if $error == 'OK'} <p class="confirm"> La configuration a bien été enregistrée. </p> {else} <p class="error"> | | | | | > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | {include file="admin/_head.tpl" title="Configuration" current="config"} {if $error} {if $error == 'OK'} <p class="confirm"> La configuration a bien été enregistrée. </p> {else} <p class="error"> {$error} </p> {/if} {/if} {include file="admin/config/_menu.tpl" current="index"} <form method="post" action="{$self_url}"> <fieldset> <legend>Garradin</legend> <dl> <dt>Version installée</dt> <dd class="help">{$garradin_version} <a href="{$garradin_website}">[Vérifier la disponibilité d'une nouvelle version]</a></dd> <dt>Informations système</dt> <dd class="help"> Version PHP : {$php_version}<br /> Version SQLite : {$sqlite_version}<br /> Heure du serveur : {$server_time|date_fr} ({if $time_diff > -5 && $time_diff < 5}à l'heure{elseif $time_diff < 0}en retard de {$time_diff} secondes{else}en avance de {$time_diff} secondes{/if})<br /> Chiffrement GnuPG : {if $has_gpg_support}disponible, module activé{else}non, module PHP gnupg non installé ?{/if}<br /> </dd> </dl> </fieldset> <fieldset> <legend>Informations sur l'association</legend> <dl> <dt><label for="f_nom_asso">Nom</label> <b title="(Champ obligatoire)">obligatoire</b></dt> |
︙ | ︙ | |||
45 46 47 48 49 50 51 | <dl> <dt><label for="f_monnaie">Monnaie</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="monnaie" id="f_monnaie" required="required" value="{form_field name=monnaie data=$config}" size="5" /></dd> <dt><label for="f_pays">Pays</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="pays" id="f_pays" required="required"> {foreach from=$pays key="cc" item="nom"} | | | 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | <dl> <dt><label for="f_monnaie">Monnaie</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="monnaie" id="f_monnaie" required="required" value="{form_field name=monnaie data=$config}" size="5" /></dd> <dt><label for="f_pays">Pays</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="pays" id="f_pays" required="required"> {foreach from=$pays key="cc" item="nom"} <option value="{$cc}"{if $cc == $config.pays} selected="selected"{/if}>{$nom}</option> {/foreach} </select> </dd> </dl> </fieldset> <fieldset> |
︙ | ︙ | |||
81 82 83 84 85 86 87 | <fieldset> <legend>Membres</legend> <dl> <dt><label for="f_categorie_membres">Catégorie par défaut des nouveaux membres</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="categorie_membres" required="required" id="f_categorie_membres"> {foreach from=$membres_cats key="id" item="nom"} | | | | | | | 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 | <fieldset> <legend>Membres</legend> <dl> <dt><label for="f_categorie_membres">Catégorie par défaut des nouveaux membres</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="categorie_membres" required="required" id="f_categorie_membres"> {foreach from=$membres_cats key="id" item="nom"} <option value="{$id}"{if $config.categorie_membres == $id} selected="selected"{/if}>{$nom}</option> {/foreach} </select> </dd> <dt><label for="f_champ_identite">Champ utilisé pour définir l'identité des membres</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="help">Ce champ des fiches membres sera utilisé comme identité du membre dans les emails, les fiches, les pages, etc.</dd> <dd> <select name="champ_identite" required="required" id="f_champ_identite"> {foreach from=$champs key="c" item="champ"} <option value="{$c}" {form_field selected=$c name="champ_identite" data=$config}>{$champ.title}</option> {/foreach} </select> </dd> <dt><label for="f_champ_identifiant">Champ utilisé comme identifiant de connexion</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="help">Ce champ des fiches membres sera utilisé en guise d'identifiant pour se connecter à Garradin. Pour cela le champ doit être unique (pas de doublons).</dd> <dd> <select name="champ_identifiant" required="required" id="f_champ_identifiant"> {foreach from=$champs key="c" item="champ"} <option value="{$c}" {form_field selected=$c name="champ_identifiant" data=$config}>{$champ.title}</option> {/foreach} </select> </dd> </dl> </fieldset> |
︙ | ︙ |
Modified src/templates/admin/config/membres.tpl from [71af37bba2] to [fae223707c].
|
| | | > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | {include file="admin/_head.tpl" current="config" js=1} {include file="admin/config/_menu.tpl" current="membres"} {if $error} {if $error == 'OK'} <p class="confirm"> La configuration a bien été enregistrée. </p> {elseif $error == 'ADD_OK'} <p class="confirm"> Le champ a été ajouté à la fin de la liste. </p> {else} <p class="error"> {$error} </p> {/if} {/if} {if $review} <p class="help"> Voici ce à quoi ressemblera la nouvelle fiche de membre, vérifiez vos modifications avant d'enregistrer les changements. </p> <p class="alert"> Attention ! Si vous avez supprimé un champ, les données liées à celui-ci seront supprimées de toutes les fiches de tous les membres. </p> <fieldset> <legend>Fiche membre exemple</legend> <dl> {foreach from=$champs item="champ" key="nom"} {if $nom == 'passe'}{continue}{/if} {html_champ_membre config=$champ name=$nom disabled=true} {if empty($champ.editable) || !empty($champ.private)} |
︙ | ︙ | |||
81 82 83 84 85 86 87 | <dd>Mémorise la date de dernière connexion à l'administration de Garradin.</dd> <dt>Date d'inscription</dt> <dd>Enregistre la date de création de la fiche du membre.</dd> </dl> </fieldset> {if !empty($presets)} | | | | | | | | | | | | | | | | | | | | | | | 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 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | <dd>Mémorise la date de dernière connexion à l'administration de Garradin.</dd> <dt>Date d'inscription</dt> <dd>Enregistre la date de création de la fiche du membre.</dd> </dl> </fieldset> {if !empty($presets)} <form method="post" action="{$self_url}"> <fieldset> <legend>Ajouter un champ pré-défini</legend> <p> <select name="preset" required="required"> <option></option> {foreach from=$presets key="name" item="preset"} <option value="{$name}">{$name} — {$preset.title}</option> {/foreach} </select> <input type="hidden" name="{$csrf_name}" value="{$csrf_value}" /> <input type="submit" name="add" value="Ajouter ce champ à la fiche membre" /> </p> </fieldset> </form> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Ajouter un champ personnalisé</legend> <dl> <dt><label for="f_name">Nom unique</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="help">Ne peut comporter que des lettres minuscules et des tirets bas.</dd> <dd><input type="text" name="new" id="f_name" value="{form_field name=new}" size="30" required="required" /></dd> <dt><label for="f_title">Titre</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="new_title" id="f_title" value="{form_field name=new_title}" size="60" required="required" /></dd> <dt><label for="f_type">Type de champ</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="new_type" id="f_type" required="required"> {foreach from=$types key="type" item="nom"} <option value="{$type}" {form_field name=new_type selected=$type}>{$nom}</option> {/foreach} </select> </dd> </dl> <p> <input type="hidden" name="{$csrf_name}" value="{$csrf_value}" /> <input type="submit" name="add" value="Ajouter ce champ à la fiche membre" /> </p> </fieldset> </form> <form method="post" action="{$self_url}"> <div id="orderFields"> {foreach from=$champs item="champ" key="nom"} {if $nom == 'passe'}{continue}{/if} <fieldset id="f_{$nom}"> <legend>{$nom}</legend> <dl> <dt><label>Type</label></dt> <dd>{$champ.type|get_type}</dd> <dt><label for="f_{$nom}_title">Titre</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="champs[{$nom}][title]" id="f_{$nom}_title" value="{form_field data=$champs->$nom name=title}" size="60" required="required" /></dd> <dt><label for="f_{$nom}_help">Aide</label></dt> <dd><input type="text" name="champs[{$nom}][help]" id="f_{$nom}_help" value="{form_field data=$champs->$nom name=help}" size="100" /></dd> <dt><label><input type="checkbox" name="champs[{$nom}][editable]" value="1" {form_field data=$champs->$nom name=editable checked="1"} /> Modifiable par les membres</label></dt> <dd class="help">Si coché, les membres pourront changer cette information depuis leur espace personnel.</dd> <dt><label><input type="checkbox" name="champs[{$nom}][mandatory]" value="1" {form_field data=$champs->$nom name=mandatory checked="1"} /> Champ obligatoire</label></dt> <dd class="help">Si coché, ce champ ne pourra rester vide.</dd> <dt><label><input type="checkbox" name="champs[{$nom}][private]" value="1" {form_field data=$champs->$nom name=private checked="1"} /> Champ privé</label></dt> <dd class="help">Si coché, ce champ ne sera visible et modifiable que par les personnes pouvant gérer les membres, mais pas les membres eux-même.</dd> {if $champ.type == 'select' || $champ.type == 'multiple'} <dt><label>Options disponibles</label></dt> {if $champ.type == 'multiple'} <dd class="help">Attention changer l'ordre des options peut avoir des effets indésirables.</dd> {else} <dd class="help">Attention renommer ou supprimer une option n'affecte pas ce qui a déjà été enregistré dans les fiches des membres.</dd> {/if} <dd> <{if $champ.type == 'multiple'}ol{else}ul{/if} class="options"> {if !empty($champ.options)} {foreach from=$champ.options key="key" item="opt"} <li><input type="text" name="champs[{$nom}][options][]" value="{$opt}" size="50" /></li> {/foreach} {/if} {if $champ.type == 'select' || empty($champ.options) || count($champ.options) < 32} <li><input type="text" name="champs[{$nom}][options][]" value="" size="50" /></li> {/if} </dd> {/if} <dt><label for="f_{$nom}_list_row">Numéro de colonne dans la liste des membres</label></dt> <dd class="help">Laisser vide ou indiquer le chiffre zéro pour que ce champ n'apparaisse pas dans la liste des membres. Inscrire un chiffre entre 1 et 10 pour indiquer l'ordre d'affichage du champ dans le tableau de la liste des membres.</dd> <dd><input type="number" id="f_{$nom}_list_row" name="champs[{$nom}][list_row]" min="0" max="10" value="{form_field data=$champs->$nom name=list_row}" /></dd> </dl> </fieldset> {/foreach} </div> <fieldset id="f_passe"> <legend>Mot de passe</legend> <dl> <dt><label><input type="checkbox" name="champs[passe][editable]" value="1" {form_field data=$champs.passe name=editable checked="1"} /> Modifiable par les membres</label></dt> <dd class="help">Si coché, les membres pourront changer cette information depuis leur espace personnel.</dd> <dt><label><input type="checkbox" name="champs[passe][mandatory]" value="1" {form_field data=$champs.passe name=mandatory checked="1"} /> Champ obligatoire</label></dt> <dd class="help">Si coché, ce champ ne pourra rester vide.</dd> <dt><label><input type="checkbox" name="champs[passe][private]" value="1" {form_field data=$champs.passe name=private checked="1"} /> Champ privé</label></dt> <dd class="help">Si coché, ce champ ne sera visible et modifiable que par les personnes pouvant gérer les membres, mais pas les membres eux-même.</dd> </dl> </fieldset> <p class="submit"> <input type="hidden" name="{$csrf_name}" value="{$csrf_value}" /> <input type="submit" name="reset" value="Annuler les changements" class="minor" /> <input type="submit" name="review" value="Enregistrer →" /> (un récapitulatif sera présenté et une confirmation sera demandée) </p> </form> <script type="text/javascript"> |
︙ | ︙ | |||
205 206 207 208 209 210 211 | } var fields = document.querySelectorAll('#orderFields fieldset'); for (i = 0; i < fields.length; i++) { var field = fields[i]; | | | < < < < | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | } var fields = document.querySelectorAll('#orderFields fieldset'); for (i = 0; i < fields.length; i++) { var field = fields[i]; field.querySelector('dl').classList.toggle('hidden'); var legend = field.querySelector('legend'); legend.onclick = function () { this.parentNode.querySelector('dl').classList.toggle('hidden'); } legend.className = 'interactive'; legend.title = 'Cliquer pour modifier ce champ'; var actions = document.createElement('div'); actions.className = 'actions'; |
︙ | ︙ | |||
265 266 267 268 269 270 271 | actions.appendChild(down); var edit = document.createElement('a'); edit.className = 'icn edit'; edit.innerHTML = '✎'; edit.title = 'Modifier ce champ'; edit.onclick = function (e) { | | < < < < > > | | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | actions.appendChild(down); var edit = document.createElement('a'); edit.className = 'icn edit'; edit.innerHTML = '✎'; edit.title = 'Modifier ce champ'; edit.onclick = function (e) { this.parentNode.parentNode.querySelector('dl').classList.toggle('hidden'); return false; }; actions.appendChild(edit); if (field.id != champ_identifiant && field.id != 'f_passe' && field.id != champ_identite) { var rem = document.createElement('a'); rem.className = 'icn remove'; rem.innerHTML = '✘'; rem.title = 'Enlever ce champ de la fiche'; rem.onclick = function (e) { if (!window.confirm('Êtes-vous sûr de supprimer ce champ des fiches de membre ?')) { return false; } var field = this.parentNode.parentNode; this.parentNode.parentNode.querySelector('dl').classList.add('hidden'); field.classList.toggle('removed'); window.setTimeout(function () { field.parentNode.removeChild(field); }, 1000); return false; }; actions.appendChild(rem); } if (field.querySelector('.options')) { |
︙ | ︙ |
Modified src/templates/admin/config/plugins.tpl from [4dae78883c] to [1d5abf639f].
1 2 3 4 5 6 | {include file="admin/_head.tpl" title="Extensions" current="config"} {include file="admin/config/_menu.tpl" current="plugins"} {if $error} <p class="error"> | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Extensions" current="config"} {include file="admin/config/_menu.tpl" current="plugins"} {if $error} <p class="error"> {$error} </p> {/if} {if !empty($delete)} <form method="post" action="{$self_url}"> <fieldset> <legend>Désinstaller une extension</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer l'extension « {$plugin.nom} » ? </h3> <p class="alert"> <strong>Attention</strong> : cette action est irréversible et effacera toutes les données associées à l'extension. </p> </fieldset> <p class="submit"> {csrf_field key="delete_plugin_%s"|args:$plugin.id} <input type="submit" name="delete" value="Désinstaller →" /> </p> </form> {else} {if !empty($liste_installes)} <table class="list"> <thead> <tr> <th>Extension</th> <td>Auteur</td> <td>Version installée</td> <td></td> </tr> </thead> <tbody> {foreach from=$liste_installes item="plugin"} <tr> <th> <h4>{$plugin.nom}</h4> <small>{$plugin.description}</small> </th> <td> <a href="{$plugin.url}" onclick="return !window.open(this.href);">{$plugin.auteur}</a> </td> <td> {$plugin.version} </td> <td class="actions"> {if empty($plugin.system)} <a href="{$admin_url}config/plugins.php?delete={$plugin.id}">Désinstaller</a> {/if} {if !empty($plugin.config)} {if empty($plugin.system)}|{/if} <a href="{plugin_url id=$plugin.id file="config.php"}">Configurer</a> {/if} </td> </tr> {/foreach} </tbody> </table> {else} <p class="help"> Aucune extension n'est installée. Vous pouvez consulter <a href="{$garradin_website}">le site de Garradin</a> pour obtenir des extensions à télécharger. </p> {/if} {if !empty($liste_telecharges)} <form method="post" action="{$self_url}"> <fieldset> <legend>Extensions à installer</legend> <dl> {foreach from=$liste_telecharges item="plugin" key="id"} <dt> <label> <input type="radio" name="to_install" value="{$id}" /> {$plugin.nom} </label> (version {$plugin.version}) </dt> <dd>[<a href="{$plugin.url}" onclick="return !window.open(this.href);">{$plugin.auteur}</a>] {$plugin.description}</dd> {/foreach} </dl> </fieldset> <p class="help"> Attention : installer une extension non officielle peut présenter des risques de sécurité et de stabilité. |
︙ | ︙ |
Modified src/templates/admin/config/site.tpl from [75296b729d] to [d24641ae98].
1 2 3 4 | {include file="admin/_head.tpl" title="Configuration — Site public" current="config" js=1} {if $error && $error != 'OK'} <p class="error"> | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Configuration — Site public" current="config" js=1} {if $error && $error != 'OK'} <p class="error"> {$error} </p> {/if} {include file="admin/config/_menu.tpl" current="site"} {if isset($edit)} <form method="post" action="{$self_url}"> <h3>Éditer un squelette</h3> {if $error == 'OK'} <p class="confirm"> Modifications enregistrées. </p> {/if} <fieldset class="skelEdit"> <legend>{$edit.file}</legend> <p> <textarea name="content" cols="90" rows="50" id="f_content">{form_field name=content data=$edit}</textarea> </p> </fieldset> <p class="submit"> {csrf_field key=$csrf_key} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> <script type="text/javascript"> var doc_url = "{$admin_url}doc/skel/"; var skel_list = {$sources|escape:json}; var skel_current = "{$edit.file|escape:'js'}"; </script> <script type="text/javascript" src="{$admin_url}static/scripts/skel_editor.js"></script> {else} <div class="templatesList"> <h3>Squelettes du site</h3> {if $reset_ok} <p class="confirm"> Réinitialisation effectuée. Les squelettes ont été remis à jour </p> {/if} <form method="post" action="{$self_url}"> <table class="list"> <thead> <tr> <td class="check"></td> <th>Fichier</th> <td>Dernière modification</td> <td></td> </tr> </thead> <tbody> {foreach from=$sources key="source" item="local"} <tr> <td>{if $local && $local.dist}<input type="checkbox" name="select[]" value="{$source}" />{/if}</td> <th><a href="{$admin_url}config/site.php?edit={$source|escape:'url'}" title="Éditer">{$source}</a></th> <td>{if $local}{$local.mtime|date_fr:'d/m/Y à H:i:s'}{else}<em>(fichier non modifié)</em>{/if}</td> <td class="actions"> <a class="icn" href="{$admin_url}config/site.php?edit={$source|escape:'url'}" title="Éditer">✎</a> </td> </tr> {/foreach} </tbody> |
︙ | ︙ |
Modified src/templates/admin/index.tpl from [db706138da] to [f2462978fc].
|
| | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | {include file="admin/_head.tpl" title="Bonjour %s !"|args:$user.identite current="home"} <div class="infos_asso"> <h3>{$config.nom_asso}</h3> {if !empty($config.adresse_asso)} <p> {$config.adresse_asso|escape|nl2br} </p> {/if} {if !empty($config.email_asso)} <p> E-Mail : <a href="{$config.email_asso}">{$config.email_asso}</a> </p> {/if} {if !empty($config.site_asso)} <p> Web : <a href="{$config.site_asso}">{$config.site_asso}</a> </p> {/if} </div> <ul class="actions"> <li><a href="{$admin_url}mes_infos.php">Modifier mes informations personnelles</a></li> {if $cotisation} |
︙ | ︙ | |||
33 34 35 36 37 38 39 | {/if} </li> {/if} <li><a href="{$admin_url}mes_cotisations.php">Suivi de mes cotisations</a></li> </ul> <div class="wikiContent"> | | | 33 34 35 36 37 38 39 40 41 42 43 | {/if} </li> {/if} <li><a href="{$admin_url}mes_cotisations.php">Suivi de mes cotisations</a></li> </ul> <div class="wikiContent"> {$page.contenu.contenu|raw|format_wiki|liens_wiki:'wiki/?'} </div> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/install.tpl from [bcbb04bbbb] to [fa74b55a08].
1 2 3 4 5 6 7 8 9 10 11 12 | {include file="admin/_head.tpl" title="Garradin - Installation" js=1} {if $disabled} <p class="error">Garradin est déjà installé.</p> {else} <p class="intro"> Bienvenue dans Garradin ! Veuillez remplir les quelques informations suivantes pour terminer l'installation. </p> {if !empty($error)} | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | {include file="admin/_head.tpl" title="Garradin - Installation" js=1} {if $disabled} <p class="error">Garradin est déjà installé.</p> {else} <p class="intro"> Bienvenue dans Garradin ! Veuillez remplir les quelques informations suivantes pour terminer l'installation. </p> {if !empty($error)} <p class="error">{$error}</p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Informations sur l'association</legend> <dl> <dt><label for="f_nom_asso">Nom</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="nom_asso" id="f_nom_asso" required="required" value="{form_field name=nom_asso}" /></dd> <dt><label for="f_email_asso">Adresse E-Mail</label> <b title="(Champ obligatoire)">obligatoire</b></dt> |
︙ | ︙ | |||
40 41 42 43 44 45 46 | <dt><label for="f_passe_membre">Mot de passe</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="help"> Astuce : un mot de passe de quatre mots choisis au hasard dans le dictionnaire est plus sûr et plus simple à retenir qu'un mot de passe composé de 10 lettres et chiffres. </dd> <dd class="help"> Pas d'idée ? Voici une suggestion choisie au hasard : | | | | 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 | <dt><label for="f_passe_membre">Mot de passe</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="help"> Astuce : un mot de passe de quatre mots choisis au hasard dans le dictionnaire est plus sûr et plus simple à retenir qu'un mot de passe composé de 10 lettres et chiffres. </dd> <dd class="help"> Pas d'idée ? Voici une suggestion choisie au hasard : <input type="text" readonly="readonly" title="Cliquer pour utiliser cette suggestion comme mot de passe" id="pw_suggest" value="{$passphrase}" autocomplete="off" /> </dd> <dd><input type="password" name="passe_membre" id="f_passe_membre" value="{form_field name=passe_membre}" pattern=".{ldelim}5,{rdelim}" required="required" /></dd> <dt><label for="f_repasse_membre">Encore le mot de passe</label> (vérification) <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="password" name="repasse_membre" id="f_repasse_membre" value="{form_field name=repasse_membre}" pattern=".{ldelim}5,{rdelim}" required="required" /></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="install"} <input type="submit" id="f_submit" name="save" value="Terminer l'installation →" /> </p> <script type="text/javascript" src="{$admin_url}static/scripts/loader.js"></script> <script type="text/javascript"> {literal} g.script('scripts/password.js').onload = function () { initPasswordField('pw_suggest', 'f_passe_membre', 'f_repasse_membre'); }; var form = $('form')[0]; form.onsubmit = function () { $('#f_submit').style.opacity = 0; var loader = document.createElement('div'); loader.className = 'loader install'; |
︙ | ︙ |
Modified src/templates/admin/login.tpl from [39462f4c53] to [73997fd1e9].
︙ | ︙ | |||
14 15 16 17 18 19 20 | <p class="alert"> <strong>Message de sécurité</strong><br /> Nous vous conseillons de vous connecter sur la version <a href="{$own_https_url}">chiffrée (HTTPS) de cette page</a> pour vous connecter. </p> {/if} | | | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <p class="alert"> <strong>Message de sécurité</strong><br /> Nous vous conseillons de vous connecter sur la version <a href="{$own_https_url}">chiffrée (HTTPS) de cette page</a> pour vous connecter. </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Connexion</legend> <dl> <dt><label for="f_id">{$champ.title}</label></dt> <dd><input type="text" name="id" id="f_id" value="{form_field name=id}" /></dd> <dt><label for="f_passe">Mot de passe</label></dt> |
︙ | ︙ | |||
36 37 38 39 40 41 42 43 44 45 46 47 48 49 | <span class="error">Connexion non-sécurisée !</span> <a href="{$own_https_url}">Se connecter en HTTPS (sécurisé)</a> {else} <span class="alert">Connexion non-sécurisée</span> {/if} {/if} </dd> </dl> </fieldset> <p class="submit"> {csrf_field key="login"} <input type="submit" name="login" value="Se connecter →" /> </p> | > | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | <span class="error">Connexion non-sécurisée !</span> <a href="{$own_https_url}">Se connecter en HTTPS (sécurisé)</a> {else} <span class="alert">Connexion non-sécurisée</span> {/if} {/if} </dd> <dd><label><input type="checkbox" name="permanent" value="1" /> Rester connecté‑e</label></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="login"} <input type="submit" name="login" value="Se connecter →" /> </p> |
︙ | ︙ |
Added src/templates/admin/login_otp.tpl version [5a44d9c852].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | {include file="admin/_head.tpl" title="Connexion — double facteur"} {if $error} <p class="error"> {if $error == 'OTHER'} Une erreur est survenue, merci de réessayer. {else} Code incorrect. L'heure du serveur est {$time|date_fr:"d/m/Y H:i:s"}. Vérifiez que votre téléphone est à l'heure. {/if} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Authentification à double facteur</legend> <dl> <dt><label for="f_code">Code TOTP</label></dt> <dd class="help">Entrez ici le code donné par l'application d'authentification double facteur.</dd> <dd><input type="text" name="code" id="f_code" value="{form_field name=code}" /></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="otp"} <input type="submit" name="login" value="Se connecter →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/action.tpl from [8ecbc52c90] to [6f7340ac70].
1 2 3 4 | {include file="admin/_head.tpl" title="Action collective sur les membres" current="membres"} {if $error} <p class="error"> | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | {include file="admin/_head.tpl" title="Action collective sur les membres" current="membres"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> {foreach from=$selected item="id"} <input type="hidden" name="selected[]" value="{$id}" /> {/foreach} </fieldset> {if $action == 'move'} <fieldset> <legend>Changer la catégorie des {$nb_selected} membres sélectionnés</legend> <dl> <dt><label for="f_cat">Nouvelle catégorie</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="id_categorie" id="f_cat"> <option value="0" selected="selected">-- Pas de changement</option> {foreach from=$membres_cats key="id" item="nom"} <option value="{$id}">{$nom}</option> {/foreach} </select> </dd> </dl> </fieldset> <p class="submit"> {csrf_field key="membres_action"} <input type="submit" name="move_ok" value="Enregistrer →" /> </p> {elseif $action == 'delete'} <fieldset> <legend>Supprimer les membres sélectionnés ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer les {$nb_selected} membres sélectionnés ? </h3> <p class="alert"> <strong>Attention</strong> : cette action est irréversible et effacera toutes les données personnelles et l'historique de ces membres. </p> <p class="help"> Alternativement, il est aussi possible de déplacer les membres qui ne font plus |
︙ | ︙ |
Modified src/templates/admin/membres/ajouter.tpl from [ad97821ae3] to [f16619648e].
1 2 3 4 | {include file="admin/_head.tpl" title="Ajouter un membre" current="membres/ajouter" js=1} {if $error} <p class="error"> | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Ajouter un membre" current="membres/ajouter" js=1} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Informations personnelles</legend> <dl> {foreach from=$champs item="champ" key="nom"} {html_champ_membre config=$champ name=$nom} {/foreach} </dl> </fieldset> <fieldset> <legend>Connexion</legend> <dl> <dt><label for="f_passe">Mot de passe</label>{if $champs.passe.mandatory} <b title="(Champ obligatoire)">obligatoire</b>{/if}</dt> <dd class="help"> Astuce : un mot de passe de quatre mots choisis au hasard dans le dictionnaire est plus sûr et plus simple à retenir qu'un mot de passe composé de 10 lettres et chiffres. </dd> <dd class="help"> Pas d'idée ? Voici une suggestion choisie au hasard : <input type="text" readonly="readonly" title="Cliquer pour utiliser cette suggestion comme mot de passe" id="pw_suggest" value="{$passphrase}" autocomplete="off" /> </dd> <dd><input type="password" name="passe" id="f_passe" value="{form_field name=passe}" pattern=".{ldelim}5,{rdelim}" /></dd> <dt><label for="f_repasse">Encore le mot de passe</label> (vérification)</dt> <dd><input type="password" name="repasse" id="f_repasse" value="{form_field name=repasse}" pattern=".{ldelim}5,{rdelim}" /></dd> </dl> </fieldset> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN} <fieldset> <legend>Général</legend> <dl> <dt><label for="f_cat">Catégorie du membre</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="id_categorie" id="f_cat"> {foreach from=$membres_cats key="id" item="nom"} <option value="{$id}"{if $current_cat == $id} selected="selected"{/if}>{$nom}</option> {/foreach} </select> </dd> </dl> </fieldset> {/if} <p class="submit"> {csrf_field key="new_member"} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> <script type="text/javascript"> {literal} g.script('scripts/password.js').onload = function () { initPasswordField('pw_suggest', 'f_passe', 'f_repasse'); }; {/literal} </script> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/cat_modifier.tpl from [2fe1d52da3] to [178c923010].
1 2 3 4 | {include file="admin/_head.tpl" title="Modifier une catégorie" current="membres/categories"} {if $error} <p class="error"> | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | {include file="admin/_head.tpl" title="Modifier une catégorie" current="membres/categories"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Informations générales</legend> <dl> <dt><label for="f_nom">Nom</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="nom" id="f_nom" value="{form_field data=$cat name=nom}" required="required" /></dd> <dt><label for="f_description">Description</label></dt> |
︙ | ︙ | |||
30 31 32 33 34 35 36 | <legend>Cotisation obligatoire</legend> <dl> <dt><label for="f_id_cotisation_obligatoire">Cotisation obligatoire</label></dt> <dd> <select name="id_cotisation_obligatoire" id="f_id_cotisation_obligatoire"> <option value="">-- Non</option> {foreach from=$cotisations item="cotisation"} | | | | | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <legend>Cotisation obligatoire</legend> <dl> <dt><label for="f_id_cotisation_obligatoire">Cotisation obligatoire</label></dt> <dd> <select name="id_cotisation_obligatoire" id="f_id_cotisation_obligatoire"> <option value="">-- Non</option> {foreach from=$cotisations item="cotisation"} <option value="{$cotisation.id}" {form_field name="id_cotisation_obligatoire" selected=$cotisation.id data=$cat}> {$cotisation.intitule} — {$cotisation.montant|escape|html_money} {$config.monnaie} — {if $cotisation.duree}pour {$cotisation.duree} jours {elseif $cotisation.debut} du {$cotisation.debut|format_sqlite_date_to_french} au {$cotisation.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} </option> {/foreach} |
︙ | ︙ | |||
56 57 58 59 60 61 62 | <dt><label for="f_droit_connexion_aucun">Les membres de cette catégorie peuvent-ils se connecter ?</label></dt> {if $readonly} <dd class="help"> Il n'est pas possible de désactiver ce droit pour votre propre catégorie. </dd> {/if} <dd> | | | | | | | | | | | | | | | | | | | | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | <dt><label for="f_droit_connexion_aucun">Les membres de cette catégorie peuvent-ils se connecter ?</label></dt> {if $readonly} <dd class="help"> Il n'est pas possible de désactiver ce droit pour votre propre catégorie. </dd> {/if} <dd> <input type="radio" name="droit_connexion" value="{$membres::DROIT_AUCUN}" id="f_droit_connexion_aucun" {if $cat.droit_connexion == $membres::DROIT_AUCUN}checked="checked"{/if} {$readonly} /> <label for="f_droit_connexion_aucun"><b class="aucun">C</b> Non</label> </dd> <dd> <input type="radio" name="droit_connexion" value="{$membres::DROIT_ACCES}" id="f_droit_connexion_acces" {if $cat.droit_connexion == $membres::DROIT_ACCES}checked="checked"{/if} {$readonly} /> <label for="f_droit_connexion_acces"><b class="acces">C</b> Oui</label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_inscription_aucun">Les membres de cette catégorie peuvent-ils s'inscrire d'eux-même ?</label></dt> <dd> <input type="radio" name="droit_inscription" value="{$membres::DROIT_AUCUN}" id="f_droit_inscription_aucun" {if $cat.droit_inscription == $membres::DROIT_AUCUN}checked="checked"{/if} /> <label for="f_droit_inscription_aucun"><b class="aucun">I</b> Non</label> </dd> <dd> <input type="radio" name="droit_inscription" value="{$membres::DROIT_ACCES}" id="f_droit_inscription_acces" {if $cat.droit_inscription == $membres::DROIT_ACCES}checked="checked"{/if} /> <label for="f_droit_inscription_acces"><b class="acces">I</b> Oui</label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_membres_aucun">Gestion des membres :</label></dt> {if $readonly} <dd class="help"> Il n'est pas possible de désactiver ce droit pour votre propre catégorie. </dd> {/if} <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_AUCUN}" id="f_droit_membres_aucun" {if $cat.droit_membres == $membres::DROIT_AUCUN}checked="checked"{/if} {$readonly} /> <label for="f_droit_membres_aucun"><b class="aucun">M</b> Pas d'accès</label> </dd> <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_ACCES}" id="f_droit_membres_acces" {if $cat.droit_membres == $membres::DROIT_ACCES}checked="checked"{/if} {$readonly} /> <label for="f_droit_membres_acces"><b class="acces">M</b> Lecture uniquement</label> </dd> <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_ECRITURE}" id="f_droit_membres_ecriture" {if $cat.droit_membres == $membres::DROIT_ECRITURE}checked="checked"{/if} {$readonly} /> <label for="f_droit_membres_ecriture"><b class="ecriture">M</b> Lecture & écriture</label> </dd> <dd> <input type="radio" name="droit_membres" value="{$membres::DROIT_ADMIN}" id="f_droit_membres_admin" {if $cat.droit_membres == $membres::DROIT_ADMIN}checked="checked"{/if} {$readonly} /> <label for="f_droit_membres_admin"><b class="admin">M</b> Administration</label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_compta_aucun">Comptabilité :</label></dt> <dd> <input type="radio" name="droit_compta" value="{$membres::DROIT_AUCUN}" id="f_droit_compta_aucun" {if $cat.droit_compta == $membres::DROIT_AUCUN}checked="checked"{/if} /> <label for="f_droit_compta_aucun"><b class="aucun">€</b> Pas d'accès</label> </dd> <dd> <input type="radio" name="droit_compta" value="{$membres::DROIT_ACCES}" id="f_droit_compta_acces" {if $cat.droit_compta == $membres::DROIT_ACCES}checked="checked"{/if} /> <label for="f_droit_compta_acces"><b class="acces">€</b> Lecture uniquement</label> </dd> <dd> <input type="radio" name="droit_compta" value="{$membres::DROIT_ECRITURE}" id="f_droit_compta_ecriture" {if $cat.droit_compta == $membres::DROIT_ECRITURE}checked="checked"{/if} /> <label for="f_droit_compta_ecriture"><b class="ecriture">€</b> Lecture & écriture</label> </dd> <dd> <input type="radio" name="droit_compta" value="{$membres::DROIT_ADMIN}" id="f_droit_compta_admin" {if $cat.droit_compta == $membres::DROIT_ADMIN}checked="checked"{/if} /> <label for="f_droit_compta_admin"><b class="admin">€</b> Administration</label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_wiki_aucun">Wiki :</label></dt> <dd> <input type="radio" name="droit_wiki" value="{$membres::DROIT_AUCUN}" id="f_droit_wiki_aucun" {if $cat.droit_wiki == $membres::DROIT_AUCUN}checked="checked"{/if} /> <label for="f_droit_wiki_aucun"><b class="aucun">W</b> Pas d'accès</label> </dd> <dd> <input type="radio" name="droit_wiki" value="{$membres::DROIT_ACCES}" id="f_droit_wiki_acces" {if $cat.droit_wiki == $membres::DROIT_ACCES}checked="checked"{/if} /> <label for="f_droit_wiki_acces"><b class="acces">W</b> Lecture uniquement</label> </dd> <dd> <input type="radio" name="droit_wiki" value="{$membres::DROIT_ECRITURE}" id="f_droit_wiki_ecriture" {if $cat.droit_wiki == $membres::DROIT_ECRITURE}checked="checked"{/if} /> <label for="f_droit_wiki_ecriture"><b class="ecriture">W</b> Lecture & écriture</label> </dd> <dd> <input type="radio" name="droit_wiki" value="{$membres::DROIT_ADMIN}" id="f_droit_wiki_admin" {if $cat.droit_wiki == $membres::DROIT_ADMIN}checked="checked"{/if} /> <label for="f_droit_wiki_admin"><b class="admin">W</b> Administration</label> </dd> </dl> <dl class="droits"> <dt><label for="f_droit_config_aucun">Les membres de cette catégorie peuvent-ils modifier la configuration ?</label></dt> {if $readonly} <dd class="help"> Il n'est pas possible de désactiver ce droit pour votre propre catégorie. </dd> {/if} <dd> <input type="radio" name="droit_config" value="{$membres::DROIT_AUCUN}" id="f_droit_config_aucun" {if $cat.droit_config == $membres::DROIT_AUCUN}checked="checked"{/if} {$readonly} /> <label for="f_droit_config_aucun"><b class="aucun">☑</b> Non</label> </dd> <dd> <input type="radio" name="droit_config" value="{$membres::DROIT_ADMIN}" id="f_droit_config_admin" {if $cat.droit_config == $membres::DROIT_ADMIN}checked="checked"{/if} {$readonly} /> <label for="f_droit_config_admin"><b class="admin">☑</b> Oui</label> </dd> </dl> </fieldset> <p class="submit"> {csrf_field key="edit_cat_"|cat:$cat.id} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/cat_supprimer.tpl from [eb83b503e1] to [99229c44b3].
1 2 3 4 | {include file="admin/_head.tpl" title="Supprimer une catégorie" current="membres/categories"} {if $error} <p class="error"> | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | {include file="admin/_head.tpl" title="Supprimer une catégorie" current="membres/categories"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer la catégorie de membres ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer la catégorie « {$cat.nom} » ? </h3> <p class="help"> Attention, la catégorie ne doit plus contenir de membres pour pouvoir être supprimée. </p> <p class="help"> Notez que si des pages du wiki étaient restreintes à la lecture ou à l'écriture |
︙ | ︙ |
Modified src/templates/admin/membres/categories.tpl from [f9ee8a7a8a] to [f5797e2254].
1 2 3 4 5 6 7 8 9 10 11 12 | {include file="admin/_head.tpl" title="Catégories de membres" current="membres/categories"} <table class="list"> <thead> <th>Nom</th> <td>Membres</td> <td>Droits</td> <td></td> </thead> <tbody> {foreach from=$liste item="cat"} <tr> | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | {include file="admin/_head.tpl" title="Catégories de membres" current="membres/categories"} <table class="list"> <thead> <th>Nom</th> <td>Membres</td> <td>Droits</td> <td></td> </thead> <tbody> {foreach from=$liste item="cat"} <tr> <th>{$cat.nom}</th> <td class="num">{$cat.nombre}</td> <td class="droits"> {format_droits droits=$cat} </td> <td class="actions"> <a class="icn" href="cat_modifier.php?id={$cat.id}" title="Modifier">✎</a> {if $cat.id != $user.id_categorie} <a class="icn" href="cat_supprimer.php?id={$cat.id}" title="Supprimer">✘</a> {/if} </td> </tr> {/foreach} </tbody> </table> {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Ajouter une catégorie</legend> <dl> <dt><label for="f_nom">Nom</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="nom" id="f_nom" value="{form_field name=nom}" required="required" /></dd> </dl> |
︙ | ︙ |
Modified src/templates/admin/membres/cotisations.tpl from [b31f937787] to [a3897bbe71].
1 2 3 | {include file="admin/_head.tpl" title="Cotisations du membre" current="membres/cotisations"} <ul class="actions"> | | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Cotisations du membre" current="membres/cotisations"} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}"><b>{$membre.identite}</b></a></li> <li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN && $user.id != $membre.id} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li class="current"><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> <dl class="cotisation"> {if $cotisation} <dt>Cotisation obligatoire</dt> <dd>{$cotisation.intitule} — {if $cotisation.duree} {$cotisation.duree} jours {elseif $cotisation.debut} du {$cotisation.debut|format_sqlite_date_to_french} au {$cotisation.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} — {$cotisation.montant|escape|html_money} {$config.monnaie} </dd> <dt>À jour de cotisation ?</dt> <dd> {if !$cotisation.a_jour} <span class="error"><b>Non</b>, cotisation non payée</span> {else} <b class="confirm">✓ Oui</b> {if $cotisation.expiration} (expire le {$cotisation.expiration|format_sqlite_date_to_french}) {/if} {/if} </dd> {/if} <dt> {if $nb_activites == 1} {$nb_activites} cotisation enregistrée {elseif $nb_activites} {$nb_activites} cotisations enregistrées {else} Aucune cotisation enregistrée {/if} </dt> {if !empty($cotisations_membre)} {foreach from=$cotisations_membre item="co"} <dd>{$co.intitule} — {if $co.a_jour} <span class="confirm">À jour</span>{if $co.expiration} — Expire le {$co.expiration|format_sqlite_date_to_french}{/if} {else} <span class="error">En retard</span> — <a href="{$admin_url}membres/cotisations/rappels.php?id={$membre.id}">Suivi des rappels</a> {/if} </dd> {/foreach} {/if} <dt><form method="get" action="{$admin_url}membres/cotisations/ajout.php"><input type="submit" value="Enregistrer une cotisation →" /><input type="hidden" name="id" value="{$membre.id}" /></form></dt> </dl> {if !empty($cotisations)} <table class="list"> <thead> <th>Date</th> <td>Cotisation</td> <td></td> <td class="actions"></td> </thead> <tbody> {foreach from=$cotisations item="c"} <tr> <td>{$c.date|format_sqlite_date_to_french}</td> <td> {$c.intitule} — {if $c.duree} {$c.duree} jours {elseif $c.debut} du {$c.debut|format_sqlite_date_to_french} au {$c.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} — {$c.montant|escape|html_money} {$config.monnaie} </td> <td> {if $user.droits.compta >= Garradin\Membres::DROIT_ECRITURE && !empty($c.nb_operations)} <a href="{$admin_url}compta/operations/cotisation.php?id={$c.id}">{$c.nb_operations} écriture{if $c.nb_operations > 1}s{/if}</a> {/if} </td> <td class="actions"> <a class="icn" href="{$admin_url}membres/cotisations/voir.php?id={$c.id_cotisation}" title="Liste des membres inscrits à cette cotisation">👪</a> <a class="icn" href="{$admin_url}membres/cotisations/supprimer.php?id={$c.id}" title="Supprimer cette cotisation pour ce membre">✘</a> </td> </tr> {/foreach} </tbody> </table> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/cotisations/ajout.tpl from [f0b352697d] to [d467fbaa1a].
1 2 3 4 | {if $membre} {include file="admin/_head.tpl" title="Enregistrer une cotisation pour le membre" current="membres/cotisations" js=1} <ul class="actions"> | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {if $membre} {include file="admin/_head.tpl" title="Enregistrer une cotisation pour le membre" current="membres/cotisations" js=1} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}"><b>{$membre.identite}</b></a></li> <li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN && $user.id != $membre.id} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> {else} {include file="admin/_head.tpl" title="Enregistrer une cotisation" current="membres/cotisations" js=1} <ul class="actions"> <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li class="current"><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> {/if} </ul> {/if} {if $error} <p class="error">{$error}</p> {else if $user.droits.compta >= Garradin\Membres::DROIT_ECRITURE} <p class="help"> Cette page sert à enregistrer les cotisations des membres de l'association. Pour enregistrer un don ou une dépense, comme le paiement d'un prestataire ou une facture, il est possible de <a href="{$admin_url}compta/operations/saisir.php">saisir une opération comptable</a>. </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Enregistrer une cotisation</legend> <dl> <dt><label for="f_id_cotisation">Cotisation</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select id="f_id_cotisation" required="required" name="id_cotisation"> {foreach from=$cotisations item="co"} <option value="{$co.id}" {form_field name="id_cotisation" selected=$co.id default=$default_co} data-compta="{$co.id_categorie_compta}" data-amount="{$co.montant}"> {$co.intitule} — {$co.montant|escape|html_money} {$config.monnaie} — {if $co.duree}pour {$co.duree} jours {elseif $co.debut} du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} </option> {/foreach} </select> </dd> <dt class="f_compta"><label for="f_montant">Montant</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="f_compta"><input type="number" name="montant" step="0.01" min="0.00" id="f_montant" value="{form_field name=montant default=$default_amount}" /></dd> <dt class="f_compta"><label for="f_moyen_paiement">Moyen de paiement</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="f_compta"> <select name="moyen_paiement" id="f_moyen_paiement"> {foreach from=$moyens_paiement item="moyen"} <option value="{$moyen.code}"{if $moyen.code == $moyen_paiement} selected="selected"{/if}>{$moyen.nom}</option> {/foreach} </select> </dd> <dt class="f_cheque"><label for="f_numero_cheque">Numéro de chèque</label></dt> <dd class="f_cheque"><input type="text" name="numero_cheque" id="f_numero_cheque" value="{form_field name=numero_cheque}" /></dd> <dt class="f_banque"><label for="f_banque">Compte bancaire</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="f_banque"> <select name="banque" id="f_banque"> {foreach from=$comptes_bancaires item="compte"} <option value="{$compte.id}"{if $compte.id == $banque} selected="selected"{/if}>{$compte.libelle} - {$compte.banque}</option> {/foreach} </select> </dd> <dt><label for="f_date">Date</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="date" name="date" id="f_date" value="{form_field name=date default=$default_date}" required="required" /></dd> {if !$membre} <dt><label for="f_id_membre">Numéro de membre</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="number" name="id_membre" id="f_id_membre" value="{form_field name=id_membre}" step="1" min="1" required="required" /></dd> {/if} </dl> </fieldset> <p class="submit"> {csrf_field key="add_cotisation"} {if $membre}<input type="hidden" name="id_membre" value="{$membre.id}" />{/if} <input type="submit" name="add" value="Enregistrer →" /> </p> </form> <script type="text/javascript"> {literal} (function () { |
︙ | ︙ |
Modified src/templates/admin/membres/cotisations/gestion/modifier.tpl from [3c63d754bb] to [43e7213c19].
1 2 3 4 5 6 7 8 9 10 11 12 | {include file="admin/_head.tpl" title="Modifier une cotisation" current="membres/cotisations" js=1} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> {/if} </ul> {if $error} <p class="error"> | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | {include file="admin/_head.tpl" title="Modifier une cotisation" current="membres/cotisations" js=1} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> {/if} </ul> {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Modifier une cotisation</legend> <dl> <dt><label for="f_intitule">Intitulé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="intitule" id="f_intitule" value="{form_field name=intitule data=$cotisation}" required="required" /></dd> <dt><label for="f_description">Description</label></dt> |
︙ | ︙ | |||
51 52 53 54 55 56 57 | du montant de la cotisation sera enregistrée dans la comptabilité selon la catégorie choisie. </dd> <dt class="cat_compta"><label for="f_id_categorie_compta">Catégorie comptable</label></dt> <dd class="cat_compta"> <select name="id_categorie_compta" id="f_id_categorie_compta"> {foreach from=$categories item="cat"} | | | | | 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 | du montant de la cotisation sera enregistrée dans la comptabilité selon la catégorie choisie. </dd> <dt class="cat_compta"><label for="f_id_categorie_compta">Catégorie comptable</label></dt> <dd class="cat_compta"> <select name="id_categorie_compta" id="f_id_categorie_compta"> {foreach from=$categories item="cat"} <option value="{$cat.id}" {form_field name="id_categorie_compta" selected=$cat.id data=$cotisation}>{$cat.intitule} {if !empty($cat.description)} — <em>{$cat.description}</em> {/if} </option> {/foreach} </select> </dd> </dl> </fieldset> <p class="submit"> {csrf_field key="edit_co_%s"|args:$cotisation.id} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> <script type="text/javascript"> {literal} |
︙ | ︙ |
Modified src/templates/admin/membres/cotisations/gestion/rappel_modifier.tpl from [e1815f9594] to [00fa91360e].
1 2 3 4 5 6 7 8 9 10 | {include file="admin/_head.tpl" title="Modifier un rappel automatique" current="membres/cotisations" js=1} <ul class="actions"> <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> <li class="current"><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> </ul> {if $error} <p class="error"> | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | {include file="admin/_head.tpl" title="Modifier un rappel automatique" current="membres/cotisations" js=1} <ul class="actions"> <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> <li class="current"><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> </ul> {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}" id="f_add"> <fieldset> <legend>Modifier un rappel automatique</legend> <dl> <dt><label for="f_id_cotisation">Cotisation associée</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="id_cotisation" id="f_id_cotisation" required="required"> <option value="">--</option> {foreach from=$cotisations item="co"} <option value="{$co.id}" {form_field name="id_cotisation" selected=$co.id data=$rappel}> {$co.intitule} — {$co.montant|escape|html_money} {$config.monnaie} — {if $co.duree}pour {$co.duree} jours {elseif $co.debut} du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} </option> {/foreach} |
︙ | ︙ | |||
52 53 54 55 56 57 58 | <dt><label for="f_texte">Texte du mail</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><textarea name="texte" id="f_texte" cols="70" rows="15" required="required">{form_field name=texte data=$rappel}</textarea></dd> <dd class="help">Astuce : pour inclure dans le contenu du mail le nom du membre, utilisez #IDENTITE, pour inclure le délai de l'envoi utilisez #NB_JOURS.</dd> </dl> </fieldset> <p class="submit"> | | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | <dt><label for="f_texte">Texte du mail</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><textarea name="texte" id="f_texte" cols="70" rows="15" required="required">{form_field name=texte data=$rappel}</textarea></dd> <dd class="help">Astuce : pour inclure dans le contenu du mail le nom du membre, utilisez #IDENTITE, pour inclure le délai de l'envoi utilisez #NB_JOURS.</dd> </dl> </fieldset> <p class="submit"> {csrf_field key="edit_rappel_%s"|args:$rappel.id} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/cotisations/gestion/rappel_supprimer.tpl from [51a4232ffb] to [50e8d9fa01].
1 2 3 4 5 6 7 8 9 10 | {include file="admin/_head.tpl" title="Supprimer un rappel automatique" current="membres/cotisations"} <ul class="actions"> <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> <li class="current"><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> </ul> {if $error} <p class="error"> | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | {include file="admin/_head.tpl" title="Supprimer un rappel automatique" current="membres/cotisations"} <ul class="actions"> <li><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> <li class="current"><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> </ul> {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer ce rappel automatique ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer le rappel « {$rappel.sujet} » ? </h3> <dl> <dt><label for="f_delete_history">Effacer aussi l'historique des e-mails envoyés par le biais de ce rappel ?</label></dt> <dd> <label> <input type="radio" name="delete_history" value="0" checked="checked" /> Non, conserver l'historique |
︙ | ︙ |
Modified src/templates/admin/membres/cotisations/gestion/rappels.tpl from [9c67a467da] to [8159177598].
︙ | ︙ | |||
21 22 23 24 25 26 27 | <th>Sujet</th> <td></td> </thead> <tbody> {foreach from=$liste item="rappel"} <tr> <td> | | | | | | | | | | | | | | | 21 22 23 24 25 26 27 28 29 30 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 | <th>Sujet</th> <td></td> </thead> <tbody> {foreach from=$liste item="rappel"} <tr> <td> {$rappel.intitule} — {$rappel.montant|escape|html_money} {$config.monnaie} — {if $rappel.duree}pour {$rappel.duree} jours {elseif $rappel.debut} du {$rappel.debut|format_sqlite_date_to_french} au {$rappel.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} </td> <td> {if $rappel.delai == 0}le jour de l'expiration {else} {$rappel.delai|abs} {if abs($rappel.delai) > 1}jours{else}jour{/if} {if $rappel.delai > 0}après{else}avant{/if} expiration {/if} </td> <th>{* FIXME liste des personnes ayant reçu ce rappel<a href="{$admin_url}membres/cotisations/rappel.php?id={$rappel.id}">{$rappel.sujet}</a>*}{$rappel.sujet}</th> <td class="actions"> <a class="icn" href="{$admin_url}membres/cotisations/gestion/rappel_modifier.php?id={$rappel.id}" title="Modifier">✎</a> <a class="icn" href="{$admin_url}membres/cotisations/gestion/rappel_supprimer.php?id={$rappel.id}" title="Supprimer">✘</a> </td> </tr> {/foreach} </tbody> </table> {/if} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}" id="f_add"> <fieldset> <legend>Ajouter un rappel automatique</legend> <dl> <dt><label for="f_id_cotisation">Cotisation associée</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="id_cotisation" id="f_id_cotisation" required="required"> <option value="">--</option> {foreach from=$cotisations item="co"} <option value="{$co.id}" {form_field name="id_cotisation" selected=$co.id}> {$co.intitule} — {$co.montant|escape|html_money} {$config.monnaie} — {if $co.duree}pour {$co.duree} jours {elseif $co.debut} du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} </option> {/foreach} |
︙ | ︙ |
Modified src/templates/admin/membres/cotisations/gestion/supprimer.tpl from [c69a905047] to [9ac215b33b].
1 2 3 4 5 6 7 8 9 10 11 12 | {include file="admin/_head.tpl" title="Supprimer une cotisation" current="membres/cotisations"} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> {/if} </ul> {if $error} <p class="error"> | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | {include file="admin/_head.tpl" title="Supprimer une cotisation" current="membres/cotisations"} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> {/if} </ul> {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer cette cotisation ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer la cotisation « {$cotisation.intitule} » ? </h3> <p class="help"> Attention, l'historique des membres ayant cotisé à cette cotisation sera supprimé. Si des écritures comptables sont liées à l'historique des cotisations, elles ne seront pas supprimées, et la comptabilité demeurera inchangée. </p> </fieldset> |
︙ | ︙ |
Modified src/templates/admin/membres/cotisations/index.tpl from [ac45a1230c] to [75f3c738a3].
︙ | ︙ | |||
16 17 18 19 20 21 22 | <td>Membres inscrits</td> <td>Membres à jour</td> <td></td> </thead> <tbody> {foreach from=$liste item="co"} <tr> | | | | | | | | | | | | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | <td>Membres inscrits</td> <td>Membres à jour</td> <td></td> </thead> <tbody> {foreach from=$liste item="co"} <tr> <th><a href="{$admin_url}membres/cotisations/voir.php?id={$co.id}">{$co.intitule}</a></th> <td> {if $co.duree} {$co.duree} jours {elseif $co.debut} du {$co.debut|format_sqlite_date_to_french} au {$co.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} </td> <td class="num">{$co.montant|escape|html_money} {$config.monnaie}</td> <td class="num">{$co.nb_membres}</td> <td class="num">{$co.nb_a_jour}</td> <td class="actions"> <a class="icn" href="{$admin_url}membres/cotisations/voir.php?id={$co.id}" title="Liste des membres cotisants">👪</a> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <a class="icn" href="{$admin_url}membres/cotisations/gestion/modifier.php?id={$co.id}" title="Modifier">✎</a> <a class="icn" href="{$admin_url}membres/cotisations/gestion/supprimer.php?id={$co.id}" title="Supprimer">✘</a> {/if} </td> </tr> {/foreach} </tbody> </table> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} {if $error} <p class="error"> {$error} </p> {else} <p class="help"> Idée : les cotisations peuvent également être utilisées pour suivre les activités auxquelles sont inscrits les membres de l'association. </p> {/if} <form method="post" action="{$self_url}" id="f_add"> <fieldset> <legend>Ajouter une cotisation</legend> <dl> <dt><label for="f_intitule">Intitulé</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="intitule" id="f_intitule" value="{form_field name=intitule}" required="required" /></dd> <dt><label for="f_description">Description</label></dt> |
︙ | ︙ | |||
95 96 97 98 99 100 101 | du montant de la cotisation sera enregistrée dans la comptabilité selon la catégorie choisie. </dd> <dt class="cat_compta"><label for="f_id_categorie_compta">Catégorie comptable</label></dt> <dd class="cat_compta"> <select name="id_categorie_compta" id="f_id_categorie_compta"> {foreach from=$categories item="cat"} | | | | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | du montant de la cotisation sera enregistrée dans la comptabilité selon la catégorie choisie. </dd> <dt class="cat_compta"><label for="f_id_categorie_compta">Catégorie comptable</label></dt> <dd class="cat_compta"> <select name="id_categorie_compta" id="f_id_categorie_compta"> {foreach from=$categories item="cat"} <option value="{$cat.id}" {form_field name="id_categorie_compta" selected=$cat.id}>{$cat.intitule} {if !empty($cat.description)} — <em>{$cat.description}</em> {/if} </option> {/foreach} </select> </dd> </dl> </fieldset> |
︙ | ︙ |
Modified src/templates/admin/membres/cotisations/rappels.tpl from [02dc8464dd] to [8a165b2c72].
1 2 3 | {include file="admin/_head.tpl" title="Rappels pour cotisations du membre" current="membres/cotisations" js=1} <ul class="actions"> | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Rappels pour cotisations du membre" current="membres/cotisations" js=1} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}"><b>{$membre.identite}</b></a></li> <li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN && $user.id != $membre.id} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li class="current"><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> <form method="post" action="{$self_url}"> <fieldset> <legend>Enregistrer un rappel fait à ce membre</legend> <dl> <dt><label for="f_id_cotisation">Cotisation</label></dt> <dd> <select id="f_id_cotisation" name="id_cotisation"> {foreach from=$cotisations item="co"} <option value="{$co.id}">{$co.intitule} — {if $co.a_jour} Expire dans {$co.nb_jours} jours {else} EXPIRÉE depuis {$co.nb_jours} jours {/if} </option> {/foreach} </select> </dd> <dt><label for="f_date">Date du rappel</label></dt> <dd><input type="date" name="date" id="f_date" required="required" value="{form_field name="date" default=$default_date}" /></dd> <dt><label for="f_media_email">Moyen de communication utilisé</label></dt> <dd> <label> <input id="f_media_email" type="radio" name="media" value="{$rappels_envoyes::MEDIA_EMAIL}" /> E-Mail </label> </dd> {* FIXME: proposer d'envoyer un email au membre *} <dd> <label> <input type="radio" name="media" value="{$rappels_envoyes::MEDIA_TELEPHONE}" /> Téléphone </label> </dd> {* FIXME: afficher les différents numéros de téléphone de la fiche membre *} <dd> <label> <input type="radio" name="media" value="{$rappels_envoyes::MEDIA_COURRIER}" /> Courrier postal </label> </dd> <dd> <label> <input type="radio" name="media" value="{$rappels_envoyes::MEDIA_AUTRE}" /> Autre </label> </dd> </dl> <p class="submit"> {csrf_field key="add_rappel_%s"|args:$membre.id} <input type="submit" name="save" value="Enregistrer le rappel →" /> </p> </fieldset> </form> {if !empty($rappels)} <table class="list"> |
︙ | ︙ | |||
84 85 86 87 88 89 90 | {elseif $r.media == Garradin\Rappels_envoyes::MEDIA_TELEPHONE} Téléphone {else} E-Mail {/if} </td> <td> | | | | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | {elseif $r.media == Garradin\Rappels_envoyes::MEDIA_TELEPHONE} Téléphone {else} E-Mail {/if} </td> <td> {$r.intitule} — {$r.montant|escape|html_money} {$config.monnaie} </td> <td class="actions"> </td> </tr> {/foreach} </tbody> </table> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/cotisations/supprimer.tpl from [0e6b2ffe34] to [7f2b5597c6].
|
| | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | {include file="admin/_head.tpl" title="Supprimer une cotisation pour le membre n°%s"|args:$membre.id current="membres/cotisations"} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}">Membre n°{$membre.id}</a></li> <li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN && $user.id != $membre.id} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li class="current"><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> {if $error} <p class="error">{$error}</p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer une cotisation membre</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer la cotisation membre du {$cotisation.date|format_sqlite_date_to_french} ? </h3> {if $nb_operations > 0} <p class="alert"> Attention il y a {$nb_operations} écritures comptables liées à cette cotisation. Celles-ci ne seront pas supprimées lors de la suppression de la cotisation membre. </p> {else} <p class="help"> Aucune écriture comptable n'est liée à cette cotisation. </p> {/if} </fieldset> </fieldset> <p class="submit"> {csrf_field key="del_cotisation_%s"|args:$cotisation.id} <input type="submit" name="delete" value="Supprimer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/cotisations/voir.tpl from [e845d60b27] to [075b100334].
1 2 3 4 5 6 7 8 9 10 11 12 | {include file="admin/_head.tpl" title="Membres ayant cotisé" current="membres/cotisations"} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> {/if} </ul> <dl class="cotisation"> <dt>Cotisation</dt> | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Membres ayant cotisé" current="membres/cotisations"} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/cotisations/">Cotisations</a></li> <li><a href="{$admin_url}membres/cotisations/ajout.php">Saisie d'une cotisation</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/cotisations/gestion/rappels.php">Gestion des rappels automatiques</a></li> {/if} </ul> <dl class="cotisation"> <dt>Cotisation</dt> <dd>{$cotisation.intitule} — {if $cotisation.duree} {$cotisation.duree} jours {elseif $cotisation.debut} du {$cotisation.debut|format_sqlite_date_to_french} au {$cotisation.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} — {$cotisation.montant|escape|html_money} {$config.monnaie} </dd> <dt>Nombre de membres ayant cotisé</dt> <dd> {$cotisation.nb_membres} <small class="help">(incluant les membres des catégories cachées)</small> </dd> </dl> {if !empty($liste)} <table class="list"> <thead class="userOrder"> <tr> <td class="{if $order == "id"} cur {if $desc}desc{else}asc{/if}{/if}"><a href="?id={$cotisation.id}&o=id&a" class="icn up">↑</a><a href="?id={$cotisation.id}&o=id&d" class="icn dn">↓</a></td> <th class="{if $order == "identite"} cur {if $desc}desc{else}asc{/if}{/if}">Membre <a href="?id={$cotisation.id}&o=identite&a" class="icn up">↑</a><a href="?id={$cotisation.id}&o=identite&d" class="icn dn">↓</a></th> <td class="{if $order == "a_jour"} cur {if $desc}desc{else}asc{/if}{/if}">Statut <a href="?id={$cotisation.id}&o=a_jour&a" class="icn up">↑</a><a href="?id={$cotisation.id}&o=a_jour&d" class="icn dn">↓</a></td> <td class="{if $order == "date"} cur {if $desc}desc{else}asc{/if}{/if}">Date de cotisation <a href="?id={$cotisation.id}&o=date&a" class="icn up">↑</a><a href="?id={$cotisation.id}&o=date&d" class="icn dn">↓</a></td> <td></td> </tr> </thead> <tbody> {foreach from=$liste item="co"} <tr> <td class="num"><a href="{$admin_url}membres/fiche.php?id={$co.id_membre}">{$co.id_membre}</a></td> <th>{$co.nom}</th> <td>{if $co.a_jour}<b class="confirm">À jour</b>{else}<b class="error">En retard</b>{/if}</td> <td>{$co.date|format_sqlite_date_to_french}</td> <td class="actions"> <a class="icn" href="{$admin_url}membres/cotisations/ajout.php?id={$co.id_membre}&cotisation={$cotisation.id}" title="Saisir une cotisation">➕</a> <a class="icn" href="{$admin_url}membres/cotisations.php?id={$co.id_membre}" title="Voir toutes les cotisations de ce membre">𝍢</a> <a class="icn" href="{$admin_url}membres/cotisations/rappels.php?id={$co.id_membre}" title="Rappels envoyés à ce membre">⚠</a> </td> </tr> {/foreach} </tbody> </table> {pagination url=$pagination_url page=$page bypage=$bypage total=$total} {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/fiche.tpl from [5537ffcdef] to [ce083161b7].
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="%s (%s)"|args:$membre.identite:$categorie.nom current="membres"} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/fiche.php?id={$membre.id}"><b>{$membre.identite}</b></a></li> <li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN && $user.id != $membre.id} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> <dl class="cotisation"> {if $cotisation} <dt>Cotisation obligatoire</dt> <dd>{$cotisation.intitule} — {if $cotisation.duree} {$cotisation.duree} jours {elseif $cotisation.debut} du {$cotisation.debut|format_sqlite_date_to_french} au {$cotisation.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} — {$cotisation.montant|escape|html_money} {$config.monnaie} </dd> <dt>À jour de cotisation ?</dt> <dd> {if !$cotisation.a_jour} <span class="error"><b>Non</b>, cotisation non payée</span> {else} <b class="confirm">✓ Oui</b> {if $cotisation.expiration} (expire le {$cotisation.expiration|format_sqlite_date_to_french}) {/if} {/if} </dd> {/if} <dt> {if $nb_activites == 1} {$nb_activites} cotisation enregistrée {elseif $nb_activites} {$nb_activites} cotisations enregistrées {else} Aucune cotisation enregistrée {/if} </dt> <dd> <a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Voir l'historique</a> </dd> <dd><form method="get" action="{$admin_url}membres/cotisations/ajout.php"><input type="submit" value="Enregistrer une cotisation →" /><input type="hidden" name="id" value="{$membre.id}" /></form></dd> {if !empty($nb_operations)} <dt>Écritures comptables</dt> <dd>{$nb_operations} écritures comptables — <a href="{$admin_url}compta/operations/membre.php?id={$membre.id}">Voir la liste des écritures ajoutées par ce membre</a> </dd> {/if} </dl> <dl class="describe"> <dt>Numéro d'adhérent</dt> <dd>{$membre.id}</dd> <dt>Catégorie</dt> <dd>{$categorie.nom} <span class="droits">{format_droits droits=$categorie}</span></dd> <dt>Inscription</dt> <dd>{$membre.date_inscription|date_fr:'d/m/Y'}</dd> <dt>Dernière connexion</dt> <dd>{if empty($membre.date_connexion)}Jamais{else}{$membre.date_connexion|date_fr:'d/m/Y à H:i'}{/if}</dd> {foreach from=$champs key="c" item="config"} <dt>{$config.title}</dt> <dd> {if $config.type == 'checkbox'} {if $membre->$c}Oui{else}Non{/if} {elseif empty($membre->$c)} <em>(Non renseigné)</em> {elseif $c == 'nom'} <strong>{$membre->$c}</strong> {elseif $c == 'email'} <a href="mailto:{$membre->$c}">{$membre->$c}</a> | <a href="{$www_url}admin/membres/message.php?id={$membre.id}"><b class="icn action">✉</b> Envoyer un message</a> {elseif $config.type == 'email'} <a href="mailto:{$membre->$c}">{$membre->$c}</a> {elseif $config.type == 'tel'} <a href="tel:{$membre->$c}">{$membre->$c|format_tel}</a> {elseif $config.type == 'country'} {$membre->$c|get_country_name} {elseif $config.type == 'date' || $config.type == 'datetime'} {$membre->$c|format_sqlite_date_to_french} {elseif $c == 'passe'} Oui {elseif $config.type == 'password'} ******* {elseif $config.type == 'multiple'} <ul> {foreach from=$config.options key="b" item="name"} {if $membre->$c & (0x01 << $b)} <li>{$name}</li> {/if} {/foreach} </ul> {else} {$membre->$c|escape|rtrim|nl2br} {/if} </dd> {/foreach} </dl> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/import.tpl from [af9178fa27] to [e21d9b42f1].
1 2 3 4 | {include file="admin/_head.tpl" title="Import & export des membres" current="membres" js=1} {if $error} <p class="error"> | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | {include file="admin/_head.tpl" title="Import & export des membres" current="membres" js=1} {if $error} <p class="error"> {$error} </p> {elseif $ok} <p class="confirm"> L'import s'est bien déroulé. </p> {/if} <ul class="actions"> <li class="current"><a href="{$www_url}admin/membres/import.php">Importer</a></li> <li><a href="{$www_url}admin/membres/import.php?export">Exporter en CSV</a></li> </ul> <form method="post" action="{$self_url}" enctype="multipart/form-data"> <fieldset> <legend>Importer depuis un fichier</legend> <dl> <dt><label for="f_file">Fichier à importer</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="file" name="upload" id="f_file" required="required" /></dd> <dt><label for="f_type">Type de fichier</label> <b title="(Champ obligatoire)">obligatoire</b></dt> |
︙ | ︙ | |||
44 45 46 47 48 49 50 | <dd class="help">Indiquer quels champs des fiches membre de Garradin les données de Galette doivent remplir.</dd> <dd class="galette"> <table class="list auto"> <tbody> {foreach from=$galette_champs item="galette"} {if is_int($galette)}{continue}{/if} <tr> | | | | | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | <dd class="help">Indiquer quels champs des fiches membre de Garradin les données de Galette doivent remplir.</dd> <dd class="galette"> <table class="list auto"> <tbody> {foreach from=$galette_champs item="galette"} {if is_int($galette)}{continue}{/if} <tr> <th>{$galette}</th> <td><select name="galette_translate[{$galette}]"> <option value="">-- Ne pas importer ce champ</option> {foreach from=$garradin_champs item="champ" key="name"} {if $champ.type == 'checkbox' || $champ.type == 'multiple'}{continue}{/if} <option value="{$name}" {if (!empty($translate[$galette]) && $translate[$galette] == $name)}selected="selected"{/if}>{$champ.title}</option> {/foreach} </select></td> </tr> {/foreach} </tbody> </table> </dd> |
︙ | ︙ |
Modified src/templates/admin/membres/index.tpl from [16475009f5] to [432dc2550b].
1 2 3 4 5 6 7 8 9 10 11 12 13 | {include file="admin/_head.tpl" title="Liste des membres" current="membres" js=1} {if $user.droits.membres >= Garradin\Membres::DROIT_ECRITURE} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/">Liste des membres</a></li> <li><a href="{$admin_url}membres/recherche.php">Recherche avancée</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/import.php">Import & export</a></li> <li><a href="{$admin_url}membres/recherche_sql.php">Recherche par requête SQL</a></li> {/if} </ul> {/if} | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | {include file="admin/_head.tpl" title="Liste des membres" current="membres" js=1} {if $user.droits.membres >= Garradin\Membres::DROIT_ECRITURE} <ul class="actions"> <li class="current"><a href="{$admin_url}membres/">Liste des membres</a></li> <li><a href="{$admin_url}membres/recherche.php">Recherche avancée</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$admin_url}membres/import.php">Import & export</a></li> <li><a href="{$admin_url}membres/recherche_sql.php">Recherche par requête SQL</a></li> {/if} </ul> {/if} {if $sent} <p class="confirm">Votre message a été envoyé.</p> {/if} {if !empty($membres_cats)} <form method="get" action="{$self_url}" class="shortFormRight"> <fieldset> <legend>Filtrer par catégorie</legend> <select name="cat" id="f_cat" onchange="this.form.submit();"> <option value="0" {if $current_cat == 0} selected="selected"{/if}>-- Toutes</option> {foreach from=$membres_cats key="id" item="nom"} {if $user.droits.membres >= Garradin\Membres::DROIT_ECRITURE || !array_key_exists($id, $membres_cats_cachees)} <option value="{$id}"{if $current_cat == $id} selected="selected"{/if}>{$nom}</option> {/if} {/foreach} </select> <noscript><input type="submit" value="Filtrer →" /></noscript> </fieldset> </form> {/if} |
︙ | ︙ | |||
48 49 50 51 52 53 54 | {if !empty($liste)} <table class="list"> <thead class="userOrder"> <tr> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN}<td class="check"><input type="checkbox" title="Tout cocher / décocher" /></td>{/if} <td class="{if $order == 'id'} cur {if $desc}desc{else}asc{/if}{/if}" title="Numéro unique"><a href="?o=id&a" class="icn up">↑</a><a href="?o=id&d" class="icn dn">↓</a></td> {foreach from=$champs key="c" item="champ"} | | | | | | | | | 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 | {if !empty($liste)} <table class="list"> <thead class="userOrder"> <tr> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN}<td class="check"><input type="checkbox" title="Tout cocher / décocher" /></td>{/if} <td class="{if $order == 'id'} cur {if $desc}desc{else}asc{/if}{/if}" title="Numéro unique"><a href="?o=id&a" class="icn up">↑</a><a href="?o=id&d" class="icn dn">↓</a></td> {foreach from=$champs key="c" item="champ"} <td class="{if $order == $c} cur {if $desc}desc{else}asc{/if}{/if}">{$champ.title} <a href="?o={$c}&a" class="icn up">↑</a><a href="?o={$c}&d" class="icn dn">↓</a></td> {/foreach} <td></td> </tr> </thead> <tbody> {foreach from=$liste item="membre"} <tr> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN}<td class="check"><input type="checkbox" name="selected[]" value="{$membre.id}" /></td>{/if} <td class="num"><a href="{$admin_url}membres/fiche.php?id={$membre.id}">{$membre.id}</a></th> {foreach from=$champs key="c" item="cfg"} <td>{$membre->$c|raw|display_champ_membre:$cfg}</td> {/foreach} <td class="actions"> {if !empty($membre.email)}<a class="icn" href="{$admin_url}membres/message.php?id={$membre.id}" title="Envoyer un message">✉</a> {/if} <a class="icn" href="{$admin_url}membres/fiche.php?id={$membre.id}" title="Fiche membre">👤</a> <a class="icn" href="{$admin_url}membres/modifier.php?id={$membre.id}" title="Modifier la fiche membre">✎</a> </td> </tr> {/foreach} </tbody> </table> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN} |
︙ | ︙ | |||
98 99 100 101 102 103 104 | <thead> <th>Membre</th> <td></td> </thead> <tbody> {foreach from=$liste item="membre"} <tr> | | | | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | <thead> <th>Membre</th> <td></td> </thead> <tbody> {foreach from=$liste item="membre"} <tr> <th>{$membre.identite}</th> <td class="actions"> {if !empty($membre.email)}<a href="{$www_url}admin/membres/message.php?id={$membre.id}">Envoyer un message</a>{/if} </td> </tr> {/foreach} </tbody> </table> {if !empty($pagination_url)} |
︙ | ︙ |
Modified src/templates/admin/membres/message.tpl from [f18c3abe8b] to [657d2ca8e3].
1 2 3 4 | {include file="admin/_head.tpl" title="Contacter un membre" current="membres"} {if $error} <p class="error"> | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | {include file="admin/_head.tpl" title="Contacter un membre" current="membres"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset class="memberMessage"> <legend>Message</legend> <dl> <dt>Expéditeur</dt> <dd>{$user.identite} <{$user.email}></dd> <dd class="help"> Votre adresse E-Mail apparaîtra dans le champ "expéditeur" du message reçu par le destinataire. </dd> <dt>Destinataire</dt> <dd>{$membre.identite} ({$categorie.nom})</dd> <dt><label for="f_sujet">Sujet</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="sujet" id="f_sujet" value="{form_field name=sujet}" required="required" /></dd> <dt><label for="f_message">Message</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><textarea name="message" id="f_message" cols="72" rows="25" required="required">{form_field name=message}</textarea></dd> <dd> <input type="checkbox" name="copie" id="f_copie" value="1" /> <label for="f_copie">Recevoir par e-mail une copie du message envoyé</label> |
︙ | ︙ |
Modified src/templates/admin/membres/message_collectif.tpl from [97895debec] to [b82f35bae6].
1 2 3 4 | {include file="admin/_head.tpl" title="Envoyer un message collectif" current="membres/message_collectif"} {if $error} <p class="error"> | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | {include file="admin/_head.tpl" title="Envoyer un message collectif" current="membres/message_collectif"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}" onsubmit="return confirm('Envoyer vraiment ce message collectif ?');"> <fieldset class="memberMessage"> <legend>Message</legend> <dl> <dt>Expéditeur</dt> <dd>{$config.nom_asso} <{$config.email_asso}></dd> <dt><label for="f_dest">Membres destinataires</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="dest"> <option value="0">Toutes les catégories qui ne sont pas cachées</option> {foreach from=$cats_liste key="id" item="nom"} <option value="{$id}">{$nom} {if array_key_exists($id, $cats_cachees)}[cachée]{/if}</option> {/foreach} </select> </dd> <dd> <input type="checkbox" id="f_subscribed" name="subscribed" value="1" {form_field name="subscribed" default="1" checked="1"} /> <label for="f_subscribed">Seulement les membres inscrits à la lettre d'information</label> </dd> <dt><label for="f_sujet">Sujet</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="help">Sera automatiquement précédé de la mention [{$config.nom_asso}]</dd> <dd><input type="text" name="sujet" id="f_sujet" value="{form_field name=sujet}" required="required" /></dd> <dt><label for="f_message">Message</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><textarea name="message" id="f_message" cols="72" rows="25" required="required">{form_field name=message}</textarea></dd> </dl> </fieldset> <p class="submit"> |
︙ | ︙ |
Modified src/templates/admin/membres/modifier.tpl from [71e88e20d1] to [7878a5d47d].
1 2 3 | {include file="admin/_head.tpl" title="Modifier un membre" current="membres" js=1} <ul class="actions"> | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | {include file="admin/_head.tpl" title="Modifier un membre" current="membres" js=1} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}"><b>{$membre.identite}</b></a></li> <li class="current"><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN && $user.id != $membre.id} <li><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Informations personnelles</legend> <dl> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN} <dt><label for="f_id">Numéro de membre</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="id" id="f_id" value="{form_field data=$membre name=id}" required="required" pattern="^\d+$" /></dd> |
︙ | ︙ | |||
41 42 43 44 45 46 47 | <dt><label for="f_passe">Nouveau mot de passe</label>{if $champs.passe.mandatory} <b title="(Champ obligatoire)">obligatoire</b>{/if}</dt> <dd class="help"> Astuce : un mot de passe de quatre mots choisis au hasard dans le dictionnaire est plus sûr et plus simple à retenir qu'un mot de passe composé de 10 lettres et chiffres. </dd> <dd class="help"> Pas d'idée ? Voici une suggestion choisie au hasard : | | | | | 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 | <dt><label for="f_passe">Nouveau mot de passe</label>{if $champs.passe.mandatory} <b title="(Champ obligatoire)">obligatoire</b>{/if}</dt> <dd class="help"> Astuce : un mot de passe de quatre mots choisis au hasard dans le dictionnaire est plus sûr et plus simple à retenir qu'un mot de passe composé de 10 lettres et chiffres. </dd> <dd class="help"> Pas d'idée ? Voici une suggestion choisie au hasard : <input type="text" readonly="readonly" title="Cliquer pour utiliser cette suggestion comme mot de passe" id="pw_suggest" value="{$passphrase}" autocomplete="off" /> </dd> <dd><input type="password" name="passe" id="f_passe" value="{form_field name=passe}" pattern=".{ldelim}5,{rdelim}" /></dd> <dt><label for="f_repasse">Encore le mot de passe</label> (vérification){if $champs.passe.mandatory} <b title="(Champ obligatoire)">obligatoire</b>{/if}</dt> <dd><input type="password" name="repasse" id="f_repasse" value="{form_field name=repasse}" pattern=".{ldelim}5,{rdelim}" /></dd> </dl> </fieldset> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN && $user.id != $membre.id} <fieldset> <legend>Général</legend> <dl> <dt><label for="f_cat">Catégorie du membre</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <select name="id_categorie" id="f_cat"> {foreach from=$membres_cats key="id" item="nom"} <option value="{$id}"{if $current_cat == $id} selected="selected"{/if}>{$nom}</option> {/foreach} </select> </dd> </dl> </fieldset> {/if} <p class="submit"> {csrf_field key="edit_member_"|cat:$membre.id} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> <script type="text/javascript"> {literal} g.script('scripts/password.js').onload = function () { initPasswordField('pw_suggest', 'f_passe', 'f_repasse'); }; {/literal} </script> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/membres/recherche.tpl from [5f0fb47d43] to [418dc56141].
︙ | ︙ | |||
13 14 15 16 17 18 19 | <fieldset> <legend>Rechercher un membre</legend> <dl> <dt><label for="f_champ">Champ</label></dt> <dd> <select name="c" id="f_champ"> {foreach from=$champs_liste key="k" item="v"} | | | | | | | | | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | <fieldset> <legend>Rechercher un membre</legend> <dl> <dt><label for="f_champ">Champ</label></dt> <dd> <select name="c" id="f_champ"> {foreach from=$champs_liste key="k" item="v"} <option value="{$k}"{form_field name="c" default=$champ selected=$k}>{$v.title}</option> {/foreach} </select> </dd> <dt><label for="f_texte">Recherche</label></dt> <dd id="f_free"><input id="f_texte" type="text" name="r" value="{$recherche}" required="required" /></dd> {foreach from=$champs_liste key="k" item="v"} {if $v.type == 'select'} <dd class="special" id="f_{$k}"> <select name="r" disabled="disabled"> {foreach from=$v.options item="opt"} <option value="{$opt}"{form_field name="r" default=$recherche selected=$opt}>{$opt}</option> {/foreach} </select> </dd> {elseif $v.type == 'multiple'} <dd class="special" id="f_{$k}"> <select name="r" disabled="disabled"> {foreach from=$v.options key="opt_k" item="opt"} <option value="{$opt_k}"{form_field name="r" default=$recherche selected=$opt_k}>{$opt}</option> {/foreach} </select> </dd> {elseif $v.type == 'checkbox'} <dd class="special" id="f_{$k}"> <select name="r" disabled="disabled"> <option value="1"{form_field name="r" default=$recherche selected=1}>Oui</option> <option value="0"{form_field name="r" default=$recherche selected=0}>Non</option> </select> </dd> {/if} {/foreach} |
︙ | ︙ | |||
63 64 65 66 67 68 69 | {if !empty($liste)} <table class="list search"> <thead> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN}<td class="check"><input type="checkbox" value="Tout cocher / décocher" onclick="checkUncheck();" /></td>{/if} <td></td> {foreach from=$champs_entete key="c" item="cfg"} {if $champ == $c} | | | | | | | | | | 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 | {if !empty($liste)} <table class="list search"> <thead> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN}<td class="check"><input type="checkbox" value="Tout cocher / décocher" onclick="checkUncheck();" /></td>{/if} <td></td> {foreach from=$champs_entete key="c" item="cfg"} {if $champ == $c} <th><strong>{$cfg.title}</strong></th> {else} <td>{$cfg.title}</td> {/if} {/foreach} <td></td> </thead> <tbody> {foreach from=$liste item="membre"} <tr> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN}<td class="check"><input type="checkbox" name="selected[]" value="{$membre.id}" /></td>{/if} <td class="num"><a href="{$admin_url}membres/fiche.php?id={$membre.id}">{$membre.id}</a></th> {foreach from=$champs_entete key="c" item="cfg"} {if $champ == $c} <th><strong>{$membre[$c]|raw|display_champ_membre:$cfg}</strong></th> {else} <td>{$membre[$c]|raw|display_champ_membre:$cfg}</td> {/if} {/foreach} <td class="actions"> {if !empty($membre.email)}<a class="icn" href="{$www_url}admin/membres/message.php?id={$membre.id}" title="Envoyer un message">✉</a> {/if} <a class="icn" href="modifier.php?id={$membre.id}" title="Modifier la fiche membre">✎</a> </td> </tr> {/foreach} </tbody> </table> {if $user.droits.membres == Garradin\Membres::DROIT_ADMIN} |
︙ | ︙ | |||
150 151 152 153 154 155 156 | <thead> <th>Membre</th> <td></td> </thead> <tbody> {foreach from=$liste item="membre"} <tr> | | | | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | <thead> <th>Membre</th> <td></td> </thead> <tbody> {foreach from=$liste item="membre"} <tr> <th>{$membre.identite}</th> <td class="actions"> {if !empty($membre.email)}<a href="{$www_url}admin/membres/message.php?id={$membre.id}">Envoyer un message</a>{/if} </td> </tr> {/foreach} </tbody> </table> {else} <p class="info"> |
︙ | ︙ |
Modified src/templates/admin/membres/recherche_sql.tpl from [a0886f3573] to [a29af04094].
1 2 3 4 5 | {include file="admin/_head.tpl" title="Recherche par requête SQL" current="membres"} <form method="get" action="{$admin_url}membres/recherche_sql.php"> <fieldset> <legend>Schéma des tables SQL</legend> | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Recherche par requête SQL" current="membres"} <form method="get" action="{$admin_url}membres/recherche_sql.php"> <fieldset> <legend>Schéma des tables SQL</legend> <pre class="sql_schema">{$schema.membres}</pre> <dl> <dt><label for="f_query">Requête SQL</label></dt> <dd class="help">Si aucune limite n'est précisée, une limite de 100 résultats sera appliquée.</dd> <dd><textarea name="query" id="f_query" cols="50" rows="7" required="required">{$query}</textarea></dd> </dl> <p class="submit"> <input type="submit" value="Exécuter →" /> </p> </fieldset> </form> {if !empty($error)} <p class="error"> <strong>Erreur dans la requête SQL :</strong><br /> {$error} </p> {/if} <form method="post" action="{$admin_url}membres/action.php" class="memberList"> {if !empty($result)} <p class="alert">{$result|@count} résultats renvoyés.</p> <table class="list search"> <thead> {if array_key_exists('id', $result[0])} <td class="check"><input type="checkbox" value="Tout cocher / décocher" onclick="checkUncheck();" /></td> {/if} {foreach from=$result[0] key="col" item="ignore"} <td>{$col}</td> {/foreach} {if array_key_exists('id', $result[0])} <td></td> {/if} </thead> <tbody> {foreach from=$result item="row"} <tr> {if array_key_exists('id', $result[0])} <td class="check">{if !empty($row.id)}<input type="checkbox" name="selected[]" value="{$row.id}" />{/if}</td> {/if} {foreach from=$row item="col"} <td>{$col}</td> {/foreach} {if array_key_exists('id', $result[0])} <td class="actions"> {if !empty($row.id)} <a class="icn" href="{$admin_url}membres/fiche.php?id={$row.id}" title="Fiche membre">👤</a> <a class="icn" href="{$admin_url}membres/modifier.php?id={$row.id}" title="Modifier ce membre">✎</a> {/if} </td> {/if} </tr> {/foreach} </tbody> </table> |
︙ | ︙ |
Modified src/templates/admin/membres/supprimer.tpl from [b62ea02f23] to [cc4bfe10cc].
1 2 3 | {include file="admin/_head.tpl" title="Supprimer un membre" current="membres"} <ul class="actions"> | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | {include file="admin/_head.tpl" title="Supprimer un membre" current="membres"} <ul class="actions"> <li><a href="{$admin_url}membres/fiche.php?id={$membre.id}"><b>{$membre.identite}</b></a></li> <li><a href="{$admin_url}membres/modifier.php?id={$membre.id}">Modifier</a></li> {if $user.droits.membres >= Garradin\Membres::DROIT_ADMIN} <li class="current"><a href="{$admin_url}membres/supprimer.php?id={$membre.id}">Supprimer</a></li> {/if} <li><a href="{$admin_url}membres/cotisations.php?id={$membre.id}">Suivi des cotisations</a></li> </ul> {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer ce membre ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer le membre « {$membre.identite} » ? </h3> <p class="alert"> <strong>Attention</strong> : cette action est irréversible et effacera toutes les données personnelles et l'historique de ces membres. </p> <p class="help"> Alternativement, il est aussi possible de déplacer les membres qui ne font plus |
︙ | ︙ |
Modified src/templates/admin/mes_cotisations.tpl from [ce9d57271e] to [2423b2fa48].
1 2 3 4 5 | {include file="admin/_head.tpl" title="Mes cotisations" current="mes_cotisations"} <dl class="cotisation"> <dt> {if $nb_activites == 1} | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | {include file="admin/_head.tpl" title="Mes cotisations" current="mes_cotisations"} <dl class="cotisation"> <dt> {if $nb_activites == 1} Vous avez {$nb_activites} cotisation enregistrée. {elseif $nb_activites} Vous avez {$nb_activites} cotisations enregistrées. {else} Vous n'avez aucune cotisation enregistrée. {/if} </dt> {if $cotisation} <dt>Cotisation obligatoire</dt> <dd>{$cotisation.intitule} — {if $cotisation.duree} {$cotisation.duree} jours {elseif $cotisation.debut} du {$cotisation.debut|format_sqlite_date_to_french} au {$cotisation.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} — {$cotisation.montant|escape|html_money} {$config.monnaie} </dd> <dd> {if !$cotisation.a_jour} <b class="error">Vous n'êtes pas à jour de cotisation</b> {else} <b class="confirm">✓ À jour de cotisation</b> {if $cotisation.expiration} (expire le {$cotisation.expiration|format_sqlite_date_to_french}) {/if} {/if} </dd> {/if} {if !empty($cotisations_membre)} <dt>Cotisations en cours</dt> {foreach from=$cotisations_membre item="co"} <dd>{$co.intitule} — {if $co.a_jour} <span class="confirm">À jour</span>{if $co.expiration} — Expire le {$co.expiration|format_sqlite_date_to_french}{/if} {else} <span class="error">En retard</span> {/if} </dd> {/foreach} |
︙ | ︙ | |||
58 59 60 61 62 63 64 | <td>Cotisation</td> </thead> <tbody> {foreach from=$cotisations item="c"} <tr> <td>{$c.date|format_sqlite_date_to_french}</td> <td> | | | | | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | <td>Cotisation</td> </thead> <tbody> {foreach from=$cotisations item="c"} <tr> <td>{$c.date|format_sqlite_date_to_french}</td> <td> {$c.intitule} — {if $c.duree} {$c.duree} jours {elseif $c.debut} du {$c.debut|format_sqlite_date_to_french} au {$c.fin|format_sqlite_date_to_french} {else} ponctuelle {/if} — {$c.montant|escape|html_money} {$config.monnaie} </td> </tr> {/foreach} </tbody> </table> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/mes_infos.tpl from [16d0990455] to [701b28771a].
1 2 3 4 | {include file="admin/_head.tpl" title="Mes informations personnelles" current="mes_infos" js=1} {if $error} <p class="error"> | | > > > > > | | < < < < < < < < < < < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | {include file="admin/_head.tpl" title="Mes informations personnelles" current="mes_infos" js=1} {if $error} <p class="error"> {$error} </p> {/if} <ul class="actions"> <li class="current"><a href="{$admin_url}mes_infos.php">Mes informations personnelles</a></li> <li><a href="{$admin_url}mes_infos_securite.php">Mot de passe et options de sécurité</a></li> </ul> <form method="post" action="{$self_url}"> <fieldset> <legend>Informations personnelles</legend> <dl> {foreach from=$champs item="champ" key="nom"} {if empty($champ.private) && $nom != 'passe'} {html_champ_membre config=$champ name=$nom data=$membre user_mode=true} {/if} {/foreach} </dl> </fieldset> <fieldset> <legend>Changer mon mot de passe</legend> {if $user.droits.membres < Garradin\Membres::DROIT_ADMIN && (!empty($champs.passe.private) || empty($champs.passe.editable))} <p class="help">Vous devez contacter un administrateur pour changer votre mot de passe.</p> {else} <p><a href="{$admin_url}mes_infos_securite.php">Modifier mon mot de passe ou autres informations de sécurité.</a></p> {/if} </fieldset> <p class="submit"> {csrf_field key="edit_me"} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> {include file="admin/_foot.tpl"} |
Added src/templates/admin/mes_infos_securite.tpl version [31aa919cb6].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | {include file="admin/_head.tpl" title="Mes informations de connexion et sécurité" current="mes_infos" js=1} <ul class="actions"> <li><a href="{$admin_url}mes_infos.php">Mes informations personnelles</a></li> <li class="current"><a href="{$admin_url}mes_infos_securite.php">Mot de passe et options de sécurité</a></li> </ul> {if $confirm} <form method="post" action="{$self_url}"> {if $error} <p class="error"> {$error} </p> {/if} {if !empty($otp)} <p class="alert"> Confirmez l'activation de l'authentification à double facteur TOTP en l'utilisant une première fois. </p> <fieldset> <legend>Confirmer l'activation de l'authentification à double facteur (2FA)</legend> <img class="qrcode" src="{$otp.qrcode}" alt="" /> <dl> <dt>Ma clé secrète est :</dt> <dd><code>{$otp.secret_display}</code></dd> <dd class="help">Recopiez la clé secrète ou scannez le QR code pour configurer votre application TOTP (par exemple <a href="https://freeotp.github.io/">FreeOTP</a>), puis utilisez celle-ci pour générer un code d'accès et confirmer l'activation.</dd> <dt><label for="f_code">Code TOTP</label></dt> <dd class="help">Entrez ici le code donné par l'application d'authentification double facteur.</dd> <dd><input type="text" name="code" id="f_code" value="{form_field name=code}" /></dd> </dl> </fieldset> {/if} <fieldset> <legend>Confirmer les changements</legend> <dl> <dt><label for="f_passe_confirm">Mot de passe actuel</label></dt> <dd class="help">Entrez votre mot de passe actuel pour confirmer les changements demandés.</dd> <dd><input type="password" name="passe_confirm" /></dd> </dl> </fieldset> <p class="submit"> {csrf_field key="edit_me_security"} <input type="hidden" name="passe" value="{form_field name="passe"}" /> <input type="hidden" name="repasse" value="{form_field name="repasse"}" /> <input type="hidden" name="clef_pgp" value="{form_field name="clef_pgp"}" /> <input type="hidden" name="otp_secret" value="{$otp.secret}" /> <input type="hidden" name="otp" value="generate" /> <input type="submit" name="confirm" value="Confirmer →" /> </p> </form> {else} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Changer mon mot de passe</legend> {if $user.droits.membres < Garradin\Membres::DROIT_ADMIN && (!empty($champs.passe.private) || empty($champs.passe.editable))} <p class="help">Vous devez contacter un administrateur pour changer votre mot de passe.</p> {else} <dl> <dd>Vous avez déjà un mot de passe, ne remplissez les champs suivants que si vous souhaitez en changer.</dd> <dt><label for="f_passe">Nouveau mot de passe</label></dt> <dd class="help"> Astuce : un mot de passe de quatre mots choisis au hasard dans le dictionnaire est plus sûr et plus simple à retenir qu'un mot de passe composé de 10 lettres et chiffres. </dd> <dd class="help"> Pas d'idée ? Voici une suggestion choisie au hasard : <input type="text" readonly="readonly" title="Cliquer pour utiliser cette suggestion comme mot de passe" id="pw_suggest" value="{$passphrase}" autocomplete="off" /> </dd> <dd><input type="password" name="passe" id="f_passe" value="{form_field name=passe}" pattern=".{ldelim}5,{rdelim}" /></dd> <dt><label for="f_repasse">Encore le mot de passe</label> (vérification)</dt> <dd><input type="password" name="repasse" id="f_repasse" value="{form_field name=repasse}" pattern=".{ldelim}5,{rdelim}" /></dd> </dl> {/if} </fieldset> <fieldset> <legend>Authentification à double facteur (2FA)</legend> <p class="help">Pour renforcer la sécurité de votre connexion en cas de vol de votre mot de passe, vous pouvez activer l'authentification à double facteur. Cela nécessite d'installer une application comme <a href="https://freeotp.github.io/">FreeOTP</a> sur votre téléphone.</p> <dl> <dt>Authentification à double facteur (TOTP)</dt> {if $membre.secret_otp} <dd><label><input type="radio" name="otp" value="" checked="checked" /> <strong>Activée</strong></label></dd> <dd><label><input type="radio" name="otp" value="generate" /> Régénérer une nouvelle clé secrète</label></dd> <dd><label><input type="radio" name="otp" value="disable" /> Désactiver l'authentification à double facteur</label></dd> {else} <dd><em>Désactivée</em></dd> <dd><label><input type="checkbox" name="otp" value="generate" /> Activer</label></dd> {/if} </dl> </fieldset> {if $pgp_disponible} <fieldset> <legend>Protéger mes mails personnels par chiffrement PGP/GnuPG</legend> <dl> <dt><label for="f_clef_pgp">Ma clé publique PGP</label></dt> <dd class="help">En inscrivant ici votre clé publique, tous les emails personnels (non collectifs) qui vous sont envoyés seront chiffrés (cryptés) avec cette clé : messages envoyés par les membres, rappels de cotisation, procédure de récupération de mot de passe, etc.</dd> <dd><textarea name="clef_pgp" id="f_clef_pgp" cols="90" rows="5">{form_field name="clef_pgp" data=$user}</textarea></dd> {if $clef_pgp_fingerprint}<dd class="help">L'empreinte de la clé est : <code>{$clef_pgp_fingerprint}</code></dd>{/if} </dl> <p class="alert"> Attention : en inscrivant ici votre clé PGP, les emails de récupération de mot de passe perdu vous seront envoyés chiffrés et ne pourront être lus sans utiliser le mot de passe protégeant votre clé privée correspondante. </p> </fieldset> {/if} <p class="submit"> {csrf_field key="edit_me_security"} <input type="submit" name="save" value="Enregistrer →" /> </p> </form> <script type="text/javascript"> {literal} g.script('scripts/password.js').onload = function () { initPasswordField('pw_suggest', 'f_passe', 'f_repasse'); }; {/literal} </script> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/password.tpl from [889d5d8ac8] to [35d28557ff].
︙ | ︙ | |||
24 25 26 27 28 29 30 | {else} Membre inconnu ou ne disposant pas d'adresse e-mail. Si vous êtes membre, contactez un responsable pour obtenir un mot de passe. {/if} </p> {/if} | | | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | {else} Membre inconnu ou ne disposant pas d'adresse e-mail. Si vous êtes membre, contactez un responsable pour obtenir un mot de passe. {/if} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Recevoir un e-mail avec un nouveau mot de passe</legend> <p class="help"> Inscrivez ici votre {$champ.title}. Nous vous enverrons un message vous indiquant un lien permettant de recevoir un nouveau mot de passe. |
︙ | ︙ |
Modified src/templates/admin/wiki/_fichiers.tpl from [de79328606] to [0b713bbc92].
1 2 3 4 | {include file="admin/_head.tpl" title="Inclure un fichier" current="wiki" body_id="transparent" is_popup=true js=1} {if $error} <p class="error"> | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | {include file="admin/_head.tpl" title="Inclure un fichier" current="wiki" body_id="transparent" is_popup=true js=1} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" enctype="multipart/form-data" action="{$self_url}" id="f_upload"> <fieldset> <legend>Téléverser un fichier</legend> <input type="hidden" name="MAX_FILE_SIZE" value="{$max_size}" id="f_maxsize" /> <dl> <dd class="help">Taille maximale : {$max_size|format_bytes}</dd> <dd class="fileUpload"><input type="file" name="fichier" id="f_fichier" data-hash-check /></dd> </dl> <p class="submit"> <input type="hidden" name="{$csrf_field_name}" value="{$csrf_value}" /> <input type="submit" name="upload" id="f_submit" value="Envoyer le fichier" /> </p> </fieldset> </form> <form method="get" action="#" style="display: none;" id="insertImage"> <fieldset> |
︙ | ︙ | |||
44 45 46 47 48 49 50 | </form> {if !empty($images)} <ul class="gallery"> {foreach from=$images item="file"} <li> <figure> | | | | | | | | | | | | | 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 | </form> {if !empty($images)} <ul class="gallery"> {foreach from=$images item="file"} <li> <figure> <a href="{$file.url}" data-id="{$file.id}"><img src="{$file.thumb}" alt="" title="{$file.nom}" /></a> <form class="actions" method="post" action="{$self_url}"> <a href="{$file.url}" onclick="return !window.open(this.href);" class="icn" title="Télécharger">⇓</a> <input type="hidden" name="{$csrf_field_name}" value="{$csrf_value}" /> <input type="hidden" name="delete" value="{$file.id}" /> <noscript><input type="submit" value="Supprimer" /></noscript> </form> </figure> </li> {/foreach} </ul> {/if} {if !empty($fichiers)} <table class="list"> <tbody> {foreach from=$fichiers item="file"} <tr> <th>{$file.nom}</th> <td>{if $file.type}{$file.type}{/if}</td> <td class="actions"> <form class="actions" method="post" action="{$self_url}"> <a href="{$file.url}" onclick="return !window.open(this.href);" class="icn" title="Télécharger">⇓</a> <input type="hidden" name="{$csrf_field_name}" value="{$csrf_value}" /> <input type="hidden" name="delete" value="{$file.id}" /> <noscript><input type="submit" value="Supprimer" /></noscript> </form> </td> </tr> {/foreach} </tbody> </table> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/wiki/_preview.tpl from [3ed71895c6] to [1c9551975d].
1 2 3 | {include file="admin/_head.tpl" title="Wiki" current="wiki" is_popup=1 body_id="transparent"} <div class="wikiContent"> | | | 1 2 3 4 5 6 7 | {include file="admin/_head.tpl" title="Wiki" current="wiki" is_popup=1 body_id="transparent"} <div class="wikiContent"> {$contenu|raw|format_wiki|liens_wiki:'#'} </div> {include file="admin/_foot.tpl"} |
Modified src/templates/admin/wiki/chercher.tpl from [84d0518960] to [608bc4531d].
1 2 3 4 5 6 | {include file="admin/_head.tpl" title="Recherche" current="wiki/chercher"} <form method="get" action="{$www_url}admin/wiki/chercher.php" class="wikiSearch"> <fieldset> <legend>Rechercher une page</legend> <p> | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | {include file="admin/_head.tpl" title="Recherche" current="wiki/chercher"} <form method="get" action="{$www_url}admin/wiki/chercher.php" class="wikiSearch"> <fieldset> <legend>Rechercher une page</legend> <p> <input type="text" name="q" value="{$recherche}" size="25" /> <input type="submit" value="Chercher" /> </p> </fieldset> </form> {if !$recherche} <p class="alert"> Aucun terme recherché. </p> {else} <p class="alert"> <strong>{$nb_resultats}</strong> pages trouvées pour « {$recherche} » </p> <div class="wikiResults"> {foreach from=$resultats item="page"} <h3><a href="./?{$page.uri}">{$page.titre}</a></h3> <p>{$page.snippet|escape|clean_snippet}</p> {/foreach} </div> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/wiki/creer.tpl from [55d3438eb1] to [85b6a3631c].
1 2 3 4 | {include file="admin/_head.tpl" title="Créer une page" current="wiki"} {if $error} <p class="error"> | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | {include file="admin/_head.tpl" title="Créer une page" current="wiki"} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Informations</legend> <dl> <dt><label for="f_titre">Titre</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="titre" id="f_titre" value="{form_field name=titre}" /></dd> </dl> |
︙ | ︙ |
Modified src/templates/admin/wiki/editer.tpl from [e660a7c338] to [63babc113b].
1 2 3 4 | {include file="admin/_head.tpl" title="Éditer une page" current="wiki" js=1} {if $error} <p class="error"> | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Éditer une page" current="wiki" js=1} {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}" id="f_form"> <fieldset class="wikiMain"> <legend>Informations générales</legend> <dl> <dt><label for="f_titre">Titre</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd><input type="text" name="titre" id="f_titre" value="{form_field data=$page name=titre}" required="required" /></dd> <dt><label for="f_uri">Adresse unique</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd class="help"> Ne peut comporter que des lettres, des chiffres, des tirets et des tirets bas. </dd> <dd><input type="text" name="uri" id="f_uri" value="{form_field data=$page name=uri}" required="required" /></dd> <dt><label for="f_browse_parent">Cette page est une sous-rubrique de...</label></dt> <dd> <input type="hidden" name="parent" id="f_parent" value="{form_field data=$page name=parent}" /> {if $page.parent == 0} <samp id="current_parent_name">la racine du site</samp> {else} <samp id="current_parent_name">{$parent}</samp> {/if} <input type="button" id="f_browse_parent" onclick="browseWikiForParent();" value="Changer" /> </dd> <dt><label for="f_date">Date</label> <b title="(Champ obligatoire)">obligatoire</b></dt> <dd> <input type="date" size="10" name="date" id="f_date" value="{$date|date_fr:'Y-m-d'}" pattern="{literal}^\d{4}-\d{2}-\d{2}${/literal}" required="required" /> <input type="text" class="time" size="2" name="date_h" value="{$date|date_fr:'H'}" pattern="^{literal}\d{1,2}${/literal}" required="required" /> h <input type="text" class="time" size="2" name="date_min" value="{$date|date_fr:'i'}" pattern="{literal}^\d{1,2}${/literal}" required="required" /> </dd> </dl> </fieldset> <fieldset class="wikiRights"> <legend>Droits d'accès</legend> <dl> <dt><label for="f_droit_lecture_public">Cette page est visible :</label></dt> <dd> <input type="radio" name="droit_lecture" id="f_droit_lecture_public" value="{$wiki::LECTURE_PUBLIC}" {form_field data=$page name="droit_lecture" checked=$wiki::LECTURE_PUBLIC} /> <label for="f_droit_lecture_public"><strong>Sur le site de l'association</strong></label> — cette page apparaîtra sur le site public de l'association, accessible à tous les visiteurs </dd> <dd> <input type="radio" name="droit_lecture" id="f_droit_lecture_normal" value="{$wiki::LECTURE_NORMAL}" {form_field data=$page name="droit_lecture" checked=$wiki::LECTURE_NORMAL} /> <label for="f_droit_lecture_normal"><strong>Sur le wiki uniquement</strong></label> — seuls les membres ayant accès au wiki pourront la voir </dd> <dd> <input type="radio" name="droit_lecture" id="f_droit_lecture_categorie" value="{$user.id_categorie}" {if $page.droit_lecture >= $wiki::LECTURE_CATEGORIE}checked="checked"{/if} /> <label for="f_droit_lecture_categorie"><strong>Aux membres de ma catégorie</strong></label> — seuls les membres de la même catégorie que moi pourront voir cette page </dd> <dt><label for="f_droit_ecriture_normal">Cette page peut être modifiée par :</label></dt> <dd> <input type="radio" name="droit_ecriture" id="f_droit_ecriture_normal" value="{$wiki::ECRITURE_NORMAL}" {form_field data=$page name="droit_ecriture" checked=$wiki::ECRITURE_NORMAL} {if $page.droit_lecture >= $wiki::LECTURE_CATEGORIE}disabled="disabled"{/if} /> <label for="f_droit_ecriture_normal">Les membres qui ont accès au wiki en écriture</label> </dd> <dd> <input type="radio" name="droit_ecriture" id="f_droit_ecriture_categorie" value="{$user.id_categorie}" {if $page.droit_ecriture >= $wiki::ECRITURE_CATEGORIE || $page.droit_lecture >= $wiki::LECTURE_CATEGORIE}checked="checked"{/if} {if $page.droit_lecture >= $wiki::LECTURE_CATEGORIE}disabled="disabled"{/if} /> <label for="f_droit_ecriture_categorie">Les membres de ma catégorie</label> </dd> </dl> </fieldset> <fieldset class="wikiEncrypt"> <dl> |
︙ | ︙ | |||
100 101 102 103 104 105 106 | <label for="f_suivi">Suivre les modifications de cette page</label> </dt> *} </dl> </fieldset> <p class="submit"> | | | | | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | <label for="f_suivi">Suivre les modifications de cette page</label> </dt> *} </dl> </fieldset> <p class="submit"> {csrf_field key="wiki_edit_%d"|args:$page.id} <input type="hidden" name="revision_edition" value="{form_field name=revision_edition default=$page.revision}" /> <input type="hidden" name="debut_edition" value="{form_field name=debut_edition default=$time}" /> <input id="f_id" value="{$page.id}" type="hidden" /> <input type="submit" name="save" value="Enregistrer →" /> </p> </form> <script type="text/javascript"> var page_id = '{$page.id}'; {literal} (function() { $('#f_droit_lecture_categorie').onchange = function() { $('#f_droit_ecriture_normal').checked = false; $('#f_droit_ecriture_normal').disabled = true; |
︙ | ︙ |
Modified src/templates/admin/wiki/historique.tpl from [487bc70707] to [456438825d].
|
| | | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {include file="admin/_head.tpl" title="Historique : %s"|args:$page.titre current="wiki"} <ul class="actions"> <li><a href="{$www_url}admin/wiki/?{$page.uri}">Voir la page</a></li> </ul> {if !empty($revisions)} <table class="list wikiRevisions"> {foreach from=$revisions item="rev"} <tr> <td> {if $rev.chiffrement} <del title="Contenu chiffré">chiffré</del> {else} {if $rev.revision == $page.revision} actu {else} <a href="?id={$page.id}&diff={$rev.revision}.{$page.revision}">actu</a> {/if} | {if $rev.revision == 1} diff {else} <a href="?id={$page.id}&diff={$rev.revision-1}.{$rev.revision}">diff</a> {/if} {/if} </td> <th>{$rev.date|date_fr:'d/m/Y à H:i'}</th> <td> {if $user.droits.membres >= Garradin\Membres::DROIT_ACCES} <a href="{$www_url}admin/membres/fiche.php?id={$rev.id_auteur}">{$rev.nom_auteur}</a> {/if} </td> <td class="length"> {$rev.taille} octets {if $rev.revision > 1 && !$rev.chiffrement} {if $rev.diff_taille > 0} <ins>(+{$rev.diff_taille})</ins> {elseif $rev.diff_taille < 0} <del>({$rev.diff_taille})</del> {else} <i>({$rev.diff_taille})</i> {/if} {/if} </td> <td> {if $rev.modification} <em>{$rev.modification}</em> {/if} </td> </tr> {/foreach} </table> {elseif !empty($diff)} <div class="wikiRevision revisionLeft"> <h3>Version du {$rev1.date|date_fr:'d/m/Y à H:i'}</h3> {if $user.droits.membres >= Garradin\Membres::DROIT_ACCES} <h4>De <a href="{$www_url}admin/membres/fiche.php?id={$rev1.id_auteur}">{$rev1.nom_auteur}</a></h4> {/if} {if $rev1.modification} <p><em>{$rev1.modification}</em></p> {/if} </div> <div class="wikiRevision revisionRight"> <h3>Version {if $rev2.revision == $page.revision}actuelle en date{/if} du {$rev2.date|date_fr:'d/m/Y à H:i'}</h3> {if $user.droits.membres >= Garradin\Membres::DROIT_ACCES} <h4>De <a href="{$www_url}admin/membres/fiche.php?id={$rev2.id_auteur}">{$rev2.nom_auteur}</a></h4> {/if} {if $rev2.modification} <p><em>{$rev2.modification}</em></p> {/if} </div> {diff old=$rev1.contenu new=$rev2.contenu} {else} <p class="alert"> Cette page n'a pas d'historique. </p> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/wiki/page.tpl from [3fe9a88ab2] to [453f6fcd36].
1 2 3 4 5 6 7 8 | {if !empty($page.titre) && $can_read} {include file="admin/_head.tpl" title=$page.titre current="wiki" js=1} {else} {include file="admin/_head.tpl" title="Wiki" current="wiki"} {/if} <ul class="actions"> {if $user.droits.wiki >= Garradin\Membres::DROIT_ECRITURE} | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | {if !empty($page.titre) && $can_read} {include file="admin/_head.tpl" title=$page.titre current="wiki" js=1} {else} {include file="admin/_head.tpl" title="Wiki" current="wiki"} {/if} <ul class="actions"> {if $user.droits.wiki >= Garradin\Membres::DROIT_ECRITURE} <li><a href="{$www_url}admin/wiki/creer.php?parent={if $config.accueil_wiki == $page.uri}0{else}{$page.id}{/if}"><strong>Créer une nouvelle page</strong></a></li> {/if} {if $can_edit} <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id}">Éditer</a></li> {/if} {if $can_read && $page && $page.contenu} <li><a href="{$www_url}admin/wiki/historique.php?id={$page.id}">Historique</a> {if $page.droit_lecture == Garradin\Wiki::LECTURE_PUBLIC} <li><a href="{$www_url}{$page.uri}">Voir sur le site</a> {/if} {/if} {if $user.droits.wiki >= Garradin\Membres::DROIT_ADMIN} <li><a href="{$www_url}admin/wiki/supprimer.php?id={$page.id}">Supprimer</a></li> {/if} </ul> {if !$can_read} <p class="alert">Vous n'avez pas le droit de lire cette page.</p> {else} <div class="breadCrumbs"> <ul> <li><a href="./">Wiki</a></li> {if !empty($breadcrumbs)} {foreach from=$breadcrumbs item="crumb"} <li><a href="?{$crumb.uri}">{$crumb.titre}</a></li> {/foreach} {/if} </ul> </div> {if !$page} <p class="error"> Cette page n'existe pas. </p> {if $can_edit} <form method="post" action="{$www_url}admin/wiki/creer.php"> <p class="submit"> {csrf_field key="wiki_create"} <input type="hidden" name="titre" value="{$uri}" /> <input type="submit" name="create" value="Créer cette page" /> </p> </form> {/if} {else} {if !empty($children)} <div class="wikiChildren"> <h4>Dans cette rubrique</h4> <ul> {foreach from=$children item="child"} <li><a href="?{$child.uri}">{$child.titre}</a></li> {/foreach} </ul> </div> {/if} {if !$page.contenu} <p class="alert">Cette page est vide, cliquez sur « Éditer » pour la modifier.</p> |
︙ | ︙ | |||
76 77 78 79 80 81 82 | <script type="text/javascript" src="{$admin_url}static/scripts/wiki-encryption.js"></script> <div id="wikiEncryptedMessage"> <p class="alert">Cette page est chiffrée. <input type="button" onclick="return wikiDecrypt(false);" value="Entrer le mot de passe" /> </p> </div> <div class="wikiContent" style="display: none;" id="wikiEncryptedContent"> | | | | | | | | 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 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | <script type="text/javascript" src="{$admin_url}static/scripts/wiki-encryption.js"></script> <div id="wikiEncryptedMessage"> <p class="alert">Cette page est chiffrée. <input type="button" onclick="return wikiDecrypt(false);" value="Entrer le mot de passe" /> </p> </div> <div class="wikiContent" style="display: none;" id="wikiEncryptedContent"> {$page.contenu.contenu} </div> {else} <div class="wikiContent"> {$page.contenu.contenu|raw|format_wiki|liens_wiki:'?'} </div> {/if} {if !empty($images) || !empty($fichiers)} <div class="wikiFiles"> <h3>Fichiers liés à cette page</h3> {if !empty($images)} <ul class="gallery"> {foreach from=$images item="file"} <li> <figure> <a href="{$file.url}"><img src="{$file.thumb}" alt="" title="{$file.nom}" /></a> </figure> </li> {/foreach} </ul> {/if} {if !empty($fichiers)} <ul class="files"> {foreach from=$fichiers item="file"} <li> <aside class="fichier" class="internal-file"><a href="{$file.url}">{$file.nom}</a> <small>({$file.type}, {$file.taille|format_bytes})</small> </li> {/foreach} </ul> {/if} </div> {/if} <p class="wikiFooter"> Dernière modification le {$page.date_modification|date_fr:'d/m/Y à H:i'} {if $user.droits.membres >= Garradin\Membres::DROIT_ACCES} par <a href="{$www_url}admin/membres/fiche.php?id={$page.contenu.id_auteur}">{$auteur}</a> {/if} </p> {/if} {/if} {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/wiki/recent.tpl from [78ce6c2b53] to [e1e2925aea].
1 2 3 4 5 6 7 | {include file="admin/_head.tpl" title="Pages modifiées récemment" current="wiki/recent"} {if !empty($list)} <table class="list"> <tbody> {foreach from=$list item="page"} <tr> | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | {include file="admin/_head.tpl" title="Pages modifiées récemment" current="wiki/recent"} {if !empty($list)} <table class="list"> <tbody> {foreach from=$list item="page"} <tr> <th><a href="{$www_url}admin/wiki/?{$page.uri}">{$page.titre}</a></th> <td>{$page.date_modification|date_fr:'d/m/Y à H:i'}</td> </tr> {/foreach} </tbody> </table> {pagination url="?p=[ID]" page=$page bypage=$bypage total=$total} {else} <p class="alert">Pas de modification récente.</p> {/if} {include file="admin/_foot.tpl"} |
Modified src/templates/admin/wiki/supprimer.tpl from [c5b76403c8] to [9dc193042d].
|
| | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | {include file="admin/_head.tpl" title="Supprimer : %s"|args:$page.titre current="wiki"} <ul class="actions"> <li><a href="{$www_url}admin/wiki/"><strong>Wiki</strong></a></li> <li><a href="{$www_url}admin/wiki/chercher.php">Rechercher</a></li> <li><a href="{$www_url}admin/wiki/?{$page.uri}">Voir la page</a></li> <li><a href="{$www_url}admin/wiki/editer.php?id={$page.id}">Éditer</a></li> </ul> {if $error} <p class="error"> {$error} </p> {/if} <form method="post" action="{$self_url}"> <fieldset> <legend>Supprimer cette page du wiki ?</legend> <h3 class="warning"> Êtes-vous sûr de vouloir supprimer la page « {$page.titre} » ? </h3> <p class="help"> La page ne pourra pas être supprimée si d'autres pages l'utilisent comme rubrique parente. </p> </fieldset> |
︙ | ︙ |
Modified src/templates/error.tpl from [2cdd29210c] to [a16bde0e90].
︙ | ︙ | |||
30 31 32 33 34 35 36 | </head> <body> <h1>Erreur</h1> <p class="error"> | | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | </head> <body> <h1>Erreur</h1> <p class="error"> {$error} </p> <p> <a href="{$www_url}" onclick="history.back(); return false;">← Retour</a> </p> </body> </html> |
Modified src/templates/index.tpl from [115830f3d6] to [e30875923e].
1 2 3 4 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>{$config.nom_asso}</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> </head> <body> <div class="header"> <h1>{$config.nom_asso}</h1> </div> <div class="page"> <p> {$config.adresse_asso} </p> </div> <p> <a href="admin/">Administration</a> </p> </body> </html> |
Modified src/www/.htaccess from [270ad9f48c] to [9e40080631].
1 2 3 4 | Options -MultiViews -Indexes <IfModule mod_rewrite.c> RewriteEngine on | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Options -MultiViews -Indexes <IfModule mod_rewrite.c> RewriteEngine on RewriteRule admin/plugin/(.*?)/(.*) admin/plugin.php?_p=$1&_u=$2 [QSA,L] RewriteRule f/([\d\w]+)/(.*) file.php?id=$1&file=$2 [QSA,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [QSA,L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 /index.php </IfModule> |
Modified src/www/admin/_inc.php from [0483c8df72] to [8fa8938d39].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <?php namespace Garradin; require_once __DIR__ . '/../../include/init.php'; // Redirection automatique en HTTPS si nécessaire if (PREFER_HTTPS !== true && PREFER_HTTPS >= 2 && empty($_SERVER['HTTPS']) && empty($_POST)) { utils::redirect(str_replace('http://', 'https://', utils::getSelfURL())); exit; } $tpl = Template::getInstance(); $tpl->assign('admin_url', WWW_URL . 'admin/'); | > > | | > > > > > > | > > > | < | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | <?php namespace Garradin; use Garradin\Membres\Session; require_once __DIR__ . '/../../include/init.php'; // Redirection automatique en HTTPS si nécessaire if (PREFER_HTTPS !== true && PREFER_HTTPS >= 2 && empty($_SERVER['HTTPS']) && empty($_POST)) { utils::redirect(str_replace('http://', 'https://', utils::getSelfURL())); exit; } $tpl = Template::getInstance(); $tpl->assign('admin_url', WWW_URL . 'admin/'); $session = Session::get(); if (!defined('Garradin\LOGIN_PROCESS')) { if (!$session) { if (Session::isOTPRequired()) { Utils::redirect('/admin/login_otp.php'); } else { Utils::redirect('/admin/login.php'); } } $tpl->assign('config', Config::getInstance()->getConfig()); $tpl->assign('is_logged', true); $user = $session->getUser(); $tpl->assign('user', $user); $tpl->assign('current', ''); $tpl->assign('plugins_menu', Plugin::listMenu()); if ($session->canAccess('membres', Membres::DROIT_ACCES)) { $tpl->assign('nb_membres', (new Membres)->countAllButHidden()); } } |
Modified src/www/admin/compta/_inc.php from [2d5e4f96d6] to [668ded3763].
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; if ($user['droits']['compta'] < Membres::DROIT_ACCES) { throw new UserException("Vous n'avez pas le droit d'accéder à cette page."); } $comptes = new Compta\Comptes; | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; if ($user['droits']['compta'] < Membres::DROIT_ACCES) { throw new UserException("Vous n'avez pas le droit d'accéder à cette page."); } $comptes = new Compta\Comptes; $tpl->assign('id_caisse', Compta\Comptes::CAISSE); |
Modified src/www/admin/compta/categories/ajouter.php from [5d7dfbfcec] to [75ac6668be].
︙ | ︙ | |||
45 46 47 48 49 50 51 52 53 | } } $tpl->assign('error', $error); $tpl->assign('type', isset($_POST['type']) ? Utils::post('type') : Compta\Categories::RECETTES); $tpl->assign('comptes', $comptes->listTree()); $tpl->display('admin/compta/categories/ajouter.tpl'); | > < < | 45 46 47 48 49 50 51 52 53 54 | } } $tpl->assign('error', $error); $tpl->assign('type', isset($_POST['type']) ? Utils::post('type') : Compta\Categories::RECETTES); $tpl->assign('comptes', $comptes->listTree()); $tpl->assign('categories', $cats); $tpl->display('admin/compta/categories/ajouter.tpl'); |
Modified src/www/admin/config/_inc.php from [04e5b052de] to [3f3d512f92].
1 2 3 4 5 6 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; | | | < < | < | 1 2 3 4 5 6 7 8 9 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); $tpl->assign('garradin_website', WEBSITE); |
Modified src/www/admin/config/donnees.php from [f33ac12b59] to [b991b2d410].
1 2 3 4 5 6 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $s = new Sauvegarde; | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $s = new Sauvegarde; $code = $error = false; if (Utils::post('config')) { if (!Utils::CSRF_check('backup_config')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } |
︙ | ︙ | |||
61 62 63 64 65 66 67 | if (!Utils::CSRF_check('backup_manage')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { | | | | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | if (!Utils::CSRF_check('backup_manage')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $r = $s->restoreFromLocal(Utils::post('file')); Utils::redirect('/admin/config/donnees.php?ok=restore&code=' . (int)$r); } catch (UserException $e) { $error = $e->getMessage(); } } } elseif (Utils::post('remove')) { |
︙ | ︙ | |||
92 93 94 95 96 97 98 99 | { if (!Utils::CSRF_check('backup_restore')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { | > > > | | > > > | 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 | { if (!Utils::CSRF_check('backup_restore')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { // Ignorer la vérification d'intégrité si autorisé et demandé $check = (ALLOW_MODIFIED_IMPORT && Utils::post('force_import')) ? false : true; try { $r = $s->restoreFromUpload($_FILES['file'], $user->id, $check); Utils::redirect('/admin/config/donnees.php?ok=restore&code=' . (int)$r); } catch (UserException $e) { $error = $e->getMessage(); $code = $e->getCode(); } } } $tpl->assign('error', $error); $tpl->assign('code', $code); $tpl->assign('ok_code', Utils::get('code')); $tpl->assign('ok', Utils::get('ok')); $tpl->assign('liste', $s->getList()); $tpl->assign('max_file_size', Utils::getMaxUploadSize()); $tpl->assign('db_size', $s->getDBSize()); $tpl->assign('files_size', $s->getDBFilesSize()); $tpl->display('admin/config/donnees.tpl'); |
Modified src/www/admin/config/import.php from [84fe620fc0] to [0d90db7427].
1 2 3 4 5 6 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $tpl->display('admin/config/import.tpl'); | < < | 1 2 3 4 5 6 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $tpl->display('admin/config/import.tpl'); |
Modified src/www/admin/config/index.php from [8758269459] to [1aa6f266e6].
︙ | ︙ | |||
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | $error = $e->getMessage(); } } } $tpl->assign('error', $error); $tpl->assign('garradin_version', garradin_version() . ' [' . (garradin_manifest() ?: 'release') . ']'); $tpl->assign('php_version', phpversion()); $v = \SQLite3::version(); $tpl->assign('sqlite_version', $v['versionString']); $tpl->assign('pays', Utils::getCountryList()); $cats = new Membres\Categories; $tpl->assign('membres_cats', $cats->listSimple()); | > > > > > > > < < | < < < < | 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 | $error = $e->getMessage(); } } } $tpl->assign('error', $error); $server_time = time(); $ntp_time = \KD2\Security_OTP::getTimeFromNTP(NTP_SERVER); $diff = $server_time - $ntp_time; $tpl->assign('garradin_version', garradin_version() . ' [' . (garradin_manifest() ?: 'release') . ']'); $tpl->assign('php_version', phpversion()); $tpl->assign('has_gpg_support', \KD2\Security::canUseEncryption()); $tpl->assign('server_time', $server_time); $tpl->assign('time_diff', $diff); $v = \SQLite3::version(); $tpl->assign('sqlite_version', $v['versionString']); $tpl->assign('pays', Utils::getCountryList()); $cats = new Membres\Categories; $tpl->assign('membres_cats', $cats->listSimple()); $tpl->assign('champs', $config->get('champs_membres')->getList(true)); $tpl->display('admin/config/index.tpl'); |
Modified src/www/admin/config/membres.php from [d2b6067eb1] to [a7dd2bb69f].
1 2 3 4 5 6 7 8 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $error = false; // Restauration de ce qui était en session | > > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $error = false; $membres = new Membres; // Restauration de ce qui était en session if ($champs = $session->sessionGet('champs_membres')) { $champs = new Membres\Champs($champs); } else { // Il est nécessaire de créer une nouvelle instance ici, sinon // l'enregistrement des modifs ne marchera pas car les deux instances seront identiques. |
︙ | ︙ | |||
31 32 33 34 35 36 37 | { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { if (!empty($_POST['reset'])) { | | | | 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 | { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { if (!empty($_POST['reset'])) { $session->sessionStore('champs_membres', null); Utils::redirect('/admin/config/membres.php'); } elseif (!empty($_POST['review'])) { try { $nouveau_champs = Utils::post('champs'); foreach ($nouveau_champs as $key=>&$cfg) { $cfg['type'] = $champs->get($key, 'type'); } $champs->setAll($nouveau_champs); $session->sessionStore('champs_membres', (string)$champs); Utils::redirect('/admin/config/membres.php?review'); } catch (UserException $e) { $error = $e->getMessage(); } |
︙ | ︙ | |||
92 93 94 95 96 97 98 | { $config['options'] = ['Première option']; } $champs->add($new, $config); } | | | | 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 | { $config['options'] = ['Première option']; } $champs->add($new, $config); } $session->sessionStore('champs_membres', (string) $champs); Utils::redirect('/admin/config/membres.php?added'); } catch (UserException $e) { $error = $e->getMessage(); } } elseif (!empty($_POST['save'])) { try { $champs->save(); $session->sessionStore('champs_membres', null); Utils::redirect('/admin/config/membres.php?ok'); } catch (UserException $e) { $error = $e->getMessage(); } } |
︙ | ︙ | |||
133 134 135 136 137 138 139 | $tpl->register_modifier('get_type', function ($type) use ($types) { return $types[$type]; }); $tpl->assign('csrf_name', Utils::CSRF_field_name('config_membres')); $tpl->assign('csrf_value', Utils::CSRF_create('config_membres')); | | | | 135 136 137 138 139 140 141 142 143 144 | $tpl->register_modifier('get_type', function ($type) use ($types) { return $types[$type]; }); $tpl->assign('csrf_name', Utils::CSRF_field_name('config_membres')); $tpl->assign('csrf_value', Utils::CSRF_create('config_membres')); $tpl->assign('title', 'Configuration — ' . (isset($_GET['review']) ? 'Confirmer les changements' : 'Fiche membres')); $tpl->display('admin/config/membres.tpl'); |
Modified src/www/admin/config/site.php from [0869dac1c0] to [548ea357b2].
︙ | ︙ | |||
84 85 86 87 88 89 90 | $error = "Impossible d'enregistrer le squelette."; } } } $tpl->assign('edit', ['file' => trim(Utils::get('edit')), 'content' => $source]); $tpl->assign('csrf_key', $csrf_key); | < < | | < | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | $error = "Impossible d'enregistrer le squelette."; } } } $tpl->assign('edit', ['file' => trim(Utils::get('edit')), 'content' => $source]); $tpl->assign('csrf_key', $csrf_key); } $tpl->assign('sources', Squelette::listSources()); $tpl->assign('reset_ok', Utils::get('reset_ok')); $tpl->assign('error', $error); $tpl->display('admin/config/site.tpl'); |
Modified src/www/admin/index.php from [7c054dec30] to [b5439ef247].
1 2 3 4 5 6 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $cats = new Membres\Categories; | > | | | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $cats = new Membres\Categories; $categorie = $cats->get($user->id_categorie); $tpl->assign('categorie', $categorie); $wiki = new Wiki; $page = $wiki->getByURI($config->get('accueil_connexion')); $tpl->assign('page', $page); $cats = new Membres\Categories; $categorie = $cats->get($user->id_categorie); $cotisations = new Membres\Cotisations; if (!empty($categorie->id_cotisation_obligatoire)) { $tpl->assign('cotisation', $cotisations->isMemberUpToDate($user->id, $categorie->id_cotisation_obligatoire)); } else { $tpl->assign('cotisation', false); } $tpl->display('admin/index.tpl'); flush(); // Si pas de cron on réalise les tâches automatisées à ce moment-là // c'est pas idéal mais mieux que rien if (!USE_CRON) { require_once ROOT . '/cron.php'; } |
Modified src/www/admin/install.php from [469e7fae31] to [a29cc0c7e4].
︙ | ︙ | |||
31 32 33 34 35 36 37 | echo "Pour plus d'informations consulter http://dev.kd2.org/garradin/Probl%C3%A8mes%20fr%C3%A9quents\n"; } exit; } test_requis( | | | < < < < < | 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 | echo "Pour plus d'informations consulter http://dev.kd2.org/garradin/Probl%C3%A8mes%20fr%C3%A9quents\n"; } exit; } test_requis( version_compare(phpversion(), '5.6', '>='), 'PHP 5.6 ou supérieur requis. PHP version ' . phpversion() . ' installée.' ); test_requis( defined('CRYPT_BLOWFISH') && CRYPT_BLOWFISH, 'L\'algorithme de hashage de mot de passe Blowfish n\'est pas présent (pas installé ou pas compilé).' ); test_requis( class_exists('SQLite3'), 'Le module de base de données SQLite3 n\'est pas disponible.' ); $v = \SQLite3::version(); test_requis( version_compare($v['versionString'], '3.7.4', '>='), 'SQLite3 version 3.7.4 ou supérieur requise. Version installée : ' . $v['versionString'] ); test_requis( file_exists(__DIR__ . '/../../include/lib/KD2'), 'Librairie KD2 non disponible.' ); const INSTALL_PROCESS = true; |
︙ | ︙ |
Modified src/www/admin/login.php from [aecfcafaf0] to [5749aca48a].
1 2 3 4 5 6 7 | <?php namespace Garradin; const LOGIN_PROCESS = true; require_once __DIR__ . '/_inc.php'; | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <?php namespace Garradin; const LOGIN_PROCESS = true; require_once __DIR__ . '/_inc.php'; if ($session) { Utils::redirect('/admin/'); } // Relance session_start et renvoie une image de 1px transparente if (isset($_GET['keepSessionAlive'])) { Session::refresh(); header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Content-Type: image/gif'); echo base64_decode("R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="); |
︙ | ︙ | |||
31 32 33 34 35 36 37 | if (!Utils::CSRF_check('login')) { $error = 'OTHER'; } else { if (Utils::post('id') && Utils::post('passe') | | | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | if (!Utils::CSRF_check('login')) { $error = 'OTHER'; } else { if (Utils::post('id') && Utils::post('passe') && Membres\Session::login(Utils::post('id'), Utils::post('passe'), (bool) Utils::post('permanent'))) { Utils::redirect('/admin/'); } $error = 'LOGIN'; } } |
︙ | ︙ |
Added src/www/admin/login_otp.php version [a263b860c3].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | <?php namespace Garradin; const LOGIN_PROCESS = true; require_once __DIR__ . '/_inc.php'; if ($membres->isLogged() && !$membres->isOTPRequired()) { Utils::redirect('/admin/'); } $error = false; if (Utils::post('code')) { if (!Utils::CSRF_check('otp')) { $error = 'OTHER'; } else { if ($membres->loginOTP(Utils::post('code'))) { Utils::redirect('/admin/'); } $error = 'LOGIN'; } } $tpl->assign('error', $error); $tpl->assign('time', time()); $tpl->display('admin/login_otp.tpl'); |
Modified src/www/admin/logout.php from [fc64d98efd] to [2dab3d0640].
1 2 3 4 5 6 | <?php namespace Garradin; const LOGIN_PROCESS = true; require_once __DIR__ . '/_inc.php'; | | < < | 1 2 3 4 5 6 7 8 | <?php namespace Garradin; const LOGIN_PROCESS = true; require_once __DIR__ . '/_inc.php'; $session->logout(); Utils::redirect('/'); |
Added src/www/admin/membres/_inc.php version [def8326778].
> > > > > > > > | 1 2 3 4 5 6 7 8 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ACCES); $membres = new Membres; |
Modified src/www/admin/membres/action.php from [5fee09a6d1] to [42ab6e796b].
1 2 3 | <?php namespace Garradin; | | | < < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); if (empty($_POST['selected'])) { throw new UserException("Aucun membre sélectionné."); } foreach ($_POST['selected'] as &$id) { $id = (int) $id; // On ne permet pas d'action collective sur l'utilisateur courant pour éviter les risques // d'erreur genre "oh je me suis supprimé du coup j'ai plus accès à rien" if ($id == $user->id) { throw new UserException("Il n'est pas possible de se modifier ou supprimer soi-même."); } } $error = false; |
︙ | ︙ |
Modified src/www/admin/membres/ajouter.php from [90216da4e4] to [bced1ce071].
1 2 3 | <?php namespace Garradin; | | | < < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); $cats = new Membres\Categories; $champs = $config->get('champs_membres'); $error = false; if (!empty($_POST['save'])) { if (!Utils::CSRF_check('new_member')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } elseif (Utils::post('passe') != Utils::post('repasse')) { $error = 'La vérification ne correspond pas au mot de passe.'; } else { try { if ($session->canAccess('membres', Membres::DROIT_ADMIN)) { $id_categorie = Utils::post('id_categorie'); } else { $id_categorie = $config->get('categorie_membres'); } |
︙ | ︙ | |||
58 59 60 61 62 63 64 | $tpl->assign('passphrase', Utils::suggestPassword()); $tpl->assign('champs', $champs->getAll()); $tpl->assign('membres_cats', $cats->listSimple()); $tpl->assign('current_cat', Utils::post('id_categorie') ?: $config->get('categorie_membres')); $tpl->display('admin/membres/ajouter.tpl'); | < < | 55 56 57 58 59 60 61 | $tpl->assign('passphrase', Utils::suggestPassword()); $tpl->assign('champs', $champs->getAll()); $tpl->assign('membres_cats', $cats->listSimple()); $tpl->assign('current_cat', Utils::post('id_categorie') ?: $config->get('categorie_membres')); $tpl->display('admin/membres/ajouter.tpl'); |
Modified src/www/admin/membres/cat_modifier.php from [33afb1fa19] to [ac24a4dd6a].
1 2 3 | <?php namespace Garradin; | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); $cats = new Membres\Categories; if (empty($_GET['id']) || !is_numeric($_GET['id'])) { throw new UserException("Argument du numéro de catégorie manquant."); } |
︙ | ︙ | |||
46 47 48 49 50 51 52 | 'cacher' => (int) Utils::post('cacher'), 'id_cotisation_obligatoire' => (int) Utils::post('id_cotisation_obligatoire'), ]; // Ne pas permettre de modifier la connexion, l'accès à la config et à la gestion des membres // pour la catégorie du membre qui édite les catégories, sinon il pourrait s'empêcher // de se connecter ou n'avoir aucune catégorie avec le droit de modifier les catégories ! | | | | > > | 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 | 'cacher' => (int) Utils::post('cacher'), 'id_cotisation_obligatoire' => (int) Utils::post('id_cotisation_obligatoire'), ]; // Ne pas permettre de modifier la connexion, l'accès à la config et à la gestion des membres // pour la catégorie du membre qui édite les catégories, sinon il pourrait s'empêcher // de se connecter ou n'avoir aucune catégorie avec le droit de modifier les catégories ! if ($cat->id == $user->id_categorie) { $data['droit_connexion'] = Membres::DROIT_ACCES; $data['droit_config'] = Membres::DROIT_ADMIN; $data['droit_membres'] = Membres::DROIT_ADMIN; } try { $cats->edit($id, $data); if ($id == $user->id_categorie) { $membres->updateSessionData(); } Utils::redirect('/admin/membres/categories.php'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('cat', $cat); $tpl->assign('error', $error); $tpl->assign('readonly', $cat->id == $user->id_categorie ? 'disabled="disabled"' : ''); $cotisations = new Cotisations; $tpl->assign('cotisations', $cotisations->listCurrent()); $tpl->assign('membres', $membres); $tpl->display('admin/membres/cat_modifier.tpl'); |
Modified src/www/admin/membres/cat_supprimer.php from [0996b48d07] to [9693b6dec4].
1 2 3 | <?php namespace Garradin; | | | < < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); $cats = new Membres\Categories; if (empty($_GET['id']) || !is_numeric($_GET['id'])) { throw new UserException("Argument du numéro de catégorie manquant."); } $id = (int) $_GET['id']; $cat = $cats->get($id); if (!$cat) { throw new UserException("Cette catégorie n'existe pas."); } if ($cat->id == $user->id_categorie) { throw new UserException("Vous ne pouvez pas supprimer votre catégorie."); } $error = false; if (!empty($_POST['delete'])) |
︙ | ︙ | |||
50 51 52 53 54 55 56 | } } $tpl->assign('cat', $cat); $tpl->assign('error', $error); $tpl->display('admin/membres/cat_supprimer.tpl'); | < < | 47 48 49 50 51 52 53 | } } $tpl->assign('cat', $cat); $tpl->assign('error', $error); $tpl->display('admin/membres/cat_supprimer.tpl'); |
Modified src/www/admin/membres/categories.php from [2d57cb637e] to [40bd489c9b].
1 2 3 | <?php namespace Garradin; | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); $cats = new Membres\Categories; $error = false; if (!empty($_POST['save'])) { |
︙ | ︙ | |||
35 36 37 38 39 40 41 | } $tpl->assign('error', $error); $tpl->assign('liste', $cats->listCompleteWithStats()); $tpl->display('admin/membres/categories.tpl'); | < < | 32 33 34 35 36 37 38 | } $tpl->assign('error', $error); $tpl->assign('liste', $cats->listCompleteWithStats()); $tpl->display('admin/membres/categories.tpl'); |
Modified src/www/admin/membres/cotisations.php from [7c4f24c856] to [54685c9fe6].
1 2 3 | <?php namespace Garradin; | | | < < < | | | | | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); if (empty($_GET['id']) || !is_numeric($_GET['id'])) { throw new UserException("Argument du numéro de membre manquant."); } $id = (int) $_GET['id']; $membre = $membres->get($id); if (!$membre) { throw new UserException("Ce membre n'existe pas."); } $cats = new Membres\Categories; $categorie = $cats->get($membre->id_categorie); $tpl->assign('categorie', $categorie); $cotisations = new Membres\Cotisations; if (!empty($categorie->id_cotisation_obligatoire)) { $tpl->assign('cotisation', $cotisations->isMemberUpToDate($membre->id, $categorie->id_cotisation_obligatoire)); } else { $tpl->assign('cotisation', false); } $tpl->assign('nb_activites', $cotisations->countForMember($membre->id)); $tpl->assign('cotisations', $cotisations->listForMember($membre->id)); $tpl->assign('cotisations_membre', $cotisations->listSubscriptionsForMember($membre->id)); $tpl->assign('membre', $membre); $tpl->display('admin/membres/cotisations.tpl'); |
Modified src/www/admin/membres/cotisations/ajout.php from [28e15bf3fd] to [9893f3db2f].
1 2 3 | <?php namespace Garradin; | | | < < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); $membre = false; if (!empty($_GET['id']) && is_numeric($_GET['id'])) { $membre = $membres->get((int) $_GET['id']); if (!$membre) { throw new UserException("Ce membre n'existe pas."); } $cats = new Membres\Categories; $categorie = $cats->get($membre->id_categorie); } else { $categorie = ['id_cotisation_obligatoire' => false]; } $cotisations = new Cotisations; |
︙ | ︙ | |||
44 45 46 47 48 49 50 | else { try { $data = [ 'date' => Utils::post('date'), 'id_cotisation' => Utils::post('id_cotisation'), 'id_membre' => Utils::post('id_membre'), | | | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | else { try { $data = [ 'date' => Utils::post('date'), 'id_cotisation' => Utils::post('id_cotisation'), 'id_membre' => Utils::post('id_membre'), 'id_auteur' => $user->id, 'montant' => Utils::post('montant'), 'moyen_paiement' => Utils::post('moyen_paiement'), 'numero_cheque' => Utils::post('numero_cheque'), 'banque' => Utils::post('banque'), ]; $m_cotisations->add($data); |
︙ | ︙ | |||
87 88 89 90 91 92 93 | $co = $cotisations->get(Utils::get('cotisation')); if (!$co) { throw new UserException("La cotisation indiquée en paramètre n'existe pas."); } | | | | | | | | | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | $co = $cotisations->get(Utils::get('cotisation')); if (!$co) { throw new UserException("La cotisation indiquée en paramètre n'existe pas."); } $tpl->assign('default_co', $co->id); $tpl->assign('default_compta', $co->id_categorie_compta); $tpl->assign('default_amount', $co->montant); } elseif ($membre) { if (!empty($categorie->id_cotisation_obligatoire)) { $co = $cotisations->get($categorie->id_cotisation_obligatoire); $tpl->assign('default_co', $co->id); $tpl->assign('default_amount', $co->montant); } } $tpl->display('admin/membres/cotisations/ajout.tpl'); |
Modified src/www/admin/membres/cotisations/gestion/modifier.php from [0b44bd3324] to [e36b905d94].
1 2 3 | <?php namespace Garradin; | | | < < < | | | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | <?php namespace Garradin; require_once __DIR__ . '/../../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); if (!Utils::get('id') || !is_numeric(Utils::get('id'))) { throw new UserException("Argument du numéro de cotisation manquant."); } $cotisations = new Cotisations; $co = $cotisations->get(Utils::get('id')); $cats = new Compta\Categories; if (!$co) { throw new UserException("Cette cotisation n'existe pas."); } $error = false; if (!empty($_POST['save'])) { if (!Utils::CSRF_check('edit_co_' . $co->id)) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $duree = Utils::post('periodicite') == 'jours' ? (int) Utils::post('duree') : null; $debut = Utils::post('periodicite') == 'date' ? Utils::post('debut') : null; $fin = Utils::post('periodicite') == 'date' ? Utils::post('fin') : null; $id_cat = Utils::post('categorie') ? (int) Utils::post('id_categorie_compta') : null; $cotisations->edit($co->id, [ 'intitule' => Utils::post('intitule'), 'description' => Utils::post('description'), 'montant' => (float) Utils::post('montant'), 'duree' => $duree, 'debut' => $debut, 'fin' => $fin, 'id_categorie_compta'=> $id_cat, ]); Utils::redirect('/admin/membres/cotisations/'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $co->periodicite = $co->duree ? 'jours' : ($co->debut ? 'date' : 'ponctuel'); $co->categorie = $co->id_categorie_compta ? 1 : 0; $tpl->assign('cotisation', $co); $tpl->assign('categories', $cats->getList(Compta\Categories::RECETTES)); $tpl->display('admin/membres/cotisations/gestion/modifier.tpl'); |
Modified src/www/admin/membres/cotisations/gestion/rappel_modifier.php from [b4298806b4] to [ca9a91b7b8].
1 2 3 | <?php namespace Garradin; | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/../../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); if (!Utils::get('id') || !is_numeric(Utils::get('id'))) { throw new UserException("Argument du numéro de rappel manquant."); } $rappels = new Rappels; |
︙ | ︙ | |||
24 25 26 27 28 29 30 | $cotisations = new Cotisations; $error = false; if (!empty($_POST['save'])) { | | | | > | > < < | 21 22 23 24 25 26 27 28 29 30 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 | $cotisations = new Cotisations; $error = false; if (!empty($_POST['save'])) { if (!Utils::CSRF_check('edit_rappel_' . $rappel->id)) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { if (Utils::post('delai_choix') == 0) $delai = 0; elseif (Utils::post('delai_choix') > 0) $delai = (int) Utils::post('delai_post'); else $delai = -(int) Utils::post('delai_pre'); $rappels->edit($rappel->id, [ 'sujet' => Utils::post('sujet'), 'texte' => Utils::post('texte'), 'delai' => $delai, 'id_cotisation' => Utils::post('id_cotisation'), ]); Utils::redirect('/admin/membres/cotisations/gestion/rappels.php'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $rappel->delai_pre = $rappel->delai_post = (abs($rappel->delai) ?: 30); $rappel->delai_choix = ($rappel->delai == 0) ? 0 : ($rappel->delai > 0 ? 1 : -1); $tpl->assign('rappel', $rappel); $tpl->assign('cotisations', $cotisations->listCurrent()); $tpl->display('admin/membres/cotisations/gestion/rappel_modifier.tpl'); |
Modified src/www/admin/membres/cotisations/gestion/rappel_supprimer.php from [4ebdec86bd] to [4e4905ac77].
1 2 3 | <?php namespace Garradin; | | | < < < | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <?php namespace Garradin; require_once __DIR__ . '/../../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); if (!Utils::get('id') || !is_numeric(Utils::get('id'))) { throw new UserException("Argument du numéro de rappel manquant."); } $rappels = new Rappels; $rappel = $rappels->get(Utils::get('id')); if (!$rappel) { throw new UserException("Ce rappel n'existe pas."); } $error = false; if (!empty($_POST['delete'])) { if (!Utils::CSRF_check('delete_rappel_' . $rappel->id)) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $rappels->delete($rappel->id, (bool) Utils::post('delete_history')); Utils::redirect('/admin/membres/cotisations/gestion/rappels.php'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $tpl->assign('rappel', $rappel); $tpl->display('admin/membres/cotisations/gestion/rappel_supprimer.tpl'); |
Modified src/www/admin/membres/cotisations/gestion/rappels.php from [5e80b880be] to [88eacf9866].
1 2 3 | <?php namespace Garradin; | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/../../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); $rappels = new Rappels; $cotisations = new Cotisations; $error = false; if (!empty($_POST['save'])) |
︙ | ︙ | |||
52 53 54 55 56 57 58 | $tpl->assign('default_subject', '[#NOM_ASSO] Échéance de cotisation'); $tpl->assign('default_text', "Bonjour #IDENTITE,\n\nVotre cotisation arrive à échéance dans #NB_JOURS jours.\n\n" . "Merci de nous contacter pour renouveler votre cotisation.\n\nCordialement.\n\n" . "--\n#NOM_ASSO\n#ADRESSE_ASSO\nE-Mail : #EMAIL_ASSO\nSite web : #SITE_ASSO"); $tpl->display('admin/membres/cotisations/gestion/rappels.tpl'); | < < | 49 50 51 52 53 54 55 | $tpl->assign('default_subject', '[#NOM_ASSO] Échéance de cotisation'); $tpl->assign('default_text', "Bonjour #IDENTITE,\n\nVotre cotisation arrive à échéance dans #NB_JOURS jours.\n\n" . "Merci de nous contacter pour renouveler votre cotisation.\n\nCordialement.\n\n" . "--\n#NOM_ASSO\n#ADRESSE_ASSO\nE-Mail : #EMAIL_ASSO\nSite web : #SITE_ASSO"); $tpl->display('admin/membres/cotisations/gestion/rappels.tpl'); |
Modified src/www/admin/membres/cotisations/gestion/supprimer.php from [a1937c7779] to [7d60f16901].
1 2 3 | <?php namespace Garradin; | | | < < < | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | <?php namespace Garradin; require_once __DIR__ . '/../../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); if (!Utils::get('id') || !is_numeric(Utils::get('id'))) { throw new UserException("Argument du numéro de cotisation manquant."); } $cotisations = new Cotisations; $co = $cotisations->get(Utils::get('id')); if (!$co) { throw new UserException("Cette cotisation n'existe pas."); } $error = false; if (!empty($_POST['delete'])) { if (!Utils::CSRF_check('delete_co_' . $co->id)) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $cotisations->delete($co->id); Utils::redirect('/admin/membres/cotisations/'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $tpl->assign('cotisation', $co); $tpl->display('admin/membres/cotisations/gestion/supprimer.tpl'); |
Modified src/www/admin/membres/cotisations/index.php from [0477202564] to [1dbf7ffdee].
1 2 3 | <?php namespace Garradin; | | | < < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); $cotisations = new Cotisations; if ($session->canAccess('membres', Membres::DROIT_ADMIN)) { $cats = new Compta\Categories; $error = false; if (!empty($_POST['save'])) { |
︙ | ︙ |
Modified src/www/admin/membres/cotisations/rappels.php from [1b6ad513bd] to [bbdea97b0c].
1 2 3 | <?php namespace Garradin; | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); if (empty($_GET['id']) || !is_numeric($_GET['id'])) { throw new UserException("Argument du numéro de membre manquant."); } $id = (int) $_GET['id']; |
︙ | ︙ | |||
25 26 27 28 29 30 31 | $re = new Rappels_Envoyes; $cm = new Membres\Cotisations; $error = false; if (Utils::post('save')) { | | | | | | > | 22 23 24 25 26 27 28 29 30 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 | $re = new Rappels_Envoyes; $cm = new Membres\Cotisations; $error = false; if (Utils::post('save')) { if (!Utils::CSRF_check('add_rappel_'.$membre->id)) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $re->add([ 'id_rappel' => NULL, 'id_cotisation' => Utils::post('id_cotisation'), 'id_membre' => $membre->id, 'media' => Utils::post('media'), 'date' => Utils::post('date'), ]); Utils::redirect('/admin/membres/cotisations/rappels.php?id=' . $membre->id . '&ok'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $tpl->assign('ok', isset($_GET['ok'])); $tpl->assign('membre', $membre); $tpl->assign('cotisations', $cm->listSubscriptionsForMember($membre->id)); $tpl->assign('default_date', date('Y-m-d')); $tpl->assign('rappels', $re->listForMember($membre->id)); $tpl->assign('rappels_envoyes', $re); $tpl->display('admin/membres/cotisations/rappels.tpl'); |
Modified src/www/admin/membres/cotisations/supprimer.php from [46518bea34] to [5883297a40].
1 2 3 | <?php namespace Garradin; | | | < < < | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); $membre = false; $cotisations = new Cotisations; $m_cotisations = new Membres\Cotisations; if (empty($_GET['id']) || !is_numeric($_GET['id'])) { throw new UserException("Argument du numéro de cotisation membre manquant."); } $id = (int) $_GET['id']; $co = $m_cotisations->get($id); if (!$co) { throw new UserException("Cette cotisation membre n'existe pas."); } $membre = $membres->get($co->id_membre); if (!$membre) { throw new UserException("Le membre lié à la cotisation n'existe pas ou plus."); } $error = false; if (!empty($_POST['delete'])) { if (!Utils::CSRF_check('del_cotisation_' . $co->id)) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $m_cotisations->delete($co->id); Utils::redirect('/admin/membres/cotisations.php?id=' . $membre->id); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $tpl->assign('membre', $membre); $tpl->assign('cotisation', $co); $tpl->assign('nb_operations', $m_cotisations->countOperationsCompta($co->id)); $tpl->display('admin/membres/cotisations/supprimer.tpl'); |
Modified src/www/admin/membres/cotisations/voir.php from [bc9f5b7431] to [b49f8dfa2f].
1 2 3 | <?php namespace Garradin; | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/../_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); if (empty($_GET['id']) || !is_numeric($_GET['id'])) { throw new UserException("Argument du numéro de cotisation manquant."); } $id = (int) $_GET['id']; |
︙ | ︙ | |||
25 26 27 28 29 30 31 | throw new UserException("Cette cotisation n'existe pas."); } $page = (int) Utils::get('p') ?: 1; $tpl->assign('page', $page); $tpl->assign('bypage', Membres\Cotisations::ITEMS_PER_PAGE); | | | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | throw new UserException("Cette cotisation n'existe pas."); } $page = (int) Utils::get('p') ?: 1; $tpl->assign('page', $page); $tpl->assign('bypage', Membres\Cotisations::ITEMS_PER_PAGE); $tpl->assign('total', $m_cotisations->countMembersForCotisation($co->id)); $tpl->assign('pagination_url', Utils::getSelfUrl(true) . '?id=' . $co->id . '&p=[ID]'); $tpl->assign('cotisation', $co); $tpl->assign('order', Utils::get('o') ?: 'date'); $tpl->assign('desc', !isset($_GET['a'])); $tpl->assign('liste', $m_cotisations->listMembersForCotisation( $co->id, $page, Utils::get('o'), isset($_GET['a']) ? false : true)); $tpl->display('admin/membres/cotisations/voir.tpl'); |
Modified src/www/admin/membres/fiche.php from [5ba9e3f633] to [1a6a56f8e5].
1 2 3 | <?php namespace Garradin; | | | < < < | | | | | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); if (empty($_GET['id']) || !is_numeric($_GET['id'])) { throw new UserException("Argument du numéro de membre manquant."); } $id = (int) $_GET['id']; $membre = $membres->get($id); if (!$membre) { throw new UserException("Ce membre n'existe pas."); } $champs = $config->get('champs_membres'); $tpl->assign('champs', $champs->getAll()); $cats = new Membres\Categories; $categorie = $cats->get($membre->id_categorie); $tpl->assign('categorie', $categorie); $cotisations = new Membres\Cotisations; if (!empty($categorie->id_cotisation_obligatoire)) { $tpl->assign('cotisation', $cotisations->isMemberUpToDate($membre->id, $categorie->id_cotisation_obligatoire)); } else { $tpl->assign('cotisation', false); } $tpl->assign('nb_activites', $cotisations->countForMember($membre->id)); if ($session->canAccess('compta', Membres::DROIT_ACCES)) { $journal = new Compta\Journal; $tpl->assign('nb_operations', $journal->countForMember($membre->id)); } $tpl->assign('membre', $membre); $tpl->display('admin/membres/fiche.tpl'); |
Modified src/www/admin/membres/import.php from [2c608782f6] to [af2f9a0078].
1 2 3 | <?php namespace Garradin; | | | < < < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); $import = new Membres\Import; if (isset($_GET['export'])) { header('Content-type: application/csv'); header('Content-Disposition: attachment; filename="Export membres - ' . $config->get('nom_asso') . ' - ' . date('Y-m-d') . '.csv"'); $import->toCSV(); exit; } $error = false; $champs = $config->get('champs_membres')->getAll(); $champs->date_inscription = (object) ['title' => 'Date inscription', 'type' => 'date']; if (Utils::post('import')) { // FIXME if (false && !Utils::CSRF_check('membres_import')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; |
︙ | ︙ | |||
63 64 65 66 67 68 69 | $tpl->assign('ok', isset($_GET['ok']) ? true : false); $tpl->assign('garradin_champs', $champs); $tpl->assign('galette_champs', $import->galette_fields); $tpl->assign('translate', Utils::post('galette_translate')); $tpl->display('admin/membres/import.tpl'); | < < | 60 61 62 63 64 65 66 | $tpl->assign('ok', isset($_GET['ok']) ? true : false); $tpl->assign('garradin_champs', $champs); $tpl->assign('galette_champs', $import->galette_fields); $tpl->assign('translate', Utils::post('galette_translate')); $tpl->display('admin/membres/import.tpl'); |
Modified src/www/admin/membres/index.php from [67dc558d96] to [b79c4341ba].
1 2 3 | <?php namespace Garradin; | | < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; // Recherche de membre (pour ceux qui n'ont qu'un accès à la liste des membres) if (Utils::get('r')) { $recherche = trim(Utils::get('r')); $result = $membres->search($config->get('champ_identite'), $recherche); |
︙ | ︙ | |||
27 28 29 30 31 32 33 | $membres_cats_cachees = $cats->listHidden(); $cat_id = (int) Utils::get('cat') ?: 0; $page = (int) Utils::get('p') ?: 1; if ($cat_id) { | | | | | | | | | 21 22 23 24 25 26 27 28 29 30 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 | $membres_cats_cachees = $cats->listHidden(); $cat_id = (int) Utils::get('cat') ?: 0; $page = (int) Utils::get('p') ?: 1; if ($cat_id) { if ($session->canAccess('membres', Membres::DROIT_ECRITURE) && array_key_exists($cat_id, $membres_cats_cachees)) { $cat_id = 0; } } if (!$cat_id) { $cat_id = array_diff(array_keys((array) $membres_cats), array_keys((array) $membres_cats_cachees)); } // Par défaut le champ de tri c'est l'identité $order = $config->get('champ_identite'); $desc = false; if (Utils::get('o')) $order = Utils::get('o'); if (isset($_GET['d'])) $desc = true; $fields = $champs->getListedFields(); // Vérifier que le champ de tri existe bien dans la table if ($order != 'id' && !isset($fields->$order)) { // Sinon par défaut c'est le premier champ de la table qui fait le tri $order = $champs->getFirstListed(); } $tpl->assign('order', $order); $tpl->assign('desc', $desc); $tpl->assign('champs', $fields); $tpl->assign('liste', $membres->listByCategory($cat_id, array_keys((array) $fields), $page, $order, $desc)); $tpl->assign('total', $membres->countByCategory($cat_id)); $tpl->assign('pagination_url', Utils::getSelfUrl(true) . '?p=[ID]&o=' . $order . ($desc ? '&d' : '') . ($cat_id? '&cat='. (int) Utils::get('cat') : '')); $tpl->assign('membres_cats', $membres_cats); $tpl->assign('membres_cats_cachees', $membres_cats_cachees); $tpl->assign('current_cat', $cat_id); $tpl->assign('page', $page); $tpl->assign('bypage', Membres::ITEMS_PER_PAGE); } $tpl->assign('sent', isset($_GET['sent'])); $tpl->display('admin/membres/index.tpl'); |
Modified src/www/admin/membres/message.php from [520b167629] to [0c98a0bb58].
1 2 3 | <?php namespace Garradin; | | < < < < < | > > > > > | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; if (empty($user->email)) { throw new UserException("Vous devez renseigner l'adresse e-mail dans vos informations pour pouvoir contacter les autres membres."); } if (empty($_GET['id']) || !is_numeric($_GET['id'])) { throw new UserException("Argument du numéro de membre manquant."); } $id = (int) $_GET['id']; $membre = $membres->get($id); if (!$membre) { throw new UserException("Ce membre n'existe pas."); } if (empty($membre->email)) { throw new UserException('Ce membre n\'a pas d\'adresse email renseignée.'); } $error = false; if (!empty($_POST['save'])) { if (!Utils::CSRF_check('send_message_'.$id)) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } elseif (!Utils::post('sujet')) { $error = 'Le sujet ne peut rester vide.'; } elseif (!Utils::post('message')) { $error = 'Le message ne peut rester vide.'; } else { try { $membres->sendMessage($membre->email, Utils::post('sujet'), Utils::post('message'), (bool) Utils::post('copie')); Utils::redirect('/admin/membres/?sent'); } catch (UserException $e) { $error = $e->getMessage(); } } } $cats = new Membres\Categories; $tpl->assign('categorie', $cats->get($membre->id_categorie)); $tpl->assign('membre', $membre); $tpl->assign('error', $error); $tpl->display('admin/membres/message.tpl'); |
Modified src/www/admin/membres/message_collectif.php from [0c88c5bc92] to [96dd15d89a].
1 2 3 | <?php namespace Garradin; | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); $error = false; if (!empty($_POST['save'])) { if (!Utils::CSRF_check('send_message_collectif')) { |
︙ | ︙ | |||
40 41 42 43 44 45 46 | $cats = new Membres\Categories; $tpl->assign('cats_liste', $cats->listSimple()); $tpl->assign('cats_cachees', $cats->listHidden()); $tpl->assign('error', $error); $tpl->display('admin/membres/message_collectif.tpl'); | < < | 37 38 39 40 41 42 43 | $cats = new Membres\Categories; $tpl->assign('cats_liste', $cats->listSimple()); $tpl->assign('cats_cachees', $cats->listHidden()); $tpl->assign('error', $error); $tpl->display('admin/membres/message_collectif.tpl'); |
Modified src/www/admin/membres/modifier.php from [27d1716970] to [c5f6388ed3].
1 2 3 | <?php namespace Garradin; | | | < < < | > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); if (empty($_GET['id']) || !is_numeric($_GET['id'])) { throw new UserException("Argument du numéro de membre manquant."); } $id = (int) $_GET['id']; $membre = $membres->get($id); if (!$membre) { throw new UserException("Ce membre n'existe pas."); } $cats = new Membres\Categories; $champs = $config->get('champs_membres'); // Protection contre la modification des admins par des membres moins puissants $membre_cat = $cats->get($membre->id_categorie); if (($membre_cat->droit_membres == Membres::DROIT_ADMIN) && ($user->droits->membres < Membres::DROIT_ADMIN)) { throw new UserException("Seul un membre admin peut modifier un autre membre admin."); } $error = false; if (!empty($_POST['save'])) |
︙ | ︙ | |||
51 52 53 54 55 56 57 | $data = []; foreach ($champs->getAll() as $key=>$config) { $data[$key] = Utils::post($key); } | | | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | $data = []; foreach ($champs->getAll() as $key=>$config) { $data[$key] = Utils::post($key); } if ($session->canAccess('membres', Membres::DROIT_ADMIN) && $user->id != $membre->id) { $data['id_categorie'] = Utils::post('id_categorie'); $data['id'] = Utils::post('id'); } $membres->edit($id, $data); |
︙ | ︙ | |||
78 79 80 81 82 83 84 | } $tpl->assign('error', $error); $tpl->assign('passphrase', Utils::suggestPassword()); $tpl->assign('champs', $champs->getAll()); $tpl->assign('membres_cats', $cats->listSimple()); | | | < < | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | } $tpl->assign('error', $error); $tpl->assign('passphrase', Utils::suggestPassword()); $tpl->assign('champs', $champs->getAll()); $tpl->assign('membres_cats', $cats->listSimple()); $tpl->assign('current_cat', Utils::post('id_categorie') ?: $membre->id_categorie); $tpl->assign('can_change_id', $session->canAccess('membres', Membres::DROIT_ADMIN)); $tpl->assign('membre', $membre); $tpl->display('admin/membres/modifier.tpl'); |
Modified src/www/admin/membres/recherche.php from [96a9bc1326] to [88e89e6801].
1 2 3 | <?php namespace Garradin; | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ECRITURE); $recherche = trim(Utils::get('r')); $champ = trim(Utils::get('c')); $champs = $config->get('champs_membres'); $auto = false; |
︙ | ︙ | |||
40 41 42 43 44 45 46 | if ($recherche != '') { $result = $membres->search($champ, $recherche); if (count($result) == 1 && $auto) { | | | < < | 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 | if ($recherche != '') { $result = $membres->search($champ, $recherche); if (count($result) == 1 && $auto) { Utils::redirect('/admin/membres/fiche.php?id=' . (int)$result[0]->id); } } $champs_liste = $champs->getList(); $champs_liste = array_merge( ['id' => ['title' => 'Numéro unique', 'type' => 'number']], $champs_liste ); $champs_entete = $champs->getListedFields(); if (!array_key_exists($champ, $champs_entete)) { $champs_entete = array_merge( [$champ => $champs_liste->$champ], $champs_entete ); } $tpl->assign('champs_entete', $champs_entete); $tpl->assign('champs_liste', $champs_liste); $tpl->assign('champ', $champ); if ($recherche != '') { $tpl->assign('liste', $result); } $tpl->assign('recherche', $recherche); $tpl->display('admin/membres/recherche.tpl'); |
Modified src/www/admin/membres/recherche_sql.php from [acf1e4a17e] to [7fb10d435a].
1 2 3 | <?php namespace Garradin; | | | < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); $query = trim(Utils::get('query')); $tpl->assign('schema', $membres->schemaSQL()); $tpl->assign('query', $query); if ($query != '') |
︙ | ︙ | |||
26 27 28 29 30 31 32 | } else { $tpl->assign('result', null); } $tpl->display('admin/membres/recherche_sql.tpl'); | < < | 23 24 25 26 27 28 29 | } else { $tpl->assign('result', null); } $tpl->display('admin/membres/recherche_sql.tpl'); |
Modified src/www/admin/membres/supprimer.php from [77972b15eb] to [9fa9721159].
1 2 3 | <?php namespace Garradin; | | | < < < | | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $session->requireAccess('membres', Membres::DROIT_ADMIN); $membre = $membres->get(Utils::get('id')); if (!$membre) { throw new UserException("Ce membre n'existe pas."); } $error = false; if ($membre->id == $user->id) { $error = "Il n'est pas possible de supprimer votre propre compte."; } if (Utils::post('delete') && !$error) { if (!Utils::CSRF_check('delete_membre_'.$membre->id)) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $membres->delete($membre->id); Utils::redirect('/admin/membres/'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('membre', $membre); $tpl->assign('error', $error); $tpl->display('admin/membres/supprimer.tpl'); |
Modified src/www/admin/mes_infos.php from [a68d27a87a] to [7c839aa4bc].
1 2 3 4 5 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; | < < < < < < < < < < < < | | | < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $error = false; if (!empty($_POST['save'])) { if (!Utils::CSRF_check('edit_me')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } else { try { $data = []; foreach ($config->get('champs_membres')->getAll() as $key=>$c) { if (!empty($c['editable'])) { $data[$key] = Utils::post($key); } } $session->editUser($data); Utils::redirect('/admin/'); } catch (UserException $e) { $error = $e->getMessage(); } } } $tpl->assign('error', $error); $tpl->assign('champs', $config->get('champs_membres')->getAll()); $tpl->assign('membre', $session->getUser()); $tpl->display('admin/mes_infos.tpl'); |
Added src/www/admin/mes_infos_securite.php version [a0932f5a86].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 114 115 116 117 118 119 | <?php namespace Garradin; require_once __DIR__ . '/_inc.php'; $membre = $membres->getLoggedUser(); if (!$membre) { throw new UserException("Ce membre n'existe pas."); } $error = false; $confirm = false; if (!empty($_POST['confirm'])) { if (!Utils::CSRF_check('edit_me_security')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } elseif (trim(Utils::post('passe_confirm')) === '') { $error = 'Merci de bien vouloir renseigner votre mot de passe courant pour confirmer les changements.'; } elseif ($membres->checkPassword(Utils::post('passe_confirm'))) { $error = 'Le mot de passe fourni ne correspond pas au mot de passe actuel. Merci de bien vouloir renseigner votre mot de passe courant pour confirmer les changements.'; } elseif (Utils::post('passe') != Utils::post('repasse')) { $error = 'La vérification ne correspond pas au mot de passe.'; } elseif (Utils::post('otp_secret') && !$membres->checkOTP(Utils::post('otp_secret'), Utils::post('code'))) { $error = 'Le code TOTP entré n\'est pas valide.'; } else { try { $data = [ 'clef_pgp' => Utils::post('clef_pgp'), ]; if (Utils::post('passe') && !empty($config->get('champs_membres')->get('passe')['editable'])) { $data['passe'] = Utils::post('passe'); } if (Utils::post('otp_secret')) { $data['secret_otp'] = Utils::post('otp_secret'); } elseif (Utils::post('otp') == 'disable') { $data['secret_otp'] = null; } $membres->editSecurity($data); Utils::redirect('/admin/'); } catch (UserException $e) { $error = $e->getMessage(); } } $confirm = true; } elseif (Utils::post('save')) { if (!Utils::CSRF_check('edit_me_security')) { $error = 'Une erreur est survenue, merci de renvoyer le formulaire.'; } elseif (Utils::post('passe') != Utils::post('repasse')) { $error = 'La vérification ne correspond pas au mot de passe.'; } elseif (Utils::post('clef_pgp') && !$membres->getPGPFingerprint(Utils::post('clef_pgp'))) { $error = 'Clé PGP invalide : impossible de récupérer l\'empreinte de la clé.'; } else { $confirm = true; } } $tpl->assign('error', $error); $tpl->assign('confirm', $confirm); if (Utils::post('otp') == 'generate') { $otp = $membres->getNewOTPSecret(); $tpl->assign('otp', $otp); } else { $tpl->assign('otp', false); } $tpl->assign('pgp_disponible', \KD2\Security::canUseEncryption()); $fingerprint = ''; if ($membre['clef_pgp']) { $fingerprint = $membres->getPGPFingerprint($membre['clef_pgp'], true); } $tpl->assign('clef_pgp_fingerprint', $fingerprint); $tpl->assign('passphrase', Utils::suggestPassword()); $tpl->assign('champs', $config->get('champs_membres')->getAll()); $tpl->assign('membre', $membre); $tpl->display('admin/mes_infos_securite.tpl'); |
Modified src/www/admin/static/admin.css from [c54095f31a] to [0a77a33694].
︙ | ︙ | |||
140 141 142 143 144 145 146 | color: #090; } span.alert, b.alert { color: #990; } | | | | > | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | color: #090; } span.alert, b.alert { color: #990; } p.error, div.error { border: 1px solid #c00; background: #fcc; padding: 0.5em; margin-bottom: 1em; } p.confirm, div.confirm { border: 1px solid #0c0; background: #cfc; padding: 0.5em; margin-bottom: 1em; } p.alert, div.alert { border: 1px solid #cc0; background: #ffc; padding: 0.5em; margin-bottom: 1em; overflow: auto; } p.help { margin: 1em; color: #666; } |
︙ | ︙ | |||
1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 | background: #eee; padding: .5em; } #orderFields fieldset { position: relative; min-height: 2em; } #orderFields fieldset legend { font-size: 1.2em; line-height: .8em; color: #666; } #orderFields fieldset .actions { display: block; position: absolute; | > > > | > > > > > > > > > > > > > > > > > > > > > | 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 | background: #eee; padding: .5em; } #orderFields fieldset { position: relative; min-height: 2em; transition: all 1s; overflow: hidden; max-height: 1000px; } #orderFields fieldset legend { font-size: 1.2em; line-height: .8em; color: #666; } #orderFields fieldset .actions { display: block; position: absolute; top: 1em; right: 1em; } #orderFields fieldset .actions .icn { position: absolute; } #orderFields fieldset dl { overflow: hidden; transition: all .5s; opacity: 1; display: block; max-height: 1000px; } #orderFields fieldset dl.hidden { opacity: 0; max-height: 0; } #orderFields fieldset.removed { max-height: 0; opacity: 0; border-color: red; min-height: 0; height: 0; } #orderFields fieldset .actions .remove { right: 0em; } #orderFields fieldset .actions .edit { right: 1.5em; } #orderFields fieldset .actions .down { right: 3em; } #orderFields fieldset .actions .up { right: 4.5em; } #orderFields fieldset:nth-child(1) .actions .up, #orderFields fieldset:nth-last-child(1) .actions .down { |
︙ | ︙ | |||
1278 1279 1280 1281 1282 1283 1284 | } form#insertImage .align input:hover, form#insertImage .cancel input:hover { cursor: pointer; background-color: #eee; color: darkred; } | > > > > > > > | 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 | } form#insertImage .align input:hover, form#insertImage .cancel input:hover { cursor: pointer; background-color: #eee; color: darkred; } img.qrcode { float: right; padding: .5em; border: .5em solid #000; background: #fff; } |
Modified src/www/admin/static/scripts/code_editor.min.js from [efbd29b03e] to [89cf1ff3b6].
|
| | | 1 | (function(){window.textEditor=function(a){if(!document.getElementById(a))throw new Error("Invalid ID parameter: "+a);this.id=a;this.textarea=document.getElementById(a);this.shortcuts=[];if(!('selectionStart' in this.textarea))return false;this.preventKeyPress=false;this.textarea.addEventListener('keydown',this.keyEvent.bind(this),true);this.textarea.addEventListener('keypress',this.keyEvent.bind(this),true);return true;};textEditor.prototype.keyEvent=function(a){var a=a||window.event;if(this.preventKeyPress&&a.type=='keypress'){this.preventKeyPress=false;return this.preventDefault(a);}for(var b in this.shortcuts){var c=this.shortcuts[b];if(a.metaKey)continue;if((a.ctrlKey&&!c.ctrl)||(c.ctrl&&!a.ctrlKey))continue;if((a.shiftKey&&!c.shift)||(c.shift&&!a.shiftKey))continue;if((a.altKey&&!c.alt)||(c.alt&&!a.altKey))continue;if(!(b=this.matchKeyPress(c.key,a)))continue;if(typeof c.callback!='function'){var d=(c.ctrl?'Ctrl-':'')+(c.alt?'Alt-':'');d+=(c.shift?'Shift-':'')+c;throw new Error("Invalid callback type for shortcut "+d);}var e=c.callback.call(this,a,b);if(a.type=='keydown'&&e)this.preventKeyPress=true;return e?this.preventDefault(a):true;}return true;};textEditor.prototype.matchKeyPress=function(a,b){if(b.defaultPrevented||!b.key)return;return(b.key.toLowerCase()==a.toLowerCase());};textEditor.prototype.preventDefault=function(a){if(a.preventDefault)a.preventDefault();if(a.stopPropagation)a.stopPropagation();a.returnValue=false;a.cancelBubble=true;return false;};textEditor.prototype.getSelection=function(){var a=this.textarea;var b=a.selectionEnd-a.selectionStart;return{start:a.selectionStart,end:a.selectionEnd,length:b,text:a.value.substr(a.selectionStart,b)};};textEditor.prototype.replaceSelection=function(a,b){var c=this.textarea;var d=a.start;var e=d+b.length;c.value=c.value.substr(0,d)+b+c.value.substr(a.end,c.value.length);this.setSelection(d,e);return{start:d,end:e,length:b.length,text:b};};textEditor.prototype.insertAtPosition=function(a,b,c){var d=a+b.length;var e=this.textarea;e.value=e.value.substr(0,a)+b+e.value.substr(a,e.value.length-a);if(!c)c=d;return this.setSelection(c,c);};textEditor.prototype.setSelection=function(a,b){var c=this.textarea;c.focus();c.selectionStart=a;c.selectionEnd=b;return this.getSelection();};textEditor.prototype.scrollToSelection=function(a){var b=this.textarea;var c=b.value.substr(a.end);b.value=b.value.substr(0,a.end);b.scrollTop=100000;var d=b.scrollTop;b.value+=c;b.scrollTop=d;this.setSelection(a.start,a.end);};textEditor.prototype.wrapSelection=function(a,b,c){var d=this.textarea;var e=d.scrollTop;var f=a.text;var a=this.replaceSelection(a,b+f+c);if(f=='')a=this.setSelection(a.start+b.length,a.start+b.length);d.scrollTop=e;return a;};}());(function(){function a(a){function b(){}b.prototype=a;return new b();}String.prototype.repeat=function(a){return new Array(a+1).join(this);};window.codeEditor=function(a){var b=textEditor.call(this,a);if(!b)return false;this.onlinechange=null;this.onlinenumberchange=null;this.fullscreen=false;this.nb_lines=0;this.current_line=0;this.search_str=null;this.search_pos=0;this.params={indent_size:4,tab_size:4,convert_tabs:true,lang:{search:"Text to search?\n(regexps allowed, begin them with '/')",replace:"Text for replacement?\n(use $1, $2... for regexp replacement)",search_selection:"Text to replace in selection?\n(regexps allowed, begin them with '/')",replace_result:"%d occurence found and replaced.",goto:"Line to go to:",no_search_result:"No search result found."}};that=this;this.init();this.textarea.spellcheck=false;this.shortcuts.push({shift:true,key:'tab',callback:this.indent});this.shortcuts.push({key:'tab',callback:this.indent});this.shortcuts.push({ctrl:true,key:'f',callback:this.search});this.shortcuts.push({ctrl:true,key:'h',callback:this.searchAndReplace});this.shortcuts.push({ctrl:true,key:'g',callback:this.goToLine});this.shortcuts.push({key:'F3',callback:this.searchNext});this.shortcuts.push({key:'backspace',callback:this.backspace});this.shortcuts.push({key:'enter',callback:this.enter});this.shortcuts.push({key:'"',callback:this.insertBrackets});this.shortcuts.push({key:'[',callback:this.insertBrackets});this.shortcuts.push({key:'{',callback:this.insertBrackets});this.shortcuts.push({key:'(',callback:this.insertBrackets});this.shortcuts.push({key:'F11',callback:this.toggleFullscreen});this.textarea.addEventListener('keypress',this.keyEvent.bind(this),true);this.textarea.addEventListener('keydown',this.keyEvent.bind(this),true);};codeEditor.prototype=a(textEditor.prototype);codeEditor.prototype.init=function(){var a=this;this.nb_lines=this.countLines();this.parent=document.createElement('div');this.parent.className='codeEditor';this.lineCounter=document.createElement('span');this.lineCounter.className='lineCount';for(i=1;i<=this.nb_lines;i++)this.lineCounter.innerHTML+='<b>'+i+'</b>';this.lineCounter.innerHTML+='<i>---</i>';this.parent.appendChild(this.lineCounter);var b=document.createElement('div');b.className='container';b.appendChild(this.textarea.cloneNode(true));this.parent.appendChild(b);var c=this.textarea.parentNode;c.appendChild(this.parent);c.removeChild(this.textarea);this.textarea=this.parent.getElementsByTagName('textarea')[0];this.textarea.wrap='off';if(this.params.convert_tabs){this.textarea.value=this.textarea.value.replace(/[ ]{1,7}\t/g,' '.repeat(this.params.tab_size));this.textarea.value=this.textarea.value.replace(/\t/g,' '.repeat(this.params.tab_size));}this.textarea.addEventListener('focus',function(){a.update();},false);this.textarea.addEventListener('keyup',function(){a.update();},false);this.textarea.addEventListener('click',function(){a.update();},false);this.textarea.addEventListener('scroll',function(){a.lineCounter.scrollTop=a.textarea.scrollTop;},false);};codeEditor.prototype.update=function(){var a=this.getSelection();var b=this.getLineNumberFromPosition(a);var c=this.countLines();this.search_pos=a.end;if(c!=this.nb_lines){var d=this.lineCounter.getElementsByTagName('b');for(var e=this.nb_lines;e>c;e--)this.lineCounter.removeChild(d[e-1]);var f=this.lineCounter.lastChild;for(var e=d.length;e<c;e++){var g=document.createElement('b');g.innerHTML=e+1;this.lineCounter.insertBefore(g,f);}this.nb_lines=c;if(typeof this.onlinenumberchange==='function')this.onlinenumberchange.call(this);}if(b!=this.current_line){var d=this.lineCounter.getElementsByTagName('b');for(var e=0;e<this.nb_lines;e++)d[e].className='';d[b].className='current';this.current_line=b;if(typeof this.onlinechange==='function')this.onlinechange.call(this);}};codeEditor.prototype.countLines=function(){var a=this.textarea.value.match(/(\r?\n)/g);return a?a.length+1:1;};codeEditor.prototype.getLineNumberFromPosition=function(a){var a=a||this.getSelection();if(a.start==0)return 0;var b=this.textarea.value.substr(0,a.start).match(/(\r?\n)/g);return b?b.length:0;};codeEditor.prototype.getLines=function(){return this.textarea.value.split("\n");};codeEditor.prototype.getLine=function(a){return this.textarea.value.split("\n",a+1)[a];};codeEditor.prototype.getLinePosition=function(a,b){var c=0;for(i=0;i<a.length;i++){if(i==b)return{start:c+i,end:c+a[i].length,length:a[i].length,text:a[i]};c+=a[i].length;}return false;};codeEditor.prototype.selectLines=function(a){for(var b=a.start;b>0;b--)if(this.textarea.value.substr(b,1)=="\n"){a.start=b+1;break;}for(var b=a.end-1;b<this.textarea.length;b++)if(this.textarea.value.substr(b,1)=="\n"){a.end=b-1;break;}this.setSelection(a.start,a.end);return a;};codeEditor.prototype.goToLine=function(a){var b=window.prompt(that.params.lang.goto);if(!b)return;var c=this.textarea.value.split("\n",parseInt(b,10)).join("\n").length;this.scrollToSelection(this.setSelection(c,c));return true;};codeEditor.prototype.indent=function(a,b){var c=this.getSelection();var d=a.shiftKey;var e=this.getLines();var f=this.getLineNumberFromPosition(c);var g=this.getLinePosition(e,f);var h=(c.end>g.end)?true:false;if((c.length==0||!h)&&c.start!=g.start){this.insertAtPosition(c.start,' '.repeat(this.params.indent_size));return true;}if(c.length==0&&c.start==g.start){var i=(f-1 in e)?e[f-1].match(/^(\s+)/):false;if(!i||g.length!=0)var j=' '.repeat(this.params.indent_size);else var j=' '.repeat(i[1].length);this.insertAtPosition(c.start,j);return true;}c=this.selectLines(c);var k=this.textarea.value.substr(c.start,(c.end-c.start));var e=k.split("\n");if(d){var l=new RegExp('^[ ]{1,'+this.params.indent_size+'}');for(var m=0;m<e.length;m++)e[m]=e[m].replace(l,'');}else for(var m=0;m<e.length;m++)e[m]=' '.repeat(this.params.indent_size)+e[m];k=e.join("\n");this.replaceSelection(c,k);return true;};codeEditor.prototype.search=function(){if(!(this.search_str=window.prompt(this.params.lang.search,this.search_str)))return;this.search_pos=0;return this.searchNext();};codeEditor.prototype.searchNext=function(){if(!this.search_str)return true;var a=this.getSelection();var b=a.end>=this.search_pos?this.search_pos:a.start;var c=this.textarea.value.substr(b);var d=this.getSearchRegexp(this.search_str);var e=c.search(d);if(e==-1)return window.alert(this.params.lang.no_search_result);var f=c.match(d);a.start=b+e;a.end=a.start+f[0].length;a.length=f[0].length;a.text=f[0];this.setSelection(a.start,a.end);this.search_pos=a.end;this.scrollToSelection(a);return true;};codeEditor.prototype.getSearchRegexp=function(a,b){var c,d;if(a.substr(0,1)=='/'){var e=a.lastIndexOf("/");c=a.substr(1,e-1);d=a.substr(e+1).replace(/g/,'');}else{c=a.replace(/([\/$^.?()[\]{}\\])/,'\\$1');d='i';}if(b)d+='g';return new RegExp(c,d);};codeEditor.prototype.searchAndReplace=function(a){var b=this.getSelection();var c=b.length!=0?this.params.lang.search_selection:this.params.lang.search;if(!(s=window.prompt(c,this.search_str))||!(r=window.prompt(that.params.lang.replace)))return true;var d=this.getSearchRegexp(s,true);if(b.length==0){var e=this.textarea.value.match(d).length;this.textarea.value=this.textarea.value.replace(d,r);}else{var e=b.text.match(d).length;this.replaceSelection(b,b.text.replace(d,r));}window.alert(this.params.lang.replace_result.replace(/%d/g,e));return true;};codeEditor.prototype.enter=function(a){var b=this.getSelection();var c=this.getLineNumberFromPosition(b);var d='';c=this.getLine(c);if(this.textarea.value.substr(b.start-1,1)=='{')d+=' '.repeat(this.params.indent_size);if(match=c.match(/^(\s+)/))d+=match[1];if(!d)return false;this.insertAtPosition(b.start,"\n"+d);return true;};codeEditor.prototype.backspace=function(a){var b=this.getSelection();if(b.length>0)return false;var c=this.textarea.value.substr(b.start-2,2);if(c=='""'||c=="''"||c=='{}'||c=='()'||c=='[]'){b.start-=2;this.replaceSelection(b,'');return true;}var c=this.textarea.value.substr(b.start-20,20);if((pos=c.search(/^(\s+)$/m))!=-1){b.start-=this.params.indent_size;this.replaceSelection(b,'');return true;}return false;};codeEditor.prototype.insertBrackets=function(a,b){var c=this.getSelection();var d=b;var e=d;switch(d){case '(':e=')';break;case '[':e=']';break;case '{':e='}';break;}if(c.length==0)this.insertAtPosition(c.start,d+e,c.start+1);else this.wrapSelection(c,d,e);return true;};codeEditor.prototype.toggleFullscreen=function(a){var b=this.parent.className.split(' ');for(var c=0;c<b.length;c++)if(b[c]=='fullscreen'){b.splice(c,1);this.parent.className=b.join(' ');this.fullscreen=false;return true;}b.push('fullscreen');this.parent.className=b.join(' ');this.fullscreen=true;return true;};}()); |
Modified src/www/admin/upgrade.php from [e7450be78d] to [f01a9593fe].
︙ | ︙ | |||
240 241 242 243 244 245 246 | // Mise à jour base de données $db->exec(file_get_contents(ROOT . '/include/data/0.7.2.sql')); $db->exec('END;'); } | | < < < | | | > | > | | | > | > > | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | // Mise à jour base de données $db->exec(file_get_contents(ROOT . '/include/data/0.7.2.sql')); $db->exec('END;'); } if (version_compare($v, '0.8.0', '<')) { $db->exec('PRAGMA foreign_keys = OFF;'); // Inscription de l'appid $db->exec('PRAGMA application_id = ' . DB::APPID . ';'); $db->begin(); $db->import(ROOT . '/include/data/0.8.0.sql'); $db->commit(); // Nettoyage de la base de données $db->exec('VACUUM;'); } Utils::clearCaches(); $config->setVersion(garradin_version()); echo '<h2>Mise à jour terminée.</h2> |
︙ | ︙ | |||
275 276 277 278 279 280 281 | stopAnimatedLoader(); }, 1000); </script>'; } echo ' </body>'; | < < | 277 278 279 280 281 282 283 | stopAnimatedLoader(); }, 1000); </script>'; } echo ' </body>'; |
Modified src/www/admin/wiki/editer.php from [467a406a97] to [7a3da3be01].
︙ | ︙ | |||
77 78 79 80 81 82 83 84 85 86 87 88 89 90 | } $parent = (int) Utils::post('parent') ?: (int) $page['parent']; $tpl->assign('parent', $parent ? $wiki->getTitle($parent) : 0); $tpl->assign('error', $error); $tpl->assign('page', $page); $tpl->assign('time', time()); $tpl->assign('date', $date ? strtotime($date) : $page['date_creation']); $tpl->assign('custom_js', ['wiki_editor.js', 'wiki-encryption.js']); $tpl->display('admin/wiki/editer.tpl'); | > > | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | } $parent = (int) Utils::post('parent') ?: (int) $page['parent']; $tpl->assign('parent', $parent ? $wiki->getTitle($parent) : 0); $tpl->assign('error', $error); $tpl->assign('page', $page); $tpl->assign('wiki', $wiki); $tpl->assign('time', time()); $tpl->assign('date', $date ? strtotime($date) : $page['date_creation']); $tpl->assign('custom_js', ['wiki_editor.js', 'wiki-encryption.js']); $tpl->display('admin/wiki/editer.tpl'); |
Deleted tests/01-installation.js version [042769244d].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/10-login.js version [9e07ca2ad5].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/11-add-member.js version [d82bb90f60].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/12-edit-member.js version [9ba6b617ca].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/13-delete-member.js version [1ddf5215aa].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/14-add-cotisation.js version [4e5efdd1ce].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Deleted tests/README version [00c8746857].
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Added tests/phantom/01-installation.js version [042769244d].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | /*jshint strict:false*/ /*global CasperError, casper, console, phantom, require*/ casper.test.begin('Installation', 3, function suite(test) { casper.start("http://localhost:8080/", function() { test.assertTitle("Garradin - Installation", "Page installation"); test.assertExists('form', "Formulaire présent"); this.fillSelectors('form', { '#f_nom_asso': "Garradin", '#f_email_asso': "asso@demo.garradin.eu", '#f_adresse_asso': "15 rue du Logiciel Libre\n21000 DIJON", '#f_nom_membre': "Ada Lovelace", '#f_cat_membre': "Bureau", '#f_email_membre': "ada@demo.garradin.eu", '#f_passe_membre': "Garradin c'est chouette", '#f_repasse_membre': "Garradin c'est chouette" }, false); this.click('form input[type=submit]'); }); casper.then(function() { if (this.getCurrentUrl().match(/login\.php/)) { test.pass("Installation réussie."); } else { test.error(this.fetchText('p.error')); } }); casper.run(function () { test.done(); }); }); |
Added tests/phantom/10-login.js version [9e07ca2ad5].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | /*jshint strict:false*/ /*global CasperError, casper, console, phantom, require*/ casper.test.begin('Login', 3, function suite(test) { casper.start("http://localhost:8080/admin/login.php", function() { test.assertTitle("Connexion", "Page de connexion"); test.assertExists('form', "Formulaire présent"); this.fillSelectors('form', { '#f_id': "ada@demo.garradin.eu", '#f_passe': "Garradin c'est chouette", }, false); this.click('form input[type=submit]'); }); casper.then(function() { if (this.getCurrentUrl().match(/\/$/)) { test.pass("Connexion réussie."); } else { test.error(this.fetchText('p.error')); } }); casper.run(function () { test.done(); }); }); |
Added tests/phantom/11-add-member.js version [d82bb90f60].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | /*jshint strict:false*/ /*global CasperError, casper, console, phantom, require*/ casper.test.begin('Ajout membre', 3, function suite(test) { casper.start("http://localhost:8080/admin/membres/ajouter.php", function() { test.assertTitle("Ajouter un membre", "Page OK"); test.assertExists('form', "Formulaire présent"); this.fillSelectors('form', { '#f_nom': "Gaston Lagaffe", '#f_email': "gaston@demo.garradin.eu", '#f_adresse': "42 rue Spirou", '#f_ville': "Bruxelles", '#f_code_postal': "3001", '#f_pays': "BE", '#f_telephone': "01 02 03 04 05", }, false); this.click('#password_suggest'); this.click('form input[type=submit]'); }); casper.then(function() { if (this.getCurrentUrl().match(/fiche\.php\?id=/)) { test.pass("Ajout réussi."); } else { test.error(this.fetchText('p.error')); } }); casper.run(function () { test.done(); }); }); |
Added tests/phantom/12-edit-member.js version [9ba6b617ca].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | /*jshint strict:false*/ /*global CasperError, casper, console, phantom, require*/ casper.test.begin('Modif Membre', 3, function suite(test) { casper.start("http://localhost:8080/admin/membres/modifier.php?id=2", function() { test.assertTitle("Modifier un membre", "Page OK"); test.assertExists('form', "Formulaire présent"); this.fillSelectors('form', { '#f_nom': "Pacôme De Champignac", '#f_email': "comte@demo.garradin.eu", '#f_adresse': "Château", '#f_ville': "Champignac", '#f_code_postal': "12070", '#f_pays': "FR", '#f_telephone': "+32777229929", }, false); this.click('#password_suggest'); this.click('form input[type=submit]'); }); casper.then(function() { if (this.getCurrentUrl().match(/fiche\.php\?id=/)) { test.pass("Modif réussie."); } else { test.error(this.fetchText('p.error')); } }); casper.run(function () { test.done(); }); }); |
Added tests/phantom/13-delete-member.js version [1ddf5215aa].
> > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | /*jshint strict:false*/ /*global CasperError, casper, console, phantom, require*/ casper.test.begin('Login', 3, function suite(test) { casper.start("http://localhost:8080/admin/membres/supprimer.php?id=2", function() { test.assertTitle("Supprimer un membre", "Page OK"); test.assertExists('form', "Formulaire présent"); this.click('form input[type=submit]'); }); casper.then(function() { if (this.getCurrentUrl().match(/\/membres\/$/)) { test.pass("Suppression OK"); } else { test.error(this.fetchText('p.error')); } }); casper.run(function () { test.done(); }); }); |
Added tests/phantom/14-add-cotisation.js version [4e5efdd1ce].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | /*jshint strict:false*/ /*global CasperError, casper, console, phantom, require*/ casper.test.begin('Ajout cotise', 3, function suite(test) { casper.start("http://localhost:8080/admin/membres/cotisations/", function() { test.assertTitle("Cotisations", "Page OK"); test.assertExists('form', "Formulaire présent"); this.click('#f_periodicite_jours'); this.click('#f_categorie'); this.fillSelectors('form', { '#f_intitule': 'Cotisation normale', '#f_montant': '15.00', '#f_id_categorie_compta': '18', '#f_duree': '300', }, false); this.click('form input[type=submit]'); }); casper.thenOpen('http://localhost:8080/admin/membres/cotisations/voir.php?id=1', function() { test.assertTitle("Membres ayant cotisé", "Cotisation OK"); }); casper.run(function () { test.done(); }); }); |
Added tests/phantom/README version [00c8746857].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | Les tests de Garradin sont écrits en Javascript à l'aide de CasperJS. CasperJS peut utiliser Phantom.js pour émuler un navigateur webkit ou SlimeJS pour un navigateur Gecko. === Installer l'environnement de test === 1. Installer Phantom.js - apt-get install phantomjs/unstable - ou depuis http://phantomjs.org/download.html 2. (si installation manuelle) mettre Phantom.js dans le $PATH 3. Installer CasperJS: $ git clone git://github.com/n1k0/casperjs.git 4. Mettre CasperJS dans le $PATH === Lancer un test === 1. Lancer un serveur php sur localhost:8080 qui pointe sur le www/ de Garradin 2. Lancer le test avec par exemple : $ phantomjs test 02-login.js === Lancer tous les tests === $ ./run-all.sh Cela va : - télécharger le trunk de Garradin dans /tmp/garradin - télécharger les dépendances - lancer chacun des tests JS avec CasperJS dans l'ordre indiqué par le numéro Pour utiliser une version locale de Garradin plutôt que de laisser télécharger le trunk il suffit de faire un lien symbolique de /tmp/garradin vers le code local. |
Added tests/phantom/run.sh version [c2ecdca281].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #!/bin/sh SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" if [ -f $SCRIPTPATH/config.sh ] then . $SCRIPTPATH/config.sh fi if [ "$1" = "--reset" ] then rm -rf $TESTDIR fi if [ ! -d $TESTDIR ] then mkdir -p $TESTDIR cd $TESTDIR fossil clone https://fossil.kd2.org/garradin/ garradin.fossil fossil open garradin.fossil sh tools/setup_dependencies.sh cd $SCRIPTPATH fi if [ "$1" != "--no-install" ] then rm -rf $TESTDIR/src/cache rm -rf $TESTDIR/src/*.sqlite fi php -S localhost:8080 -t $TESTDIR/src/www & PHP_PID=$! if [ "$1" != "--no-install" ] then $CASPERJS test 0*.js fi $CASPERJS --cookies-file=$TESTDIR/cookies.txt test 1*.js kill $! |
Added tests/phantom/syntax.sh version [9f1c94329e].
> > > > > > > > | 1 2 3 4 5 6 7 8 | #!/bin/sh SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" cd $SCRIPTPATH cd ../src find . -name '*.php' -exec php -l '{}' \; | fgrep -v 'No syntax error' |
Added tests/run.php version [e0e24bf932].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | <?php require __DIR__ . '/../src/include/init.php'; if (!empty($_SERVER['argv'][1])) { require $_SERVER['argv'][1]; exit; } else { // Lister et exécuter tous les tests unitaires $dir = new RecursiveDirectoryIterator(__DIR__ . '/unit_tests'); $iterator = new RecursiveIteratorIterator($dir); $files = new RegexIterator($iterator, '/^.*\.php$/i', RecursiveRegexIterator::GET_MATCH); $list = []; foreach ($files as $file) { $list[] = $file[0]; } natcasesort($list); foreach ($list as $file) { require $file; } } |
Modified tests/run.sh from [c2ecdca281] to [476c017c61].
|
| | < | < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1 2 3 4 5 | #!/bin/bash DIR="$(dirname "${BASH_SOURCE[0]}")" find "$DIR" -type f -name '*.php' -exec php "{}" \; |
Deleted tests/syntax.sh version [9f1c94329e].
|
| < < < < < < < < |
Added tests/unit_tests/01_basic/db.php version [88dbf0c61d].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | <?php namespace Garradin; use KD2\Test; const DB_FILE = ':memory:'; require __DIR__ . '/../init.php'; $db = DB::getInstance(); // test exec Test::assert($db->exec('CREATE TABLE test (a, b);')); // test insert Test::assert($db->insert('test', ['a' => 1, 'b' => 2])); Test::assert($db->insert('test', ['a' => 3, 'b' => 4])); // test insert object Test::assert($db->insert('test', (object) ['a' => 9, 'b' => 10])); // test fetch Test::equals((object)['a' => 1, 'b' => 2], $db->first('SELECT a, b FROM test;')); Test::assert(is_object($db->first('SELECT a, b FROM test;'))); Test::equals(1, $db->firstColumn('SELECT a, b FROM test;')); Test::equals(3, $db->firstColumn('SELECT COUNT(*) FROM test;')); // test update Test::assert($db->update('test', ['a' => 5, 'b' => 6], 'a = :a AND b = :b', ['a' => 3, 'b' => 4])); // test update with mixed type bindings try { $db->update('test', ['a' => 5, 'b' => 6], 'a = ? AND b = ?', [3, 4]); $failed = false; } catch (\InvalidArgumentException $e) { $failed = true; } Test::assert($failed === true); // test if update worked Test::equals((object)['a' => 5, 'b' => 6], $db->first('SELECT a, b FROM test LIMIT 1, 1;')); // test delete Test::assert($db->delete('test', 'a = ? AND b = ?', 5, 6)); // test if delete worked Test::equals(2, $db->firstColumn('SELECT COUNT(*) FROM test;')); // test insert again Test::assert(is_bool($db->insert('test', ['a' => 3, 'b' => 4]))); Test::equals(3, $db->firstColumn('SELECT COUNT(*) FROM test;')); // Test bindings Test::equals(1, $db->firstColumn('SELECT a, b FROM test WHERE a = :a;', ['a' => 1])); Test::equals((object) ['a' => 1, 'b' => 2], $db->first('SELECT a, b FROM test WHERE a = ?;', 1)); // test SELECT $expected = [(object)['a' => 1, 'b' => 2], (object)['a' => 9, 'b' => 10]]; Test::equals($expected, $db->get('SELECT * FROM test LIMIT 2;')); $expected = [1 => 2, 9 => 10]; Test::equals($expected, $db->getAssoc('SELECT * FROM test LIMIT 2;')); $expected = [1 => (object) ['a' => 1, 'b' => 2], 9 => (object) ['a' => 9, 'b' => 10]]; Test::equals($expected, $db->getAssocKey('SELECT * FROM test LIMIT 2;')); // test transactions Test::assert($db->begin()); Test::assert($db->insert('test', ['a' => 42, 'b' => 43])); // test nested transaction Test::assert(!$db->begin()); Test::assert(!$db->commit()); Test::assert($db->insert('test', ['a' => 44, 'b' => 45])); // test rollback Test::assert($db->rollback()); Test::equals(3, $db->firstColumn('SELECT COUNT(*) FROM test;')); // test successful commit Test::assert($db->begin()); Test::assert($db->insert('test', ['a' => 42, 'b' => 43])); Test::assert($db->commit()); Test::equals(4, $db->firstColumn('SELECT COUNT(*) FROM test;')); |
Added tests/unit_tests/01_basic/paths.php version [802a0c36b5].
> > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <?php namespace Garradin; use KD2\Test; require __DIR__ . '/../init.php'; Test::assert(defined('Garradin\ROOT')); Test::assert(is_readable(ROOT)); Test::assert(defined('Garradin\PLUGINS_ROOT')); Test::assert(is_readable(PLUGINS_ROOT)); Test::assert(defined('Garradin\DATA_ROOT')); Test::assert(is_readable(DATA_ROOT)); Test::assert(is_writeable(DATA_ROOT)); Test::assert(defined('Garradin\CACHE_ROOT')); Test::assert(is_readable(CACHE_ROOT)); Test::assert(is_writeable(CACHE_ROOT)); |
Added tests/unit_tests/01_basic/version.php version [20ce832281].
> > > > > > > > > | 1 2 3 4 5 6 7 8 9 | <?php namespace Garradin; use KD2\Test; require __DIR__ . '/../init.php'; Test::assert(function_exists('Garradin\garradin_version')); Test::assert(garradin_version()); |
Added tools/plugin_check_0.8.php version [ec4dbeaaed].
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 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 | <?php if (empty($argv[1])) { echo sprintf('Usage: %s PLUGIN_DIRECTORY' . PHP_EOL, $argv[0]); exit(1); } assert_options(ASSERT_ACTIVE, true); assert_options(ASSERT_BAIL, true); $dir = rtrim($argv[1], '/\\') . DIRECTORY_SEPARATOR; assert(is_readable($dir), 'Le répertoire du plugin n\'est pas lisible'); assert(is_dir($dir), sprintf('%s n\'est pas un répertoire', $dir)); assert(file_exists($dir . 'garradin_plugin.ini'), sprintf('%s n\'est pas un répertoire de plugin Garradin', $dir)); $dir_iterator = new RecursiveDirectoryIterator(substr($dir, 0, -1), FilesystemIterator::SKIP_DOTS); $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST); $base = realpath($dir); foreach ($iterator as $file) { if ($file->isDir()) { // Skip directories continue; } $source = str_replace($base, '', $file->getRealPath()); if ($file->getExtension() == 'php') { check_php($file->getRealPath(), $source); } elseif ($file->getExtension() == 'tpl') { check_smarty($file->getRealPath(), $source); } } function check_php($file, $source) { static $deprecated_php_functions = [ '->simpleQuerySingle', '->queryFetchAssocKey', '->queryFetchAssoc', '->queryFetch', '->simpleStatementFetchAssocKey', '->simpleStatementFetchAssoc', '->simpleStatementFetch', '->simpleStatement', '->escapeString', '->simpleExec', '->simpleUpdate', '->simpleInsert', ]; $content = file_get_contents($file); foreach ($deprecated_php_functions as $func) { if (stripos($content, $func) !== false) { fputs(STDERR, sprintf('DEPRECATED: %s: la fonction %s est dépréciée et sera supprimée de la prochaine version de Garradin.', $source, $func) . PHP_EOL); } } } function check_smarty($file, $source) { $content = file_get_contents($file); if (preg_match('/\{.*`.*\}/sU', $content)) { fputs(STDERR, sprintf('ERROR: %s: la syntaxe `$variable` est invalide dans Smartyer, utiliser le modifieur |args:$variable', $source) . PHP_EOL); } if (preg_match('/\{\s*(section|php|switch|insert|capture)/', $content, $match)) { fputs(STDERR, sprintf('ERROR: %s: le bloc "%s" est absent dans Smartyer', $source, $match[1]) . PHP_EOL); } if (preg_match('/(\$smarty\.|\$tpl\.|\$templatelite\.)/', $content, $match)) { fputs(STDERR, sprintf('ERROR: %s: les variables "%s" sont absentes dans Smartyer', $source, $match[1]) . PHP_EOL); } if (preg_match('/\{.*\|escape/sU', $content)) { fputs(STDERR, sprintf('SUGGESTION: %s: le modifieur |escape n\'est plus nécessaire (escaping automatique)', $source) . PHP_EOL); } } |