Completed
Branch develop (5aee27)
by
unknown
23:55
created
htdocs/admin/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
 
137 137
 // Define $nbmodulesnotautoenabled - TODO This code is at different places
138 138
 $nbmodulesnotautoenabled = count($conf->modules);
139
-$listofmodulesautoenabled = array('user', 'agenda', 'fckeditor', 'export', 'import');	// All modules with ->enabled_bydefault to true (so enabled during install)
139
+$listofmodulesautoenabled = array('user', 'agenda', 'fckeditor', 'export', 'import'); // All modules with ->enabled_bydefault to true (so enabled during install)
140 140
 foreach ($listofmodulesautoenabled as $moduleautoenable) {
141 141
 	if (in_array($moduleautoenable, $conf->modules)) {
142 142
 		$nbmodulesnotautoenabled--;
Please login to merge, or discard this patch.
htdocs/comm/mailing/class/mailing_targets.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -205,9 +205,9 @@  discard block
 block discarded – undo
205 205
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing_cibles";
206 206
 		$sql .= " (fk_mailing, fk_contact, email, statut)";
207 207
 		$sql .= " VALUES (".((int) $this->fk_mailing).", ";
208
-		$sql .=  ((int) $this->fk_contact).", ";
208
+		$sql .= ((int) $this->fk_contact).", ";
209 209
 		$sql .= "'".$this->db->escape($this->email)."', ";
210
-		$sql .=  ((int) $conf->statut)." )";
210
+		$sql .= ((int) $conf->statut)." )";
211 211
 
212 212
 		dol_syslog(__METHOD__, LOG_DEBUG);
213 213
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 				return $this->id;
226 226
 			} else {
227 227
 				$this->db->rollback();
228
-				dol_syslog(__METHOD__ . ' ' . $this->error, LOG_ERR);
228
+				dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);
229 229
 				return -2;
230 230
 			}
