Completed
Push — master ( 8acc04...458fbe )
by Laurent
02:26
created

modFlightLog::__construct()   B

Complexity

Conditions 3
Paths 2

Size

Total Lines 69

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 2
nop 1
dl 0
loc 69
rs 8.6763
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/* Copyright (C) 2003      Rodolphe Quiedeville <[email protected]>
3
 * Copyright (C) 2004-2015 Laurent Destailleur  <[email protected]>
4
 * Copyright (C) 2005-2016 Regis Houssin        <[email protected]>
5
 *
6
 * This program is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18
 */
19
20
/**
21
 *    \defgroup   mymodule     Module MyModule
22
 *  \brief      Example of a module descriptor.
23
 *                Such a file must be copied into htdocs/mymodule/core/modules directory.
24
 *  \file       htdocs/mymodule/core/modules/modMyModule.class.php
25
 *  \ingroup    mymodule
26
 *  \brief      Description and activation file for module MyModule
27
 */
28
include_once DOL_DOCUMENT_ROOT . '/core/modules/DolibarrModules.class.php';
29
30
31
/**
32
 *  Description and activation class for module MyModule
33
 */
34
class modFlightLog extends DolibarrModules
35
{
36
    const MENU_TYPE_LEFT = 'left';
37
    const MENU_TYPE_TOP = 'top';
38
39
    /**
40
     * @var array Indexed list of export IDs
41
     *
42
     */
43
    public $export_code = array();
44
45
    /**
46
     * @var array Indexed list of export names
47
     *
48
     */
49
    public $export_label = array();
50
51
    /**
52
     * @var array Indexed list of export enabling conditions
53
     *
54
     */
55
    public $export_enabled = array();
56
57
    /**
58
     * @var array Indexed list of export required permissions
59
     *
60
     */
61
    public $export_permission = array();
62
63
    /**
64
     * @var array Indexed list of export fields
65
     *
66
     */
67
    public $export_fields_array = array();
68
69
    /**
70
     * @var array Indexed list of export entities
71
     *
72
     */
73
    public $export_entities_array = array();
74
75
    /**
76
     * @var array Indexed list of export SQL queries start
77
     *
78
     */
79
    public $export_sql_start = array();
80
81
    /**
82
     * @var array Indexed list of export SQL queries end
83
     *
84
     */
85
    public $export_sql_end = array();
86
87
    /**
88
     * @var array
89
     */
90
    public $export_TypeFields_array = [];
91
92
    /**
93
     * @var array
94
     */
95
    public $menus;
96
97
    /**
98
     * @var array
99
     */
100
    public $tabs;
101
102
    /**
103
     * @var array
104
     */
105
    public $dictionaries;
106
107
    /**
108
     * Constructor. Define names, constants, directories, boxes, permissions
109
     *
110
     * @param DoliDB $db Database handler
111
     */
112
    public function __construct($db)
113
    {
114
        parent::__construct($db);
115
116
        global $conf;
117
118
        // Id for module (must be unique).
119
        $this->numero = 500000;
120
        // Key text used to identify module (for permissions, menus, etc...)
121
        $this->rights_class = 'flightlog';
122
123
        $this->family = "Belgian Balloon Club";
124
        $this->module_position = 500;
125
        $this->name = preg_replace('/^mod/i', '', get_class($this));
126
        // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
127
        $this->description = "Pilots flight log";
128
        $this->descriptionlong = "Manage flights and flight types for the Belgian Balloon Club";
129
        $this->editor_name = 'De Coninck Laurent';
130
        $this->editor_url = 'http://www.dolibarr.org';
131
132
        // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
133
        $this->version = '1.4';
134
        // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
135
        $this->const_name = 'MAIN_MODULE_' . strtoupper($this->name);
136
        // Name of image file used for this module.
137
        // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
138
        // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
139
        $this->picto = 'flight@flightlog';
140
141
        $this->configureCss();
142
143
        // Data directories to create when module is enabled.
144
        $this->dirs = array();
145
146
        // Config pages. Put here list of php page, stored into mymodule/admin directory, to use to setup module.
147
        $this->config_page_url = [
148
            "vol.php@flightlog",
149
        ];
150
151
        // Dependencies
152
        $this->hidden = false;
153
        $this->depends = array('modFlightBalloon');
154
        $this->requiredby = array();
155
        $this->conflictwith = array();
156
        $this->phpmin = array(5, 5);
157
        $this->need_dolibarr_version = array(4, 0);
158
        $this->langfiles = array("mymodule@flightlog");
159
160
        // Constants
161
        $this->initConstants();
162
163
        if (!isset($conf->flightLog) || !isset($conf->flightLog->enabled)) {
164
            $conf->flightLog = new stdClass();
165
            $conf->flightLog->enabled = 0;
166
        }
167
168
        $this->boxes = [];
169
170
        $this->initTabs();
171
        $this->initDictionnaries();
172
        $this->initCronJobs();
173
        $this->initMenu();
174
        $this->initHooks();
175
        $this->initPermissions();
176
        $this->initExports();
177
178
        $this->activateTriggers();
179
        $this->initWorkflows();
180
    }
181
182
    /**
183
     *        Function called when module is enabled.
184
     *        The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
185
     *        It also creates data directories
186
     *
187
     * @param      string $options Options when enabling module ('', 'noboxes')
188
     *
189
     * @return     int                1 if OK, 0 if KO
190
     */
191
    public function init($options = '')
192
    {
193
        $sql = array();
194
195
        $this->_load_tables('/flightlog/sql/');
196
197
        return $this->_init($sql, $options);
198
    }
199
200
    /**
201
     * Function called when module is disabled.
202
     * Remove from database constants, boxes and permissions from Dolibarr database.
203
     * Data directories are not deleted
204
     *
205
     * @param      string $options Options when enabling module ('', 'noboxes')
206
     *
207
     * @return     int                1 if OK, 0 if KO
208
     */
209
    public function remove($options = '')
210
    {
211
        $sql = array();
212
213
        return $this->_remove($sql, $options);
214
    }
215
216
    /**
217
     * Init menu
218
     */
219
    private function initMenu()
220
    {
221
        $this->menus = array();
222
        $r = 0;
223
224
        $this->menu[$r] = array(
225
            'fk_menu' => 'fk_mainmenu=flightlog',
226
            'type' => self::MENU_TYPE_TOP,
227
            'titre' => 'Carnet de vols',
228
            'mainmenu' => 'flightlog',
229
            'leftmenu' => 'readFlight',
230
            'url' => '/flightlog/readFlights.php',
231
            'langs' => 'mylangfile',
232
            'position' => 100,
233
            'enabled' => '1',
234
            'perms' => '$user->rights->flightlog->vol->access',
235
            'target' => '',
236
            'user' => 0
237
        );
238
        $r++;
239
240
        $this->menu[$r] = array(
241
            'fk_menu' => 'fk_mainmenu=flightlog',
242
            'type' => self::MENU_TYPE_LEFT,
243
            'titre' => 'Ajouter une commande',
244
            'mainmenu' => 'flightlog',
245
            'leftmenu' => 'addOrder',
246
            'url' => '/flightlog/addOrder.php',
247
            'langs' => 'mylangfile',
248
            'position' => 101,
249
            'enabled' => '1',
250
            'perms' => '$user->rights->commande->creer',
251
            'target' => '',
252
            'user' => 2
253
        );
254
        $r++;
255
256
        $this->menu[$r] = array(
257
            'fk_menu' => 'fk_mainmenu=flightlog',
258
            'type' => self::MENU_TYPE_LEFT,
259
            'titre' => 'Mes commandes',
260
            'mainmenu' => 'flightlog',
261
            'leftmenu' => 'listOrder',
262
            'url' => '/commande/list.php?search_sale=__USERID__',
263
            'langs' => 'mylangfile',
264
            'position' => 102,
265
            'enabled' => '1',
266
            'perms' => '$user->rights->commande->creer',
267
            'target' => '',
268
            'user' => 2
269
        );
270
        $r++;
271
272
        $this->menu[$r] = array(
273
            'fk_menu' => 'fk_mainmenu=flightlog',
274
            'type' => self::MENU_TYPE_LEFT,
275
            'titre' => 'Ajouter un vol',
276
            'mainmenu' => 'flightlog',
277
            'leftmenu' => 'addFlight',
278
            'url' => '/flightlog/addFlight.php',
279
            'langs' => 'mylangfile',
280
            'position' => 102,
281
            'enabled' => '1',
282
            'perms' => '$user->rights->flightlog->vol->add',
283
            'target' => '',
284
            'user' => 2
285
        );
286
        $r++;
287
        $this->menu[$r] = array(
288
            'fk_menu' => 'fk_mainmenu=flightlog',
289
            'type' => self::MENU_TYPE_LEFT,
290
            'titre' => 'Visualisation',
291
            'mainmenu' => 'flightlog',
292
            'leftmenu' => 'showFlight',
293
            'url' => '/flightlog/readFlights.php',
294
            'langs' => 'mylangfile',
295
            'position' => 103,
296
            'enabled' => '1',
297
            'perms' => '1',
298
            'target' => '',
299
            'user' => 2
300
        );
301
        $this->menu[$r] = array(
302
            'fk_menu' => 'fk_mainmenu=flightlog',
303
            'type' => self::MENU_TYPE_LEFT,
304
            'titre' => 'Les vols',
305
            'mainmenu' => 'flightlog',
306
            'leftmenu' => 'flightlog',
307
            'url' => '/flightlog/list.php',
308
            'langs' => 'mylangfile',
309
            'position' => 104,
310
            'enabled' => '1',
311
            'perms' => '1',
312
            'target' => '',
313
            'user' => 2
314
        );
315
        $r++;
316
        $this->menu[$r] = array(
317
            'fk_menu' => 'fk_mainmenu=flightlog',
318
            'type' => self::MENU_TYPE_LEFT,
319
            'titre' => 'Gestion',
320
            'mainmenu' => 'flightlog',
321
            'leftmenu' => 'management',
322
            'url' => '',
323
            'langs' => 'mylangfile',
324
            'position' => 105,
325
            'enabled' => '1',
326
            'perms' => '$user->rights->flightlog->vol->status||$user->rights->flightlog->vol->detail',
327
            'target' => '',
328
            'user' => 2
329
        );
330
        $r++;
331
        $this->menu[$r] = array(
332
            'fk_menu' => 'fk_mainmenu=flightlog,fk_leftmenu=management',
333
            'type' => self::MENU_TYPE_LEFT,
334
            'titre' => 'Payement',
335
            'mainmenu' => 'flightlog',
336
            'leftmenu' => 'flightBilling',
337
            'url' => '/flightlog/listFact.php?view=1',
338
            'langs' => 'mylangfile',
339
            'position' => 106,
340
            'enabled' => '1',
341
            'perms' => '$user->rights->flightlog->vol->financial',
342
            'target' => '',
343
            'user' => 2
344
        );
345
        $r++;
346
        $this->menu[$r] = array(
347
            'fk_menu' => 'fk_mainmenu=flightlog,fk_leftmenu=management',
348
            'type' => self::MENU_TYPE_LEFT,
349
            'titre' => 'Aviabel',
350
            'mainmenu' => 'flightlog',
351
            'leftmenu' => 'flightAviabel',
352
            'url' => '/flightlog/listFact.php?view=2',
353
            'langs' => 'mylangfile',
354
            'position' => 107,
355
            'enabled' => '1',
356
            'perms' => '$user->rights->flightlog->vol->detail',
357
            'target' => '',
358
            'user' => 2
359
        );
360
        $r++;
361
        $this->menu[$r] = array(
362
            'fk_menu' => 'fk_mainmenu=flightlog,fk_leftmenu=management',
363
            'type' => self::MENU_TYPE_LEFT,
364
            'titre' => 'Facturation mensuelle',
365
            'mainmenu' => 'flightlog',
366
            'leftmenu' => 'monthlyBill',
367
            'url' => '/flightlog/generateMonthlyBilling.php',
368
            'langs' => 'mylangfile',
369
            'position' => 108,
370
            'enabled' => '1',
371
            'perms' => '$user->rights->flightlog->vol->financial',
372
            'target' => '',
373
            'user' => 2
374
        );
375
    }
376
377
    /**
378
     * Init permissions
379
     */
380
    private function initPermissions()
381
    {
382
        $this->rights = array();        // Permission array used by this module
383
        $r = 0;
384
385
        $this->rights[$r][0] = 9993;
386
        $this->rights[$r][1] = 'Permet d\'acceder au module des vols.';
387
        $this->rights[$r][3] = 0;
388
        $this->rights[$r][4] = 'vol';
389
        $this->rights[$r][5] = 'access';
390
        $r++;
391
392
        $this->rights[$r][0] = 9998;
393
        $this->rights[$r][1] = 'Enregistrer un nouveau vol.';
394
        $this->rights[$r][3] = 0;
395
        $this->rights[$r][4] = 'vol';
396
        $this->rights[$r][5] = 'add';
397
        $r++;
398
399
        $this->rights[$r][0] = 9997;
400
        $this->rights[$r][1] = 'Permet de facturer un vol.';
401
        $this->rights[$r][3] = 0;
402
        $this->rights[$r][4] = 'vol';
403
        $this->rights[$r][5] = 'status';
404
        $r++;
405
406
        $this->rights[$r][0] = 9996;
407
        $this->rights[$r][1] = 'Permet de supprimer un vol.';
408
        $this->rights[$r][3] = 0;
409
        $this->rights[$r][4] = 'vol';
410
        $this->rights[$r][5] = 'delete';
411
        $r++;
412
413
        $this->rights[$r][0] = 9995;
414
        $this->rights[$r][1] = 'Permet de modifier tous les vols.';
415
        $this->rights[$r][3] = 0;
416
        $this->rights[$r][4] = 'vol';
417
        $this->rights[$r][5] = 'edit';
418
        $r++;
419
420
        $this->rights[$r][0] = 9994;
421
        $this->rights[$r][1] = 'affiche les details de tous les ballons et de tous les pilotes.';
422
        $this->rights[$r][3] = 0;
423
        $this->rights[$r][4] = 'vol';
424
        $this->rights[$r][5] = 'detail';
425
        $r++;
426
427
        $this->rights[$r][0] = 9999;
428
        $this->rights[$r][1] = 'Gérer les aspects financier des vols';
429
        $this->rights[$r][3] = 0;
430
        $this->rights[$r][4] = 'vol';
431
        $this->rights[$r][5] = 'financial';
432
        $r++;
433
434
        $this->rights[$r][0] = 10000;
435
        $this->rights[$r][1] = 'Gérer des documents financiers';
436
        $this->rights[$r][3] = 0;
437
        $this->rights[$r][4] = 'vol';
438
        $this->rights[$r][5] = 'financialGenerateDocuments';
439
    }
440
441
    private function initCronJobs()
442
    {
443
        $this->cronjobs = [
444
            0=>array('label'=>'bbcMonthlyFlightsBill', 'jobtype'=>'method', 'class'=>'flightlog/core/cron/BbcMonthlyFlightsBillCron.php', 'objectname'=>'BbcMonthlyFlightsBillCron', 'method'=>'run', 'parameters'=>'', 'comment'=>'Generate month bill.', 'frequency'=>1, 'unitfrequency'=>2592000),
445
        ];
446
    }
447
448
    private function initDictionnaries()
449
    {
450
        $this->initFlightTypeDictionnary();
451
    }
452
453
    private function initFlightTypeDictionnary()
454
    {
455
        $this->dictionaries = array(
456
            'langs' => 'mylangfile@mymodule',
457
            'tabname' => array(MAIN_DB_PREFIX . "bbc_types"),
458
            'tablib' => array("Types de vols"),
459
            'tabsql' => array('SELECT f.idType, f.numero, f.nom, f.active FROM ' . MAIN_DB_PREFIX . 'bbc_types as f',),
460
            'tabsqlsort' => array("numero ASC"),
461
            'tabfield' => array("idType,numero,nom"),
462
            'tabfieldvalue' => array("numero,nom"),
463
            'tabfieldinsert' => array("numero,nom"),
464
            'tabrowid' => array("idType"),
465
            'tabcond' => array('$conf->flightlog->enabled'),
466
        );
467
    }
468
469
    /**
470
     * Init hooks
471
     */
472
    private function initHooks()
473
    {
474
        if (!isset($this->module_parts["hooks"])) {
475
            $this->module_parts["hooks"] = [];
476
        }
477
478
        $this->module_parts["hooks"][] = "searchform";
479
        $this->module_parts["hooks"][] = "showLinkToObjectBlock";
480
        $this->module_parts["hooks"][] = "criccar";
481
482
    }
483
484
    private function initConstants()
485
    {
486
        $this->const = array(
487
            0 => [
488
                'BBC_FLIGHT_LOG_TAUX_REMB_KM',
489
                'chaine',
490
                '0.25',
491
                'Taux remboursement des kilomètres au BBC',
492
                true,
493
                'current',
494
                true
495
            ],
496
            1 => [
497
                'BBC_FLIGHT_LOG_UNIT_PRICE_MISSION',
498
                'chaine',
499
                '35',
500
                'Unit price special mission',
501
                true,
502
                'current',
503
                true
504
            ],
505
        );
506
    }
507
508
    /**
509
     * Init exports
510
     */
511
    private function initExports()
512
    {
513
        $r = 0;
514
        $this->addFullFlightsExport($r);
515
    }
516
517
    /**
518
     * @param int $r
519
     */
520
    private function addFullFlightsExport($r)
521
    {
522
        $this->export_code[$r] = $this->rights_class . '_' . $r;
523
        $this->export_label[$r] = 'Flights export';
524
        $this->export_enabled[$r] = '1';
525
        $this->export_permission[$r] = array(array("flightlog", "vol", "detail"));
526
        $this->export_fields_array[$r] = array(
527
            "flight.idBBC_vols" => "Identifiant",
528
            "flight.date" => "Date",
529
            "flight.lieuD" => "Lieu décollage ",
530
            "flight.lieuA" => "Lieu atterissage",
531
            "flight.heureD" => "Heure décollage",
532
            "flight.heureA" => "Heure atterissage",
533
            "flight.BBC_ballons_idBBC_ballons" => "Identifiant ballon",
534
            "flight.nbrPax" => "# pax",
535
            "flight.remarque" => "Remarque",
536
            "flight.incidents" => "Incidents",
537
            "flight.fk_type" => "Identifiant type",
538
            "flight.fk_pilot" => "Identifiant pilote",
539
            "flight.fk_organisateur" => "Identifiant organisateur",
540
            "flight.is_facture" => "Facture Oui/Non",
541
            "flight.kilometers" => "# Km",
542
            "flight.cost" => "Cout",
543
            "flight.fk_receiver" => "Identifiant receveur d'argent",
544
            "flight.justif_kilometers" => "Justificatif kilomètres",
545
            "balloon.immat" => "Immat.",
546
            "pilot.login" => "Pilote",
547
            "flightType.nom" => "Type de vol",
548
            "organisator.login" => "Organisateur",
549
            "receiver.login" => "Percepteur",
550
        );
551
552
        $this->export_TypeFields_array[$r] = [
553
            "flight.date" => "Date",
554
            "flight.lieuD" => "Text",
555
            "flight.lieuA" => "Text",
556
            "flight.heureD" => "Text",
557
            "flight.heureA" => "Text",
558
            "flight.BBC_ballons_idBBC_ballons" => implode(":", ["List", "bbc_ballons", "immat", "rowid"]),
559
            "flight.nbrPax" => "Numeric",
560
            "flight.remarque" => "Text",
561
            "flight.incidents" => "Text",
562
            "flight.fk_type" => implode(":", ["List", "bbc_types", "nom", "idType"]),
563
            "flight.fk_pilot" => implode(":", ["List", "user", "login", "rowid"]),
564
            "flight.fk_organisateur" => implode(":", ["List", "user", "login", "rowid"]),
565
            "flight.is_facture" => "Boolean",
566
            "flight.kilometers" => "Numeric",
567
            "flight.cost" => "Numeric",
568
            "flight.fk_receiver" => implode(":", ["List", "user", "login", "rowid"]),
569
            "flight.justif_kilometers" => "Text",
570
        ];
571
572
        $this->export_entities_array[$r] = array(
573
            "flight.idBBC_vols" => "Flight",
574
            "flight.date" => "Flight",
575
            "flight.lieuD" => "Flight",
576
            "flight.lieuA" => "Flight",
577
            "flight.heureD" => "Flight",
578
            "flight.heureA" => "Flight",
579
            "flight.BBC_ballons_idBBC_ballons" => "Flight",
580
            "flight.nbrPax" => "Flight",
581
            "flight.remarque" => "Flight",
582
            "flight.incidents" => "Flight",
583
            "flight.fk_type" => "Flight",
584
            "flight.fk_pilot" => "Flight",
585
            "flight.fk_organisateur" => "Flight",
586
            "flight.is_facture" => "Flight",
587
            "flight.kilometers" => "Flight",
588
            "flight.cost" => "Flight",
589
            "flight.fk_receiver" => "Flight",
590
            "flight.justif_kilometers" => "Flight",
591
            "balloon.immat" => "Balloon",
592
            "pilot.login" => "Pilot",
593
            "flightType.nom" => "FlightType",
594
            "organisator.login" => "Organisator",
595
            "receiver.login" => "Percepteur",
596
        );
597
        $this->export_sql_start[$r] = 'SELECT DISTINCT ';
598
        $this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'bbc_vols as flight';
599
        $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bbc_ballons as balloon on (flight.BBC_ballons_idBBC_ballons = balloon.rowid)';
600
        $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bbc_types as flightType on (flight.fk_type = flightType.idType)';
601
        $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'user as pilot on (flight.fk_pilot = pilot.rowid)';
602
        $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'user as organisator on (flight.fk_organisateur = organisator.rowid)';
603
        $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'user as receiver on (flight.fk_receiver = receiver.rowid)';
604
        $this->export_sql_end[$r] .= ' WHERE 1 = 1';
605
    }
606
607
    /**
608
     * Activate triggers for this module
609
     */
610
    private function activateTriggers()
611
    {
612
        $this->module_parts['triggers'] = 1;
613
    }
614
615
    /**
616
     * Initialize all workflows
617
     */
618
    private function initWorkflows()
619
    {
620
        $this->module_parts['workflow'] = [
621
            "WORKFLOW_BBC_FLIGHTLOG_SEND_MAIL_ON_INCIDENT" => [
622
                'family' => 'create',
623
                'position' => 10,
624
                'enabled' => '1',
625
                'picto' => 'order'
626
            ],
627
        ];
628
    }
629
630
    /**
631
     * Add stylesheets
632
     */
633
    private function configureCss()
634
    {
635
        $this->module_parts['css'] = [
636
            '/flightlog/css/flightlog.css',
637
        ];
638
    }
639
640
    /**
641
     * Init tabs to inject in other modules.
642
     */
643
    private function initTabs()
644
    {
645
        $this->tabs = [];
646
        $this->tabs[] = [
647
            'data'=>'project:+instruction:Vol d\'instructions:mymodule@flightlog:1:/flightlog/tabs/project/instructions.php?id=__ID__'
648
        ];
649
    }
650
651
}
652
653