Completed
Branch develop (1d589f)
by
unknown
21:18
created
htdocs/user/document.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 	|| (($user->id != $id) && $user->hasRight("user", "user", "passsword")));
61 61
 }
62 62
 
63
-$permissiontoadd = $caneditfield;	// Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
63
+$permissiontoadd = $caneditfield; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
64 64
 $permtoedit = $caneditfield;
65 65
 
66 66
 // Security check
Please login to merge, or discard this patch.
htdocs/core/filemanagerdol/connectors/php/connector.lib.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -374,7 +374,7 @@
 block discarded – undo
374 374
 	echo <<<EOF
375 375
 <script type="text/javascript">
376 376
 (function(){var d=document.domain;while (true){try{var A=window.parent.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,'');if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();
377
-EOF;
377
+eof;
378 378
 
379 379
 	if ($errorNumber && $errorNumber != 201) {
380 380
 		$fileUrl = "";
Please login to merge, or discard this patch.
htdocs/core/filemanagerdol/connectors/php/connector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
 ob_start();
26 26
 
27
-require 'config.inc.php';	// This include the main.inc.php
27
+require 'config.inc.php'; // This include the main.inc.php
28 28
 require 'connector.lib.php';
29 29
 
30 30
 if (!$Config['Enabled']) {
Please login to merge, or discard this patch.
htdocs/core/lib/images.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
 	$filetoread = realpath(dol_osencode($file)); // Chemin canonique absolu de l'image
184 184
 
185
-	$infoImg = getimagesize($filetoread); 			// Get data about src image
185
+	$infoImg = getimagesize($filetoread); // Get data about src image
186 186
 	$imgWidth = $infoImg[0]; // Largeur de l'image
187 187
 	$imgHeight = $infoImg[1]; // Hauteur de l'image
188 188
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 	}
302 302
 
303 303
 	// Set transparent color according to image extension
304
-	$trans_colour = -1;	// By default, undefined
304
+	$trans_colour = -1; // By default, undefined
305 305
 	switch ($newExt) {
306 306
 		case 'gif':	// Gif
307 307
 			$trans_colour = imagecolorallocate($imgTarget, 255, 255, 255); // On procede autrement pour le format GIF
Please login to merge, or discard this patch.
htdocs/product/stock/stocktransfer/stocktransfer_note.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,9 @@
 block discarded – undo
51 51
 
52 52
 // Load object
53 53
 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once  // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
54
-if ($id > 0 || !empty($ref)) $upload_dir = $conf->stocktransfer->multidir_output[$object->entity]."/".$object->id;
54
+if ($id > 0 || !empty($ref)) {
55
+	$upload_dir = $conf->stocktransfer->multidir_output[$object->entity]."/".$object->id;
56
+}
55 57
 
56 58
 $permissionnote = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_setnotes.inc.php
57 59
 $permissiontoadd = $user->rights->stocktransfer->stocktransfer->write; // Used by the include of actions_addupdatedelete.inc.php
Please login to merge, or discard this patch.
htdocs/product/stock/stocktransfer/stocktransfer_contact.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,9 @@  discard block
 block discarded – undo
35 35
 $action = GETPOST('action', 'alpha');
36 36
 
37 37
 // Security check
38
-if ($user->socid) $socid = $user->socid;
38
+if ($user->socid) {
39
+	$socid = $user->socid;
40
+}
39 41
 
40 42
 $result = restrictedArea($user, 'stocktransfer', $id, '', 'stocktransfer');
41 43
 
@@ -175,7 +177,9 @@  discard block
 block discarded – undo
175 177
 	$dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
176 178
 	foreach ($dirtpls as $reldir) {
177 179
 		$res = @include dol_buildpath($reldir.'/contacts.tpl.php');
178
-		if ($res) break;
180
+		if ($res) {
181
+			break;
182
+		}
179 183
 	}
180 184
 }
181 185
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
 	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
132 132
 	// Thirdparty
133 133
 	if (!empty($object->thirdparty)) {
134
-		$morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'customer');
134
+		$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
135 135
 	}
136 136
 	// Project
137 137
 	if (isModEnabled('project')) {
Please login to merge, or discard this patch.
htdocs/bom/class/bom.class.php 4 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -671,11 +671,11 @@
 block discarded – undo
671 671
 			$rankToUse = (int) $position;
672 672
 			if ($rankToUse != $line->oldcopy->position) { // check if position have a new value
673 673
 				foreach ($this->lines as $bl) {
674
-					if ($bl->position >= $rankToUse AND $bl->position < ($line->oldcopy->position + 1)) { // move rank up
674
+					if ($bl->position >= $rankToUse and $bl->position < ($line->oldcopy->position + 1)) { // move rank up
675 675
 						$bl->position++;
676 676
 						$bl->update($user);
677 677
 					}
678
-					if ($bl->position <= $rankToUse AND $bl->position > ($line->oldcopy->position)) { // move rank down
678
+					if ($bl->position <= $rankToUse and $bl->position > ($line->oldcopy->position)) { // move rank down
679 679
 						$bl->position--;
680 680
 						$bl->update($user);
681 681
 					}
Please login to merge, or discard this patch.
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -405,7 +405,6 @@
 block discarded – undo
405 405
 	 * Load object lines in memory from the database by type of product
406 406
 	 *
407 407
 	 * 	@param int    $typeproduct   0 type product, 1 type service
408
-
409 408
 	 * @return int         <0 if KO, 0 if not found, >0 if OK
410 409
 	 */
411 410
 	public function fetchLinesbytypeproduct($typeproduct = 0)
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -782,7 +782,9 @@  discard block
 block discarded – undo
782 782
 			$line->position = $rankToUse;
783 783
 
784 784
 
785
-			if (!empty($fk_unit)) $line->fk_unit = $fk_unit;
785
+			if (!empty($fk_unit)) {
786
+				$line->fk_unit = $fk_unit;
787
+			}
786 788
 
787 789
 
788 790
 			if (is_array($array_options) && count($array_options) > 0) {
@@ -1476,8 +1478,9 @@  discard block
 block discarded – undo
1476 1478
 						$workstation = new Workstation($this->db);
1477 1479
 						$res = $workstation->fetch($line->fk_default_workstation);
1478 1480
 
1479
-						if ($res > 0) $line->total_cost = price2num($qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
1480
-						else {
1481
+						if ($res > 0) {
1482
+							$line->total_cost = price2num($qtyhourforline * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
1483
+						} else {
1481 1484
 							$this->error = $workstation->error;
1482 1485
 								return -3;
1483 1486
 						}
@@ -1541,7 +1544,9 @@  discard block
 block discarded – undo
1541 1544
 		if (!empty($this->lines)) {
1542 1545
 			foreach ($this->lines as $line) {
1543 1546
 				if (!empty($line->childBom)) {
1544
-					foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty);
1547
+					foreach ($line->childBom as $childBom) {
1548
+						$childBom->getNetNeeds($TNetNeeds, $line->qty*$qty);
1549
+					}
1545 1550
 				} else {
1546 1551
 					if (empty($TNetNeeds[$line->fk_product])) {
1547 1552
 						$TNetNeeds[$line->fk_product] = 0;
@@ -1596,7 +1601,9 @@  discard block
 block discarded – undo
1596 1601
 			return;
1597 1602
 		}
1598 1603
 
1599
-		if (empty($bom_id)) $bom_id=$this->id;
1604
+		if (empty($bom_id)) {
1605
+			$bom_id=$this->id;
1606
+		}
1600 1607
 
1601 1608
 		$sql = 'SELECT l.fk_bom, b.label
1602 1609
 				FROM '.MAIN_DB_PREFIX.'bom_bomline l
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 		$sql .= " FROM ".$this->db->prefix().$objectline->table_element." as l";
456 456
 		$sql .= " LEFT JOIN ".$this->db->prefix()."product as p ON p.rowid = l.fk_product";
457 457
 		$sql .= " WHERE l.fk_".$this->db->escape($this->element)." = ".((int) $this->id);
458
-		$sql .= " AND p.fk_product_type = ". ((int) $typeproduct);
458
+		$sql .= " AND p.fk_product_type = ".((int) $typeproduct);
459 459
 		if (isset($objectline->fields['position'])) {
460 460
 			$sql .= $this->db->order('position', 'ASC');
461 461
 		}
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
 		if (getDolGlobalString('BOM_ADDON')) {
877 877
 			$mybool = false;
878 878
 
879
-			$file = getDolGlobalString('BOM_ADDON') . ".php";
879
+			$file = getDolGlobalString('BOM_ADDON').".php";
880 880
 			$classname = $conf->global->BOM_ADDON;
881 881
 
882 882
 			// Include file with class
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
 				$label = $langs->trans("ShowBillOfMaterials");
1198 1198
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
1199 1199
 			}
1200
-			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' :  ' title="tocomplete"');
1200
+			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
1201 1201
 			$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
1202 1202
 		} else {
1203 1203
 			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
 		$this->unit_cost = 0;
1418 1418
 		$this->total_cost = 0;
1419 1419
 
1420
-		$parameters=array();
1420
+		$parameters = array();
1421 1421
 		$reshook = $hookmanager->executeHooks('calculateCostsBom', $parameters, $this); // Note that $action and $object may have been modified by hook
1422 1422
 
1423 1423
 		if ($reshook > 0) {
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
 			foreach ($this->lines as &$line) {
1433 1433
 				$tmpproduct->cost_price = 0;
1434 1434
 				$tmpproduct->pmp = 0;
1435
-				$result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1);	// We discard selling price and language loading
1435
+				$result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading
1436 1436
 
1437 1437
 				if ($tmpproduct->type == $tmpproduct::TYPE_PRODUCT) {
1438 1438
 					if (empty($line->fk_bom_child)) {
@@ -1541,12 +1541,12 @@  discard block
 block discarded – undo
1541 1541
 		if (!empty($this->lines)) {
1542 1542
 			foreach ($this->lines as $line) {
1543 1543
 				if (!empty($line->childBom)) {
1544
-					foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty*$qty);
1544
+					foreach ($line->childBom as $childBom) $childBom->getNetNeeds($TNetNeeds, $line->qty * $qty);
1545 1545
 				} else {
1546 1546
 					if (empty($TNetNeeds[$line->fk_product])) {
1547 1547
 						$TNetNeeds[$line->fk_product] = 0;
1548 1548
 					}
1549
-					$TNetNeeds[$line->fk_product] += $line->qty*$qty;
1549
+					$TNetNeeds[$line->fk_product] += $line->qty * $qty;
1550 1550
 				}
1551 1551
 			}
1552 1552
 		}
@@ -1568,9 +1568,9 @@  discard block
 block discarded – undo
1568 1568
 					foreach ($line->childBom as $childBom) {
1569 1569
 						$TNetNeeds[$childBom->id]['bom'] = $childBom;
1570 1570
 						$TNetNeeds[$childBom->id]['parentid'] = $this->id;
1571
-						$TNetNeeds[$childBom->id]['qty'] = $line->qty*$qty;
1571
+						$TNetNeeds[$childBom->id]['qty'] = $line->qty * $qty;
1572 1572
 						$TNetNeeds[$childBom->id]['level'] = $level;
1573
-						$childBom->getNetNeedsTree($TNetNeeds, $line->qty*$qty, $level+1);
1573
+						$childBom->getNetNeedsTree($TNetNeeds, $line->qty * $qty, $level + 1);
1574 1574
 					}
1575 1575
 				} else {
1576 1576
 					$TNetNeeds[$this->id]['product'][$line->fk_product]['qty'] += $line->qty * $qty;
@@ -1596,7 +1596,7 @@  discard block
 block discarded – undo
1596 1596
 			return;
1597 1597
 		}
1598 1598
 
1599
-		if (empty($bom_id)) $bom_id=$this->id;
1599
+		if (empty($bom_id)) $bom_id = $this->id;
1600 1600
 
1601 1601
 		$sql = 'SELECT l.fk_bom, b.label
1602 1602
 				FROM '.MAIN_DB_PREFIX.'bom_bomline l
@@ -1607,7 +1607,7 @@  discard block
 block discarded – undo
1607 1607
 		if (!empty($resql)) {
1608 1608
 			while ($res = $this->db->fetch_object($resql)) {
1609 1609
 				$TParentBom[$res->fk_bom] = $res->fk_bom;
1610
-				$this->getParentBomTreeRecursive($TParentBom, $res->fk_bom, $level+1);
1610
+				$this->getParentBomTreeRecursive($TParentBom, $res->fk_bom, $level + 1);
1611 1611
 			}
1612 1612
 		}
1613 1613
 	}
@@ -1621,7 +1621,7 @@  discard block
 block discarded – undo
1621 1621
 	 */
1622 1622
 	public function getKanbanView($option = '', $arraydata = null)
1623 1623
 	{
1624
-		global $db,$langs;
1624
+		global $db, $langs;
1625 1625
 
1626 1626
 		$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
1627 1627
 
Please login to merge, or discard this patch.
htdocs/cron/card.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -550,7 +550,7 @@
 block discarded – undo
550 550
 		$langs->load($reg[1]);
551 551
 	}
552 552
 
553
-	$labeltoshow =  preg_replace('/:.*$/', '', $object->label);
553
+	$labeltoshow = preg_replace('/:.*$/', '', $object->label);
554 554
 
555 555
 	$morehtmlref = '<div class="refidno">';
556 556
 	$morehtmlref .= $langs->trans($labeltoshow);
Please login to merge, or discard this patch.
htdocs/accountancy/admin/defaultaccounts.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 print '<tr class="oddeven value">';
279 279
 // Param
280 280
 print '<td>';
281
-print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT');
281
+print img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT');
282 282
 print '</td>';
283 283
 // Value
284 284
 print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
@@ -288,13 +288,13 @@  discard block
 block discarded – undo
288 288
 
289 289
 if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') && getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT') != '-1') {
290 290
 	print '<tr class="oddeven">';
291
-	print '<td>' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . '</td>';
291
+	print '<td>'.img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("UseAuxiliaryAccountOnCustomerDeposit").'</td>';
292 292
 	if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) {
293
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=0">';
293
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=0">';
294 294
 		print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
295 295
 		print '</a></td>';
296 296
 	} else {
297
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=1">';
297
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT&value=1">';
298 298
 		print img_picto($langs->trans("Disabled"), 'switch_off');
299 299
 		print '</a></td>';
300 300
 	}
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 print '<tr class="oddeven value">';
306 306
 // Param
307 307
 print '<td>';
308
-print img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT');
308
+print img_picto('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT');
309 309
 print '</td>';
310 310
 // Value
311 311
 print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
@@ -315,13 +315,13 @@  discard block
 block discarded – undo
315 315
 
316 316
 if (isModEnabled('societe') && getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT') && getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT') != '-1') {
317 317
 	print '<tr class="oddeven">';
318
-	print '<td>' . img_picto('', 'supplier_invoice', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnSupplierDeposit") . '</td>';
318
+	print '<td>'.img_picto('', 'supplier_invoice', 'class="pictofixedwidth"').$langs->trans("UseAuxiliaryAccountOnSupplierDeposit").'</td>';
319 319
 	if (getDolGlobalInt('ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT')) {
320
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=0">';
320
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=0">';
321 321
 		print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
322 322
 		print '</a></td>';
323 323
 	} else {
324
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=1">';
324
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT&value=1">';
325 325
 		print img_picto($langs->trans("Disabled"), 'switch_off');
326 326
 		print '</a></td>';
327 327
 	}
Please login to merge, or discard this patch.