Passed
Push — dev ( 813770 )
by Rafael
69:44
created
public/htdocs/core/db/Database.interface.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function stddevpop($nameoffield);
49 49
 
50
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
50
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
51 51
     /**
52 52
      * Return datas as an array
53 53
      * @TODO deprecate this. Use fetch_object() so you can access a field with its name instead of using an index of position of field.
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * @return  array                               Array
57 57
      */
58 58
     public function fetch_row($resultset);
59
-	// phpcs:enable
59
+    // phpcs:enable
60 60
 
61 61
     /**
62 62
      * Convert (by PHP) a GM Timestamp date into a string date with PHP server TZ to insert into a date field.
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public function begin($textinlog = '');
84 84
 
85
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
85
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
86 86
     /**
87 87
      * Create a new database
88 88
      * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @return  bool|SQLite3Result|mysqli_result|resource      Resource result of the query to create database if OK, null if KO
96 96
      */
97 97
     public function DDLCreateDb($database, $charset = '', $collation = '', $owner = '');
98
-	// phpcs:enable
98
+    // phpcs:enable
99 99
 
100 100
     /**
101 101
      * Return version of database server into an array
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function convertSQLFromMysql($line, $type = 'ddl');
115 115
 
116
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
116
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
117 117
     /**
118 118
      * Return the number of lines in the result of a request INSERT, DELETE or UPDATE
119 119
      *
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      * @see     num_rows()
123 123
      */
124 124
     public function affected_rows($resultset);
125
-	// phpcs:enable
125
+    // phpcs:enable
126 126
 
127 127
     /**
128 128
      * Return description of last error
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function error();
133 133
 
134
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
134
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
135 135
     /**
136 136
      *  List tables into a database
137 137
      *
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
      *  @return array                   List of tables in an array
141 141
      */
142 142
     public function DDLListTables($database, $table = '');
143
-	// phpcs:enable
143
+    // phpcs:enable
144 144
 
145
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
145
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
146 146
     /**
147 147
      *  List tables into a database with table type
148 148
      *
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      *  @return array                   List of tables in an array
152 152
      */
153 153
     public function DDLListTablesFull($database, $table = '');
154
-	// phpcs:enable
154
+    // phpcs:enable
155 155
 
156 156
     /**
157 157
      * Return last request executed with query()
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public function decrypt($value);
179 179
 
180
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
180
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
181 181
     /**
182 182
      *    Return datas as an array
183 183
      *
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
      * @return  array|null|false                                    Result with row
186 186
      */
187 187
     public function fetch_array($resultset);
188
-	// phpcs:enable
188
+    // phpcs:enable
189 189
 
190 190
     /**
191 191
      * Return last error label
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      */
220 220
     public function sanitize($stringtosanitize);
221 221
 
222
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
222
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
223 223
     /**
224 224
      * Get last ID after an insert INSERT
225 225
      *
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      * @return  int                 Id of row
229 229
      */
230 230
     public function last_insert_id($tab, $fieldid = 'rowid');
231
-	// phpcs:enable
231
+    // phpcs:enable
232 232
 
233 233
     /**
234 234
      *    Return full path of restore program
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public function getDefaultCollationDatabase();
304 304
 
305
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
305
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
306 306
     /**
307 307
      * Return number of lines for result of a SELECT
308 308
      *
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
      * @see     affected_rows()
312 312
      */
313 313
     public function num_rows($resultset);
314
-	// phpcs:enable
314
+    // phpcs:enable
315 315
 
316 316
     /**
317 317
      * Return full path of dump program
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      */
335 335
     public function errno();
336 336
 
337
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
337
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
338 338
     /**
339 339
      * Create a table into database
340 340
      *
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
      * @return       int                    Return integer <0 if KO, >=0 if OK
349 349
      */
350 350
     public function DDLCreateTable($table, $fields, $primary_key, $type, $unique_keys = null, $fulltext_keys = null, $keys = null);