231 231
 		} else {
@@ -248,12 +248,12 @@  discard block
 block discarded – undo
248 248
 		$this->db->begin();
249 249
 
250 250
 		$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles";
251
-		$sql .= " WHERE rowid = " . ((int) $this->id);
251
+		$sql .= " WHERE rowid = ".((int) $this->id);
252 252
 
253 253
 		dol_syslog(__METHOD__, LOG_DEBUG);
254 254
 		$resql = $this->db->query($sql);
255 255
 		if ($resql) {
256
-			dol_syslog(__METHOD__ . ' success');
256
+			dol_syslog(__METHOD__.' success');
257 257
 			$this->db->commit();
258 258
 			return 1;
259 259
 		} else {
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 		dol_syslog(__METHOD__, LOG_DEBUG);
429 429
 		$resql = $this->db->query($sql);
430 430
 		if ($resql) {
431
-			dol_syslog(__METHOD__ . ' success');
431
+			dol_syslog(__METHOD__.' success');
432 432
 			$this->db->commit();
433 433
 			return 1;
434 434
 		} else {
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 				$this->email = $obj->email;
483 483
 				$this->other = $obj->other;
484 484
 				$this->tag = $obj->tag;
485
-				$this->statut = $obj->status;	// deprecated
485
+				$this->statut = $obj->status; // deprecated
486 486
 				$this->status = $obj->status;
487 487
 				$this->source_url = $obj->source_url;
488 488
 				$this->source_id = $obj->source_id;
Please login to merge, or discard this patch.
htdocs/contrat/class/contrat.class.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 		if (getDolGlobalString('CONTRACT_ADDON')) {
318 318
 			$mybool = false;
319 319
 
320
-			$file = getDolGlobalString('CONTRACT_ADDON') . ".php";
320
+			$file = getDolGlobalString('CONTRACT_ADDON').".php";
321 321
 			$classname = getDolGlobalString('CONTRACT_ADDON');
322 322
 
323 323
 			// Include file with class
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 			if ($contratline->statut != ContratLigne::STATUS_OPEN) {
429 429
 				$contratline->context = $this->context;
430 430
 
431
-				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment);	// This call trigger LINECONTRACT_ACTIVATE
431
+				$result = $contratline->active_line($user, $date_start, !empty($date_end) ? $date_end : -1, $comment); // This call trigger LINECONTRACT_ACTIVATE
432 432
 				if ($result < 0) {
433 433
 					$error++;
434 434
 					$this->error = $contratline->error;
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 			// Close lines not already closed
482 482
 			if ($contratline->statut != ContratLigne::STATUS_CLOSED) {
483 483
 				$contratline->date_end_real = $now;
484
-				$contratline->date_cloture = $now;	// For backward compatibility
484
+				$contratline->date_cloture = $now; // For backward compatibility
485 485
 				$contratline->user_closing_id = $user->id;
486 486
 				$contratline->statut = ContratLigne::STATUS_CLOSED;
487 487
 
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 			if (!$error) {
628 628
 				$this->ref = $num;
629 629
 				$this->status = self::STATUS_VALIDATED;
630
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
630
+				$this->statut = self::STATUS_VALIDATED; // deprecated
631 631
 				$this->date_validation = $now;
632 632
 			}
633 633
 		} else {
@@ -903,10 +903,10 @@  discard block
 block discarded – undo
903 903
 				$line->localtax2_tx		= $objp->localtax2_tx;
904 904
 				$line->localtax1_type	= $objp->localtax1_type;
905 905
 				$line->localtax2_type	= $objp->localtax2_type;
906
-				$line->subprice			= $objp->subprice;
906
+				$line->subprice = $objp->subprice;
907 907
 				$line->statut           = $objp->status; // For backward compatibility
908 908
 				$line->status           = $objp->status;
909
-				$line->remise_percent	= $objp->remise_percent;
909
+				$line->remise_percent = $objp->remise_percent;
910 910
 				$line->total_ht			= $objp->total_ht;
911 911
 				$line->total_tva		= $objp->total_tva;
912 912
 				$line->total_localtax1	= $objp->total_localtax1;
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
 		}
1419 1419
 
1420 1420
 		if (!$error) {
1421
-			$result = $this->insertExtraFields();	// This delete and reinsert extrafields
1421
+			$result = $this->insertExtraFields(); // This delete and reinsert extrafields
1422 1422
 			if ($result < 0) {
1423 1423
 				$error++;
1424 1424
 			}
@@ -2045,7 +2045,7 @@  discard block
 block discarded – undo
2045 2045
 				}
2046 2046
 				$datas['customer'] = '<br><b>'.$langs->trans('Customer').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
2047 2047
 			}
2048
-			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '. $this->ref_customer;
2048
+			$datas['refcustomer'] = '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_customer;
2049 2049
 			if (!$nofetch) {
2050 2050
 				$langs->load('project');
2051 2051
 				if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) {
@@ -2084,7 +2084,7 @@  discard block
 block discarded – undo
2084 2084
 
2085 2085
 		$result = '';
2086 2086
 
2087
-		$baseurl = DOL_URL_ROOT . '/contrat/card.php';
2087
+		$baseurl = DOL_URL_ROOT.'/contrat/card.php';
2088 2088
 		$query = ['id' => $this->id];
2089 2089
 
2090 2090
 		//if ($option !== 'nolink')
@@ -2475,7 +2475,7 @@  discard block
 block discarded – undo
2475 2475
 		$this->note_public = 'This is a comment (public)';
2476 2476
 		$this->fk_project = 0;
2477 2477
 		// Lines
2478
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
2478
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
2479 2479
 		$xnbp = 0;
2480 2480
 		while ($xnbp < $nbp) {
2481 2481
 			$line = new ContratLigne($this->db);
@@ -2521,7 +2521,7 @@  discard block
 block discarded – undo
2521 2521
 		global $user;
2522 2522
 
2523 2523
 		$ticket = new Ticket($this->db);
2524
-		$nbTicket =  $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id));
2524
+		$nbTicket = $ticket->fetchAll($user, 'ASC', 't.datec', 0, 0, 0, array('t.fk_contract' => $this->id));
2525 2525
 
2526 2526
 		return ($nbTicket < 0 ? $nbTicket : $ticket->lines);
2527 2527
 	}
@@ -2543,7 +2543,7 @@  discard block
 block discarded – undo
2543 2543
 		global $conf, $langs;
2544 2544
 
2545 2545
 		if (!dol_strlen($modele)) {
2546
-			$modele = '';	// No doc template/generation by default
2546
+			$modele = ''; // No doc template/generation by default
2547 2547
 
2548 2548
 			if (!empty($this->model_pdf)) {
2549 2549
 				$modele = $this->model_pdf;
@@ -2641,14 +2641,14 @@  discard block
 block discarded – undo
2641 2641
 			}
2642 2642
 		}
2643 2643
 
2644
-		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').".php")) {
2644
+		if (!getDolGlobalString('CONTRACT_ADDON') || !is_readable(DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').".php")) {
2645 2645
 			$this->error = 'ErrorSetupNotComplete';
2646 2646
 			dol_syslog($this->error);
2647 2647
 			return -1;
2648 2648
 		}
2649 2649
 
2650 2650
 		// Set ref
2651
-		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/" . getDolGlobalString('CONTRACT_ADDON').'.php';
2651
+		require_once DOL_DOCUMENT_ROOT."/core/modules/contract/".getDolGlobalString('CONTRACT_ADDON').'.php';
2652 2652
 		$obj = getDolGlobalString('CONTRACT_ADDON');
2653 2653
 		$modContract = new $obj();
2654 2654
 		'@phan-var-force ModelNumRefContracts $modContract';
@@ -2771,7 +2771,7 @@  discard block
 block discarded – undo
2771 2771
 
2772 2772
 					// Load contract
2773 2773
 					$object = new Contrat($this->db);
2774
-					$object->fetch($obj->rowid);		// fetch also lines
2774
+					$object->fetch($obj->rowid); // fetch also lines
2775 2775
 
2776 2776
 					if ($object->id <= 0) {
2777 2777
 						$error++;
@@ -2817,7 +2817,7 @@  discard block
 block discarded – undo
2817 2817
 					if ($expirationdate && $expirationdate < $enddatetoscan) {
2818 2818
 						dol_syslog("Define the newdate of end of services from expirationdate=".$expirationdate);
2819 2819
 						$newdate = $expirationdate;
2820
-						$protecti = 0;	// $protecti is to avoid infinite loop
2820
+						$protecti = 0; // $protecti is to avoid infinite loop
2821 2821
 						while ($newdate < $enddatetoscan && $protecti < 1000) {
2822 2822
 							$newdate = dol_time_plus_duree($newdate, (int) $duration_value, $duration_unit);
2823 2823
 							$protecti++;
@@ -2856,21 +2856,21 @@  discard block
 block discarded – undo
2856 2856
 
2857 2857
 								// Create an event
2858 2858
 								$actioncomm = new ActionComm($this->db);
2859
-								$actioncomm->type_code    = 'AC_OTH_AUTO';		// Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2859
+								$actioncomm->type_code    = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
2860 2860
 								$actioncomm->code         = 'AC_'.$actioncode;
2861 2861
 								$actioncomm->label        = $label;
2862 2862
 								$actioncomm->datep        = $now;
2863 2863
 								$actioncomm->datef        = $now;
2864
-								$actioncomm->percentage   = -1;   // Not applicable
2864
+								$actioncomm->percentage   = -1; // Not applicable
2865 2865
 								$actioncomm->socid        = $object->socid;
2866
-								$actioncomm->authorid     = $user->id;   // User saving action
2867
-								$actioncomm->userownerid  = $user->id;	// Owner of action
2866
+								$actioncomm->authorid     = $user->id; // User saving action
2867
+								$actioncomm->userownerid  = $user->id; // Owner of action
2868 2868
 								$actioncomm->fk_element   = $object->id;
2869 2869
 								$actioncomm->elementid    = $object->id;
2870 2870
 								$actioncomm->elementtype  = 'contract';
2871 2871
 								$actioncomm->note_private = $comment;
2872 2872
 
2873
-								$ret = $actioncomm->create($user);       // User creating action
2873
+								$ret = $actioncomm->create($user); // User creating action
2874 2874
 							} else {
2875 2875
 								$contracterror[$object->id] = $object->ref;
2876 2876
 
@@ -2879,7 +2879,7 @@  discard block
 block discarded – undo
2879 2879
 								$this->error = $this->db->lasterror();
2880 2880
 							}
2881 2881
 
2882
-							if (! $errorforlocaltransaction) {
2882
+							if (!$errorforlocaltransaction) {
2883 2883
 								$this->db->commit();
2884 2884
 							} else {
2885 2885
 								$this->db->rollback();
@@ -2937,7 +2937,7 @@  discard block
 block discarded – undo
2937 2937
 		$return .= img_picto('', $this->picto);
2938 2938
 		$return .= '</span>';
2939 2939
 		$return .= '<div class="info-box-content">';
2940
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl() . '</span>';
2940
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl().'</span>';
2941 2941
 		if ($selected >= 0) {
2942 2942
 			$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
2943 2943
 		}
Please login to merge, or discard this patch.
htdocs/install/repair.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 		],
270 270
 		[
271 271
 			'name' => 'force_utf8mb4_on_tables',
272
-			'info' => 'Force utf8mb4 + row=dynamic, for mysql/mariadb only' . $warning_using_utf8mb4
272
+			'info' => 'Force utf8mb4 + row=dynamic, for mysql/mariadb only'.$warning_using_utf8mb4
273 273
 		],
274 274
 		[
275 275
 			'name' => 'force_collation_from_conf_on_tables',
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 		$url_test = $_SERVER['PHP_SELF'].'?'.$option.'=test';
298 298
 		$url_confirmed = $_SERVER['PHP_SELF'].'?'.$option.'=confirmed';
299 299
 		print '<tr>';
300
-		print '<td>' . $option . '</td>';
300
+		print '<td>'.$option.'</td>';
301 301
 		print '<td>';
302 302
 		if ($tooltip) {
303 303
 			print $form->textwithpicto($info, $tooltip);
@@ -1318,13 +1318,13 @@  discard block
 block discarded – undo
1318 1318
 							}
1319 1319
 							if ($key == 'js') {
1320 1320
 								$value = $obj->value;
1321
-								$valuearray = (array) json_decode($value);	// Force cast into array because sometimes it is a stdClass
1321
+								$valuearray = (array) json_decode($value); // Force cast into array because sometimes it is a stdClass
1322 1322
 								$reloffile = $valuearray[0];
1323 1323
 								$reloffile = preg_replace('/^\//', '', $valuearray[0]);
1324 1324
 							}
1325 1325
 							if ($key == 'css') {
1326 1326
 								$value = $obj->value;
1327
-								$valuearray = (array) json_decode($value);	// Force cast into array because sometimes it is a stdClass
1327
+								$valuearray = (array) json_decode($value); // Force cast into array because sometimes it is a stdClass
1328 1328
 								if ($value && (!is_array($valuearray) || count($valuearray) == 0)) {
1329 1329
 									$valuearray = array();
1330 1330
 									$valuearray[0] = $value; // If value was not a json array but a string
@@ -1340,7 +1340,7 @@  discard block
 block discarded – undo
1340 1340
 									$result = 'found'; // If error, we force like if we found to avoid any deletion
1341 1341
 								}
1342 1342
 							} else {
1343
-								$result = 'found';	//
1343
+								$result = 'found'; //
1344 1344
 							}
1345 1345
 
1346 1346
 							if (!$result) {
@@ -1915,7 +1915,7 @@  discard block
 block discarded – undo
1915 1915
 
1916 1916
 					$sql_attach = 'INSERT INTO '.MAIN_DB_PREFIX.'receptiondet_batch';
1917 1917
 					$sql_attach .= ' (fk_element, fk_product, fk_elementdet, qty, fk_entrepot, fk_user, datec, comment, status, tms, batch, eatby, sellby)';
1918
-					$sql_attach .= " VALUES (".$sql_attach_values.")";	// The string is already sanitized
1918
+					$sql_attach .= " VALUES (".$sql_attach_values.")"; // The string is already sanitized
1919 1919
 				}
1920 1920
 
1921 1921
 				if ($repair_link_dispatch_lines_supplier_order_lines == 'confirmed') {
@@ -1962,16 +1962,16 @@  discard block
 block discarded – undo
1962 1962
 
1963 1963
 // Repair llx_commande_fournisseur to eliminate duplicate reference
1964 1964
 if ($ok && GETPOST('repair_supplier_order_duplicate_ref')) {
1965
-	require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php';
1966
-	include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
1965
+	require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
1966
+	include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
1967 1967
 
1968 1968
 	$db->begin();
1969 1969
 
1970 1970
 	$err = 0;
1971 1971
 
1972 1972
 	// Query to find all duplicate supplier orders
1973
-	$sql = "SELECT * FROM " . MAIN_DB_PREFIX . "commande_fournisseur";
1974
-	$sql .= " WHERE ref IN (SELECT cf.ref FROM " . MAIN_DB_PREFIX . "commande_fournisseur cf GROUP BY cf.ref, cf.entity HAVING COUNT(cf.rowid) > 1)";
1973
+	$sql = "SELECT * FROM ".MAIN_DB_PREFIX."commande_fournisseur";
1974
+	$sql .= " WHERE ref IN (SELECT cf.ref FROM ".MAIN_DB_PREFIX."commande_fournisseur cf GROUP BY cf.ref, cf.entity HAVING COUNT(cf.rowid) > 1)";
1975 1975
 
1976 1976
 	// Build a list of ref => []CommandeFournisseur
1977 1977
 	$duplicateSupplierOrders = [];
@@ -1997,7 +1997,7 @@  discard block
 block discarded – undo
1997 1997
 
1998 1998
 			$newRef = $supplierOrder->getNextNumRef($soc);
1999 1999
 
2000
-			$sql = "UPDATE " . MAIN_DB_PREFIX . "commande_fournisseur cf SET cf.ref = '" . $db->escape($newRef) . "' WHERE cf.rowid = " . (int) $supplierOrder->id;
2000
+			$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur cf SET cf.ref = '".$db->escape($newRef)."' WHERE cf.rowid = ".(int) $supplierOrder->id;
2001 2001
 			if (!$db->query($sql)) {
2002 2002
 				$err++;
2003 2003
 			}
@@ -2052,7 +2052,7 @@  discard block
 block discarded – undo
2052 2052
 					// Calcul de la somme des paiements reçus
2053 2053
 					$sql_paiements = "SELECT SUM(amount) as somme from ".MAIN_DB_PREFIX."paiement_facture WHERE fk_facture = $obj->rowid";
2054 2054
 					$montantPaiements = $db->fetch_object($db->query($sql_paiements))->somme;
2055
-					$totHt= ($obj_calcul->total_ht ? price2num($obj_calcul->total_ht, 'MT') : 0);
2055
+					$totHt = ($obj_calcul->total_ht ? price2num($obj_calcul->total_ht, 'MT') : 0);
2056 2056
 					$totTva = ($obj_calcul->total_tva ? price2num($obj_calcul->total_tva, 'MT') : 0);
2057 2057
 					$totLocal1 = ($obj_calcul->localtax1 ? price2num($obj_calcul->localtax1, 'MT') : 0);
2058 2058
 					$totLocal2 = ($obj_calcul->localtax2 ? price2num($obj_calcul->localtax2, 'MT') : 0);
@@ -2065,8 +2065,8 @@  discard block
 block discarded – undo
2065 2065
 							localtax1 = $totLocal1,
2066 2066
 							localtax2 = $totLocal2,
2067 2067
 							total_ttc = $totTtc,
2068
-							fk_statut = ".($totTtc == price2num($montantPaiements, 'MT') ? 2 : 1 ).",
2069
-							paid = ".($totTtc == price2num($montantPaiements, 'MT') ? 1 : 0 )."
2068
+							fk_statut = ".($totTtc == price2num($montantPaiements, 'MT') ? 2 : 1).",
2069
+							paid = ".($totTtc == price2num($montantPaiements, 'MT') ? 1 : 0)."
2070 2070
 						WHERE
2071 2071
 							rowid = $obj->rowid";
2072 2072
 					$db->query($sql_maj);
@@ -2130,7 +2130,7 @@  discard block
 block discarded – undo
2130 2130
 							dol_mkdir($destin.'/'.$file);
2131 2131
 							while (($thumb = readdir($thumbs)) !== false) {
2132 2132
 								$res = dol_move($origin.'/'.$file.'/'.$thumb, $destin.'/'.$file.'/'.$thumb);
2133
-								$msg = ($res ? '  * Migration successful' : 'Migration failed') . ' for file '.$origin.'/'.$file.'.<br>';
2133
+								$msg = ($res ? '  * Migration successful' : 'Migration failed').' for file '.$origin.'/'.$file.'.<br>';
2134 2134
 								print ($msg);
2135 2135
 							}
2136 2136
 							// dol_delete_dir($origin.'/'.$file);
@@ -2138,7 +2138,7 @@  discard block
 block discarded – undo
2138 2138
 					} else {
2139 2139
 						if (dol_is_file($origin.'/'.$file)) {
2140 2140
 							$res = dol_move($origin.'/'.$file, $destin.'/'.$file);
2141
-							$msg = ($res ? '  * Migration successful' : 'Migration failed') . ' for file '.$origin.'/'.$file.'.<br>';
2141
+							$msg = ($res ? '  * Migration successful' : 'Migration failed').' for file '.$origin.'/'.$file.'.<br>';
2142 2142
 							print ($msg);
2143 2143
 						}
2144 2144
 					}
Please login to merge, or discard this patch.
htdocs/api/class/api_documents.class.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 				throw new RestException(500, 'Error generating document');
217 217
 			}
218 218
 		} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') {
219
-			require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
219
+			require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
220 220
 			$tmpobject = new FactureFournisseur($this->db);
221 221
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
222 222
 			if (!$result) {
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 				throw new RestException(500, 'Error generating document');
254 254
 			}
255 255
 		} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
256
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
256
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
257 257
 
258 258
 			$tmpobject = new Contrat($this->db);
259 259
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 				throw new RestException(500, 'Error generating document missing doctemplate parameter');
270 270
 			}
271 271
 		} elseif ($modulepart == 'expedition' || $modulepart == 'shipment') {
272
-			require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
272
+			require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
273 273
 
274 274
 			$tmpobject = new Expedition($this->db);
275 275
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 				throw new RestException(500, 'Error generating document missing doctemplate parameter');
286 286
 			}
287 287
 		} elseif ($modulepart == 'mrp') {
288
-			require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
288
+			require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
289 289
 
290 290
 			$tmpobject = new Mo($this->db);
291 291
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 				throw new RestException(404, 'User not found');
390 390
 			}
391 391
 
392
-			$upload_dir = getMultidirOutput($object) . '/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id;
392
+			$upload_dir = getMultidirOutput($object).'/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id;
393 393
 		} elseif ($modulepart == 'adherent' || $modulepart == 'member') {
394 394
 			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
395 395
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 				throw new RestException(404, 'Member not found');
404 404
 			}
405 405
 
406
-			$upload_dir = getMultidirOutput($object) . "/".get_exdir(0, 0, 0, 1, $object, 'member');
406
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'member');
407 407
 		} elseif ($modulepart == 'propal' || $modulepart == 'proposal') {
408 408
 			require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
409 409
 
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 				throw new RestException(404, 'Order not found');
446 446
 			}
