Completed
Push — feature/graph_stat_flight ( ed413f )
by Laurent
01:27
created
lib/flightLog.lib.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 }
109 109
 
110 110
 /**
111
- * @param null $year
111
+ * @param integer $year
112 112
  * @param null $pilotId
113 113
  * @param null $quarter
114 114
  * @param bool $groupBy
Please login to merge, or discard this patch.
command/CreateFlightBillCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
             throw new \InvalidArgumentException('Model document is missing');
92 92
         }
93 93
 
94
-        if(!isset($nbrPax) || !is_numeric($nbrPax) || $nbrPax != (int) $nbrPax){
94
+        if (!isset($nbrPax) || !is_numeric($nbrPax) || $nbrPax != (int) $nbrPax) {
95 95
             throw new \InvalidArgumentException('The number of pax is not correct, an integer is expected');
96 96
         }
97 97
 
Please login to merge, or discard this patch.
class/bbctypes.class.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -645,7 +645,7 @@
 block discarded – undo
645 645
     }
646 646
 
647 647
     /**
648
-     * @return array|BbctypesLine[]
648
+     * @return BbctypesLine[]
649 649
      */
650 650
     public function getLines()
651 651
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -733,7 +733,7 @@
 block discarded – undo
733 733
      */
734 734
     public function getActive()
735 735
     {
736
-        return (boolean)$this->active;
736
+        return (boolean) $this->active;
737 737
     }
738 738
 
739 739
     /**
Please login to merge, or discard this patch.
Form/Form.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,6 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
     /**
97 97
      * @inheritDoc
98
+     * @param string $fieldName
98 99
      */
99 100
     public function remove($fieldName)
100 101
     {
@@ -142,7 +143,7 @@  discard block
 block discarded – undo
142 143
     }
143 144
 
144 145
     /**
145
-     * @param null|\ValidatorInterface $validator
146
+     * @param ValidatorInterface $validator
146 147
      *
147 148
      * @return Form
148 149
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     public function add(FormElementInterface $element)
89 89
     {
90
-        if(array_key_exists($element->getName(), $this->elements)){
90
+        if (array_key_exists($element->getName(), $this->elements)) {
91 91
             throw new \InvalidArgumentException('Element already exists');
92 92
         }
93 93
         $this->elements[$element->getName()] = $element;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function getErrorMessages()
143 143
     {
144
-        if(!$this->validator){
144
+        if (!$this->validator) {
145 145
             return [];
146 146
         }
147 147
 
Please login to merge, or discard this patch.
Form/InputDate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
      */
29 29
     public function setValue($value)
