Completed
Branch develop (6cdb7c)
by
unknown
19:03
created
htdocs/fourn/facture/card-rec.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -898,8 +898,12 @@  discard block
 block discarded – undo
898 898
 		print dol_get_fiche_head(null, '', '', 0);
899 899
 
900 900
 		$rowspan = 4;
901
-		if (isModEnabled('project')) $rowspan++;
902
-		if ($object->fk_account > 0) $rowspan++;
901
+		if (isModEnabled('project')) {
902
+			$rowspan++;
903
+		}
904
+		if ($object->fk_account > 0) {
905
+			$rowspan++;
906
+		}
903 907
 
904 908
 		print '<table class="border centpercent">';
905 909
 
@@ -1576,9 +1580,12 @@  discard block
 block discarded – undo
1576 1580
 
1577 1581
 				$parameters = array();
1578 1582
 				$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
1579
-				if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1580
-				if (empty($reshook))
1581
-					global $senderissupplier;
1583
+				if ($reshook < 0) {
1584
+					setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
1585
+				}
1586
+				if (empty($reshook)) {
1587
+									global $senderissupplier;
1588
+				}
1582 1589
 				$senderissupplier = 2;
1583 1590
 				$object->formAddObjectLine(0, $object->thirdparty, $mysoc); // No date selector for template invoice
1584 1591
 			}
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/scripts/mymodule.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,10 @@
 block discarded – undo
40 40
 //if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule');	// Force authentication handler
41 41
 //if (! defined('CSRFCHECK_WITH_TOKEN'))     define('CSRFCHECK_WITH_TOKEN', '1');		// Force use of CSRF protection with tokens even for GET
42 42
 //if (! defined('NOBROWSERNOTIF'))     		 define('NOBROWSERNOTIF', '1');				// Disable browser notification
43
-if (!defined('NOSESSION')) define('NOSESSION', '1');	// On CLI mode, no need to use web sessions
43
+if (!defined('NOSESSION')) {
44
+	define('NOSESSION', '1');
45
+}
46
+// On CLI mode, no need to use web sessions
44 47
 
45 48
 
46 49
 $sapi_type = php_sapi_name();
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/myobject_agenda.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,9 @@
 block discarded – undo
149 149
 if (!isModEnabled("mymodule")) {
150 150
 	accessforbidden();
151 151
 }
152
-if (!$permissiontoread) accessforbidden();
152
+if (!$permissiontoread) {
153
+	accessforbidden();
154
+}
153 155
 
154 156
 
155 157
 /*
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/myobject_list.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -192,7 +192,9 @@  discard block
 block discarded – undo
192 192
 }
193 193
 
194 194
 // Security check (enable the most restrictive one)
195
-if ($user->socid > 0) accessforbidden();
195
+if ($user->socid > 0) {
196
+	accessforbidden();
197
+}
196 198
 //if ($user->socid > 0) accessforbidden();
197 199
 //$socid = 0; if ($user->socid > 0) $socid = $user->socid;
198 200
 //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
@@ -200,7 +202,9 @@  discard block
 block discarded – undo
200 202
 if (!isModEnabled("mymodule")) {
201 203
 	accessforbidden('Module mymodule not enabled');
202 204
 }
203
-if (!$permissiontoread) accessforbidden();
205
+if (!$permissiontoread) {
206
+	accessforbidden();
207
+}
204 208
 
205 209
 
206 210
 /*
Please login to merge, or discard this patch.
htdocs/ecm/dir_add_card.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
  *	\brief		Main page for ECM section area
24 24
  */
25 25
 
26
-if (! defined('DISABLE_JS_GRAHP')) define('DISABLE_JS_GRAPH', 1);
26
+if (! defined('DISABLE_JS_GRAHP')) {
27
+	define('DISABLE_JS_GRAPH', 1);
28
+}
27 29
 
28 30
 // Load Dolibarr environment
29 31
 require '../main.inc.php';
Please login to merge, or discard this patch.
htdocs/core/tpl/objectline_create.tpl.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -258,7 +258,9 @@
 block discarded – undo
258 258
 			if (empty($senderissupplier)) {
259 259
 				$statustoshow = 1;
260 260
 				$statuswarehouse = 'warehouseopen,warehouseinternal';
261
-				if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) $statuswarehouse = 'warehouseopen';
261
+				if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) {
262
+					$statuswarehouse = 'warehouseopen';
263
+				}
262 264
 				if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
263 265
 					// hide products in closed warehouse, but show products for internal transfer
264 266
 					$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, $statuswarehouse, GETPOST('combinations', 'array'));
Please login to merge, or discard this patch.
htdocs/core/lib/company.lib.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1538,7 +1538,9 @@  discard block
 block discarded – undo
1538 1538
 		// Fields from hook
1539 1539
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
1540 1540
 		$reshook = $hookmanager->executeHooks('showActionsDoneListSelect', $parameters);    // Note that $action and $object may have been modified by hook
1541
-		if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint;
1541
+		if (!empty($hookmanager->resPrint)) {
1542
+			$sql.= $hookmanager->resPrint;
1543
+		}
1542 1544
 
1543 1545
 		$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
1544 1546
 		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_action";
@@ -1554,7 +1556,9 @@  discard block
 block discarded – undo
1554 1556
 		// Fields from hook
1555 1557
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon);
1556 1558
 		$reshook = $hookmanager->executeHooks('showActionsDoneListFrom', $parameters);    // Note that $action and $object may have been modified by hook