447 447
 
448
-			$upload_dir = getMultidirOutput($object). "/".get_exdir(0, 0, 0, 1, $object, 'commande');
448
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'commande');
449 449
 		} elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') {
450 450
 			$modulepart = 'supplier_order';
451 451
 
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 				throw new RestException(404, 'Purchase order not found');
462 462
 			}
463 463
 
464
-			$upload_dir = getMultidirOutput($object) . "/commande/".dol_sanitizeFileName($object->ref);
464
+			$upload_dir = getMultidirOutput($object)."/commande/".dol_sanitizeFileName($object->ref);
465 465
 		} elseif ($modulepart == 'shipment' || $modulepart == 'expedition') {
466 466
 			require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
467 467
 
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 				throw new RestException(404, 'Shipment not found');
476 476
 			}
477 477
 
478
-			$upload_dir = getMultidirOutput($object) . "/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment');
478
+			$upload_dir = getMultidirOutput($object)."/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment');
479 479
 		} elseif ($modulepart == 'facture' || $modulepart == 'invoice') {
480 480
 			require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
481 481
 
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 				throw new RestException(404, 'Invoice not found');
490 490
 			}
491 491
 
492
-			$upload_dir = getMultidirOutput($object) . "/".get_exdir(0, 0, 0, 1, $object, 'invoice');
492
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
493 493
 		} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') {