30 30
     {
31
-        if($value instanceof \DateTime){
31
+        if ($value instanceof \DateTime) {
32 32
             return parent::setValue($value->format('Y-m-d'));
33 33
         }
34 34
 
Please login to merge, or discard this patch.
Form/FlightForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * @param array $options
28 28
      * @param \User $user
29 29
      */
30
-    public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options,\User $user)
30
+    public function __construct(\ValidatorInterface $validator, $baseObject, \DoliDB $db, $options, \User $user)
31 31
     {
32 32
 
33 33
         parent::__construct('flight_form', FormInterface::METHOD_POST, $this->buildOptionsfromConfiguration($options));
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $flight = $object;
84 84
 
85 85
         // Quick fix - Fixme by a factory on this form.
86
-        if($this->user->rights->flightlog->vol->advanced){
86
+        if ($this->user->rights->flightlog->vol->advanced) {
87 87
             return parent::bind($object);
88 88
         }
89 89
 
Please login to merge, or discard this patch.
command/CreateExpenseNoteCommandHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@
 block discarded – undo
272 272
         $expenseNoteUser = new User($this->db);
273 273
         $expenseNoteUser->id = $currentMissionUserId;
274 274
         $id = $expenseNote->create($expenseNoteUser);
275
-        if($id < 0){
275
+        if ($id < 0) {
276 276
             return null;
277 277
         }
278 278
 
Please login to merge, or discard this patch.
query/GetPilotsWithMissionsQueryHandler.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
                         $pilotLastname = $obj->lastname;
53 53
                         $pilotFirstname = $obj->firstname;
54 54
 
55
-                        if($query->isPilotsOnly()){
55
+                        if ($query->isPilotsOnly()) {
56 56
                             $result->addPilot($pilotId, $pilotFirstname, $pilotLastname);
57
-                        }else{
57
+                        } else {
58 58
                             $result->addMission($obj->quartil, $pilotId, $pilotFirstname, $pilotLastname,
59 59
                                 $obj->number_flights, $obj->total_kilometers);
60 60
                         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $sql .= " , SUM(VOL.kilometers) as total_kilometers ";
80 80
         $sql .= " , COUNT(VOL.idBBC_vols) as number_flights";
81 81
 
82
-        if(!$query->isPilotsOnly()){
82
+        if (!$query->isPilotsOnly()) {
83 83
             $sql .= " , QUARTER(VOL.date) as quartil ";
84 84
         }
85 85
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
                         if($query->isPilotsOnly()){
56 56
                             $result->addPilot($pilotId, $pilotFirstname, $pilotLastname);
57
-                        }else{
57
+                        } else{
58 58
                             $result->addMission($obj->quartil, $pilotId, $pilotFirstname, $pilotLastname,
59 59
                                 $obj->number_flights, $obj->total_kilometers);
60 60
                         }
Please login to merge, or discard this patch.
card_tab_financial.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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,18 +93,18 @@  discard block
 block discarded – undo
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>';
100 100
 print '<tr><td class="fieldrequired">' . $langs->trans("Fieldjustif_kilometers") . '</td><td>' . $object->justif_kilometers . '</td></tr>';
101
-if(!$object->isLinkedToOrder()){
101
+if (!$object->isLinkedToOrder()) {
102 102
     print '<tr><td class="fieldrequired">' . $langs->trans("Fieldcost") . '</td><td>' . $object->cost . " " . $langs->getCurrencySymbol($conf->currency) . '</td></tr>';
103 103
     print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_receiver") . '</td><td>' . $receiver->getNomUrl(1) . '</td></tr>';
104
-}else{
104
+} else {
105 105
     print '<tr><td class="fieldrequired">' . $langs->trans("Order") . '</td><td><ul>';
106
-    foreach($object->getOrders() as $currentOrder){
107
-        print '<li>'.$currentOrder->getNomUrl(1).'</li>';
106
+    foreach ($object->getOrders() as $currentOrder) {
107
+        print '<li>' . $currentOrder->getNomUrl(1) . '</li>';
108 108
     }
109 109
     print '</ul></td></tr>';
110 110
 }
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
 // Buttons
116 116
 print '<div class="tabsAction">' . "\n";
117 117
 
118
-if($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()){
119
-    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";
118
+if ($user->rights->flightlog->vol->financial && $object->fk_type == 2 && !$object->hasFacture()) {
119
+    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";
120 120
 }
121 121
 
122 122
 print '</div>' . "\n";
123 123
 
124
-if($user->rights->flightlog->vol->financial){
124
+if ($user->rights->flightlog->vol->financial) {
125 125
     print '<div class="fichecenter"><div class="fichehalfleft">';
126 126
     $form->showLinkedObjectBlock($object);
127 127
     print '</div></div>';
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
 if(!$object->isLinkedToOrder()){
102 102
     print '<tr><td class="fieldrequired">' . $langs->trans("Fieldcost") . '</td><td>' . $object->cost . " " . $langs->getCurrencySymbol($conf->currency) . '</td></tr>';
103 103
     print '<tr><td class="fieldrequired">' . $langs->trans("Fieldfk_receiver") . '</td><td>' . $receiver->getNomUrl(1) . '</td></tr>';
104
-}else{
104
+} else{
105 105
     print '<tr><td class="fieldrequired">' . $langs->trans("Order") . '</td><td><ul>';
106 106
     foreach($object->getOrders() as $currentOrder){
107 107
         print '<li>'.$currentOrder->getNomUrl(1).'</li>';
Please login to merge, or discard this patch.