Passed
Push — MINOR_OPTIMIZATIONS_241106 ( 63568c )
by Rafael
57:48
created
public/htdocs/takepos/phone.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@
 block discarded – undo
33 33
 //if (! defined('NOREQUIREDB'))     define('NOREQUIREDB','1');      // Not disabled cause need to load personalized language
34 34
 //if (! defined('NOREQUIRESOC'))        define('NOREQUIRESOC','1');
35 35
 //if (! defined('NOREQUIRETRAN'))       define('NOREQUIRETRAN','1');
36
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
37
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
36
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
37
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
38 38
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
39 39
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
40 40
 
Please login to merge, or discard this patch.
public/htdocs/takepos/floors.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 //if (! defined('NOREQUIREDB'))     define('NOREQUIREDB','1');      // Not disabled cause need to load personalized language
32 32
 //if (! defined('NOREQUIRESOC'))    define('NOREQUIRESOC','1');
33 33
 //if (! defined('NOREQUIRETRAN'))   define('NOREQUIRETRAN','1');
34
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
34
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
35 35
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
36 36
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
37 37
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  */
64 64
 
65 65
 if ($action == "getTables") {
66
-    $sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM " . MAIN_DB_PREFIX . "takepos_floor_tables WHERE floor = " . ((int)$floor) . " AND entity IN (" . getEntity('takepos') . ")";
66
+    $sql = "SELECT rowid, entity, label, leftpos, toppos, floor FROM " . MAIN_DB_PREFIX . "takepos_floor_tables WHERE floor = " . ((int) $floor) . " AND entity IN (" . getEntity('takepos') . ")";
67 67
     $resql = $db->query($sql);
68 68
     $rows = array();
69 69
     while ($row = $db->fetch_array($resql)) {
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
         $top = 95;
89 89
     }
90 90
     if ($left > 3 or $top > 4) {
91
-        $db->query("UPDATE " . MAIN_DB_PREFIX . "takepos_floor_tables SET leftpos = " . ((int)$left) . ", toppos = " . ((int)$top) . " WHERE rowid = " . ((int)$place));
91
+        $db->query("UPDATE " . MAIN_DB_PREFIX . "takepos_floor_tables SET leftpos = " . ((int) $left) . ", toppos = " . ((int) $top) . " WHERE rowid = " . ((int) $place));
92 92
     } else {
93
-        $db->query("DELETE from " . MAIN_DB_PREFIX . "takepos_floor_tables WHERE rowid = " . ((int)$place));
93
+        $db->query("DELETE from " . MAIN_DB_PREFIX . "takepos_floor_tables WHERE rowid = " . ((int) $place));
94 94
     }
95 95
 }
96 96
 
@@ -99,11 +99,11 @@  discard block
 block discarded – undo
99 99
     if (strlen($newname) > 3) {
100 100
         $newname = substr($newname, 0, 3); // Only 3 chars
101 101
     }
102
-    $resql = $db->query("UPDATE " . MAIN_DB_PREFIX . "takepos_floor_tables SET label='" . $db->escape($newname) . "' WHERE rowid = " . ((int)$place));
102
+    $resql = $db->query("UPDATE " . MAIN_DB_PREFIX . "takepos_floor_tables SET label='" . $db->escape($newname) . "' WHERE rowid = " . ((int) $place));
103 103
 }
104 104
 
105 105
 if ($action == "add") {
106
-    $sql = "INSERT INTO " . MAIN_DB_PREFIX . "takepos_floor_tables(entity, label, leftpos, toppos, floor) VALUES (" . $conf->entity . ", '', '45', '45', " . ((int)$floor) . ")";
106
+    $sql = "INSERT INTO " . MAIN_DB_PREFIX . "takepos_floor_tables(entity, label, leftpos, toppos, floor) VALUES (" . $conf->entity . ", '', '45', '45', " . ((int) $floor) . ")";
107 107
     $asdf = $db->query($sql);
108 108
     $db->query("UPDATE " . MAIN_DB_PREFIX . "takepos_floor_tables SET label = rowid WHERE label = ''"); // No empty table names
109 109
 }
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             url: "<?php echo constant('BASE_URL') . '/takepos/floors.php'; ?>",
156 156
             data: {action: "update", left: left, top: top, place: idplace, token: '<?php echo currentToken(); ?>'}
