Issues (188)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

card.php (12 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/* Copyright (C) 2007-2015 Laurent Destailleur  <[email protected]>
3
 * Copyright (C) ---Put here your own copyright and developer email---
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation; either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
/**
20
 *    \file       flightlog/bbcvols_card.php
21
 *        \ingroup    flightlog
22
 *        \brief      This file is an example of a php page
23
 *                    Initialy built by build_class_from_table on 2017-02-09 11:10
24
 */
25
26
// Change this following line to use the correct relative path (../, ../../, etc)
27
$res = 0;
28
if (!$res && file_exists("../main.inc.php")) {
29
    $res = @include '../main.inc.php';
30
}                    // to work if your module directory is into dolibarr root htdocs directory
31
if (!$res && file_exists("../../main.inc.php")) {
32
    $res = @include '../../main.inc.php';
33
}            // to work if your module directory is into a subdir of root htdocs directory
34
if (!$res && file_exists("../../../dolibarr/htdocs/main.inc.php")) {
35
    $res = @include '../../../dolibarr/htdocs/main.inc.php';
36
}     // Used on dev env only
37
if (!$res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) {
38
    $res = @include '../../../../dolibarr/htdocs/main.inc.php';
39
}   // Used on dev env only
40
if (!$res) {
41
    die("Include of main fails");
42
}
43
// Change this following line to use the correct relative path from htdocs
44
include_once(DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php');
45
46
dol_include_once('/flightlog/flightlog.inc.php');
47
dol_include_once('/flightlog/class/bbcvols.class.php');
48
dol_include_once('/flightlog/class/bbctypes.class.php');
49
dol_include_once('/flightlog/lib/card.lib.php');
50
dol_include_once('/flightlog/lib/PilotService.php');
51
dol_include_once('/flightballoon/class/bbc_ballons.class.php');
52
dol_include_once('/user/class/usergroup.class.php');
53
54
global $langs, $user, $conf;
55
56
const ACTION_FLAG_BILLED = 'action_flag_bill';
57
const ACTION_CONFIRM_FLAG_BILLED = 'confirm_flag_bill';
58
59
// Load traductions files requiredby by page
60
$langs->load("mymodule@flightlog");
61
$langs->load("other");
62
63
// Get parameters
64
$id = GETPOST('id', 'int') ?: GETPOST('idBBC_vols', 'int');
65
$action = GETPOST('action', 'alpha');
66
$cancel = GETPOST('cancel');
67
$backtopage = GETPOST('backtopage');
68
$myparam = GETPOST('myparam', 'alpha');
69
70
$isAllowedEdit = ($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id));
71
$isAllowedDelete = ($user->rights->flightlog->vol->delete || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id && !$object->is_facture));
72
$permissiondellink = $user->rights->flightlog->vol->financial;
73
74
$search_idBBC_vols = GETPOST('search_idBBC_vols', 'int');
75
$search_lieuD = GETPOST('search_lieuD', 'alpha');
76
$search_lieuA = GETPOST('search_lieuA', 'alpha');
77
$search_heureD = GETPOST('search_heureD', 'alpha');
78
$search_heureA = GETPOST('search_heureA', 'alpha');
79
$search_BBC_ballons_idBBC_ballons = GETPOST('search_BBC_ballons_idBBC_ballons', 'int');
80
$search_nbrPax = GETPOST('search_nbrPax', 'int');
81
$search_remarque = GETPOST('search_remarque', 'alpha');
82
$search_incidents = GETPOST('search_incidents', 'alpha');
83
$search_fk_type = GETPOST('search_fk_type', 'int');
84
$search_fk_pilot = GETPOST('search_fk_pilot', 'int');
85
$search_fk_organisateur = GETPOST('search_fk_organisateur', 'int');
86
$search_is_facture = GETPOST('search_is_facture', 'int');
87
$search_kilometers = GETPOST('search_kilometers', 'int');
88
$search_cost = GETPOST('search_cost', 'alpha');
89
$search_fk_receiver = GETPOST('search_fk_receiver', 'int');
90
$search_justif_kilometers = GETPOST('search_justif_kilometers', 'alpha');
91
92
$pageTitle = "Fiche vol " . $id;
93
94
if (!$user->rights->flightlog->vol->access) {
95
    accessforbidden($langs->trans("Tu n'as pas accès au vol"));
96
}
97
98
if (empty($action) && empty($id) && empty($ref)) {
99
    $action = 'view';
100
}
101
102
$object = new Bbcvols($db);
103
$extrafields = new ExtraFields($db);
104
105
$receiver = new User($db);
106
107
$pilotService = new PilotService($db);
108
$pilot = new User($db);
109
110
$organisator = new User($db);
111
112
$flightType = new Bbctypes($db);
113
$balloon = new Bbc_ballons($db);
114
115
// fetch optionals attributes and labels
116
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
117
118
// Load object
119
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
120
include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
121
122
// Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
123
$hookmanager->initHooks(array('bbcvols'));
124
$object->ref = $object->idBBC_vols;
125
$receiver->fetch($object->fk_receiver);
126
$pilot->fetch($object->fk_pilot);
127
$organisator->fetch($object->fk_organisateur);
128
$flightType->fetch($object->fk_type);
129
$balloon->fetch($object->BBC_ballons_idBBC_ballons);
130
131
$formFlight = new \flightlog\form\FlightForm(new FlightValidator($langs, $db, $conf->global->BBC_FLIGHT_TYPE_CUSTOMER), $object, $db, $conf->global);
132
$formFlight->bind($object);
133
134
135
if (($action == "update" || $action == "edit") && !($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id))) {
136
    setEventMessage("Ceci n'est pas un de tes vols tu ne peux l'editer ! ", 'errors');
137
    $action = 'view';
138
}
139
140
/*******************************************************************
141
 * ACTIONS
142
 *
143
 * Put here all code to do according to value of "action" parameter
144
 ********************************************************************/
