]> git.agnieray.net Git - galette.git/blob - galette/includes/fields_defs/pdfmodels_fields.php
Fix RTL issues on PDF member form; closes #1727
[galette.git] / galette / includes / fields_defs / pdfmodels_fields.php
1 <?php
2
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5 /**
6 * PDF models declarations
7 *
8 * PHP version 5
9 *
10 * Copyright © 2013-2023 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 Functions
28 * @package Galette
29 *
30 * @author Johan Cwiklinski <johan@x-tnd.be>
31 * @copyright 2013-2014 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 * @link http://galette.tuxfamily.org
34 * @since 0.7.5 - 2013-06-02
35 */
36
37 use Galette\Entity\PdfModel;
38
39 $pdfmodels_fields = array(
40 array(
41 'model_id' => PdfModel::MAIN_MODEL,
42 'model_name' => '_T("Main")',
43 'model_title' => null,
44 'model_type' => PdfModel::MAIN_MODEL,
45 'model_header' => '<table>
46 <tr>
47 <td id="pdf_assoname"><strong id="asso_name">{ASSO_NAME}</strong><br/>{ASSO_SLOGAN}</td>
48 <td id="pdf_logo">{ASSO_LOGO}</td>
49 </tr>
50 </table>',
51 'model_footer' => '<div id="pdf_footer">
52 _T("Association") {ASSO_NAME} - {ASSO_ADDRESS}<br/>
53 {ASSO_WEBSITE}
54 </div>',
55 'model_body' => null,
56 'model_styles' => 'div#pdf_title {
57 font-size: 1.4em;
58 font-wieght:bold;
59 text-align: center;
60 }
61
62 div#pdf_subtitle {
63 text-align: center;
64 }
65
66 div#pdf_footer {
67 text-align: center;
68 font-size: 0.7em;
69 }
70
71 td#pdf_assoname {
72 width: 75%;
73 font-size: 1.1em;
74 }
75
76 strong#asso_name {
77 font-size: 1.6em;
78 }
79
80 td#pdf_logo {
81 text-align: right;
82 width: 25%;
83 }
84
85 td[dir=rtl]#pdf_logo {
86 text-align: left;
87 width: 0%;
88 }
89
90 td[dir=rtl]#pdf_assoname {
91 width: 100%;
92 margin-left: 25%;
93 }
94
95 hr {
96 cap:\'\';
97 join:\'\';
98 dash:\'\';
99 phase:\'\';
100 }',
101 'model_parent' => null
102 ),
103 array(
104 'model_id' => PdfModel::INVOICE_MODEL,
105 'model_name' => '_T("Invoice")',
106 'model_title' => '_T("Invoice") {CONTRIBUTION_YEAR}-{CONTRIBUTION_ID}',
107 'model_type' => PdfModel::INVOICE_MODEL,
108 'model_header' => null,
109 'model_footer' => null,
110 'model_body' => '<table>
111 <tr>
112 <td width="300"></td>
113 <td><strong>{NAME_ADH}</strong><br/>
114 {ADDRESS_ADH}<br/>
115 <strong>{ZIP_ADH} {TOWN_ADH}</strong>
116 </td>
117 </tr>
118 <tr>
119 <td height="100"></td>
120 </tr>
121 <tr>
122 <td colspan="2">
123 <table>
124 <thead>
125 <tr>
126 <th>_T("Label")</th>
127 <th>_T("Amount")</th>
128 </tr>
129 </thead>
130 <tbody>
131 <tr>
132 <td>
133 {CONTRIBUTION_LABEL} (_T("on") {CONTRIBUTION_DATE})<br/>
134 _T("from") {CONTRIBUTION_BEGIN_DATE} _T("to") {CONTRIBUTION_END_DATE}<br/>
135 {CONTRIBUTION_PAYMENT_TYPE}<br/>
136 {CONTRIBUTION_COMMENT}
137 </td>
138 <td>{CONTRIBUTION_AMOUNT}</td>
139 </tr>
140 </tbody>
141 </table>
142 </td>
143 </tr>
144 </table>',
145 'model_styles' => null,
146 'model_parent' => PdfModel::MAIN_MODEL
147 ),
148 array(
149 'model_id' => PdfModel::RECEIPT_MODEL,
150 'model_name' => '_T("Receipt")',
151 'model_title' => '_T("Receipt") {CONTRIBUTION_YEAR}-{CONTRIBUTION_ID}',
152 'model_type' => PdfModel::RECEIPT_MODEL,
153 'model_header' => null,
154 'model_footer' => null,
155 'model_body' => '<table>
156 <tr>
157 <td width="300"></td>
158 <td><strong>{NAME_ADH}</strong><br/>
159 {ADDRESS_ADH}<br/>
160 <strong>{ZIP_ADH} {TOWN_ADH}</strong>
161 </td>
162 </tr>
163 <tr>
164 <td height="100"></td>
165 </tr>
166 <tr>
167 <td colspan="2">
168 <table>
169 <thead>
170 <tr>
171 <th>_T("Label")</th>
172 <th>_T("Amount")</th>
173 </tr>
174 </thead>
175 <tbody>
176 <tr>
177 <td>
178 {CONTRIBUTION_LABEL} (_T("on") {CONTRIBUTION_DATE})<br/>
179 _T("from") {CONTRIBUTION_BEGIN_DATE} _T("to") {CONTRIBUTION_END_DATE}<br/>
180 {CONTRIBUTION_PAYMENT_TYPE}<br/>
181 {CONTRIBUTION_COMMENT}
182 </td>
183 <td>{CONTRIBUTION_AMOUNT}</td>
184 </tr>
185 </tbody>
186 </table>
187 </td>
188 </tr>
189 </table>',
190 'model_styles' => null,
191 'model_parent' => PdfModel::MAIN_MODEL
192 ),
193 array(
194 'model_id' => PdfModel::ADHESION_FORM_MODEL,
195 'model_name' => '_T("Adhesion form")',
196 'model_title' => '_T("Adhesion form")',
197 'model_type' => PdfModel::ADHESION_FORM_MODEL,
198 'model_header' => null,
199 'model_footer' => null,
200 'model_body' => '<hr/>
201 <div class="infos">_T("Complete the following form and send it with your funds, in order to complete your subscription.")</div>
202 <table>
203 <tr>
204 <td width="50%"></td>
205 <td width="50%">{ASSO_ADDRESS_MULTI}</td>
206 </tr>
207 </table>
208 <hr/>
209 <table>
210 <tr>
211 <td height="30"></td>
212 </tr>
213 <tr>
214 <td>
215 <table>
216 <tr>
217 <td class="boxlabel">_T("Required membership:")</td>
218 <td class="box"><input type="radio" name="cotisation" value="none1"></td><td class="boxlabel">_T("Active member")</td>
219 <td class="box"><input type="radio" class="box" name="cotisation" value="none2"></td><td class="boxlabel">_T("Benefactor member")</td>
220 <td class="box"><input type="radio" class="box" name="cotisation" value="none3"></td><td class="boxlabel">_T("Donation")</td>
221 </tr>
222 </table>
223 <div class="infos">_T("The minimum contribution for each type of membership are defined on the website of the association. The amount of donations are free to be decided by the generous donor.") </div>
224 </td>
225 </tr>
226 <tr>
227 <td height="30"></td>
228 </tr>
229 </table>
230 <table class="member">
231 <tr>
232 <td class="label">_T("Politeness")</td>
233 <td class="input">{TITLE_ADH}</td>
234 </tr>
235 <tr>
236 <td class="label">_T("Name")</td>
237 <td class="input">{LAST_NAME_ADH}</td>
238 </tr>
239 <tr>
240 <td class="label">_T("First name")</td>
241 <td class="input">{FIRST_NAME_ADH}</td>
242 </tr>
243 <tr>
244 <td class="label">_T("Company name") *</td>
245 <td class="input">{COMPANY_ADH}</td>
246 </tr>
247 <tr>
248 <td class="label">_T("Address")</td>
249 <td class="input">{ADDRESS_ADH}</td>
250 </tr>
251 <tr>
252 <td class="label"></td>
253 <td class="input"></td>
254 </tr>
255 <tr>
256 <td class="label"></td>
257 <td class="input"></td>
258 </tr>
259 <tr>
260 <td class="label">_T("Zip Code")</td>
261 <td class="cpinput">{ZIP_ADH}</td>
262 <td class="label">_T("City")</td>
263 <td class="towninput">{TOWN_ADH}</td>
264 </tr>
265 <tr>
266 <td class="label">_T("Country")</td>
267 <td class="input">{COUNTRY_ADH}</td>
268 </tr>
269 <tr>
270 <td class="label">_T("Email address")</td>
271 <td class="input">{EMAIL_ADH}</td>
272 </tr>
273 <tr>
274 <td class="label">_T("Username") **</td>
275 <td class="input">{LOGIN_ADH}</td>
276 </tr>
277 <tr>
278 <td colspan="2" height="10"></td>
279 </tr>
280 <tr>
281 <td class="label">_T("Amount")</td>
282 <td class="input"></td>
283 </tr>
284 </table>
285 <p>str_replace(\'%s\', \'{ASSO_NAME}\', \'_T("Hereby, I agree to comply to %s association statutes and its rules.")\')</p><p>_T("At ................................................")</p><p>_T("On .......... / .......... / .......... ")</p><p>_T("Signature")</p>
286 <p class="notes">_T("* Only for compagnies")<br/>_T("** Galette identifier, if applicable")</p>',
287 'model_styles' => 'td.label {
288 width: 20%;
289 font-weight: bold;
290 }
291 td.input {
292 width: 80%;
293 border-bottom: 1px dotted black;
294 }
295
296 td.cpinput {
297 width: 10%;
298 border-bottom: 1px dotted black;
299 }
300
301 td.towninput {
302 width: 50%;
303 border-bottom: 1px dotted black;
304 }
305
306 div.infos {
307 font-size: .8em;
308 }
309
310 p.notes {
311 font-size: 0.6em;
312 text-align: right;
313 }
314
315 .member td {
316 line-height: 20px;
317 height: 20px;
318 }
319
320 td.boxlabel {
321 width: 20%;
322 }
323
324 td.box {
325 width: 5%;
326 }',
327 'model_parent' => PdfModel::MAIN_MODEL
328 )
329 );