494 494
 			$modulepart = 'supplier_invoice';
495 495
 
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 				throw new RestException(404, 'Invoice not found');
506 506
 			}
507 507
 
508
-			$upload_dir = getMultidirOutput($object) . "/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
508
+			$upload_dir = getMultidirOutput($object)."/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
509 509
 		} elseif ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'service') {
510 510
 			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
511 511
 
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 				throw new RestException(404, 'Event not found');
536 536
 			}
537 537
 
538
-			$upload_dir = getMultidirOutput($object) . '/'.dol_sanitizeFileName($object->ref);
538
+			$upload_dir = getMultidirOutput($object).'/'.dol_sanitizeFileName($object->ref);
539 539
 		} elseif ($modulepart == 'expensereport') {
540 540
 			require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
541 541
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 				throw new RestException(404, 'Expense report not found');
550 550
 			}
551 551
 
552
-			$upload_dir = getMultidirOutput($object) . '/'.dol_sanitizeFileName($object->ref);
552
+			$upload_dir = getMultidirOutput($object).'/'.dol_sanitizeFileName($object->ref);
553 553
 		} elseif ($modulepart == 'ticket') {
554 554
 			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
555 555
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 				throw new RestException(404, 'KM article not found');
578 578
 			}
579 579
 
580
-			$upload_dir = getMultidirOutput($object) . '/knowledgerecord/'.dol_sanitizeFileName($object->ref);
580
+			$upload_dir = getMultidirOutput($object).'/knowledgerecord/'.dol_sanitizeFileName($object->ref);
581 581
 		} elseif ($modulepart == 'categorie' || $modulepart == 'category') {
582 582
 			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
583 583
 
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
 			// $recursive = 0;
611 611
 		} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