145
146
$parameters = array();
147
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object,
148
    $action);    // Note that $action and $object may have been modified by some hooks
149
if ($reshook < 0) {
150
    setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
151
}
152
153
if (empty($reshook)) {
154
155
    // Action to update record
156
    if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) && $action == 'update') {
157
158
        $formFlight->setData($_POST);
159
160
        // action : edit
161
        if ($formFlight->validate()) {
162
            /** @var Bbcvols $object */
163
            $object = $formFlight->getObject();
164
            $result = $object->update($user);
165
            if ($result > 0) {
166
                $action = 'view';
167
168
                $object->id = $object->idBBC_vols;
169
                $receiver->fetch($object->fk_receiver);
170
                $pilot->fetch($object->fk_pilot);
171
                $organisator->fetch($object->fk_organisateur);
172
                $flightType->fetch($object->fk_type);
173
                $balloon->fetch($object->BBC_ballons_idBBC_ballons);
174
175 View Code Duplication
            } else {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
176
                // Creation KO
177
                if (!empty($object->errors)) {
178
                    setEventMessages(null, $object->errors, 'errors');
179
                } else {
180
                    setEventMessages($object->error, null, 'errors');
181
                }
182
                $action = 'edit';
183
            }
184
        } else {
185
            $action = 'edit';
186
        }
187
    }
188
189
    // Action to delete
190
    if ($action == 'confirm_delete') {
191
        $result = $object->delete($user);
192
        if ($result > 0) {
193
            // Delete OK
194
            setEventMessages("RecordDeleted", null, 'mesgs');
195
            header("Location: " . dol_buildpath('/flightlog/list.php', 1));
196
            exit;
197 View Code Duplication
        } else {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
198
            if (!empty($object->errors)) {
199
                setEventMessages(null, $object->errors, 'errors');
200
            } else {
201
                setEventMessages($object->error, null, 'errors');
202
            }
203
        }
204
    }
205
206
    // Action to delete
207
    if ($user->rights->flightlog->vol->financial && !$object->isBilled() && $action === ACTION_CONFIRM_FLAG_BILLED) {
208
        $result = $object
209
            ->bill()
210
            ->update($user);
211
212
        if ($result > 0) {
213
            setEventMessages("Facturé", null, 'mesgs');
214
            $action = 'show';
215 View Code Duplication
        } else {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
216
            if (!empty($object->errors)) {
217
                setEventMessages(null, $object->errors, 'errors');
218
            } else {
219
                setEventMessages($object->error, null, 'errors');
220
            }
221
        }
222
    }
223
}
224
225
226
/***************************************************
227
 * VIEW
228
 *
229
 * Put here all code to build page
230
 ****************************************************/
