Completed
Branch develop (d71cd3)
by
unknown
18:37
created
htdocs/core/modules/commande/doc/pdf_einstein.modules.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 					if (!empty($conf->mycompany->multidir_output[$object->entity])) {
272 272
 						$logodir = $conf->mycompany->multidir_output[$object->entity];
273 273
 					}
274
-					$pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
274
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
275 275
 					$tplidx = $pdf->importPage(1);
276 276
 				}
277 277
 
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
 				// Pied de page
630 630
 				$this->_pagefoot($pdf, $object, $outputlangs);
631 631
 				if (method_exists($pdf, 'AliasNbPages')) {
632
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
632
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
633 633
 				}
634 634
 
635 635
 				$pdf->Close();
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 
1486 1486
 			$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
1487 1487
 
1488
-			$mode =  'target';
1488
+			$mode = 'target';
1489 1489
 			$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object);
1490 1490
 
1491 1491
 			// Show recipient
Please login to merge, or discard this patch.
htdocs/core/modules/project/doc/pdf_timespent.modules.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
205 205
 				// Set path to the background PDF File
206 206
 				if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
207
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
207
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
208 208
 					$tplidx = $pdf->importPage(1);
209 209
 				}
210 210
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 				// Footer of the page
470 470
 				$this->_pagefoot($pdf, $object, $outputlangs);
471 471
 				if (method_exists($pdf, 'AliasNbPages')) {
472
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
472
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
473 473
 				}
474 474
 
475 475
 				$pdf->Close();
Please login to merge, or discard this patch.
htdocs/core/modules/project/doc/pdf_beluga.modules.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
241 241
 				// Set path to the background PDF File
242 242
 				if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
243
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
243
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
244 244
 					$tplidx = $pdf->importPage(1);
245 245
 				}
246 246
 
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
 				// Pied de page
704 704
 				$this->_pagefoot($pdf, $object, $outputlangs);
705 705
 				if (method_exists($pdf, 'AliasNbPages')) {
706
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
706
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
707 707
 				}
708 708
 
709 709
 				$pdf->Close();
Please login to merge, or discard this patch.
htdocs/core/modules/project/doc/pdf_baleine.modules.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
210 210
 				// Set path to the background PDF File
211 211
 				if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
212
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
212
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
213 213
 					$tplidx = $pdf->importPage(1);
214 214
 				}
215 215
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 				// Footer of the page
472 472
 				$this->_pagefoot($pdf, $object, $outputlangs);
473 473
 				if (method_exists($pdf, 'AliasNbPages')) {
474
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
474
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
475 475
 				}
476 476
 
477 477
 				$pdf->Close();
Please login to merge, or discard this patch.
htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
212 212
 				// Set path to the background PDF File
213 213
 				if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
214
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
214
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
215 215
 					$tplidx = $pdf->importPage(1);
216 216
 				}
217 217
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 					$tab_top = 65;
253 253
 
254 254
 					$pdf->SetFont('', 'B', $default_font_size);
255
-					$pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes") . ":", 0, 'L', 0, 0, 12, $tab_top);
255
+					$pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes").":", 0, 'L', 0, 0, 12, $tab_top);
256 256
 					$tab_top += 4;
257 257
 					$pdf->SetFont('', '', $default_font_size - 1);
258 258
 					$pdf->writeHTMLCell(190, 3, $this->posxnotes + 1, $tab_top + 1, dol_htmlentitiesbr($object->note_public), 0, 1);
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 				// Page footer
419 419
 				$this->_pagefoot($pdf, $object, $outputlangs);
420 420
 				if (method_exists($pdf, 'AliasNbPages')) {
421
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
421
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
422 422
 				}
423 423
 
424 424
 				$pdf->Close();
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 			// No fill color
485 485
 			$pdf->SetFillColor(255, 255, 255);
486 486
 		}
487
-		$result = (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->rankorder . "/" . $objectligne->required_rank : "-");
487
+		$result = (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->rankorder."/".$objectligne->required_rank : "-");
488 488
 		$pdf->MultiCell($this->posxresult - 210 - 0.8 - 4, 4, $result, 0, 'C', 1);
489 489
 
490 490
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 		$comment = $skill->label;
504 504
 
505 505
 		if (!empty($skill->description)) {
506
-			$comment .= '<br>' . $outputlangs->trans("Description").': '.$skill->description;
506
+			$comment .= '<br>'.$outputlangs->trans("Description").': '.$skill->description;
507 507
 		}
508 508
 		$pdf->writeHTMLCell($this->posxrankemp - $this->posxskill - 0.8, 4, $this->posxskill - 1, $curY, $comment, 0, 1);
509 509
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 			// employee information
588 588
 			$employee = new User($this->db);
589 589
 			$employee->fetch($object->fk_user);