612 612
 			$modulepart = 'contrat';
613
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
613
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
614 614
 
615 615
 			$object = new Contrat($this->db);
616 616
 			$result = $object->fetch($id, $ref);
@@ -618,10 +618,10 @@  discard block
 block discarded – undo
618 618
 				throw new RestException(404, 'Contract not found');
619 619
 			}
620 620
 
621
-			$upload_dir = getMultidirOutput($object) . "/" . get_exdir(0, 0, 0, 1, $object, 'contract');
621
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'contract');
622 622
 		} elseif ($modulepart == 'intervention' || $modulepart == 'ficheinter') {
623 623
 			$modulepart = 'ficheinter';
624
-			require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
624
+			require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
625 625
 
626 626
 			$object = new Fichinter($this->db);
627 627
 			$result = $object->fetch($id, $ref);
@@ -629,20 +629,20 @@  discard block
 block discarded – undo
629 629
 				throw new RestException(404, 'Interventional not found');
630 630
 			}
631 631
 
632
-			$upload_dir = $conf->ficheinter->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'ficheinter');
632
+			$upload_dir = $conf->ficheinter->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'ficheinter');
633 633
 		} elseif ($modulepart == 'projet' || $modulepart == 'project') {
634 634
 			$modulepart = 'project';
635
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
635
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
636 636
 
637 637
 			$object = new Project($this->db);
638 638
 			$result = $object->fetch($id, $ref);
639 639
 			if (!$result) {
640 640
 				throw new RestException(404, 'Project not found');
641 641
 			}
642
-			$upload_dir = $conf->project->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'project');
642
+			$upload_dir = $conf->project->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'project');
643 643
 		} elseif ($modulepart == 'task' || $modulepart == 'project_task') {
644 644
 			$modulepart = 'project_task';
645
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
645
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
646 646
 
647 647
 			if (!DolibarrApiAccess::$user->hasRight('projet', 'lire')) {
648 648
 				throw new RestException(403);
@@ -660,10 +660,10 @@  discard block
 block discarded – undo
660 660
 				throw new RestException(500, 'Error while fetching project for task');
661 661
 			}
662 662
 
663
-			$upload_dir = $conf->project->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . "/" . dol_sanitizeFileName($object->ref);
663
+			$upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($object->project->ref)."/".dol_sanitizeFileName($object->ref);
664 664
 		} elseif ($modulepart == 'mrp') {
665 665
 			$modulepart = 'mrp';
666
-			require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
666
+			require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
667 667
 
668 668
 			$object = new Mo($this->db);
669 669
 			$result = $object->fetch($id, $ref);
@@ -671,23 +671,23 @@  discard block
 block discarded – undo
671 671
 				throw new RestException(404, 'MO not found');
672 672
 			}
673 673
 
674
-			$upload_dir = getMultidirOutput($object) . "/" . get_exdir(0, 0, 0, 1, $object, 'mrp');
674
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'mrp');
675 675
 		} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
676 676
 			$modulepart = 'contact';
677 677
 			require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
678 678
 
679 679
 			$object = new Contact($this->db);
680
-			$result = $object->fetch($id?$id:$ref);
680
+			$result = $object->fetch($id ? $id : $ref);
681 681
 			if (!$result) {
682 682
 				throw new RestException(404, 'Contact not found');
683 683
 			}
684
-			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity] . "/contact/" . get_exdir(0, 0, 0, 1, $object, 'contact');
684
+			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity]."/contact/".get_exdir(0, 0, 0, 1, $object, 'contact');
685 685
 		} else {
686 686
 			throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
687 687
 		}
688 688
 
689 689
 		$objectType = $modulepart;
690
-		if (! empty($object->id) && ! empty($object->table_element)) {
690
+		if (!empty($object->id) && !empty($object->table_element)) {
691 691
 			$objectType = $object->table_element;
692 692
 		}
693 693
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 					throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror());
706 706
 				} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
707 707
 					$count = count($filearray);
