Completed
Branch develop (29f223)
by
unknown
19:41
created
htdocs/core/modules/contract/mod_contract_magre.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,8 +90,8 @@
 block discarded – undo
90 90
 	{
91 91
 		global $db, $langs;
92 92
 
93
-		require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
94
-		require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
93
+		require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
94
+		require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
95 95
 
96 96
 		$contract = new Contrat($db);
97 97
 		$contract->initAsSpecimen();
Please login to merge, or discard this patch.
htdocs/resource/class/html.formresource.class.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -263,14 +263,14 @@  discard block
 block discarded – undo
263 263
 
264 264
 		$size = '';
265 265
 		if (!empty($fieldsize)) {
266
-			$size = 'size="' . $fieldsize . '"';
266
+			$size = 'size="'.$fieldsize.'"';
267 267
 		}
268 268
 
269 269
 		if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
270
-			$out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT . '/core/ajax/ziptown.php') . "\n";
270
+			$out .= ajax_multiautocompleter($htmlname, $fields, DOL_URL_ROOT.'/core/ajax/ziptown.php')."\n";
271 271
 			$moreattrib .= ' autocomplete="off"';
272 272
 		}
273
-		$out .= '<input id="' . $htmlname . '" class="maxwidthonsmartphone' . ($morecss ? ' ' . $morecss : '') . '" type="text"' . ($moreattrib ? ' ' . $moreattrib : '') . ' name="' . $htmlname . '" ' . $size . ' value="' . $selected . '">' . "\n";
273
+		$out .= '<input id="'.$htmlname.'" class="maxwidthonsmartphone'.($morecss ? ' '.$morecss : '').'" type="text"'.($moreattrib ? ' '.$moreattrib : '').' name="'.$htmlname.'" '.$size.' value="'.$selected.'">'."\n";
274 274
 
275 275
 		return $out;
276 276
 	}
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		// phpcs:enable
295 295
 		global $conf, $langs, $user;
296 296
 
297
-		dol_syslog(get_class($this) . "::select_departement selected=" . $selected . ", country_codeid=" . $country_codeid, LOG_DEBUG);
297
+		dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid, LOG_DEBUG);
298 298
 
299 299
 		$langs->load("dict");
300 300
 
@@ -302,28 +302,28 @@  discard block
 block discarded – undo
302 302
 
303 303
 		// Search active departements/cantons/province of a region and actif country
304 304
 		$sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code, r.nom as region_name FROM";
305
-		$sql .= " " . $this->db->prefix() . "c_departements as d, " . $this->db->prefix() . "c_regions as r," . $this->db->prefix() . "c_country as c";
305
+		$sql .= " ".$this->db->prefix()."c_departements as d, ".$this->db->prefix()."c_regions as r,".$this->db->prefix()."c_country as c";
306 306
 		$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid";
307 307
 		$sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1";
308 308
 		if ($country_codeid && is_numeric($country_codeid)) {
309
-			$sql .= " AND c.rowid = '" . $this->db->escape($country_codeid) . "'";
309
+			$sql .= " AND c.rowid = '".$this->db->escape($country_codeid)."'";
310 310
 		}
311 311
 		if ($country_codeid && !is_numeric($country_codeid)) {
312
-			$sql .= " AND c.code = '" . $this->db->escape($country_codeid) . "'";
312
+			$sql .= " AND c.code = '".$this->db->escape($country_codeid)."'";
313 313
 		}
314 314
 		$sql .= " ORDER BY c.code, d.code_departement";
315 315
 
316 316
 		$result = $this->db->query($sql);
