Passed
Push — master ( 853f8f...c34860 )
by Alxarafe
25:12
created
dolibarr/htdocs/comm/index.php 1 patch
Spacing   +119 added lines, -119 removed lines patch added patch discarded remove patch
@@ -27,26 +27,26 @@  discard block
 block discarded – undo
27 27
  * 	\ingroup    commercial
28 28
  * 	\brief      Home page of commercial area
29 29
  */
30
-require DOL_BASE_PATH . '/main.inc.php';
30
+require DOL_BASE_PATH.'/main.inc.php';
31 31
 
32
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
33
-require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
35
-require_once DOL_DOCUMENT_ROOT . '/core/lib/agenda.lib.php';
32
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
33
+require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
35
+require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
36 36
 if (!empty($conf->contrat->enabled)) {
37
-    require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
37
+    require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
38 38
 }
39 39
 if (!empty($conf->propal->enabled)) {
40
-    require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
40
+    require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
41 41
 }
42 42
 if (!empty($conf->supplier_proposal->enabled)) {
43
-    require_once DOL_DOCUMENT_ROOT . '/supplier_proposal/class/supplier_proposal.class.php';
43
+    require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
44 44
 }
45 45
 if (!empty($conf->commande->enabled)) {
46
-    require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
46
+    require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
47 47
 }
48 48
 if (!empty($conf->fournisseur->enabled)) {
49
-    require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php';
49
+    require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
50 50
 }
51 51
 
52 52
 if (!$user->rights->societe->lire) {
@@ -127,18 +127,18 @@  discard block
 block discarded – undo
127 127
     }
128 128
 
129 129
     if (count($listofsearchfields)) {
130
-        print '<form method="post" action="' . BASE_URI . '?controller=core&method=search">';
131
-        print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
130
+        print '<form method="post" action="'.BASE_URI.'?controller=core&method=search">';
131
+        print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
132 132
         print '<table class="noborder nohover centpercent">';
133 133
         $i = 0;
134 134
         foreach ($listofsearchfields as $key => $value) {
135 135
             if ($i == 0) {
136
-                print '<tr class="liste_titre"><td colspan="3">' . $langs->trans("Search") . '</td></tr>';
136
+                print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("Search").'</td></tr>';
137 137
             }
138
-            print '<tr ' . $bc[false] . '>';
139
-            print '<td class="nowrap"><label for="' . $key . '">' . $langs->trans($value["text"]) . '</label></td><td><input type="text" class="flat inputsearch" name="' . $key . '" id="' . $key . '" size="18"></td>';
138
+            print '<tr '.$bc[false].'>';
139
+            print '<td class="nowrap"><label for="'.$key.'">'.$langs->trans($value["text"]).'</label></td><td><input type="text" class="flat inputsearch" name="'.$key.'" id="'.$key.'" size="18"></td>';
140 140
             if ($i == 0) {
141
-                print '<td class="noborderbottom" rowspan="' . count($listofsearchfields) . '"><input type="submit" value="' . $langs->trans("Search") . '" class="button "></td>';
141
+                print '<td class="noborderbottom" rowspan="'.count($listofsearchfields).'"><input type="submit" value="'.$langs->trans("Search").'" class="button "></td>';
142 142
             }
143 143
             print '</tr>';
144 144
             $i++;
@@ -158,19 +158,19 @@  discard block
 block discarded – undo
158 158
 
159 159
     $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
160 160
     $sql .= ", s.code_client";
161
-    $sql .= " FROM " . MAIN_DB_PREFIX . "propal as p";
162
-    $sql .= ", " . MAIN_DB_PREFIX . "societe as s";
161
+    $sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
162
+    $sql .= ", ".MAIN_DB_PREFIX."societe as s";
163 163
     if (!$user->rights->societe->client->voir && !$socid) {
164
-        $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
164
+        $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
165 165
     }
166 166
     $sql .= " WHERE p.fk_statut = 0";
167 167
     $sql .= " AND p.fk_soc = s.rowid";
168
-    $sql .= " AND p.entity IN (" . getEntity('propal') . ")";
168
+    $sql .= " AND p.entity IN (".getEntity('propal').")";
169 169
     if (!$user->rights->societe->client->voir && !$socid) {
170
-        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
170
+        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
171 171
     }
172 172
     if ($socid) {
173
-        $sql .= " AND s.rowid = " . $socid;
173
+        $sql .= " AND s.rowid = ".$socid;
174 174
     }
175 175
 
176 176
     $resql = $db->query($sql);
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         print '<div class="div-table-responsive-no-min">';
182 182
         print '<table class="noborder" width="100%">';
183 183
         print '<tr class="liste_titre">';
184
-        print '<th colspan="3">' . $langs->trans("ProposalsDraft") . ($num ? ' <span class="badge">' . $num . '</span>' : '') . '</th></tr>';
184
+        print '<th colspan="3">'.$langs->trans("ProposalsDraft").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
185 185
 
186 186
         if ($num > 0) {
187 187
             $i = 0;
@@ -206,17 +206,17 @@  discard block
 block discarded – undo
206 206
                 $companystatic->canvas = $obj->canvas;
207 207
                 print $companystatic->getNomUrl(1, 'customer', 16);
208 208
                 print '</td>';
209
-                print '<td align="right" class="nowrap">' . price($obj->total_ht) . '</td></tr>';
209
+                print '<td align="right" class="nowrap">'.price($obj->total_ht).'</td></tr>';
210 210
                 $i++;
211 211
                 $total += $obj->total_ht;
212 212
             }
213 213
             if ($total > 0) {
214 214
 
215
-                print '<tr class="liste_total"><td>' . $langs->trans("Total") . '</td><td colspan="2" align="right">' . price($total) . "</td></tr>";
215
+                print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
216 216
             }
217 217
         } else {
218 218
 
219
-            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">' . $langs->trans("NoProposal") . '</td></tr>';
219
+            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoProposal").'</td></tr>';
220 220
         }
221 221
         print "</table></div><br>";
222 222
 
@@ -236,19 +236,19 @@  discard block
 block discarded – undo
236 236
 
237 237
     $sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
238 238
     $sql .= ", s.code_client";
239
-    $sql .= " FROM " . MAIN_DB_PREFIX . "supplier_proposal as p";
240
-    $sql .= ", " . MAIN_DB_PREFIX . "societe as s";
239
+    $sql .= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p";
240
+    $sql .= ", ".MAIN_DB_PREFIX."societe as s";
241 241
     if (!$user->rights->societe->client->voir && !$socid) {
242
-        $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
242
+        $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
243 243
     }
244 244
     $sql .= " WHERE p.fk_statut = 0";
245 245
     $sql .= " AND p.fk_soc = s.rowid";
246
-    $sql .= " AND p.entity IN (" . getEntity('supplier_proposal') . ")";
246
+    $sql .= " AND p.entity IN (".getEntity('supplier_proposal').")";
247 247
     if (!$user->rights->societe->client->voir && !$socid) {
248
-        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
248
+        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
249 249
     }
250 250
     if ($socid) {
251
-        $sql .= " AND s.rowid = " . $socid;
251
+        $sql .= " AND s.rowid = ".$socid;
252 252
     }
253 253
 
254 254
     $resql = $db->query($sql);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
         print '<div class="div-table-responsive-no-min">';
260 260
         print '<table class="noborder" width="100%">';
261 261
         print '<tr class="liste_titre">';
262
-        print '<th colspan="3">' . $langs->trans("SupplierProposalsDraft") . ($num ? ' <span class="badge">' . $num . '</span>' : '') . '</th></tr>';
262
+        print '<th colspan="3">'.$langs->trans("SupplierProposalsDraft").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
263 263
 
264 264
         if ($num > 0) {
265 265
             $i = 0;
@@ -283,15 +283,15 @@  discard block
 block discarded – undo
283 283
                 $companystatic->canvas = $obj->canvas;
284 284
                 print $companystatic->getNomUrl(1, 'supplier', 16);
285 285
                 print '</td>';
286
-                print '<td align="right" class="nowrap">' . price($obj->total_ht) . '</td></tr>';
286
+                print '<td align="right" class="nowrap">'.price($obj->total_ht).'</td></tr>';
287 287
                 $i++;
288 288
                 $total += $obj->total_ht;
289 289
             }
290 290
             if ($total > 0) {
291
-                print '<tr class="liste_total"><td>' . $langs->trans("Total") . '</td><td colspan="2" align="right">' . price($total) . "</td></tr>";
291
+                print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
292 292
             }
293 293
         } else {
294
-            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">' . $langs->trans("NoProposal") . '</td></tr>';
294
+            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoProposal").'</td></tr>';
295 295
         }
296 296
         print "</table></div><br>";
297 297
 
@@ -310,19 +310,19 @@  discard block
 block discarded – undo
310 310
 
311 311
     $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
312 312
     $sql .= ", s.code_client";
313
-    $sql .= " FROM " . MAIN_DB_PREFIX . "commande as c";
314
-    $sql .= ", " . MAIN_DB_PREFIX . "societe as s";
313
+    $sql .= " FROM ".MAIN_DB_PREFIX."commande as c";
314
+    $sql .= ", ".MAIN_DB_PREFIX."societe as s";
315 315
     if (!$user->rights->societe->client->voir && !$socid) {
316
-        $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
316
+        $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
317 317
     }
318 318
     $sql .= " WHERE c.fk_soc = s.rowid";
319 319
     $sql .= " AND c.fk_statut = 0";
320
-    $sql .= " AND c.entity IN (" . getEntity('commande') . ")";
320
+    $sql .= " AND c.entity IN (".getEntity('commande').")";
321 321
     if (!$user->rights->societe->client->voir && !$socid) {
322
-        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
322
+        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
323 323
     }
324 324
     if ($socid) {
325
-        $sql .= " AND c.fk_soc = " . $socid;
325
+        $sql .= " AND c.fk_soc = ".$socid;
326 326
     }
327 327
 
328 328
     $resql = $db->query($sql);
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
         print '<div class="div-table-responsive-no-min">';
334 334
         print '<table class="noborder" width="100%">';
335 335
         print '<tr class="liste_titre">';
336
-        print '<th colspan="3">' . $langs->trans("DraftOrders") . ($num ? ' <span class="badge">' . $num . '</span>' : '') . '</th></tr>';
336
+        print '<th colspan="3">'.$langs->trans("DraftOrders").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
337 337
 
338 338
         if ($num > 0) {
339 339
             $i = 0;
@@ -359,20 +359,20 @@  discard block
 block discarded – undo
359 359
                 print $companystatic->getNomUrl(1, 'customer', 16);
360 360
                 print '</td>';
361 361
                 if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
362
-                    print '<td align="right" class="nowrap">' . price($obj->total_ht) . '</td></tr>';
362
+                    print '<td align="right" class="nowrap">'.price($obj->total_ht).'</td></tr>';
363 363
                 } else {
364
-                    print '<td align="right" class="nowrap">' . price($obj->total_ttc) . '</td></tr>';
364
+                    print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
365 365
                 }
366 366
                 $i++;
367 367
                 $total += $obj->total_ttc;
368 368
             }
369 369
             if ($total > 0) {
370 370
 
371
-                print '<tr class="liste_total"><td>' . $langs->trans("Total") . '</td><td colspan="2" align="right">' . price($total) . "</td></tr>";
371
+                print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
372 372
             }
373 373
         } else {
374 374
 
375
-            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">' . $langs->trans("NoOrder") . '</td></tr>';
375
+            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoOrder").'</td></tr>';
376 376
         }
377 377
         print "</table>";
378 378
         print "</div><br>";
@@ -393,19 +393,19 @@  discard block
 block discarded – undo
393 393
     $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas";
394 394
     $sql .= ", s.code_client";
395 395
     $sql .= ", s.code_fournisseur";
396
-    $sql .= " FROM " . MAIN_DB_PREFIX . "commande_fournisseur as cf";
397
-    $sql .= ", " . MAIN_DB_PREFIX . "societe as s";
396
+    $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf";
397
+    $sql .= ", ".MAIN_DB_PREFIX."societe as s";
398 398
     if (!$user->rights->societe->client->voir && !$socid) {
399
-        $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
399
+        $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
400 400
     }
401 401
     $sql .= " WHERE cf.fk_soc = s.rowid";
402 402
     $sql .= " AND cf.fk_statut = 0";
403
-    $sql .= " AND cf.entity IN (" . getEntity('supplier_order') . ")";
403
+    $sql .= " AND cf.entity IN (".getEntity('supplier_order').")";
404 404
     if (!$user->rights->societe->client->voir && !$socid) {
405
-        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
405
+        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
406 406
     }
407 407
     if ($socid) {
408
-        $sql .= " AND cf.fk_soc = " . $socid;
408
+        $sql .= " AND cf.fk_soc = ".$socid;
409 409
     }
410 410
 
411 411
     $resql = $db->query($sql);
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         print '<div class="div-table-responsive-no-min">';
417 417
         print '<table class="noborder" width="100%">';
418 418
         print '<tr class="liste_titre">';
419
-        print '<th colspan="3">' . $langs->trans("DraftSuppliersOrders") . ($num ? ' <span class="badge">' . $num . '</span>' : '') . '</th></tr>';
419
+        print '<th colspan="3">'.$langs->trans("DraftSuppliersOrders").($num ? ' <span class="badge">'.$num.'</span>' : '').'</th></tr>';
420 420
 
421 421
         if ($num > 0) {
422 422
             $i = 0;
@@ -442,20 +442,20 @@  discard block
 block discarded – undo
442 442
                 print $companystatic->getNomUrl(1, 'supplier', 16);
443 443
                 print '</td>';
444 444
                 if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
445
-                    print '<td align="right" class="nowrap">' . price($obj->total_ht) . '</td></tr>';
445
+                    print '<td align="right" class="nowrap">'.price($obj->total_ht).'</td></tr>';
446 446
                 } else {
447
-                    print '<td align="right" class="nowrap">' . price($obj->total_ttc) . '</td></tr>';
447
+                    print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
448 448
                 }
449 449
                 $i++;
450 450
                 $total += $obj->total_ttc;
451 451
             }
452 452
             if ($total > 0) {
453 453
 
454
-                print '<tr class="liste_total"><td>' . $langs->trans("Total") . '</td><td colspan="2" align="right">' . price($total) . "</td></tr>";
454
+                print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>";
455 455
             }
456 456
         } else {
457 457
 
458
-            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">' . $langs->trans("NoSupplierOrder") . '</td></tr>';
458
+            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("NoSupplierOrder").'</td></tr>';
459 459
         }
460 460
         print "</table>";
461 461
         print "</div><br>";
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
 
483 483
     $sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas";
484 484
     $sql .= ", s.code_client";
485
-    $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
485
+    $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
486 486
     if (!$user->rights->societe->client->voir && !$socid) {
487
-        $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
487
+        $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
488 488
     }
489 489
     $sql .= " WHERE s.client IN (1, 2, 3)";
490
-    $sql .= " AND s.entity IN (" . getEntity($companystatic->element) . ")";
490
+    $sql .= " AND s.entity IN (".getEntity($companystatic->element).")";
491 491
     if (!$user->rights->societe->client->voir && !$socid) {
492
-        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
492
+        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
493 493
     }
494 494
     if ($socid) {
495 495
         $sql .= " AND s.rowid = $socid";
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
             print $langs->trans("BoxTitleLastModifiedCustomers", $max);
515 515
         }
516 516
         print '</th>';
517
-        print '<th align="right"><a class="commonlink" href="' . DOL_URL_ROOT . '/societe/list.php?type=p,c">' . $langs->trans("FullList") . '</a></th>';
517
+        print '<th align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/societe/list.php?type=p,c">'.$langs->trans("FullList").'</a></th>';
518 518
         print '</tr>';
519 519
         if ($num) {
520 520
             while ($i < $num) {
@@ -526,18 +526,18 @@  discard block
 block discarded – undo
526 526
                 $companystatic->code_fournisseur = $objp->code_fournisseur;
527 527
                 $companystatic->canvas = $objp->canvas;
528 528
                 print '<tr class="oddeven">';
529
-                print '<td class="nowrap">' . $companystatic->getNomUrl(1, 'customer', 48) . '</td>';
529
+                print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 48).'</td>';
530 530
                 print '<td align="right" nowrap>';
531 531
                 print $companystatic->getLibCustProspStatut();
532 532
                 print "</td>";
533
-                print '<td align="right" nowrap>' . dol_print_date($db->jdate($objp->tms), 'day') . "</td>";
533
+                print '<td align="right" nowrap>'.dol_print_date($db->jdate($objp->tms), 'day')."</td>";
534 534
                 print '</tr>';
535 535
                 $i++;
536 536
             }
537 537
 
538 538
             $db->free($resql);
539 539
         } else {
540
-            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">' . $langs->trans("None") . '</td></tr>';
540
+            print '<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
541 541
         }
542 542
         print "</table>";
543 543
         print "</div><br>";
@@ -550,17 +550,17 @@  discard block
 block discarded – undo
550 550
 
551 551
     $sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm";
552 552
     $sql .= ", s.code_fournisseur";
553
-    $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
553
+    $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
554 554
     if (!$user->rights->societe->client->voir && !$user->societe_id) {
555
-        $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
555
+        $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
556 556
     }
557 557
     $sql .= " WHERE s.fournisseur = 1";
558
-    $sql .= " AND s.entity IN (" . getEntity($companystatic->element) . ")";
558
+    $sql .= " AND s.entity IN (".getEntity($companystatic->element).")";
559 559
     if (!$user->rights->societe->client->voir && !$user->societe_id) {
560
-        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
560
+        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
561 561
     }
562 562
     if ($socid) {
563
-        $sql .= " AND s.rowid = " . $socid;
563
+        $sql .= " AND s.rowid = ".$socid;
564 564
     }
565 565
     $sql .= " ORDER BY s.datec DESC";
566 566
     $sql .= $db->plimit($max, 0);
@@ -573,8 +573,8 @@  discard block
 block discarded – undo
573 573
         print '<div class="div-table-responsive-no-min">';
574 574
         print '<table class="noborder" width="100%">';
575 575
         print '<tr class="liste_titre">';
576
-        print '<th>' . $langs->trans("BoxTitleLastModifiedSuppliers", min($max, $num)) . '</th>';
577
-        print '<th align="right"><a class="commonlink" href="' . DOL_URL_ROOT . '/societe/list.php?type=f">' . $langs->trans("FullList") . '</a></th>';
576
+        print '<th>'.$langs->trans("BoxTitleLastModifiedSuppliers", min($max, $num)).'</th>';
577
+        print '<th align="right"><a class="commonlink" href="'.DOL_URL_ROOT.'/societe/list.php?type=f">'.$langs->trans("FullList").'</a></th>';
578 578
         print '</tr>';
579 579
         if ($num) {
580 580
             while ($i < $num && $i < $max) {
@@ -585,14 +585,14 @@  discard block
 block discarded – undo
585 585
                 $companystatic->code_fournisseur = $objp->code_fournisseur;
586 586
                 $companystatic->canvas = $objp->canvas;
587 587
                 print '<tr class="oddeven">';
588
-                print '<td class="nowrap">' . $companystatic->getNomUrl(1, 'supplier', 44) . '</td>';
589
-                print '<td align="right">' . dol_print_date($db->jdate($objp->dm), 'day') . '</td>';
588
+                print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'supplier', 44).'</td>';
589
+                print '<td align="right">'.dol_print_date($db->jdate($objp->dm), 'day').'</td>';
590 590
                 print '</tr>';
591 591
 
592 592
                 $i++;
593 593
             }
594 594
         } else {
595
-            print '<tr class="oddeven"><td colspan="2" class="opacitymedium">' . $langs->trans("None") . '</td></tr>';
595
+            print '<tr class="oddeven"><td colspan="2" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
596 596
         }
597 597
         print '</table>';
598 598
         print '</div><br>';
@@ -625,20 +625,20 @@  discard block
 block discarded – undo
625 625
     $sql = "SELECT s.nom as name, s.rowid, s.canvas, ";
626 626
     $sql .= ", s.code_client";
627 627
     $sql .= " c.statut, c.rowid as contratid, p.ref, c.mise_en_service as datemes, c.fin_validite as datefin, c.date_cloture as dateclo";
628
-    $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
629
-    $sql .= ", " . MAIN_DB_PREFIX . "contrat as c";
630
-    $sql .= ", " . MAIN_DB_PREFIX . "product as p";
628
+    $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
629
+    $sql .= ", ".MAIN_DB_PREFIX."contrat as c";
630
+    $sql .= ", ".MAIN_DB_PREFIX."product as p";
631 631
     if (!$user->rights->societe->client->voir && !$socid) {
632
-        $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
632
+        $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
633 633
     }
634 634
     $sql .= " WHERE c.fk_soc = s.rowid";
635
-    $sql .= " AND c.entity IN (" . getEntity('contract') . ")";
635
+    $sql .= " AND c.entity IN (".getEntity('contract').")";
636 636
     $sql .= " AND c.fk_product = p.rowid";
637 637
     if (!$user->rights->societe->client->voir && !$socid) {
638
-        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
638
+        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
639 639
     }
640 640
     if ($socid) {
641
-        $sql .= " AND s.rowid = " . $socid;
641
+        $sql .= " AND s.rowid = ".$socid;
642 642
     }
643 643
     $sql .= " ORDER BY c.tms DESC";
644 644
     $sql .= $db->plimit(5, 0);
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
         if ($num > 0) {
651 651
             print '<div class="div-table-responsive-no-min">';
652 652
             print '<table class="noborder" width="100%">';
653
-            print '<tr class="liste_titre"><th colspan="3">' . $langs->trans("LastContracts", 5) . '</th></tr>';
653
+            print '<tr class="liste_titre"><th colspan="3">'.$langs->trans("LastContracts", 5).'</th></tr>';
654 654
             $i = 0;
655 655
 
656 656
             $staticcontrat = new Contrat($db);
@@ -665,8 +665,8 @@  discard block
 block discarded – undo
665 665
                 $companystatic->code_fournisseur = $objp->code_fournisseur;
666 666
                 $companystatic->canvas = $objp->canvas;
667 667
                 print $companystatic->getNomUrl(1, 'customer', 44);
668
-                print '</td>' . "\n";
669
-                print "<td align=\"right\">" . $staticcontrat->LibStatut($obj->statut, 3) . "</td></tr>\n";
668
+                print '</td>'."\n";
669
+                print "<td align=\"right\">".$staticcontrat->LibStatut($obj->statut, 3)."</td></tr>\n";
670 670
 
671 671
                 $i++;
672 672
             }
@@ -686,19 +686,19 @@  discard block
 block discarded – undo
686 686
 
687 687
     $sql = "SELECT s.nom as name, s.rowid, s.code_client";
688 688
     $sql .= ", p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
689
-    $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
690
-    $sql .= ", " . MAIN_DB_PREFIX . "propal as p";
689
+    $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
690
+    $sql .= ", ".MAIN_DB_PREFIX."propal as p";
691 691
     if (!$user->rights->societe->client->voir && !$socid) {
692
-        $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
692
+        $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
693 693
     }
694 694
     $sql .= " WHERE p.fk_soc = s.rowid";
695
-    $sql .= " AND p.entity IN (" . getEntity('propal') . ")";
695
+    $sql .= " AND p.entity IN (".getEntity('propal').")";
696 696
     $sql .= " AND p.fk_statut = 1";
697 697
     if (!$user->rights->societe->client->voir && !$socid) {
698
-        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
698
+        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
699 699
     }
700 700
     if ($socid) {
701
-        $sql .= " AND s.rowid = " . $socid;
701
+        $sql .= " AND s.rowid = ".$socid;
702 702
     }
703 703
     $sql .= " ORDER BY p.rowid DESC";
704 704
 
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
         if ($num > 0) {
711 711
             print '<div class="div-table-responsive-no-min">';
712 712
             print '<table class="noborder" width="100%">';
713
-            print '<tr class="liste_titre"><th colspan="5">' . $langs->trans("ProposalsOpened") . ' <a href="' . DOL_URL_ROOT . '/comm/propal/list.php?viewstatut=1"><span class="badge">' . $num . '</span></th></tr>';
713
+            print '<tr class="liste_titre"><th colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>';
714 714
 
715 715
             $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
716 716
             while ($i < $nbofloop) {
@@ -739,8 +739,8 @@  discard block
 block discarded – undo
739 739
                 print '</td>';
740 740
                 print '<td width="16" align="center" class="nobordernopadding">';
741 741
                 $filename = dol_sanitizeFileName($obj->ref);
742
-                $filedir = $conf->propal->multidir_output[$obj->entity] . '/' . dol_sanitizeFileName($obj->ref);
743
-                $urlsource = $_SERVER['PHP_SELF'] . '?id=' . $obj->propalid;
742
+                $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
743
+                $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
744 744
                 print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
745 745
                 print '</td></tr></table>';
746 746
 
@@ -756,21 +756,21 @@  discard block
 block discarded – undo
756 756
                 print $companystatic->getNomUrl(1, 'customer', 44);
757 757
                 print '</td>';
758 758
                 print '<td align="right">';
759
-                print dol_print_date($db->jdate($obj->dp), 'day') . '</td>' . "\n";
759
+                print dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
760 760
                 if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
761
-                    print '<td align="right">' . price($obj->total_ht) . '</td>';
761
+                    print '<td align="right">'.price($obj->total_ht).'</td>';
762 762
                 } else {
763
-                    print '<td align="right">' . price($obj->total_ttc) . '</td>';
763
+                    print '<td align="right">'.price($obj->total_ttc).'</td>';
764 764
                 }
765
-                print '<td align="center" width="14">' . $propalstatic->LibStatut($obj->fk_statut, 3) . '</td>' . "\n";
766
-                print '</tr>' . "\n";
765
+                print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>'."\n";
766
+                print '</tr>'."\n";
767 767
                 $i++;
768 768
                 $total += $obj->total_ttc;
769 769
             }