708
-					for ($i = 0 ; $i < $count ; $i++) {
708
+					for ($i = 0; $i < $count; $i++) {
709 709
 						foreach ($ecmfile->lines as $line) {
710 710
 							unset($line->db);
711 711
 							if ($filearray[$i]['name'] == $line->filename) {
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 				$object = new Propal($this->db);
886 886
 			} elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') {
887 887
 				$modulepart = 'agenda';
888
-				require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
888
+				require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
889 889
 				$object = new ActionComm($this->db);
890 890
 			} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
891 891
 				$modulepart = 'contact';
@@ -897,18 +897,18 @@  discard block
 block discarded – undo
897 897
 				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
898 898
 				$object = new Societe($this->db);
899 899
 				$fetchbyid = true;
900
-			} elseif ($modulepart == 'ticket' ) {
900
+			} elseif ($modulepart == 'ticket') {
901 901
 				$modulepart = 'ticket';
902 902
 				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
903 903
 				$object = new Ticket($this->db);
904 904
 				$fetchbyid = true;
905 905
 			} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
906 906
 				$modulepart = 'contrat';
907
-				require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
907
+				require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
908 908
 				$object = new Contrat($this->db);
909 909
 			} elseif ($modulepart == 'mrp') {
910 910
 				$modulepart = 'mrp';
911
-				require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
911
+				require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
912 912
 				$object = new Mo($this->db);
913 913
 			} elseif ($modulepart == 'ecm') {
914 914
 				throw new RestException(500, 'Using a non empty "ref" is not compatible with using modulepart = '.$modulepart);
Please login to merge, or discard this patch.
htdocs/fourn/facture/card.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	// Action clone object
206 206
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) {
207 207
 		$objectutil = dol_clone($object, 1); // To avoid to denaturate loaded object when setting some properties for clone. We use native clone to keep this->db valid.
208
-		'@phan-var-force FactureFournisseur $objectutil';  // Same object type for cloned object
208
+		'@phan-var-force FactureFournisseur $objectutil'; // Same object type for cloned object
209 209
 
210 210
 		if (GETPOST('newsupplierref', 'alphanohtml')) {
211 211
 			$objectutil->ref_supplier = GETPOST('newsupplierref', 'alphanohtml');
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 		$db->begin();
801 801
 
802 802
 		$error = 0;
803
-		$tmpproject = 0;  // Ensure a value
803
+		$tmpproject = 0; // Ensure a value
804 804
 
805 805
 		// Fill array 'array_options' with data from add form
806 806
 		$ret = $extrafields->setOptionalsFromPost(null, $object);
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 			$error++;
809 809
 		}
810 810
 
811
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
811
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
812 812
 		$datedue = dol_mktime(0, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'), 'tzserver');
813 813
 		//var_dump($dateinvoice.' '.dol_print_date($dateinvoice, 'dayhour'));
814 814
 		//var_dump(dol_now('tzuserrel').' '.dol_get_last_hour(dol_now('tzuserrel')).' '.dol_print_date(dol_now('tzuserrel'),'dayhour').' '.dol_print_date(dol_get_last_hour(dol_now('tzuserrel')), 'dayhour'));
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 				$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
848 848
 				$object->socid = GETPOSTINT('socid');
849 849
 				$object->label = GETPOST('label', 'alphanohtml');
850
-				$object->libelle = $object->label;	// deprecated
850
+				$object->libelle = $object->label; // deprecated
851 851
 				$object->date = $dateinvoice;
852 852
 				$object->date_echeance = $datedue;
853 853
 				$object->note_public = GETPOST('note_public', 'restricthtml');
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
 				$object->subtype            = GETPOST('subtype', 'alphanohtml');
922 922
 				$object->socid				= GETPOSTINT('socid');
923 923
 				$object->label				= GETPOST('label', 'alphanohtml');
924
-				$object->libelle            = $object->label;  // Deprecated
924
+				$object->libelle            = $object->label; // Deprecated
925 925
 				$object->date               = $dateinvoice;
926 926
 				$object->date_echeance      = $datedue;
927 927
 				$object->note_public        = GETPOST('note_public', 'restricthtml');
@@ -1031,7 +1031,7 @@  discard block
 block discarded – undo
1031 1031
 				$object->cond_reglement_id	= (GETPOSTINT('type') == 3 ? 1 : GETPOSTINT('cond_reglement_id'));
1032 1032
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1033 1033
 				$object->fk_account         = GETPOSTINT('fk_account');
1034
-				$object->amount             = (float) price2num(GETPOST('amount'));  // FIXME: FactureFournisseur::$amount is deprecated and not used?
1034
+				$object->amount             = (float) price2num(GETPOST('amount')); // FIXME: FactureFournisseur::$amount is deprecated and not used?
1035 1035
 				//$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
1036 1036
 				//$object->remise_percent		= price2num(GETPOST('remise_percent'), '', 2);
1037 1037
 				$object->fk_incoterms       = GETPOSTINT('incoterm_id');
@@ -1084,28 +1084,28 @@  discard block
 block discarded – undo
1084 1084
 				$tmpproject = GETPOSTINT('projectid');
1085 1085
 
1086 1086
 				// Creation invoice
1087
-				$object->socid				= GETPOSTINT('socid');
1088
-				$object->type				= GETPOST('type', 'alphanohtml');
1089
-				$object->subtype            = GETPOSTINT('subtype');
1090
-				$object->ref				= GETPOST('ref', 'alphanohtml');
1091
-				$object->ref_supplier		= GETPOST('ref_supplier', 'alphanohtml');
1087
+				$object->socid = GETPOSTINT('socid');
1088
+				$object->type = GETPOST('type', 'alphanohtml');
1089
+				$object->subtype = GETPOSTINT('subtype');
1090
+				$object->ref = GETPOST('ref', 'alphanohtml');
1091
+				$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml');
1092 1092
 				$object->socid				= GETPOSTINT('socid');
1093 1093
 				$object->label				= GETPOST('label', 'alphanohtml');
1094
-				$object->libelle			= $object->label;	// deprecated
1095
-				$object->date				= $dateinvoice;
1096
-				$object->date_echeance		= $datedue;
1097
-				$object->note_public		= GETPOST('note_public', 'restricthtml');
1098
-				$object->note_private		= GETPOST('note_private', 'restricthtml');
1094
+				$object->libelle = $object->label; // deprecated
1095
+				$object->date = $dateinvoice;
1096
+				$object->date_echeance = $datedue;
1097
+				$object->note_public = GETPOST('note_public', 'restricthtml');
1098
+				$object->note_private = GETPOST('note_private', 'restricthtml');
1099 1099
 				$object->cond_reglement_id	= GETPOSTINT('cond_reglement_id');
1100 1100
 				$object->mode_reglement_id	= GETPOSTINT('mode_reglement_id');
1101 1101
 				$object->fk_account			= GETPOSTINT('fk_account');
1102 1102
 				$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1103 1103
 				$object->fk_project			= ($tmpproject > 0) ? $tmpproject : null;
1104
-				$object->fk_incoterms		= GETPOSTINT('incoterm_id');
1104
+				$object->fk_incoterms = GETPOSTINT('incoterm_id');
1105 1105
 				$object->location_incoterms	= GETPOST('location_incoterms', 'alpha');
1106 1106
 				$object->multicurrency_code	= GETPOST('multicurrency_code', 'alpha');
1107
-				$object->multicurrency_tx	= GETPOSTFLOAT('originmulticurrency_tx');
1108
-				$object->transport_mode_id	= GETPOSTINT('transport_mode_id');
1107
+				$object->multicurrency_tx = GETPOSTFLOAT('originmulticurrency_tx');
1108
+				$object->transport_mode_id = GETPOSTINT('transport_mode_id');
1109 1109
 
1110 1110
 				// Auto calculation of date due if not filled by user
1111 1111
 				if (empty($object->date_echeance)) {
@@ -1318,7 +1318,7 @@  discard block
 block discarded – undo
1318 1318
 									0,
1319 1319
 									$object->lines[0]->date_start,
1320 1320
 									$object->lines[0]->date_end,
1321
-									array(),  // array_options
1321
+									array(), // array_options
1322 1322
 									0,
1323 1323
 									0,
1324 1324
 									'',
@@ -1467,7 +1467,7 @@  discard block
 block discarded – undo
1467 1467
 		// Edit line
1468 1468
 		$db->begin();
1469 1469
 
1470
-		if (! $object->fetch($id) > 0) {
1470
+		if (!$object->fetch($id) > 0) {
1471 1471
 			dol_print_error($db);
1472 1472
 		}
1473 1473
 		$object->fetch_thirdparty();
@@ -1638,7 +1638,7 @@  discard block
 block discarded – undo
1638 1638
 			$price_ttc_devise = price2num(GETPOST('multicurrency_price_ttc'), 'CU', 2);
1639 1639
 		}
1640 1640
 
1641
-		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0);		// Can be '1.2' or '1.2 (CODE)'
1641
+		$tva_tx = (GETPOST('tva_tx') ? GETPOST('tva_tx') : 0); // Can be '1.2' or '1.2 (CODE)'
1642 1642
 
1643 1643
 		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
1644 1644
 
@@ -1781,7 +1781,7 @@  discard block
 block discarded – undo
1781 1781
 
1782 1782
 				// Get vat rate
1783 1783
 				if (!GETPOSTISSET('tva_tx')) {	// If vat rate not provided from the form (the form has the priority)
1784
-					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha');	// can be an id of price, or -1, -2, -99 or 'idprod_...'
1784
+					$tmpidprodfournprice = GETPOST('idprodfournprice', 'alpha'); // can be an id of price, or -1, -2, -99 or 'idprod_...'
1785 1785
 					if (is_numeric($tmpidprodfournprice) && (int) $tmpidprodfournprice > 0) {
1786 1786
 						$tmpidprodfournprice = (int) $tmpidprodfournprice;
1787 1787
 					} else {
@@ -2063,7 +2063,7 @@  discard block
 block discarded – undo
2063 2063
 		}
2064 2064
 	}
2065 2065
 	if ($action == 'update_extras' && $permissiontoeditextra) {
2066
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
2066
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
2067 2067
 
2068 2068
 		$attribute_name = GETPOST('attribute', 'aZ09');
2069 2069
 
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
 // Mode creation
2155 2155
 if ($action == 'create') {
2156 2156
 	$facturestatic = new FactureFournisseur($db);
2157
-	$selectedLines = array();  // Ensure initialised
2157
+	$selectedLines = array(); // Ensure initialised
2158 2158
 
2159 2159
 	print load_fiche_titre($langs->trans('NewSupplierInvoice'), '', 'supplier_invoice');
2160 2160
 
@@ -2172,7 +2172,7 @@  discard block
 block discarded – undo
2172 2172
 		}
2173 2173
 	}
2174 2174
 
2175
-	$objectsrc = null;  // Initialise
2175
+	$objectsrc = null; // Initialise
2176 2176
 	if (!empty($origin) && !empty($originid)) {
2177 2177
 		// Parse element/subelement (ex: project_task)
2178 2178
 		$element = $subelement = $origin;
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="post">';
2352 2352
 	print '<input type="hidden" name="token" value="'.newToken().'">';
2353 2353
 	print '<input type="hidden" name="action" value="add">';
2354
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
2354
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
2355 2355
 
2356 2356
 	if (!empty($societe->id) && $societe->id > 0) {
2357 2357
 		print '<input type="hidden" name="socid" value="'.$societe->id.'">'."\n";
@@ -2435,7 +2435,7 @@  discard block
 block discarded – undo
2435 2435
 
2436 2436
 			$sql = 'SELECT r.rowid, r.titre as title, r.total_ttc';
2437 2437
 			$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_rec as r';
2438
-			$sql .= ' WHERE r.fk_soc = '. (int) $invoice_predefined->socid;
2438
+			$sql .= ' WHERE r.fk_soc = '.(int) $invoice_predefined->socid;
2439 2439
 
2440 2440
 			$resql = $db->query($sql);
2441 2441
 			if ($resql) {
@@ -2502,7 +2502,7 @@  discard block
 block discarded – undo
2502 2502
 			// Deposit - Down payment
2503 2503
 			if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) {
2504 2504
 				print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
2505
-				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"' . (GETPOSTINT('type') == 3 ? ' checked' : '') . '> ';
2505
+				$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"'.(GETPOSTINT('type') == 3 ? ' checked' : '').'> ';
2506 2506
 				print '<script type="text/javascript">
2507 2507
 				jQuery(document).ready(function() {
2508 2508
 					jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() {
@@ -2572,7 +2572,7 @@  discard block
 block discarded – undo
2572 2572
 					print $form->selectarray('typedeposit', $arraylist, $typedeposit, 0, 0, 0, '', 1);
2573 2573
 					print '</td>';
2574 2574
 					print '<td class="nowrap" style="padding-left: 5px">';
2575
-					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="' . $valuedeposit . '"/>';
2575
+					print '<span class="opacitymedium paddingleft">'.$langs->trans("AmountOrPercent").'</span><input type="text" id="valuedeposit" name="valuedeposit" class="width75 right" value="'.$valuedeposit.'"/>';
2576 2576
 					print '</td>';
2577 2577
 				}
2578 2578
 				print '</tr></table>';
@@ -2821,8 +2821,8 @@  discard block
 block discarded – undo
2821 2821
 
2822 2822
 		// Vat reverse-charge by default
2823 2823
 		if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2824
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
2825
-			print '<tr><td>' . $langs->trans('VATReverseCharge') . '</td><td>';
2824
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
2825
+			print '<tr><td>'.$langs->trans('VATReverseCharge').'</td><td>';
2826 2826
 			// Try to propose to use VAT reverse charge even if the VAT reverse charge is not activated in the supplier card, if this corresponds to the context of use, the activation is proposed
2827 2827
 			if (GETPOSTISSET('vat_reverse_charge')) {  // Check if form was submitted previously
2828 2828
 				$vat_reverse_charge = (GETPOST('vat_reverse_charge', 'alpha') == 'on' || GETPOST('vat_reverse_charge', 'alpha') == '1') ? 1 : 0;
@@ -2832,7 +2832,7 @@  discard block
 block discarded – undo
2832 2832
 				$vat_reverse_charge = 0;
2833 2833
 			}
2834 2834
 
2835
-			print '<input type="checkbox" name="vat_reverse_charge"'. (!empty($vat_reverse_charge) ? ' checked ' : '') . '>';
2835
+			print '<input type="checkbox" name="vat_reverse_charge"'.(!empty($vat_reverse_charge) ? ' checked ' : '').'>';
2836 2836
 			print '</td></tr>';
2837 2837
 		}
2838 2838
 
@@ -3404,7 +3404,7 @@  discard block
 block discarded – undo
3404 3404
 					$creditnote->fetch($invoiceid);
3405 3405
 					$invoicecredits[] = $creditnote->getNomUrl(1);
3406 3406
 				}
3407
-				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir") . (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits);
3407
+				print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir").(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits);
3408 3408
 				print '</span>';
3409 3409
 			}
3410 3410
 			if (isset($objectidnext) && $objectidnext > 0) {
@@ -3551,12 +3551,12 @@  discard block
 block discarded – undo
3551 3551
 					print '<input type="hidden" name="action" value="setvatreversecharge">';
3552 3552
 					print '<input type="hidden" name="token" value="'.newToken().'">';
3553 3553
 
3554
-					print '<input type="checkbox" name="vat_reverse_charge"' . ($object->vat_reverse_charge == '1' ? ' checked ' : '') . '>';
3554
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').'>';
3555 3555
 
3556 3556
 					print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
3557 3557
 					print '</form>';
3558 3558
 				} else {
3559
-					print '<input type="checkbox" name="vat_reverse_charge"'. ($object->vat_reverse_charge == '1' ? ' checked ' : '') . ' disabled>';
3559
+					print '<input type="checkbox" name="vat_reverse_charge"'.($object->vat_reverse_charge == '1' ? ' checked ' : '').' disabled>';
3560 3560
 				}
3561 3561
 				print '</td></tr>';
3562 3562
 			}
@@ -3652,15 +3652,15 @@  discard block
 block discarded – undo
3652 3652
 			include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3653 3653
 
3654 3654
 			print '<tr>';
3655
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3656
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3655
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3656
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3657 3657
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3658
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3658
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3659 3659
 			}
3660 3660
 			print '</tr>';
3661 3661
 
3662 3662
 			print '<tr>';
3663
-			print '<td>' . $langs->trans('AmountVAT') . '</td>';
3663
+			print '<td>'.$langs->trans('AmountVAT').'</td>';
3664 3664
 			print '<td class="nowrap amountcard right">';
3665 3665
 			if (GETPOST('calculationrule')) {
3666 3666
 				$calculationrule = GETPOST('calculationrule', 'alpha');
@@ -3674,40 +3674,40 @@  discard block
 block discarded – undo
3674 3674
 			}
3675 3675
 			// Show link for "recalculate"
3676 3676
 			if ($object->getVentilExportCompta() == 0) {
3677
-				$s = '<span class="hideonsmartphone opacitymedium">' . $langs->trans("ReCalculate") . ' </span>';
3678
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=totalofround">' . $langs->trans("Mode1") . '</a>';
3677
+				$s = '<span class="hideonsmartphone opacitymedium">'.$langs->trans("ReCalculate").' </span>';
3678
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=totalofround">'.$langs->trans("Mode1").'</a>';
3679 3679
 				$s .= ' / ';
3680
-				$s .= '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=calculate&token='.newToken().'&calculationrule=roundoftotal">' . $langs->trans("Mode2") . '</a>';
3680
+				$s .= '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=calculate&token='.newToken().'&calculationrule=roundoftotal">'.$langs->trans("Mode2").'</a>';
3681 3681
 				print '<div class="inline-block">';
3682
-				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum) . '<br>' . $langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate');
3682
+				print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'<br>'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate');
3683 3683
 				print '&nbsp; &nbsp; &nbsp; &nbsp;';
3684 3684
 				print '</div>';
3685 3685
 			}
3686 3686
 			print '<span class="nowraponall">'.price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency).'</span>';