317 317
 		if ($result) {
318 318
 			if (!empty($htmlname)) {
319
-				$out .= '<select id="' . $htmlname . '" class="flat' . ($morecss ? ' ' . $morecss : '') . '" name="' . $htmlname . '">';
319
+				$out .= '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
320 320
 			}
321 321
 			if ($country_codeid) {
322 322
 				$out .= '<option value="0">&nbsp;</option>';
323 323
 			}
324 324
 			$num = $this->db->num_rows($result);
325 325
 			$i = 0;
326
-			dol_syslog(get_class($this) . "::select_departement num=" . $num, LOG_DEBUG);
326
+			dol_syslog(get_class($this)."::select_departement num=".$num, LOG_DEBUG);
327 327
 			if ($num) {
328 328
 				$country = '';
329 329
 				while ($i < $num) {
@@ -334,15 +334,15 @@  discard block
 block discarded – undo
334 334
 						if (!$country || $country != $obj->country) {
335 335
 							// Show break if we are in list with multiple countries
336 336
 							if (!$country_codeid && $obj->country_code) {
337
-								$out .= '<option value="-1" disabled data-html="----- ' . $obj->country . ' -----">----- ' . $obj->country . " -----</option>\n";
337
+								$out .= '<option value="-1" disabled data-html="----- '.$obj->country.' -----">----- '.$obj->country." -----</option>\n";
338 338
 								$country = $obj->country;
339 339
 							}
340 340
 						}
341 341
 
342 342
 						if (!empty($selected) && $selected == $obj->rowid) {
343
-							$out .= '<option value="' . $obj->rowid . '" selected>';
343
+							$out .= '<option value="'.$obj->rowid.'" selected>';
344 344
 						} else {
345
-							$out .= '<option value="' . $obj->rowid . '">';
345
+							$out .= '<option value="'.$obj->rowid.'">';
346 346
 						}
347 347
 
348 348
 						// If translation exists use it, otherwise use default name
@@ -351,13 +351,13 @@  discard block
 block discarded – undo
351 351
 							(getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 1 || getDolGlobalInt('MAIN_SHOW_STATE_CODE') == 2 || getDolGlobalString('MAIN_SHOW_STATE_CODE') === 'all')
352 352
 						) {
353 353
 							if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) {
354
-								$out .= $obj->region_name . ' - ' . $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
354
+								$out .= $obj->region_name.' - '.$obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
355 355
 							} else {
356
-								$out .= $obj->code . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
356
+								$out .= $obj->code.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
357 357
 							}
358 358
 						} else {
359 359
 							if (getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT') == 1) {
360
-								$out .= $obj->region_name . ' - ' . ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
360
+								$out .= $obj->region_name.' - '.($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
361 361
 							} else {
362 362
 								$out .= ($langs->trans($obj->code) != $obj->code ? $langs->trans($obj->code) : ($obj->name != '-' ? $obj->name : ''));
363 363
 							}
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 				$out .= '</select>';
373 373
 			}
374 374
 			if (!empty($htmlname) && $user->admin) {
375
-				$out .= ' ' . info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
375
+				$out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
376 376
 			}
377 377
 		} else {
378 378
 			dol_print_error($this->db);
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 
381 381
 		// Make select dynamic
382 382
 		if (!empty($htmlname)) {
383
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
383
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
384 384
 			$out .= ajax_combobox($htmlname);
385 385
 		}
386 386
 
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
@@ -259,12 +259,12 @@  discard block
 block discarded – undo
259 259
 	/*
260 260
 	 * No signature
261 261
 	 */
262
-	const STATUS_NO_SIGNATURE    = 0;
262
+	const STATUS_NO_SIGNATURE = 0;
263 263
 
264 264
 	/*
265 265
 	 * Signed by sender
266 266
 	 */
267
-	const STATUS_SIGNED_SENDER   = 1;
267
+	const STATUS_SIGNED_SENDER = 1;
268 268
 
269 269
 	/*
270 270
 	 * Signed by receiver
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	/*
275 275
 	 * Signed by all
276 276
 	 */
277
-	const STATUS_SIGNED_ALL      = 9; // To handle future kind of signature (ex: tripartite contract)
277
+	const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract)
278 278
 
279 279
 
280 280
 	/**
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 		if (getDolGlobalString('CONTRACT_ADDON')) {
305 305
 			$mybool = false;
306 306
 
307
-			$file = getDolGlobalString('CONTRACT_ADDON') . ".php";
307
+			$file = getDolGlobalString('CONTRACT_ADDON').".php";
308 308
 			$classname = getDolGlobalString('CONTRACT_ADDON');
309 309
 
310 310
 			// Include file with class
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 			if ($contratline->statut != ContratLigne::STATUS_OPEN) {
415 415
 				$contratline->context = $this->context;
416 416
 
417
-				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment);	// This call trigger LINECONTRACT_ACTIVATE
417
+				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE
418 418
 				if ($result < 0) {
419 419
 					$error++;
420 420
 					$this->error = $contratline->error;
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 			// Close lines not already closed
465 465
 			if ($contratline->statut != ContratLigne::STATUS_CLOSED) {
466 466
 				$contratline->date_end_real = $now;
467
-				$contratline->date_cloture = $now;	// For backward compatibility
467
+				$contratline->date_cloture = $now; // For backward compatibility
468 468
 				$contratline->user_closing_id = $user->id;
469 469
 				$contratline->statut = ContratLigne::STATUS_CLOSED;
470 470
 				$result = $contratline->close_line($user, $now, $comment, $notrigger);
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 			if (!$error) {
604 604
 				$this->ref = $num;
605 605
 				$this->status = self::STATUS_VALIDATED;
606
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
606
+				$this->statut = self::STATUS_VALIDATED; // deprecated
607 607
 				$this->date_validation = $now;
608 608
 			}
609 609
 		} else {
@@ -873,10 +873,10 @@  discard block
 block discarded – undo
873 873
 				$line->localtax2_tx		= $objp->localtax2_tx;
874 874
 				$line->localtax1_type	= $objp->localtax1_type;
875 875
 				$line->localtax2_type	= $objp->localtax2_type;
876
-				$line->subprice			= $objp->subprice;
876
+				$line->subprice = $objp->subprice;
877 877
 				$line->statut = $objp->status;
878 878
 				$line->status = $objp->status;
879
-				$line->remise_percent	= $objp->remise_percent;
879
+				$line->remise_percent = $objp->remise_percent;
880 880
 				$line->price_ht			= $objp->price_ht;
881 881
 				$line->price = $objp->price_ht; // For backward compatibility
882 882
 				$line->total_ht			= $objp->total_ht;
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 				//$line->date_fin_prevue   = $this->db->jdate($objp->date_fin_validite);
920 920
 				//$line->date_fin_reel     = $this->db->jdate($objp->date_cloture);
921 921
 
922
-				$line->rang     = $objp->rang;
922
+				$line->rang = $objp->rang;
923 923
 
924 924
 				// Retrieve all extrafields for contract line
925 925
 				// fetch optionals attributes and labels
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
 		}
1396 1396
 
1397 1397
 		if (!$error) {
1398
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
1398
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
1399 1399
 			if ($result < 0) {
1400 1400
 				$error++;
1401 1401
 			}
@@ -2032,7 +2032,7 @@  discard block
 block discarded – undo
2032 2032
 				}
2033 2033
 				$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
2034 2034
 			}
2035
-			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer;
2035
+			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer;
2036 2036
 			if (!$nofetch) {
2037 2037
 				$langs->load('project');
2038 2038
 				if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) {
@@ -2500,7 +2500,7 @@  discard block
 block discarded – undo
2500 2500
 		global $user;
2501 2501
 
2502 2502
 		$ticket = new Ticket($this->db);
2503
-		$nbTicket =  $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id));
2503
+		$nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', '', 0, '', array('t.fk_contract' => $this->id));
2504 2504
 
2505 2505
 		return ($nbTicket < 0 ? $nbTicket : $ticket->lines);
2506 2506
 	}
@@ -2522,7 +2522,7 @@  discard block
 block discarded – undo
2522 2522
 		global $conf, $langs;
2523 2523
 
2524 2524
 		if (!dol_strlen($modele)) {
2525
-			$modele = '';	// No doc template/generation by default
2525
+			$modele = ''; // No doc template/generation by default
2526 2526
 
2527 2527
 			if (!empty($this->model_pdf)) {
2528 2528
 				$modele = $this->model_pdf;
@@ -2619,14 +2619,14 @@  discard block
 block discarded – undo
2619 2619
 			}
2620 2620
 		}
2621 2621
 
2622
-		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) {
2622
+		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) {
2623 2623
 			$this->error = 'ErrorSetupNotComplete';
2624 2624
 			dol_syslog($this->error);
2625 2625
 			return -1;
2626 2626
 		}
2627 2627
 
2628 2628
 		// Set ref
2629
-		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php';
2629
+		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php';
2630 2630
 		$obj = getDolGlobalString('CONTRACT_ADDON');
2631 2631
 		$modContract = new $obj();
2632 2632
 		'@phan-var-force CommonNumRefGenerator $modContrat';
@@ -2749,7 +2749,7 @@  discard block
 block discarded – undo
2749 2749
 
2750 2750
 					// Load contract
2751 2751
 					$object = new Contrat($this->db);
2752
-					$object->fetch($obj->rowid);		// fetch also lines
2752
+					$object->fetch($obj->rowid); // fetch also lines
2753 2753
 					//$object->fetch_thirdparty();
2754 2754
 
2755 2755
 					if ($object->id <= 0) {
@@ -2796,7 +2796,7 @@  discard block
 block discarded – undo
2796 2796
 					if ($expirationdate && $expirationdate < $enddatetoscan) {
2797 2797
 						dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate);
2798 2798
 						$newdate = $expirationdate;
2799
-						$protecti = 0;	// $protecti is to avoid infinite loop
2799
+						$protecti = 0; // $protecti is to avoid infinite loop
2800 2800
 						while ($newdate < $enddatetoscan && $protecti < 1000) {
2801 2801
 							$newdate = dol_time_plus_duree($newdate, (int) $duration_value, $duration_unit);
2802 2802
 							$protecti++;
@@ -2824,20 +2824,20 @@  discard block
 block discarded – undo
2824 2824
 
2825 2825
 								// Create an event
2826 2826
 								$actioncomm = new ActionComm($this->db);
2827
-								$actioncomm->type_code    = 'AC_OTH_AUTO';		// Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2827
+								$actioncomm->type_code    = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2828 2828
 								$actioncomm->code         = 'AC_'.$actioncode;
2829 2829
 								$actioncomm->label        = $label;
2830 2830
 								$actioncomm->datep        = $now;
2831 2831
 								$actioncomm->datef        = $now;
2832
-								$actioncomm->percentage   = -1;   // Not applicable
2832
+								$actioncomm->percentage   = -1; // Not applicable
2833 2833
 								$actioncomm->socid        = $object->socid;
2834
-								$actioncomm->authorid     = $user->id;   // User saving action
2835
-								$actioncomm->userownerid  = $user->id;	// Owner of action
2834
+								$actioncomm->authorid     = $user->id; // User saving action
2835
+								$actioncomm->userownerid  = $user->id; // Owner of action
2836 2836
 								$actioncomm->fk_element   = $object->id;
2837 2837
 								$actioncomm->elementtype  = 'contract';
2838 2838
 								$actioncomm->note_private = $comment;
2839 2839
 
2840
-								$ret = $actioncomm->create($user);       // User creating action
2840
+								$ret = $actioncomm->create($user); // User creating action
2841 2841
 							} else {
2842 2842
 								$contracterror[$object->id] = $object->ref;
2843 2843
 
@@ -2846,7 +2846,7 @@  discard block
 block discarded – undo
2846 2846
 								$this->error = $this->db->lasterror();
2847 2847
 							}
2848 2848
 
2849
-							if (! $errorforlocaltransaction) {
2849
+							if (!$errorforlocaltransaction) {
2850 2850
 								$this->db->commit();
2851 2851
 							} else {
2852 2852
 								$this->db->rollback();
Please login to merge, or discard this patch.
dev/tools/rector/rector.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,31 +31,31 @@
 block discarded – undo
31 31
 use Rector\Set\ValueObject\LevelSetList;
32 32
 use Rector\Set\ValueObject\SetList;
33 33
 
34
-return static function (RectorConfig $rectorConfig): void {
34
+return static function(RectorConfig $rectorConfig): void {
35 35
 	$rectorConfig->phpVersion(PhpVersion::PHP_71);
36 36
 	//$rectorConfig->indent(' ', 4);
37 37
 
38 38
 	// Traits seems not supported correctly by rector without declaring them as bootstrapFiles
39 39
 	$arrayoftraitfiles = array(
40
-		__DIR__ . '/../../../htdocs/core/class/commonincoterm.class.php',
41
-		__DIR__ . '/../../../htdocs/core/class/commonpeople.class.php',
42
-		__DIR__ . '/../../../htdocs/core/class/commonsocialnetworks.class.php'
40
+		__DIR__.'/../../../htdocs/core/class/commonincoterm.class.php',
41
+		__DIR__.'/../../../htdocs/core/class/commonpeople.class.php',
42
+		__DIR__.'/../../../htdocs/core/class/commonsocialnetworks.class.php'
43 43
 	);
44 44
 	$rectorConfig->bootstrapFiles($arrayoftraitfiles);
45 45
 
46 46
 	$rectorConfig->paths([
47
-		__DIR__ . '/../../../htdocs/',
48
-		__DIR__ . '/../../../scripts/',
49
-		__DIR__ . '/../../../test/phpunit/',
47
+		__DIR__.'/../../../htdocs/',
48
+		__DIR__.'/../../../scripts/',
49
+		__DIR__.'/../../../test/phpunit/',
50 50
 	]);
51 51
 
52 52
 	$rectorConfig->skip([
53 53
 		'**/includes/**',
54 54
 		'**/custom/**',
55 55
 		'**/vendor/**',
56
-		'**/rector/**',		// Disable this line to test the "test.php" file.
57
-		__DIR__ . '/../../../htdocs/custom/',
58
-		__DIR__ . '/../../../htdocs/install/doctemplates/*'
56
+		'**/rector/**', // Disable this line to test the "test.php" file.
57
+		__DIR__.'/../../../htdocs/custom/',
58
+		__DIR__.'/../../../htdocs/install/doctemplates/*'
59 59
 		//'test.php',
60 60
 	]);
61 61
 	$rectorConfig->parallel(240);
Please login to merge, or discard this patch.