231
232
llxHeader('', $pageTitle, '');
233
234
$form = new Form($db);
235
236
// Put here content of your page
237
238
print '<script type="text/javascript" language="javascript">
239
jQuery(document).ready(function() {
240
	function init_myfunc()
241
	{
242
		jQuery("#myid").removeAttr(\'disabled\');
243
		jQuery("#myid").attr(\'disabled\',\'disabled\');
244
	}
245
	init_myfunc();
246
	jQuery("#mybutton").click(function() {
247
		init_myfunc();
248
	});
249
});
250
</script>';
251
252
253
// Part to edit record
254
if (($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id )) && ($id || $ref) && $action == 'edit'): ?>
255
256
    <?php $renderer = new \flightlog\form\SimpleFormRenderer(); ?>
257
258
    <div class="errors error-messages">
259
        <?php
260
        foreach ($formFlight->getErrorMessages() as $errorMessage) {
261
            print sprintf('<div class="error"><span>%s</span></div>', $errorMessage);
262
        }
263
        ?>
264
    </div>
265
266
    <form class="flight-form js-form" name='add' action="card.php?rowid=<?php echo $object->getId(); ?>" method="POST">
267
        <input type="hidden" name="action" value="update"/>
268
269
        <?php echo $renderer->render($formFlight->getElement('idBBC_vols')); ?>
270
271
        <!-- Date et heures -->
272 View Code Duplication
        <?php if($formFlight->has('fk_type')): ?>
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
273
        <section class="form-section">
274
            <h1 class="form-section-title"><?php echo $langs->trans('Type de vol'); ?></h1>
275
            <table class="border" width="50%">
276
277
                <tr>
278
                    <td class="fieldrequired" width="25%"> Type du vol</td>
279
                    <td ><?php echo $renderer->render($formFlight->getElement('fk_type')); ?></td>
280
                </tr>
281
            </table>
282
        </section>
283
        <?php endif; ?>
284
285
        <section class="form-section">
286
            <h1 class="form-section-title"><?php echo $langs->trans('Pilote & ballon') ?></h1>
287
            <table class="border" width="50%">
288
289 View Code Duplication
                <?php if($formFlight->has('fk_pilot')): ?>
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
290
                <tr>
291
                    <td class="fieldrequired"> Pilote </td>
292
                    <td><?php echo $renderer->render($formFlight->getElement('fk_pilot'),['ajax' => true]); ?></td>
293
                </tr>
294
                <?php endif; ?>
295
296
                <?php if($formFlight->has('BBC_ballons_idBBC_ballons')): ?>
297
                <tr>
298
                    <td width="25%" class="fieldrequired">Ballon</td>
299
                    <td><?php echo $renderer->render($formFlight->getElement('BBC_ballons_idBBC_ballons')); ?></td>
300
                </tr>
301
                <?php endif; ?>
302
303
                <tr>
304
                    <td>Il y'avait-il plusieurs ballons ?</td>
305
                    <td colspan="3"><input type="checkbox" value="1" name="grouped_flight"/> - Oui</td>
306
                </tr>
307
            </table>
308
        </section>
309
310
        <section class="form-section">
311
            <h1 class="form-section-title"><?php echo $langs->trans('Lieux') ?></h1>
312
            <table class="border" width="100%">
313
                <?php
314
315
                //place start
316
                print "<tr>";
317
                print '<td class="fieldrequired">Lieu de d&#233;part </td><td width="25%" >';
318
                print $renderer->render($formFlight->getElement('lieuD'));
319
                print '</td>';
320
321
                //place end
322
                print '<td class="fieldrequired">Lieu d\'arriv&#233;e </td><td>';
323
                print $renderer->render($formFlight->getElement('lieuA'));
324
                print '</td></tr>';
325
326
                ?>
327
328
            </table>
329
        </section>
330
331 View Code Duplication
        <?php if($formFlight->has('fk_organisateur')): ?>
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
332
            <section class="form-section">
333
                <h1 class="form-section-title"><span class="js-organisator-field">Organisateur</span></h1>
334
                <table class="border" width="50%">
335
                    <tr>
336
                        <td class="fieldrequired"><span class="js-organisator-field">Organisateur</span></td>
337
                        <td>
338
                            <?php
339
                            //organisateur
340
                            print $renderer->render($formFlight->getElement('fk_organisateur'),['ajax' => true]);
341
                            ?>
342
                        </td>
343
                    </tr>
344
                </table>
345
            </section>
346
        <?php endif; ?>
347
348
349
        <section class="form-section js-expensable-field">
350
            <h1 class="form-section-title"><?php echo $langs->trans('Déplacements') ?></h1>
351
            <table class="border" width="50%">
352
                <?php if($formFlight->has('kilometers')): ?>
353
                    <!-- number of kilometers done for the flight -->
354
                    <tr>
355
                        <td class="fieldrequired">Nombre de kilometres effectués pour le vol</td>
356
                        <td>
357
                            <?php print $renderer->render($formFlight->getElement('kilometers')); ?>
358
                        </td>
359
                    </tr>
360
                <?php endif; ?>
361
362
                <?php if($formFlight->has('justif_kilometers')): ?>
363
                    <!-- Justif Kilometers -->
364
                    <tr>
365
366
                        <td width="25%" class="fieldrequired">Justificatif des KM</td>
367
                        <td>
368
                            <?php print $renderer->render($formFlight->getElement('justif_kilometers')); ?>
369
                        </textarea>
370
                        </td>
371
                    </tr>
372
                <?php endif; ?>
373
            </table>
374
        </section>
375
376
        <!-- Passagers -->
377
        <section class="form-section">
378
            <h1 class="form-section-title"><?php echo $langs->trans('Passager') ?></h1>
379
            <table class="border" width="50%">
380 View Code Duplication
                <?php if($formFlight->has('nbrPax')): ?>
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
381
                    <tr>
382
                        <td class="fieldrequired"><?php echo $langs->trans('Nombre de passagers'); ?></td>
383
                        <td>
384
                            <?php print $renderer->render($formFlight->getElement('nbrPax')); ?>
385
                        </td>
386
                    </tr>
387
                <?php endif; ?>
388
389 View Code Duplication
                <?php if($formFlight->has('passengerNames')): ?>
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
390
                    <!-- passenger names -->
391
                    <tr>
392
                        <td width="25%" class="fieldrequired"><?php echo $langs->trans('Noms des passagers'); ?><br/>(Séparé
393
                            par des ; )
394
                        </td>
395
                        <td>
396
                            <?php print $renderer->render($formFlight->getElement('passengerNames')); ?>
397
                        </td>
398
                    </tr>
399
                <?php endif;?>
400
            </table>
401
        </section>
402
403
        <!-- billing information -->
404
        <section class="form-section">
405
            <h1 class="form-section-title js-billable-field"><?php echo $langs->trans('Facturation') ?></h1>
406
            <table class="border" width="50%">
407
408 View Code Duplication
                <?php if($formFlight->has('fk_receiver')): ?>
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
409
                    <!-- Money receiver -->
410
                    <tr class="js-hide-order js-billable-field">
411
                        <td class="fieldrequired"><?php echo $langs->trans('Qui a perçu l\'argent') ?></td>
412
                        <td>
413
                            <?php print $renderer->render($formFlight->getElement('fk_receiver'),['ajax' => true]); ?>
414
                        </td>
415
                    </tr>
416
                <?php endif; ?>
417
418
                <?php if($formFlight->has('cost')): ?>
419
                    <!-- Flight cost -->
420
                    <tr class="js-hide-order js-billable-field">
421
                        <td class="fieldrequired">Montant perçu</td>
422
                        <td>
423
                            <?php print $renderer->render($formFlight->getElement('cost')); ?>
424
                            &euro;
425
                        </td>
426
                    </tr>
427
                <?php endif; ?>
428
            </table>
429
        </section>
430
431
        <!-- comments -->
432
        <section class="form-section">
433
            <h1 class="form-section-title"><?php echo $langs->trans('Commentaires') ?></h1>
434
            <table class="border" width="50%">
435
436
                <?php if($formFlight->has('remarque')): ?>
437
                    <!-- commentaires -->
438
                    <tr class="">
439
                        <td class="fieldrequired"> Commentaire</td>
440
                        <td>
441
                            <?php print $renderer->render($formFlight->getElement('remarque')); ?>
442
                        </td>
443
                    </tr>
444
                <?php endif; ?>
445
446
                <?php if($formFlight->has('incidents')): ?>
447
                    <!-- incidents -->
448
                    <tr class="">
449
                        <td class="fieldrequired"> incidents</td>
450
                        <td>
451
                            <?php print $renderer->render($formFlight->getElement('incidents')); ?>
452
                        </td>
453
                    </tr>
454
                <?php endif; ?>
455
            </table>
456
        </section>
457
458
        <button class="button" type="submit">Modifier</button>
459
        <a href="card.php?id=<?php echo $object->getId(); ?>" class="btn button button-a">Annuler</a>
460
    </form>
461
462
<?php endif;
463
464
465
// Part to show record
466
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
467
    $res = $object->fetch_optionals($object->id, $extralabels);
468
469
    $head = prepareFlightTabs($object);
470
471
    dol_fiche_head($head, 'general', $langs->trans("Vol"));
472
473
    $linkback = '<a href="' . DOL_URL_ROOT . '/flightlog/list.php">' . $langs->trans("BackToList") . '</a>';
474
    print $form->showrefnav($object, "idBBC_vols", $linkback, true, "idBBC_vols");
475
476
    if ($action == 'delete') {
477
        $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'),
478
            $langs->trans('êtes-vous sure de vouloir supprimer ce vol ?'), 'confirm_delete', '', 0, 1);
479
        print $formconfirm;
480
    } elseif ($user->rights->flightlog->vol->financial  && $action == ACTION_FLAG_BILLED) {
481
        $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id,
482
            $langs->trans('Marque comme facturé'),
483
            $langs->trans('Ce vol va être marqué comme facturé, est-ce bien le cas ?'), ACTION_CONFIRM_FLAG_BILLED, '',
484
            0, 1);