770 770
             if ($num > $nbofloop) {
771
-                print '<tr class="liste_total"><td colspan="5">' . $langs->trans("XMoreLines", ($num - $nbofloop)) . "</td></tr>";
771
+                print '<tr class="liste_total"><td colspan="5">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
772 772
             } else if ($total > 0) {
773
-                print '<tr class="liste_total"><td colspan="3">' . $langs->trans("Total") . "</td><td align=\"right\">" . price($total) . "</td><td>&nbsp;</td></tr>";
773
+                print '<tr class="liste_total"><td colspan="3">'.$langs->trans("Total")."</td><td align=\"right\">".price($total)."</td><td>&nbsp;</td></tr>";
774 774
             }
775 775
             print "</table>";
776 776
             print "</div><br>";
@@ -788,19 +788,19 @@  discard block
 block discarded – undo
788 788
 
789 789
     $sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
790 790
     $sql .= ", s.code_client";
791
-    $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
792
-    $sql .= ", " . MAIN_DB_PREFIX . "commande as c";
791
+    $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
792
+    $sql .= ", ".MAIN_DB_PREFIX."commande as c";
793 793
     if (!$user->rights->societe->client->voir && !$socid) {
794
-        $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
794
+        $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
795 795
     }
796 796
     $sql .= " WHERE c.fk_soc = s.rowid";
797
-    $sql .= " AND c.entity IN (" . getEntity('commande') . ")";
798
-    $sql .= " AND (c.fk_statut = " . Commande::STATUS_VALIDATED . " or c.fk_statut = " . Commande::STATUS_SHIPMENTONPROCESS . ")";
797
+    $sql .= " AND c.entity IN (".getEntity('commande').")";
798
+    $sql .= " AND (c.fk_statut = ".Commande::STATUS_VALIDATED." or c.fk_statut = ".Commande::STATUS_SHIPMENTONPROCESS.")";
799 799
     if (!$user->rights->societe->client->voir && !$socid) {
800
-        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
800
+        $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
801 801
     }
802 802
     if ($socid) {
803
-        $sql .= " AND s.rowid = " . $socid;
803
+        $sql .= " AND s.rowid = ".$socid;
804 804
     }
805 805
     $sql .= " ORDER BY c.rowid DESC";
806 806
 
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
         if ($num > 0) {
813 813
             print '<div class="div-table-responsive-no-min">';
814 814
             print '<table class="noborder" width="100%">';
815
-            print '<tr class="liste_titre"><th class="liste_titre" colspan="5">' . $langs->trans("OrdersOpened") . ' <a href="' . DOL_URL_ROOT . '/commande/list.php?viewstatut=1"><span class="badge">' . $num . '</span></th></tr>';
815
+            print '<tr class="liste_titre"><th class="liste_titre" colspan="5">'.$langs->trans("OrdersOpened").' <a href="'.DOL_URL_ROOT.'/commande/list.php?viewstatut=1"><span class="badge">'.$num.'</span></th></tr>';
816 816
 
817 817
             $nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
818 818
             while ($i < $nbofloop) {
@@ -839,8 +839,8 @@  discard block
 block discarded – undo
839 839
                 print '</td>';
840 840
                 print '<td width="16" align="center" class="nobordernopadding">';
841 841
                 $filename = dol_sanitizeFileName($obj->ref);
842
-                $filedir = $conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
843
-                $urlsource = $_SERVER['PHP_SELF'] . '?id=' . $obj->propalid;
842
+                $filedir = $conf->commande->dir_output.'/'.dol_sanitizeFileName($obj->ref);
843
+                $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->propalid;
844 844
                 print $formfile->getDocumentsLink($orderstatic->element, $filename, $filedir);
845 845
                 print '</td></tr></table>';
846 846
 
@@ -856,21 +856,21 @@  discard block
 block discarded – undo
856 856
                 print $companystatic->getNomUrl(1, 'customer', 44);
857 857
                 print '</td>';
858 858
                 print '<td align="right">';
859
-                print dol_print_date($db->jdate($obj->dp), 'day') . '</td>' . "\n";
859
+                print dol_print_date($db->jdate($obj->dp), 'day').'</td>'."\n";
860 860
                 if (!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT)) {
861
-                    print '<td align="right">' . price($obj->total_ht) . '</td>';
861
+                    print '<td align="right">'.price($obj->total_ht).'</td>';
862 862
                 } else {
863
-                    print '<td align="right">' . price($obj->total_ttc) . '</td>';
863
+                    print '<td align="right">'.price($obj->total_ttc).'</td>';
864 864
                 }
865
-                print '<td align="center" width="14">' . $orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3) . '</td>' . "\n";
866
-                print '</tr>' . "\n";
865
+                print '<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).'</td>'."\n";
866
+                print '</tr>'."\n";
867 867
                 $i++;
868 868
                 $total += $obj->total_ttc;
869 869
             }
870 870
             if ($num > $nbofloop) {
871
-                print '<tr class="liste_total"><td colspan="5">' . $langs->trans("XMoreLines", ($num - $nbofloop)) . "</td></tr>";
871
+                print '<tr class="liste_total"><td colspan="5">'.$langs->trans("XMoreLines", ($num - $nbofloop))."</td></tr>";
872 872
             } else if ($total > 0) {
873
-                print '<tr class="liste_total"><td colspan="3">' . $langs->trans("Total") . "</td><td align=\"right\">" . price($total) . "</td><td>&nbsp;</td></tr>";
873
+                print '<tr class="liste_total"><td colspan="3">'.$langs->trans("Total")."</td><td align=\"right\">".price($total)."</td><td>&nbsp;</td></tr>";
874 874
             }
875 875
             print "</table>";
876 876
             print "</div><br>";
Please login to merge, or discard this patch.
dolibarr/htdocs/comm/action/list.php 1 patch
Spacing   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -33,19 +33,19 @@  discard block
 block discarded – undo
33 33
     define('NOREDIRECTBYMAINTOLOGIN', 1);
34 34
 }
35 35
 
36
-require DOL_BASE_PATH . '/main.inc.php';
37
-require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/lib/agenda.lib.php';
41
-include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
42
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
36
+require DOL_BASE_PATH.'/main.inc.php';
37
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
41
+include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
42
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
43 43
 
44 44
 // Load translation files required by the page
45 45
 $langs->loadLangs(array("users", "companies", "agenda", "commercial"));
46 46
 
47 47
 $action = Request::getAlpha('action');
48
-$contextpage = Request::getAz('contextpage', 'aZ') ?? 'actioncommlist';   // To manage different context of search
48
+$contextpage = Request::getAz('contextpage', 'aZ') ?? 'actioncommlist'; // To manage different context of search
49 49
 $resourceid = Request::getNumber("search_resourceid") ?? Request::getNumber("resourceid");
50 50
 $pid = Request::getNumber("search_projectid", [INPUT_POST, INPUT_GET]) ?? Request::getNumber("projectid", [INPUT_POST, INPUT_GET]);
51 51
 $status = Request::getAlpha("search_status") ?? Request::getAlpha("status");
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) {
155 155
     foreach ($extrafields->attribute_label as $key => $val) {
156 156
         if (!empty($extrafields->attribute_list[$key]))
157
-            $arrayfields["ef." . $key] = array('label' => $extrafields->attribute_label[$key], 'checked' => $extrafields->attribute_list[$key], 'position' => $extrafields->attribute_pos[$key], 'enabled' => $extrafields->attribute_perms[$key]);
157
+            $arrayfields["ef.".$key] = array('label' => $extrafields->attribute_label[$key], 'checked' => $extrafields->attribute_list[$key], 'position' => $extrafields->attribute_pos[$key], 'enabled' => $extrafields->attribute_perms[$key]);
158 158
     }
159 159
 }
160 160
 
@@ -167,21 +167,21 @@  discard block
 block discarded – undo
167 167
     $param = '';
168 168
     if (is_array($_POST)) {
169 169
         foreach ($_POST as $key => $val) {
170
-            $param .= '&' . $key . '=' . urlencode($val);
170
+            $param .= '&'.$key.'='.urlencode($val);
171 171
         }
172 172
     }
173 173
     //print $param;
174
-    header("Location: " . DOL_URL_ROOT . '/comm/action/index.php?' . $param);
174
+    header("Location: ".DOL_URL_ROOT.'/comm/action/index.php?'.$param);
175 175
     exit;
176 176
 }
177 177
 
178 178
 $parameters = array('id' => $socid);
179
-$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);    // Note that $action and $object may have been modified by some hooks
179
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
180 180
 if ($reshook < 0)
181 181
     setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
182 182
 
183 183
 // Selection of new fields
184
-include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
184
+include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
185 185
 // Purge search criteria
186 186
 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
187 187
     //$actioncode='';
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
 $nav = '';
206 206
 $nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
207
-$nav .= ' <input type="submit" name="submitdateselect" class="button" value="' . $langs->trans("Refresh") . '">';
207
+$nav .= ' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
208 208
 
209 209
 $now = dol_now();
210 210
 
@@ -216,54 +216,54 @@  discard block
 block discarded – undo
216 216
 
217 217
 $param = '';
218 218
 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"])
219
-    $param .= '&contextpage=' . urlencode($contextpage);
219
+    $param .= '&contextpage='.urlencode($contextpage);
220 220
 if ($limit > 0 && $limit != $conf->liste_limit)
221
-    $param .= '&limit=' . urlencode($limit);
221
+    $param .= '&limit='.urlencode($limit);
222 222
 if ($actioncode != '') {
223 223
     if (is_array($actioncode)) {
224 224
         foreach ($actioncode as $str_action)
225
-            $param .= "&search_actioncode[]=" . urlencode($str_action);
225
+            $param .= "&search_actioncode[]=".urlencode($str_action);
226 226
     } else
227
-        $param .= "&search_actioncode=" . urlencode($actioncode);
227
+        $param .= "&search_actioncode=".urlencode($actioncode);
228 228
 }
229 229
 if ($resourceid > 0)
230
-    $param .= "&search_resourceid=" . urlencode($resourceid);
230
+    $param .= "&search_resourceid=".urlencode($resourceid);
231 231
 if ($status != '' && $status > -1)
232
-    $param .= "&search_status=" . urlencode($status);
232
+    $param .= "&search_status=".urlencode($status);
233 233
 if ($filter)
234
-    $param .= "&search_filter=" . urlencode($filter);
234
+    $param .= "&search_filter=".urlencode($filter);
235 235
 if ($filtert)
236
-    $param .= "&search_filtert=" . urlencode($filtert);
236
+    $param .= "&search_filtert=".urlencode($filtert);
237 237
 if ($socid)
238
-    $param .= "&search_socid=" . urlencode($socid);
238
+    $param .= "&search_socid=".urlencode($socid);
239 239
 if ($showbirthday)
240 240
     $param .= "&search_showbirthday=1";
241 241
 if ($pid)
242
-    $param .= "&search_projectid=" . urlencode($pid);
242
+    $param .= "&search_projectid=".urlencode($pid);
243 243
 if ($type)
244
-    $param .= "&search_type=" . urlencode($type);
244
+    $param .= "&search_type=".urlencode($type);
245 245
 if ($usergroup)
246
-    $param .= "&search_usergroup=" . urlencode($usergroup);
246
+    $param .= "&search_usergroup=".urlencode($usergroup);
247 247
 if ($search_id != '')
248
-    $param .= '&search_title=' . urlencode($search_id);
248
+    $param .= '&search_title='.urlencode($search_id);
249 249
 if ($search_title != '')
250
-    $param .= '&search_title=' . urlencode($search_title);
250
+    $param .= '&search_title='.urlencode($search_title);
251 251
 if (GETPOST('datestartday', 'int'))
252
-    $param .= '&datestartday=' . GETPOST('datestartday', 'int');
252
+    $param .= '&datestartday='.GETPOST('datestartday', 'int');
253 253
 if (GETPOST('datestartmonth', 'int'))
254
-    $param .= '&datestartmonth=' . GETPOST('datestartmonth', 'int');
254
+    $param .= '&datestartmonth='.GETPOST('datestartmonth', 'int');
255 255
 if (GETPOST('datestartyear', 'int'))
256
-    $param .= '&datestartyear=' . GETPOST('datestartyear', 'int');
256
+    $param .= '&datestartyear='.GETPOST('datestartyear', 'int');
257 257
 if (GETPOST('dateendday', 'int'))
258
-    $param .= '&dateendday=' . GETPOST('dateendday', 'int');
258
+    $param .= '&dateendday='.GETPOST('dateendday', 'int');
259 259
 if (GETPOST('dateendmonth', 'int'))
260
-    $param .= '&dateendmonth=' . GETPOST('dateendmonth', 'int');
260
+    $param .= '&dateendmonth='.GETPOST('dateendmonth', 'int');
261 261
 if (GETPOST('dateendyear', 'int'))
262
-    $param .= '&dateendyear=' . GETPOST('dateendyear', 'int');
262
+    $param .= '&dateendyear='.GETPOST('dateendyear', 'int');
263 263
 if ($optioncss != '')
264
-    $param .= '&optioncss=' . urlencode($optioncss);
264
+    $param .= '&optioncss='.urlencode($optioncss);
265 265
 // Add $param from extra fields
266
-include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php';
266
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
267 267
 
268 268
 $sql = "SELECT";
269 269
 if ($usergroup > 0)
@@ -277,24 +277,24 @@  discard block
 block discarded – undo
277 277
 $sql .= " sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id";
278 278
 // Add fields from extrafields
279 279
 foreach ($extrafields->attribute_label as $key => $val)
280
-    $sql .= ($extrafields->attribute_type[$key] != 'separate' ? ",ef." . $key . ' as options_' . $key : '');
281
-$sql .= " FROM " . MAIN_DB_PREFIX . "actioncomm as a";
282
-$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "actioncomm_extrafields as ef ON (a.id = ef.fk_object) ";
280
+    $sql .= ($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
281
+$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
282
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object) ";
283 283
 if (!$user->rights->societe->client->voir && !$socid)
284
-    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
285
-$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON a.fk_soc = s.rowid";
286
-$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople as sp ON a.fk_contact = sp.rowid";
287
-$sql .= " ," . MAIN_DB_PREFIX . "c_actioncomm as c";
284
+    $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
285
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
286
+$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
287
+$sql .= " ,".MAIN_DB_PREFIX."c_actioncomm as c";
288 288
 // We must filter on resource table
289 289
 if ($resourceid > 0)
290
-    $sql .= ", " . MAIN_DB_PREFIX . "element_resources as r";
290
+    $sql .= ", ".MAIN_DB_PREFIX."element_resources as r";
291 291
 // We must filter on assignement table
292 292
 if ($filtert > 0 || $usergroup > 0)
293
-    $sql .= ", " . MAIN_DB_PREFIX . "actioncomm_resources as ar";
293
+    $sql .= ", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
294 294
 if ($usergroup > 0)
295
-    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
295
+    $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
296 296
 $sql .= " WHERE c.id = a.fk_action";
297
-$sql .= ' AND a.entity IN (' . getEntity('agenda') . ')';
297
+$sql .= ' AND a.entity IN ('.getEntity('agenda').')';
298 298
 // Condition on actioncode
299 299
 if (!empty($actioncode)) {
300 300
     if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
@@ -316,26 +316,26 @@  discard block
 block discarded – undo
316 316
             $sql .= " AND c.type = 'systemauto'";
317 317
         else {
318 318
             if (is_array($actioncode)) {
319
-                $sql .= " AND c.code IN ('" . implode("','", $actioncode) . "')";
319
+                $sql .= " AND c.code IN ('".implode("','", $actioncode)."')";
320 320
             } else {
321
-                $sql .= " AND c.code IN ('" . implode("','", explode(',', $actioncode)) . "')";
321
+                $sql .= " AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
322 322
             }
323 323
         }
324 324
     }
325 325
 }
326 326
 if ($resourceid > 0)
327
-    $sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = " . $db->escape($resourceid);
327
+    $sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
328 328
 if ($pid)
329
-    $sql .= " AND a.fk_project=" . $db->escape($pid);
329
+    $sql .= " AND a.fk_project=".$db->escape($pid);
330 330
 if (!$user->rights->societe->client->voir && !$socid)
331
-    $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = " . $user->id . ")";
331
+    $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
332 332
 if ($socid > 0)
333
-    $sql .= " AND s.rowid = " . $socid;
333
+    $sql .= " AND s.rowid = ".$socid;
334 334
 // We must filter on assignement table
335 335
 if ($filtert > 0 || $usergroup > 0)
336 336
     $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
337 337
 if ($type)
338
-    $sql .= " AND c.id = " . $type;
338
+    $sql .= " AND c.id = ".$type;
339 339
 if ($status == '0') {
340 340
     $sql .= " AND a.percent = 0";
341 341
 }
@@ -362,21 +362,21 @@  discard block
 block discarded – undo
362 362
 if ($filtert > 0 || $usergroup > 0) {
363 363
     $sql .= " AND (";
364 364
     if ($filtert > 0)
365
-        $sql .= "(ar.fk_element = " . $filtert . " OR (ar.fk_element IS NULL AND a.fk_user_action=" . $filtert . "))"; // The OR is for backward compatibility
365
+        $sql .= "(ar.fk_element = ".$filtert." OR (ar.fk_element IS NULL AND a.fk_user_action=".$filtert."))"; // The OR is for backward compatibility
366 366
     if ($usergroup > 0)
367
-        $sql .= ($filtert > 0 ? " OR " : "") . " ugu.fk_usergroup = " . $usergroup;
367
+        $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".$usergroup;
368 368
     $sql .= ")";
369 369
 }
370 370
 
371 371
 // The second or of next test is to take event with no end date (we suppose duration is 1 hour in such case)
372 372
 if ($dateselect > 0)
373
-    $sql .= " AND ((a.datep2 >= '" . $db->idate($dateselect) . "' AND a.datep <= '" . $db->idate($dateselect + 3600 * 24 - 1) . "') OR (a.datep2 IS NULL AND a.datep > '" . $db->idate($dateselect - 3600) . "' AND a.datep <= '" . $db->idate($dateselect + 3600 * 24 - 1) . "'))";
373
+    $sql .= " AND ((a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect + 3600 * 24 - 1)."') OR (a.datep2 IS NULL AND a.datep > '".$db->idate($dateselect - 3600)."' AND a.datep <= '".$db->idate($dateselect + 3600 * 24 - 1)."'))";
374 374
 if ($datestart > 0)
375
-    $sql .= " AND a.datep BETWEEN '" . $db->idate($datestart) . "' AND '" . $db->idate($datestart + 3600 * 24 - 1) . "'";
375
+    $sql .= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart + 3600 * 24 - 1)."'";
376 376
 if ($dateend > 0)
377
-    $sql .= " AND a.datep2 BETWEEN '" . $db->idate($dateend) . "' AND '" . $db->idate($dateend + 3600 * 24 - 1) . "'";
377
+    $sql .= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend + 3600 * 24 - 1)."'";
378 378
 // Add where from extra fields
379
-include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php';
379
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
380 380
 
381 381
 $sql .= $db->order($sortfield, $sortorder);
382 382
 
@@ -402,30 +402,30 @@  discard block
 block discarded – undo
402 402
     $num = $db->num_rows($resql);
403 403
 
404 404
     // Local calendar
405
-    $newtitle = '<div class="nowrap clear inline-block minheight20"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> ' . $langs->trans("LocalAgenda") . ' &nbsp; </div>';
405
+    $newtitle = '<div class="nowrap clear inline-block minheight20"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
406 406
     //$newtitle=$langs->trans($title);
407 407
 
408 408
     $tabactive = 'cardlist';
409 409
 
410 410
     $head = calendars_prepare_head($param);
411 411
 
412
-    print '<form method="POST" id="searchFormList" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
412
+    print '<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'">'."\n";
413 413
 
414 414
     if ($optioncss != '')
415
-        print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
416
-    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
415
+        print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
416
+    print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
417 417
     print '<input type="hidden" name="action" value="list">';
418 418
     print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
419
-    print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
420
-    print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
421
-    print '<input type="hidden" name="page" value="' . $page . '">';
422
-    print '<input type="hidden" name="type" value="' . $type . '">';
419
+    print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
420
+    print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
421
+    print '<input type="hidden" name="page" value="'.$page.'">';
422
+    print '<input type="hidden" name="type" value="'.$type.'">';
423 423
     $nav = '';
424 424
 
425 425
     //if ($actioncode)    $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
426 426
     //if ($resourceid)      $nav.='<input type="hidden" name="resourceid" value="'.$resourceid.'">';
427 427
     if ($filter)
428
-        $nav .= '<input type="hidden" name="search_filter" value="' . $filter . '">';
428
+        $nav .= '<input type="hidden" name="search_filter" value="'.$filter.'">';
429 429
     //if ($filtert)         $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
430 430
     //if ($socid)           $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
431 431
     if ($showbirthday)
@@ -471,16 +471,16 @@  discard block
 block discarded – undo
471 471
     if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
472 472
         $tmpforcreatebutton = dol_getdate(dol_now(), true);
473 473
 
474
-        $newparam .= '&month=' . str_pad($month, 2, "0", STR_PAD_LEFT) . '&year=' . $tmpforcreatebutton['year'];
474
+        $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
475 475
 
476 476
         //$param='month='.$monthshown.'&year='.$year;
477 477
         $hourminsec = '100000';
478
-        $newcardbutton = '<a class="butActionNew" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&datep=' . sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']) . $hourminsec . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . ($newparam ? '?' . $newparam : '')) . '"><span class="valignmiddle">' . $langs->trans("AddAction") . '</span>';
478
+        $newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')).'"><span class="valignmiddle">'.$langs->trans("AddAction").'</span>';
479 479
         $newcardbutton .= '<span class="fa fa-plus-circle valignmiddle"></span>';
480 480
         $newcardbutton .= '</a>';
481 481
     }
482 482
 
483
-    print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav . $newcardbutton, '', $limit);
483
+    print_barre_liste($s, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, $nav.$newcardbutton, '', $limit);
484 484
 
485 485
     $moreforfilter = '';
486 486
 
@@ -490,17 +490,17 @@  discard block
 block discarded – undo
490 490
         $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
491 491
     $i = 0;
492 492
     print '<div class="div-table-responsive">';
493
-    print '<table class="tagtable liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
493
+    print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
494 494
 
495 495
     print '<tr class="liste_titre_filter">';
496 496
     if (!empty($arrayfields['a.id']['checked']))
497
-        print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="' . $search_id . '"></td>';
497
+        print '<td class="liste_titre"><input type="text" class="maxwidth50" name="search_id" value="'.$search_id.'"></td>';
498 498
     if (!empty($arrayfields['owner']['checked']))
499 499
         print '<td class="liste_titre"></td>';
500 500
     if (!empty($arrayfields['c.libelle']['checked']))
501 501
         print '<td class="liste_titre"></td>';
502 502
     if (!empty($arrayfields['a.label']['checked']))
503
-        print '<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="' . $search_title . '"></td>';
503
+        print '<td class="liste_titre"><input type="text" class="maxwidth75" name="search_title" value="'.$search_title.'"></td>';
504 504
     if (!empty($arrayfields['a.datep']['checked'])) {
505 505
         print '<td class="liste_titre nowraponall" align="center">';
506 506
         print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0);
@@ -520,11 +520,11 @@  discard block
 block discarded – undo
520 520
         print '<td class="liste_titre"></td>';
521 521
 
522 522
     // Extra fields
523
-    include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php';
523
+    include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
524 524
 
525 525
     // Fields from hook
526 526
     $parameters = array('arrayfields' => $arrayfields);
527
-    $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters);    // Note that $action and $object may have been modified by hook
527
+    $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
528 528
     print $hookmanager->resPrint;
529 529
 
530 530
     if (!empty($arrayfields['a.datec']['checked']))
@@ -566,11 +566,11 @@  discard block
 block discarded – undo
566 566
         print_liste_field_titre($arrayfields['a.fk_element']['label'], $_SERVER["PHP_SELF"], "a.fk_element", $param, "", "", $sortfield, $sortorder);