590
-			$carac_emetteur .= ($carac_emetteur ? "\n" : '').$outputlangs->transnoentities('Employee').' : '.$outputlangs->convToOutputCharset(ucfirst($employee->firstname) . ' ' . strtoupper($employee->lastname));
590
+			$carac_emetteur .= ($carac_emetteur ? "\n" : '').$outputlangs->transnoentities('Employee').' : '.$outputlangs->convToOutputCharset(ucfirst($employee->firstname).' '.strtoupper($employee->lastname));
591 591
 
592 592
 			// Position
593 593
 			include_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
Please login to merge, or discard this patch.
htdocs/core/modules/mrp/doc/pdf_vinci.modules.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		$this->db = $db;
92 92
 		$this->name = "vinci";
93 93
 		$this->description = $langs->trans('DocumentModelStandardPDF');
94
-		$this->update_main_doc_field = 1;		// Save the name of generated file as the main doc when generating a doc with this template
94
+		$this->update_main_doc_field = 1; // Save the name of generated file as the main doc when generating a doc with this template
95 95
 
96 96
 		// Page size for A4 format
97 97
 		$this->type = 'pdf';
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
226 226
 				// Set path to the background PDF File
227 227
 				if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
228
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
228
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
229 229
 					$tplidx = $pdf->importPage(1);
230 230
 				}
231 231
 
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 					if ($this->getColumnStatus('desc')) {
484 484
 						$pdf->startTransaction(); //description
485 485
 						$des = $prod -> description;
486
-						$descr = $des;//implode("<br>", $des);
486
+						$descr = $des; //implode("<br>", $des);
487 487
 
488 488
 						$this->printStdColumnContent($pdf, $curY, 'desc', $descr);
489 489
 
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 				// Pied de page
583 583
 				$this->_pagefoot($pdf, $object, $outputlangs);
584 584
 				if (method_exists($pdf, 'AliasNbPages')) {
585
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
585
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
586 586
 				}
587 587
 
588 588
 				$pdf->Close();
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 		$pdf->SetFont('', 'B', $default_font_size + 3);
1122 1122
 		$pdf->SetXY($posx, $posy);
1123 1123
 		$pdf->SetTextColor(0, 0, 60);
1124
-		$pdf->MultiCell($w, 3, $outputlangs->transnoentities("QtyToProduce").": " .$object->qty, '', 'R');
1124
+		$pdf->MultiCell($w, 3, $outputlangs->transnoentities("QtyToProduce").": ".$object->qty, '', 'R');
1125 1125
 
1126 1126
 
1127 1127
 		$pdf->SetTextColor(0, 0, 60);
Please login to merge, or discard this patch.
core/modules/expensereport/doc/pdf_standard_expensereport.modules.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
252 252
 				// Set path to the background PDF File
253 253
 				if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
254
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
254
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
255 255
 					$tplidx = $pdf->importPage(1);
256 256
 				}
257 257
 
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
 				// Page footer
501 501
 				$this->_pagefoot($pdf, $object, $outputlangs);
502 502
 				if (method_exists($pdf, 'AliasNbPages')) {
503
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
503
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
504 504
 				}
505 505
 
506 506
 				$pdf->Close();
Please login to merge, or discard this patch.
htdocs/core/modules/contract/doc/pdf_strato.modules.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 					if (!empty($conf->mycompany->multidir_output[$object->entity])) {
227 227
 						$logodir = $conf->mycompany->multidir_output[$object->entity];
228 228
 					}
229
-					$pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
229
+					$pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
230 230
 					$tplidx = $pdf->importPage(1);
231 231
 				}
232 232
 
@@ -339,10 +339,10 @@  discard block
 block discarded – undo
339 339
 						$desc = dol_htmlentitiesbr($objectligne->desc, 1); // Desc (not empty for free lines)
340 340
 						$txt = '';
341 341
 						if (!getDolGlobalString('CONTRACT_HIDE_QTY_ON_PDF')) {
342
-							$txt .= $outputlangs->transnoentities("Quantity") . ' : <strong>' . $objectligne->qty . '</strong>';
342
+							$txt .= $outputlangs->transnoentities("Quantity").' : <strong>'.$objectligne->qty.'</strong>';
343 343
 						}
344 344
 						if (!getDolGlobalString('CONTRACT_HIDE_PRICE_ON_PDF')) {
345
-							$txt .= ' - ' . $outputlangs->transnoentities("UnitPrice") . ' : <strong>' . price($objectligne->subprice) . '</strong>';
345
+							$txt .= ' - '.$outputlangs->transnoentities("UnitPrice").' : <strong>'.price($objectligne->subprice).'</strong>';
346 346
 						}