485
        print $formconfirm;
486
    }
487
488
    print '<table class="border centpercent">' . "\n";
489
490
491
    print '<tr><td class="fieldrequired">' . $langs->trans("FieldidBBC_vols") . '</td><td>' . $object->idBBC_vols . '</td></tr>';
492
    print '<tr><td class="fieldrequired">' . $langs->trans("Fielddate") . '</td><td>' . dol_print_date($object->date) . '</td></tr>';
493
    print '<tr><td class="fieldrequired">' . $langs->trans("FieldlieuD") . '</td><td>' . $object->lieuD . '</td></tr>';
494
    print '<tr><td class="fieldrequired">' . $langs->trans("FieldlieuA") . '</td><td>' . $object->lieuA . '</td></tr>';
495
    print '<tr><td class="fieldrequired">' . $langs->trans("FieldheureD") . '</td><td>' . $object->heureD . '</td></tr>';
496
    print '<tr><td class="fieldrequired">' . $langs->trans("FieldheureA") . '</td><td>' . $object->heureA . '</td></tr>';
497
    print '<tr><td class="fieldrequired">' . $langs->trans("FieldBBC_ballons_idBBC_ballons") . '</td><td>' . $balloon->immat . '</td></tr>';
498
    print '<tr><td class="fieldrequired">' . $langs->trans("FieldnbrPax") . '</td><td>' . $object->nbrPax . '</td></tr>';