351
-	// phpcs:enable
351
+    // phpcs:enable
352 352
 
353
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
353
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
354 354
     /**
355 355
      * Drop a table into database
356 356
      *
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
      * @return       int                    Return integer <0 if KO, >=0 if OK
359 359
      */
360 360
     public function DDLDropTable($table);
361
-	// phpcs:enable
361
+    // phpcs:enable
362 362
 
363 363
     /**
364 364
      * Return list of available charset that can be used to store data in database
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
      */
368 368
     public function getListOfCharacterSet();
369 369
 
370
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
370
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
371 371
     /**
372 372
      * Create a new field into table
373 373
      *
@@ -378,9 +378,9 @@  discard block
 block discarded – undo
378 378
      * @return   int                        Return integer <0 if KO, >0 if OK
379 379
      */
380 380
     public function DDLAddField($table, $field_name, $field_desc, $field_position = "");
381
-	// phpcs:enable
381
+    // phpcs:enable
382 382
 
383
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
383
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
384 384
     /**
385 385
      * Drop a field from table
386 386
      *
@@ -389,9 +389,9 @@  discard block
 block discarded – undo
389 389
      * @return   int                        Return integer <0 if KO, >0 if OK
390 390
      */
391 391
     public function DDLDropField($table, $field_name);
392
-	// phpcs:enable
392
+    // phpcs:enable
393 393
 
394
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
394
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
395 395
     /**
396 396
      * Update format of a field into a table
397 397
      *
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
      * @return   int                        Return integer <0 if KO, >0 if OK
402 402
      */
403 403
     public function DDLUpdateField($table, $field_name, $field_desc);
404
-	// phpcs:enable
404
+    // phpcs:enable
405 405
 
406 406
     /**
407 407
      * Return list of available collation that can be used for database
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
      */
411 411
     public function getListOfCollation();
412 412
 
413
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
413
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
414 414
     /**
415 415
      * Return a pointer of line with description of a table or field
416 416
      *
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
      * @return   bool|resource|mysqli_result|SQLite3Result            Resource
420 420
      */
421 421
     public function DDLDescTable($table, $field = "");
422
-	// phpcs:enable
422
+    // phpcs:enable
423 423
 
424 424
     /**
425 425
      * Return version of database server
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
      */
436 436
     public function getDefaultCharacterSetDatabase();
437 437
 
438
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
438
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
439 439
     /**
440 440
      * Create a user and privileges to connect to database (even if database does not exists yet)
441 441
      *
@@ -451,9 +451,9 @@  discard block
 block discarded – undo
451 451
         $dolibarr_main_db_pass,
452 452
         $dolibarr_main_db_name
453 453
     );
454
-	// phpcs:enable
454
+    // phpcs:enable
455 455
 
456
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
456
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
457 457
     /**
458 458
      * List information of columns into a table.
459 459
      *
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
      * @return  array                           Array with information on table
462 462
      */
463 463
     public function DDLInfoTable($table);
464
-	// phpcs:enable
464
+    // phpcs:enable
465 465
 
466 466
     /**
467 467
      * Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true)
@@ -515,16 +515,16 @@  discard block
 block discarded – undo
515 515
      */
516 516
     public function lastqueryerror();
517 517
 
518
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
518
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
519 519
     /**
520 520
      * Return connection ID
521 521
      *
522 522
      * @return  string      Id connection
523 523
      */
524 524
     public function DDLGetConnectId();
525
-	// phpcs:enable
525
+    // phpcs:enable
526 526
 
527
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
527
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
528 528
     /**
529 529
      * Returns the current line (as an object) for the resultset cursor
530 530
      *
@@ -532,9 +532,9 @@  discard block
 block discarded – undo
532 532
      * @return  Object|false                                                                Object result line or false if KO or end of cursor
533 533
      */
534 534
     public function fetch_object($resultset);
535
-	// phpcs:enable
535
+    // phpcs:enable
536 536
 
