@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $id = GETPOST('id', 'int') ?: GETPOST('idBBC_vols', 'int'); |
| 45 | 45 | $action = GETPOST('action', 'alpha'); |
| 46 | -$permissiondellink=$user->rights->flightlog->vol->financial; |
|
| 46 | +$permissiondellink = $user->rights->flightlog->vol->financial; |
|
| 47 | 47 | |
| 48 | 48 | $object = new Bbcvols($db); |
| 49 | 49 | $extrafields = new ExtraFields($db); |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
| 63 | 63 | |
| 64 | 64 | // Load object |
| 65 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 66 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
| 65 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 66 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
| 67 | 67 | |
| 68 | 68 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
| 69 | 69 | $hookmanager->initHooks(array('bbcvols')); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | print '<div class="tabsAction">' . "\n"; |
| 100 | 100 | print '</div>' . "\n"; |
| 101 | 101 | |
| 102 | -if($user->rights->flightlog->vol->financial){ |
|
| 102 | +if ($user->rights->flightlog->vol->financial) { |
|
| 103 | 103 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
| 104 | 104 | $form->showLinkedObjectBlock($object); |
| 105 | 105 | print '</div></div>'; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $id = GETPOST('id', 'int') ?: GETPOST('idBBC_vols', 'int'); |
| 45 | 45 | $action = GETPOST('action', 'alpha'); |
| 46 | -$permissiondellink=$user->rights->flightlog->vol->financial; |
|
| 46 | +$permissiondellink = $user->rights->flightlog->vol->financial; |
|
| 47 | 47 | |
| 48 | 48 | $object = new Bbcvols($db); |
| 49 | 49 | $extrafields = new ExtraFields($db); |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
| 63 | 63 | |
| 64 | 64 | // Load object |
| 65 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 66 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
| 65 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 66 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
| 67 | 67 | |
| 68 | 68 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
| 69 | 69 | $hookmanager->initHooks(array('bbcvols')); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | print '<tr><td class="fieldrequired">' . $langs->trans("Fielddate") . '</td><td>' . dol_print_date($object->date) . '</td></tr>'; |
| 94 | 94 | |
| 95 | 95 | if ($user->rights->flightlog->vol->financial) { |
| 96 | - print '<tr><td class="fieldrequired">' . $langs->trans("Fieldis_facture") . '</td><td>' . $object->getLibStatut(5). '</td></tr>'; |
|
| 96 | + print '<tr><td class="fieldrequired">' . $langs->trans("Fieldis_facture") . '</td><td>' . $object->getLibStatut(5) . '</td></tr>'; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | print '<tr><td class="fieldrequired">' . $langs->trans("Fieldkilometers") . '</td><td>' . $object->kilometers . ' KM</td></tr>'; |
@@ -107,13 +107,13 @@ discard block |
||
| 107 | 107 | // Buttons |
| 108 | 108 | print '<div class="tabsAction">' . "\n"; |
| 109 | 109 | |
| 110 | -if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()){ |
|
| 111 | - 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"; |
|
| 110 | +if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()) { |
|
| 111 | + 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"; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | print '</div>' . "\n"; |
| 115 | 115 | |
| 116 | -if($user->rights->flightlog->vol->financial){ |
|
| 116 | +if ($user->rights->flightlog->vol->financial) { |
|
| 117 | 117 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
| 118 | 118 | $form->showLinkedObjectBlock($object); |
| 119 | 119 | print '</div></div>'; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $id = GETPOST('id', 'int') ?: GETPOST('idBBC_vols', 'int'); |
| 45 | 45 | $action = GETPOST('action', 'alpha'); |
| 46 | -$permissiondellink=$user->rights->flightlog->vol->financial; |
|
| 46 | +$permissiondellink = $user->rights->flightlog->vol->financial; |
|
| 47 | 47 | |
| 48 | 48 | $object = new Bbcvols($db); |
| 49 | 49 | $extrafields = new ExtraFields($db); |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
| 63 | 63 | |
| 64 | 64 | // Load object |
| 65 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 66 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
| 65 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 66 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
| 67 | 67 | |
| 68 | 68 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
| 69 | 69 | $hookmanager->initHooks(array('bbcvols')); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | print '<div class="tabsAction">' . "\n"; |
| 100 | 100 | print '</div>' . "\n"; |
| 101 | 101 | |
| 102 | -if($user->rights->flightlog->vol->financial){ |
|
| 102 | +if ($user->rights->flightlog->vol->financial) { |
|
| 103 | 103 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
| 104 | 104 | $form->showLinkedObjectBlock($object); |
| 105 | 105 | print '</div></div>'; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $adherent = new Adherent($db); |
| 129 | 129 | $adherent->fetch($expenseNoteUser->fk_member); |
| 130 | 130 | |
| 131 | - $addBonus = (int)$additionalBonus[$currentMissionUserId]; |
|
| 131 | + $addBonus = (int) $additionalBonus[$currentMissionUserId]; |
|
| 132 | 132 | if ($addBonus < 0) { |
| 133 | 133 | dol_htmloutput_mesg("Facture ignorée " . $adherent->getFullName($langs), '', 'warning'); |
| 134 | 134 | continue; |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | $object->insert_discount($discountid); |
| 351 | 351 | |
| 352 | 352 | //Instructeur / examinateur |
| 353 | - if($value['orga_T6']['count'] > 0){ |
|
| 353 | + if ($value['orga_T6']['count'] > 0) { |
|
| 354 | 354 | $pu_ht = price2num($value['orga_T6']['count'] * 50, 'MU'); |
| 355 | 355 | $desc = $year . " - Vols dont vous êtes instructeur/examinateur - (" . $value['orga_T6']['count'] . " * 50)"; |
| 356 | 356 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | //Additional bonus |
| 362 | - if ((int)$addBonus > 0) { |
|
| 362 | + if ((int) $addBonus > 0) { |
|
| 363 | 363 | |
| 364 | 364 | $pu_ht = price2num($addBonus, 'MU'); |
| 365 | 365 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Type 2 : Baptême") . '</td>'; |
| 156 | 156 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Organisateur (T1/T2)") . '</td>'; |
| 157 | 157 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Instructeur (orga T6)") . '</td>'; |
| 158 | - print '<td class="liste_titre" >' . $langs->trans("Total bonus") . '</td>'; |
|
| 158 | + print '<td class="liste_titre" >' . $langs->trans("Total bonus") . '</td>'; |
|
| 159 | 159 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Type 3 : Privé") . '</td>'; |
| 160 | 160 | print '<td class="liste_titre" colspan="2">' . $langs->trans("Type 4: Meeting") . '</td>'; |
| 161 | 161 | print '<td class="liste_titre" colspan="1">' . $langs->trans("Type 5: Chambley") . '</td>'; |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | print "<tr>"; |
| 260 | 260 | print "<td colspan='20'></td>"; |
| 261 | 261 | print "<td>Total à reçevoir</td>"; |
| 262 | - print "<td>".price($total)."€</td>"; |
|
| 262 | + print "<td>" . price($total) . "€</td>"; |
|
| 263 | 263 | print "</tr>"; |
| 264 | 264 | |
| 265 | 265 | print '</tbody>'; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | $isAllowedEdit = ($user->rights->flightlog->vol->edit || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id)); |
| 68 | 68 | $isAllowedDelete = ($user->rights->flightlog->vol->delete || ($user->rights->flightlog->vol->add && $object->fk_pilot == $user->id && !$object->is_facture)); |
| 69 | -$permissiondellink=$user->rights->flightlog->vol->financial; |
|
| 69 | +$permissiondellink = $user->rights->flightlog->vol->financial; |
|
| 70 | 70 | |
| 71 | 71 | $search_idBBC_vols = GETPOST('search_idBBC_vols', 'int'); |
| 72 | 72 | $search_lieuD = GETPOST('search_lieuD', 'alpha'); |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); |
| 114 | 114 | |
| 115 | 115 | // Load object |
| 116 | -include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 117 | -include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; |
|
| 116 | +include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals |
|
| 117 | +include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; |
|
| 118 | 118 | |
| 119 | 119 | // Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array |
| 120 | 120 | $hookmanager->initHooks(array('bbcvols')); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $parameters = array(); |
| 141 | 141 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
| 142 | - $action); // Note that $action and $object may have been modified by some hooks |
|
| 142 | + $action); // Note that $action and $object may have been modified by some hooks |
|
| 143 | 143 | if ($reshook < 0) { |
| 144 | 144 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 145 | 145 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | header("Location: " . $urltogo); |
| 198 | 198 | exit; |
| 199 | 199 | } |
| 200 | - else{ |
|
| 200 | + else { |
|
| 201 | 201 | // Creation KO |
| 202 | 202 | if (!empty($object->errors)) { |
| 203 | 203 | setEventMessages(null, $object->errors, 'errors'); |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | print '<div class="tabsAction">' . "\n"; |
| 482 | 482 | $parameters = array(); |
| 483 | 483 | $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, |
| 484 | - $action); // Note that $action and $object may have been modified by hook |
|
| 484 | + $action); // Note that $action and $object may have been modified by hook |
|
| 485 | 485 | if ($reshook < 0) { |
| 486 | 486 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
| 487 | 487 | } |
@@ -494,13 +494,13 @@ discard block |
||
| 494 | 494 | print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete">' . $langs->trans('Delete') . '</a></div>' . "\n"; |
| 495 | 495 | } |
| 496 | 496 | |
| 497 | - if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()){ |
|
| 498 | - 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"; |
|
| 497 | + if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()) { |
|
| 498 | + 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"; |
|
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | print '</div>' . "\n"; |
| 502 | 502 | |
| 503 | - if($user->rights->flightlog->vol->financial){ |
|
| 503 | + if ($user->rights->flightlog->vol->financial) { |
|
| 504 | 504 | print '<div class="fichecenter"><div class="fichehalfleft">'; |
| 505 | 505 | $form->showLinkedObjectBlock($object); |
| 506 | 506 | print '</div></div>'; |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | |
| 19 | -require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; |
|
| 19 | +require_once DOL_DOCUMENT_ROOT . '/core/triggers/dolibarrtriggers.class.php'; |
|
| 20 | 20 | dol_include_once('/flightlog/class/bbcvols.class.php'); |
| 21 | 21 | dol_include_once('/core/class/CMailFile.class.php'); |
| 22 | 22 | |
@@ -78,23 +78,23 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) |
| 80 | 80 | { |
| 81 | - if (empty($conf->flightlog->enabled) || empty($conf->workflow->enabled)){ |
|
| 81 | + if (empty($conf->flightlog->enabled) || empty($conf->workflow->enabled)) { |
|
| 82 | 82 | return 0; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - if(empty($conf->global->WORKFLOW_BBC_FLIGHTLOG_SEND_MAIL_ON_INCIDENT)){ |
|
| 85 | + if (empty($conf->global->WORKFLOW_BBC_FLIGHTLOG_SEND_MAIL_ON_INCIDENT)) { |
|
| 86 | 86 | return 0; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - if($action !== 'BBC_FLIGHT_LOG_ADD_FLIGHT'){ |
|
| 89 | + if ($action !== 'BBC_FLIGHT_LOG_ADD_FLIGHT') { |
|
| 90 | 90 | return 0; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - if(empty(trim($object->incidents)) && empty(trim($object->remarque))){ |
|
| 93 | + if (empty(trim($object->incidents)) && empty(trim($object->remarque))) { |
|
| 94 | 94 | return 0; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | - if(!empty($conf->global->MAIN_DISABLE_ALL_MAILS)){ |
|
| 97 | + if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) { |
|
| 98 | 98 | return 0; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | ); |
| 128 | 128 | |
| 129 | 129 | |
| 130 | - if (! $mailfile->sendfile()) |
|
| 130 | + if (!$mailfile->sendfile()) |
|
| 131 | 131 | { |
| 132 | 132 | dol_syslog("Error while sending mail in flight log module : incident", LOG_ERR); |
| 133 | 133 | } |
@@ -341,7 +341,7 @@ |
||
| 341 | 341 | */ |
| 342 | 342 | private function initPermissions() |
| 343 | 343 | { |
| 344 | - $this->rights = array(); // Permission array used by this module |
|
| 344 | + $this->rights = array(); // Permission array used by this module |
|
| 345 | 345 | $r = 0; |
| 346 | 346 | |
| 347 | 347 | $this->rights[$r][0] = 9993; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $vol->cost = $_POST['cost']; |
| 49 | 49 | $vol->fk_receiver = $_POST['fk_receiver']; |
| 50 | 50 | $vol->justif_kilometers = $_POST['justif_kilometers']; |
| 51 | - $isGroupedFlight = (int)GETPOST('grouped_flight', 'int',2) === 1; |
|
| 51 | + $isGroupedFlight = (int) GETPOST('grouped_flight', 'int', 2) === 1; |
|
| 52 | 52 | |
| 53 | 53 | //verification des heures |
| 54 | 54 | $patern = '#[0-9]{4}#'; |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $msg = '<div class="error">Erreur ce type de vol doit être payant.</div>'; |
| 88 | 88 | $error++; |
| 89 | 89 | } |
| 90 | - if($vol->getFlightType()->isBillingRequired() && !$vol->hasReceiver()){ |
|
| 90 | + if ($vol->getFlightType()->isBillingRequired() && !$vol->hasReceiver()) { |
|
| 91 | 91 | $msg = '<div class="error">Erreur ce type de vol doit être payant, mais personne n\'a été signalé comme recepteur d\'argent.</div>'; |
| 92 | 92 | $error++; |
| 93 | 93 | } |