499
    print '<tr><td class="fieldrequired">' . $langs->trans("Noms des passagers") . '</td><td>' . $object->getPassengerNames() . '</td></tr>';
500
    print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_type") . '</td><td>' . $object->fk_type . '</td></tr>';
501
    print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_pilot") . '</td><td>' . $pilot->getNomUrl(1) . '</td></tr>';
502
    print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_organisateur") . '</td><td>' . $organisator->getNomUrl(1) . '</td></tr>';
503
504
    print '</table>';
505
506
    dol_fiche_end();
507
508
    // Buttons
509
    print '<div class="tabsAction">' . "\n";
510
    $parameters = array();
511
    $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object,
512
        $action);    // Note that $action and $object may have been modified by hook
513
    if ($reshook < 0) {
514
        setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
515
    }
516
517 View Code Duplication
    if ($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
518
        print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=edit">' . $langs->trans("Modify") . '</a></div>' . "\n";
519
    }
520
521 View Code Duplication
    if ($user->rights->flightlog->vol->delete || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id && !$object->isBilled())) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
522
        print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&amp;action=delete">' . $langs->trans('Delete') . '</a></div>' . "\n";
523
    }
524
525 View Code Duplication
    if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture() && $object->hasReceiver()) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
526
        print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/flightlog/facture.php?id=' . $object->id . '">' . $langs->trans("Facturer") . '</a></div>' . "\n";
527
    }
528
    ?>
529
530
    <?php if ($user->rights->flightlog->vol->financial && !$object->isBilled()): ?>
531
        <div class="inline-block divButAction">
532
            <a class="butAction" href="<?php echo sprintf('%s?id=%s&action=%s', $_SERVER["PHP_SELF"], $object->id,
533
                ACTION_FLAG_BILLED); ?>">
534
                <?php echo $langs->trans("Marqué comme facturé ") ?>
535
            </a>
536
        </div>
537
    <?php endif; ?>
538
539
    </div>
540
    <?php
541
    if ($user->rights->flightlog->vol->financial) {
542
        print '<div class="fichecenter"><div class="fichehalfleft">';
543
        $form->showLinkedObjectBlock($object);
544
        print '</div></div>';
545
    }
546
547
}
548
549
550
// End of page
551
llxFooter();
552
$db->close();
553