347 347
 						if (!getDolGlobalString('CONTRACT_HIDE_PLANNED_DATE_ON_PDF')) {
348 348
 							$txt .= '<br>';
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 
460 460
 				$this->_pagefoot($pdf, $object, $outputlangs);
461 461
 				if (method_exists($pdf, 'AliasNbPages')) {
462
-					$pdf->AliasNbPages();  // @phan-suppress-current-line PhanUndeclaredMethod
462
+					$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
463 463
 				}
464 464
 
465 465
 				$pdf->Close();
Please login to merge, or discard this patch.
htdocs/contrat/class/contrat.class.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -262,12 +262,12 @@  discard block
 block discarded – undo
262 262
 	/*
263 263
 	 * No signature
264 264
 	 */
265
-	const STATUS_NO_SIGNATURE    = 0;
265
+	const STATUS_NO_SIGNATURE = 0;
266 266
 
267 267
 	/*
268 268
 	 * Signed by sender
269 269
 	 */
270
-	const STATUS_SIGNED_SENDER   = 1;
270
+	const STATUS_SIGNED_SENDER = 1;
271 271
 
272 272
 	/*
273 273
 	 * Signed by receiver
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 	/*
278 278
 	 * Signed by all
279 279
 	 */
280
-	const STATUS_SIGNED_ALL      = 9; // To handle future kind of signature (ex: tripartite contract)
280
+	const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract)
281 281
 
282 282
 