567 567
 
568 568
     // Extra fields
569
-    include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php';
569
+    include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
570 570
 
571 571
     // Hook fields
572 572
     $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
573
-    $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters);    // Note that $action and $object may have been modified by hook
573
+    $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
574 574
     print $hookmanager->resPrint;
575 575
 
576 576
     if (!empty($arrayfields['a.datec']['checked']))
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
     $now = dol_now();
588 588
     $delay_warning = $conf->global->MAIN_DELAY_ACTIONS_TODO * 24 * 60 * 60;
589 589
 
590
-    require_once DOL_DOCUMENT_ROOT . '/comm/action/class/cactioncomm.class.php';
590
+    require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
591 591
     $caction = new CActionComm($db);
592 592
     $arraylist = $caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0), '', 1);
593 593
 
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 
619 619
         // User owner
620 620
         if (!empty($arrayfields['owner']['checked'])) {
621
-            print '<td class="' . ($conf->browser->name != 'chrome' ? '' : 'tdoverflowmax100') . '">'; // With edge and chrom the td overflow is not supported correctly when content is not full text.
621
+            print '<td class="'.($conf->browser->name != 'chrome' ? '' : 'tdoverflowmax100').'">'; // With edge and chrom the td overflow is not supported correctly when content is not full text.
622 622
             if ($obj->fk_user_action > 0) {
623 623
                 $userstatic->fetch($obj->fk_user_action);
624 624
                 print $userstatic->getNomUrl(-1);
@@ -635,17 +635,17 @@  discard block
 block discarded – undo
635 635
                     print img_picto('', $actionstatic->type_picto);
636 636
                 else {
637 637
                     if ($actionstatic->type_code == 'AC_RDV')
638
-                        print img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright') . ' ';
638
+                        print img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' ';
639 639
                     elseif ($actionstatic->type_code == 'AC_TEL')
640
-                        print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright') . ' ';
640
+                        print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' ';
641 641
                     elseif ($actionstatic->type_code == 'AC_FAX')
642
-                        print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright') . ' ';
642
+                        print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' ';
643 643
                     elseif ($actionstatic->type_code == 'AC_EMAIL')
644
-                        print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright') . ' ';
644
+                        print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' ';
645 645
                     elseif ($actionstatic->type_code == 'AC_INT')
646
-                        print img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright') . ' ';
646
+                        print img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' ';
647 647
                     elseif (!preg_match('/_AUTO/', $actionstatic->type_code))
648
-                        print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright') . ' ';
648
+                        print img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' ';
649 649
                 }
650 650
             }
651 651
             $labeltype = $obj->type_code;
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
             if ($obj->percent > 0 && $obj->percent < 100 && !$obj->dp2 && $obj->dp && $db->jdate($obj->dp) < ($now - $delay_warning))
679 679
                 $late = 1;
680 680
             if ($late)
681
-                print img_warning($langs->trans("Late")) . ' ';
681
+                print img_warning($langs->trans("Late")).' ';
682 682
             print '</td>';
683 683
         }
684 684
 
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
             print '<td>';
729 729
             //var_dump($obj->fkelement.' '.$obj->elementtype);
730 730
             if ($obj->fk_element > 0 && !empty($obj->elementtype)) {
731
-                include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
731
+                include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
732 732
                 print dolGetElementUrl($obj->fk_element, $obj->elementtype, 1);
733 733
             } else {
734 734
                 print "&nbsp;";
@@ -737,25 +737,25 @@  discard block
 block discarded – undo
737 737
         }
738 738
 
739 739
         // Extra fields
740
-        include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php';
740
+        include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
741 741
         // Fields from hook
742 742
         $parameters = array('arrayfields' => $arrayfields, 'obj' => $obj);
743
-        $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters);    // Note that $action and $object may have been modified by hook
743
+        $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
744 744
         print $hookmanager->resPrint;
745 745
 
746 746
         // Date creation
747 747
         if (!empty($arrayfields['a.datec']['checked'])) {
748 748
             // Status/Percent
749
-            print '<td align="center" class="nowrap">' . dol_print_date($obj->datec, 'dayhour') . '</td>';
749
+            print '<td align="center" class="nowrap">'.dol_print_date($obj->datec, 'dayhour').'</td>';
750 750
         }
751 751
         // Date update
752 752
         if (!empty($arrayfields['a.tms']['checked'])) {
753
-            print '<td align="center" class="nowrap">' . dol_print_date($obj->datem, 'dayhour') . '</td>';
753
+            print '<td align="center" class="nowrap">'.dol_print_date($obj->datem, 'dayhour').'</td>';
754 754
         }
755 755
         if (!empty($arrayfields['a.percent']['checked'])) {
756 756
             // Status/Percent
757 757
             $datep = $db->jdate($obj->datep);
758
-            print '<td align="center" class="nowrap">' . $actionstatic->LibStatut($obj->percent, 3, 0, $datep) . '</td>';
758
+            print '<td align="center" class="nowrap">'.$actionstatic->LibStatut($obj->percent, 3, 0, $datep).'</td>';
759 759
         }
760 760
         print '<td></td>';
761 761
 
Please login to merge, or discard this patch.
dolibarr/htdocs/comm/action/index.php 1 patch
Spacing   +200 added lines, -200 removed lines patch added patch discarded remove patch
@@ -32,15 +32,15 @@  discard block
 block discarded – undo
32 32
  *  \ingroup    agenda
33 33
  *  \brief      Home page of calendar events
34 34
  */
35
-require DOL_BASE_PATH . '/main.inc.php';
35
+require DOL_BASE_PATH.'/main.inc.php';
36 36
 
37
-require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
38
-require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
41
-require_once DOL_DOCUMENT_ROOT . '/core/lib/agenda.lib.php';
37
+require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
38
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
41
+require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
42 42
 if (!empty($conf->projet->enabled)) {
43
-    require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
43
+    require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
44 44
 }
45 45
 
46 46
 if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW))
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 $week = GETPOST("week", "int") ? GETPOST("week", "int") : date("W");
98 98
 $day = GETPOST("day", "int") ? GETPOST("day", "int") : date("d");
99 99
 $pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3);
100
-$status = GETPOST("search_status", 'aZ09') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09');  // status may be 0, 50, 100, 'todo'
100
+$status = GETPOST("search_status", 'aZ09') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo'
101 101
 $type = GETPOST("search_type", 'az09') ? GETPOST("search_type", 'az09') : GETPOST("type", 'az09');
102 102
 $maxprint = (isset($_GET["maxprint"]) ? GETPOST("maxprint") : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
103 103
 // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
@@ -152,11 +152,11 @@  discard block
 block discarded – undo
152 152
         foreach ($_POST as $key => $val) {
153 153
             if ($key == 'token')
154 154
                 continue;
155
-            $param .= '&' . $key . '=' . urlencode($val);
155
+            $param .= '&'.$key.'='.urlencode($val);
156 156
         }
157 157
     }
158 158
     //print $param;
159
-    header("Location: " . DOL_URL_ROOT . '/comm/action/list.php?' . $param);
159
+    header("Location: ".DOL_URL_ROOT.'/comm/action/list.php?'.$param);
160 160
     exit;
161 161
 }
162 162
 
@@ -166,11 +166,11 @@  discard block
 block discarded – undo
166 166
         foreach ($_POST as $key => $val) {
167 167
             if ($key == 'token')
168 168
                 continue;
169
-            $param .= '&' . $key . '=' . urlencode($val);
169
+            $param .= '&'.$key.'='.urlencode($val);
170 170
         }
171 171
     }
172 172
     //print $param;
173
-    header("Location: " . DOL_URL_ROOT . '/comm/action/peruser.php?' . $param);
173
+    header("Location: ".DOL_URL_ROOT.'/comm/action/peruser.php?'.$param);
174 174
     exit;
175 175
 }
176 176
 
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
     $i = 0;
206 206
     while ($i < $MAXAGENDA) {
207 207
         $i++;
208
-        $source = 'AGENDA_EXT_SRC' . $i;
209
-        $name = 'AGENDA_EXT_NAME' . $i;
210
-        $offsettz = 'AGENDA_EXT_OFFSETTZ' . $i;
211
-        $color = 'AGENDA_EXT_COLOR' . $i;
212
-        $buggedfile = 'AGENDA_EXT_BUGGEDFILE' . $i;
208
+        $source = 'AGENDA_EXT_SRC'.$i;
209
+        $name = 'AGENDA_EXT_NAME'.$i;
210
+        $offsettz = 'AGENDA_EXT_OFFSETTZ'.$i;
211
+        $color = 'AGENDA_EXT_COLOR'.$i;
212
+        $buggedfile = 'AGENDA_EXT_BUGGEDFILE'.$i;
213 213
         if (!empty($conf->global->$source) && !empty($conf->global->$name)) {
214 214
             // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
215 215
             $listofextcals[] = array('src' => $conf->global->$source, 'name' => $conf->global->$name, 'offsettz' => $conf->global->$offsettz, 'color' => $conf->global->$color, 'buggedfile' => (isset($conf->global->buggedfile) ? $conf->global->buggedfile : 0));
@@ -221,12 +221,12 @@  discard block
 block discarded – undo
221 221
     $i = 0;
222 222
     while ($i < $MAXAGENDA) {
223 223
         $i++;
224
-        $source = 'AGENDA_EXT_SRC_' . $user->id . '_' . $i;
225
-        $name = 'AGENDA_EXT_NAME_' . $user->id . '_' . $i;
226
-        $offsettz = 'AGENDA_EXT_OFFSETTZ_' . $user->id . '_' . $i;
227
-        $color = 'AGENDA_EXT_COLOR_' . $user->id . '_' . $i;
228
-        $enabled = 'AGENDA_EXT_ENABLED_' . $user->id . '_' . $i;
229
-        $buggedfile = 'AGENDA_EXT_BUGGEDFILE_' . $user->id . '_' . $i;
224
+        $source = 'AGENDA_EXT_SRC_'.$user->id.'_'.$i;
225
+        $name = 'AGENDA_EXT_NAME_'.$user->id.'_'.$i;
226
+        $offsettz = 'AGENDA_EXT_OFFSETTZ_'.$user->id.'_'.$i;
227
+        $color = 'AGENDA_EXT_COLOR_'.$user->id.'_'.$i;
228
+        $enabled = 'AGENDA_EXT_ENABLED_'.$user->id.'_'.$i;
229
+        $buggedfile = 'AGENDA_EXT_BUGGEDFILE_'.$user->id.'_'.$i;
230 230
         if (!empty($user->conf->$source) && !empty($user->conf->$name)) {
231 231
             // Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
232 232
             $listofextcals[] = array('src' => $user->conf->$source, 'name' => $user->conf->$name, 'offsettz' => $user->conf->$offsettz, 'color' => $user->conf->$color, 'buggedfile' => (isset($user->conf->buggedfile) ? $user->conf->buggedfile : 0));
@@ -242,10 +242,10 @@  discard block
 block discarded – undo
242 242
     $next_year = $next['year'];
243 243
     $next_month = $next['month'];
244 244
 
245
-    $max_day_in_prev_month = date("t", dol_mktime(0, 0, 0, $prev_month, 1, $prev_year));  // Nb of days in previous month
246
-    $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year));                 // Nb of days in next month
245
+    $max_day_in_prev_month = date("t", dol_mktime(0, 0, 0, $prev_month, 1, $prev_year)); // Nb of days in previous month
246
+    $max_day_in_month = date("t", dol_mktime(0, 0, 0, $month, 1, $year)); // Nb of days in next month
247 247
     // tmpday is a negative or null cursor to know how many days before the 1st to show on month view (if tmpday=0, 1st is monday)
248
-    $tmpday = -date("w", dol_mktime(12, 0, 0, $month, 1, $year, true)) + 2;  // date('w') is 0 fo sunday
248
+    $tmpday = -date("w", dol_mktime(12, 0, 0, $month, 1, $year, true)) + 2; // date('w') is 0 fo sunday
249 249
     $tmpday += ((isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1) - 1);
250 250
     if ($tmpday >= 1)
251 251
         $tmpday -= 7; // If tmpday is 0 we start with sunday, if -6, we start with monday of previous week.
@@ -312,60 +312,60 @@  discard block
 block discarded – undo
312 312
 if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_actioncode'])) {
313 313
     if (is_array($actioncode)) {
314 314
         foreach ($actioncode as $str_action)
315
-            $param .= "&search_actioncode[]=" . urlencode($str_action);
315
+            $param .= "&search_actioncode[]=".urlencode($str_action);
316 316
     } else
317
-        $param .= "&search_actioncode=" . urlencode($actioncode);
317
+        $param .= "&search_actioncode=".urlencode($actioncode);
318 318
 }
319 319
 if ($resourceid > 0)
320
-    $param .= "&search_resourceid=" . urlencode($resourceid);
320
+    $param .= "&search_resourceid=".urlencode($resourceid);
321 321
 if ($status || isset($_GET['status']) || isset($_POST['status']))
322
-    $param .= "&search_status=" . urlencode($status);
322
+    $param .= "&search_status=".urlencode($status);
323 323
 if ($filter)
324
-    $param .= "&search_filter=" . urlencode($filter);
324
+    $param .= "&search_filter=".urlencode($filter);
325 325
 if ($filtert)
326
-    $param .= "&search_filtert=" . urlencode($filtert);
326
+    $param .= "&search_filtert=".urlencode($filtert);
327 327
 if ($usergroup)
328
-    $param .= "&search_usergroup=" . urlencode($usergroup);
328
+    $param .= "&search_usergroup=".urlencode($usergroup);
329 329
 if ($socid)
330
-    $param .= "&search_socid=" . urlencode($socid);
330
+    $param .= "&search_socid=".urlencode($socid);
331 331
 if ($showbirthday)
332 332
     $param .= "&search_showbirthday=1";
333 333
 if ($pid)
334
-    $param .= "&search_projectid=" . urlencode($pid);
334
+    $param .= "&search_projectid=".urlencode($pid);
335 335
 if ($type)
336
-    $param .= "&search_type=" . urlencode($type);
336
+    $param .= "&search_type=".urlencode($type);
337 337
 if ($action == 'show_day' || $action == 'show_week' || $action == 'show_month')
338
-    $param .= '&action=' . urlencode($action);
339
-$param .= "&maxprint=" . urlencode($maxprint);
338
+    $param .= '&action='.urlencode($action);
339
+$param .= "&maxprint=".urlencode($maxprint);
340 340
 
341 341
 // Show navigation bar
342 342
 if (empty($action) || $action == 'show_month') {
343
-    $nav = "<a href=\"?year=" . $prev_year . "&amp;month=" . $prev_month . $param . "\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
344
-    $nav .= " <span id=\"month_name\">" . dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%b %Y");
343
+    $nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month.$param."\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
344
+    $nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%b %Y");
345 345
     $nav .= " </span>\n";
346
-    $nav .= " &nbsp; <a href=\"?year=" . $next_year . "&amp;month=" . $next_month . $param . "\"><i class=\"fa fa-chevron-right\"></i></a>\n";
347
-    $nav .= " &nbsp; (<a href=\"?year=" . $nowyear . "&amp;month=" . $nowmonth . $param . "\">" . $langs->trans("Today") . "</a>)";
346
+    $nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
347
+    $nav .= " &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth.$param."\">".$langs->trans("Today")."</a>)";
348 348
     $picto = 'calendar';
349 349
 }
350 350
 if ($action == 'show_week') {
351
-    $nav = "<a href=\"?year=" . $prev_year . "&amp;month=" . $prev_month . "&amp;day=" . $prev_day . $param . "\"><i class=\"fa fa-chevron-left\" title=\"" . dol_escape_htmltag($langs->trans("Previous")) . "\"></i></a> &nbsp;\n";
352
-    $nav .= " <span id=\"month_name\">" . dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y") . ", " . $langs->trans("Week") . " " . $week;
351
+    $nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\" title=\"".dol_escape_htmltag($langs->trans("Previous"))."\"></i></a> &nbsp;\n";
352
+    $nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("Week")." ".$week;
353 353
     $nav .= " </span>\n";
354
-    $nav .= " &nbsp; <a href=\"?year=" . $next_year . "&amp;month=" . $next_month . "&amp;day=" . $next_day . $param . "\"><i class=\"fa fa-chevron-right\" title=\"" . dol_escape_htmltag($langs->trans("Next")) . "\"></i></a>\n";
355
-    $nav .= " &nbsp; (<a href=\"?year=" . $nowyear . "&amp;month=" . $nowmonth . "&amp;day=" . $nowday . $param . "\">" . $langs->trans("Today") . "</a>)";
354
+    $nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\" title=\"".dol_escape_htmltag($langs->trans("Next"))."\"></i></a>\n";
355
+    $nav .= " &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
356 356
     $picto = 'calendarweek';
357 357
 }
358 358
 if ($action == 'show_day') {
359
-    $nav = "<a href=\"?year=" . $prev_year . "&amp;month=" . $prev_month . "&amp;day=" . $prev_day . $param . "\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
360
-    $nav .= " <span id=\"month_name\">" . dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "daytextshort");
359
+    $nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
360
+    $nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "daytextshort");
361 361
     $nav .= " </span>\n";
362
-    $nav .= " &nbsp; <a href=\"?year=" . $next_year . "&amp;month=" . $next_month . "&amp;day=" . $next_day . $param . "\"><i class=\"fa fa-chevron-right\"></i></a>\n";
363
-    $nav .= " &nbsp; (<a href=\"?year=" . $nowyear . "&amp;month=" . $nowmonth . "&amp;day=" . $nowday . $param . "\">" . $langs->trans("Today") . "</a>)";
362
+    $nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
363
+    $nav .= " &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
364 364
     $picto = 'calendarday';
365 365
 }
366 366
 
367 367
 // Must be after the nav definition
368
-$param .= '&year=' . $year . '&month=' . $month . ($day ? '&day=' . $day : '');
368
+$param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : '');
369 369
 //print 'x'.$param;
370 370
 
371 371
 
@@ -385,10 +385,10 @@  discard block
 block discarded – undo
385 385
 
386 386
 $head = calendars_prepare_head($paramnoaction);
387 387
 
388
-print '<form method="POST" id="searchFormList" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '">' . "\n";
388
+print '<form method="POST" id="searchFormList" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'">'."\n";
389 389
 if ($optioncss != '')
390
-    print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
391
-print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
390
+    print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
391
+print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
392 392
 
393 393
 dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action');
394 394
 print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, '', $resourceid);
@@ -402,50 +402,50 @@  discard block
 block discarded – undo
402 402
 $showextcals = $listofextcals;
403 403
 
404 404
 if (!empty($conf->use_javascript_ajax)) { // If javascript on
405
-    $s .= "\n" . '<!-- Div to calendars selectors -->' . "\n";
406
-    $s .= '<script type="text/javascript">' . "\n";
407
-    $s .= 'jQuery(document).ready(function () {' . "\n";
408
-    $s .= 'jQuery("#check_birthday").click(function() { console.log("Toggle birthday"); jQuery(".family_birthday").toggle(); });' . "\n";
409
-    $s .= 'jQuery(".family_birthday").toggle();' . "\n";
405
+    $s .= "\n".'<!-- Div to calendars selectors -->'."\n";
406
+    $s .= '<script type="text/javascript">'."\n";
407
+    $s .= 'jQuery(document).ready(function () {'."\n";
408
+    $s .= 'jQuery("#check_birthday").click(function() { console.log("Toggle birthday"); jQuery(".family_birthday").toggle(); });'."\n";
409
+    $s .= 'jQuery(".family_birthday").toggle();'."\n";
410 410
     if ($action == "show_week" || $action == "show_month" || empty($action)) {
411 411
         // Code to enable drag and drop
412
-        $s .= 'jQuery( "div.sortable" ).sortable({connectWith: ".sortable", placeholder: "ui-state-highlight", items: "div.movable", receive: function( event, ui ) {' . "\n";
412
+        $s .= 'jQuery( "div.sortable" ).sortable({connectWith: ".sortable", placeholder: "ui-state-highlight", items: "div.movable", receive: function( event, ui ) {'."\n";
413 413
         // Code to submit form
414
-        $s .= 'console.log("submit form to record new event");' . "\n";
414
+        $s .= 'console.log("submit form to record new event");'."\n";
415 415
         //$s.='console.log(event.target);';
416
-        $s .= 'var newval = jQuery(event.target).closest("div.dayevent").attr("id");' . "\n";
417
-        $s .= 'console.log("found parent div.dayevent with id = "+newval);' . "\n";
418
-        $s .= 'var frm=jQuery("#searchFormList");' . "\n";
419
-        $s .= 'var newurl = ui.item.find("a.cal_event").attr("href");' . "\n";
420
-        $s .= 'console.log(newurl);' . "\n";
421
-        $s .= 'frm.attr("action", newurl).children("#newdate").val(newval);frm.submit();}' . "\n";
422
-        $s .= '});' . "\n";
416
+        $s .= 'var newval = jQuery(event.target).closest("div.dayevent").attr("id");'."\n";
417
+        $s .= 'console.log("found parent div.dayevent with id = "+newval);'."\n";
418
+        $s .= 'var frm=jQuery("#searchFormList");'."\n";
419
+        $s .= 'var newurl = ui.item.find("a.cal_event").attr("href");'."\n";
420
+        $s .= 'console.log(newurl);'."\n";
421
+        $s .= 'frm.attr("action", newurl).children("#newdate").val(newval);frm.submit();}'."\n";
422
+        $s .= '});'."\n";
423 423
     }
424
-    $s .= '});' . "\n";
425
-    $s .= '</script>' . "\n";
424
+    $s .= '});'."\n";
425
+    $s .= '</script>'."\n";
426 426
 
427 427
     // Local calendar
428
-    $s .= '<div class="nowrap clear inline-block minheight20"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> ' . $langs->trans("LocalAgenda") . ' &nbsp; </div>';
428
+    $s .= '<div class="nowrap clear inline-block minheight20"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
429 429
 
430 430
     // External calendars
431 431
     if (is_array($showextcals) && count($showextcals) > 0) {
432
-        $s .= '<script type="text/javascript">' . "\n";
432
+        $s .= '<script type="text/javascript">'."\n";
433 433
         $s .= 'jQuery(document).ready(function () {
434 434
 				jQuery("table input[name^=\"check_ext\"]").click(function() {
435 435
 					var name = $(this).attr("name");
436 436
 					jQuery(".family_ext" + name.replace("check_ext", "")).toggle();
437 437
 				});
438 438
 			});' . "\n";
439
-        $s .= '</script>' . "\n";
439
+        $s .= '</script>'."\n";
440 440
 
441 441
         foreach ($showextcals as $val) {
442 442
             $htmlname = md5($val['name']);
443
-            $s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_ext' . $htmlname . '" name="check_ext' . $htmlname . '" checked> ' . $val['name'] . ' &nbsp; </div>';
443
+            $s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" checked> '.$val['name'].' &nbsp; </div>';
444 444
         }
445 445
     }
446 446
 
447 447
     // Birthdays
448
-    $s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_birthday" name="check_birthday"> ' . $langs->trans("AgendaShowBirthdayEvents") . ' &nbsp; </div>';
448
+    $s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_birthday" name="check_birthday"> '.$langs->trans("AgendaShowBirthdayEvents").' &nbsp; </div>';
449 449
 
450 450
     // Calendars from hooks
451 451
     $parameters = array();
@@ -457,12 +457,12 @@  discard block
 block discarded – undo
457 457
         $s = $hookmanager->resPrint;
458 458
     }
459 459
 } else {          // If javascript off
460
-    $newparam = $param;   // newparam is for birthday links
461
-    $newparam = preg_replace('/showbirthday=[0-1]/i', 'showbirthday=' . (empty($showbirthday) ? 1 : 0), $newparam);
460
+    $newparam = $param; // newparam is for birthday links
461
+    $newparam = preg_replace('/showbirthday=[0-1]/i', 'showbirthday='.(empty($showbirthday) ? 1 : 0), $newparam);
462 462
     if (!preg_match('/showbirthday=/i', $newparam))
463 463
         $newparam .= '&showbirthday=1';
464
-    $link = '<a href="' . dol_escape_htmltag($_SERVER['PHP_SELF']);
465
-    $link .= '?' . dol_escape_htmltag($newparam);
464
+    $link = '<a href="'.dol_escape_htmltag($_SERVER['PHP_SELF']);
465
+    $link .= '?'.dol_escape_htmltag($newparam);
466 466
     $link .= '">';
467 467
     if (empty($showbirthday))
468 468
         $link .= $langs->trans("AgendaShowBirthdayEvents");
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
     $link .= '</a>';
472 472
 }
473 473
 
474
-print load_fiche_titre($s, $link . ' &nbsp; &nbsp; ' . $nav, '', 0, 0, 'tablelistofcalendars');
474
+print load_fiche_titre($s, $link.' &nbsp; &nbsp; '.$nav, '', 0, 0, 'tablelistofcalendars');
475 475
 
