1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Members;
13
14 use ICanBoogie\I18n;
15
16 use Brickrouge\Date;
17 use Brickrouge\Element;
18 use Brickrouge\Form;
19 use Brickrouge\Text;
20
21 use Icybee\Modules\Editor\RTEEditorElement;
22
23 class Module extends \Icybee\Modules\Users\Module
24 {
25 protected function block_edit(array $properties, $permission)
26 {
27 return array_merge_recursive
28 (
29 parent::block_edit($properties, $permission), array
30 (
31 Element::GROUPS => array
32 (
33 'numbers' => array
34 (
35 'title' => 'Numéros de téléphone',
36 'template' => <<<EOT
37 <table class="panel">
38 <tr><td class="label">{\$number_work.label:}</td><td>{\$number_work}</td>
39 <td class="label">{\$number_fax.label:}</td><td>{\$number_fax}</td></tr>
40 <tr><td class="label">{\$number_home.label:}</td><td>{\$number_home}</td>
41 <td class="label">{\$number_pager.label:}</td><td>{\$number_pager}</td></tr>
42 <tr><td class="label">{\$number_mobile.label:}</td><td>{\$number_mobile}</td><td colspan="2"> </td></tr>
43 </table>
44 EOT
45 ),
46
47 'private' => array
48 (
49 'title' => 'Données privées',
50 'template' => <<<EOT
51 <table class="panel">
52 <tr><td class="label">{\$street.label:}</td><td colspan="3">{\$street}</td></tr>
53 <tr><td> </td><td colspan="3">{\$street_complement}</td></tr>
54 <tr><td class="label">{\$city.label:}</td><td colspan="3">{\$city}</td></tr>
55 <tr><td class="label">{\$state.label:}</td><td>{\$state}</td>
56 <td class="label">{\$postalcode.label:}</td><td>{\$postalcode}</td></tr>
57 <tr><td class="label">{\$country.label:}</td><td colspan="3">{\$country}</td></tr>
58 <tr><td class="label">{\$webpage.label:}</td><td colspan="3">{\$webpage}</td></tr>
59 <tr><td class="label">{\$birthday.label:}</td><td colspan="3">{\$birthday}</td></tr>
60 </table>
61 EOT
62 ),
63
64 'professional' => array
65 (
66 'title' => 'Données professionnelles',
67 'template' => <<<EOT
68 <table class="panel">
69 <tr><td class="label">{\$position.label:}</td><td>{\$position}</td>
70 <td class="label">{\$service.label:}</td><td>{\$service}</td></tr>
71 <tr><td class="label">{\$company.label:}</td><td colspan="3">{\$company}</td></tr>
72 <tr><td class="label">{\$company_street.label:}</td><td colspan="3">{\$company_street}</td></tr>
73 <tr><td> </td><td colspan="3">{\$company_street_complement}</td></tr>
74 <tr><td class="label">{\$company_city.label:}</td><td colspan="3">{\$company_city}</td></tr>
75 <tr><td class="label">{\$company_state.label:}</td><td>{\$company_state}</td>
76 <td class="label">{\$company_postalcode.label:}</td><td>{\$company_postalcode}</td></tr>
77 <tr><td class="label">{\$company_country.label:}</td><td colspan="3">{\$company_country}</td></tr>
78 <tr><td class="label">{\$company_webpage.label:}</td><td colspan="3">{\$company_webpage}</td></tr>
79 </table>
80 EOT
81 ),
82
83 'misc' => array
84 (
85 'title' => 'Informations complémentaires',
86 'template' => <<<EOT
87 <table class="panel">
88 <tr><td class="label">{\$misc1.label:}</td><td>{\$misc1}</td></tr>
89 <tr><td class="label">{\$misc2.label:}</td><td>{\$misc2}</td></tr>
90 <tr><td class="label">{\$misc3.label:}</td><td>{\$misc3}</td></tr>
91 <tr><td class="label">{\$misc4.label:}</td><td>{\$misc4}</td></tr>
92 <tr><td class="label" style="vertical-align: top">{\$notes.label:}</td><td>{\$notes}</td></tr>
93 </table>
94 EOT
95 ),
96
97 'attached' => array
98 (
99 'title' => 'Pièces attachées'
100 )
101 ),
102
103 Element::CHILDREN => array
104 (
105 'salutation_code' => new Element
106 (
107 'select', array
108 (
109 Form::LABEL => '.Salutation',
110 Element::REQUIRED => true,
111 Element::GROUP => 'contact',
112 Element::WEIGHT => -10,
113 Element::OPTIONS => array
114 (
115 null => '',
116 I18n\t('salutation.misses'),
117 I18n\t('salutation.miss'),
118 I18n\t('salutation.mister')
119 )
120 )
121 ),
122
123 #
124 # numbers
125 #
126
127 'number_work' => new Text
128 (
129 array
130 (
131 Form::LABEL => 'Travail',
132 Element::GROUP => 'numbers'
133 )
134 ),
135
136 'number_home' => new Text
137 (
138 array
139 (
140 Form::LABEL => 'Domicile',
141 Element::GROUP => 'numbers'
142 )
143 ),
144
145 'number_fax' => new Text
146 (
147 array
148 (
149 Form::LABEL => 'FAX',
150 Element::GROUP => 'numbers'
151 )
152 ),
153
154 'number_pager' => new Text
155 (
156 array
157 (
158 Form::LABEL => 'Pager',
159 Element::GROUP => 'numbers'
160 )
161 ),
162
163 'number_mobile' => new Text
164 (
165 array
166 (
167 Form::LABEL => 'Mobile',
168 Element::GROUP => 'numbers'
169 )
170 ),
171
172 #
173 # private
174 #
175
176 'street' => new Text
177 (
178 array
179 (
180 Form::LABEL => 'Rue',
181 Element::GROUP => 'private'
182 )
183 ),
184
185 'street_complement' => new Text
186 (
187 array
188 (
189 Element::GROUP => 'private'
190 )
191 ),
192
193 'city' => new Text
194 (
195 array
196 (
197 Form::LABEL => 'Ville/Localité',
198 Element::GROUP => 'private'
199 )
200 ),
201
202 'state' => new Text
203 (
204 array
205 (
206 Form::LABEL => 'État/Province',
207 Element::GROUP => 'private'
208 )
209 ),
210
211 'postalcode' => new Text
212 (
213 array
214 (
215 Form::LABEL => 'Code postal',
216 Element::GROUP => 'private'
217 )
218 ),
219
220 'country' => new Text
221 (
222 array
223 (
224 Form::LABEL => 'Pays',
225 Element::GROUP => 'private'
226 )
227 ),
228
229 'webpage' => new Text
230 (
231 array
232 (
233 Form::LABEL => 'Page Web',
234 Element::GROUP => 'private'
235 )
236 ),
237
238 'birthday' => new Date
239 (
240 array
241 (
242 Form::LABEL => 'Date de naissance',
243 Element::GROUP => 'private'
244 )
245 ),
246
247 #
248 # professional
249 #
250
251 'position' => new Text
252 (
253 array
254 (
255 Form::LABEL => 'Poste',
256 Element::GROUP => 'professional'
257 )
258 ),
259
260 'service' => new Text
261 (
262 array
263 (
264 Form::LABEL => 'Service',
265 Element::GROUP => 'professional'
266 )
267 ),
268
269 'company' => new Text
270 (
271 array
272 (
273 Form::LABEL => 'Société',
274 Element::GROUP => 'professional'
275 )
276 ),
277
278 'company_street' => new Text
279 (
280 array
281 (
282 Form::LABEL => 'Rue',
283 Element::GROUP => 'professional'
284 )
285 ),
286
287 'company_street_complement' => new Text
288 (
289 array
290 (
291 Element::GROUP => 'professional'
292 )
293 ),
294
295 'company_city' => new Text
296 (
297 array
298 (
299 Form::LABEL => 'Ville/Localité',
300 Element::GROUP => 'professional'
301 )
302 ),
303
304 'company_state' => new Text
305 (
306 array
307 (
308 Form::LABEL => 'État/Province',
309 Element::GROUP => 'professional'
310 )
311 ),
312
313 'company_postalcode' => new Text
314 (
315 array
316 (
317 Form::LABEL => 'Code postal',
318 Element::GROUP => 'professional'
319 )
320 ),
321
322 'company_country' => new Text
323 (
324 array
325 (
326 Form::LABEL => 'Pays',
327 Element::GROUP => 'professional'
328 )
329 ),
330
331 'company_webpage' => new Text
332 (
333 array
334 (
335 Form::LABEL => 'Page Web',
336 Element::GROUP => 'professional'
337 )
338 ),
339
340 #
341 # miscelaneous informations
342 #
343
344 'misc1' => new Text
345 (
346 array
347 (
348 Form::LABEL => 'Divers 1',
349 Element::GROUP => 'misc'
350 )
351 ),
352
353 'misc2' => new Text
354 (
355 array
356 (
357 Form::LABEL => 'Divers 2',
358 Element::GROUP => 'misc'
359 )
360 ),
361
362 'misc3' => new Text
363 (
364 array
365 (
366 Form::LABEL => 'Divers 3',
367 Element::GROUP => 'misc'
368 )
369 ),
370
371 'misc4' => new Text
372 (
373 array
374 (
375 Form::LABEL => 'Divers 4',
376 Element::GROUP => 'misc'
377 )
378 ),
379
380 'notes' => new RTEEditorElement
381 (
382 array
383 (
384 Form::LABEL => 'Notes',
385 Element::GROUP => 'misc'
386 )
387 ),
388
389 #
390 # photo
391 #
392
393 'photo' => new \Brickrouge\File
394 (
395 array
396 (
397 Form::LABEL => 'Photo',
398 Element::GROUP => 'attached',
399 Element::FILE_WITH_LIMIT => 256,
400 Element::FILE_WITH_REMINDER => true
401 )
402 )
403 )
404 )
405 );
406 }
407 }