283 283
 	/**
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 		if (getDolGlobalString('CONTRACT_ADDON')) {
308 308
 			$mybool = false;
309 309
 
310
-			$file = getDolGlobalString('CONTRACT_ADDON') . ".php";
310
+			$file = getDolGlobalString('CONTRACT_ADDON').".php";
311 311
 			$classname = getDolGlobalString('CONTRACT_ADDON');
312 312
 
313 313
 			// Include file with class
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 			if ($contratline->statut != ContratLigne::STATUS_OPEN) {
418 418
 				$contratline->context = $this->context;
419 419
 
420
-				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment);	// This call trigger LINECONTRACT_ACTIVATE
420
+				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE
421 421
 				if ($result < 0) {
422 422
 					$error++;
423 423
 					$this->error = $contratline->error;
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 			// Close lines not already closed
468 468
 			if ($contratline->statut != ContratLigne::STATUS_CLOSED) {
469 469
 				$contratline->date_end_real = $now;
470
-				$contratline->date_cloture = $now;	// For backward compatibility
470
+				$contratline->date_cloture = $now; // For backward compatibility
471 471
 				$contratline->user_closing_id = $user->id;
472 472
 				$contratline->statut = ContratLigne::STATUS_CLOSED;
473 473
 				$result = $contratline->close_line($user, $now, $comment, $notrigger);
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 			if (!$error) {
607 607
 				$this->ref = $num;
608 608
 				$this->status = self::STATUS_VALIDATED;
609
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
609
+				$this->statut = self::STATUS_VALIDATED; // deprecated
610 610
 				$this->date_validation = $now;
611 611
 			}
612 612
 		} else {
@@ -876,10 +876,10 @@  discard block
 block discarded – undo
876 876
 				$line->localtax2_tx		= $objp->localtax2_tx;
877 877
 				$line->localtax1_type	= $objp->localtax1_type;
878 878
 				$line->localtax2_type	= $objp->localtax2_type;
879
-				$line->subprice			= $objp->subprice;
879
+				$line->subprice = $objp->subprice;
880 880
 				$line->statut = $objp->status;
881 881
 				$line->status = $objp->status;
882
-				$line->remise_percent	= $objp->remise_percent;
882
+				$line->remise_percent = $objp->remise_percent;
883 883
 				$line->price_ht			= $objp->price_ht;
884 884
 				$line->price = $objp->price_ht; // For backward compatibility
885 885
 				$line->total_ht			= $objp->total_ht;
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
 				//$line->date_fin_prevue   = $this->db->jdate($objp->date_fin_validite);
923 923
 				//$line->date_fin_reel     = $this->db->jdate($objp->date_cloture);
924 924
 
925
-				$line->rang     = $objp->rang;
925
+				$line->rang = $objp->rang;
926 926
 
927 927
 				// Retrieve all extrafields for contract line
928 928
 				// fetch optionals attributes and labels
@@ -1398,7 +1398,7 @@  discard block
 block discarded – undo
1398 1398
 		}
1399 1399
 
1400 1400
 		if (!$error) {
1401
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
1401
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
1402 1402
 			if ($result < 0) {
1403 1403
 				$error++;
1404 1404
 			}
@@ -2038,7 +2038,7 @@  discard block
 block discarded – undo
2038 2038
 				}
2039 2039
 				$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
2040 2040
 			}
2041
-			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer;
2041
+			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer;
2042 2042
 			if (!$nofetch) {
2043 2043
 				$langs->load('project');
2044 2044
 				if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) {
@@ -2506,7 +2506,7 @@  discard block
 block discarded – undo
2506 2506
 		global $user;
2507 2507
 
2508 2508
 		$ticket = new Ticket($this->db);
2509
-		$nbTicket =  $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id));
2509
+		$nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id));
2510 2510
 
2511 2511
 		return ($nbTicket < 0 ? $nbTicket : $ticket->lines);
2512 2512
 	}
@@ -2528,7 +2528,7 @@  discard block
 block discarded – undo
2528 2528
 		global $conf, $langs;
2529 2529
 
2530 2530
 		if (!dol_strlen($modele)) {
2531
-			$modele = '';	// No doc template/generation by default
2531
+			$modele = ''; // No doc template/generation by default
2532 2532
 
2533 2533
 			if (!empty($this->model_pdf)) {
2534 2534
 				$modele = $this->model_pdf;
@@ -2625,14 +2625,14 @@  discard block
 block discarded – undo
2625 2625
 			}
2626 2626
 		}
2627 2627
 
2628
-		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) {
2628
+		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) {
2629 2629
 			$this->error = 'ErrorSetupNotComplete';
2630 2630
 			dol_syslog($this->error);
2631 2631
 			return -1;
2632 2632
 		}
2633 2633
 
2634 2634
 		// Set ref
2635
-		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php';
2635
+		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php';
2636 2636
 		$obj = getDolGlobalString('CONTRACT_ADDON');
2637 2637
 		$modContract = new $obj();
2638 2638
 		'@phan-var-force ModelNumRefContracts $modContrat';
@@ -2755,7 +2755,7 @@  discard block
 block discarded – undo
2755 2755
 
2756 2756
 					// Load contract
2757 2757
 					$object = new Contrat($this->db);
2758
-					$object->fetch($obj->rowid);		// fetch also lines
2758
+					$object->fetch($obj->rowid); // fetch also lines
2759 2759
 					//$object->fetch_thirdparty();
2760 2760
 
2761 2761
 					if ($object->id <= 0) {
@@ -2802,7 +2802,7 @@  discard block
 block discarded – undo
2802 2802
 					if ($expirationdate && $expirationdate < $enddatetoscan) {
2803 2803
 						dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate);
2804 2804
 						$newdate = $expirationdate;
2805
-						$protecti = 0;	// $protecti is to avoid infinite loop
2805
+						$protecti = 0; // $protecti is to avoid infinite loop
2806 2806
 						while ($newdate < $enddatetoscan && $protecti < 1000) {
2807 2807
 							$newdate = dol_time_plus_duree($newdate, (int) $duration_value, $duration_unit);
2808 2808
 							$protecti++;
@@ -2830,20 +2830,20 @@  discard block
 block discarded – undo
2830 2830
 
2831 2831
 								// Create an event
2832 2832
 								$actioncomm = new ActionComm($this->db);
2833
-								$actioncomm->type_code    = 'AC_OTH_AUTO';		// Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2833
+								$actioncomm->type_code    = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2834 2834
 								$actioncomm->code         = 'AC_'.$actioncode;
2835 2835
 								$actioncomm->label        = $label;
2836 2836
 								$actioncomm->datep        = $now;
2837 2837
 								$actioncomm->datef        = $now;
2838
-								$actioncomm->percentage   = -1;   // Not applicable
2838
+								$actioncomm->percentage   = -1; // Not applicable
2839 2839
 								$actioncomm->socid        = $object->socid;
2840
-								$actioncomm->authorid     = $user->id;   // User saving action
2841
-								$actioncomm->userownerid  = $user->id;	// Owner of action
2840
+								$actioncomm->authorid     = $user->id; // User saving action
2841
+								$actioncomm->userownerid  = $user->id; // Owner of action
2842 2842
 								$actioncomm->fk_element   = $object->id;
2843 2843
 								$actioncomm->elementtype  = 'contract';
2844 2844
 								$actioncomm->note_private = $comment;
2845 2845
 
2846
-								$ret = $actioncomm->create($user);       // User creating action
2846
+								$ret = $actioncomm->create($user); // User creating action
2847 2847
 							} else {
2848 2848
 								$contracterror[$object->id] = $object->ref;
2849 2849
 
@@ -2852,7 +2852,7 @@  discard block
 block discarded – undo
2852 2852
 								$this->error = $this->db->lasterror();
2853 2853
 							}
2854 2854
 
2855
-							if (! $errorforlocaltransaction) {
2855
+							if (!$errorforlocaltransaction) {
2856 2856
 								$this->db->commit();
2857 2857
 							} else {
2858 2858
 								$this->db->rollback();
Please login to merge, or discard this patch.