@@ -613,9 +613,12 @@ |
||
613 | 613 | |
614 | 614 | <?php if ($year >= $currentYear || !$t1->service || !$t2->service || !$t3->service || !$t4->service || !$t5->service || !$t6->service || !$t7->service) : ?> |
615 | 615 | <a class="butActionRefused" href="#">Générer</a> |
616 | - <?php else: ?> |
|
616 | + <?php else { |
|
617 | + : ?> |
|
617 | 618 | <button class="butAction" type="submit">Générer</button> |
618 | - <?php endif; ?> |
|
619 | + <?php endif; |
|
620 | +} |
|
621 | +?> |
|
619 | 622 | |
620 | 623 | </form> |
621 | 624 |
@@ -26,58 +26,58 @@ discard block |
||
26 | 26 | */ |
27 | 27 | class InterfaceMailOnIncident extends DolibarrTriggers |
28 | 28 | { |
29 | - /** |
|
30 | - * @var DoliDB Database handler |
|
31 | - */ |
|
32 | - protected $db; |
|
33 | - |
|
34 | - /** |
|
35 | - * Constructor |
|
36 | - * |
|
37 | - * @param DoliDB $db Database handler |
|
38 | - */ |
|
39 | - public function __construct($db) |
|
40 | - { |
|
41 | - $this->db = $db; |
|
42 | - |
|
43 | - $this->name = preg_replace('/^Interface/i', '', get_class($this)); |
|
44 | - $this->family = "Belgian balloon club"; |
|
45 | - $this->description = "Trigger that send an e-mail on flight incident."; |
|
46 | - $this->version = '1.0'; |
|
47 | - $this->picto = 'flightlog@flightlog'; |
|
48 | - } |
|
49 | - |
|
50 | - /** |
|
51 | - * Trigger name |
|
52 | - * |
|
53 | - * @return string Name of trigger file |
|
54 | - */ |
|
55 | - public function getName() |
|
56 | - { |
|
57 | - return $this->name; |
|
58 | - } |
|
59 | - |
|
60 | - /** |
|
61 | - * Trigger description |
|
62 | - * |
|
63 | - * @return string Description of trigger file |
|
64 | - */ |
|
65 | - public function getDesc() |
|
66 | - { |
|
67 | - return $this->description; |
|
68 | - } |
|
69 | - |
|
70 | - |
|
71 | - /** |
|
72 | - * @param string $action Event action code |
|
73 | - * @param Bbcvols $object Object |
|
74 | - * @param User $user Object user |
|
75 | - * @param Translate $langs Object langs |
|
76 | - * @param Conf $conf Object conf |
|
77 | - * @return int <0 if KO, 0 if no triggered ran, >0 if OK |
|
78 | - */ |
|
79 | - public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) |
|
80 | - { |
|
29 | + /** |
|
30 | + * @var DoliDB Database handler |
|
31 | + */ |
|
32 | + protected $db; |
|
33 | + |
|
34 | + /** |
|
35 | + * Constructor |
|
36 | + * |
|
37 | + * @param DoliDB $db Database handler |
|
38 | + */ |
|
39 | + public function __construct($db) |
|
40 | + { |
|
41 | + $this->db = $db; |
|
42 | + |
|
43 | + $this->name = preg_replace('/^Interface/i', '', get_class($this)); |
|
44 | + $this->family = "Belgian balloon club"; |
|
45 | + $this->description = "Trigger that send an e-mail on flight incident."; |
|
46 | + $this->version = '1.0'; |
|
47 | + $this->picto = 'flightlog@flightlog'; |
|
48 | + } |
|
49 | + |
|
50 | + /** |
|
51 | + * Trigger name |
|
52 | + * |
|
53 | + * @return string Name of trigger file |
|
54 | + */ |
|
55 | + public function getName() |
|
56 | + { |
|
57 | + return $this->name; |
|
58 | + } |
|
59 | + |
|
60 | + /** |
|
61 | + * Trigger description |
|
62 | + * |
|
63 | + * @return string Description of trigger file |
|
64 | + */ |
|
65 | + public function getDesc() |
|
66 | + { |
|
67 | + return $this->description; |
|
68 | + } |
|
69 | + |
|
70 | + |
|
71 | + /** |
|
72 | + * @param string $action Event action code |
|
73 | + * @param Bbcvols $object Object |
|
74 | + * @param User $user Object user |
|
75 | + * @param Translate $langs Object langs |
|
76 | + * @param Conf $conf Object conf |
|
77 | + * @return int <0 if KO, 0 if no triggered ran, >0 if OK |
|
78 | + */ |
|
79 | + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) |
|
80 | + { |
|
81 | 81 | if (empty($conf->flightlog->enabled) || empty($conf->workflow->enabled)){ |
82 | 82 | return 0; |
83 | 83 | } |
@@ -132,6 +132,6 @@ discard block |
||
132 | 132 | dol_syslog("Error while sending mail in flight log module : incident", LOG_ERR); |
133 | 133 | } |
134 | 134 | |
135 | - return 0; |
|
136 | - } |
|
135 | + return 0; |
|
136 | + } |
|
137 | 137 | } |
@@ -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(!$object->hasIncidents() && !$object->hasComment()){ |
|
93 | + if (!$object->hasIncidents() && !$object->hasComment()) { |
|
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 | |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | $message .= sprintf("<p>Vous recevez cet e-mail car un vol a été encodé avec un incident/ une remarque sur le ballon : %s dont vous êtes titulaire ou co-titulaire.</p>", $object->getBalloon()->immat); |
103 | 103 | $message .= sprintf("<p><b>Vol id :</b> %d</p>", $object->getId()); |
104 | 104 | $message .= sprintf("<p><b>Réalisé par :</b> %s </p>", $object->getPilot()->getFullName($langs)); |
105 | - if($object->hasComment()){ |
|
105 | + if ($object->hasComment()) { |
|
106 | 106 | $message .= sprintf("<p><b>Commentaire :</b> %s </p>", $object->getComment()); |
107 | 107 | } |
108 | 108 | |
109 | - if($object->hasIncidents()){ |
|
109 | + if ($object->hasIncidents()) { |
|
110 | 110 | $message .= sprintf("<p><b>Incident :</b> %s </p>", $object->getIncident()); |
111 | 111 | } |
112 | 112 | |
@@ -118,18 +118,18 @@ discard block |
||
118 | 118 | |
119 | 119 | $responsable = new User($user->db); |
120 | 120 | $res = $responsable->fetch($object->getBalloon()->fk_responsable); |
121 | - if($res > 0){ |
|
121 | + if ($res > 0) { |
|
122 | 122 | $to[] = $responsable->email; |
123 | 123 | } |
124 | 124 | |
125 | 125 | |
126 | 126 | $backup = new User($user->db); |
127 | 127 | $res = $backup->fetch($object->getBalloon()->fk_co_responsable); |
128 | - if($res > 0){ |
|
128 | + if ($res > 0) { |
|
129 | 129 | $to[] = $backup->email; |
130 | 130 | } |
131 | 131 | |
132 | - if(empty($to)){ |
|
132 | + if (empty($to)) { |
|
133 | 133 | return 0; |
134 | 134 | } |
135 | 135 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | ); |
150 | 150 | |
151 | 151 | |
152 | - if (! $mailfile->sendfile()) |
|
152 | + if (!$mailfile->sendfile()) |
|
153 | 153 | { |
154 | 154 | dol_syslog("Error while sending mail in flight log module : incident", LOG_ERR); |
155 | 155 | } |
@@ -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; |
@@ -25,15 +25,15 @@ discard block |
||
25 | 25 | * Actions |
26 | 26 | */ |
27 | 27 | // Save |
28 | -if($action === ACTION_SAVE){ |
|
29 | - foreach($services as $flightTypeId => $serviceId){ |
|
28 | +if ($action === ACTION_SAVE) { |
|
29 | + foreach ($services as $flightTypeId => $serviceId) { |
|
30 | 30 | $res = $flightType->fetch($flightTypeId); |
31 | - if($res > 0 ){ |
|
31 | + if ($res > 0) { |
|
32 | 32 | $flightType->fkService = $serviceId; |
33 | 33 | $flightType->update($user); |
34 | 34 | } |
35 | 35 | |
36 | - dolibarr_set_const($db, 'BBC_POINTS_BONUS_'.$flightTypeId, GETPOST('points_bonus_'.$flightTypeId), 'chaine', 0, 'Points pour le vol T'.$flightTypeId, $conf->entity); |
|
36 | + dolibarr_set_const($db, 'BBC_POINTS_BONUS_' . $flightTypeId, GETPOST('points_bonus_' . $flightTypeId), 'chaine', 0, 'Points pour le vol T' . $flightTypeId, $conf->entity); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | dolibarr_set_const($db, 'BBC_FLIGHT_TYPE_CUSTOMER', GETPOST('customer_product'), 'chaine', 0, '', $conf->entity); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | <tr class="<?= $flightTypeLine->id % 2 == 0 ? "pair" : "impair" ?>"> |
72 | 72 | <td>(T<?= $flightTypeLine->numero ?>) - <?= $flightTypeLine->nom ?></td> |
73 | 73 | <td> |
74 | - <?php $form->select_produits($flightTypeLine->fkService, 'idprod['.$flightTypeLine->id.']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?> |
|
74 | + <?php $form->select_produits($flightTypeLine->fkService, 'idprod[' . $flightTypeLine->id . ']', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?> |
|
75 | 75 | </td> |
76 | 76 | </tr> |
77 | 77 | <?php endforeach; ?> |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | </td> |
84 | 84 | <td> |
85 | 85 | <?php $form->select_produits($conf->global->BBC_FLIGHT_TYPE_CUSTOMER, 'customer_product', |
86 | - $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); ?> |
|
86 | + $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id); ?> |
|
87 | 87 | </td> |
88 | 88 | </tr> |
89 | 89 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | <label for="points_bonus_<?php echo $flightTypeLine->numero; ?>"> |
107 | 107 | (T<?php echo $flightTypeLine->numero ?>) - <?php echo $flightTypeLine->nom ?> |
108 | 108 | </label> |
109 | - <?php $prop = 'BBC_POINTS_BONUS_'.$flightTypeLine->numero; ?> |
|
109 | + <?php $prop = 'BBC_POINTS_BONUS_' . $flightTypeLine->numero; ?> |
|
110 | 110 | <input type="number" id="points_bonus_<?php echo $flightTypeLine->numero; ?>" name="points_bonus_<?php echo $flightTypeLine->numero; ?>" value="<?php echo $conf->global->$prop?>" /> |
111 | 111 | <br/> |
112 | 112 | <?php endforeach; ?> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__.'/CreateFlightBillCommandHandler.php'; |
|
4 | -require_once __DIR__.'/CreateFlightBillTransactionalCommandHandler.php'; |
|
3 | +require_once __DIR__ . '/CreateFlightBillCommandHandler.php'; |
|
4 | +require_once __DIR__ . '/CreateFlightBillTransactionalCommandHandler.php'; |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * @author Laurent De Coninck <[email protected]> |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | /** |
12 | 12 | * @return CreateFlightBillCommandHandler |
13 | 13 | */ |
14 | - public static function factory($db, $conf, $user, $langs){ |
|
14 | + public static function factory($db, $conf, $user, $langs) { |
|
15 | 15 | return new CreateFlightBillTransactionalCommandHandler($db, $conf, $user, $langs); |
16 | 16 | } |
17 | 17 |
@@ -239,9 +239,12 @@ |
||
239 | 239 | <?php echo $langs->trans('La periode demandée n\'est pas cloturée.') ?> |
240 | 240 | </p> |
241 | 241 | <a class="butActionRefused" href="#">Générer</a> |
242 | - <?php else: ?> |
|
242 | + <?php else { |
|
243 | + : ?> |
|
243 | 244 | <button class="butAction" type="submit">Générer</button> |
244 | - <?php endif; ?> |
|
245 | + <?php endif; |
|
246 | +} |
|
247 | +?> |
|
245 | 248 | |
246 | 249 | </form> |
247 | 250 | </section> |
@@ -95,7 +95,7 @@ |
||
95 | 95 | if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) { |
96 | 96 | try { |
97 | 97 | |
98 | - $command = new CreateMonthBillCommand( $type, $publicNote, $privateNote, $year, $month); |
|
98 | + $command = new CreateMonthBillCommand($type, $publicNote, $privateNote, $year, $month); |
|
99 | 99 | $handler->handle($command); |
100 | 100 | dol_htmloutput_mesg('Génération : OK'); |
101 | 101 | } catch (Exception $e) { |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | try { |
55 | 55 | |
56 | - if(date('d')>=15){ |
|
56 | + if (date('d') >= 15) { |
|
57 | 57 | dol_syslog('Monthly bill generation : date over'); |
58 | 58 | return -2; |
59 | 59 | } |
@@ -232,7 +232,7 @@ |
||
232 | 232 | <?php echo !empty($flight->linkedObjectsIds) && in_array($currentTask->id, |
233 | 233 | $flight->linkedObjectsIds[$currentTask->table_element]) ? 'checked' : '' ?> |
234 | 234 | /> |
235 | - <?php else: ?> |
|
235 | + <?php else : ?> |
|
236 | 236 | |
237 | 237 | <?php if (!empty($flight->linkedObjectsIds) && in_array($currentTask->id, |
238 | 238 | $flight->linkedObjectsIds[$currentTask->table_element])): ?> |
@@ -211,8 +211,11 @@ discard block |
||
211 | 211 | <?php if ($userWrite): ?> |
212 | 212 | <?php echo $formOther->select_percent($currentTask->progress, |
213 | 213 | sprintf('progression[%s]', $currentTask->id, false, 10)); ?> |
214 | - <?php else: ?> |
|
215 | - <span><?php echo $currentTask->progress; ?> %</span> |
|
214 | + <?php else { |
|
215 | + : ?> |
|
216 | + <span><?php echo $currentTask->progress; |
|
217 | +} |
|
218 | +?> %</span> |
|
216 | 219 | <?php endif; ?> |
217 | 220 | |
218 | 221 | </td> |
@@ -232,14 +235,17 @@ discard block |
||
232 | 235 | <?php echo !empty($flight->linkedObjectsIds) && in_array($currentTask->id, |
233 | 236 | $flight->linkedObjectsIds[$currentTask->table_element]) ? 'checked' : '' ?> |
234 | 237 | /> |
235 | - <?php else: ?> |
|
238 | + <?php else { |
|
239 | + : ?> |
|
236 | 240 | |
237 | 241 | <?php if (!empty($flight->linkedObjectsIds) && in_array($currentTask->id, |
238 | 242 | $flight->linkedObjectsIds[$currentTask->table_element])): ?> |
239 | 243 | <span class="fa fa-check"></span> |
240 | 244 | <?php else: ?> |
241 | 245 | <span class="fa fa-times"></span> |
242 | - <?php endif; ?> |
|
246 | + <?php endif; |
|
247 | +} |
|
248 | +?> |
|
243 | 249 | |
244 | 250 | <?php endif; ?> |
245 | 251 |
@@ -132,12 +132,12 @@ discard block |
||
132 | 132 | //'t.justif_kilometers' => array('label' => $langs->trans("Fieldjustif_kilometers"), 'checked' => 1), |
133 | 133 | //'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode))), |
134 | 134 | 't.datec' => array('label' => $langs->trans("DateCreationShort"), |
135 | - 'checked' => 0, |
|
136 | - 'position' => 500 |
|
135 | + 'checked' => 0, |
|
136 | + 'position' => 500 |
|
137 | 137 | ), |
138 | 138 | 't.tms' => array('label' => $langs->trans("DateModificationShort"), |
139 | - 'checked' => 0, |
|
140 | - 'position' => 500 |
|
139 | + 'checked' => 0, |
|
140 | + 'position' => 500 |
|
141 | 141 | ), |
142 | 142 | //'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), |
143 | 143 | ); |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { |
146 | 146 | foreach ($extrafields->attribute_label as $key => $val) { |
147 | 147 | $arrayfields["ef." . $key] = array('label' => $extrafields->attribute_label[$key], |
148 | - 'checked' => $extrafields->attribute_list[$key], |
|
149 | - 'position' => $extrafields->attribute_pos[$key], |
|
150 | - 'enabled' => $extrafields->attribute_perms[$key] |
|
148 | + 'checked' => $extrafields->attribute_list[$key], |
|
149 | + 'position' => $extrafields->attribute_pos[$key], |
|
150 | + 'enabled' => $extrafields->attribute_perms[$key] |
|
151 | 151 | ); |
152 | 152 | } |
153 | 153 | } |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $search_fk_type = GETPOST('search_fk_type', 'int'); |
51 | 51 | $search_fk_pilot = GETPOST('search_fk_pilot', 'int') ?: ($user->admin ? '' : $user->id); |
52 | 52 | $search_fk_organisateur = GETPOST('search_fk_organisateur', 'int'); |
53 | -$search_is_facture = GETPOST('search_is_facture', 'int') === ''? -1 : (int)GETPOST('search_is_facture', 'int'); |
|
54 | -if($search_is_facture === 0){ |
|
53 | +$search_is_facture = GETPOST('search_is_facture', 'int') === '' ? -1 : (int) GETPOST('search_is_facture', 'int'); |
|
54 | +if ($search_is_facture === 0) { |
|
55 | 55 | $search_is_facture = '<=0'; |
56 | 56 | } |
57 | 57 | $search_kilometers = GETPOST('search_kilometers', 'alpha'); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | $parameters = array(); |
181 | 181 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, |
182 | - $action); // Note that $action and $object may have been modified by some hooks |
|
182 | + $action); // Note that $action and $object may have been modified by some hooks |
|
183 | 183 | if ($reshook < 0) { |
184 | 184 | setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); |
185 | 185 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | // Add fields from hooks |
277 | 277 | $parameters = array(); |
278 | 278 | $reshook = $hookmanager->executeHooks('printFieldListSelect', |
279 | - $parameters); // Note that $action and $object may have been modified by hook |
|
279 | + $parameters); // Note that $action and $object may have been modified by hook |
|
280 | 280 | $sql .= $hookmanager->resPrint; |
281 | 281 | $sql .= " FROM " . MAIN_DB_PREFIX . "bbc_vols as t"; |
282 | 282 | if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | |
291 | 291 | $sql .= " WHERE 1 = 1"; |
292 | 292 | |
293 | -if($search_all){ |
|
294 | - $sql .= natural_search(["idBBC_vols", "lieuD", "lieuA", "pilot.lastname", "pilot.firstname", "balloon.immat"], $search_all); |
|
293 | +if ($search_all) { |
|
294 | + $sql .= natural_search(["idBBC_vols", "lieuD", "lieuA", "pilot.lastname", "pilot.firstname", "balloon.immat"], $search_all); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | if ($search_idBBC_vols) { |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | } |
336 | 336 | |
337 | 337 | if ($search_is_facture != -1) { |
338 | - $sql .= natural_search("is_facture", $search_is_facture,1); |
|
338 | + $sql .= natural_search("is_facture", $search_is_facture, 1); |
|
339 | 339 | } |
340 | 340 | if ($search_kilometers) { |
341 | 341 | $sql .= natural_search("kilometers", $search_kilometers, 1); |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | // Add where from hooks |
371 | 371 | $parameters = array(); |
372 | 372 | $reshook = $hookmanager->executeHooks('printFieldListWhere', |
373 | - $parameters); // Note that $action and $object may have been modified by hook |
|
373 | + $parameters); // Note that $action and $object may have been modified by hook |
|
374 | 374 | $sql .= $hookmanager->resPrint; |
375 | 375 | $sql .= $db->order($sortfield, $sortorder); |
376 | 376 | //$sql.= $db->plimit($conf->liste_limit+1, $offset); |
@@ -412,58 +412,58 @@ discard block |
||
412 | 412 | if ($limit > 0 && $limit != $conf->liste_limit) { |
413 | 413 | $param .= '&limit=' . $limit; |
414 | 414 | } |
415 | -if ($search_idBBC_vols != '') { |
|
415 | +if ($search_idBBC_vols != '') { |
|
416 | 416 | $param .= '&search_idBBC_vols=' . urlencode($search_idBBC_vols); |
417 | 417 | } |
418 | -if ($search_date != '') { |
|
418 | +if ($search_date != '') { |
|
419 | 419 | $param .= '&search_date=' . urlencode($search_date); |
420 | 420 | } |
421 | -if ($search_lieuD != '') { |
|
421 | +if ($search_lieuD != '') { |
|
422 | 422 | $param .= '&search_lieuD=' . urlencode($search_lieuD); |
423 | 423 | } |
424 | -if ($search_lieuA != '') { |
|
424 | +if ($search_lieuA != '') { |
|
425 | 425 | $param .= '&search_lieuA=' . urlencode($search_lieuA); |
426 | 426 | } |
427 | -if ($search_heureD != '') { |
|
427 | +if ($search_heureD != '') { |
|
428 | 428 | $param .= '&search_heureD=' . urlencode($search_heureD); |
429 | 429 | } |
430 | -if ($search_heureA != '') { |
|
430 | +if ($search_heureA != '') { |
|
431 | 431 | $param .= '&search_heureA=' . urlencode($search_heureA); |
432 | 432 | } |
433 | -if ($search_BBC_ballons_idBBC_ballons != '') { |
|
433 | +if ($search_BBC_ballons_idBBC_ballons != '') { |
|
434 | 434 | $param .= '&search_BBC_ballons_idBBC_ballons=' . urlencode($search_BBC_ballons_idBBC_ballons); |
435 | 435 | } |
436 | -if ($search_nbrPax != '') { |
|
436 | +if ($search_nbrPax != '') { |
|
437 | 437 | $param .= '&search_nbrPax=' . urlencode($search_nbrPax); |
438 | 438 | } |
439 | -if ($search_remarque != '') { |
|
439 | +if ($search_remarque != '') { |
|
440 | 440 | $param .= '&search_remarque=' . urlencode($search_remarque); |
441 | 441 | } |
442 | -if ($search_incidents != '') { |
|
442 | +if ($search_incidents != '') { |
|
443 | 443 | $param .= '&search_incidents=' . urlencode($search_incidents); |
444 | 444 | } |
445 | -if ($search_fk_type != '') { |
|
445 | +if ($search_fk_type != '') { |
|
446 | 446 | $param .= '&search_fk_type=' . urlencode($search_fk_type); |
447 | 447 | } |
448 | 448 | if ($search_fk_pilot != '') { |
449 | 449 | $param .= '&search_fk_pilot=' . urlencode($search_fk_pilot); |
450 | 450 | } |
451 | -if ($search_fk_organisateur != '') { |
|
451 | +if ($search_fk_organisateur != '') { |
|
452 | 452 | $param .= '&search_fk_organisateur=' . urlencode($search_fk_organisateur); |
453 | 453 | } |
454 | -if ($search_is_facture != -1) { |
|
454 | +if ($search_is_facture != -1) { |
|
455 | 455 | $param .= '&search_is_facture=' . urlencode($search_is_facture); |
456 | 456 | } |
457 | -if ($search_kilometers != '') { |
|
457 | +if ($search_kilometers != '') { |
|
458 | 458 | $param .= '&search_kilometers=' . urlencode($search_kilometers); |
459 | 459 | } |
460 | -if ($search_cost != '') { |
|
460 | +if ($search_cost != '') { |
|
461 | 461 | $param .= '&search_cost=' . urlencode($search_cost); |
462 | 462 | } |
463 | -if ($search_fk_receiver != '') { |
|
463 | +if ($search_fk_receiver != '') { |
|
464 | 464 | $param .= '&search_fk_receiver=' . urlencode($search_fk_receiver); |
465 | 465 | } |
466 | -if ($search_justif_kilometers != '') { |
|
466 | +if ($search_justif_kilometers != '') { |
|
467 | 467 | $param .= '&search_justif_kilometers=' . urlencode($search_justif_kilometers); |
468 | 468 | } |
469 | 469 | if ($search_all != '') { |
@@ -507,8 +507,8 @@ discard block |
||
507 | 507 | |
508 | 508 | |
509 | 509 | $moreHtml = ""; |
510 | -if($search_all !== ""){ |
|
511 | - $moreHtml = "<p>".$langs->trans(sprintf("La liste est en recherche globale sur : l'identifiant du vol, le nom du pilote, l'immat du ballon, le lieu de Décollage et le lieu d'atterissage : %s", $search_all))."</p>"; |
|
510 | +if ($search_all !== "") { |
|
511 | + $moreHtml = "<p>" . $langs->trans(sprintf("La liste est en recherche globale sur : l'identifiant du vol, le nom du pilote, l'immat du ballon, le lieu de Décollage et le lieu d'atterissage : %s", $search_all)) . "</p>"; |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | |
529 | 529 | $parameters = array(); |
530 | 530 | $reshook = $hookmanager->executeHooks('printFieldPreListTitle', |
531 | - $parameters); // Note that $action and $object may have been modified by hook |
|
531 | + $parameters); // Note that $action and $object may have been modified by hook |
|
532 | 532 | if (empty($reshook)) { |
533 | 533 | $moreforfilter .= $hookmanager->resPrint; |
534 | 534 | } else { |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | |
544 | 544 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
545 | 545 | $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, |
546 | - $varpage); // This also change content of $arrayfields |
|
546 | + $varpage); // This also change content of $arrayfields |
|
547 | 547 | |
548 | 548 | print '<div class="div-table-responsive">'; |
549 | 549 | print '<table class="tagtable liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n"; |
@@ -639,7 +639,7 @@ discard block |
||
639 | 639 | // Hook fields |
640 | 640 | $parameters = array('arrayfields' => $arrayfields); |
641 | 641 | $reshook = $hookmanager->executeHooks('printFieldListTitle', |
642 | - $parameters); // Note that $action and $object may have been modified by hook |
|
642 | + $parameters); // Note that $action and $object may have been modified by hook |
|
643 | 643 | print $hookmanager->resPrint; |
644 | 644 | if (!empty($arrayfields['t.datec']['checked'])) { |
645 | 645 | print_liste_field_titre($arrayfields['t.datec']['label'], $_SERVER["PHP_SELF"], "t.datec", "", $param, |
@@ -697,18 +697,18 @@ discard block |
||
697 | 697 | } |
698 | 698 | if (!empty($arrayfields['t.fk_pilot']['checked'])) { |
699 | 699 | print '<td class="liste_titre">'; |
700 | - print $form->select_dolusers($search_fk_pilot, "search_fk_pilot", true, null, 0, '', '', 0,0,0,'',0,'','', true); |
|
700 | + print $form->select_dolusers($search_fk_pilot, "search_fk_pilot", true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true); |
|
701 | 701 | print '</td>'; |
702 | 702 | } |
703 | 703 | if (!empty($arrayfields['t.fk_organisateur']['checked'])) { |
704 | 704 | print '<td class="liste_titre">'; |
705 | - print $form->select_dolusers($search_fk_organisateur, "search_fk_organisateur", true, null, 0, '', '', 0,0,0,'',0,'','', true); |
|
705 | + print $form->select_dolusers($search_fk_organisateur, "search_fk_organisateur", true, null, 0, '', '', 0, 0, 0, '', 0, '', '', true); |
|
706 | 706 | print '</td>'; |
707 | 707 | } |
708 | 708 | |
709 | 709 | if (!empty($arrayfields['t.is_facture']['checked'])) { |
710 | 710 | print '<td class="liste_titre">'; |
711 | - print '<select name="search_is_facture"><option value="-1" '.($search_is_facture != 1 && $search_is_facture != 0 && $search_is_facture != '<=0'? 'selected' : '' ).'></option><option value="1" '.($search_is_facture == 1 ? 'selected' : '' ).'>Facturé</option><option value="0" '.($search_is_facture == 0 || $search_is_facture == '<=0' ? 'selected' : '' ).'>Ouvert</option></select>'; |
|
711 | + print '<select name="search_is_facture"><option value="-1" ' . ($search_is_facture != 1 && $search_is_facture != 0 && $search_is_facture != '<=0' ? 'selected' : '') . '></option><option value="1" ' . ($search_is_facture == 1 ? 'selected' : '') . '>Facturé</option><option value="0" ' . ($search_is_facture == 0 || $search_is_facture == '<=0' ? 'selected' : '') . '>Ouvert</option></select>'; |
|
712 | 712 | print '</td>'; |
713 | 713 | } |
714 | 714 | |
@@ -753,7 +753,7 @@ discard block |
||
753 | 753 | // Fields from hook |
754 | 754 | $parameters = array('arrayfields' => $arrayfields); |
755 | 755 | $reshook = $hookmanager->executeHooks('printFieldListOption', |
756 | - $parameters); // Note that $action and $object may have been modified by hook |
|
756 | + $parameters); // Note that $action and $object may have been modified by hook |
|
757 | 757 | print $hookmanager->resPrint; |
758 | 758 | if (!empty($arrayfields['t.datec']['checked'])) { |
759 | 759 | // Date creation |
@@ -795,125 +795,125 @@ discard block |
||
795 | 795 | // Show here line of result |
796 | 796 | print '<tr ' . $bc[$var] . '>'; |
797 | 797 | |
798 | - if (! empty($arrayfields['t.idBBC_vols']['checked'])) |
|
798 | + if (!empty($arrayfields['t.idBBC_vols']['checked'])) |
|
799 | 799 | { |
800 | - print '<td>'.$flight->getNomUrl(0).'</td>'; |
|
800 | + print '<td>' . $flight->getNomUrl(0) . '</td>'; |
|
801 | 801 | |
802 | - if (! $i) $totalarray['nbfield']++; |
|
802 | + if (!$i) $totalarray['nbfield']++; |
|
803 | 803 | } |
804 | - if (! empty($arrayfields['t.date']['checked'])) |
|
804 | + if (!empty($arrayfields['t.date']['checked'])) |
|
805 | 805 | { |
806 | 806 | print '<td>'; |
807 | 807 | print dol_print_date($db->jdate($obj->date), '%d-%m-%y'); |
808 | 808 | print '</td>'; |
809 | 809 | |
810 | - if (! $i) $totalarray['nbfield']++; |
|
810 | + if (!$i) $totalarray['nbfield']++; |
|
811 | 811 | } |
812 | - if (! empty($arrayfields['t.lieuD']['checked'])) |
|
812 | + if (!empty($arrayfields['t.lieuD']['checked'])) |
|
813 | 813 | { |
814 | - print '<td>'.$obj->lieuD.'</td>'; |
|
814 | + print '<td>' . $obj->lieuD . '</td>'; |
|
815 | 815 | |
816 | - if (! $i) $totalarray['nbfield']++; |
|
816 | + if (!$i) $totalarray['nbfield']++; |
|
817 | 817 | } |
818 | - if (! empty($arrayfields['t.lieuA']['checked'])) |
|
818 | + if (!empty($arrayfields['t.lieuA']['checked'])) |
|
819 | 819 | { |
820 | - print '<td>'.$obj->lieuA.'</td>'; |
|
820 | + print '<td>' . $obj->lieuA . '</td>'; |
|
821 | 821 | |
822 | - if (! $i) $totalarray['nbfield']++; |
|
822 | + if (!$i) $totalarray['nbfield']++; |
|
823 | 823 | } |
824 | - if (! empty($arrayfields['t.heureD']['checked'])) |
|
824 | + if (!empty($arrayfields['t.heureD']['checked'])) |
|
825 | 825 | { |
826 | - print '<td>'.$obj->heureD.'</td>'; |
|
826 | + print '<td>' . $obj->heureD . '</td>'; |
|
827 | 827 | |
828 | - if (! $i) $totalarray['nbfield']++; |
|
828 | + if (!$i) $totalarray['nbfield']++; |
|
829 | 829 | } |
830 | - if (! empty($arrayfields['t.heureA']['checked'])) |
|
830 | + if (!empty($arrayfields['t.heureA']['checked'])) |
|
831 | 831 | { |
832 | - print '<td>'.$obj->heureA.'</td>'; |
|
832 | + print '<td>' . $obj->heureA . '</td>'; |
|
833 | 833 | |
834 | - if (! $i) $totalarray['nbfield']++; |
|
834 | + if (!$i) $totalarray['nbfield']++; |
|
835 | 835 | } |
836 | - if (! empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked'])) |
|
836 | + if (!empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked'])) |
|
837 | 837 | { |
838 | - print '<td>'.$obj->bal.'</td>'; |
|
838 | + print '<td>' . $obj->bal . '</td>'; |
|
839 | 839 | |
840 | - if (! $i) $totalarray['nbfield']++; |
|
840 | + if (!$i) $totalarray['nbfield']++; |
|
841 | 841 | } |
842 | - if (! empty($arrayfields['t.nbrPax']['checked'])) |
|
842 | + if (!empty($arrayfields['t.nbrPax']['checked'])) |
|
843 | 843 | { |
844 | - print '<td>'.$obj->nbrPax.'</td>'; |
|
844 | + print '<td>' . $obj->nbrPax . '</td>'; |
|
845 | 845 | |
846 | - if (! $i) $totalarray['nbfield']++; |
|
846 | + if (!$i) $totalarray['nbfield']++; |
|
847 | 847 | } |
848 | - if (! empty($arrayfields['t.remarque']['checked'])) |
|
848 | + if (!empty($arrayfields['t.remarque']['checked'])) |
|
849 | 849 | { |
850 | - print '<td>'.$obj->remarque.'</td>'; |
|
850 | + print '<td>' . $obj->remarque . '</td>'; |
|
851 | 851 | |
852 | - if (! $i) $totalarray['nbfield']++; |
|
852 | + if (!$i) $totalarray['nbfield']++; |
|
853 | 853 | } |
854 | - if (! empty($arrayfields['t.incidents']['checked'])) |
|
854 | + if (!empty($arrayfields['t.incidents']['checked'])) |
|
855 | 855 | { |
856 | - print '<td>'.$obj->incidents.'</td>'; |
|
856 | + print '<td>' . $obj->incidents . '</td>'; |
|
857 | 857 | |
858 | - if (! $i) $totalarray['nbfield']++; |
|
858 | + if (!$i) $totalarray['nbfield']++; |
|
859 | 859 | } |
860 | - if (! empty($arrayfields['t.fk_type']['checked'])) |
|
860 | + if (!empty($arrayfields['t.fk_type']['checked'])) |
|
861 | 861 | { |
862 | - print '<td>'.$obj->flight_type.'</td>'; |
|
862 | + print '<td>' . $obj->flight_type . '</td>'; |
|
863 | 863 | |
864 | - if (! $i) $totalarray['nbfield']++; |
|
864 | + if (!$i) $totalarray['nbfield']++; |
|
865 | 865 | } |
866 | - if (! empty($arrayfields['t.fk_pilot']['checked'])) |
|
866 | + if (!empty($arrayfields['t.fk_pilot']['checked'])) |
|
867 | 867 | { |
868 | - print '<td>'.$obj->pilot.'</td>'; |
|
868 | + print '<td>' . $obj->pilot . '</td>'; |
|
869 | 869 | |
870 | - if (! $i) $totalarray['nbfield']++; |
|
870 | + if (!$i) $totalarray['nbfield']++; |
|
871 | 871 | } |
872 | - if (! empty($arrayfields['t.fk_organisateur']['checked'])) |
|
872 | + if (!empty($arrayfields['t.fk_organisateur']['checked'])) |
|
873 | 873 | { |
874 | - print '<td>'.$obj->organisator.'</td>'; |
|
874 | + print '<td>' . $obj->organisator . '</td>'; |
|
875 | 875 | |
876 | - if (! $i) $totalarray['nbfield']++; |
|
876 | + if (!$i) $totalarray['nbfield']++; |
|
877 | 877 | } |
878 | - if (! empty($arrayfields['t.is_facture']['checked'])) |
|
878 | + if (!empty($arrayfields['t.is_facture']['checked'])) |
|
879 | 879 | { |
880 | 880 | $flight->is_facture = $obj->is_facture; |
881 | - print '<td>'.$flight->getLibStatut(3).'</td>'; |
|
881 | + print '<td>' . $flight->getLibStatut(3) . '</td>'; |
|
882 | 882 | |
883 | - if (! $i) $totalarray['nbfield']++; |
|
883 | + if (!$i) $totalarray['nbfield']++; |
|
884 | 884 | } |
885 | - if (! empty($arrayfields['t.kilometers']['checked'])) |
|
885 | + if (!empty($arrayfields['t.kilometers']['checked'])) |
|
886 | 886 | { |
887 | - if($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot){ |
|
888 | - print '<td>'.$obj->kilometers.' KM</td>'; |
|
889 | - }else{ |
|
887 | + if ($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) { |
|
888 | + print '<td>' . $obj->kilometers . ' KM</td>'; |
|
889 | + } else { |
|
890 | 890 | print '<td> - Km</td>'; |
891 | 891 | } |
892 | 892 | |
893 | - if (! $i) $totalarray['nbfield']++; |
|
893 | + if (!$i) $totalarray['nbfield']++; |
|
894 | 894 | } |
895 | - if (! empty($arrayfields['t.cost']['checked'])) |
|
895 | + if (!empty($arrayfields['t.cost']['checked'])) |
|
896 | 896 | { |
897 | - if(($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0){ |
|
897 | + if (($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0) { |
|
898 | 898 | $nbrPax = $obj->nbrPax > 0 ? $obj->nbrPax : 1; |
899 | - print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost/$nbrPax, 0, $langs, -1, -1, -1, $conf->currency)); |
|
900 | - }else{ |
|
899 | + print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost / $nbrPax, 0, $langs, -1, -1, -1, $conf->currency)); |
|
900 | + } else { |
|
901 | 901 | print '<td> - €</td>'; |
902 | 902 | } |
903 | 903 | |
904 | - if (! $i) $totalarray['nbfield']++; |
|
904 | + if (!$i) $totalarray['nbfield']++; |
|
905 | 905 | } |
906 | - if (! empty($arrayfields['t.fk_receiver']['checked'])) |
|
906 | + if (!empty($arrayfields['t.fk_receiver']['checked'])) |
|
907 | 907 | { |
908 | - print '<td>'.$obj->receiver.'</td>'; |
|
908 | + print '<td>' . $obj->receiver . '</td>'; |
|
909 | 909 | |
910 | - if (! $i) $totalarray['nbfield']++; |
|
910 | + if (!$i) $totalarray['nbfield']++; |
|
911 | 911 | } |
912 | - if (! empty($arrayfields['t.justif_kilometers']['checked'])) |
|
912 | + if (!empty($arrayfields['t.justif_kilometers']['checked'])) |
|
913 | 913 | { |
914 | - print '<td>'.$obj->justif_kilometers.'</td>'; |
|
914 | + print '<td>' . $obj->justif_kilometers . '</td>'; |
|
915 | 915 | |
916 | - if (! $i) $totalarray['nbfield']++; |
|
916 | + if (!$i) $totalarray['nbfield']++; |
|
917 | 917 | } |
918 | 918 | |
919 | 919 | // Extra fields |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | // Fields from hook |
939 | 939 | $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj); |
940 | 940 | $reshook = $hookmanager->executeHooks('printFieldListValue', |
941 | - $parameters); // Note that $action and $object may have been modified by hook |
|
941 | + $parameters); // Note that $action and $object may have been modified by hook |
|
942 | 942 | print $hookmanager->resPrint; |
943 | 943 | // Date creation |
944 | 944 | if (!empty($arrayfields['t.datec']['checked'])) { |
@@ -1008,7 +1008,7 @@ discard block |
||
1008 | 1008 | |
1009 | 1009 | $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); |
1010 | 1010 | $reshook = $hookmanager->executeHooks('printFieldListFooter', |
1011 | - $parameters); // Note that $action and $object may have been modified by hook |
|
1011 | + $parameters); // Note that $action and $object may have been modified by hook |
|
1012 | 1012 | print $hookmanager->resPrint; |
1013 | 1013 | |
1014 | 1014 | print '</table>' . "\n"; |
@@ -189,10 +189,12 @@ discard block |
||
189 | 189 | include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; |
190 | 190 | |
191 | 191 | // Purge search criteria |
192 | - if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers |
|
192 | + if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) { |
|
193 | + // All tests are required to be compatible with all browsers |
|
193 | 194 | { |
194 | 195 | |
195 | 196 | $search_idBBC_vols = ''; |
197 | + } |
|
196 | 198 | $search_date = ''; |
197 | 199 | $search_lieuD = ''; |
198 | 200 | $search_lieuA = ''; |
@@ -799,7 +801,9 @@ discard block |
||
799 | 801 | { |
800 | 802 | print '<td>'.$flight->getNomUrl(0).'</td>'; |
801 | 803 | |
802 | - if (! $i) $totalarray['nbfield']++; |
|
804 | + if (! $i) { |
|
805 | + $totalarray['nbfield']++; |
|
806 | + } |
|
803 | 807 | } |
804 | 808 | if (! empty($arrayfields['t.date']['checked'])) |
805 | 809 | { |
@@ -807,113 +811,147 @@ discard block |
||
807 | 811 | print dol_print_date($db->jdate($obj->date), '%d-%m-%y'); |
808 | 812 | print '</td>'; |
809 | 813 | |
810 | - if (! $i) $totalarray['nbfield']++; |
|
814 | + if (! $i) { |
|
815 | + $totalarray['nbfield']++; |
|
816 | + } |
|
811 | 817 | } |
812 | 818 | if (! empty($arrayfields['t.lieuD']['checked'])) |
813 | 819 | { |
814 | 820 | print '<td>'.$obj->lieuD.'</td>'; |
815 | 821 | |
816 | - if (! $i) $totalarray['nbfield']++; |
|
822 | + if (! $i) { |
|
823 | + $totalarray['nbfield']++; |
|
824 | + } |
|
817 | 825 | } |
818 | 826 | if (! empty($arrayfields['t.lieuA']['checked'])) |
819 | 827 | { |
820 | 828 | print '<td>'.$obj->lieuA.'</td>'; |
821 | 829 | |
822 | - if (! $i) $totalarray['nbfield']++; |
|
830 | + if (! $i) { |
|
831 | + $totalarray['nbfield']++; |
|
832 | + } |
|
823 | 833 | } |
824 | 834 | if (! empty($arrayfields['t.heureD']['checked'])) |
825 | 835 | { |
826 | 836 | print '<td>'.$obj->heureD.'</td>'; |
827 | 837 | |
828 | - if (! $i) $totalarray['nbfield']++; |
|
838 | + if (! $i) { |
|
839 | + $totalarray['nbfield']++; |
|
840 | + } |
|
829 | 841 | } |
830 | 842 | if (! empty($arrayfields['t.heureA']['checked'])) |
831 | 843 | { |
832 | 844 | print '<td>'.$obj->heureA.'</td>'; |
833 | 845 | |
834 | - if (! $i) $totalarray['nbfield']++; |
|
846 | + if (! $i) { |
|
847 | + $totalarray['nbfield']++; |
|
848 | + } |
|
835 | 849 | } |
836 | 850 | if (! empty($arrayfields['t.BBC_ballons_idBBC_ballons']['checked'])) |
837 | 851 | { |
838 | 852 | print '<td>'.$obj->bal.'</td>'; |
839 | 853 | |
840 | - if (! $i) $totalarray['nbfield']++; |
|
854 | + if (! $i) { |
|
855 | + $totalarray['nbfield']++; |
|
856 | + } |
|
841 | 857 | } |
842 | 858 | if (! empty($arrayfields['t.nbrPax']['checked'])) |
843 | 859 | { |
844 | 860 | print '<td>'.$obj->nbrPax.'</td>'; |
845 | 861 | |
846 | - if (! $i) $totalarray['nbfield']++; |
|
862 | + if (! $i) { |
|
863 | + $totalarray['nbfield']++; |
|
864 | + } |
|
847 | 865 | } |
848 | 866 | if (! empty($arrayfields['t.remarque']['checked'])) |
849 | 867 | { |
850 | 868 | print '<td>'.$obj->remarque.'</td>'; |
851 | 869 | |
852 | - if (! $i) $totalarray['nbfield']++; |
|
870 | + if (! $i) { |
|
871 | + $totalarray['nbfield']++; |
|
872 | + } |
|
853 | 873 | } |
854 | 874 | if (! empty($arrayfields['t.incidents']['checked'])) |
855 | 875 | { |
856 | 876 | print '<td>'.$obj->incidents.'</td>'; |
857 | 877 | |
858 | - if (! $i) $totalarray['nbfield']++; |
|
878 | + if (! $i) { |
|
879 | + $totalarray['nbfield']++; |
|
880 | + } |
|
859 | 881 | } |
860 | 882 | if (! empty($arrayfields['t.fk_type']['checked'])) |
861 | 883 | { |
862 | 884 | print '<td>'.$obj->flight_type.'</td>'; |
863 | 885 | |
864 | - if (! $i) $totalarray['nbfield']++; |
|
886 | + if (! $i) { |
|
887 | + $totalarray['nbfield']++; |
|
888 | + } |
|
865 | 889 | } |
866 | 890 | if (! empty($arrayfields['t.fk_pilot']['checked'])) |
867 | 891 | { |
868 | 892 | print '<td>'.$obj->pilot.'</td>'; |
869 | 893 | |
870 | - if (! $i) $totalarray['nbfield']++; |
|
894 | + if (! $i) { |
|
895 | + $totalarray['nbfield']++; |
|
896 | + } |
|
871 | 897 | } |
872 | 898 | if (! empty($arrayfields['t.fk_organisateur']['checked'])) |
873 | 899 | { |
874 | 900 | print '<td>'.$obj->organisator.'</td>'; |
875 | 901 | |
876 | - if (! $i) $totalarray['nbfield']++; |
|
902 | + if (! $i) { |
|
903 | + $totalarray['nbfield']++; |
|
904 | + } |
|
877 | 905 | } |
878 | 906 | if (! empty($arrayfields['t.is_facture']['checked'])) |
879 | 907 | { |
880 | 908 | $flight->is_facture = $obj->is_facture; |
881 | 909 | print '<td>'.$flight->getLibStatut(3).'</td>'; |
882 | 910 | |
883 | - if (! $i) $totalarray['nbfield']++; |
|
911 | + if (! $i) { |
|
912 | + $totalarray['nbfield']++; |
|
913 | + } |
|
884 | 914 | } |
885 | 915 | if (! empty($arrayfields['t.kilometers']['checked'])) |
886 | 916 | { |
887 | 917 | if($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot){ |
888 | 918 | print '<td>'.$obj->kilometers.' KM</td>'; |
889 | - }else{ |
|
919 | + } else{ |
|
890 | 920 | print '<td> - Km</td>'; |
891 | 921 | } |
892 | 922 | |
893 | - if (! $i) $totalarray['nbfield']++; |
|
923 | + if (! $i) { |
|
924 | + $totalarray['nbfield']++; |
|
925 | + } |
|
894 | 926 | } |
895 | 927 | if (! empty($arrayfields['t.cost']['checked'])) |
896 | 928 | { |
897 | 929 | if(($user->rights->flightlog->vol->financial || $user->id == $flight->fk_pilot) && $obj->cost > 0){ |
898 | 930 | $nbrPax = $obj->nbrPax > 0 ? $obj->nbrPax : 1; |
899 | 931 | print sprintf('<td>%s - (%s/pax)</td>', price($obj->cost, 0, $langs, 0, 0, -1, $conf->currency), price($obj->cost/$nbrPax, 0, $langs, -1, -1, -1, $conf->currency)); |
900 | - }else{ |
|
932 | + } else{ |
|
901 | 933 | print '<td> - €</td>'; |
902 | 934 | } |
903 | 935 | |
904 | - if (! $i) $totalarray['nbfield']++; |
|
936 | + if (! $i) { |
|
937 | + $totalarray['nbfield']++; |
|
938 | + } |
|
905 | 939 | } |
906 | 940 | if (! empty($arrayfields['t.fk_receiver']['checked'])) |
907 | 941 | { |
908 | 942 | print '<td>'.$obj->receiver.'</td>'; |
909 | 943 | |
910 | - if (! $i) $totalarray['nbfield']++; |
|
944 | + if (! $i) { |
|
945 | + $totalarray['nbfield']++; |
|
946 | + } |
|
911 | 947 | } |
912 | 948 | if (! empty($arrayfields['t.justif_kilometers']['checked'])) |
913 | 949 | { |
914 | 950 | print '<td>'.$obj->justif_kilometers.'</td>'; |
915 | 951 | |
916 | - if (! $i) $totalarray['nbfield']++; |
|
952 | + if (! $i) { |
|
953 | + $totalarray['nbfield']++; |
|
954 | + } |
|
917 | 955 | } |
918 | 956 | |
919 | 957 | // Extra fields |
@@ -961,9 +999,11 @@ discard block |
||
961 | 999 | |
962 | 1000 | // Action column |
963 | 1001 | print '<td class="nowrap" align="center">'; |
964 | - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined |
|
1002 | + if ($massactionbutton || $massaction) { |
|
1003 | + // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined |
|
965 | 1004 | { |
966 | 1005 | $selected = 0; |
1006 | + } |
|
967 | 1007 | if (in_array($obj->idBBC_vols, $arrayofselected)) { |
968 | 1008 | $selected = 1; |
969 | 1009 | } |