3687 3687
 			print '</td>';
3688 3688
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3689
-				print '<td class="nowraponall amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3689
+				print '<td class="nowraponall amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3690 3690
 			}
3691 3691
 			print '</tr>';
3692 3692
 
3693 3693
 			if ($societe->localtax1_assuj == "1") { //Localtax1
3694 3694
 				print '<tr>';
3695
-				print '<td>' . $langs->transcountry("AmountLT1", $societe->country_code) . '</td>';
3696
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3695
+				print '<td>'.$langs->transcountry("AmountLT1", $societe->country_code).'</td>';
3696
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3697 3697
 				print '</tr>';
3698 3698
 			}
3699 3699
 			if ($societe->localtax2_assuj == "1") { //Localtax2
3700 3700
 				print '<tr>';
3701
-				print '<td>' . $langs->transcountry("AmountLT2", $societe->country_code) . '</td>';
3702
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency) . '</td>';
3701
+				print '<td>'.$langs->transcountry("AmountLT2", $societe->country_code).'</td>';
3702
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).'</td>';
3703 3703
 				print '</tr>';
3704 3704
 			}
3705 3705
 
3706 3706
 			print '<tr>';
3707
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
3708
-			print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3707
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
3708
+			print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3709 3709
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3710
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3710
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3711 3711
 			}