476 476
 
477 477
 // Load events from database into $eventarray
@@ -489,19 +489,19 @@  discard block
 block discarded – undo
489 489
 $sql .= ' a.fk_soc, a.fk_contact,';
490 490
 $sql .= ' a.fk_element, a.elementtype,';
491 491
 $sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color';
492
-$sql .= ' FROM ' . MAIN_DB_PREFIX . 'c_actioncomm as ca, ' . MAIN_DB_PREFIX . "actioncomm as a";
492
+$sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
493 493
 if (!$user->rights->societe->client->voir && !$socid)
494
-    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
494
+    $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
495 495
 // We must filter on resource table
496 496
 if ($resourceid > 0)
497
-    $sql .= ", " . MAIN_DB_PREFIX . "element_resources as r";
497
+    $sql .= ", ".MAIN_DB_PREFIX."element_resources as r";
498 498
 // We must filter on assignement table
499 499
 if ($filtert > 0 || $usergroup > 0)
500
-    $sql .= ", " . MAIN_DB_PREFIX . "actioncomm_resources as ar";
500
+    $sql .= ", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
501 501
 if ($usergroup > 0)
502
-    $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
502
+    $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
503 503
 $sql .= ' WHERE a.fk_action = ca.id';
504
-$sql .= ' AND a.entity IN (' . getEntity('agenda') . ')';
504
+$sql .= ' AND a.entity IN ('.getEntity('agenda').')';
505 505
 // Condition on actioncode
506 506
 if (!empty($actioncode)) {
507 507
     if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
@@ -523,50 +523,50 @@  discard block
 block discarded – undo
523 523
             $sql .= " AND ca.type = 'systemauto'";
524 524
         else {
525 525
             if (is_array($actioncode)) {
526
-                $sql .= " AND ca.code IN ('" . implode("','", $actioncode) . "')";
526
+                $sql .= " AND ca.code IN ('".implode("','", $actioncode)."')";
527 527
             } else {
528
-                $sql .= " AND ca.code IN ('" . implode("','", explode(',', $actioncode)) . "')";
528
+                $sql .= " AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
529 529
             }
530 530
         }
531 531
     }
532 532
 }
533 533
 if ($resourceid > 0)
534
-    $sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = " . $db->escape($resourceid);
534
+    $sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".$db->escape($resourceid);
535 535
 if ($pid)
536
-    $sql .= " AND a.fk_project=" . $db->escape($pid);
536
+    $sql .= " AND a.fk_project=".$db->escape($pid);
537 537
 if (!$user->rights->societe->client->voir && !$socid)
538
-    $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = " . $user->id . ")";
538
+    $sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
539 539
 if ($socid > 0)
540
-    $sql .= ' AND a.fk_soc = ' . $socid;
540
+    $sql .= ' AND a.fk_soc = '.$socid;
541 541
 // We must filter on assignement table
542 542
 if ($filtert > 0 || $usergroup > 0)
543 543
     $sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
544 544
 if ($action == 'show_day') {
545 545
     $sql .= " AND (";
546
-    $sql .= " (a.datep BETWEEN '" . $db->idate(dol_mktime(0, 0, 0, $month, $day, $year)) . "'";
547
-    $sql .= " AND '" . $db->idate(dol_mktime(23, 59, 59, $month, $day, $year)) . "')";
546
+    $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'";
547
+    $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
548 548
     $sql .= " OR ";
549
-    $sql .= " (a.datep2 BETWEEN '" . $db->idate(dol_mktime(0, 0, 0, $month, $day, $year)) . "'";
550
-    $sql .= " AND '" . $db->idate(dol_mktime(23, 59, 59, $month, $day, $year)) . "')";
549
+    $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'";
550
+    $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
551 551
     $sql .= " OR ";
552
-    $sql .= " (a.datep < '" . $db->idate(dol_mktime(0, 0, 0, $month, $day, $year)) . "'";
553
-    $sql .= " AND a.datep2 > '" . $db->idate(dol_mktime(23, 59, 59, $month, $day, $year)) . "')";
552
+    $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."'";
553
+    $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."')";
554 554
     $sql .= ')';
555 555
 } else {
556 556
     // To limit array
557 557
     $sql .= " AND (";
558
-    $sql .= " (a.datep BETWEEN '" . $db->idate(dol_mktime(0, 0, 0, $month, 1, $year) - (60 * 60 * 24 * 7)) . "'";   // Start 7 days before
559
-    $sql .= " AND '" . $db->idate(dol_mktime(23, 59, 59, $month, 28, $year) + (60 * 60 * 24 * 10)) . "')";            // End 7 days after + 3 to go from 28 to 31
558
+    $sql .= " (a.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, 1, $year) - (60 * 60 * 24 * 7))."'"; // Start 7 days before
559
+    $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, 28, $year) + (60 * 60 * 24 * 10))."')"; // End 7 days after + 3 to go from 28 to 31
560 560
     $sql .= " OR ";
561
-    $sql .= " (a.datep2 BETWEEN '" . $db->idate(dol_mktime(0, 0, 0, $month, 1, $year) - (60 * 60 * 24 * 7)) . "'";
562
-    $sql .= " AND '" . $db->idate(dol_mktime(23, 59, 59, $month, 28, $year) + (60 * 60 * 24 * 10)) . "')";
561
+    $sql .= " (a.datep2 BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, 1, $year) - (60 * 60 * 24 * 7))."'";
562
+    $sql .= " AND '".$db->idate(dol_mktime(23, 59, 59, $month, 28, $year) + (60 * 60 * 24 * 10))."')";
563 563
     $sql .= " OR ";
564
-    $sql .= " (a.datep < '" . $db->idate(dol_mktime(0, 0, 0, $month, 1, $year) - (60 * 60 * 24 * 7)) . "'";
565
-    $sql .= " AND a.datep2 > '" . $db->idate(dol_mktime(23, 59, 59, $month, 28, $year) + (60 * 60 * 24 * 10)) . "')";
564
+    $sql .= " (a.datep < '".$db->idate(dol_mktime(0, 0, 0, $month, 1, $year) - (60 * 60 * 24 * 7))."'";
565
+    $sql .= " AND a.datep2 > '".$db->idate(dol_mktime(23, 59, 59, $month, 28, $year) + (60 * 60 * 24 * 10))."')";
566 566
     $sql .= ')';
567 567
 }
568 568
 if ($type)
569
-    $sql .= " AND ca.id = " . $type;
569
+    $sql .= " AND ca.id = ".$type;
570 570
 if ($status == '0') {
571 571
     $sql .= " AND a.percent = 0";
572 572
 }
@@ -586,9 +586,9 @@  discard block
 block discarded – undo
586 586
 if ($filtert > 0 || $usergroup > 0) {
587 587
     $sql .= " AND (";
588 588
     if ($filtert > 0)
589
-        $sql .= "ar.fk_element = " . $filtert;
589
+        $sql .= "ar.fk_element = ".$filtert;
590 590
     if ($usergroup > 0)
591
-        $sql .= ($filtert > 0 ? " OR " : "") . " ugu.fk_usergroup = " . $usergroup;
591
+        $sql .= ($filtert > 0 ? " OR " : "")." ugu.fk_usergroup = ".$usergroup;
592 592
     $sql .= ")";
593 593
 }
594 594
 // Sort on date
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 if ($resql) {
602 602
     $num = $db->num_rows($resql);
603 603
 
604
-    $MAXONSAMEPAGE = 10000;   // Useless to have more. Protection to avoid memory overload when high number of event (for example after a mass import)
604
+    $MAXONSAMEPAGE = 10000; // Useless to have more. Protection to avoid memory overload when high number of event (for example after a mass import)
605 605
     $i = 0;
606 606
     while ($i < $num && $i < $MAXONSAMEPAGE) {
607 607
         $obj = $db->fetch_object($resql);
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
         $event = new ActionComm($db);
617 617
         $event->id = $obj->id;
618 618
 
619
-        $event->datep = $db->jdate($obj->datep);      // datep and datef are GMT date. Example: 1970-01-01 01:00:00, jdate will return 0 if TZ of PHP server is Europe/Berlin
619
+        $event->datep = $db->jdate($obj->datep); // datep and datef are GMT date. Example: 1970-01-01 01:00:00, jdate will return 0 if TZ of PHP server is Europe/Berlin
620 620
         $event->datef = $db->jdate($obj->datep2);
621 621
         //var_dump($obj->datep);
622 622
         //var_dump($event->datep);
@@ -628,9 +628,9 @@  discard block
 block discarded – undo
628 628
         $event->libelle = $obj->label;
629 629
         $event->label = $obj->label;
630 630
         $event->percentage = $obj->percent;
631
-        $event->authorid = $obj->fk_user_author;  // user id of creator
631
+        $event->authorid = $obj->fk_user_author; // user id of creator
632 632
         $event->userownerid = $obj->fk_user_action; // user id of owner
633
-        $event->fetch_userassigned();    // This load $event->userassigned
633
+        $event->fetch_userassigned(); // This load $event->userassigned
634 634
         $event->priority = $obj->priority;
635 635
         $event->fulldayevent = $obj->fulldayevent;
636 636
         $event->location = $obj->location;
@@ -710,14 +710,14 @@  discard block
 block discarded – undo
710 710
 if ($showbirthday) {
711 711
     // Add events in array
712 712
     $sql = 'SELECT sp.rowid, sp.lastname, sp.firstname, sp.birthday';
713
-    $sql .= ' FROM ' . MAIN_DB_PREFIX . 'socpeople as sp';
714
-    $sql .= ' WHERE (priv=0 OR (priv=1 AND fk_user_creat=' . $user->id . '))';
715
-    $sql .= " AND sp.entity IN (" . getEntity('socpeople') . ")";
713
+    $sql .= ' FROM '.MAIN_DB_PREFIX.'socpeople as sp';
714
+    $sql .= ' WHERE (priv=0 OR (priv=1 AND fk_user_creat='.$user->id.'))';
715
+    $sql .= " AND sp.entity IN (".getEntity('socpeople').")";
716 716
     if ($action == 'show_day') {
717
-        $sql .= ' AND MONTH(birthday) = ' . $month;
718
-        $sql .= ' AND DAY(birthday) = ' . $day;
717
+        $sql .= ' AND MONTH(birthday) = '.$month;
718
+        $sql .= ' AND DAY(birthday) = '.$day;
719 719
     } else {
720
-        $sql .= ' AND MONTH(birthday) = ' . $month;
720
+        $sql .= ' AND MONTH(birthday) = '.$month;
721 721
     }
722 722
     $sql .= ' ORDER BY birthday';
723 723
 
@@ -733,10 +733,10 @@  discard block
 block discarded – undo
733 733
             $datebirth = dol_stringtotime($obj->birthday, 1);
734 734
             //print 'ee'.$obj->birthday.'-'.$datebirth;
735 735
             $datearray = dol_getdate($datebirth, true);
736
-            $event->datep = dol_mktime(0, 0, 0, $datearray['mon'], $datearray['mday'], $year, true);    // For full day events, date are also GMT but they wont but converted during output
736
+            $event->datep = dol_mktime(0, 0, 0, $datearray['mon'], $datearray['mday'], $year, true); // For full day events, date are also GMT but they wont but converted during output
737 737
             $event->datef = $event->datep;
738 738
             $event->type_code = 'BIRTHDAY';
739
-            $event->libelle = $langs->trans("Birthday") . ' ' . dolGetFirstLastname($obj->firstname, $obj->lastname);
739
+            $event->libelle = $langs->trans("Birthday").' '.dolGetFirstLastname($obj->firstname, $obj->lastname);
740 740
             $event->percentage = 100;
741 741
             $event->fulldayevent = 1;
742 742
 
@@ -769,9 +769,9 @@  discard block
 block discarded – undo
769 769
 
770 770
 // Complete $eventarray with external import Ical
771 771
 if (count($listofextcals)) {
772
-    require_once DOL_DOCUMENT_ROOT . '/comm/action/class/ical.class.php';
772
+    require_once DOL_DOCUMENT_ROOT.'/comm/action/class/ical.class.php';
773 773
     foreach ($listofextcals as $extcal) {
774
-        $url = $extcal['src'];    // Example: https://www.google.com/calendar/ical/eldy10%40gmail.com/private-cde92aa7d7e0ef6110010a821a2aaeb/basic.ics
774
+        $url = $extcal['src']; // Example: https://www.google.com/calendar/ical/eldy10%40gmail.com/private-cde92aa7d7e0ef6110010a821a2aaeb/basic.ics
775 775
         $namecal = $extcal['name'];
776 776
         $offsettz = $extcal['offsettz'];
777 777
         $colorcal = $extcal['color'];
@@ -784,9 +784,9 @@  discard block
 block discarded – undo
784 784
         //var_dump($ical->cal); exit;
785 785
         $icalevents = array();
786 786
         if (is_array($ical->get_event_list()))
787
-            $icalevents = array_merge($icalevents, $ical->get_event_list());        // Add $ical->cal['VEVENT']
787
+            $icalevents = array_merge($icalevents, $ical->get_event_list()); // Add $ical->cal['VEVENT']
788 788
         if (is_array($ical->get_freebusy_list()))
789
-            $icalevents = array_merge($icalevents, $ical->get_freebusy_list());  // Add $ical->cal['VFREEBUSY']
789
+            $icalevents = array_merge($icalevents, $ical->get_freebusy_list()); // Add $ical->cal['VFREEBUSY']
790 790
 
791 791
         if (count($icalevents) > 0) {
792 792
             // Duplicate all repeatable events into new entries
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
                     //if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow-1);
798 798
                     if ($icalevent['DTSTART;VALUE=DATE']) { //fullday event
799 799
                         $datecurstart = dol_stringtotime($icalevent['DTSTART;VALUE=DATE'], 1);
800
-                        $datecurend = dol_stringtotime($icalevent['DTEND;VALUE=DATE'], 1) - 1;  // We remove one second to get last second of day
800
+                        $datecurend = dol_stringtotime($icalevent['DTEND;VALUE=DATE'], 1) - 1; // We remove one second to get last second of day
801 801
                     } else if (is_array($icalevent['DTSTART']) && !empty($icalevent['DTSTART']['unixtime'])) {
802 802
                         $datecurstart = $icalevent['DTSTART']['unixtime'];
803 803
                         $datecurend = $icalevent['DTEND']['unixtime'];
@@ -832,9 +832,9 @@  discard block
 block discarded – undo
832 832
                     $until = empty($icalevent['RRULE']['UNTIL']) ? 0 : dol_stringtotime($icalevent['RRULE']['UNTIL'], 1);
833 833
                     $maxrepeat = empty($icalevent['RRULE']['COUNT']) ? 0 : $icalevent['RRULE']['COUNT'];
834 834
                     if ($until && ($until + ($datecurend - $datecurstart)) < $firstdaytoshow)
835
-                        continue;  // We discard repeatable event that end before start date to show
835
+                        continue; // We discard repeatable event that end before start date to show
836 836
                     if ($datecurstart >= $lastdaytoshow)
837
-                        continue;                                   // We discard repeatable event that start after end date to show
837
+                        continue; // We discard repeatable event that start after end date to show
838 838
 
839 839
                     $numofevent = 0;
840 840
                     while (($datecurstart < $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat))) {
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
                         }
870 870
                         // Test to avoid infinite loop ($datecurstart must increase)
871 871
                         if ($savdatecurstart >= $datecurstart) {
872
-                            dol_syslog("Found a rule freq " . $icalevent['RRULE']['FREQ'] . " not managed by dolibarr code. Assume 1 week frequency.", LOG_ERR);
872
+                            dol_syslog("Found a rule freq ".$icalevent['RRULE']['FREQ']." not managed by dolibarr code. Assume 1 week frequency.", LOG_ERR);
873 873
                             $datecurstart += 3600 * 24 * 7;
874 874
                             $datecurend += 3600 * 24 * 7;
875 875
                         }
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
                 //var_dump($icalevent);
884 884
                 //print $icalevent['SUMMARY'].'->'.var_dump($icalevent).'<br>';exit;
885 885
                 if (!empty($icalevent['RRULE']))
886
-                    continue;    // We found a repeatable event. It was already split into unitary events, so we discard general rule.
886
+                    continue; // We found a repeatable event. It was already split into unitary events, so we discard general rule.
887 887
 
888 888
 
889 889
                     
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
                 if (isset($icalevent['DTSTART;VALUE=DATE'])) { // fullday event
894 894
                     // For full day events, date are also GMT but they wont but converted using tz during output
895 895
                     $datestart = dol_stringtotime($icalevent['DTSTART;VALUE=DATE'], 1);
896
-                    $dateend = dol_stringtotime($icalevent['DTEND;VALUE=DATE'], 1) - 1;  // We remove one second to get last second of day
896
+                    $dateend = dol_stringtotime($icalevent['DTEND;VALUE=DATE'], 1) - 1; // We remove one second to get last second of day
897 897
                     //print 'x'.$datestart.'-'.$dateend;exit;
898 898
                     //print dol_print_date($dateend,'dayhour','gmt');
899 899
                     $event->fulldayevent = 1;
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
                     $event->id = $icalevent['UID'];
939 939
                     $event->icalname = $namecal;
940 940
                     $event->icalcolor = $colorcal;
941
-                    $usertime = 0;    // We dont modify date because we want to have date into memory datep and datef stored as GMT date. Compensation will be done during output.
941
+                    $usertime = 0; // We dont modify date because we want to have date into memory datep and datef stored as GMT date. Compensation will be done during output.
942 942
                     $event->datep = $datestart + $usertime;
943 943
                     $event->datef = $dateend + $usertime;
944 944
                     $event->type_code = "ICALEVENT";
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
                             //if ($event->fulldayevent) print dol_print_date($daykeygmt,'dayhour','gmt').'-'.dol_print_date($daykey,'dayhour','gmt').'-'.dol_print_date($event->date_end_in_calendar,'dayhour','gmt').' ';
992 992
                             $eventarray[$daykey][] = $event;
993 993
                             $daykey += 60 * 60 * 24;
994
-                            $daykeygmt += 60 * 60 * 24;   // Add one day
994
+                            $daykeygmt += 60 * 60 * 24; // Add one day
995 995
                             if (($event->fulldayevent ? $daykeygmt : $daykey) > $event->date_end_in_calendar)
996 996
                                 $loop = false;
997 997
                         }
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 $cacheusers = array();
1027 1027
 
1028 1028
 // Define theme_datacolor array
1029
-$color_file = DOL_DOCUMENT_ROOT . "/theme/" . $conf->theme . "/graph-color.php";
1029
+$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
1030 1030
 if (is_readable($color_file)) {
1031 1031
     include_once $color_file;
1032 1032
 }
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 
1036 1036
 
1037 1037
 if (empty($action) || $action == 'show_month') {      // View by month
1038
-    $newparam = $param;   // newparam is for birthday links
1038
+    $newparam = $param; // newparam is for birthday links
1039 1039
     $newparam = preg_replace('/showbirthday=/i', 'showbirthday_=', $newparam); // To avoid replacement when replace day= is done
1040 1040
     $newparam = preg_replace('/action=show_month&?/i', '', $newparam);
1041 1041
     $newparam = preg_replace('/action=show_week&?/i', '', $newparam);
@@ -1058,11 +1058,11 @@  discard block
 block discarded – undo
1058 1058
             $labelshort = array(0 => 'SundayMin', 1 => 'MondayMin', 2 => 'TuesdayMin', 3 => 'WednesdayMin', 4 => 'ThursdayMin', 5 => 'FridayMin', 6 => 'SaturdayMin');
1059 1059
             print $langs->trans($labelshort[$numdayinweek]);
1060 1060
         } else
1061
-            print $langs->trans("Day" . $numdayinweek);
1062
-        print '  </td>' . "\n";
1061
+            print $langs->trans("Day".$numdayinweek);
1062
+        print '  </td>'."\n";
1063 1063
         $i++;
1064 1064
     }
1065
-    echo ' </tr>' . "\n";
1065
+    echo ' </tr>'."\n";
1066 1066
 
1067 1067
     $todayarray = dol_getdate($now, 'fast');
1068 1068
     $todaytms = dol_mktime(0, 0, 0, $todayarray['mon'], $todayarray['mday'], $todayarray['year']);
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
                 $style = 'cal_other_month cal_past';
1078 1078
                 if ($iter_day == 6)
1079 1079
                     $style .= ' cal_other_month_right';
1080
-                echo '  <td class="' . $style . ' nowrap" width="14%" valign="top">';
1080
+                echo '  <td class="'.$style.' nowrap" width="14%" valign="top">';
1081 1081
                 show_day_events($db, $max_day_in_prev_month + $tmpday, $prev_month, $prev_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
1082 1082
                 echo "  </td>\n";
1083 1083
             }
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
                 if ($curtime < $todaytms)
1096 1096
                     $style .= ' cal_past';
1097 1097
                 //var_dump($todayarray['mday']."==".$tmpday." && ".$todayarray['mon']."==".$month." && ".$todayarray['year']."==".$year.' -> '.$style);
1098
-                echo '  <td class="' . $style . ' nowrap" width="14%" valign="top">';
1098
+                echo '  <td class="'.$style.' nowrap" width="14%" valign="top">';
1099 1099
                 show_day_events($db, $tmpday, $month, $year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
1100 1100
                 echo "  </td>\n";
1101 1101
             }
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
                 $style = 'cal_other_month';
1105 1105
                 if ($iter_day == 6)
1106 1106
                     $style .= ' cal_other_month_right';
1107
-                echo '  <td class="' . $style . ' nowrap" width="14%" valign="top">';
1107
+                echo '  <td class="'.$style.' nowrap" width="14%" valign="top">';
1108 1108
                 show_day_events($db, $tmpday - $max_day_in_month, $next_month, $next_year, $month, $style, $eventarray, $maxprint, $maxnbofchar, $newparam);
1109 1109
                 echo "</td>\n";
1110 1110
             }
@@ -1116,11 +1116,11 @@  discard block
 block discarded – undo
1116 1116
     print '</div>';
1117 1117
 
1118 1118
     print '<input type="hidden" name="actionmove" value="mupdate">';
1119
-    print '<input type="hidden" name="backtopage" value="' . dol_escape_htmltag($_SERVER['PHP_SELF']) . '?' . dol_escape_htmltag($_SERVER['QUERY_STRING']) . '">';
1119
+    print '<input type="hidden" name="backtopage" value="'.dol_escape_htmltag($_SERVER['PHP_SELF']).'?'.dol_escape_htmltag($_SERVER['QUERY_STRING']).'">';
1120 1120
     print '<input type="hidden" name="newdate" id="newdate">';
1121 1121
 }
1122 1122
 elseif ($action == 'show_week') { // View by week
1123
-    $newparam = $param;   // newparam is for birthday links
1123
+    $newparam = $param; // newparam is for birthday links
1124 1124
     $newparam = preg_replace('/showbirthday=/i', 'showbirthday_=', $newparam); // To avoid replacement when replace day= is done
1125 1125
     $newparam = preg_replace('/action=show_month&?/i', '', $newparam);
1126 1126
     $newparam = preg_replace('/action=show_week&?/i', '', $newparam);
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
     print ' <tr class="liste_titre">';
1137 1137
     $i = 0;
1138 1138
     while ($i < 7) {
1139
-        echo '  <td align="center">' . $langs->trans("Day" . (($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7)) . "</td>\n";
1139
+        echo '  <td align="center">'.$langs->trans("Day".(($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7))."</td>\n";
1140 1140
         $i++;
1141 1141
     }
1142 1142
     echo " </tr>\n";
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
         if ($today)
1162 1162
             $style = 'cal_today';
1163 1163
 
1164
-        echo '  <td class="' . $style . '" width="14%" valign="top">';
1164
+        echo '  <td class="'.$style.'" width="14%" valign="top">';
1165 1165
         show_day_events($db, $tmpday, $tmpmonth, $tmpyear, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
1166 1166
         echo "  </td>\n";
1167 1167
     }
@@ -1171,11 +1171,11 @@  discard block
 block discarded – undo
1171 1171
     print '</div>';
1172 1172
 
1173 1173
     echo '<input type="hidden" name="actionmove" value="mupdate">';
1174
-    echo '<input type="hidden" name="backtopage" value="' . dol_escape_htmltag($_SERVER['PHP_SELF']) . '?' . dol_escape_htmltag($_SERVER['QUERY_STRING']) . '">';
1174
+    echo '<input type="hidden" name="backtopage" value="'.dol_escape_htmltag($_SERVER['PHP_SELF']).'?'.dol_escape_htmltag($_SERVER['QUERY_STRING']).'">';
1175 1175
     echo '<input type="hidden" name="newdate" id="newdate">';
1176 1176
 }
1177 1177
 else {    // View by day
1178
-    $newparam = $param;   // newparam is for birthday links
1178
+    $newparam = $param; // newparam is for birthday links
1179 1179
     $newparam = preg_replace('/action=show_month&?/i', '', $newparam);
1180 1180
     $newparam = preg_replace('/action=show_week&?/i', '', $newparam);
1181 1181
     $newparam = preg_replace('/viewday=[0-9]+&?/i', '', $newparam);
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 
1197 1197
     echo ' <tr class="tagtr liste_titre">';
1198 1198
     echo '  <td class="tagtd width100"></td>';
1199
-    echo '  <td class="tagtd center">' . $langs->trans("Day" . $arraytimestamp['wday']) . "</td>\n";
1199
+    echo '  <td class="tagtd center">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n";
1200 1200
     echo " </td>\n";
1201 1201
 
1202 1202
     /*
@@ -1213,11 +1213,11 @@  discard block
 block discarded – undo
1213 1213
     /* WIP View per hour */
1214 1214
     $useviewhour = 0;
1215 1215
     if ($useviewhour) {
1216
-        print '<div class="div-table-responsive-no-min borderbottom">';  // You can use div-table-responsive-no-min if you dont need reserved height for your table
1216
+        print '<div class="div-table-responsive-no-min borderbottom">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
1217 1217
 
1218 1218
         $maxheightwin = (isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 500) ? ($_SESSION["dol_screenheight"] - 200) : 660; // Also into index.php file
1219 1219
 
1220
-        echo '<div style="max-height: ' . $maxheightwin . 'px;">';
1220
+        echo '<div style="max-height: '.$maxheightwin.'px;">';
1221 1221
         echo '<div class="tagtable centpercent calendarviewcontainer">';
1222 1222
 
1223 1223
         $maxnbofchar = 80;
@@ -1236,9 +1236,9 @@  discard block
 block discarded – undo
1236 1236
         $i = 0;
1237 1237
         $j = 0;
1238 1238
         while ($i < 24) {
1239
-            echo ' <div class="tagtr calendarviewcontainertr">' . "\n";
1240
-            echo '  <div class="tagtd width100 tdtop">' . dol_print_date($i * 3600, 'hour', 'gmt') . '</div>';
1241
-            echo '  <div class="tagtd ' . $style . ' tdtop">';
1239
+            echo ' <div class="tagtr calendarviewcontainertr">'."\n";
1240
+            echo '  <div class="tagtd width100 tdtop">'.dol_print_date($i * 3600, 'hour', 'gmt').'</div>';
1241
+            echo '  <div class="tagtd '.$style.' tdtop">';
1242 1242
             echo "  </div>\n";
1243 1243
             echo " </div>\n";
1244 1244
             $i++;
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
 
1252 1252
         print '</div>';
1253 1253
     } else {
1254
-        print '<div class="div-table-responsive-no-min">';  // You can use div-table-responsive-no-min if you dont need reserved height for your table
1254
+        print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
1255 1255
 
1256 1256
         show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0);
1257 1257
 
@@ -1259,7 +1259,7 @@  discard block
 block discarded – undo
1259 1259
     }
1260 1260
 }
1261 1261
 
1262
-print "\n" . '</form>';
1262
+print "\n".'</form>';
1263 1263
 
1264 1264
 // End of page
1265 1265
 llxFooter();
@@ -1290,18 +1290,18 @@  discard block
 block discarded – undo
1290 1290
     global $theme_datacolor;
1291 1291
     global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
1292 1292
 
1293
-    $dateint = sprintf("%04d", $year) . sprintf("%02d", $month) . sprintf("%02d", $day);
1293
+    $dateint = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
1294 1294
 
1295 1295
     print "\n";
1296 1296
 
1297 1297
     // Line with title of day
1298 1298
     $curtime = dol_mktime(0, 0, 0, $month, $day, $year);
1299
-    print '<div id="dayevent_' . $dateint . '" class="dayevent tagtable centpercent nobordernopadding">' . "\n";
1299
+    print '<div id="dayevent_'.$dateint.'" class="dayevent tagtable centpercent nobordernopadding">'."\n";
1300 1300
 
1301 1301
     if ($nonew <= 0) {
1302 1302
         print '<div class="tagtr"><div class="nowrap float">';
1303
-        print '<a style="color: #666" href="' . DOL_URL_ROOT . '/comm/action/index.php?';
1304
-        print 'action=show_day&day=' . str_pad($day, 2, "0", STR_PAD_LEFT) . '&month=' . str_pad($month, 2, "0", STR_PAD_LEFT) . '&year=' . $year;
1303
+        print '<a style="color: #666" href="'.DOL_URL_ROOT.'/comm/action/index.php?';
1304
+        print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
1305 1305
         print $newparam;
1306 1306
         print '">';
1307 1307
         if ($showinfo)
@@ -1311,15 +1311,15 @@  discard block
 block discarded – undo
1311 1311
         print '</a>';
1312 1312
         print '</div><div class="floatright nowrap">';
1313 1313
         if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
1314
-            $newparam .= '&month=' . str_pad($month, 2, "0", STR_PAD_LEFT) . '&year=' . $year;
1314
+            $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
1315 1315
 
1316 1316
             //$param='month='.$monthshown.'&year='.$year;
1317 1317
             $hourminsec = '100000';
1318
-            print '<a href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&datep=' . sprintf("%04d%02d%02d", $year, $month, $day) . $hourminsec . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . ($newparam ? '?' . $newparam : '')) . '">';
1318
+            print '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $year, $month, $day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')).'">';
1319 1319
             print img_picto($langs->trans("NewAction"), 'edit_add.png');
1320 1320
             print '</a>';
1321 1321
         }
1322
-        print '</div></div>' . "\n";
1322
+        print '</div></div>'."\n";
1323 1323
     }
1324 1324
 
1325 1325
     if ($nonew < 0) {
@@ -1337,9 +1337,9 @@  discard block
 block discarded – undo
1337 1337
     $numbirthday = 0;
1338 1338
     $numical = 0;
1339 1339
     $numicals = array();
1340
-    $ymd = sprintf("%04d", $year) . sprintf("%02d", $month) . sprintf("%02d", $day);
1340
+    $ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
1341 1341
 
1342
-    $colorindexused[$user->id] = 0;   // Color index for current user (user->id) is always 0
1342
+    $colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0
1343 1343
     $nextindextouse = is_array($colorindexused) ? count($colorindexused) : 0; // At first run this is 0, so fist user has 0, next 1, ...
1344 1344
     //var_dump($colorindexused);
1345 1345
 
@@ -1376,11 +1376,11 @@  discard block
 block discarded – undo
1376 1376
                             if (!isset($numicals[dol_string_nospecial($event->icalname)])) {
1377 1377
                                 $numicals[dol_string_nospecial($event->icalname)] = 0;
1378 1378
                             }
1379
-                            $numicals[dol_string_nospecial($event->icalname)] ++;
1379
+                            $numicals[dol_string_nospecial($event->icalname)]++;
1380 1380
                         }
1381 1381
 
1382 1382
                         $color = ($event->icalcolor ? $event->icalcolor : -1);
1383
-                        $cssclass = (!empty($event->icalname) ? 'family_ext' . md5($event->icalname) : 'family_other');
1383
+                        $cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
1384 1384
                     } else if ($event->type_code == 'BIRTHDAY') {
1385 1385
                         $numbirthday++;
1386 1386
                         $colorindex = 2;
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
                     } else {
1390 1390
                         $numother++;
1391 1391
                         $color = ($event->icalcolor ? $event->icalcolor : -1);
1392
-                        $cssclass = (!empty($event->icalname) ? 'family_ext' . md5($event->icalname) : 'family_other');
1392
+                        $cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
1393 1393
 
1394 1394
                         if (empty($cacheusers[$event->userownerid])) {
1395 1395
                             $newuser = new User($db);
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
                         // Define color
1418 1418
                         $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
1419 1419
                     }
1420
-                    $cssclass = $cssclass . ' ' . $cssclass . '_day_' . $ymd;
1420
+                    $cssclass = $cssclass.' '.$cssclass.'_day_'.$ymd;
1421 1421
 
1422 1422
                     // Defined style to disable drag and drop feature
1423 1423
                     if ($event->type_code == 'AC_OTH_AUTO') {
@@ -1453,8 +1453,8 @@  discard block
 block discarded – undo
1453 1453
 
1454 1454
                     // Show rect of event
1455 1455
                     print "\n";
1456
-                    print '<!-- start event ' . $i . ' -->' . "\n";
1457
-                    print '<div id="event_' . $ymd . '_' . $i . '" class="event ' . $cssclass . '"';
1456
+                    print '<!-- start event '.$i.' -->'."\n";
1457
+                    print '<div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'"';
1458 1458
                     //print ' style="height: 100px;';
1459 1459
                     //print ' position: absolute; top: 40px; width: 50%;';
1460 1460
                     //print '"';
@@ -1462,12 +1462,12 @@  discard block
 block discarded – undo
1462 1462
 
1463 1463
                     //var_dump($event->userassigned);
1464 1464
                     //var_dump($event->transparency);
1465
-                    print '<table class="centpercent cal_event' . (empty($event->transparency) ? ' cal_event_notbusy' : ' cal_event_busy') . '" style="' . $h;
1465
+                    print '<table class="centpercent cal_event'.(empty($event->transparency) ? ' cal_event_notbusy' : ' cal_event_busy').'" style="'.$h;
1466 1466
                     if (empty($event->transparency) && empty($conf->global->AGENDA_NO_TRANSPARENT_ON_NOT_BUSY)) {
1467
-                        print 'border: 2px solid #' . $color . ';';
1467
+                        print 'border: 2px solid #'.$color.';';
1468 1468
                     } else {
1469
-                        print 'background: #' . $color . ';';
1470
-                        print 'background: -webkit-gradient(linear, left top, left bottom, from(#' . dol_color_minus($color, -3) . '), to(#' . dol_color_minus($color, -1) . '));';
1469
+                        print 'background: #'.$color.';';
1470
+                        print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -3).'), to(#'.dol_color_minus($color, -1).'));';
1471 1471
                     }
1472 1472
                     //if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
1473 1473
                     //else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
@@ -1475,7 +1475,7 @@  discard block
 block discarded – undo
1475 1475
                     //print 'border: 1px solid #ccc" width="100%"';
1476 1476
                     print '">';
1477 1477
                     print '<tr>';
1478
-                    print '<td class="tdoverflow nobottom centpercent ' . ($nowrapontd ? 'nowrap ' : '') . 'cal_event' . ($event->type_code == 'BIRTHDAY' ? ' cal_event_birthday' : '') . '">';
1478
+                    print '<td class="tdoverflow nobottom centpercent '.($nowrapontd ? 'nowrap ' : '').'cal_event'.($event->type_code == 'BIRTHDAY' ? ' cal_event_birthday' : '').'">';
1479 1479
 
1480 1480
                     $daterange = '';
1481 1481
 
@@ -1520,13 +1520,13 @@  discard block
 block discarded – undo
1520 1520
                         }
