]> git.agnieray.net Git - galette.git/blob - galette/includes/routes/contributions.routes.php
Scrutinizer Auto-Fixes (#59)
[galette.git] / galette / includes / routes / contributions.routes.php
1 <?php
2
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5 /**
6 * Contributions related routes
7 *
8 * PHP version 5
9 *
10 * Copyright © 2014-2016 The Galette Team
11 *
12 * This file is part of Galette (http://galette.tuxfamily.org).
13 *
14 * Galette is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * Galette is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
26 *
27 * @category Routes
28 * @package Galette
29 *
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2014-2016 The Galette Team
32 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
33 * @version SVN: $Id$
34 * @link http://galette.tuxfamily.org
35 * @since 0.8.2dev 2014-11-27
36 */
37
38 use Galette\Controllers\Crud;
39 use Galette\Controllers\PdfController;
40
41 use Galette\Repository\Contributions;
42 use Galette\Entity\Transaction;
43 use Galette\Repository\Transactions;
44 use Galette\Repository\Members;
45 use Galette\Entity\Adherent;
46 use Galette\Entity\ContributionsTypes;
47 use Galette\Core\GaletteMail;
48 use Galette\Entity\Texts;
49 use Galette\Repository\PaymentTypes;
50
51 $app->get(
52 '/{type:transactions|contributions}[/{option:page|order|member}/{value:\d+|all}]',
53 Crud\ContributionsController::class . ':list'
54 )->setName('contributions')->add($authenticate);
55
56 $app->post(
57 '/{type:contributions|transactions}/filter',
58 Crud\ContributionsController::class . ':filter'
59 )->setName('payments_filter')->add($authenticate);
60
61 $app->get(
62 '/contribution/{type:fee|donation}/add',
63 Crud\ContributionsController::class . ':add'
64 )->setName('addContribution')->add($authenticate);
65
66 $app->get(
67 '/contribution/{type:fee|donation}/edit/{id:\d+}',
68 Crud\ContributionsController::class . ':edit'
69 )->setName('editContribution')->add($authenticate);
70
71 $app->post(
72 '/contribution/{type:fee|donation}/add',
73 Crud\ContributionsController::class . ':doAdd'
74 )->setName('doAddContribution')->add($authenticate);
75
76 $app->post(
77 '/contribution/{type:fee|donation}/edit/{id:\d+}',
78 Crud\ContributionsController::class . ':doEdit'
79 )->setName('doEditContribution')->add($authenticate);
80
81 $app->get(
82 '/transaction/{action:add|edit}[/{id:\d+}]',
83 Crud\TransactionsController::class . ':edit'
84 )->setName('transaction')->add($authenticate);
85
86 $app->get(
87 '/transaction/{id}/attach/{cid}',
88 Crud\TransactionsController::class . ':attach'
89 )->setName('attach_contribution')->add($authenticate);
90
91 $app->get(
92 '/transaction/{id}/detach/{cid}',
93 Crud\TransactionsController::class . ':detach'
94 )->setName('detach_contribution')->add($authenticate);
95
96 $app->post(
97 '/transaction/add',
98 Crud\TransactionsController::class . ':doAdd'
99 )->setName('doEditTransaction')->add($authenticate);
100
101 $app->post(
102 '/transaction/edit/{id:\d+}',
103 Crud\TransactionsController::class . ':doEdit'
104 )->setName('doEditTransaction')->add($authenticate);
105
106 $app->get(
107 '/{type:contributions|transactions}/remove' . '/{id:\d+}',
108 Crud\ContributionsController::class . ':confirmDelete'
109 )->setName('removeContribution')->add($authenticate);
110
111 $app->post(
112 '/{type:contributions|transactions}/batch/remove',
113 Crud\ContributionsController::class . ':confirmDelete'
114 )->setName('removeContributions')->add($authenticate);
115
116 $app->post(
117 '/{type:contributions|transactions}/remove[/{id}]',
118 Crud\ContributionsController::class . ':delete'
119 )->setName('doRemoveContribution')->add($authenticate);
120
121 //Contribution PDF
122 $app->get(
123 '/contribution/print/{id:\d+}',
124 PdfController::class . ':contribution'
125 )->setName('printContribution')->add($authenticate);
126
127 $app->get(
128 '/document/{hash}',
129 GaletteController::class . ':documentLink'
130 )->setName('directlink');
131
132 $app->post(
133 '/document/{hash}',
134 PdfController::class . ':directlinkDocument'
135 )->setName('get-directlink');