3712 3712
 			print '</tr>';
3713 3713
 
@@ -4249,7 +4249,7 @@  discard block
 block discarded – undo
4249 4249
 				}
4250 4250
 
4251 4251
 				// Clone as predefined / Create template
4252
-				if (($object->type ==  FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4252
+				if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_DEPOSIT) && $object->status == 0 && $usercancreate) {
4253 4253
 					if (!$objectidnext && count($object->lines) > 0) {
4254 4254
 						print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card-rec.php?facid='.$object->id.'&action=create">'.$langs->trans("ChangeIntoRepeatableInvoice").'</a>';
4255 4255
 					}
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/core/modules/modMyModule.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
 		// Author
74 74
 		$this->editor_name = 'Editor name';
75
-		$this->editor_url = 'https://www.example.com';		// Must be an external online web site
76
-		$this->editor_squarred_logo = '';					// Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@mymodule'
75
+		$this->editor_url = 'https://www.example.com'; // Must be an external online web site
76
+		$this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@mymodule'
77 77
 
78 78
 		// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z'
79 79
 		$this->version = '1.0';
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
 		$this->need_javascript_ajax = 0;
164 164
 
165 165
 		// Messages at activation
166
-		$this->warnings_activation = array(); 		// Warning to show when we activate a module. Example: array('always'='text') or array('FR'='textfr','MX'='textmx'...)
167
-		$this->warnings_activation_ext = array(); 	// Warning to show when we activate a module if another module is on. Example: array('modOtherModule' => array('always'=>'text')) or array('always' => array('FR'=>'textfr','MX'=>'textmx'...))
166
+		$this->warnings_activation = array(); // Warning to show when we activate a module. Example: array('always'='text') or array('FR'='textfr','MX'='textmx'...)
167
+		$this->warnings_activation_ext = array(); // Warning to show when we activate a module if another module is on. Example: array('modOtherModule' => array('always'=>'text')) or array('always' => array('FR'=>'textfr','MX'=>'textmx'...))
168 168
 		//$this->automatic_activation = array('FR'=>'MyModuleWasAutomaticallyActivatedBecauseOfYourCountryChoice');
169 169
 		//$this->always_enabled = false;			// If true, can't be disabled. Value true is reserved for core modules. Not allowed for external modules.
170 170
 
Please login to merge, or discard this patch.