1521 1521
                         else {
1522 1522
                             if ($showinfo) {
1523
-                                print $langs->trans("EventOnFullDay") . "<br>\n";
1523
+                                print $langs->trans("EventOnFullDay")."<br>\n";
1524 1524
                             }
1525 1525
                         }
1526 1526
 
1527 1527
                         // Show title
1528 1528
                         $titletoshow = $daterange;
1529
-                        $titletoshow .= ($titletoshow ? ' ' : '') . $event->libelle;
1529
+                        $titletoshow .= ($titletoshow ? ' ' : '').$event->libelle;
1530 1530
 
1531 1531
                         if ($event->type_code == 'ICALEVENT')
1532 1532
                             print $titletoshow;
@@ -1557,7 +1557,7 @@  discard block
 block discarded – undo
1557 1557
                         print $listofusertoshow;
1558 1558
 
1559 1559
                         if ($event->type_code == 'ICALEVENT')
1560
-                            print '<br>(' . dol_trunc($event->icalname, $maxnbofchar) . ')';
1560
+                            print '<br>('.dol_trunc($event->icalname, $maxnbofchar).')';
1561 1561
 
1562 1562
                         // If action related to company / contact
1563 1563
                         $linerelatedto = '';
@@ -1584,20 +1584,20 @@  discard block
 block discarded – undo
1584 1584
                                 $linerelatedto .= $contact->getNomUrl(1, '', 0);
1585 1585
                         }
1586 1586
                         if (!empty($event->fk_element) && $event->fk_element > 0 && !empty($event->elementtype) && !empty($conf->global->AGENDA_SHOW_LINKED_OBJECT)) {
1587
-                            include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
1587
+                            include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
1588 1588
                             if ($linerelatedto)
1589 1589
                                 $linerelatedto .= '<br>';
1590 1590
                             $linerelatedto .= dolGetElementUrl($event->fk_element, $event->elementtype, 1);
1591 1591
                         }
1592 1592
                         if ($linerelatedto)
1593
-                            print '<br>' . $linerelatedto;
1593
+                            print '<br>'.$linerelatedto;
1594 1594
                     }
1595 1595
 
1596 1596
                     // Show location
1597 1597
                     if ($showinfo) {
1598 1598
                         if ($event->location) {
1599 1599
                             print '<br>';
1600
-                            print $langs->trans("Location") . ': ' . $event->location;
1600
+                            print $langs->trans("Location").': '.$event->location;
1601 1601
                         }
1602 1602
                     }
1603 1603
 
@@ -1609,23 +1609,23 @@  discard block
 block discarded – undo
1609 1609
                         if ($event->percentage >= 0)
1610 1610
                             $withstatus = 2;
1611 1611
                     }
1612
-                    print '<td class="nobottom right nowrap cal_event_right' . ($withstatus >= 2 ? ' cal_event_right_status' : '') . '">';
1612
+                    print '<td class="nobottom right nowrap cal_event_right'.($withstatus >= 2 ? ' cal_event_right_status' : '').'">';
1613 1613
                     if ($withstatus)
1614 1614
                         print $event->getLibStatut(3, 1);
1615 1615
                     else
1616 1616
                         print '&nbsp;';
1617 1617
                     print '</td></tr></table>';
1618
-                    print '</div><!-- end event ' . $i . ' -->' . "\n";
1618
+                    print '</div><!-- end event '.$i.' -->'."\n";
1619 1619
                     $i++;
1620 1620
                 }
1621 1621
                 else {
1622
-                    print '<a href="' . DOL_URL_ROOT . '/comm/action/index.php?action=' . $action . '&maxprint=0&month=' . $monthshown . '&year=' . $year;
1623
-                    print ($status ? '&status=' . $status : '') . ($filter ? '&filter=' . $filter : '');
1624
-                    print ($filtert ? '&filtert=' . $filtert : '');
1625
-                    print ($usergroup ? '&usergroup=' . $usergroup : '');
1626
-                    print ($actioncode != '' ? '&actioncode=' . $actioncode : '');
1627
-                    print '">' . img_picto("all", "1downarrow_selected.png") . ' ...';
1628
-                    print ' +' . (count($eventarray[$daykey]) - $maxprint);
1622
+                    print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action='.$action.'&maxprint=0&month='.$monthshown.'&year='.$year;
1623
+                    print ($status ? '&status='.$status : '').($filter ? '&filter='.$filter : '');
1624
+                    print ($filtert ? '&filtert='.$filtert : '');
1625
+                    print ($usergroup ? '&usergroup='.$usergroup : '');
1626
+                    print ($actioncode != '' ? '&actioncode='.$actioncode : '');
1627
+                    print '">'.img_picto("all", "1downarrow_selected.png").' ...';
1628
+                    print ' +'.(count($eventarray[$daykey]) - $maxprint);
1629 1629
                     print '</a>';
1630 1630
                     break;
1631 1631
                     //$ok=false;        // To avoid to show twice the link
@@ -1639,26 +1639,26 @@  discard block
 block discarded – undo
1639 1639
         print '&nbsp;';
1640 1640
 
1641 1641
     if (!empty($conf->global->MAIN_JS_SWITCH_AGENDA) && $i > $maxprint && $maxprint) {
1642
-        print '<div id="more_' . $ymd . '">' . img_picto("all", "1downarrow_selected.png") . ' +' . $langs->trans("More") . '...</div>';
1642
+        print '<div id="more_'.$ymd.'">'.img_picto("all", "1downarrow_selected.png").' +'.$langs->trans("More").'...</div>';
1643 1643
         //print ' +'.(count($eventarray[$daykey])-$maxprint);
1644
-        print '<script type="text/javascript">' . "\n";
1645
-        print 'jQuery(document).ready(function () {' . "\n";
1646
-        print 'jQuery("#more_' . $ymd . '").click(function() { reinit_day_' . $ymd . '(); });' . "\n";
1644
+        print '<script type="text/javascript">'."\n";
1645
+        print 'jQuery(document).ready(function () {'."\n";
1646
+        print 'jQuery("#more_'.$ymd.'").click(function() { reinit_day_'.$ymd.'(); });'."\n";
1647 1647
 
1648
-        print 'function reinit_day_' . $ymd . '() {' . "\n";
1649
-        print 'var nb=0;' . "\n";
1648
+        print 'function reinit_day_'.$ymd.'() {'."\n";
1649
+        print 'var nb=0;'."\n";
1650 1650
         // TODO Loop on each element of day $ymd and start to toggle once $maxprint has been reached
1651
-        print 'jQuery(".family_mytasks_day_' . $ymd . '").toggle();';
1652
-        print '}' . "\n";
1651
+        print 'jQuery(".family_mytasks_day_'.$ymd.'").toggle();';
1652
+        print '}'."\n";
1653 1653
 
1654
-        print '});' . "\n";
1654
+        print '});'."\n";
1655 1655
 
1656
-        print '</script>' . "\n";
1656
+        print '</script>'."\n";
1657 1657
     }
1658 1658
 
1659
-    print '</div></div>';       // td tr
1659
+    print '</div></div>'; // td tr
1660 1660
 
1661
-    print '</div>';             // table
1661
+    print '</div>'; // table
1662 1662
     print "\n";
1663 1663
 }
1664 1664
 
Please login to merge, or discard this patch.
dolibarr/htdocs/admin/dict.php 1 patch
Spacing   +263 added lines, -263 removed lines patch added patch discarded remove patch
@@ -26,24 +26,24 @@  discard block
 block discarded – undo
26 26
  * You should have received a copy of the GNU General Public License
27 27
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 28
  */
29
-require_once DOL_BASE_PATH . '/core/lib/functions2.lib.php';
29
+require_once DOL_BASE_PATH.'/core/lib/functions2.lib.php';
30 30
 
31 31
 /**
32 32
  * 	    \file       htdocs/admin/dict.php
33 33
  * 		\ingroup    setup
34 34
  * 		\brief      Page to administer data tables
35 35
  */
36
-require DOL_BASE_PATH . '/main.inc.php';
36
+require DOL_BASE_PATH.'/main.inc.php';
37 37
 
38
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php';
39
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
40
-require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
41
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
42
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
43
-require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
38
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
39
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
40
+require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
41
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
42
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
44 44
 
45 45
 if (!empty($conf->accounting->enabled)) {
46
-    require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
46
+    require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
47 47
 }
48 48
 
49 49
 // Load translation files required by the page
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 
59 59
 $allowed = $user->admin;
60 60
 if ($id == 7 && !empty($user->rights->accounting->chartofaccount)) {
61
-    $allowed = 1;     // Tax page allowed to manager of chart account
61
+    $allowed = 1; // Tax page allowed to manager of chart account
62 62
 }if ($id == 10 && !empty($user->rights->accounting->chartofaccount)) {
63
-    $allowed = 1;    // Vat page allowed to manager of chart account
63
+    $allowed = 1; // Vat page allowed to manager of chart account
64 64
 }if ($id == 17 && !empty($user->rights->accounting->chartofaccount)) {
65
-    $allowed = 1;    // Dictionary with type of expense report and accounting account allowed to manager of chart account
65
+    $allowed = 1; // Dictionary with type of expense report and accounting account allowed to manager of chart account
66 66
 }if (!$allowed) {
67 67
     accessforbidden();
68 68
 }
@@ -102,42 +102,42 @@  discard block
 block discarded – undo
102 102
 
103 103
 // Name of SQL tables of dictionaries
104 104
 $tabname = array();
105
-$tabname[1] = MAIN_DB_PREFIX . "c_forme_juridique";
106
-$tabname[2] = MAIN_DB_PREFIX . "c_departements";
107
-$tabname[3] = MAIN_DB_PREFIX . "c_regions";
108
-$tabname[4] = MAIN_DB_PREFIX . "c_country";
109
-$tabname[5] = MAIN_DB_PREFIX . "c_civility";
110
-$tabname[6] = MAIN_DB_PREFIX . "c_actioncomm";
111
-$tabname[7] = MAIN_DB_PREFIX . "c_chargesociales";
112
-$tabname[8] = MAIN_DB_PREFIX . "c_typent";
113
-$tabname[9] = MAIN_DB_PREFIX . "c_currencies";
114
-$tabname[10] = MAIN_DB_PREFIX . "c_tva";
115
-$tabname[11] = MAIN_DB_PREFIX . "c_type_contact";
116
-$tabname[12] = MAIN_DB_PREFIX . "c_payment_term";
117
-$tabname[13] = MAIN_DB_PREFIX . "c_paiement";
118
-$tabname[14] = MAIN_DB_PREFIX . "c_ecotaxe";
119
-$tabname[15] = MAIN_DB_PREFIX . "c_paper_format";
120
-$tabname[16] = MAIN_DB_PREFIX . "c_prospectlevel";
121
-$tabname[17] = MAIN_DB_PREFIX . "c_type_fees";
122
-$tabname[18] = MAIN_DB_PREFIX . "c_shipment_mode";
123
-$tabname[19] = MAIN_DB_PREFIX . "c_effectif";
124
-$tabname[20] = MAIN_DB_PREFIX . "c_input_method";
125
-$tabname[21] = MAIN_DB_PREFIX . "c_availability";
126
-$tabname[22] = MAIN_DB_PREFIX . "c_input_reason";
127
-$tabname[23] = MAIN_DB_PREFIX . "c_revenuestamp";
128
-$tabname[24] = MAIN_DB_PREFIX . "c_type_resource";
129
-$tabname[25] = MAIN_DB_PREFIX . "c_type_container";
130
-$tabname[26] = MAIN_DB_PREFIX . "c_units";
131
-$tabname[27] = MAIN_DB_PREFIX . "c_stcomm";
132
-$tabname[28] = MAIN_DB_PREFIX . "c_holiday_types";
133
-$tabname[29] = MAIN_DB_PREFIX . "c_lead_status";
134
-$tabname[30] = MAIN_DB_PREFIX . "c_format_cards";
105
+$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
106
+$tabname[2] = MAIN_DB_PREFIX."c_departements";
107
+$tabname[3] = MAIN_DB_PREFIX."c_regions";
108
+$tabname[4] = MAIN_DB_PREFIX."c_country";
109
+$tabname[5] = MAIN_DB_PREFIX."c_civility";
110
+$tabname[6] = MAIN_DB_PREFIX."c_actioncomm";
111
+$tabname[7] = MAIN_DB_PREFIX."c_chargesociales";
112
+$tabname[8] = MAIN_DB_PREFIX."c_typent";
113
+$tabname[9] = MAIN_DB_PREFIX."c_currencies";
114
+$tabname[10] = MAIN_DB_PREFIX."c_tva";
115
+$tabname[11] = MAIN_DB_PREFIX."c_type_contact";
116
+$tabname[12] = MAIN_DB_PREFIX."c_payment_term";
117
+$tabname[13] = MAIN_DB_PREFIX."c_paiement";
118
+$tabname[14] = MAIN_DB_PREFIX."c_ecotaxe";
119
+$tabname[15] = MAIN_DB_PREFIX."c_paper_format";
120
+$tabname[16] = MAIN_DB_PREFIX."c_prospectlevel";
121
+$tabname[17] = MAIN_DB_PREFIX."c_type_fees";
122
+$tabname[18] = MAIN_DB_PREFIX."c_shipment_mode";
123
+$tabname[19] = MAIN_DB_PREFIX."c_effectif";
124
+$tabname[20] = MAIN_DB_PREFIX."c_input_method";
125
+$tabname[21] = MAIN_DB_PREFIX."c_availability";
126
+$tabname[22] = MAIN_DB_PREFIX."c_input_reason";
127
+$tabname[23] = MAIN_DB_PREFIX."c_revenuestamp";
128
+$tabname[24] = MAIN_DB_PREFIX."c_type_resource";
129
+$tabname[25] = MAIN_DB_PREFIX."c_type_container";
130
+$tabname[26] = MAIN_DB_PREFIX."c_units";
131
+$tabname[27] = MAIN_DB_PREFIX."c_stcomm";
132
+$tabname[28] = MAIN_DB_PREFIX."c_holiday_types";
133
+$tabname[29] = MAIN_DB_PREFIX."c_lead_status";
134
+$tabname[30] = MAIN_DB_PREFIX."c_format_cards";
135 135
 //$tabname[31]= MAIN_DB_PREFIX."accounting_system";
136 136
 //$tabname[32]= MAIN_DB_PREFIX."c_accounting_category";
