Test Failed
Push — main ( c8394f...8477f1 )
by Rafael
66:21
created
public/htdocs/install/inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     echo "      Display this help message.\n";
125 125
 }
126 126
 
127
-if (php_sapi_name() === "cli" && (float)PHP_VERSION > 7.0) {
127
+if (php_sapi_name() === "cli" && (float) PHP_VERSION > 7.0) {
128 128
     $rest_index = 0;
129 129
     $opts = getopt($short_options, $long_options, $rest_index);
130 130
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
          * @param string $arg
150 150
          * @return bool
151 151
          */
152
-        static function ($arg) {
152
+        static function($arg) {
153 153
             return strlen($arg) >= 2 && $arg[0] == '-';
154 154
         }
155 155
     );
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      * @param string $arg
160 160
      * @return string
161 161
      */
162
-        static function ($arg) {
162
+        static function($arg) {
163 163
             if (strlen($arg) > 1) {
164 164
                 return "--" . $arg;
165 165
             }
@@ -294,10 +294,10 @@  discard block
 block discarded – undo
294 294
 
295 295
 // Check install.lock (for both install and upgrade)
296 296
 
297
-$lockfile = DOL_DATA_ROOT . '/install.lock';    // To lock all /install pages
298
-$lockfile2 = DOL_DOCUMENT_ROOT . '/install.lock';    // To lock all /install pages (recommended)
299
-$upgradeunlockfile = DOL_DATA_ROOT . '/upgrade.unlock';    // To unlock upgrade process
300
-$upgradeunlockfile2 = DOL_DOCUMENT_ROOT . '/upgrade.unlock';    // To unlock upgrade process
297
+$lockfile = DOL_DATA_ROOT . '/install.lock'; // To lock all /install pages
298
+$lockfile2 = DOL_DOCUMENT_ROOT . '/install.lock'; // To lock all /install pages (recommended)
299
+$upgradeunlockfile = DOL_DATA_ROOT . '/upgrade.unlock'; // To unlock upgrade process
300
+$upgradeunlockfile2 = DOL_DOCUMENT_ROOT . '/upgrade.unlock'; // To unlock upgrade process
301 301
 if (constant('DOL_DATA_ROOT') === null) {
302 302
     // We don't have a configuration file yet
303 303
     // Try to detect any lockfile in the default documents path
Please login to merge, or discard this patch.
public/htdocs/install/step2.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,9 +42,9 @@  discard block
 block discarded – undo
42 42
 // Only works if you are not in safe_mode. / Ne fonctionne que si on est pas en safe_mode.
43 43
 
44 44
 $err = error_reporting();
45
-error_reporting(0);      // Disable all errors
45
+error_reporting(0); // Disable all errors
46 46
 //error_reporting(E_ALL);
47
-@set_time_limit(1800);   // Need 1800 on some very slow OS like Windows 7/64
47
+@set_time_limit(1800); // Need 1800 on some very slow OS like Windows 7/64
48 48
 error_reporting($err);
49 49
 
50 50
 $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : (empty($argv[1]) ? '' : $argv[1]);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 dolibarr_install_syslog("--- step2: entering step2.php page");
95 95
 
96
-'@phan-var-force string $dolibarr_main_db_prefix';  // From configuraiotn file or install/inc.php
96
+'@phan-var-force string $dolibarr_main_db_prefix'; // From configuraiotn file or install/inc.php
97 97
 
98 98
 /*
99 99
  *	View
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     print '<table cellspacing="0" style="padding: 4px 4px 4px 0" border="0" width="100%">';
115 115
     $error = 0;
116 116
 
117
-    $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, (int)$conf->db->port);
117
+    $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, (int) $conf->db->port);
118 118
 
119 119
     if ($db->connected) {
120 120
         print "<tr><td>";
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
 $conf->file->instance_unique_id = (empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id); // Unique id of instance
601 601
 
602
-$hash_unique_id = dol_hash('dolibarr' . $conf->file->instance_unique_id, 'sha256');   // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
602
+$hash_unique_id = dol_hash('dolibarr' . $conf->file->instance_unique_id, 'sha256'); // Note: if the global salt changes, this hash changes too so ping may be counted twice. We don't mind. It is for statistics purpose only.
603 603
 
604 604
 $out = '<input type="checkbox" name="dolibarrpingno" id="dolibarrpingno"' . ((getDolGlobalString('MAIN_FIRST_PING_OK_ID') == 'disabled') ? '' : ' value="checked" checked="true"') . '> ';
605 605
 $out .= '<label for="dolibarrpingno">' . $langs->trans("MakeAnonymousPing") . '</label>';
Please login to merge, or discard this patch.
public/htdocs/comm/remise.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
 
98 98
 $form = new Form($db);
99 99
 
100
-if (! ($socid > 0)) {
100
+if (!($socid > 0)) {
101 101
     accessforbidden('Record not found');
102 102
 }
103 103
 
Please login to merge, or discard this patch.
public/htdocs/comm/propal/card.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1159,8 +1159,8 @@  discard block
 block discarded – undo
1159 1159
                         if (count($prodcustprice->lines) > 0) {
1160 1160
                             $pu_ht = price($prodcustprice->lines[0]->price);
1161 1161
                             $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
1162
-                            $price_min =  price($prodcustprice->lines[0]->price_min);
1163
-                            $price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
1162
+                            $price_min = price($prodcustprice->lines[0]->price_min);
1163
+                            $price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
1164 1164
                             $price_base_type = $prodcustprice->lines[0]->price_base_type;
1165 1165
                             /*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
1166 1166
                             if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
@@ -1904,7 +1904,7 @@  discard block
 block discarded – undo
1904 1904
     print '<form name="addprop" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
1905 1905
     print '<input type="hidden" name="token" value="' . newToken() . '">';
1906 1906
     print '<input type="hidden" name="action" value="add">';
1907
-    print '<input type="hidden" name="changecompany" value="0">';   // will be set to 1 by javascript so we know post is done after a company change
1907
+    print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
1908 1908
     print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
1909 1909
     if ($origin != 'project' && $originid) {
1910 1910
         print '<input type="hidden" name="origin" value="' . $origin . '">';
@@ -2295,7 +2295,7 @@  discard block
 block discarded – undo
2295 2295
         if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2296 2296
             $formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">' . $langs->trans("CloseAs") . '</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
2297 2297
         }
2298
-        $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');               // Field to complete private note (not replace)
2298
+        $formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2299 2299
 
2300 2300
         if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2301 2301
             // This is a hidden option:
@@ -2479,7 +2479,7 @@  discard block
 block discarded – undo
2479 2479
         $nbMandated = 0;
2480 2480
         foreach ($object->lines as $line) {
2481 2481
             $res = $line->fetch_product();
2482
-            if ($res  > 0) {
2482
+            if ($res > 0) {
2483 2483
                 if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2484 2484
                     $nbMandated++;
2485 2485
                     break;
Please login to merge, or discard this patch.
public/htdocs/comm/propal/list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 // Search Fields
80 80
 $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
81
-$search_user    = GETPOSTINT('search_user');
81
+$search_user = GETPOSTINT('search_user');
82 82
 if ($search_user == -1) {
83 83
     $search_user = 0;
84 84
 }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 $search_date_endday = GETPOSTINT('search_date_endday');
112 112
 $search_date_endmonth = GETPOSTINT('search_date_endmonth');
113 113
 $search_date_endyear = GETPOSTINT('search_date_endyear');
114
-$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);   // Use tzserver
114
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
115 115
 $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
116 116
 $search_date_end_startday = GETPOSTINT('search_date_end_startday');
117 117
 $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth');
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 $search_date_end_endday = GETPOSTINT('search_date_end_endday');
120 120
 $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth');
121 121
 $search_date_end_endyear = GETPOSTINT('search_date_end_endyear');
122
-$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear);   // Use tzserver
122
+$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver
123 123
 $search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
124 124
 $search_date_delivery_startday = GETPOSTINT('search_date_delivery_startday');
125 125
 $search_date_delivery_startmonth = GETPOSTINT('search_date_delivery_startmonth');
Please login to merge, or discard this patch.
public/htdocs/comm/propal/class/propal.class.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -219,12 +219,12 @@  discard block
 block discarded – undo
219 219
      */
220 220
     public $total;
221 221
 
222
-    public $cond_reglement_code;    // code
223
-    public $cond_reglement;         // label
224
-    public $cond_reglement_doc;     // label doc
222
+    public $cond_reglement_code; // code
223
+    public $cond_reglement; // label
224
+    public $cond_reglement_doc; // label doc
225 225
 
226
-    public $mode_reglement_code;    // code
227
-    public $mode_reglement;         // label
226
+    public $mode_reglement_code; // code
227
+    public $mode_reglement; // label
228 228
 
229 229
     public $deposit_percent;
230 230
 
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
 
262 262
     public $duree_validite;
263 263
 
264
-    public $demand_reason_id;       // id
265
-    public $demand_reason_code;     // code
266
-    public $demand_reason;          // label
264
+    public $demand_reason_id; // id
265
+    public $demand_reason_code; // code
266
+    public $demand_reason; // label
267 267
 
268 268
     public $warehouse_id;
269 269
 
@@ -1619,7 +1619,7 @@  discard block
 block discarded – undo
1619 1619
                 $this->ref_customer         = $obj->ref_client;
1620 1620
                 $this->ref_ext              = $obj->ref_ext;
1621 1621
 
1622
-                $this->total                = $obj->total_ttc;          // TODO deprecated
1622
+                $this->total                = $obj->total_ttc; // TODO deprecated
1623 1623
                 $this->total_ttc            = $obj->total_ttc;
1624 1624
                 $this->total_ht             = $obj->total_ht;
1625 1625
                 $this->total_tva            = $obj->total_tva;
@@ -2535,7 +2535,7 @@  discard block
 block discarded – undo
2535 2535
      */
2536 2536
     public function closeProposal($user, $status, $note = '', $notrigger = 0)
2537 2537
     {
2538
-        global $langs,$conf;
2538
+        global $langs, $conf;
2539 2539
 
2540 2540
         $error = 0;
2541 2541
         $now = dol_now();
@@ -2566,10 +2566,10 @@  discard block
 block discarded – undo
2566 2566
         if ($resql) {
2567 2567
             // Status self::STATUS_REFUSED by default
2568 2568
             $modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf);
2569
-            $trigger_name = 'PROPAL_CLOSE_REFUSED';     // used later in call_trigger()
2569
+            $trigger_name = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger()
2570 2570
 
2571 2571
             if ($status == self::STATUS_SIGNED) {   // Status self::STATUS_SIGNED
2572
-                $trigger_name = 'PROPAL_CLOSE_SIGNED';  // used later in call_trigger()
2572
+                $trigger_name = 'PROPAL_CLOSE_SIGNED'; // used later in call_trigger()
2573 2573
                 $modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_TOBILL') ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->model_pdf;
2574 2574
 
2575 2575
                 // The connected company is classified as a client
@@ -3100,7 +3100,7 @@  discard block
 block discarded – undo
3100 3100
                     }
3101 3101
                 }
3102 3102
                 if (file_exists($dir)) {
3103
-                    $res = @dol_delete_dir_recursive($dir);     // delete files physically + into ecm tables
3103
+                    $res = @dol_delete_dir_recursive($dir); // delete files physically + into ecm tables
3104 3104
                     if (!$res) {
3105 3105
                         $this->error = 'ErrorFailToDeleteDir';
3106 3106
                         $this->errors[] = $this->error;
Please login to merge, or discard this patch.
public/htdocs/comm/mailing/card.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
     }
472 472
 
473 473
     // Action send test emailing
474
-    if ($action == 'send' && ! $cancel && $permissiontovalidatesend) {
474
+    if ($action == 'send' && !$cancel && $permissiontovalidatesend) {
475 475
         $error = 0;
476 476
 
477 477
         $upload_dir = $conf->mailing->dir_output . "/" . get_exdir($object->id, 2, 0, 1, $object, 'mailing');
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
     if ($action == 'add' && $permissiontocreate) {
550 550
         $mesgs = array();
551 551
 
552
-        $object->messtype       = (string) GETPOST("messtype");
552
+        $object->messtype = (string) GETPOST("messtype");
553 553
         if ($object->messtype == 'sms') {
554 554
             $object->email_from     = (string) GETPOST("from_phone", 'alphawithlgt'); // Must allow 'name <email>'
555 555
         } else {
@@ -1515,7 +1515,7 @@  discard block
 block discarded – undo
1515 1515
                 $maxfilesizearray = getMaxFileSizeArray();
1516 1516
                 $maxmin = $maxfilesizearray['maxmin'];
1517 1517
                 if ($maxmin > 0) {
1518
-                    $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">';  // MAX_FILE_SIZE must precede the field type=file
1518
+                    $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="' . ($maxmin * 1024) . '">'; // MAX_FILE_SIZE must precede the field type=file
1519 1519
                 }
1520 1520
                 $out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="' . $langs->trans("Upload") . '" />';
1521 1521
                 $out .= ' ';
Please login to merge, or discard this patch.
public/htdocs/comm/mailing/cibles.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             }
395 395
         }
396 396
         if (empty($nbemail)) {
397
-            $nbemail .= ' ' . img_warning($langs->trans('ToAddRecipientsChooseHere'));//.' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
397
+            $nbemail .= ' ' . img_warning($langs->trans('ToAddRecipientsChooseHere')); //.' <span class="warning">'.$langs->trans("NoTargetYet").'</span>';
398 398
         }
399 399
         if ($text) {
400 400
             // @phan-suppress-next-line PhanPluginSuspiciousParamPosition
@@ -549,12 +549,12 @@  discard block
 block discarded – undo
549 549
                     }
550 550
                     print img_object($langs->trans("EmailingTargetSelector") . ': ' . get_class($obj), $obj->picto, 'class="valignmiddle width25 size15x"');
551 551
                     print '</div>';
552
-                    print '<div class="tagtd valignmiddle">';   //  style="height: 4em"
552
+                    print '<div class="tagtd valignmiddle">'; //  style="height: 4em"
553 553
                     print $obj->getDesc();
554 554
                     print '</div>';
555 555
 
556 556
                     try {
557
-                        $obj->evenunsubscribe = $object->evenunsubscribe;   // Set flag to include/exclude email that has opt-out.
557
+                        $obj->evenunsubscribe = $object->evenunsubscribe; // Set flag to include/exclude email that has opt-out.
558 558
 
559 559
                         $nbofrecipient = $obj->getNbOfRecipients('');
560 560
                     } catch (Exception $e) {
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
                 print '<td class="center nowraponall">';
900 900
                 if ($obj->status != $object::STATUS_DRAFT) {        // If status of target line is not draft
901 901
                     // Date sent
902
-                    print $obj->date_envoi;     // @TODO Must store date in date format
902
+                    print $obj->date_envoi; // @TODO Must store date in date format
903 903
                 }
904 904
                 print '</td>';
905 905
 
Please login to merge, or discard this patch.
public/htdocs/comm/mailing/list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 // Initialize technical objects
65 65
 $object = new Mailing($db);
66 66
 $extrafields = new ExtraFields($db);
67
-$hookmanager->initHooks(array($contextpage));   // Note that conf->hooks_modules contains array of activated contexes
67
+$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
68 68
 
69 69
 // Fetch optionals attributes and labels
70 70
 $extrafields->fetch_name_optionals_label($object->table_element);
Please login to merge, or discard this patch.