157 157
         }).done(function (msg) {
158
-            window.location.href = 'floors.php?mode=edit&floor=<?php echo urlencode((string)($floor)); ?>';
158
+            window.location.href = 'floors.php?mode=edit&floor=<?php echo urlencode((string) ($floor)); ?>';
159 159
         });
160 160
     }
161 161
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             url: "<?php echo constant('BASE_URL') . '/takepos/floors.php'; ?>",
168 168
             data: {action: "updatename", place: rowid, newname: after, token: '<?php echo currentToken(); ?>'}
169 169
         }).done(function (msg) {
170
-            window.location.href = 'floors.php?mode=edit&floor=<?php echo urlencode((string)($floor)); ?>';
170
+            window.location.href = 'floors.php?mode=edit&floor=<?php echo urlencode((string) ($floor)); ?>';
171 171
         });
172 172
     }
173 173
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
 
179 179
     $(document).ready(function () {
180
-        $.getJSON('./floors.php?action=getTables&token=<?php echo newToken();?>&floor=<?php echo $floor; ?>', function (data) {
180
+        $.getJSON('./floors.php?action=getTables&token=<?php echo newToken(); ?>&floor=<?php echo $floor; ?>', function (data) {
181 181
             $.each(data, function (key, val) {
182 182
                 <?php if ($mode == "edit") {?>
183 183
                 $('body').append('<div class="tablediv" contenteditable onblur="updatename(' + val.rowid + ');" style="position: absolute; left: ' + val.leftpos + '%; top: ' + val.toppos + '%;" id="tablename' + val.rowid + '">' + val.label + '</div>');
Please login to merge, or discard this patch.
public/htdocs/stripe/ajax/ajax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@
 block discarded – undo
32 32
  *  action=capturePaymentIntent generates a payment
33 33
  */
34 34
 
35
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
36
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
35
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
36
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
37 37
 Functions::defineIfNotDefined('NOREQUIREHTML', 1); // If we don't need to load the html.form.class.php
38 38
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
39
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
39
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
40 40
 
41 41
 // Load Dolibarr environment
42 42
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php'; // Load $user and permissions
Please login to merge, or discard this patch.
public/htdocs/ecm/ajax/ecmdatabase.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@
 block discarded – undo
26 26
  *       \brief      File to build/refresh the ecm database for directories
27 27
  */
28 28
 
29
-Functions::defineIfNotDefined('NOTOKENRENEWAL', 1);  // Disables token renewal
30
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
29
+Functions::defineIfNotDefined('NOTOKENRENEWAL', 1); // Disables token renewal
30
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
31 31
 Functions::defineIfNotDefined('NOREQUIREAJAX', 1); // Do not load ajax.lib.php library
32
-Functions::defineIfNotDefined('NOREQUIRESOC', 1);   // No company needed
32
+Functions::defineIfNotDefined('NOREQUIRESOC', 1); // No company needed
33 33
 
34 34
 // Load Dolibarr environment
35 35
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
Please login to merge, or discard this patch.
public/htdocs/public/donations/donateurs_code.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@
 block discarded – undo
26 26
  *      \brief      Page to list donators
27 27
  */
28 28
 
29
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
30
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
29
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
30
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
31 31
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
32 32
 
33 33
 // C'est un wrapper, donc header vierge
Please login to merge, or discard this patch.
public/htdocs/public/stripe/ipn.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 use Dolibarr\Code\Stripe\Classes\Stripe;
33 33
 use Dolibarr\Code\User\Classes\User;
34 34
 
35
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
35
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
36 36
 Functions::defineIfNotDefined('NOCSRFCHECK', 1); // We accept to go on this page from external web site.
37 37
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
38
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
38
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
39 39
 
40 40
 // Because 2 entities can have the same ref.
41
-$entity = (!empty($_GET['entity']) ? (int)$_GET['entity'] : (!empty($_POST['entity']) ? (int)$_POST['entity'] : 1));
41
+$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
42 42
 if (is_numeric($entity)) {
43 43
     define("DOLENTITY", $entity);
44 44
 }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             $typeto = 'VIR';
240 240
 
241 241
             if (!$error) {
242
-                $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1 * (float)price2num($amount), '', '', $user);
242
+                $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1 * (float) price2num($amount), '', '', $user);
243 243
             }
244 244
             if (!($bank_line_id_from > 0)) {
245 245
                 $error++;
@@ -318,15 +318,15 @@  discard block
 block discarded – undo
318 318
     global $stripearrayofkeysbyenv;
319 319
     $error = 0;
320 320
     $object = $event->data->object;
321
-    $TRANSACTIONID = $object->id;   // Example pi_123456789...
321
+    $TRANSACTIONID = $object->id; // Example pi_123456789...
322 322
     $ipaddress = $object->metadata->ipaddress;
323 323
     $now = dol_now();
324 324
     $currencyCodeType = strtoupper($object->currency);
325 325
     $paymentmethodstripeid = $object->payment_method;
326 326
     $customer_id = $object->customer;
327 327
     $invoice_id = "";
328
-    $paymentTypeCode = "";          // payment type according to Stripe
329
-    $paymentTypeCodeInDolibarr = "";    // payment type according to Dolibarr
328
+    $paymentTypeCode = ""; // payment type according to Stripe
329
+    $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr
330 330
     $payment_amount = 0;
331 331
     $payment_amountInDolibarr = 0;
332 332
 
@@ -417,9 +417,9 @@  discard block
 block discarded – undo
417 417
             $paiement->datepaye = $now;
418 418
             $paiement->date = $now;
419 419
             if ($currencyCodeType == $conf->currency) {
420
-                $paiement->amounts = [$invoice_id => $payment_amount];   // Array with all payments dispatching with invoice id
420
+                $paiement->amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching with invoice id
421 421
             } else {
422
-                $paiement->multicurrency_amounts = [$invoice_id => $payment_amount];   // Array with all payments dispatching
422
+                $paiement->multicurrency_amounts = [$invoice_id => $payment_amount]; // Array with all payments dispatching
423 423
 
424 424
                 $postactionmessages[] = 'Payment was done in a currency (' . $currencyCodeType . ') other than the expected currency of company (' . $conf->currency . ')';
425 425
                 $ispostactionok = -1;
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
             $paiement->num_payment = '';
444 444
             $paiement->note_public = '';
445 445
             $paiement->note_private = 'StripeSepa payment received by IPN webhook - ' . dol_print_date($now, 'standard') . ' using servicestatus=' . $servicestatus . ($ipaddress ? ' from ip ' . $ipaddress : '') . ' - Transaction ID = ' . $TRANSACTIONID;
446
-            $paiement->ext_payment_id = $TRANSACTIONID . ':' . $customer_id . '@' . $stripearrayofkeysbyenv[$servicestatus]['publishable_key'];     // May be we should store py_... instead of pi_... but we started with pi_... so we continue.
446
+            $paiement->ext_payment_id = $TRANSACTIONID . ':' . $customer_id . '@' . $stripearrayofkeysbyenv[$servicestatus]['publishable_key']; // May be we should store py_... instead of pi_... but we started with pi_... so we continue.
447 447
             $paiement->ext_payment_site = $service;
448 448
 
449 449
             $ispaymentdone = 0;
@@ -525,11 +525,11 @@  discard block
 block discarded – undo
525 525
                 $sql .= " FROM " . MAIN_DB_PREFIX . "prelevement_demande as dp";
526 526
                 $sql .= " JOIN " . MAIN_DB_PREFIX . "prelevement_bons as pb"; // Here we join to prevent modification of a prelevement bon already credited
527 527
                 $sql .= " ON pb.rowid = dp.fk_prelevement_bons";
528
-                $sql .= " WHERE dp.fk_facture = " . ((int)$invoice_id);
528
+                $sql .= " WHERE dp.fk_facture = " . ((int) $invoice_id);
529 529
                 $sql .= " AND dp.sourcetype = 'facture'";
530 530
                 $sql .= " AND dp.ext_payment_id = '" . $db->escape($TRANSACTIONID) . "'";
531 531
                 $sql .= " AND dp.traite = 1";
532
-                $sql .= " AND statut = " . ((int)$bon::STATUS_TRANSFERED); // To be sure that it's not already credited
532
+                $sql .= " AND statut = " . ((int) $bon::STATUS_TRANSFERED); // To be sure that it's not already credited
533 533
                 $result = $db->query($sql);
534 534
                 if ($result) {
535 535
                     if ($db->num_rows($result)) {
@@ -547,12 +547,12 @@  discard block
 block discarded – undo
547 547
 
548 548
                 if (!$error && !empty($idbon)) {
549 549
                     $sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_bons";
550
-                    $sql .= " SET fk_user_credit = " . ((int)$user->id);
551
-                    $sql .= ", statut = " . ((int)$bon::STATUS_CREDITED);
550
+                    $sql .= " SET fk_user_credit = " . ((int) $user->id);
551
+                    $sql .= ", statut = " . ((int) $bon::STATUS_CREDITED);
552 552
                     $sql .= ", date_credit = '" . $db->idate($now) . "'";
553 553
                     $sql .= ", credite = 1";
554
-                    $sql .= " WHERE rowid = " . ((int)$idbon);
555
-                    $sql .= " AND statut = " . ((int)$bon::STATUS_TRANSFERED);
554
+                    $sql .= " WHERE rowid = " . ((int) $idbon);
555
+                    $sql .= " AND statut = " . ((int) $bon::STATUS_TRANSFERED);
556 556
 
557 557
                     $result = $db->query($sql);
558 558
                     if (!$result) {
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
                 if (!$error && !empty($idbon)) {
566 566
                     $sql = "UPDATE " . MAIN_DB_PREFIX . "prelevement_lignes";
567 567
                     $sql .= " SET statut = 2";
568
-                    $sql .= " WHERE fk_prelevement_bons = " . ((int)$idbon);
568
+                    $sql .= " WHERE fk_prelevement_bons = " . ((int) $idbon);
569 569
                     $result = $db->query($sql);
570 570
                     if (!$result) {
571 571
                         $postactionmessages[] = $db->lasterror();
@@ -758,7 +758,7 @@  discard block
 block discarded – undo
758 758
     }
759 759
 } elseif ($event->type == 'payment_method.detached') {
760 760
     $db->begin();
761
-    $sql = "DELETE FROM " . MAIN_DB_PREFIX . "societe_rib WHERE number = '" . $db->escape($event->data->object->id) . "' and status = " . ((int)$servicestatus);
761
+    $sql = "DELETE FROM " . MAIN_DB_PREFIX . "societe_rib WHERE number = '" . $db->escape($event->data->object->id) . "' and status = " . ((int) $servicestatus);
762 762
     $db->query($sql);
763 763
     $db->commit();
764 764
 } elseif ($event->type == 'charge.succeeded') {
Please login to merge, or discard this patch.
public/htdocs/public/ticket/list.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@  discard block
 block discarded – undo
32 32
  *       \brief      Public file to list tickets
33 33
  */
34 34
 
35
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
35
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
36 36
 // If there is no need to load and show top and left menu
37
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
37
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
38 38
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
39
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
39
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
40 40
 // If this page is public (can be called outside logged session)
41 41
 
42 42
 // For MultiCompany module.
43 43
 // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
44 44
 // Because 2 entities can have the same ref.
45
-$entity = (!empty($_GET['entity']) ? (int)$_GET['entity'] : (!empty($_POST['entity']) ? (int)$_POST['entity'] : 1));
45
+$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
46 46
 if (is_numeric($entity)) {
47 47
     define("DOLENTITY", $entity);
48 48
 }
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
         $param = '&action=view_ticketlist';
233 233
         if (!empty($entity) && isModEnabled('multicompany')) {
234
-            $param .= '&entity=' . ((int)$entity);
234
+            $param .= '&entity=' . ((int) $entity);
235 235
         }
236 236
 
237 237
         $param .= '&token=' . newToken();
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
268 268
             foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
269 269
                 if ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate') {
270
-                    $enabled = abs((int)dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1, 1, '2'));
270
+                    $enabled = abs((int) dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1, 1, '2'));
271 271
                     $enabled = (($enabled == 0 || $enabled == 3) ? 0 : $enabled);
272 272
                     $arrayfields["ef." . $key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => ($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1, 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => $enabled && $extrafields->attributes[$object->table_element]['perms'][$key]);
273 273
                 }
@@ -293,14 +293,14 @@  discard block
 block discarded – undo
293 293
             // -1 value = all so no filter
294 294
             if ($search_fk_user_assign > 0) {
295 295
                 $filter['t.fk_user_assign'] = $search_fk_user_assign;
296
-                $param .= '&search_fk_user_assign=' . urlencode((string)($search_fk_user_assign));
296
+                $param .= '&search_fk_user_assign=' . urlencode((string) ($search_fk_user_assign));
297 297
             }
298 298
         }
299 299
         if (!empty($search_fk_user_create)) {
300 300
             // -1 value = all so no filter
301 301
             if ($search_fk_user_create > 0) {
302 302
                 $filter['t.fk_user_create'] = $search_fk_user_create;
303
-                $param .= '&search_fk_user_create=' . urlencode((string)($search_fk_user_create));
303
+                $param .= '&search_fk_user_create=' . urlencode((string) ($search_fk_user_create));
304 304
             }
305 305
         }
306 306
         if ((isset($search_fk_status) && $search_fk_status != '') && $search_fk_status != '-1' && $search_fk_status != 'non_closed') {
@@ -383,9 +383,9 @@  discard block
 block discarded – undo
383 383
         $sql .= " AND ((tc.source = 'external'";
384 384
         $sql .= " AND tc.element='" . $db->escape($object->element) . "'";
385 385
         $sql .= " AND tc.active=1";
386
-        $sql .= " AND sp.email='" . $db->escape($_SESSION['email_customer']) . "')";        // email found into an external contact
387
-        $sql .= " OR s.email='" . $db->escape($_SESSION['email_customer']) . "'";           // or email of the linked company
388
-        $sql .= " OR t.origin_email='" . $db->escape($_SESSION['email_customer']) . "')";   // or email of the requester
386
+        $sql .= " AND sp.email='" . $db->escape($_SESSION['email_customer']) . "')"; // email found into an external contact
387
+        $sql .= " OR s.email='" . $db->escape($_SESSION['email_customer']) . "'"; // or email of the linked company
388
+        $sql .= " OR t.origin_email='" . $db->escape($_SESSION['email_customer']) . "')"; // or email of the requester
389 389
         // Manage filter
390 390
         if (!empty($filter)) {
391 391
             foreach ($filter as $key => $value) {
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
                     if (is_array($value) && count($value) > 0) {
398 398
                         $sql .= " AND " . $key . " IN (" . $db->sanitize(implode(',', $value)) . ")";
399 399
                     } else {
400
-                        $sql .= " AND " . $key . " = " . ((int)$value);
400
+                        $sql .= " AND " . $key . " = " . ((int) $value);
401 401
                     }
402 402
                 } else {
403 403
                     $sql .= " AND " . $key . " LIKE '%" . $db->escape($value) . "%'";
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 
434 434
                 // allow to display information before list
435 435
                 $parameters = array('arrayfields' => $arrayfields);
436
-                $reshook = $hookmanager->executeHooks('printFieldListHeader', $parameters, $object, $action);    // Note that $action and $object may have been modified by hook
436
+                $reshook = $hookmanager->executeHooks('printFieldListHeader', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
437 437
                 print $hookmanager->resPrint;
438 438
 
439 439
                 print '<div class="div-table-responsive">';
Please login to merge, or discard this patch.
public/htdocs/public/ticket/view.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,17 +34,17 @@
 block discarded – undo
34 34
  *       \brief      Public file to show one ticket
35 35
  */
36 36
 
37
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
37
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
38 38
 // If there is no need to load and show top and left menu
39
-Functions::defineIfNotDefined('NOLOGIN', 1);  // File must be accessed by logon page so without login
39
+Functions::defineIfNotDefined('NOLOGIN', 1); // File must be accessed by logon page so without login
40 40
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
41
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
41
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
42 42
 // If this page is public (can be called outside logged session)
43 43
 
44 44
 // For MultiCompany module.
45 45
 // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
46 46
 // Because 2 entities can have the same ref.
47
-$entity = (!empty($_GET['entity']) ? (int)$_GET['entity'] : (!empty($_POST['entity']) ? (int)$_POST['entity'] : 1));
47
+$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
48 48
 if (is_numeric($entity)) {
49 49
     define("DOLENTITY", $entity);
50 50
 }
Please login to merge, or discard this patch.
public/htdocs/public/ticket/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
  *    \brief      Public page to add and manage tickets
30 30
  */
31 31
 
32
-Functions::defineIfNotDefined('NOREQUIREMENU', 1);  // If there is no need to load and show top and left menu
33
-Functions::defineIfNotDefined('NOLOGIN', 1);  // If this page is public (can be called outside logged session)
32
+Functions::defineIfNotDefined('NOREQUIREMENU', 1); // If there is no need to load and show top and left menu
33
+Functions::defineIfNotDefined('NOLOGIN', 1); // If this page is public (can be called outside logged session)
34 34
 Functions::defineIfNotDefined('NOIPCHECK', 1); // Do not check IP defined into conf $dolibarr_main_restrict_ip
35
-Functions::defineIfNotDefined('NOBROWSERNOTIF', 1);  // Disable browser notification
35
+Functions::defineIfNotDefined('NOBROWSERNOTIF', 1); // Disable browser notification
36 36
 
37 37
 // For MultiCompany module
38 38
 // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
39 39
 // Because 2 entities can have the same ref.
40
-$entity = (!empty($_GET['entity']) ? (int)$_GET['entity'] : (!empty($_POST['entity']) ? (int)$_POST['entity'] : 1));
40
+$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
41 41
 if (is_numeric($entity)) {
42 42
     define("DOLENTITY", $entity);
43 43
 }
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 print '<a href="list.php' . (!empty($entity) && isModEnabled('multicompany') ? '?entity=' . $entity : '') . '" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded"><span class="fa fa-15 fa-list-alt valignmiddle btnTitle-icon"></span><br>' . dol_escape_htmltag($langs->trans("ViewMyTicketList")) . '</div></a>';
93 93
 print '<a href="view.php' . (!empty($entity) && isModEnabled('multicompany') ? '?entity=' . $entity : '') . '" rel="nofollow noopener" class="butAction marginbottomonly"><div class="index_display bigrounded">' . img_picto('', 'ticket', 'class="fa-15"') . '<br>' . dol_escape_htmltag($langs->trans("ShowTicketWithTrackId")) . '</div></a>';
94 94
 print '<div class="clearboth"></div>';
95
-print '</div>';  // ends '<div class="ticketform">';
96
-print '</div>';  // ends '<div class="ticketpublicarea ticketlargemargin centpercent">';
95
+print '</div>'; // ends '<div class="ticketform">';
96
+print '</div>'; // ends '<div class="ticketpublicarea ticketlargemargin centpercent">';
97 97
 
98 98
 if (getDolGlobalInt('TICKET_SHOW_COMPANY_FOOTER')) {
99 99
     // End of page
Please login to merge, or discard this patch.