137
-$tabname[33] = MAIN_DB_PREFIX . "c_hrm_department";
138
-$tabname[34] = MAIN_DB_PREFIX . "c_hrm_function";
139
-$tabname[35] = MAIN_DB_PREFIX . "c_exp_tax_cat";
140
-$tabname[36] = MAIN_DB_PREFIX . "c_exp_tax_range";
137
+$tabname[33] = MAIN_DB_PREFIX."c_hrm_department";
138
+$tabname[34] = MAIN_DB_PREFIX."c_hrm_function";
139
+$tabname[35] = MAIN_DB_PREFIX."c_exp_tax_cat";
140
+$tabname[36] = MAIN_DB_PREFIX."c_exp_tax_range";
141 141
 
142 142
 // Dictionary labels
143 143
 $tablib = array();
@@ -180,42 +180,42 @@  discard block
 block discarded – undo
180 180
 
181 181
 // Requests to extract data
182 182
 $tabsql = array();
183
-$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM " . MAIN_DB_PREFIX . "c_forme_juridique as f, " . MAIN_DB_PREFIX . "c_country as c WHERE f.fk_pays=c.rowid";
184
-$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, c.code as country_code, c.label as country, d.active FROM " . MAIN_DB_PREFIX . "c_departements as d, " . MAIN_DB_PREFIX . "c_regions as r, " . MAIN_DB_PREFIX . "c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1";
185
-$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM " . MAIN_DB_PREFIX . "c_regions as r, " . MAIN_DB_PREFIX . "c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
186
-$tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite FROM " . MAIN_DB_PREFIX . "c_country AS c";
187
-$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM " . MAIN_DB_PREFIX . "c_civility AS c";
188
-$tabsql[6] = "SELECT a.id    as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM " . MAIN_DB_PREFIX . "c_actioncomm AS a";
189
-$tabsql[7] = "SELECT a.id    as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM " . MAIN_DB_PREFIX . "c_chargesociales AS a, " . MAIN_DB_PREFIX . "c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
190
-$tabsql[8] = "SELECT t.id	 as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.active FROM " . MAIN_DB_PREFIX . "c_typent as t LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON t.fk_country=c.rowid";
191
-$tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM " . MAIN_DB_PREFIX . "c_currencies AS c";
192
-$tabsql[10] = "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM " . MAIN_DB_PREFIX . "c_tva as t, " . MAIN_DB_PREFIX . "c_country as c WHERE t.fk_pays=c.rowid";
193
-$tabsql[11] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM " . MAIN_DB_PREFIX . "c_type_contact AS t";
194
-$tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM " . MAIN_DB_PREFIX . "c_payment_term AS c WHERE c.entity = " . getEntity($tabname[12]);
195
-$tabsql[13] = "SELECT c.id    as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM " . MAIN_DB_PREFIX . "c_paiement AS c WHERE c.entity = " . getEntity($tabname[13]);
196
-$tabsql[14] = "SELECT e.rowid as rowid, e.code as code, e.label, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM " . MAIN_DB_PREFIX . "c_ecotaxe AS e, " . MAIN_DB_PREFIX . "c_country as c WHERE e.fk_pays=c.rowid and c.active=1";
197
-$tabsql[15] = "SELECT rowid   as rowid, code, label as libelle, width, height, unit, active FROM " . MAIN_DB_PREFIX . "c_paper_format";
198
-$tabsql[16] = "SELECT code, label as libelle, sortorder, active FROM " . MAIN_DB_PREFIX . "c_prospectlevel";
199
-$tabsql[17] = "SELECT id      as rowid, code, label, accountancy_code, active FROM " . MAIN_DB_PREFIX . "c_type_fees";
200
-$tabsql[18] = "SELECT rowid   as rowid, code, libelle, tracking, active FROM " . MAIN_DB_PREFIX . "c_shipment_mode";
201
-$tabsql[19] = "SELECT id      as rowid, code, libelle, active FROM " . MAIN_DB_PREFIX . "c_effectif";
202
-$tabsql[20] = "SELECT rowid   as rowid, code, libelle, active FROM " . MAIN_DB_PREFIX . "c_input_method";
203
-$tabsql[21] = "SELECT c.rowid as rowid, code, label, active FROM " . MAIN_DB_PREFIX . "c_availability AS c";
204
-$tabsql[22] = "SELECT rowid   as rowid, code, label, active FROM " . MAIN_DB_PREFIX . "c_input_reason";
205
-$tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM " . MAIN_DB_PREFIX . "c_revenuestamp as t, " . MAIN_DB_PREFIX . "c_country as c WHERE t.fk_pays=c.rowid";
206
-$tabsql[24] = "SELECT rowid   as rowid, code, label, active FROM " . MAIN_DB_PREFIX . "c_type_resource";
207
-$tabsql[25] = "SELECT rowid   as rowid, code, label, active, module FROM " . MAIN_DB_PREFIX . "c_type_container as t WHERE t.entity IN (" . getEntity('c_type_container') . ")";
208
-$tabsql[26] = "SELECT rowid   as rowid, code, label, short_label, active FROM " . MAIN_DB_PREFIX . "c_units";
209
-$tabsql[27] = "SELECT id      as rowid, code, libelle, active FROM " . MAIN_DB_PREFIX . "c_stcomm";
210
-$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM " . MAIN_DB_PREFIX . "c_holiday_types as h LEFT JOIN " . MAIN_DB_PREFIX . "c_country as c ON h.fk_country=c.rowid";
211
-$tabsql[29] = "SELECT rowid   as rowid, code, label, percent, position, active FROM " . MAIN_DB_PREFIX . "c_lead_status";
212
-$tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM " . MAIN_DB_PREFIX . "c_format_cards";
183
+$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c WHERE f.fk_pays=c.rowid";
184
+$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, c.code as country_code, c.label as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1";
185
+$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
186
+$tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite FROM ".MAIN_DB_PREFIX."c_country AS c";
187
+$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
188
+$tabsql[6] = "SELECT a.id    as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
189
+$tabsql[7] = "SELECT a.id    as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
190
+$tabsql[8] = "SELECT t.id	 as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.position, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid";
191
+$tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c";
192
+$tabsql[10] = "SELECT t.rowid, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
193
+$tabsql[11] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
194
+$tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = ".getEntity($tabname[12]);
195
+$tabsql[13] = "SELECT c.id    as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = ".getEntity($tabname[13]);
196
+$tabsql[14] = "SELECT e.rowid as rowid, e.code as code, e.label, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1";
197
+$tabsql[15] = "SELECT rowid   as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
198
+$tabsql[16] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
199
+$tabsql[17] = "SELECT id      as rowid, code, label, accountancy_code, active FROM ".MAIN_DB_PREFIX."c_type_fees";
200
+$tabsql[18] = "SELECT rowid   as rowid, code, libelle, tracking, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
201
+$tabsql[19] = "SELECT id      as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif";
202
+$tabsql[20] = "SELECT rowid   as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_input_method";
203
+$tabsql[21] = "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c";
204
+$tabsql[22] = "SELECT rowid   as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
205
+$tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
206
+$tabsql[24] = "SELECT rowid   as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
207
+$tabsql[25] = "SELECT rowid   as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
208
+$tabsql[26] = "SELECT rowid   as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
209
+$tabsql[27] = "SELECT id      as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
210
+$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
211
+$tabsql[29] = "SELECT rowid   as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
212
+$tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
213 213
 //$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
214 214
 //$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
215
-$tabsql[33] = "SELECT rowid, pos, code, label, active FROM " . MAIN_DB_PREFIX . "c_hrm_department";
216
-$tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM " . MAIN_DB_PREFIX . "c_hrm_function";
217
-$tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM " . MAIN_DB_PREFIX . "c_exp_tax_cat c";
218
-$tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM " . MAIN_DB_PREFIX . "c_exp_tax_range r";
215
+$tabsql[33] = "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department";
216
+$tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function";
217
+$tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
218
+$tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r";
219 219
 
220 220
 // Criteria to sort dictionaries
221 221
 $tabsqlsort = array();
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 $tabsqlsort[5] = "label ASC";
227 227
 $tabsqlsort[6] = "a.type ASC, a.module ASC, a.position ASC, a.code ASC";
228 228
 $tabsqlsort[7] = "country ASC, code ASC, a.libelle ASC";
229
-$tabsqlsort[8] = "country DESC," . (!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ' t.position ASC,' : '') . " libelle ASC";
229
+$tabsqlsort[8] = "country DESC,".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ' t.position ASC,' : '')." libelle ASC";
230 230
 $tabsqlsort[9] = "label ASC";
231 231
 $tabsqlsort[10] = "country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
232 232
 $tabsqlsort[11] = "t.element ASC, t.source ASC, t.position ASC, t.code ASC";
@@ -259,13 +259,13 @@  discard block
 block discarded – undo
259 259
 // Nom des champs en resultat de select pour affichage du dictionnaire
260 260
 $tabfield = array();
261 261
 $tabfield[1] = "code,libelle,country";
262
-$tabfield[2] = "code,libelle,region_id,region,country";   // "code,libelle,region,country_code-country"
262
+$tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,region,country_code-country"
263 263
 $tabfield[3] = "code,libelle,country_id,country";
264 264
 $tabfield[4] = "code,label";
265 265
 $tabfield[5] = "code,label";
266 266
 $tabfield[6] = "code,libelle,type,color,position";
267 267
 $tabfield[7] = "code,libelle,country,accountancy_code,deductible";
268
-$tabfield[8] = "code,libelle,country_id,country" . (!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ',position' : '');
268
+$tabfield[8] = "code,libelle,country_id,country".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ',position' : '');
269 269
 $tabfield[9] = "code,label,unicode";
270 270
 $tabfield[10] = "country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
271 271
 $tabfield[11] = "element,source,code,libelle,position";
@@ -298,13 +298,13 @@  discard block
 block discarded – undo
298 298
 // Nom des champs d'edition pour modification d'un enregistrement
299 299
 $tabfieldvalue = array();
300 300
 $tabfieldvalue[1] = "code,libelle,country";
301
-$tabfieldvalue[2] = "code,libelle,region";   // "code,libelle,region"
301
+$tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region"
302 302
 $tabfieldvalue[3] = "code,libelle,country";
303 303
 $tabfieldvalue[4] = "code,label";
304 304
 $tabfieldvalue[5] = "code,label";
305 305
 $tabfieldvalue[6] = "code,libelle,type,color,position";
306 306
 $tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
307
-$tabfieldvalue[8] = "code,libelle,country" . (!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ',position' : '');
307
+$tabfieldvalue[8] = "code,libelle,country".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ',position' : '');
308 308
 $tabfieldvalue[9] = "code,label,unicode";
309 309
 $tabfieldvalue[10] = "country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
310 310
 $tabfieldvalue[11] = "element,source,code,libelle,position";
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 $tabfieldinsert[5] = "code,label";
344 344
 $tabfieldinsert[6] = "code,libelle,type,color,position";
345 345
 $tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible";
346
-$tabfieldinsert[8] = "code,libelle,fk_country" . (!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ',position' : '');
346
+$tabfieldinsert[8] = "code,libelle,fk_country".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ',position' : '');
347 347
 $tabfieldinsert[9] = "code_iso,label,unicode";
348 348
 $tabfieldinsert[10] = "fk_pays,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note";
349 349
 $tabfieldinsert[11] = "element,source,code,libelle,position";
@@ -585,12 +585,12 @@  discard block
 block discarded – undo
585 585
 if ($id == 10) {
586 586
     $localtax_typeList = array(
587 587
         "0" => $langs->trans("No"),
588
-        "1" => $langs->trans("Yes") . ' (' . $langs->trans("Type") . " 1)", //$langs->trans("%ageOnAllWithoutVAT"),
589
-        "2" => $langs->trans("Yes") . ' (' . $langs->trans("Type") . " 2)", //$langs->trans("%ageOnAllBeforeVAT"),
590
-        "3" => $langs->trans("Yes") . ' (' . $langs->trans("Type") . " 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
591
-        "4" => $langs->trans("Yes") . ' (' . $langs->trans("Type") . " 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
592
-        "5" => $langs->trans("Yes") . ' (' . $langs->trans("Type") . " 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
593
-        "6" => $langs->trans("Yes") . ' (' . $langs->trans("Type") . " 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
588
+        "1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"),
589
+        "2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"),
590
+        "3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
591
+        "4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
592
+        "5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
593
+        "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
594 594
     );
595 595
 }
596 596
 
@@ -616,9 +616,9 @@  discard block
 block discarded – undo
616 616
     $ok = 1;
617 617
     foreach ($listfield as $f => $value) {
618 618
         if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryVAT', 'DictionaryRegion', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp', 'DictionaryAccountancysystem', 'DictionaryAccountancyCategory')))
619
-            continue;  // For some pages, country is not mandatory
619
+            continue; // For some pages, country is not mandatory
620 620
         if ($value == 'country' && in_array($tablib[$id], array('DictionaryCanton', 'DictionaryCompanyType', 'DictionaryRevenueStamp')))
621
-            continue;  // For some pages, country is not mandatory
621
+            continue; // For some pages, country is not mandatory
622 622
         if ($value == 'localtax1' && empty($_POST['localtax1_type']))
623 623
             continue;
624 624
         if ($value == 'localtax2' && empty($_POST['localtax2_type']))
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
         if ($value == 'formula' && empty($_POST['formula']))
629 629
             continue;
630 630
         if ($value == 'sortorder')
631
-            continue;  // For a column name 'sortorder', we use the field name 'position'
631
+            continue; // For a column name 'sortorder', we use the field name 'position'
632 632
         if ((!isset($_POST[$value]) || $_POST[$value] == '') && (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking'))  // Fields that are not mandatory
633 633
             && (!($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
634 634
             )
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
         }
672 672
     }
673 673
     // Other checks
674
-    if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX . "c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"], array('system', 'systemauto'))) {
674
+    if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"], array('system', 'systemauto'))) {
675 675
         $ok = 0;
676 676
         setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
677 677
     }
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
         if ($tabrowid[$id]) {
720 720
             // Recupere id libre pour insertion
721 721
             $newid = 0;
722
-            $sql = "SELECT max(" . $tabrowid[$id] . ") newid from " . $tabname[$id];
722
+            $sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
723 723
             $result = $db->query($sql);
724 724
             if ($result) {
725 725
                 $obj = $db->fetch_object($result);
@@ -730,17 +730,17 @@  discard block
 block discarded – undo
730 730
         }
731 731
 
732 732
         // Add new entry
733
-        $sql = "INSERT INTO " . $tabname[$id] . " (";
733
+        $sql = "INSERT INTO ".$tabname[$id]." (";
734 734
         // List of fields
735 735
         if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert))
736
-            $sql .= $tabrowid[$id] . ",";
736
+            $sql .= $tabrowid[$id].",";
737 737
         $sql .= $tabfieldinsert[$id];
738 738
         $sql .= ",active)";
739 739
         $sql .= " VALUES(";
740 740
 
741 741
         // List of values
742 742
         if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert))
743
-            $sql .= $newid . ",";
743
+            $sql .= $newid.",";
744 744
         $i = 0;
745 745
         foreach ($listfieldinsert as $f => $value) {
746 746
             if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') {
@@ -751,11 +751,11 @@  discard block
 block discarded – undo
751 751
             if ($i)
752 752
                 $sql .= ",";
753 753
             if ($listfieldvalue[$i] == 'sortorder') {  // For column name 'sortorder', we use the field name 'position'
754
-                $sql .= "'" . (int) $db->escape($_POST['position']) . "'";
754
+                $sql .= "'".(int) $db->escape($_POST['position'])."'";
755 755
             } elseif ($_POST[$listfieldvalue[$i]] == '' && !($listfieldvalue[$i] == 'code' && $id == 10))
756
-                $sql .= "null";  // For vat, we want/accept code = ''
756
+                $sql .= "null"; // For vat, we want/accept code = ''
757 757
             else
758
-                $sql .= "'" . $db->escape($_POST[$listfieldvalue[$i]]) . "'";
758
+                $sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
759 759
             $i++;
760 760
         }
761 761
         $sql .= ",1)";
@@ -783,11 +783,11 @@  discard block
 block discarded – undo
783 783
         }
784 784
 
785 785
         // Modify entry
786
-        $sql = "UPDATE " . $tabname[$id] . " SET ";
786
+        $sql = "UPDATE ".$tabname[$id]." SET ";
787 787
         // Modifie valeur des champs
788 788
         if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
789
-            $sql .= $tabrowid[$id] . "=";
790
-            $sql .= "'" . $db->escape($rowid) . "', ";
789
+            $sql .= $tabrowid[$id]."=";
790
+            $sql .= "'".$db->escape($rowid)."', ";
791 791
         }
792 792
         $i = 0;
793 793
         foreach ($listfieldmodify as $field) {
@@ -798,18 +798,18 @@  discard block
 block discarded – undo
798 798
             }
799 799
             if ($i)
800 800
                 $sql .= ",";
801
-            $sql .= $field . "=";
801
+            $sql .= $field."=";
802 802
             if ($listfieldvalue[$i] == 'sortorder') {  // For column name 'sortorder', we use the field name 'position'
803
-                $sql .= "'" . (int) $db->escape($_POST['position']) . "'";
803
+                $sql .= "'".(int) $db->escape($_POST['position'])."'";
804 804
             } elseif ($_POST[$listfieldvalue[$i]] == '' && !($listfieldvalue[$i] == 'code' && $id == 10))
805
-                $sql .= "null";  // For vat, we want/accept code = ''
805
+                $sql .= "null"; // For vat, we want/accept code = ''
806 806
             else
807
-                $sql .= "'" . $db->escape($_POST[$listfieldvalue[$i]]) . "'";
807
+                $sql .= "'".$db->escape($_POST[$listfieldvalue[$i]])."'";
808 808
             $i++;
809 809
         }
810
-        $sql .= " WHERE " . $rowidcol . " = '" . $rowid . "'";
810
+        $sql .= " WHERE ".$rowidcol." = '".$rowid."'";
811 811
         if (in_array('entity', $listfieldmodify))
812
-            $sql .= " AND entity = '" . getEntity($tabname[$id]) . "'";
812
+            $sql .= " AND entity = '".getEntity($tabname[$id])."'";
813 813
 
814 814
         dol_syslog("actionmodify", LOG_DEBUG);
815 815
         //print $sql;
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
         $rowidcol = "rowid";
833 833
     }
834 834
 
835
-    $sql = "DELETE FROM " . $tabname[$id] . " WHERE " . $rowidcol . "='" . $rowid . "'" . ($entity != '' ? " AND entity = " . (int) $entity : '');
835
+    $sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = ".(int) $entity : '');
836 836
 
837 837
     dol_syslog("delete", LOG_DEBUG);
838 838
     $result = $db->query($sql);
@@ -854,9 +854,9 @@  discard block
 block discarded – undo
854 854
     }
855 855
 
856 856
     if ($rowid) {
857
-        $sql = "UPDATE " . $tabname[$id] . " SET active = 1 WHERE " . $rowidcol . "='" . $rowid . "'" . ($entity != '' ? " AND entity = " . (int) $entity : '');
857
+        $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = ".(int) $entity : '');
858 858
     } elseif ($code) {
859
-        $sql = "UPDATE " . $tabname[$id] . " SET active = 1 WHERE code='" . dol_escape_htmltag($code) . "'" . ($entity != '' ? " AND entity = " . (int) $entity : '');
859
+        $sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
860 860
     }
861 861
 
862 862
     $result = $db->query($sql);
@@ -874,9 +874,9 @@  discard block
 block discarded – undo
874 874
     }
875 875
 
876 876
     if ($rowid) {
877
-        $sql = "UPDATE " . $tabname[$id] . " SET active = 0 WHERE " . $rowidcol . "='" . $rowid . "'" . ($entity != '' ? " AND entity = " . (int) $entity : '');
877
+        $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = ".(int) $entity : '');
878 878
     } elseif ($code) {
879
-        $sql = "UPDATE " . $tabname[$id] . " SET active = 0 WHERE code='" . dol_escape_htmltag($code) . "'" . ($entity != '' ? " AND entity = " . (int) $entity : '');
879
+        $sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
880 880
     }
881 881
 
882 882
     $result = $db->query($sql);
@@ -894,9 +894,9 @@  discard block
 block discarded – undo
894 894
     }
895 895
 
896 896
     if ($rowid) {
897
-        $sql = "UPDATE " . $tabname[$id] . " SET favorite = 1 WHERE " . $rowidcol . "='" . $rowid . "'" . ($entity != '' ? " AND entity = " . (int) $entity : '');
897
+        $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = ".(int) $entity : '');
898 898
     } elseif ($code) {
899
-        $sql = "UPDATE " . $tabname[$id] . " SET favorite = 1 WHERE code='" . dol_escape_htmltag($code) . "'" . ($entity != '' ? " AND entity = " . (int) $entity : '');
899
+        $sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
900 900
     }
901 901
 
902 902
     $result = $db->query($sql);
@@ -914,9 +914,9 @@  discard block
 block discarded – undo
914 914
     }
915 915
 
916 916
     if ($rowid) {
917
-        $sql = "UPDATE " . $tabname[$id] . " SET favorite = 0 WHERE " . $rowidcol . "='" . $rowid . "'" . ($entity != '' ? " AND entity = " . (int) $entity : '');
917
+        $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = ".(int) $entity : '');
918 918
     } elseif ($code) {
919
-        $sql = "UPDATE " . $tabname[$id] . " SET favorite = 0 WHERE code='" . dol_escape_htmltag($code) . "'" . ($entity != '' ? " AND entity = " . (int) $entity : '');
919
+        $sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
920 920
     }
921 921
 
922 922
     $result = $db->query($sql);
@@ -938,9 +938,9 @@  discard block
 block discarded – undo
938 938
 $titre = $langs->trans("DictionarySetup");
939 939
 $linkback = '';
940 940
 if ($id) {
941
-    $titre .= ' - ' . $langs->trans($tablib[$id]);
941
+    $titre .= ' - '.$langs->trans($tablib[$id]);
942 942
     // $linkback = '<a href="' . $_SERVER['PHP_SELF'] . '">' . $langs->trans("BackToDictionaryList") . '</a>';
943
-    $linkback = '<a href="' . BASE_URI . '?controller=admin&method=dict">' . $langs->trans("BackToDictionaryList") . '</a>';
943
+    $linkback = '<a href="'.BASE_URI.'?controller=admin&method=dict">'.$langs->trans("BackToDictionaryList").'</a>';
944 944
 }
945 945
 $titlepicto = 'title_setup';