537
-	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
537
+    // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
538 538
     /**
539 539
      * Select a database
540 540
      *
@@ -542,5 +542,5 @@  discard block
 block discarded – undo
542 542
      * @return  boolean            true if OK, false if KO
543 543
      */
544 544
     public function select_db($database);
545
-	// phpcs:enable
545
+    // phpcs:enable
546 546
 }
Please login to merge, or discard this patch.
public/htdocs/core/ajax/onlineSign.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 if (!defined('NOBROWSERNOTIF')) {
51 51
     define('NOBROWSERNOTIF', '1');
52 52
 }
53
-$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));  // Keep $_GET and $_POST here. GETPOST not yet defined.
53
+$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); // Keep $_GET and $_POST here. GETPOST not yet defined.
54 54
 if (is_numeric($entity)) {
55 55
     define("DOLENTITY", $entity);
56 56
 }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 $signature = GETPOST('signaturebase64');
63 63
 $ref = GETPOST('ref', 'aZ09');
64
-$mode = GETPOST('mode', 'aZ09');    // 'proposal', ...
64
+$mode = GETPOST('mode', 'aZ09'); // 'proposal', ...
65 65
 $SECUREKEY = GETPOST("securekey"); // Secure key
66 66
 $online_sign_name = GETPOST("onlinesignname");
67 67
 
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
             $upload_dir = !empty($conf->propal->multidir_output[$object->entity]) ? $conf->propal->multidir_output[$object->entity] : $conf->propal->dir_output;
119 119
             $upload_dir .= '/' . dol_sanitizeFileName($object->ref) . '/';
120 120
 
121
-            $default_font_size = pdf_getPDFFontSize($langs);    // Must be after pdf_getInstance
122
-            $default_font = pdf_getPDFFont($langs);    // Must be after pdf_getInstance
121
+            $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
122
+            $default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance
123 123
             $langs->loadLangs(array("main", "companies"));
124 124
 