1557
-		if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint;
1559
+		if (!empty($hookmanager->resPrint)) {
1560
+			$sql.= $hookmanager->resPrint;
1561
+		}
1558 1562
 
1559 1563
 		if (is_object($filterobj) && in_array(get_class($filterobj), array('Societe', 'Client', 'Fournisseur'))) {
1560 1564
 			$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
@@ -1659,7 +1663,9 @@  discard block
 block discarded – undo
1659 1663
 		// Fields from hook
1660 1664
 		$parameters = array('sql' => &$sql, 'filterobj' => $filterobj, 'objcon' => $objcon, 'module' => $module);
1661 1665
 		$reshook = $hookmanager->executeHooks('showActionsDoneListWhere', $parameters);    // Note that $action and $object may have been modified by hook
1662
-		if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint;
1666
+		if (!empty($hookmanager->resPrint)) {
1667
+			$sql.= $hookmanager->resPrint;
1668
+		}
1663 1669
 
1664 1670
 		if (is_array($actioncode)) {
1665 1671
 			foreach ($actioncode as $code) {
Please login to merge, or discard this patch.
htdocs/core/lib/date.lib.php 1 patch
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -331,13 +331,27 @@  discard block
 block discarded – undo
331 331
 {
332 332
 	$result = 0;
333 333
 
334
-	if ($duration_unit == 's') $result = $duration_value / 3600;
335
-	if ($duration_unit == 'i') $result = $duration_value / 60;
336
-	if ($duration_unit == 'h') $result = $duration_value;
337
-	if ($duration_unit == 'd') $result = $duration_value * 24;
338
-	if ($duration_unit == 'w') $result = $duration_value * 24 * 7;
339
-	if ($duration_unit == 'm') $result = $duration_value * 730.484;
340
-	if ($duration_unit == 'y') $result = $duration_value * 365 * 24;
334
+	if ($duration_unit == 's') {
335
+		$result = $duration_value / 3600;
336
+	}
337
+	if ($duration_unit == 'i') {
338
+		$result = $duration_value / 60;
339
+	}
340
+	if ($duration_unit == 'h') {
341
+		$result = $duration_value;
342
+	}
343
+	if ($duration_unit == 'd') {
344
+		$result = $duration_value * 24;
345
+	}
346
+	if ($duration_unit == 'w') {
347
+		$result = $duration_value * 24 * 7;
348
+	}
349
+	if ($duration_unit == 'm') {
350
+		$result = $duration_value * 730.484;
351
+	}
352
+	if ($duration_unit == 'y') {
353
+		$result = $duration_value * 365 * 24;
354
+	}
341 355
 
342 356
 	return $result;
343 357
 }
@@ -929,7 +943,9 @@  discard block
 block discarded – undo
929 943
 				$date_1sunsept = strtotime('next thursday', strtotime('next sunday', mktime(0, 0, 0, 9, 1, $annee)));
930 944
 				$jour_1sunsept = date("d", $date_1sunsept);
931 945
 				$mois_1sunsept = date("m", $date_1sunsept);
932
-				if ($jour_1sunsept == $jour && $mois_1sunsept == $mois) $ferie=true;
946
+				if ($jour_1sunsept == $jour && $mois_1sunsept == $mois) {
947
+					$ferie=true;
948
+				}
933 949
 				// Geneva fast in Switzerland
934 950
 			}
935 951
 		}
Please login to merge, or discard this patch.
htdocs/core/modules/modStockTransfer.class.php 1 patch
Braces   +13 added lines, -4 removed lines patch added patch discarded remove patch
@@ -426,7 +426,10 @@  discard block
 block discarded – undo
426 426
 		global  $conf, $langs;
427 427
 
428 428
 		$result = $this->_load_tables('/install/mysql/tables/', 'stocktransfer');
429
-		if ($result < 0) return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
429
+		if ($result < 0) {
430
+			return -1;
431
+		}
432
+		// Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
430 433
 
431 434
 		// Permissions
432 435
 		$this->remove($options);
@@ -437,17 +440,23 @@  discard block
 block discarded – undo
437 440
 		$resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STDEST" AND element = "StockTransfer" AND source = "internal"');
438 441
 		$res = $this->db->fetch_object($resql);
439 442
 		$nextid=$this->getNextId();
440
-		if (empty($res)) $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "internal", "STRESP", "Responsable du transfert de stocks", 1, NULL, 0)');
443
+		if (empty($res)) {
444
+			$this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "internal", "STRESP", "Responsable du transfert de stocks", 1, NULL, 0)');
445
+		}
441 446
 
442 447
 		$resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STFROM" AND element = "StockTransfer" AND source = "external"');
443 448
 		$res = $this->db->fetch_object($resql);
444 449
 		$nextid=$this->getNextId();
445
-		if (empty($res)) $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STFROM", "Contact expéditeur transfert de stocks", 1, NULL, 0)');
450
+		if (empty($res)) {
451
+			$this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STFROM", "Contact expéditeur transfert de stocks", 1, NULL, 0)');
452
+		}
446 453
 
447 454
 		$resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STDEST" AND element = "StockTransfer" AND source = "external"');
448 455
 		$res = $this->db->fetch_object($resql);
449 456
 		$nextid=$this->getNextId();
450
-		if (empty($res)) $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STDEST", "Contact destinataire transfert de stocks", 1, NULL, 0)');
457
+		if (empty($res)) {
458
+			$this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STDEST", "Contact destinataire transfert de stocks", 1, NULL, 0)');
459
+		}
451 460
 
452 461
 		return $this->_init($sql, $options);
453 462
 	}
Please login to merge, or discard this patch.