946 946
 if ($id == 10 && GETPOST('from') == 'accountancy') {
@@ -956,30 +956,30 @@  discard block
 block discarded – undo
956 956
 
957 957
 if (empty($id)) {
958 958
     print $langs->trans("DictionaryDesc");
959
-    print " " . $langs->trans("OnlyActiveElementsAreShown") . "<br>\n";
959
+    print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
960 960
     print '<br>';
961 961
 }
962 962
 
963 963
 
964
-$param = '&id=' . urlencode($id);
964
+$param = '&id='.urlencode($id);
965 965
 if ($search_country_id > 0)
966
-    $param .= '&search_country_id=' . urlencode($search_country_id);
966
+    $param .= '&search_country_id='.urlencode($search_country_id);
967 967
 if ($search_code != '')
968
-    $param .= '&search_code=' . urlencode($search_country_id);
968
+    $param .= '&search_code='.urlencode($search_country_id);
969 969
 if ($entity != '')
970
-    $param .= '&entity=' . (int) $entity;
970
+    $param .= '&entity='.(int) $entity;
971 971
 $paramwithsearch = $param;
972 972
 if ($sortorder)
973
-    $paramwithsearch .= '&sortorder=' . urlencode($sortorder);
973
+    $paramwithsearch .= '&sortorder='.urlencode($sortorder);
974 974
 if ($sortfield)
975
-    $paramwithsearch .= '&sortfield=' . urlencode($sortfield);
975
+    $paramwithsearch .= '&sortfield='.urlencode($sortfield);
976 976
 if (GETPOST('from'))
977
-    $paramwithsearch .= '&from=' . urlencode(GETPOST('from', 'alpha'));
977
+    $paramwithsearch .= '&from='.urlencode(GETPOST('from', 'alpha'));
978 978
 
979 979
 
980 980
 // Confirmation de la suppression de la ligne
981 981
 if ($action == 'delete') {
982
-    print $form->formconfirm($_SERVER["PHP_SELF"] . '?' . ($page ? 'page=' . $page . '&' : '') . 'rowid=' . $rowid . '&code=' . urlencode($code) . $paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
982
+    print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'rowid='.$rowid.'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
983 983
 }
984 984
 //var_dump($elementList);
985 985
 
@@ -993,7 +993,7 @@  discard block
 block discarded – undo
993 993
     if (!preg_match('/ WHERE /', $sql))
994 994
         $sql .= " WHERE 1 = 1";
995 995
     if ($search_country_id > 0)
996
-        $sql .= " AND c.rowid = " . $search_country_id;
996
+        $sql .= " AND c.rowid = ".$search_country_id;
997 997
     if ($search_code != '' && $id != 9)
998 998
         $sql .= natural_search("code", $search_code);
999 999
     if ($search_code != '' && $id == 9)
@@ -1003,14 +1003,14 @@  discard block
 block discarded – undo
1003 1003
         // If sort order is "country", we use country_code instead
1004 1004
         if ($sortfield == 'country')
1005 1005
             $sortfield = 'country_code';
1006
-        $sql .= " ORDER BY " . $db->escape($sortfield);
1006
+        $sql .= " ORDER BY ".$db->escape($sortfield);
1007 1007
         if ($sortorder) {
1008
-            $sql .= " " . strtoupper($db->escape($sortorder));
1008
+            $sql .= " ".strtoupper($db->escape($sortorder));
1009 1009
         }
1010 1010
         $sql .= ", ";
1011 1011
         // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value
1012
-        $tabsqlsort[$id] = preg_replace('/([a-z]+\.)?' . $sortfield . ' ' . $sortorder . ',/i', '', $tabsqlsort[$id]);
1013
-        $tabsqlsort[$id] = preg_replace('/([a-z]+\.)?' . $sortfield . ',/i', '', $tabsqlsort[$id]);
1012
+        $tabsqlsort[$id] = preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i', '', $tabsqlsort[$id]);
1013
+        $tabsqlsort[$id] = preg_replace('/([a-z]+\.)?'.$sortfield.',/i', '', $tabsqlsort[$id]);
1014 1014
     } else {
1015 1015
         $sql .= " ORDER BY ";
1016 1016
     }
@@ -1019,15 +1019,15 @@  discard block
 block discarded – undo
1019 1019
     //print $sql;
1020 1020
 
1021 1021
     if (empty($tabfield[$id])) {
1022
-        dol_print_error($db, 'The table with id ' . $id . ' has no array tabfield defined');
1022
+        dol_print_error($db, 'The table with id '.$id.' has no array tabfield defined');
1023 1023
         exit;
1024 1024
     }
1025 1025
     $fieldlist = explode(',', $tabfield[$id]);
1026 1026
 
1027 1027
     // print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
1028
-    print '<form href="' . BASE_URI . '?controller=admin&method=dict&id=' . $id . '" method="POST">';
1029
-    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
1030
-    print '<input type="hidden" name="from" value="' . dol_escape_htmltag(GETPOST('from', 'alpha')) . '">';
1028
+    print '<form href="'.BASE_URI.'?controller=admin&method=dict&id='.$id.'" method="POST">';
1029
+    print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
1030
+    print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
1031 1031
 
1032 1032
     if ($id == 10 && empty($conf->global->FACTURE_TVAOPTION)) {
1033 1033
         print info_admin($langs->trans("VATIsUsedIsOff", $langs->transnoentities("Setup"), $langs->transnoentities("CompanyFoundation")));
@@ -1055,8 +1055,8 @@  discard block
 block discarded – undo
1055 1055
 
1056 1056
             // Determine le nom du champ par rapport aux noms possibles
1057 1057
             // dans les dictionnaires de donnees
1058
-            $valuetoshow = ucfirst($fieldlist[$field]);   // Par defaut
1059
-            $valuetoshow = $langs->trans($valuetoshow);   // try to translate
1058
+            $valuetoshow = ucfirst($fieldlist[$field]); // Par defaut
1059
+            $valuetoshow = $langs->trans($valuetoshow); // try to translate
1060 1060
             $class = '';
1061 1061
             if ($fieldlist[$field] == 'source') {
1062 1062
                 $valuetoshow = $langs->trans("Contact");
@@ -1065,28 +1065,28 @@  discard block
 block discarded – undo
1065 1065
                 $valuetoshow = $langs->trans("PriceUHT");
1066 1066
             }
1067 1067
             if ($fieldlist[$field] == 'taux') {
1068
-                if ($tabname[$id] != MAIN_DB_PREFIX . "c_revenuestamp")
1068
+                if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp")
1069 1069
                     $valuetoshow = $langs->trans("Rate");
1070 1070
                 else
1071 1071
                     $valuetoshow = $langs->trans("Amount");
1072 1072
                 $class = 'center';
1073 1073
             }
1074 1074
             if ($fieldlist[$field] == 'localtax1_type') {
1075
-                $valuetoshow = $langs->trans("UseLocalTax") . " 2";
1075
+                $valuetoshow = $langs->trans("UseLocalTax")." 2";
1076 1076
                 $class = "center";
1077 1077
                 $sortable = 0;
1078 1078
             }
1079 1079
             if ($fieldlist[$field] == 'localtax1') {
1080
-                $valuetoshow = $langs->trans("Rate") . " 2";
1080
+                $valuetoshow = $langs->trans("Rate")." 2";
1081 1081
                 $class = "center";
1082 1082
             }
1083 1083
             if ($fieldlist[$field] == 'localtax2_type') {
1084
-                $valuetoshow = $langs->trans("UseLocalTax") . " 3";
1084
+                $valuetoshow = $langs->trans("UseLocalTax")." 3";
1085 1085
                 $class = "center";
1086 1086
                 $sortable = 0;
1087 1087
             }
1088 1088
             if ($fieldlist[$field] == 'localtax2') {
1089
-                $valuetoshow = $langs->trans("Rate") . " 3";
1089
+                $valuetoshow = $langs->trans("Rate")." 3";
1090 1090
                 $class = "center";
1091 1091
             }
1092 1092
             if ($fieldlist[$field] == 'organization') {
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
                 $valuetoshow = $langs->trans("Language");
1097 1097
             }
1098 1098
             if ($fieldlist[$field] == 'type') {
1099
-                if ($tabname[$id] == MAIN_DB_PREFIX . "c_paiement")
1099
+                if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement")
1100 1100
                     $valuetoshow = $form->textwithtooltip($langs->trans("Type"), $langs->trans("TypePaymentDesc"), 2, 1, img_help(1, ''));
1101 1101
                 else
1102 1102
                     $valuetoshow = $langs->trans("Type");
@@ -1241,15 +1241,15 @@  discard block
 block discarded – undo
1241 1241
                     $showfield = 1;
1242 1242
                 }
1243 1243
                 if ($fieldlist[$field] == 'region') {
1244
-                    $valuetoshow = $langs->trans("Country") . '/' . $langs->trans("Region");
1244
+                    $valuetoshow = $langs->trans("Country").'/'.$langs->trans("Region");
1245 1245
                     $showfield = 1;
1246 1246
                 }
1247 1247
             }
1248 1248
 
1249 1249
             if ($valuetoshow != '') {
1250
-                print '<td' . ($class ? ' class="' . $class . '"' : '') . '>';
1250
+                print '<td'.($class ? ' class="'.$class.'"' : '').'>';
1251 1251
                 if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value]))
1252
-                    print '<a href="' . $tabhelp[$id][$value] . '" target="_blank">' . $valuetoshow . ' ' . img_help(1, $valuetoshow) . '</a>';
1252
+                    print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
1253 1253
                 else if (!empty($tabhelp[$id][$value]))
1254 1254
                     print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
1255 1255
                 else
@@ -1263,9 +1263,9 @@  discard block
 block discarded – undo
1263 1263
         if ($id == 4)
1264 1264
             print '<td></td>';
1265 1265
         print '<td>';
1266
-        print '<input type="hidden" name="id" value="' . $id . '">';
1266
+        print '<input type="hidden" name="id" value="'.$id.'">';
1267 1267
         if (!is_null($withentity))
1268
-            print '<input type="hidden" name="entity" value="' . $withentity . '">';
1268
+            print '<input type="hidden" name="entity" value="'.$withentity.'">';
1269 1269
         print '</td>';
1270 1270
         print '<td style="min-width: 26px;"></td>';
1271 1271
         print '<td style="min-width: 26px;"></td>';
@@ -1285,7 +1285,7 @@  discard block
 block discarded – undo
1285 1285
 
1286 1286
         $tmpaction = 'create';
1287 1287
         $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
1288
-        $reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction);    // Note that $action and $object may have been modified by some hooks
1288
+        $reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
1289 1289
         $error = $hookmanager->error;
1290 1290
         $errors = $hookmanager->errors;
1291 1291
 
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
             print '<td></td>';
1301 1301
         print '<td colspan="3" align="center">';
1302 1302
         if ($action != 'edit') {
1303
-            print '<input type="submit" class="button" name="actionadd" value="' . $langs->trans("Add") . '">';
1303
+            print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
1304 1304
         }
1305 1305
         print '</td>';
1306 1306
         print "</tr>";
@@ -1318,9 +1318,9 @@  discard block
 block discarded – undo
1318 1318
     print '<br>';
1319 1319
 
1320 1320
     // print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
1321
-    print '<form href="' . BASE_URI . '?controller=admin&method=dict&id=' . $id . '" method="POST">';
1322
-    print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
1323
-    print '<input type="hidden" name="from" value="' . dol_escape_htmltag(GETPOST('from', 'alpha')) . '">';
1321
+    print '<form href="'.BASE_URI.'?controller=admin&method=dict&id='.$id.'" method="POST">';
1322
+    print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
1323
+    print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from', 'alpha')).'">';
1324 1324
 
1325 1325
     // List of available record in database
1326 1326
     dol_syslog("htdocs/admin/dict", LOG_DEBUG);
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
 
1332 1332
         // There is several pages
1333 1333
         if ($num > $listlimit || $page) {
1334
-            print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>' . $langs->trans("Page") . ' ' . ($page + 1) . '</span></li>');
1334
+            print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>');
1335 1335
             print '<div class="clearboth"></div>';
1336 1336
         }
1337 1337
 
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
                     $filterfound++;
1360 1360
                 } elseif ($value == 'code') {
1361 1361
                     print '<td class="liste_titre">';
1362
-                    print '<input type="text" class="maxwidth100" name="search_code" value="' . dol_escape_htmltag($search_code) . '">';
1362
+                    print '<input type="text" class="maxwidth100" name="search_code" value="'.dol_escape_htmltag($search_code).'">';
1363 1363
                     print '</td>';
1364 1364
                     $filterfound++;
1365 1365
                 } else {
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
 
1388 1388
             // Determine le nom du champ par rapport aux noms possibles
1389 1389
             // dans les dictionnaires de donnees
1390
-            $showfield = 1;          // By defaut
1390
+            $showfield = 1; // By defaut
1391 1391
             $align = "left";
1392 1392
             $sortable = 1;
1393 1393
             $valuetoshow = '';
@@ -1398,8 +1398,8 @@  discard block
 block discarded – undo
1398 1398
               $align=$tmp['align'];
1399 1399
               $sortable=$tmp['sortable'];
1400 1400
              */
1401
-            $valuetoshow = ucfirst($fieldlist[$field]);   // By defaut
1402
-            $valuetoshow = $langs->trans($valuetoshow);   // try to translate
1401
+            $valuetoshow = ucfirst($fieldlist[$field]); // By defaut
1402
+            $valuetoshow = $langs->trans($valuetoshow); // try to translate
1403 1403
             if ($fieldlist[$field] == 'source') {
1404 1404
                 $valuetoshow = $langs->trans("Contact");
1405 1405
             }
@@ -1407,29 +1407,29 @@  discard block
 block discarded – undo
1407 1407
                 $valuetoshow = $langs->trans("PriceUHT");
1408 1408
             }
1409 1409
             if ($fieldlist[$field] == 'taux') {
1410
-                if ($tabname[$id] != MAIN_DB_PREFIX . "c_revenuestamp")
1410
+                if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp")
1411 1411
                     $valuetoshow = $langs->trans("Rate");
1412 1412
                 else
1413 1413
                     $valuetoshow = $langs->trans("Amount");
1414 1414
                 $align = 'center';
1415 1415
             }
1416 1416
             if ($fieldlist[$field] == 'localtax1_type') {
1417
-                $valuetoshow = $langs->trans("UseLocalTax") . " 2";
1417
+                $valuetoshow = $langs->trans("UseLocalTax")." 2";
1418 1418
                 $align = "center";
1419 1419
                 $sortable = 0;
1420 1420
             }
1421 1421
             if ($fieldlist[$field] == 'localtax1') {
1422
-                $valuetoshow = $langs->trans("Rate") . " 2";
1422
+                $valuetoshow = $langs->trans("Rate")." 2";
1423 1423
                 $align = "center";
1424 1424
                 $sortable = 0;
1425 1425
             }
1426 1426
             if ($fieldlist[$field] == 'localtax2_type') {
1427
-                $valuetoshow = $langs->trans("UseLocalTax") . " 3";
1427
+                $valuetoshow = $langs->trans("UseLocalTax")." 3";
1428 1428
                 $align = "center";
1429 1429
                 $sortable = 0;
1430 1430
             }
1431 1431
             if ($fieldlist[$field] == 'localtax2') {
1432
-                $valuetoshow = $langs->trans("Rate") . " 3";
1432
+                $valuetoshow = $langs->trans("Rate")." 3";
1433 1433
                 $align = "center";
1434 1434
                 $sortable = 0;
1435 1435
             }
@@ -1579,14 +1579,14 @@  discard block
 block discarded – undo
1579 1579
 
1580 1580
             // Affiche nom du champ
1581 1581
             if ($showfield) {
1582
-                print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $fieldlist[$field] : ''), ($page ? 'page=' . $page . '&' : ''), $param, "align=" . $align, $sortfield, $sortorder);
1582
+                print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $fieldlist[$field] : ''), ($page ? 'page='.$page.'&' : ''), $param, "align=".$align, $sortfield, $sortorder);
1583 1583
             }
1584 1584
         }
1585 1585
         // Favorite - Only activated on country dictionary
1586 1586
         if ($id == 4)
1587
-            print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page=' . $page . '&' : ''), $param, 'align="center"', $sortfield, $sortorder);
1587
+            print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder);
1588 1588
 
1589
-        print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page=' . $page . '&' : ''), $param, 'align="center"', $sortfield, $sortorder);
1589
+        print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder);
1590 1590
         print getTitleFieldOfList('');
1591 1591
         print getTitleFieldOfList('');
1592 1592
         print '</tr>';
@@ -1596,11 +1596,11 @@  discard block
 block discarded – undo
1596 1596
             while ($i < $num) {
1597 1597
                 $obj = $db->fetch_object($resql);
1598 1598
                 //print_r($obj);
1599
-                print '<tr class="oddeven" id="rowid-' . $obj->rowid . '">';
1599
+                print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
1600 1600
                 if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
1601 1601
                     $tmpaction = 'edit';
1602 1602
                     $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
1603
-                    $reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction);    // Note that $action and $object may have been modified by some hooks
1603
+                    $reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
1604 1604
                     $error = $hookmanager->error;
1605 1605
                     $errors = $hookmanager->errors;
1606 1606
 
@@ -1610,19 +1610,19 @@  discard block
 block discarded – undo
1610 1610
                     }
1611 1611
 
1612 1612
                     print '<td colspan="3" align="center">';
1613
-                    print '<div name="' . (!empty($obj->rowid) ? $obj->rowid : $obj->code) . '"></div>';
1614
-                    print '<input type="hidden" name="page" value="' . $page . '">';
1615
-                    print '<input type="hidden" name="rowid" value="' . $rowid . '">';
1613
+                    print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
1614
+                    print '<input type="hidden" name="page" value="'.$page.'">';
1615
+                    print '<input type="hidden" name="rowid" value="'.$rowid.'">';
1616 1616
                     if (!is_null($withentity))
1617
-                        print '<input type="hidden" name="entity" value="' . $withentity . '">';
1618
-                    print '<input type="submit" class="button" name="actionmodify" value="' . $langs->trans("Modify") . '">';
1619
-                    print '<input type="submit" class="button" name="actioncancel" value="' . $langs->trans("Cancel") . '">';
1617
+                        print '<input type="hidden" name="entity" value="'.$withentity.'">';
1618
+                    print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
1619
+                    print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
1620 1620
                     print '</td>';
1621 1621
                 }
1622 1622
                 else {
1623 1623
                     $tmpaction = 'view';
1624 1624
                     $parameters = array('fieldlist' => $fieldlist, 'tabname' => $tabname[$id]);
1625
-                    $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction);    // Note that $action and $object may have been modified by some hooks
1625
+                    $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
1626 1626
 
1627 1627
                     $error = $hookmanager->error;
1628 1628
                     $errors = $hookmanager->errors;
@@ -1651,8 +1651,8 @@  discard block
 block discarded – undo
1651 1651
                                 if (empty($obj->country_code)) {
1652 1652
                                     $valuetoshow = '-';
1653 1653
                                 } else {
1654
-                                    $key = $langs->trans("Country" . strtoupper($obj->country_code));
1655
-                                    $valuetoshow = ($key != "Country" . strtoupper($obj->country_code) ? $obj->country_code . " - " . $key : $obj->country);
1654
+                                    $key = $langs->trans("Country".strtoupper($obj->country_code));
1655
+                                    $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country);
1656 1656
                                 }
1657 1657
                             } else if ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
1658 1658
                                 $valuetoshow = yn($valuetoshow);
@@ -1673,58 +1673,58 @@  discard block
 block discarded – undo
1673 1673
                                 $valuetoshow = yn($elementList[$valuetoshow]);