125 125
             $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             if (!$error) {
143 143
                 // Defined modele of doc
144 144
                 $last_main_doc_file = $object->last_main_doc;
145
-                $directdownloadlink = $object->getLastMainDocLink('proposal');    // url to download the $object->last_main_doc
145
+                $directdownloadlink = $object->getLastMainDocLink('proposal'); // url to download the $object->last_main_doc
146 146
 
147 147
                 if (preg_match('/\.pdf/i', $last_main_doc_file)) {
148 148
                     // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile
@@ -170,13 +170,13 @@  discard block
 block discarded – undo
170 170
                             }
171 171
 
172 172
                             //$pdf->Open();
173
-                            $pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
173
+                            $pagecount = $pdf->setSourceFile($sourcefile); // original PDF
174 174
 
175 175
                             $param = array();
176 176
                             $param['online_sign_name'] = $online_sign_name;
177 177
                             $param['pathtoimage'] = $upload_dir . $filename;
178 178
 
179
-                            $s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
179
+                            $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
180 180
                             for ($i = 1; $i < ($pagecount + 1); $i++) {
181 181
                                 try {
182 182
                                     $tppl = $pdf->importPage($i);
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
             if (!$error) {
333 333
                 // Defined modele of doc
334 334
                 $last_main_doc_file = $object->last_main_doc;
335
-                $directdownloadlink = $object->getLastMainDocLink('contrat');    // url to download the $object->last_main_doc
335
+                $directdownloadlink = $object->getLastMainDocLink('contrat'); // url to download the $object->last_main_doc
336 336
 
337 337
                 if (preg_match('/\.pdf/i', $last_main_doc_file)) {
338 338
                     // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile
@@ -360,13 +360,13 @@  discard block
 block discarded – undo
360 360
                             }
361 361
 
362 362
                             //$pdf->Open();
363
-                            $pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
363
+                            $pagecount = $pdf->setSourceFile($sourcefile); // original PDF
364 364
 
365 365
                             $param = array();
366 366
                             $param['online_sign_name'] = $online_sign_name;
367 367
                             $param['pathtoimage'] = $upload_dir . $filename;
368 368
 
369
-                            $s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
369
+                            $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
370 370
                             for ($i = 1; $i < ($pagecount + 1); $i++) {
371 371
                                 try {
372 372
                                     $tppl = $pdf->importPage($i);
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 
444 444
             $langs->loadLangs(array("main", "companies"));
445 445
 
446
-            $default_font_size = pdf_getPDFFontSize($langs);    // Must be after pdf_getInstance
446
+            $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
447 447
             $default_font = pdf_getPDFFont($langs); // Must be
448 448
 
449 449
             $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
             if (!$error) {
467 467
                 // Defined modele of doc
468 468
                 $last_main_doc_file = $object->last_main_doc;
469
-                $directdownloadlink = $object->getLastMainDocLink('fichinter');    // url to download the $object->last_main_doc
469
+                $directdownloadlink = $object->getLastMainDocLink('fichinter'); // url to download the $object->last_main_doc
470 470
 
471 471
                 if (preg_match('/\.pdf/i', $last_main_doc_file)) {
472 472
                     // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
                             }
495 495
 
496 496
                             //$pdf->Open();
497
-                            $pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
497
+                            $pagecount = $pdf->setSourceFile($sourcefile); // original PDF
498 498
 
499 499
                             $param = array();
500 500
                             $param['online_sign_name'] = $online_sign_name;
501 501
                             $param['pathtoimage'] = $upload_dir . $filename;
502 502
 
503
-                            $s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
503
+                            $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
504 504
                             for ($i = 1; $i < ($pagecount + 1); $i++) {
505 505
                                 try {
506 506
                                     $tppl = $pdf->importPage($i);
@@ -578,8 +578,8 @@  discard block
 block discarded – undo
578 578
 
579 579
                 $upload_dir = $conf->societe->multidir_output[$object->thirdparty->entity] . '/' . dol_sanitizeFileName($object->thirdparty->id) . '/';
580 580
 
581
-                $default_font_size = pdf_getPDFFontSize($langs);    // Must be after pdf_getInstance
582
-                $default_font = pdf_getPDFFont($langs);    // Must be after pdf_getInstance
581
+                $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
582
+                $default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance
583 583
                 $langs->loadLangs(array("main", "companies"));
584 584
 
585 585
                 $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
                     // Defined modele of doc
612 612
                     $last_main_doc_file = $object->last_main_doc;
613 613
                     $last_modelpdf = $object->model_pdf;
614
-                    $directdownloadlink = $object->getLastMainDocLink('company');    // url to download the $object->last_main_doc
614
+                    $directdownloadlink = $object->getLastMainDocLink('company'); // url to download the $object->last_main_doc
615 615
 
616 616
                     if (preg_match('/\.pdf/i', $last_main_doc_file)) {
617 617
                         $sourcefile = '';
@@ -641,9 +641,9 @@  discard block
 block discarded – undo
641 641
                                 }
642 642
 
643 643
                                 //$pdf->Open();
644
-                                $pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
644
+                                $pagecount = $pdf->setSourceFile($sourcefile); // original PDF
645 645
 
646
-                                $s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
646
+                                $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
647 647
                                 for ($i = 1; $i < ($pagecount + 1); $i++) {
648 648
                                     try {
649 649
                                         $tppl = $pdf->importPage($i);
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
 
785 785
             $langs->loadLangs(array("main", "companies"));
786 786
 
787
-            $default_font_size = pdf_getPDFFontSize($langs);    // Must be after pdf_getInstance
787
+            $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
788 788
             $default_font = pdf_getPDFFont($langs); // Must be
789 789
 
790 790
             $date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
@@ -810,11 +810,11 @@  discard block
 block discarded – undo
810 810
                 if (empty($last_main_doc_file) || !dol_is_file(DOL_DATA_ROOT . '/' . $object->last_main_doc)) {
811 811
                     // It seems document has never been generated, or was generated and then deleted.
812 812
                     // So we try to regenerate it with its default template.
813
-                    $defaulttemplate = '';      // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used.
813
+                    $defaulttemplate = ''; // We force the use an empty string instead of $object->model_pdf to be sure to use a "main" default template and not the last one used.
814 814
                     $object->generateDocument($defaulttemplate, $langs);
815 815
                 }
816 816
                 $last_main_doc_file = $object->last_main_doc;
817
-                $directdownloadlink = $object->getLastMainDocLink('expedition');    // url to download the $object->last_main_doc
817
+                $directdownloadlink = $object->getLastMainDocLink('expedition'); // url to download the $object->last_main_doc
818 818
 
819 819
                 if (preg_match('/\.pdf/i', $last_main_doc_file)) {
820 820
                     // TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile
@@ -842,13 +842,13 @@  discard block
 block discarded – undo
842 842
                             }
843 843
 
844 844
                             //$pdf->Open();
845
-                            $pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
845
+                            $pagecount = $pdf->setSourceFile($sourcefile); // original PDF
846 846
 
847 847
                             $param = array();
848 848
                             $param['online_sign_name'] = $online_sign_name;
849 849
                             $param['pathtoimage'] = $upload_dir . $filename;
850 850
 
851
-                            $s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
851
+                            $s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
852 852
                             for ($i = 1; $i < ($pagecount + 1); $i++) {
853 853
                                 try {
854 854
                                     $tppl = $pdf->importPage($i);
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
                 $db->begin();
908 908
 
909 909
                 $sql = "UPDATE " . MAIN_DB_PREFIX . "expedition";
910
-                $sql .= " SET signed_status = " . ((int) $object::STATUS_SIGNED) ;
910
+                $sql .= " SET signed_status = " . ((int) $object::STATUS_SIGNED);
911 911
                 $sql .= " WHERE rowid = " . ((int) $object->id);
912 912
 
913 913
                 dol_syslog(__FILE__, LOG_DEBUG);
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
  */
951 951
 function dolPrintSignatureImage(TCPDF $pdf, $langs, $params)
952 952
 {
953
-    $default_font_size = pdf_getPDFFontSize($langs);    // Must be after pdf_getInstance
953
+    $default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
954 954
     $default_font = pdf_getPDFFont($langs); // Must be
955 955
     $xforimgstart = $params['xforimgstart'];
956 956
     $yforimgstart = $params['yforimgstart'];
Please login to merge, or discard this patch.
public/htdocs/core/ajax/box.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 
46 46
 $boxid = GETPOSTINT('boxid');
47 47
 $boxorder = GETPOST('boxorder');
48
-$zone = GETPOST('zone');        // Can be '0' or '1' or 'pagename'...
48
+$zone = GETPOST('zone'); // Can be '0' or '1' or 'pagename'...
49 49
 $userid = GETPOSTINT('userid');
50 50
 
51 51
 // Security check
Please login to merge, or discard this patch.
public/htdocs/core/ajax/fileupload.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 // Load Dolibarr environment
40 40
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
41
-require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/fileupload.class.php';  // Class to upload common files
41
+require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/fileupload.class.php'; // Class to upload common files
42 42
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/class/genericobject.class.php';
43 43
 require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/geturl.lib.php';
44 44
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 if (!empty($user->socid)) {
64 64
     $socid = $user->socid;
65 65
     if (!empty($object->socid) && $socid != $object->socid) {
66
-        httponly_accessforbidden("Access on object not allowed for this external user.");   // This includes the exit.
66
+        httponly_accessforbidden("Access on object not allowed for this external user."); // This includes the exit.
67 67
     }
68 68
 }
69 69
 
Please login to merge, or discard this patch.
public/htdocs/core/ajax/selectobject.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -93,9 +93,9 @@
 block discarded – undo
93 93
     $vartmp = (empty($InfoFieldList[3]) ? '' : $InfoFieldList[3]);
94 94
     $reg = array();
95 95
     if (preg_match('/^.*:(\w*)$/', $vartmp, $reg)) {
96
-        $InfoFieldList[4] = $reg[1];    // take the sort field
96
+        $InfoFieldList[4] = $reg[1]; // take the sort field
97 97
     }
98
-    $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp);    // take the filter field
98
+    $InfoFieldList[3] = preg_replace('/:\w*$/', '', $vartmp); // take the filter field
99 99
 
100 100
     $classname = $InfoFieldList[0];
101 101
     $classpath = $InfoFieldList[1];
Please login to merge, or discard this patch.
public/htdocs/core/ajax/fetchKnowledgeRecord.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
         $response = array();
95 95
         while ($i < $num) {
96 96
             $obj = $db->fetch_object($resql);
97
-            $response[] = array('title' => $obj->question,'ref' => $obj->ref,'answer' => dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)),'url' => $obj->url);
97
+            $response[] = array('title' => $obj->question, 'ref' => $obj->ref, 'answer' => dol_escape_htmltag(preg_replace('/\\r|\\r\\n|\\n/', "", $obj->answer)), 'url' => $obj->url);
98 98
             $i++;
99 99
         }
100 100
     } else {
Please login to merge, or discard this patch.
public/htdocs/core/ajax/ajaxinvoiceline.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
     $formProject = new FormProjets($db);
61 61
 
62 62
 
63
-    $return['value']    = $formProject->selectInvoiceAndLine($invoice_id, 0, 'invoiceid', 'invoicelineid', 'maxwidth500', array(), 1);
63
+    $return['value'] = $formProject->selectInvoiceAndLine($invoice_id, 0, 'invoiceid', 'invoicelineid', 'maxwidth500', array(), 1);
64 64
     //$return['num'] = $form->num;
65 65
     //$return['error']  = $form->error;
66 66
 }
Please login to merge, or discard this patch.
public/htdocs/core/ajax/flowjs-server.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 $flowChunkSize = GETPOST('flowChunkSize', 'alpha');
59 59
 $flowTotalSize = GETPOST('flowTotalSize', 'alpha');
60 60
 
61
-$result = restrictedArea($user, $module, 0, '', 0, 'fk_soc', 'rowid', 0, 1);    // Call with mode return
61
+$result = restrictedArea($user, $module, 0, '', 0, 'fk_soc', 'rowid', 0, 1); // Call with mode return
62 62
 
63 63
 if ($action != 'upload') {
64 64
     httponly_accessforbidden("Param action must be 'upload'");
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
     // check that all the parts are present
165 165
     // the size of the last part is between chunkSize and 2*$chunkSize
166
-    if ($total_files * (float) $chunkSize >=  ((float) $totalSize - (float) $chunkSize + 1)) {
166
+    if ($total_files * (float) $chunkSize >= ((float) $totalSize - (float) $chunkSize + 1)) {
167 167
         // create the final destination file
168 168
         if (($fp = fopen($upload_dir . '/' . $fileName, 'w')) !== false) {
169 169
             for ($i = 1; $i <= $total_files; $i++) {
Please login to merge, or discard this patch.
public/htdocs/core/ajax/vatrates.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 require constant('DOL_DOCUMENT_ROOT') . '/main.inc.php';
37 37
 
38 38
 $id = GETPOSTINT('id');
39
-$action = GETPOST('action', 'aZ09');    // 'getSellerVATRates' or 'getBuyerVATRates'
39
+$action = GETPOST('action', 'aZ09'); // 'getSellerVATRates' or 'getBuyerVATRates'
40 40
 $htmlname   = GETPOST('htmlname', 'alpha');
41 41
 $selected   = (GETPOST('selected') ? GETPOST('selected') : '-1');
42 42
 $productid = (GETPOSTINT('productid') ? GETPOSTINT('productid') : 0);
Please login to merge, or discard this patch.