1674 1674
                             } else if ($fieldlist[$field] == 'libelle_facture') {
1675 1675
                                 $langs->load("bills");
1676
-                                $key = $langs->trans("PaymentCondition" . strtoupper($obj->code));
1677
-                                $valuetoshow = ($obj->code && $key != "PaymentCondition" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1676
+                                $key = $langs->trans("PaymentCondition".strtoupper($obj->code));
1677
+                                $valuetoshow = ($obj->code && $key != "PaymentCondition".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1678 1678
                                 $valuetoshow = nl2br($valuetoshow);
1679
-                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX . 'c_country') {
1680
-                                $key = $langs->trans("Country" . strtoupper($obj->code));
1681
-                                $valuetoshow = ($obj->code && $key != "Country" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1682
-                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX . 'c_availability') {
1679
+                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_country') {
1680
+                                $key = $langs->trans("Country".strtoupper($obj->code));
1681
+                                $valuetoshow = ($obj->code && $key != "Country".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1682
+                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_availability') {
1683 1683
                                 $langs->load("propal");
1684
-                                $key = $langs->trans("AvailabilityType" . strtoupper($obj->code));
1685
-                                $valuetoshow = ($obj->code && $key != "AvailabilityType" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1686
-                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX . 'c_actioncomm') {
1687
-                                $key = $langs->trans("Action" . strtoupper($obj->code));
1688
-                                $valuetoshow = ($obj->code && $key != "Action" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1689
-                            } else if (!empty($obj->code_iso) && $fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX . 'c_currencies') {
1690
-                                $key = $langs->trans("Currency" . strtoupper($obj->code_iso));
1691
-                                $valuetoshow = ($obj->code_iso && $key != "Currency" . strtoupper($obj->code_iso) ? $key : $obj->{$fieldlist[$field]});
1692
-                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX . 'c_typent') {
1684
+                                $key = $langs->trans("AvailabilityType".strtoupper($obj->code));
1685
+                                $valuetoshow = ($obj->code && $key != "AvailabilityType".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1686
+                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_actioncomm') {
1687
+                                $key = $langs->trans("Action".strtoupper($obj->code));
1688
+                                $valuetoshow = ($obj->code && $key != "Action".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1689
+                            } else if (!empty($obj->code_iso) && $fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_currencies') {
1690
+                                $key = $langs->trans("Currency".strtoupper($obj->code_iso));
1691
+                                $valuetoshow = ($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso) ? $key : $obj->{$fieldlist[$field]});
1692
+                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_typent') {
1693 1693
                                 $key = $langs->trans(strtoupper($obj->code));
1694 1694
                                 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1695
-                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX . 'c_prospectlevel') {
1695
+                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_prospectlevel') {
1696 1696
                                 $key = $langs->trans(strtoupper($obj->code));
1697 1697
                                 $valuetoshow = ($key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1698
-                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX . 'c_civility') {
1699
-                                $key = $langs->trans("Civility" . strtoupper($obj->code));
1700
-                                $valuetoshow = ($obj->code && $key != "Civility" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1701
-                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX . 'c_type_contact') {
1698
+                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_civility') {
1699
+                                $key = $langs->trans("Civility".strtoupper($obj->code));
1700
+                                $valuetoshow = ($obj->code && $key != "Civility".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1701
+                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_contact') {
1702 1702
                                 $langs->load('agenda');
1703
-                                $key = $langs->trans("TypeContact_" . $obj->element . "_" . $obj->source . "_" . strtoupper($obj->code));
1704
-                                $valuetoshow = ($obj->code && $key != "TypeContact_" . $obj->element . "_" . $obj->source . "_" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1705
-                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX . 'c_payment_term') {
1703
+                                $key = $langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
1704
+                                $valuetoshow = ($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1705
+                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_payment_term') {
1706 1706
                                 $langs->load("bills");
1707
-                                $key = $langs->trans("PaymentConditionShort" . strtoupper($obj->code));
1708
-                                $valuetoshow = ($obj->code && $key != "PaymentConditionShort" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1709
-                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX . 'c_paiement') {
1707
+                                $key = $langs->trans("PaymentConditionShort".strtoupper($obj->code));
1708
+                                $valuetoshow = ($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1709
+                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_paiement') {
1710 1710
                                 $langs->load("bills");
1711
-                                $key = $langs->trans("PaymentType" . strtoupper($obj->code));
1712
-                                $valuetoshow = ($obj->code && $key != "PaymentType" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1713
-                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX . 'c_input_reason') {
1714
-                                $key = $langs->trans("DemandReasonType" . strtoupper($obj->code));
1715
-                                $valuetoshow = ($obj->code && $key != "DemandReasonType" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1716
-                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX . 'c_input_method') {
1711
+                                $key = $langs->trans("PaymentType".strtoupper($obj->code));
1712
+                                $valuetoshow = ($obj->code && $key != "PaymentType".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1713
+                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_input_reason') {
1714
+                                $key = $langs->trans("DemandReasonType".strtoupper($obj->code));
1715
+                                $valuetoshow = ($obj->code && $key != "DemandReasonType".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1716
+                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_input_method') {
1717 1717
                                 $langs->load("orders");
1718 1718
                                 $key = $langs->trans($obj->code);
1719 1719
                                 $valuetoshow = ($obj->code && $key != $obj->code) ? $key : $obj->{$fieldlist[$field]};
1720
-                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX . 'c_shipment_mode') {
1720
+                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_shipment_mode') {
1721 1721
                                 $langs->load("sendings");
1722
-                                $key = $langs->trans("SendingMethod" . strtoupper($obj->code));
1723
-                                $valuetoshow = ($obj->code && $key != "SendingMethod" . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1724
-                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX . 'c_paper_format') {
1725
-                                $key = $langs->trans('PaperFormat' . strtoupper($obj->code));
1726
-                                $valuetoshow = ($obj->code && $key != 'PaperFormat' . strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1727
-                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX . 'c_type_fees') {
1722
+                                $key = $langs->trans("SendingMethod".strtoupper($obj->code));
1723
+                                $valuetoshow = ($obj->code && $key != "SendingMethod".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1724
+                            } else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_paper_format') {
1725
+                                $key = $langs->trans('PaperFormat'.strtoupper($obj->code));
1726
+                                $valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
1727
+                            } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') {
1728 1728
                                 $langs->load('trips');
1729 1729
                                 $key = $langs->trans(strtoupper($obj->code));
1730 1730
                                 $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
@@ -1732,15 +1732,15 @@  discard block
 block discarded – undo
1732 1732
                                 $showfield = 0;
1733 1733
                             } else if ($fieldlist[$field] == 'unicode') {
1734 1734
                                 $valuetoshow = $langs->getCurrencySymbol($obj->code, 1);
1735
-                            } else if ($fieldlist[$field] == 'label' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX . 'c_units') {
1735
+                            } else if ($fieldlist[$field] == 'label' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX.'c_units') {
1736 1736
                                 $langs->load("products");
1737 1737
                                 $valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
1738
-                            } else if ($fieldlist[$field] == 'short_label' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX . 'c_units') {
1738
+                            } else if ($fieldlist[$field] == 'short_label' && $tabname[$_GET["id"]] == MAIN_DB_PREFIX.'c_units') {
1739 1739
                                 $langs->load("products");
1740 1740
                                 $valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
1741
-                            } else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX . 'c_paper_format')) {
1742
-                                $key = $langs->trans('SizeUnit' . strtolower($obj->unit));
1743
-                                $valuetoshow = ($obj->code && $key != 'SizeUnit' . strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
1741
+                            } else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format')) {
1742
+                                $key = $langs->trans('SizeUnit'.strtolower($obj->unit));
1743
+                                $valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
1744 1744
                             } else if ($fieldlist[$field] == 'localtax1' || $fieldlist[$field] == 'localtax2') {
1745 1745
                                 $align = "center";
1746 1746
                             } else if ($fieldlist[$field] == 'localtax1_type') {
@@ -1772,9 +1772,9 @@  discard block
 block discarded – undo
1772 1772
                                     }
1773 1773
                                 }
1774 1774
                             } elseif ($fieldlist[$field] == 'fk_c_exp_tax_cat') {
1775
-                                $valuetoshow = getDictvalue(MAIN_DB_PREFIX . 'c_exp_tax_cat', 'label', $valuetoshow);
1775
+                                $valuetoshow = getDictvalue(MAIN_DB_PREFIX.'c_exp_tax_cat', 'label', $valuetoshow);
1776 1776
                                 $valuetoshow = $langs->trans($valuetoshow);
1777
-                            } elseif ($tabname[$id] == MAIN_DB_PREFIX . 'c_exp_tax_cat') {
1777
+                            } elseif ($tabname[$id] == MAIN_DB_PREFIX.'c_exp_tax_cat') {
1778 1778
                                 $valuetoshow = $langs->trans($valuetoshow);
1779 1779
                             }
1780 1780
 
@@ -1793,7 +1793,7 @@  discard block
 block discarded – undo
1793 1793
                                 $class .= ' nowrap';
1794 1794
                             // Show value for field
1795 1795
                             if ($showfield)
1796
-                                print '<!-- ' . $fieldlist[$field] . ' --><td align="' . $align . '" class="' . $class . '">' . $valuetoshow . '</td>';
1796
+                                print '<!-- '.$fieldlist[$field].' --><td align="'.$align.'" class="'.$class.'">'.$valuetoshow.'</td>';
1797 1797
                         }
1798 1798
                     }
1799 1799
 
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
                     $canbemodified = $iserasable;
1825 1825
                     if ($obj->code == 'RECEP')
1826 1826
                         $canbemodified = 1;
1827
-                    if ($tabname[$id] == MAIN_DB_PREFIX . "c_actioncomm")
1827
+                    if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm")
1828 1828
                         $canbemodified = 1;
1829 1829
 
1830 1830
                     // Url
@@ -1833,11 +1833,11 @@  discard block
 block discarded – undo
1833 1833
                     if (empty($rowidcol) || in_array($id, array(6, 7, 8, 13, 17, 19, 27)))
1834 1834
                         $rowidcol = 'rowid';
1835 1835
                     //$url = $_SERVER["PHP_SELF"] . '?' . ($page ? 'page=' . $page . '&' : '') . 'sortfield=' . $sortfield . '&sortorder=' . $sortorder . '&rowid=' . ((!empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0') ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) : '')) . '&code=' . (!empty($obj->code) ? urlencode($obj->code) : '');
1836
-                    $url = BASE_URI . '?controller=admin&method=dict&' . ($page ? 'page=' . $page . '&' : '') . 'sortfield=' . $sortfield . '&sortorder=' . $sortorder . '&rowid=' . ((!empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0') ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) : '')) . '&code=' . (!empty($obj->code) ? urlencode($obj->code) : '');
1836
+                    $url = BASE_URI.'?controller=admin&method=dict&'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((!empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0') ? $obj->{$rowidcol} : (!empty($obj->code) ? urlencode($obj->code) : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
1837 1837
                     if (!empty($param))
1838
-                        $url .= '&' . $param;
1838
+                        $url .= '&'.$param;
1839 1839
                     if (!is_null($withentity))
1840
-                        $url .= '&entity=' . $withentity;
1840
+                        $url .= '&entity='.$withentity;
1841 1841
                     $url .= '&';
1842 1842
 
1843 1843
                     // Favorite
@@ -1845,7 +1845,7 @@  discard block
 block discarded – undo
1845 1845
                     if ($id == 4) {
1846 1846
                         print '<td align="center" class="nowrap">';
1847 1847
                         if ($iserasable)
1848
-                            print '<a href="' . $url . 'action=' . $acts[$obj->favorite] . '_favorite">' . $actl[$obj->favorite] . '</a>';
1848
+                            print '<a href="'.$url.'action='.$acts[$obj->favorite].'_favorite">'.$actl[$obj->favorite].'</a>';
1849 1849
                         else
1850 1850
                             print $langs->trans("AlwaysActive");
1851 1851
                         print '</td>';
@@ -1854,7 +1854,7 @@  discard block
 block discarded – undo
1854 1854
                     // Active
1855 1855
                     print '<td align="center" class="nowrap">';
1856 1856
                     if ($canbedisabled)
1857
-                        print '<a href="' . $url . 'action=' . $acts[$obj->active] . '">' . $actl[$obj->active] . '</a>';
1857
+                        print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
1858 1858
                     else {
1859 1859
                         if (in_array($obj->code, array('AC_OTH', 'AC_OTH_AUTO')))
1860 1860
                             print $langs->trans("AlwaysActive");
@@ -1869,7 +1869,7 @@  discard block
 block discarded – undo
1869 1869
 
1870 1870
                     // Modify link
1871 1871
                     if ($canbemodified)
1872
-                        print '<td align="center"><a class="reposition" href="' . $url . 'action=edit">' . img_edit() . '</a></td>';
1872
+                        print '<td align="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
1873 1873
                     else
1874 1874
                         print '<td>&nbsp;</td>';
1875 1875
 
@@ -1877,7 +1877,7 @@  discard block
 block discarded – undo
1877 1877
                     if ($iserasable) {
1878 1878
                         print '<td align="center">';
1879 1879
                         if ($user->admin)
1880
-                            print '<a href="' . $url . 'action=delete">' . img_delete() . '</a>';
1880
+                            print '<a href="'.$url.'action=delete">'.img_delete().'</a>';
1881 1881
                         //else print '<a href="#">'.img_delete().'</a>';    // Some dictionary can be edited by other profile than admin
1882 1882
                         print '</td>';
1883 1883
                     } else
@@ -1909,8 +1909,8 @@  discard block
 block discarded – undo
1909 1909
     print '<table class="noborder" width="100%">';
1910 1910
     print '<tr class="liste_titre">';
1911 1911
     //print '<td>'.$langs->trans("Module").'</td>';
1912
-    print '<td colspan="2">' . $langs->trans("Dictionary") . '</td>';
1913
-    print '<td>' . $langs->trans("Table") . '</td>';
1912
+    print '<td colspan="2">'.$langs->trans("Dictionary").'</td>';
1913
+    print '<td>'.$langs->trans("Table").'</td>';
1914 1914
     print '</tr>';
1915 1915
 
1916 1916
     $showemptyline = '';
@@ -1930,7 +1930,7 @@  discard block
 block discarded – undo
1930 1930
             print '<tr class="oddeven"><td width="50%">';
1931 1931
             if (!empty($tabcond[$i])) {
1932 1932
                 // print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $i . '">' . $langs->trans($tablib[$i]) . '</a>';
1933
-                print '<a href="' . BASE_URI . '?controller=admin&method=dict&id=' . $i . '">' . $langs->trans($tablib[$i]) . '</a>';
1933
+                print '<a href="'.BASE_URI.'?controller=admin&method=dict&id='.$i.'">'.$langs->trans($tablib[$i]).'</a>';
1934 1934
             } else {
1935 1935
                 print $langs->trans($tablib[$i]);
1936 1936
             }
@@ -1941,7 +1941,7 @@  discard block
 block discarded – undo
1941 1941
               print info_admin($langs->trans("DictionaryDisabledSinceNoModuleNeedIt"),1);
1942 1942
               } */
1943 1943
             print '</td>';
1944
-            print '<td>' . $tabname[$i] . '</td></tr>';
1944
+            print '<td>'.$tabname[$i].'</td></tr>';
1945 1945
             $lastlineisempty = false;
1946 1946
         } else {
1947 1947
             if (!$lastlineisempty) {
@@ -1990,10 +1990,10 @@  discard block
 block discarded – undo
1990 1990
             continue;
1991 1991
         }
1992 1992
 
1993
-        if (in_array($fieldlist[$field], array('code', 'libelle', 'type')) && $tabname == MAIN_DB_PREFIX . "c_actioncomm" && in_array($obj->type, array('system', 'systemauto'))) {
1993
+        if (in_array($fieldlist[$field], array('code', 'libelle', 'type')) && $tabname == MAIN_DB_PREFIX."c_actioncomm" && in_array($obj->type, array('system', 'systemauto'))) {
1994 1994
             $hidden = (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '');
1995 1995
             print '<td>';
1996
-            print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $hidden . '">';
1996
+            print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$hidden.'">';
1997 1997
             print $langs->trans($hidden);
1998 1998
             print '</td>';
1999 1999
         } elseif ($fieldlist[$field] == 'country') {
@@ -2011,7 +2011,7 @@  discard block
 block discarded – undo
2011 2011
             if (!in_array('country', $fieldlist)) { // If there is already a field country, we don't show country_id (avoid duplicate)
2012 2012
                 $country_id = (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0);
2013 2013
                 print '<td class="tdoverflowmax100">';
2014
-                print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $country_id . '">';
2014
+                print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$country_id.'">';
2015 2015
                 print '</td>';
2016 2016
             }
2017 2017
         } elseif ($fieldlist[$field] == 'region') {
@@ -2021,7 +2021,7 @@  discard block
 block discarded – undo
2021 2021
         } elseif ($fieldlist[$field] == 'region_id') {
2022 2022
             $region_id = (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0);
2023 2023
             print '<td>';
2024
-            print '<input type="hidden" name="' . $fieldlist[$field] . '" value="' . $region_id . '">';
2024
+            print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$region_id.'">';
2025 2025
             print '</td>';
2026 2026
         } elseif ($fieldlist[$field] == 'lang') {
2027 2027
             print '<td>';
@@ -2043,10 +2043,10 @@  discard block
 block discarded – undo
2043 2043
             print '<td>';
2044 2044
             print $form->selectyesno("private", (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : ''));
2045 2045
             print '</td>';
2046
-        } elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX . "c_actioncomm") {
2046
+        } elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") {
2047 2047
             $type = (!empty($obj->type) ? $obj->type : 'user'); // Check if type is different of 'user' (external module)
2048 2048
             print '<td>';
2049
-            print $type . '<input type="hidden" name="type" value="' . $type . '">';
2049
+            print $type.'<input type="hidden" name="type" value="'.$type.'">';
2050 2050
             print '</td>';
2051 2051
         } elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
2052 2052
             if ($fieldlist[$field] == 'type_cdr')
@@ -2063,30 +2063,30 @@  discard block
 block discarded – undo
2063 2063
             $align = "left";
2064 2064
             if (in_array($fieldlist[$field], array('taux', 'localtax1', 'localtax2')))
2065 2065
                 $align = "center"; // Fields aligned on right
2066
-            print '<td align="' . $align . '">';
2067
-            print '<input type="text" class="flat" value="' . (isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '') . '" size="3" name="' . $fieldlist[$field] . '">';
2066
+            print '<td align="'.$align.'">';
2067
+            print '<input type="text" class="flat" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '').'" size="3" name="'.$fieldlist[$field].'">';
2068 2068
             print '</td>';
2069 2069
         }
2070 2070
         elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
2071 2071
             print '<td>';
2072 2072
             $transfound = 0;
2073 2073
             // Special case for labels
2074
-            if ($tabname == MAIN_DB_PREFIX . 'c_payment_term') {
2074
+            if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
2075 2075
                 $langs->load("bills");
2076
-                $transkey = "PaymentCondition" . strtoupper($obj->code);
2076
+                $transkey = "PaymentCondition".strtoupper($obj->code);
2077 2077
                 if ($langs->trans($transkey) != $transkey) {
2078 2078
                     $transfound = 1;
2079 2079
                     print $form->textwithpicto($langs->trans($transkey), $langs->trans("GoIntoTranslationMenuToChangeThis"));
2080 2080
                 }
2081 2081
             }
2082 2082
             if (!$transfound) {
2083
-                print '<textarea cols="30" rows="' . ROWS_2 . '" class="flat" name="' . $fieldlist[$field] . '">' . (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '') . '</textarea>';
2083
+                print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '').'</textarea>';
2084 2084
             }
2085 2085
             print '</td>';
2086 2086
         } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) {
2087
-            print '<td><input type="text" class="flat minwidth75" value="' . price((!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '')) . '" name="' . $fieldlist[$field] . '"></td>';
2087
+            print '<td><input type="text" class="flat minwidth75" value="'.price((!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '')).'" name="'.$fieldlist[$field].'"></td>';
2088 2088
         } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
2089
-            print '<td class="maxxxx"><input type="text" class="flat minwidth75" value="' . (!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '') . '" name="' . $fieldlist[$field] . '"></td>';
2089
+            print '<td class="maxxxx"><input type="text" class="flat minwidth75" value="'.(!empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '').'" name="'.$fieldlist[$field].'"></td>';
2090 2090
         } elseif ($fieldlist[$field] == 'unit') {
2091 2091
             print '<td>';
2092 2092
             $units = array(
@@ -2108,10 +2108,10 @@  discard block
 block discarded – undo
2108 2108
             if (!empty($conf->accounting->enabled)) {
2109 2109
                 $fieldname = $fieldlist[$field];
2110 2110
                 $accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
2111
-                print $formaccounting->select_account($accountancy_account, '.' . $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
2111
+                print $formaccounting->select_account($accountancy_account, '.'.$fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
2112 2112
             } else {
2113 2113
                 $fieldname = $fieldlist[$field];
2114
-                print '<input type="text" size="10" class="flat" value="' . (isset($obj->$fieldname) ? $obj->$fieldname : '') . '" name="' . $fieldlist[$field] . '">';
2114
+                print '<input type="text" size="10" class="flat" value="'.(isset($obj->$fieldname) ? $obj->$fieldname : '').'" name="'.$fieldlist[$field].'">';
2115 2115
             }
2116 2116
             print '</td>';
2117 2117
         } elseif ($fieldlist[$field] == 'fk_tva') {
@@ -2146,17 +2146,17 @@  discard block
 block discarded – undo
2146 2146
                 $class = 'quatrevingtpercent';
2147 2147
             if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'sens' || $fieldlist[$field] == 'category_type')
2148 2148
                 $class = 'maxwidth50';
2149
-            print '<td class="' . $classtd . '">';
2149
+            print '<td class="'.$classtd.'">';
2150 2150
             $transfound = 0;
2151 2151
             if (in_array($fieldlist[$field], array('label', 'libelle'))) {
2152 2152
                 $transkey = '';
2153 2153
                 // Special case for labels
2154
-                if ($tabname == MAIN_DB_PREFIX . 'c_civility') {
2155
-                    $transkey = "Civility" . strtoupper($obj->code);
2154
+                if ($tabname == MAIN_DB_PREFIX.'c_civility') {
2155
+                    $transkey = "Civility".strtoupper($obj->code);
2156 2156
                 }
2157
-                if ($tabname == MAIN_DB_PREFIX . 'c_payment_term') {
2157
+                if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
2158 2158
                     $langs->load("bills");
2159
-                    $transkey = "PaymentCondition" . strtoupper($obj->code);
2159
+                    $transkey = "PaymentCondition".strtoupper($obj->code);
2160 2160
                 }
2161 2161
                 if ($transkey && $langs->trans($transkey) != $transkey) {
2162 2162
                     $transfound = 1;
@@ -2164,7 +2164,7 @@  discard block
 block discarded – undo
2164 2164
                 }
2165 2165
             }
2166 2166
             if (!$transfound) {
2167
-                print '<input type="text" class="flat' . ($class ? ' ' . $class : '') . '" value="' . (isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '') . '" name="' . $fieldlist[$field] . '">';
2167
+                print '<input type="text" class="flat'.($class ? ' '.$class : '').'" value="'.(isset($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : '').'" name="'.$fieldlist[$field].'">';
2168 2168
             }
2169 2169
             print '</td>';
2170 2170
         }
Please login to merge, or discard this patch.
dolibarr/htdocs/core/lib/parsemd.lib.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,15 +30,15 @@
 block discarded – undo
30 30
  * @param   string    $replaceimagepath     Replace path to image with another path. Exemple: ('doc/'=>'xxx/aaa/')
31 31
  * @return	string                          Parsed content
32 32
  */
33
-function dolMd2Html($content, $parser='parsedown',$replaceimagepath=null)
33
+function dolMd2Html($content, $parser = 'parsedown', $replaceimagepath = null)
34 34
 {
35 35
     if (is_array($replaceimagepath))
36 36
     {
37
-        foreach($replaceimagepath as $key => $val)
37
+        foreach ($replaceimagepath as $key => $val)
38 38
         {
39 39
             $keytoreplace = ']('.$key;
40 40
             $valafter = ']('.$val;
41
-            $content = preg_replace('/'.preg_quote($keytoreplace,'/').'/m', $valafter, $content);
41
+            $content = preg_replace('/'.preg_quote($keytoreplace, '/').'/m', $valafter, $content);
42 42
         }
43 43
     }
44 44
     if ($parser == 'parsedown')
Please login to merge, or discard this patch.
Helpers/Request.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -25,17 +25,17 @@  discard block
 block discarded – undo
25 25
 {
26 26
 
27 27
     // Filters
28
-    const NO_CHECK = 0;             // 'none'=no check (only for param that should have very rich content)
29
-    const NUMERIC = 1;              // 'int'=check it's numeric (integer or float)
30
-    const NUMBER_COMMA = 2;         // 'intcomma'=check it's integer+comma ('1,2,3,4...')
31
-    const ALPHA = 3;                // 'alpha'=check it's text and sign
32
-    const LETTERS_ONLY = 4;         // 'aZ'=check it's a-z only
33
-    const LETTERS_AND_NUMBERS = 5;  // 'aZ09'=check it's simple alpha string (recommended for keys)
34
-    const AN_ARRAY = 6;             // 'array'=check it's array
35
-    const SANITIZE = 7;             // 'san_alpha' = Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string)
36
-    const NO_HTML = 8;              // 'nohtml', 'alphanohtml' = check there is no html content
37
-    const ALPHA_NO_HTML = 9;              // 'nohtml', 'alphanohtml' = check there is no html content
38
-    const CUSTOM = 10;               // 'custom' = custom filter specify $filter and $options)
28
+    const NO_CHECK = 0; // 'none'=no check (only for param that should have very rich content)
29
+    const NUMERIC = 1; // 'int'=check it's numeric (integer or float)
30
+    const NUMBER_COMMA = 2; // 'intcomma'=check it's integer+comma ('1,2,3,4...')
31
+    const ALPHA = 3; // 'alpha'=check it's text and sign
32
+    const LETTERS_ONLY = 4; // 'aZ'=check it's a-z only
33
+    const LETTERS_AND_NUMBERS = 5; // 'aZ09'=check it's simple alpha string (recommended for keys)
34
+    const AN_ARRAY = 6; // 'array'=check it's array
35
+    const SANITIZE = 7; // 'san_alpha' = Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string)
36
+    const NO_HTML = 8; // 'nohtml', 'alphanohtml' = check there is no html content
37
+    const ALPHA_NO_HTML = 9; // 'nohtml', 'alphanohtml' = check there is no html content
38
+    const CUSTOM = 10; // 'custom' = custom filter specify $filter and $options)
39 39
 
40 40
     public static function get(string $variable, array $methods = [INPUT_GET, INPUT_POST], int $filter = self::NO_CHECK): string
41 41
     {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         if (empty($paramname))
178 178
             return 'BadFirstParameterForGETPOST';
179 179
         if (empty($check)) {
180
-            dol_syslog("Deprecated use of GETPOST, called with 1st param = " . $paramname . " and 2nd param is '', when calling page " . $_SERVER["PHP_SELF"], LOG_WARNING);
180
+            dol_syslog("Deprecated use of GETPOST, called with 1st param = ".$paramname." and 2nd param is '', when calling page ".$_SERVER["PHP_SELF"], LOG_WARNING);
181 181
 // Enable this line to know who call the GETPOST with '' $check parameter.
182 182
 //var_dump(debug_backtrace()[0]);
183 183
         }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
             $relativepathstring = $_SERVER["PHP_SELF"];
200 200
 // Clean $relativepathstring
201 201
             if (constant('DOL_URL_ROOT'))
202
-                $relativepathstring = preg_replace('/^' . preg_quote(constant('DOL_URL_ROOT'), '/') . '/', '', $relativepathstring);
202
+                $relativepathstring = preg_replace('/^'.preg_quote(constant('DOL_URL_ROOT'), '/').'/', '', $relativepathstring);
203 203
             $relativepathstring = preg_replace('/^\//', '', $relativepathstring);
204 204
             $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring);
205 205
 //var_dump($relativepathstring);
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
 // Code for search criteria persistence.
208 208
 // Retrieve values if restore_lastsearch_values
209 209
             if (!empty($_GET['restore_lastsearch_values'])) {        // Use $_GET here and not GETPOST
210
-                if (!empty($_SESSION['lastsearch_values_' . $relativepathstring])) { // If there is saved values
211
-                    $tmp = json_decode($_SESSION['lastsearch_values_' . $relativepathstring], true);
210
+                if (!empty($_SESSION['lastsearch_values_'.$relativepathstring])) { // If there is saved values
211
+                    $tmp = json_decode($_SESSION['lastsearch_values_'.$relativepathstring], true);
212 212
                     if (is_array($tmp)) {
213 213
                         foreach ($tmp as $key => $val) {
214 214
                             if ($key == $paramname) { // We are on the requested parameter
@@ -219,12 +219,12 @@  discard block
 block discarded – undo
219 219
                     }
220 220
                 }
221 221
 // If there is saved contextpage, page or limit
222
-                if ($paramname == 'contextpage' && !empty($_SESSION['lastsearch_contextpage_' . $relativepathstring])) {
223
-                    $out = $_SESSION['lastsearch_contextpage_' . $relativepathstring];
224
-                } elseif ($paramname == 'page' && !empty($_SESSION['lastsearch_page_' . $relativepathstring])) {
225
-                    $out = $_SESSION['lastsearch_page_' . $relativepathstring];
226
-                } elseif ($paramname == 'limit' && !empty($_SESSION['lastsearch_limit_' . $relativepathstring])) {
227
-                    $out = $_SESSION['lastsearch_limit_' . $relativepathstring];
222
+                if ($paramname == 'contextpage' && !empty($_SESSION['lastsearch_contextpage_'.$relativepathstring])) {
223
+                    $out = $_SESSION['lastsearch_contextpage_'.$relativepathstring];
224
+                } elseif ($paramname == 'page' && !empty($_SESSION['lastsearch_page_'.$relativepathstring])) {
225
+                    $out = $_SESSION['lastsearch_page_'.$relativepathstring];
226
+                } elseif ($paramname == 'limit' && !empty($_SESSION['lastsearch_limit_'.$relativepathstring])) {
227
+                    $out = $_SESSION['lastsearch_limit_'.$relativepathstring];
228 228
                 }
229 229
             }
230 230
 // Else, retreive default values if we are not doing a sort
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
                                             $qualified = 1;
293 293
 
294 294
                                         if ($qualified) {
295
-                                            $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "=");  // we accept _, -, . and ,
295
+                                            $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
296 296
                                             foreach ($user->default_values[$relativepathstring]['sortorder'][$defkey] as $key => $val) {
297 297
                                                 if ($out)
298 298
                                                     $out .= ', ';
@@ -328,11 +328,11 @@  discard block
 block discarded – undo
328 328
                                         if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all'])) {
329 329
 // We made a search from quick search menu, do we still use default filter ?
330 330
                                             if (empty($conf->global->MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH)) {
331
-                                                $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "=");  // we accept _, -, . and ,
331
+                                                $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
332 332
                                                 $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
333 333
                                             }
334 334
                                         } else {
335
-                                            $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "=");  // we accept _, -, . and ,
335
+                                            $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and ,
336 336
                                             $out = dol_string_nospecial($user->default_values[$relativepathstring]['filters'][$defkey][$paramname], '', $forbidden_chars_to_replace);
337 337
                                         }
338 338
                                         break;
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 // We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
351 351
         if (!is_array($out) && empty($_POST[$paramname]) && empty($noreplace)) {
352 352
             $maxloop = 20;
353
-            $loopnb = 0;    // Protection against infinite loop
353
+            $loopnb = 0; // Protection against infinite loop
354 354
             while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) {    // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
355 355
                 $loopnb++;
356 356
                 $newout = '';
@@ -395,9 +395,9 @@  discard block
 block discarded – undo
395 395
                 } elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID') {
396 396
                     $newout = $conf->entity;
397 397
                 } else
398
-                    $newout = '';     // Key not found, we replace with empty string
398
+                    $newout = ''; // Key not found, we replace with empty string
399 399
 //var_dump('__'.$reg[1].'__ -> '.$newout);
400
-                $out = preg_replace('/__' . preg_quote($reg[1], '/') . '__/', $newout, $out);
400
+                $out = preg_replace('/__'.preg_quote($reg[1], '/').'__/', $newout, $out);
401 401
             }
402 402
         }
403 403
 
Please login to merge, or discard this patch.