Completed
Branch develop (b713ef)
by
unknown
15:54
created
htdocs/expedition/class/expedition.class.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 		if (!empty($conf->global->EXPEDITION_ADDON_NUMBER)) {
279 279
 			$mybool = false;
280 280
 
281
-			$file = getDolGlobalString('EXPEDITION_ADDON_NUMBER') . ".php";
281
+			$file = getDolGlobalString('EXPEDITION_ADDON_NUMBER').".php";
282 282
 			$classname = $conf->global->EXPEDITION_ADDON_NUMBER;
283 283
 
284 284
 			// Include file with class
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
 		// If product need a batch number, we should not have called this function but addline_batch instead.
935 935
 		// If this happen, we may have a bug in card.php page
936 936
 		if (isModEnabled('productbatch') && !empty($orderline->fk_product) && !empty($orderline->product_tobatch)) {
937
-			$this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH '.$orderline->id.' '.$orderline->fk_product;	//
937
+			$this->error = 'ADDLINE_WAS_CALLED_INSTEAD_OF_ADDLINEBATCH '.$orderline->id.' '.$orderline->fk_product; //
938 938
 			return -4;
939 939
 		}
940 940
 
@@ -1567,7 +1567,7 @@  discard block
 block discarded – undo
1567 1567
 		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = cd.fk_product";
1568 1568
 		$sql .= " WHERE ed.fk_expedition = ".((int) $this->id);
1569 1569
 		$sql .= " AND ed.fk_origin_line = cd.rowid";
1570
-		$sql .= " ORDER BY cd.rang, ed.fk_origin_line";		// We need after a break on fk_origin_line but when there is no break on fk_origin_line, cd.rang is same so we can add it as first order criteria.
1570
+		$sql .= " ORDER BY cd.rang, ed.fk_origin_line"; // We need after a break on fk_origin_line but when there is no break on fk_origin_line, cd.rang is same so we can add it as first order criteria.
1571 1571
 
1572 1572
 		dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
1573 1573
 		$resql = $this->db->query($sql);
@@ -1595,9 +1595,9 @@  discard block
 block discarded – undo
1595 1595
 					$line->entrepot_id = 0; // entrepod_id in details_entrepot
1596 1596
 					$line->qty_shipped += $obj->qty_shipped;
1597 1597
 				} else {
1598
-					$line = new ExpeditionLigne($this->db);		// new group to start
1599
-					$line->entrepot_id    	= $obj->fk_entrepot;	// this is a property of a shipment line
1600
-					$line->qty_shipped    	= $obj->qty_shipped;	// this is a property of a shipment line
1598
+					$line = new ExpeditionLigne($this->db); // new group to start
1599
+					$line->entrepot_id    	= $obj->fk_entrepot; // this is a property of a shipment line
1600
+					$line->qty_shipped    	= $obj->qty_shipped; // this is a property of a shipment line
1601 1601
 				}
1602 1602
 
1603 1603
 				$detail_entrepot              = new stdClass();
@@ -1622,8 +1622,8 @@  discard block
 block discarded – undo
1622 1622
 				$line->ref = $obj->product_ref; // TODO deprecated
1623 1623
 				$line->product_ref = $obj->product_ref;
1624 1624
 				$line->product_label = $obj->product_label;
1625
-				$line->libelle        	= $obj->product_label; // TODO deprecated
1626
-				$line->product_barcode  = $obj->product_barcode; // Barcode number product
1625
+				$line->libelle = $obj->product_label; // TODO deprecated
1626
+				$line->product_barcode = $obj->product_barcode; // Barcode number product
1627 1627
 				$line->product_tosell = $obj->product_tosell;
1628 1628
 				$line->product_tobuy = $obj->product_tobuy;
1629 1629
 				$line->product_tobatch = $obj->product_tobatch;
@@ -1844,7 +1844,7 @@  discard block
 block discarded – undo
1844 1844
 				$label = $langs->trans("Shipment");
1845 1845
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
1846 1846
 			}
1847
-			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' :  ' title="tocomplete"');
1847
+			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
1848 1848
 			$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
1849 1849
 		}
1850 1850
 
@@ -1861,7 +1861,7 @@  discard block
 block discarded – undo
1861 1861
 		}
1862 1862
 		$result .= $linkend;
1863 1863
 		global $action;
1864
-		$hookmanager->initHooks(array($this->element . 'dao'));
1864
+		$hookmanager->initHooks(array($this->element.'dao'));
1865 1865
 		$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
1866 1866
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1867 1867
 		if ($reshook > 0) {
@@ -2150,17 +2150,17 @@  discard block
 block discarded – undo
2150 2150
 				if ($shipments_match_order) {
2151 2151
 					dol_syslog("Qty for the ".count($order->lines)." lines of the origin order is same than qty for lines in the shipment we close (shipments_match_order is true), with new status Expedition::STATUS_CLOSED=".self::STATUS_CLOSED.', so we close order');
2152 2152
 					// We close the order
2153
-					$order->cloture($user);		// Note this may also create an invoice if module workflow ask it
2153
+					$order->cloture($user); // Note this may also create an invoice if module workflow ask it
2154 2154
 				}
2155 2155
 			}
2156 2156
 
2157
-			$this->statut = self::STATUS_CLOSED;	// Will be revert to STATUS_VALIDATED at end if there is a rollback
2158
-			$this->status = self::STATUS_CLOSED;	// Will be revert to STATUS_VALIDATED at end if there is a rollback
2157
+			$this->statut = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback
2158
+			$this->status = self::STATUS_CLOSED; // Will be revert to STATUS_VALIDATED at end if there is a rollback
2159 2159
 
2160 2160
 			// If stock increment is done on closing
2161 2161
 			if (!$error && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) {
2162 2162
 				$result = $this->manageStockMvtOnEvt($user);
2163
-				if ($result<0) {
2163
+				if ($result < 0) {
2164 2164
 					$error++;
2165 2165
 				}
2166 2166
 			}
@@ -2202,9 +2202,9 @@  discard block
 block discarded – undo
2202 2202
 	{
2203 2203
 		global $langs;
2204 2204
 
2205
-		$error=0;
2205
+		$error = 0;
2206 2206
 
2207
-		require_once DOL_DOCUMENT_ROOT . '/product/stock/class/mouvementstock.class.php';
2207
+		require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
2208 2208
 
2209 2209
 		$langs->load("agenda");
2210 2210
 
@@ -2214,14 +2214,14 @@  discard block
 block discarded – undo
2214 2214
 		$sql .= " e.ref,";
2215 2215
 		$sql .= " edb.rowid as edbrowid, edb.eatby, edb.sellby, edb.batch, edb.qty as edbqty, edb.fk_origin_stock,";
2216 2216
 		$sql .= " cd.rowid as cdid, ed.rowid as edid";
2217
-		$sql .= " FROM " . MAIN_DB_PREFIX . "commandedet as cd,";
2218
-		$sql .= " " . MAIN_DB_PREFIX . "expeditiondet as ed";
2219
-		$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
2220
-		$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "expedition as e ON ed.fk_expedition = e.rowid";
2221
-		$sql .= " WHERE ed.fk_expedition = " . ((int) $this->id);
2217
+		$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd,";
2218
+		$sql .= " ".MAIN_DB_PREFIX."expeditiondet as ed";
2219
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as edb on edb.fk_expeditiondet = ed.rowid";
2220
+		$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expedition as e ON ed.fk_expedition = e.rowid";
2221
+		$sql .= " WHERE ed.fk_expedition = ".((int) $this->id);
2222 2222
 		$sql .= " AND cd.rowid = ed.fk_origin_line";
2223 2223
 
2224
-		dol_syslog(get_class($this) . "::valid select details", LOG_DEBUG);
2224
+		dol_syslog(get_class($this)."::valid select details", LOG_DEBUG);
2225 2225
 		$resql = $this->db->query($sql);
2226 2226
 		if ($resql) {
2227 2227
 			$cpt = $this->db->num_rows($resql);
@@ -2235,7 +2235,7 @@  discard block
 block discarded – undo
2235 2235
 				if ($qty <= 0 || ($qty < 0 && !getDolGlobalInt('SHIPMENT_ALLOW_NEGATIVE_QTY'))) {
2236 2236
 					continue;
2237 2237
 				}
2238
-				dol_syslog(get_class($this) . "::valid movement index " . $i . " ed.rowid=" . $obj->rowid . " edb.rowid=" . $obj->edbrowid);
2238
+				dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid);
2239 2239
 
2240 2240
 				$mouvS = new MouvementStock($this->db);
2241 2241
 				$mouvS->origin = &$this;
@@ -2274,7 +2274,7 @@  discard block
 block discarded – undo
2274 2274
 		} else {
2275 2275
 			$this->error = $this->db->lasterror();
2276 2276
 			$this->errors[] = $this->db->lasterror();
2277
-			$error ++;
2277
+			$error++;
2278 2278
 		}
2279 2279
 
2280 2280
 		return $error;
@@ -2530,7 +2530,7 @@  discard block
 block discarded – undo
2530 2530
 	 * @var int
2531 2531
 	 * @deprecated
2532 2532
 	 */
2533
-	public $line_id;	// deprecated
2533
+	public $line_id; // deprecated
2534 2534
 
2535 2535
 	/**
2536 2536
 	 * @deprecated
@@ -2543,7 +2543,7 @@  discard block
 block discarded – undo
2543 2543
 	 *
2544 2544
 	 * @var string
2545 2545
 	 */
2546
-	public $fk_origin;			// Example: 'orderline'
2546
+	public $fk_origin; // Example: 'orderline'
2547 2547
 
2548 2548
 	/**
2549 2549
 	 * @var int ID
Please login to merge, or discard this patch.
htdocs/commande/card.php 2 patches
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -79,18 +79,18 @@  discard block
 block discarded – undo
79 79
 
80 80
 
81 81
 $id        = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('orderid', 'int'));
82
-$ref       =  GETPOST('ref', 'alpha');
83
-$socid     =  GETPOST('socid', 'int');
84
-$action    =  GETPOST('action', 'aZ09');
85
-$cancel    =  GETPOST('cancel', 'alpha');
86
-$confirm   =  GETPOST('confirm', 'alpha');
82
+$ref       = GETPOST('ref', 'alpha');
83
+$socid     = GETPOST('socid', 'int');
84
+$action    = GETPOST('action', 'aZ09');
85
+$cancel    = GETPOST('cancel', 'alpha');
86
+$confirm   = GETPOST('confirm', 'alpha');
87 87
 $backtopage = GETPOST('backtopage', 'alpha');
88 88
 
89
-$lineid    =  GETPOST('lineid', 'int');
90
-$contactid =  GETPOST('contactid', 'int');
91
-$projectid =  GETPOST('projectid', 'int');
92
-$origin    =  GETPOST('origin', 'alpha');
93
-$originid  = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int'));    // For backward compatibility
89
+$lineid    = GETPOST('lineid', 'int');
90
+$contactid = GETPOST('contactid', 'int');
91
+$projectid = GETPOST('projectid', 'int');
92
+$origin    = GETPOST('origin', 'alpha');
93
+$originid  = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
94 94
 $rank      = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
95 95
 
96 96
 // PDF
@@ -115,26 +115,26 @@  discard block
 block discarded – undo
115 115
 $extrafields->fetch_name_optionals_label($object->table_element);
116 116
 
117 117
 // Load object
118
-include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php';     // Must be include, not include_once
118
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
119 119
 
120 120
 // Permissions / Rights
121
-$usercanread    =  $user->hasRight("commande", "lire");
122
-$usercancreate  =  $user->hasRight("commande", "creer");
123
-$usercandelete  =  $user->hasRight("commande", "supprimer");
121
+$usercanread    = $user->hasRight("commande", "lire");
122
+$usercancreate  = $user->hasRight("commande", "creer");
123
+$usercandelete  = $user->hasRight("commande", "supprimer");
124 124
 
125 125
 // Advanced permissions
126
-$usercanclose       =  ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'close')));
127
-$usercanvalidate    =  ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'validate')));
128
-$usercancancel      =  ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'annuler')));
129
-$usercansend        =   (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'send'));
130
-$usercangeneretedoc =   (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'generetedoc'));
126
+$usercanclose       = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'close')));
127
+$usercanvalidate    = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'validate')));
128
+$usercancancel      = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'annuler')));
129
+$usercansend        = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'send'));
130
+$usercangeneretedoc = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'generetedoc'));
131 131
 
132 132
 $usermustrespectpricemin    = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS));
133 133
 $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
134 134
 
135
-$permissionnote    = $usercancreate;     //  Used by the include of actions_setnotes.inc.php
136
-$permissiondellink = $usercancreate;     //  Used by the include of actions_dellink.inc.php
137
-$permissiontoadd   = $usercancreate;     //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
135
+$permissionnote    = $usercancreate; //  Used by the include of actions_setnotes.inc.php
136
+$permissiondellink = $usercancreate; //  Used by the include of actions_dellink.inc.php
137
+$permissiontoadd   = $usercancreate; //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
138 138
 
139 139
 
140 140
 $error = 0;
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
 		$action = '';
178 178
 	}
179 179
 
180
-	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php';    // Must be include, not include_once
180
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
181 181
 
182
-	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';     // Must be include, not include_once
182
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
183 183
 
184
-	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';  // Must be include, not include_once
184
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
185 185
 
186 186
 	// Action clone object
187 187
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 		$pu_ht = '';
666 666
 		$pu_ttc = '';
667 667
 		$pu_ht_devise = '';
668
-		$pu_ttc_devise  = '';
668
+		$pu_ttc_devise = '';
669 669
 
670 670
 		if (GETPOST('price_ht') !== '') {
671 671
 			$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
@@ -809,8 +809,8 @@  discard block
 block discarded – undo
809 809
 						if (count($prodcustprice->lines) > 0) {
810 810
 							$pu_ht = price($prodcustprice->lines[0]->price);
811 811
 							$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
812
-							$price_min =  price($prodcustprice->lines[0]->price_min);
813
-							$price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
812
+							$price_min = price($prodcustprice->lines[0]->price_min);
813
+							$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
814 814
 							$price_base_type = $prodcustprice->lines[0]->price_base_type;
815 815
 							$tva_tx = $prodcustprice->lines[0]->tva_tx;
816 816
 							if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
@@ -909,8 +909,8 @@  discard block
 block discarded – undo
909 909
 				}
910 910
 
911 911
 				//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
912
-				if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
913
-					$product_desc='';
912
+				if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
913
+					$product_desc = '';
914 914
 				}
915 915
 
916 916
 				if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) {
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
 					GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms)
1332 1332
 					&& isModEnabled('facture') && $user->hasRight('facture', 'creer')
1333 1333
 				) {
1334
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
1334
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1335 1335
 
1336 1336
 					$date = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int'));
1337 1337
 					$forceFields = array();
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
 
1345 1345
 					if ($deposit) {
1346 1346
 						setEventMessage('DepositGenerated');
1347
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
1347
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
1348 1348
 					} else {
1349 1349
 						$error++;
1350 1350
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1352,7 +1352,7 @@  discard block
 block discarded – undo
1352 1352
 				}
1353 1353
 
1354 1354
 				// Define output language
1355
-				if (! $error) {
1355
+				if (!$error) {
1356 1356
 					$db->commit();
1357 1357
 
1358 1358
 					if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
@@ -1380,7 +1380,7 @@  discard block
 block discarded – undo
1380 1380
 					}
1381 1381
 
1382 1382
 					if ($locationTarget) {
1383
-						header('Location: ' . $locationTarget);
1383
+						header('Location: '.$locationTarget);
1384 1384
 						exit;
1385 1385
 					}
1386 1386
 				} else {
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
 	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
1574 1574
 
1575 1575
 	// Actions to build doc
1576
-	$upload_dir = !empty($conf->commande->multidir_output[$object->entity])?$conf->commande->multidir_output[$object->entity]:$conf->commande->dir_output;
1576
+	$upload_dir = !empty($conf->commande->multidir_output[$object->entity]) ? $conf->commande->multidir_output[$object->entity] : $conf->commande->dir_output;
1577 1577
 	$permissiontoadd = $usercancreate;
1578 1578
 	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
1579 1579
 
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
 	print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
1804 1804
 	print '<input type="hidden" name="token" value="'.newToken().'">';
1805 1805
 	print '<input type="hidden" name="action" value="add">';
1806
-	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
1806
+	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
1807 1807
 	print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
1808 1808
 	print '<input type="hidden" name="origin" value="'.$origin.'">';
1809 1809
 	print '<input type="hidden" name="originid" value="'.$originid.'">';
@@ -1865,7 +1865,7 @@  discard block
 block discarded – undo
1865 1865
 		// Contacts (ask contact only if thirdparty already defined).
1866 1866
 		print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
1867 1867
 		print img_picto('', 'contact', 'class="pictofixedwidth"');
1868
-		print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, !empty($srccontactslist)?$srccontactslist:"", '', 1, 'maxwidth200 widthcentpercentminusx');
1868
+		print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, !empty($srccontactslist) ? $srccontactslist : "", '', 1, 'maxwidth200 widthcentpercentminusx');
1869 1869
 		print '</td></tr>';
1870 1870
 
1871 1871
 		// Ligne info remises tiers
@@ -1934,14 +1934,14 @@  discard block
 block discarded – undo
1934 1934
 		require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
1935 1935
 		$formproduct = new FormProduct($db);
1936 1936
 		print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
1937
-		print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses((GETPOSTISSET('warehouse_id')?GETPOST('warehouse_id'):$warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
1937
+		print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses((GETPOSTISSET('warehouse_id') ?GETPOST('warehouse_id') : $warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
1938 1938
 		print '</td></tr>';
1939 1939
 	}
1940 1940
 
1941 1941
 	// Source / Channel - What trigger creation
1942 1942
 	print '<tr><td>'.$langs->trans('Channel').'</td><td>';
1943 1943
 	print img_picto('', 'question', 'class="pictofixedwidth"');
1944
-	$form->selectInputReason((GETPOSTISSET('demand_reason_id')?GETPOST('demand_reason_id'):$demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');
1944
+	$form->selectInputReason((GETPOSTISSET('demand_reason_id') ?GETPOST('demand_reason_id') : $demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');
1945 1945
 	print '</td></tr>';
1946 1946
 
1947 1947
 	// TODO How record was recorded OrderMode (llx_c_input_method)
@@ -1951,7 +1951,7 @@  discard block
 block discarded – undo
1951 1951
 		$langs->load("projects");
1952 1952
 		print '<tr>';
1953 1953
 		print '<td>'.$langs->trans("Project").'</td><td>';
1954
-		print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid')?GETPOST('projectid'):$projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
1954
+		print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid') ?GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
1955 1955
 		print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
1956 1956
 		print '</td>';
1957 1957
 		print '</tr>';
@@ -1976,7 +1976,7 @@  discard block
 block discarded – undo
1976 1976
 	// Other attributes
1977 1977
 	$parameters = array();
1978 1978
 	if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
1979
-		$parameters['objectsrc'] =  $objectsrc;
1979
+		$parameters['objectsrc'] = $objectsrc;
1980 1980
 	}
1981 1981
 	$parameters['socid'] = $socid;
1982 1982
 
@@ -2011,7 +2011,7 @@  discard block
 block discarded – undo
2011 2011
 		print '<tr>';
2012 2012
 		print '<td>'.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).'</td>';
2013 2013
 		print '<td class="maxwidthonsmartphone">';
2014
-		print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany'))?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2014
+		print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ?GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2015 2015
 		print '</td></tr>';
2016 2016
 	}
2017 2017
 
@@ -2192,14 +2192,14 @@  discard block
 block discarded – undo
2192 2192
 			$nbMandated = 0;
2193 2193
 			foreach ($object->lines as $line) {
2194 2194
 				$res = $line->fetch_product();
2195
-				if ($res  > 0  ) {
2196
-					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
2195
+				if ($res > 0) {
2196
+					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2197 2197
 						$nbMandated++;
2198 2198
 						break;
2199 2199
 					}
2200 2200
 				}
2201 2201
 			}
2202
-			if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2202
+			if ($nbMandated > 0) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2203 2203
 
2204 2204
 			if (getDolGlobalInt('SALE_ORDER_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2205 2205
 				// This is a hidden option:
@@ -2209,7 +2209,7 @@  discard block
 block discarded – undo
2209 2209
 				$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2210 2210
 
2211 2211
 				if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && $user->hasRight('facture', 'creer')) {
2212
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2212
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2213 2213
 
2214 2214
 					$object->fetchObjectLinked();
2215 2215
 
@@ -2420,7 +2420,7 @@  discard block
 block discarded – undo
2420 2420
 		$morehtmlref = '<div class="refidno">';
2421 2421
 		// Ref customer
2422 2422
 		$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
2423
-		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2423
+		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2424 2424
 		// Thirdparty
2425 2425
 		$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2426 2426
 		if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
@@ -2742,55 +2742,55 @@  discard block
 block discarded – undo
2742 2742
 
2743 2743
 			$alert = '';
2744 2744
 			if (!empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->order_min_amount) {
2745
-				$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount));
2745
+				$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
2746 2746
 			}
2747 2747
 
2748 2748
 			print '<tr>';
2749
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2750
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
2749
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2750
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency).'</td>';
2751 2751
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2752 2752
 				// Multicurrency Amount HT
2753
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2753
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2754 2754
 			}
2755 2755
 			print '</tr>';
2756 2756
 
2757 2757
 			print '<tr>';
2758
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
2759
-			print '<td class="nowrap amountcard right">' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
2758
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
2759
+			print '<td class="nowrap amountcard right">'.price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency).'</td>';
2760 2760
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2761 2761
 				// Multicurrency Amount VAT
2762
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2762
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2763 2763
 			}
2764 2764
 			print '</tr>';
2765 2765
 
2766 2766
 			// Amount Local Taxes
2767 2767
 			if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2768 2768
 				print '<tr>';
2769
-				print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2770
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
2769
+				print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2770
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency).'</td>';
2771 2771
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2772
-					print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2772
+					print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2773 2773
 				}
2774 2774
 				print '</tr>';
2775 2775
 
2776 2776
 				// Amount Local Taxes
2777 2777
 				if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
2778 2778
 					print '<tr>';
2779
-					print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
2780
-					print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
2779
+					print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
2780
+					print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency).'</td>';
2781 2781
 					if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2782
-						print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2782
+						print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2783 2783
 					}
2784 2784
 					print '</tr>';
2785 2785
 				}
2786 2786
 			}
2787 2787
 
2788 2788
 			print '<tr>';
2789
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
2790
-			print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>';
2789
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
2790
+			print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
2791 2791
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2792 2792
 				// Multicurrency Amount TTC
2793
-				print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>';
2793
+				print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>';
2794 2794
 			}
2795 2795
 			print '</tr>'."\n";
2796 2796
 
@@ -2904,7 +2904,7 @@  discard block
 block discarded – undo
2904 2904
 						if ($usercansend) {
2905 2905
 							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
2906 2906
 						} else {
2907
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF']. '#', '', false);
2907
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false);
2908 2908
 						}
2909 2909
 					}
2910 2910
 				}
@@ -2973,7 +2973,7 @@  discard block
 block discarded – undo
2973 2973
 						}*/
2974 2974
 					} else {
2975 2975
 						$langs->load("errors");
2976
-						print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
2976
+						print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
2977 2977
 					}
2978 2978
 				}
2979 2979
 
@@ -3025,7 +3025,7 @@  discard block
 block discarded – undo
3025 3025
 					if ($numshipping == 0) {
3026 3026
 						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
3027 3027
 					} else {
3028
-						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
3028
+						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3029 3029
 					}
3030 3030
 				}
3031 3031
 			}
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2199,7 +2199,9 @@  discard block
 block discarded – undo
2199 2199
 					}
2200 2200
 				}
2201 2201
 			}
2202
-			if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2202
+			if ($nbMandated > 0 ) {
2203
+				$text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2204
+			}
2203 2205
 
2204 2206
 			if (getDolGlobalInt('SALE_ORDER_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2205 2207
 				// This is a hidden option:
@@ -2867,9 +2869,12 @@  discard block
 block discarded – undo
2867 2869
 					$parameters = array();
2868 2870
 					// Note that $action and $object may be modified by hook
2869 2871
 					$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action);
2870
-					if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
2871
-					if (empty($reshook))
2872
-						$object->formAddObjectLine(1, $mysoc, $soc);
2872
+					if ($reshook < 0) {
2873
+						setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
2874
+					}
2875
+					if (empty($reshook)) {
2876
+											$object->formAddObjectLine(1, $mysoc, $soc);
2877
+					}
2873 2878
 				} else {
2874 2879
 					$parameters = array();
2875 2880
 					$reshook = $hookmanager->executeHooks('formEditObjectLine', $parameters, $object, $action);
Please login to merge, or discard this patch.
htdocs/core/triggers/interface_20_all_Logevents.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 	{
68 68
 		parent::__construct($db);
69 69
 
70
-		$this->family 		= "core";
70
+		$this->family = "core";
71 71
 		$this->description  = "Triggers of this module allows to add security event records inside Dolibarr.";
72
-		$this->version 		= self::VERSION_DOLIBARR;  // VERSION_ 'DEVELOPMENT' or 'EXPERIMENTAL' or 'DOLIBARR'
73
-		$this->picto 		= 'technic';
72
+		$this->version = self::VERSION_DOLIBARR; // VERSION_ 'DEVELOPMENT' or 'EXPERIMENTAL' or 'DOLIBARR'
73
+		$this->picto = 'technic';
74 74
 		$this->event_label 	= '';
75 75
 		$this->event_desc 	= '';
76 76
 		$this->event_date 	= 0;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		}
105 105
 
106 106
 		// Actions
107
-		dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id);
107
+		dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
108 108
 		$this->initEventData(InterfaceLogevents::EVENT_ACTION_DICT[$action], $object);
109 109
 
110 110
 		// Add entry in event table
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	private function initEventData($key_text, $object): void
142 142
 	{
143 143
 		$this->event_date = dol_now();
144
-		$this->event_label = $this->event_desc = $key_text . ' : ' . $object->login;
144
+		$this->event_label = $this->event_desc = $key_text.' : '.$object->login;
145 145
 		if ($key_text == InterfaceLogevents::EVENT_ACTION_DICT['USER_ENABLEDISABLE']) { // TODO should be refactored using an object property for event data.
146 146
 			$object->statut ? $this->event_desc .= ' - disabled' : $this->event_desc .= ' - enabled';
147 147
 		}
Please login to merge, or discard this patch.
htdocs/core/actions_addupdatedelete.inc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 			$db->commit();
169 169
 
170 170
 			if (empty($noback)) {
171
-				header("Location: " . $urltogo);
171
+				header("Location: ".$urltogo);
172 172
 				exit;
173 173
 			}
174 174
 		} else {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 				continue;
203 203
 			}
204 204
 		} else {
205
-			if (!GETPOSTISSET($key) && !preg_match('/^chkbxlst:/', $object->fields[$key]['type']) && $object->fields[$key]['type']!=='checkbox') {
205
+			if (!GETPOSTISSET($key) && !preg_match('/^chkbxlst:/', $object->fields[$key]['type']) && $object->fields[$key]['type'] !== 'checkbox') {
206 206
 				continue; // The field was not submited to be saved
207 207
 			}
208 208
 		}
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 			$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
307 307
 			$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
308 308
 			if ($urltogo && empty($noback)) {
309
-				header("Location: " . $urltogo);
309
+				header("Location: ".$urltogo);
310 310
 				exit;
311 311
 			}
312 312
 		} else {
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 				print 'Error backurlforlist is not defined';
398 398
 				exit;
399 399
 			}
400
-			header("Location: " . $backurlforlist);
400
+			header("Location: ".$backurlforlist);
401 401
 			exit;
402 402
 		}
403 403
 	} else {
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 			}
595 595
 
596 596
 			if (empty($noback)) {
597
-				header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $newid); // Open record of new object
597
+				header("Location: ".$_SERVER['PHP_SELF'].'?id='.$newid); // Open record of new object
598 598
 				exit;
599 599
 			}
600 600
 		} else {
Please login to merge, or discard this patch.
htdocs/core/modules/modMultiCurrency.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -145,12 +145,12 @@  discard block
 block discarded – undo
145 145
 
146 146
 		// Cronjobs (List of cron jobs entries to add when module is enabled)
147 147
 		// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
148
-		$statusatinstall=1;
149
-		$arraydate=dol_getdate(dol_now());
150
-		$datestart=dol_mktime(21, 15, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
148
+		$statusatinstall = 1;
149
+		$arraydate = dol_getdate(dol_now());
150
+		$datestart = dol_mktime(21, 15, 0, $arraydate['mon'], $arraydate['mday'], $arraydate['year']);
151 151
 
152 152
 		$this->cronjobs = array(
153
-			0 =>array('priority'=>61, 'label'=>'MutltiCurrencyAutoUpdateCurrencies', 'jobtype'=>'method', 'class'=>'multicurrency/class/multicurrency.class.php', 'objectname'=>'MultiCurrency', 'method'=>'syncRates',             'parameters'=>'0,0,cron',      'comment'=>'Update all the currencies using the currencylayer API. An APi key needs to be given in the multi-currency module config page', 'frequency'=>1, 'unitfrequency'=>2678400, 'status'=>$statusatinstall, 'test'=>'isModEnabled("cron")', 'datestart'=>$datestart),
153
+			0 =>array('priority'=>61, 'label'=>'MutltiCurrencyAutoUpdateCurrencies', 'jobtype'=>'method', 'class'=>'multicurrency/class/multicurrency.class.php', 'objectname'=>'MultiCurrency', 'method'=>'syncRates', 'parameters'=>'0,0,cron', 'comment'=>'Update all the currencies using the currencylayer API. An APi key needs to be given in the multi-currency module config page', 'frequency'=>1, 'unitfrequency'=>2678400, 'status'=>$statusatinstall, 'test'=>'isModEnabled("cron")', 'datestart'=>$datestart),
154 154
 		);
155 155
 
156 156
 		// Permissions
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
 		$multicurrency = new MultiCurrency($this->db);
322 322
 
323
-		if (! $multicurrency->checkCodeAlreadyExists($conf->currency)) {
323
+		if (!$multicurrency->checkCodeAlreadyExists($conf->currency)) {
324 324
 			$langs->loadCacheCurrencies('');
325 325
 
326 326
 			$multicurrency->code = $conf->currency;
Please login to merge, or discard this patch.
htdocs/fourn/class/fournisseur.facture.class.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	/**
205 205
 	 * @var int ID
206 206
 	 */
207
-	public $fk_account;		// default bank account
207
+	public $fk_account; // default bank account
208 208
 
209 209
 	/**
210 210
 	 * @var int transport mode id
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 		if ($this->fac_rec > 0) {
408 408
 			$this->fk_fac_rec_source = $this->fac_rec;
409 409
 
410
-			require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php';
410
+			require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php';
411 411
 			$_facrec = new FactureFournisseurRec($this->db);
412 412
 			$result = $_facrec->fetch($this->fac_rec);
413 413
 			$result = $_facrec->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0); // This load $_facrec->linkedObjectsIds
@@ -441,13 +441,13 @@  discard block
 block discarded – undo
441 441
 			$this->location_incoterms = $_facrec->location_incoterms;
442 442
 
443 443
 			// Clean parameters
444
-			if (! $this->type) {
444
+			if (!$this->type) {
445 445
 				$this->type = self::TYPE_STANDARD;
446 446
 			}
447 447
 			if (!empty(GETPOST('ref_supplier'))) {
448 448
 				$this->ref_supplier = trim($this->ref_supplier);
449 449
 			} else {
450
-				$this->ref_supplier = trim($this->ref_supplier . '_' . ($_facrec->nb_gen_done + 1));
450
+				$this->ref_supplier = trim($this->ref_supplier.'_'.($_facrec->nb_gen_done + 1));
451 451
 			}
452 452
 			$this->note_public = trim($this->note_public);
453 453
 			$this->note_private = trim($this->note_private);
@@ -455,11 +455,11 @@  discard block
 block discarded – undo
455 455
 
456 456
 			$this->array_options = $_facrec->array_options;
457 457
 
458
-			if (! $this->mode_reglement_id) {
458
+			if (!$this->mode_reglement_id) {
459 459
 				$this->mode_reglement_id = 0;
460 460
 			}
461 461
 			$this->status = self::STATUS_DRAFT;
462
-			$this->statut = self::STATUS_DRAFT;	// deprecated
462
+			$this->statut = self::STATUS_DRAFT; // deprecated
463 463
 
464 464
 			$this->linked_objects = $_facrec->linkedObjectsIds;
465 465
 			// We do not add link to template invoice or next invoice will be linked to all generated invoices
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 			/*
709 709
 			 * Insert lines of template invoices
710 710
 			 */
711
-			if (! $error && $this->fac_rec > 0) {
711
+			if (!$error && $this->fac_rec > 0) {
712 712
 				foreach ($_facrec->lines as $i => $val) {
713 713
 					if ($_facrec->lines[$i]->fk_product) {
714 714
 						$prod = new Product($this->db);
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 					$localtax1_tx=get_localtax($tva_tx,1,$soc,$mysoc,$tva_npr);
724 724
 					$localtax2_tx=get_localtax($tva_tx,2,$soc,$mysoc,$tva_npr);
725 725
 					*/
726
-					$tva_tx = $_facrec->lines[$i]->tva_tx . ($_facrec->lines[$i]->vat_src_code ? '(' . $_facrec->lines[$i]->vat_src_code . ')' : '');
726
+					$tva_tx = $_facrec->lines[$i]->tva_tx.($_facrec->lines[$i]->vat_src_code ? '('.$_facrec->lines[$i]->vat_src_code.')' : '');
727 727
 					$tva_npr = $_facrec->lines[$i]->info_bits;
728 728
 					if (empty($tva_tx)) {
729 729
 						$tva_npr = 0;
@@ -735,8 +735,8 @@  discard block
 block discarded – undo
735 735
 					$buyprice = empty($_facrec->lines[$i]->buyprice) ? 0 : $_facrec->lines[$i]->buyprice;
736 736
 
737 737
 					// If buyprice not defined from template invoice, we try to guess the best value
738
-					if (! $buyprice && $_facrec->lines[$i]->fk_product > 0) {
739
-						require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
738
+					if (!$buyprice && $_facrec->lines[$i]->fk_product > 0) {
739
+						require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
740 740
 						$producttmp = new ProductFournisseur($this->db);
741 741
 						$producttmp->fetch($_facrec->lines[$i]->fk_product);
742 742
 
@@ -921,11 +921,11 @@  discard block
 block discarded – undo
921 921
 				$this->id = $obj->rowid;
922 922
 				$this->ref = $obj->ref ? $obj->ref : $obj->rowid; // We take rowid if ref is empty for backward compatibility
923 923
 
924
-				$this->ref_supplier         = $obj->ref_supplier;
925
-				$this->ref_ext			    = $obj->ref_ext;
926
-				$this->entity				= $obj->entity;
924
+				$this->ref_supplier = $obj->ref_supplier;
925
+				$this->ref_ext = $obj->ref_ext;
926
+				$this->entity = $obj->entity;
927 927
 				$this->type					= empty($obj->type) ? self::TYPE_STANDARD : $obj->type;
928
-				$this->subtype				= $obj->subtype;
928
+				$this->subtype = $obj->subtype;
929 929
 				$this->socid				= $obj->fk_soc;
930 930
 				$this->datec				= $this->db->jdate($obj->datec);
931 931
 				$this->date					= $this->db->jdate($obj->datef);
@@ -943,13 +943,13 @@  discard block
 block discarded – undo
943 943
 				$this->total_tva			= $obj->total_tva;
944 944
 				$this->total_ttc			= $obj->total_ttc;
945 945
 				$this->status				= $obj->status;
946
-				$this->statut				= $obj->status;	// For backward compatibility
947
-				$this->fk_statut			= $obj->status;	// For backward compatibility
946
+				$this->statut				= $obj->status; // For backward compatibility
947
+				$this->fk_statut			= $obj->status; // For backward compatibility
948 948
 				$this->fk_user_author       = $obj->fk_user_author;
949 949
 				$this->author				= $obj->fk_user_author;
950 950
 				$this->fk_user_valid        = $obj->fk_user_valid;
951 951
 				$this->fk_facture_source	= $obj->fk_facture_source;
952
-				$this->vat_reverse_charge	= empty($obj->vat_reverse_charge) ? '0' : '1';
952
+				$this->vat_reverse_charge = empty($obj->vat_reverse_charge) ? '0' : '1';
953 953
 				$this->fk_fac_rec_source	= $obj->fk_fac_rec_source;
954 954
 				$this->fk_project           = $obj->fk_project;
955 955
 				$this->cond_reglement_id	= $obj->fk_cond_reglement;
@@ -1051,11 +1051,11 @@  discard block
 block discarded – undo
1051 1051
 					$line->date_end         = $obj->date_end;
1052 1052
 					$line->product_ref      = $obj->product_ref;
1053 1053
 					$line->ref              = $obj->product_ref;
1054
-					$line->ref_supplier		= $obj->ref_supplier;
1054
+					$line->ref_supplier = $obj->ref_supplier;
1055 1055
 					$line->libelle			= $obj->label;
1056 1056
 					$line->label  			= $obj->label;
1057 1057
 					$line->product_barcode  = $obj->product_barcode;
1058
-					$line->product_desc		= $obj->product_desc;
1058
+					$line->product_desc = $obj->product_desc;
1059 1059
 					$line->subprice         = $obj->pu_ht;
1060 1060
 					$line->pu_ht            = $obj->pu_ht;
1061 1061
 					$line->pu_ttc			= $obj->pu_ttc;
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
 					$line->localtax2_tx		= $obj->localtax2_tx;
1066 1066
 					$line->localtax1_type	= $obj->localtax1_type;
1067 1067
 					$line->localtax2_type	= $obj->localtax2_type;
1068
-					$line->qty				= $obj->qty;
1068
+					$line->qty = $obj->qty;
1069 1069
 					$line->remise_percent   = $obj->remise_percent;
1070 1070
 					$line->fk_remise_except = $obj->fk_remise_except;
1071 1071
 					//$line->tva			= $obj->total_tva; // deprecated
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 				$facligne->rang = 1;
1351 1351
 				$linecount = count($this->lines);
1352 1352
 				for ($ii = 1; $ii <= $linecount; $ii++) {
1353
-					$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii+1);
1353
+					$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
1354 1354
 				}
1355 1355
 			}
1356 1356
 
@@ -2699,7 +2699,7 @@  discard block
 block discarded – undo
2699 2699
 
2700 2700
 			while ($obj = $this->db->fetch_object($resql)) {
2701 2701
 				$facturestatic->date_echeance = $this->db->jdate($obj->datefin);
2702
-				$facturestatic->statut = $obj->status;	// For backward compatibility
2702
+				$facturestatic->statut = $obj->status; // For backward compatibility
2703 2703
 				$facturestatic->status = $obj->status;
2704 2704
 
2705 2705
 				$response->nbtodo++;
@@ -2881,7 +2881,7 @@  discard block
 block discarded – undo
2881 2881
 				$label = $langs->trans("ShowSupplierInvoice");
2882 2882
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
2883 2883
 			}
2884
-			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' :  ' title="tocomplete"');
2884
+			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
2885 2885
 			$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
2886 2886
 		}
2887 2887
 
@@ -2910,7 +2910,7 @@  discard block
 block discarded – undo
2910 2910
 			}
2911 2911
 		}
2912 2912
 		global $action;
2913
-		$hookmanager->initHooks(array($this->element . 'dao'));
2913
+		$hookmanager->initHooks(array($this->element.'dao'));
2914 2914
 		$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
2915 2915
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
2916 2916
 		if ($reshook > 0) {
@@ -2941,7 +2941,7 @@  discard block
 block discarded – undo
2941 2941
 
2942 2942
 		$mybool = false;
2943 2943
 
2944
-		$file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER') . ".php";
2944
+		$file = getDolGlobalString('INVOICE_SUPPLIER_ADDON_NUMBER').".php";
2945 2945
 		$classname = $conf->global->INVOICE_SUPPLIER_ADDON_NUMBER;
2946 2946
 
2947 2947
 		// Include file with class
@@ -3132,7 +3132,7 @@  discard block
 block discarded – undo
3132 3132
 		// Load source object
3133 3133
 		$object->fetch($fromid);
3134 3134
 		$object->id = 0;
3135
-		$object->statut = self::STATUS_DRAFT;	// For backward compatibility
3135
+		$object->statut = self::STATUS_DRAFT; // For backward compatibility
3136 3136
 		$object->status = self::STATUS_DRAFT;
3137 3137
 
3138 3138
 		$object->fetch_thirdparty(); // We need it to recalculate VAT localtaxes according to main sale taxes and vendor
@@ -3682,7 +3682,7 @@  discard block
 block discarded – undo
3682 3682
 		$this->localtax1_type	= $obj->localtax1_type;
3683 3683
 		$this->localtax2_type	= $obj->localtax2_type;
3684 3684
 
3685
-		$this->qty				= $obj->qty;
3685
+		$this->qty = $obj->qty;
3686 3686
 		$this->remise_percent = $obj->remise_percent;
3687 3687
 		$this->fk_remise_except = $obj->fk_remise_except;
3688 3688
 		//$this->tva				= $obj->total_tva; // deprecated
Please login to merge, or discard this patch.
htdocs/admin/multicurrency.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -356,13 +356,13 @@
 block discarded – undo
356 356
 	print '<tr class="oddeven">';
357 357
 	print '<td class="fieldrequired"><a target="_blank" rel="noopener noreferrer external" href="'.$urlforapilayer.'">'.$langs->transnoentitiesnoconv("multicurrency_appId").'</a></td>';
358 358
 	print '<td class="right">';
359
-	print '<input type="text" name="MULTICURRENCY_APP_ID" value="' . getDolGlobalString('MULTICURRENCY_APP_ID').'" size="28" />&nbsp;';
359
+	print '<input type="text" name="MULTICURRENCY_APP_ID" value="'.getDolGlobalString('MULTICURRENCY_APP_ID').'" size="28" />&nbsp;';
360 360
 	print '</td></tr>';
361 361
 
362 362
 	print '<tr class="oddeven">';
363 363
 	print '<td>'.$langs->transnoentitiesnoconv("multicurrency_appCurrencySource").'</td>';
364 364
 	print '<td class="right">';
365
-	print '<input type="text" name="MULTICURRENCY_APP_SOURCE" value="' . getDolGlobalString('MULTICURRENCY_APP_SOURCE').'" size="10" placeholder="USD" />&nbsp;'; // Default: USD
365
+	print '<input type="text" name="MULTICURRENCY_APP_SOURCE" value="'.getDolGlobalString('MULTICURRENCY_APP_SOURCE').'" size="10" placeholder="USD" />&nbsp;'; // Default: USD
366 366
 	print '</td></tr>';
367 367
 
368 368
 	/*print '<tr class="oddeven">';
Please login to merge, or discard this patch.
htdocs/modulebuilder/index.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
 $modulename = dol_sanitizeFileName(GETPOST('modulename', 'alpha'));
75 75
 $objectname = dol_sanitizeFileName(GETPOST('objectname', 'alpha'));
76 76
 $dicname = dol_sanitizeFileName(GETPOST('dicname', 'alpha'));
77
-$editorname= GETPOST('editorname', 'alpha');
78
-$editorurl= GETPOST('editorurl', 'alpha');
79
-$version= GETPOST('version', 'alpha');
80
-$family= GETPOST('family', 'alpha');
81
-$picto= GETPOST('idpicto', 'alpha');
82
-$idmodule= GETPOST('idmodule', 'alpha');
77
+$editorname = GETPOST('editorname', 'alpha');
78
+$editorurl = GETPOST('editorurl', 'alpha');
79
+$version = GETPOST('version', 'alpha');
80
+$family = GETPOST('family', 'alpha');
81
+$picto = GETPOST('idpicto', 'alpha');
82
+$idmodule = GETPOST('idmodule', 'alpha');
83 83
 
84 84
 // Security check
85 85
 if (!isModEnabled('modulebuilder')) {
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
 		// Copy last html.formsetup.class.php' to backport folder
250 250
 		$tryToCopyFromSetupClass = true;
251
-		$backportDest = $destdir .'/backport/v16/core/class';
251
+		$backportDest = $destdir.'/backport/v16/core/class';
252 252
 		$backportFileSrc = DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
253 253
 		$backportFileDest = $backportDest.'/html.formsetup.class.php';
254 254
 		$result = dol_mkdir($backportDest);
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 			);
352 352
 
353 353
 			if (!empty($conf->global->MODULEBUILDER_SPECIFIC_AUTHOR)) {
354
-				$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
354
+				$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' '.getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
355 355
 			}
356 356
 
357 357
 			$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 
380 380
 		clearstatcache(true);
381 381
 		if (function_exists('opcache_invalidate')) {
382
-			opcache_reset();	// remove the include cache hell !
382
+			opcache_reset(); // remove the include cache hell !
383 383
 		}
384 384
 
385 385
 		header("Location: ".$_SERVER["PHP_SELF"].'?module='.$modulename);
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 				}
829 829
 			}
830 830
 			$stringLog = implode("\n", $strreplace);
831
-			dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '','__CHANGELOG__' => $stringLog));
831
+			dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '', '__CHANGELOG__' => $stringLog));
832 832
 		}
833 833
 
834 834
 		// Delete old documentation files
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
 			}
1304 1304
 			$rights = $moduleobj->rights;
1305 1305
 			$moduledescriptorfile = $destdir.'/core/modules/mod'.$module.'.class.php';
1306
-			$checkComment=checkExistComment($moduledescriptorfile, 1);
1306
+			$checkComment = checkExistComment($moduledescriptorfile, 1);
1307 1307
 			if ($checkComment < 0) {
1308 1308
 				setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings');
1309 1309
 			} else {
@@ -1469,7 +1469,7 @@  discard block
 block discarded – undo
1469 1469
 			}
1470 1470
 		}
1471 1471
 			$menus = $moduleobj->menu;
1472
-			$counter = 0 ;
1472
+			$counter = 0;
1473 1473
 		foreach ($menus as $menu) {
1474 1474
 			if ($menu['leftmenu'] == strtolower($objectname)) {
1475 1475
 				$counter++;
@@ -1510,7 +1510,7 @@  discard block
 block discarded – undo
1510 1510
 			);
1511 1511
 
1512 1512
 			if (!empty($conf->global->MODULEBUILDER_SPECIFIC_AUTHOR)) {
1513
-				$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
1513
+				$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' '.getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
1514 1514
 			}
1515 1515
 
1516 1516
 			$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 		} else {
1611 1611
 			createNewDictionnary($module, $moduledescriptorfile, $newdicname, $dictionaries);
1612 1612
 			if (function_exists('opcache_invalidate')) {
1613
-				opcache_reset();	// remove the include cache hell !
1613
+				opcache_reset(); // remove the include cache hell !
1614 1614
 			}
1615 1615
 			clearstatcache(true);
1616 1616
 			header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''));
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 				'isameasure'=>GETPOST('propisameasure', 'int'),
1705 1705
 				'comment'=>GETPOST('propcomment', 'alpha'),
1706 1706
 				'help'=>GETPOST('prophelp', 'alpha'),
1707
-				'css'=>GETPOST('propcss', 'alpha'),        // Can be 'maxwidth500 widthcentpercentminusxx' for example
1707
+				'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example
1708 1708
 				'cssview'=>GETPOST('propcssview', 'alpha'),
1709 1709
 				'csslist'=>GETPOST('propcsslist', 'alpha'),
1710 1710
 				'default'=>GETPOST('propdefault', 'restricthtml'),
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
 
1859 1859
 			clearstatcache(true);
1860 1860
 			if (function_exists('opcache_invalidate')) {
1861
-				opcache_reset();	// remove the include cache hell !
1861
+				opcache_reset(); // remove the include cache hell !
1862 1862
 			}
1863 1863
 
1864 1864
 			header("Location: ".$_SERVER["PHP_SELF"].'?module=deletemodule');
@@ -1950,7 +1950,7 @@  discard block
 block discarded – undo
1950 1950
 
1951 1951
 			clearstatcache(true);
1952 1952
 			if (function_exists('opcache_invalidate')) {
1953
-				opcache_reset();	// remove the include cache hell !
1953
+				opcache_reset(); // remove the include cache hell !
1954 1954
 			}
1955 1955
 			$resultko = 0;
1956 1956
 			foreach ($filetodelete as $tmpfiletodelete) {
@@ -1970,7 +1970,7 @@  discard block
 block discarded – undo
1970 1970
 	}
1971 1971
 
1972 1972
 	$action = '';
1973
-	if (! $error) {
1973
+	if (!$error) {
1974 1974
 		$tabobj = 'newobject';
1975 1975
 	} else {
1976 1976
 		$tabobj = 'deleteobject';
@@ -2031,11 +2031,11 @@  discard block
 block discarded – undo
2031 2031
 	}
2032 2032
 
2033 2033
 	if (!empty(GETPOST('dictionnarykey'))) {
2034
-		$newdicname = $dicts['tabname'][GETPOST('dictionnarykey')-1];
2034
+		$newdicname = $dicts['tabname'][GETPOST('dictionnarykey') - 1];
2035 2035
 	}
2036 2036
 
2037 2037
 	//chercher la table dicname
2038
-	$query = "SHOW TABLES LIKE '" . MAIN_DB_PREFIX.strtolower($newdicname) . "'";
2038
+	$query = "SHOW TABLES LIKE '".MAIN_DB_PREFIX.strtolower($newdicname)."'";
2039 2039
 	$checkTable = $db->query($query);
2040 2040
 	if ($checkTable && $db->num_rows($checkTable) <= 0) {
2041 2041
 		$error++;
@@ -2074,7 +2074,7 @@  discard block
 block discarded – undo
2074 2074
 			setEventMessages($langs->trans("DictionaryDeleted", ucfirst(substr($newdicname, 2))), null);
2075 2075
 		}
2076 2076
 		if (function_exists('opcache_invalidate')) {
2077
-			opcache_reset();	// remove the include cache hell !
2077
+			opcache_reset(); // remove the include cache hell !
2078 2078
 		}
2079 2079
 		clearstatcache(true);
2080 2080
 		header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''));
@@ -2082,7 +2082,7 @@  discard block
 block discarded – undo
2082 2082
 	}
2083 2083
 }
2084 2084
 if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) {
2085
-	$keydict = GETPOST('dictionnarykey') - 1 ;
2085
+	$keydict = GETPOST('dictionnarykey') - 1;
2086 2086
 
2087 2087
 	$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
2088 2088
 	$destdir = $dirins.'/'.strtolower($module);
@@ -2116,7 +2116,7 @@  discard block
 block discarded – undo
2116 2116
 				setEventMessages($langs->trans("DictionaryNameUpdated", ucfirst(GETPOST('tablib'))), null);
2117 2117
 			}
2118 2118
 			if (function_exists('opcache_invalidate')) {
2119
-				opcache_reset();	// remove the include cache hell !
2119
+				opcache_reset(); // remove the include cache hell !
2120 2120
 			}
2121 2121
 			clearstatcache(true);
2122 2122
 			header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''));
@@ -2236,13 +2236,13 @@  discard block
 block discarded – undo
2236 2236
 
2237 2237
 	//check existing object permission
2238 2238
 	$counter = 0;
2239
-	$permsForObject =array();
2239
+	$permsForObject = array();
2240 2240
 	$permissions = $moduleobj->rights;
2241 2241
 	$allObject = array();
2242 2242
 
2243 2243
 	$countPerms = count($permissions);
2244 2244
 
2245
-	for ($i =0; $i<$countPerms; $i++) {
2245
+	for ($i = 0; $i < $countPerms; $i++) {
2246 2246
 		if ($permissions[$i][4] == $objectForPerms) {
2247 2247
 			$counter++;
2248 2248
 			if (count($permsForObject) < 3) {
@@ -2254,7 +2254,7 @@  discard block
 block discarded – undo
2254 2254
 
2255 2255
 	// check if label of object already exists
2256 2256
 	$countPermsObj = count($permsForObject);
2257
-	for ($j = 0; $j<$countPermsObj; $j++) {
2257
+	for ($j = 0; $j < $countPermsObj; $j++) {
2258 2258
 		if (in_array($crud, $permsForObject[$j])) {
2259 2259
 			$error++;
2260 2260
 			setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($crud), $langs->transnoentities($objectForPerms)), null, 'errors');
@@ -2291,7 +2291,7 @@  discard block
 block discarded – undo
2291 2291
 
2292 2292
 		clearstatcache(true);
2293 2293
 		if (function_exists('opcache_invalidate')) {
2294
-			opcache_reset();	// remove the include cache hell !
2294
+			opcache_reset(); // remove the include cache hell !
2295 2295
 		}
2296 2296
 		header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
2297 2297
 		exit;
@@ -2300,7 +2300,7 @@  discard block
 block discarded – undo
2300 2300
 
2301 2301
 
2302 2302
 // Update permission
2303
-if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright')&& empty($cancel)) {
2303
+if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright') && empty($cancel)) {
2304 2304
 	$error = 0;
2305 2305
 	// load class and check if right exist
2306 2306
 	$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
@@ -2343,21 +2343,21 @@  discard block
 block discarded – undo
2343 2343
 	}
2344 2344
 
2345 2345
 	$permissions = $moduleobj->rights;
2346
-	$key =(int) GETPOST('counter')-1;
2346
+	$key = (int) GETPOST('counter') - 1;
2347 2347
 	//get permission want to delete from permissions array
2348 2348
 	$x1 = $permissions[$key][1];
2349 2349
 	$x2 = $permissions[$key][4];
2350 2350
 	$x3 = $permissions[$key][5];
2351 2351
 		//check existing object permission
2352 2352
 		$counter = 0;
2353
-		$permsForObject =array();
2353
+		$permsForObject = array();
2354 2354
 		$permissions = $moduleobj->rights;
2355 2355
 		$firstRight = 0;
2356 2356
 		$existRight = 0;
2357 2357
 		$allObject = array();
2358 2358
 
2359 2359
 		$countPerms = count($permissions);
2360
-	for ($i =0; $i<$countPerms; $i++) {
2360
+	for ($i = 0; $i < $countPerms; $i++) {
2361 2361
 		if ($permissions[$i][4] == $objectForPerms) {
2362 2362
 			$counter++;
2363 2363
 			if (count($permsForObject) < 3) {
@@ -2369,7 +2369,7 @@  discard block
 block discarded – undo
2369 2369
 
2370 2370
 	if ($label != $x1 && $crud != $x3) {
2371 2371
 		$countPermsObj = count($permsForObject);
2372
-		for ($j = 0; $j<$countPermsObj; $j++) {
2372
+		for ($j = 0; $j < $countPermsObj; $j++) {
2373 2373
 			if (in_array($label, $permsForObject[$j])) {
2374 2374
 				$error++;
2375 2375
 				setEventMessages($langs->trans("ErrorExistingPermission", $langs->transnoentities($label), $langs->transnoentities($objectForPerms)), null, 'errors');
@@ -2397,7 +2397,7 @@  discard block
 block discarded – undo
2397 2397
 			setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null);
2398 2398
 			clearstatcache(true);
2399 2399
 			if (function_exists('opcache_invalidate')) {
2400
-				opcache_reset();	// remove the include cache hell !
2400
+				opcache_reset(); // remove the include cache hell !
2401 2401
 			}
2402 2402
 			header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
2403 2403
 			exit;
@@ -2421,7 +2421,7 @@  discard block
 block discarded – undo
2421 2421
 	}
2422 2422
 
2423 2423
 	$permissions = $moduleobj->rights;
2424
-	$key = (int) GETPOST('permskey', 'int')-1;
2424
+	$key = (int) GETPOST('permskey', 'int') - 1;
2425 2425
 
2426 2426
 	if (!$error) {
2427 2427
 		// check if module is enabled
@@ -2447,7 +2447,7 @@  discard block
 block discarded – undo
2447 2447
 
2448 2448
 			clearstatcache(true);
2449 2449
 			if (function_exists('opcache_invalidate')) {
2450
-				opcache_reset();	// remove the include cache hell !
2450
+				opcache_reset(); // remove the include cache hell !
2451 2451
 			}
2452 2452
 
2453 2453
 			header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
@@ -2617,7 +2617,7 @@  discard block
 block discarded – undo
2617 2617
 
2618 2618
 		clearstatcache(true);
2619 2619
 		if (function_exists('opcache_invalidate')) {
2620
-			opcache_reset();	// remove the include cache hell !
2620
+			opcache_reset(); // remove the include cache hell !
2621 2621
 		}
2622 2622
 
2623 2623
 		setEventMessages($langs->trans('MenuDeletedSuccessfuly'), null);
@@ -2674,7 +2674,7 @@  discard block
 block discarded – undo
2674 2674
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Url")), null, 'errors');
2675 2675
 	}
2676 2676
 	if (!empty(GETPOST('target'))) {
2677
-		$targets = array('_blank','_self','_parent','_top','');
2677
+		$targets = array('_blank', '_self', '_parent', '_top', '');
2678 2678
 		if (!in_array(GETPOST('target'), $targets)) {
2679 2679
 			$error++;
2680 2680
 			setEventMessages($langs->trans("ErrorFieldValue", $langs->transnoentities("target")), null, 'errors');
@@ -2708,7 +2708,7 @@  discard block
 block discarded – undo
2708 2708
 	 $objects = dolGetListOfObjectClasses($destdir);
2709 2709
 
2710 2710
 	if (GETPOST('type', 'alpha') == 'left') {
2711
-		if (empty(GETPOST('leftmenu')) && count($objects) >0) {
2711
+		if (empty(GETPOST('leftmenu')) && count($objects) > 0) {
2712 2712
 			$error++;
2713 2713
 			setEventMessages($langs->trans("ErrorCoherenceMenu", $langs->transnoentities("leftmenu"), $langs->transnoentities("type")), null, 'errors');
2714 2714
 		}
@@ -2780,7 +2780,7 @@  discard block
 block discarded – undo
2780 2780
 
2781 2781
 // Modify a menu entry
2782 2782
 if ($dirins && $action == "update_menu" && GETPOST('menukey', 'int') && GETPOST('tabobj')) {
2783
-	$objectname =  GETPOST('tabobj');
2783
+	$objectname = GETPOST('tabobj');
2784 2784
 	$dirins = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
2785 2785
 	$destdir = $dirins.'/'.strtolower($module);
2786 2786
 	$objects = dolGetListOfObjectClasses($destdir);
@@ -2865,7 +2865,7 @@  discard block
 block discarded – undo
2865 2865
 					if ($result < 0) {
2866 2866
 						setEventMessages($langs->trans('ErrorMenuExistValue'), null, 'errors');
2867 2867
 						//var_dump($_SESSION);exit;
2868
-						header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key+1));
2868
+						header("Location: ".$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($key + 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.($key + 1));
2869 2869
 						exit;
2870 2870
 					}
2871 2871
 
@@ -3319,7 +3319,7 @@  discard block
 block discarded – undo
3319 3319
 		$h++;
3320 3320
 
3321 3321
 		$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '');
3322
-		$head2[$h][1] = ($countDictionaries == 0  ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries').'<span class="marginleftonlyshort badge">'.$countDictionaries."</span>");
3322
+		$head2[$h][1] = ($countDictionaries == 0 ? $langs->trans("Dictionaries") : $langs->trans('Dictionaries').'<span class="marginleftonlyshort badge">'.$countDictionaries."</span>");
3323 3323
 		$head2[$h][2] = 'dictionaries';
3324 3324
 		$h++;
3325 3325
 
@@ -3842,7 +3842,7 @@  discard block
 block discarded – undo
3842 3842
 
3843 3843
 				print '</form>';
3844 3844
 			} elseif ($tabobj == 'createproperty') {
3845
-				$attributesUnique = array (
3845
+				$attributesUnique = array(
3846 3846
 					'proplabel' => $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")),
3847 3847
 					'propname' => $form->textwithpicto($langs->trans("Code"), $langs->trans("PropertyDesc"), 1, 'help', 'extracss', 0, 3, 'propertyhelp'),
3848 3848
 					'proptype' => $form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelpIntro").'<br><br>'.$langs->trans("TypeOfFieldsHelp"), 1, 'help', 'extracss', 0, 3, 'typehelp'),
@@ -3937,8 +3937,8 @@  discard block
 block discarded – undo
3937 3937
 				}
3938 3938
 				print '</table><br>'."\n";
3939 3939
 				print '<div class="center">';
3940
-				print '<input type="submit" class="button button-save" name="add" value="' . dol_escape_htmltag($langs->trans('Create')) . '">';
3941
-				print '<input type="button" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" onclick="goBack()">';
3940
+				print '<input type="submit" class="button button-save" name="add" value="'.dol_escape_htmltag($langs->trans('Create')).'">';
3941
+				print '<input type="button" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" onclick="goBack()">';
3942 3942
 				print '</div>';
3943 3943
 				print '</form>';
3944 3944
 				// javascript
@@ -4003,7 +4003,7 @@  discard block
 block discarded – undo
4003 4003
 					// Print form confirm
4004 4004
 					print $formconfirm;
4005 4005
 				}
4006
-				if ($action != 'editfile' || empty($file) ) {
4006
+				if ($action != 'editfile' || empty($file)) {
4007 4007
 					try {
4008 4008
 						//$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
4009 4009
 
@@ -4043,16 +4043,16 @@  discard block
 block discarded – undo
4043 4043
 						// Define path for sql file
4044 4044
 						$pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql';
4045 4045
 						$result = dol_buildpath($pathtosql);
4046
-						if (! dol_is_file($result)) {
4046
+						if (!dol_is_file($result)) {
4047 4047
 							$pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'.sql';
4048 4048
 							$result = dol_buildpath($pathtosql);
4049
-							if (! dol_is_file($result)) {
4049
+							if (!dol_is_file($result)) {
4050 4050
 								$pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql';
4051 4051
 								$result = dol_buildpath($pathtosql);
4052
-								if (! dol_is_file($result)) {
4052
+								if (!dol_is_file($result)) {
4053 4053
 									$pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql';
4054 4054
 									$result = dol_buildpath($pathtosql);
4055
-									if (! dol_is_file($result)) {
4055
+									if (!dol_is_file($result)) {
4056 4056
 										$pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'.sql';
4057 4057
 										$pathtosqlextra = 'install/mysql/tables/llx_'.strtolower($module).'_extrafields.sql';
4058 4058
 										$result = dol_buildpath($pathtosql);
@@ -4071,7 +4071,7 @@  discard block
 block discarded – undo
4071 4071
 						$pathtosqlroot = preg_replace('/\/llx_.*$/', '', $pathtosql);
4072 4072
 
4073 4073
 						$pathtosqlkey   = preg_replace('/\.sql$/', '.key.sql', $pathtosql);
4074
-						$pathtosqlextrakey   = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra);
4074
+						$pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra);
4075 4075
 
4076 4076
 						$pathtolib      = strtolower($module).'/lib/'.strtolower($module).'.lib.php';
4077 4077
 						$pathtoobjlib   = strtolower($module).'/lib/'.strtolower($module).'_'.strtolower($tabobj).'.lib.php';
@@ -4130,7 +4130,7 @@  discard block
 block discarded – undo
4130 4130
 
4131 4131
 						// API file
4132 4132
 						print '<br>';
4133
-						print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtoapi) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi)?'':'</span></strike>').'</strong>';
4133
+						print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtoapi) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi) ? '' : '</span></strike>').'</strong>';
4134 4134
 						if (dol_is_file($realpathtoapi)) {
4135 4135
 							$file = file_get_contents($realpathtoapi);
4136 4136
 							if (preg_match('/var '.$tabobj.'\s+([^\s]*)\s/ims', $file, $objs)) {
@@ -4152,7 +4152,7 @@  discard block
 block discarded – undo
4152 4152
 						}
4153 4153
 						// PHPUnit
4154 4154
 						print '<br>';
4155
-						print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtophpunit) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit)?'':'</span></strike>').'</strong>';
4155
+						print '<span class="fa fa-file-o"></span> '.$langs->trans("TestClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtophpunit) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtophpunit).(dol_is_file($realpathtophpunit) ? '' : '</span></strike>').'</strong>';
4156 4156
 						if (dol_is_file($realpathtophpunit)) {
4157 4157
 							print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.urlencode($tab).'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtophpunit).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
4158 4158
 							print ' ';
@@ -4341,26 +4341,26 @@  discard block
 block discarded – undo
4341 4341
 									$propname = $propkey;
4342 4342
 									$proplabel = $propval['label'];
4343 4343
 									$proptype = $propval['type'];
4344
-									$proparrayofkeyval = !empty($propval['arrayofkeyval'])?$propval['arrayofkeyval']:'';
4344
+									$proparrayofkeyval = !empty($propval['arrayofkeyval']) ? $propval['arrayofkeyval'] : '';
4345 4345
 									$propnotnull = !empty($propval['notnull']) ? $propval['notnull'] : '0';
4346
-									$propdefault = !empty($propval['default'])?$propval['default']:'';
4347
-									$propindex = !empty($propval['index'])?$propval['index']:'';
4348
-									$propforeignkey = !empty($propval['foreignkey'])?$propval['foreignkey']:'';
4346
+									$propdefault = !empty($propval['default']) ? $propval['default'] : '';
4347
+									$propindex = !empty($propval['index']) ? $propval['index'] : '';
4348
+									$propforeignkey = !empty($propval['foreignkey']) ? $propval['foreignkey'] : '';
4349 4349
 									$propposition = $propval['position'];
4350 4350
 									$propenabled = $propval['enabled'];
4351 4351
 									$propvisible = $propval['visible'];
4352
-									$propnoteditable = !empty($propval['noteditable'])?$propval['noteditable']:0;
4352
+									$propnoteditable = !empty($propval['noteditable']) ? $propval['noteditable'] : 0;
4353 4353
 									//$propalwayseditable = !empty($propval['alwayseditable'])?$propval['alwayseditable']:0;
4354
-									$propsearchall = !empty($propval['searchall'])?$propval['searchall']:0;
4355
-									$propisameasure = !empty($propval['isameasure'])?$propval['isameasure']:0;
4356
-									$propcss = !empty($propval['css'])?$propval['css']:'';
4357
-									$propcssview = !empty($propval['cssview'])?$propval['cssview']:'';
4358
-									$propcsslist = !empty($propval['csslist'])?$propval['csslist']:'';
4359
-									$prophelp = !empty($propval['help'])?$propval['help']:'';
4360
-									$propshowoncombobox = !empty($propval['showoncombobox'])?$propval['showoncombobox']:0;
4354
+									$propsearchall = !empty($propval['searchall']) ? $propval['searchall'] : 0;
4355
+									$propisameasure = !empty($propval['isameasure']) ? $propval['isameasure'] : 0;
4356
+									$propcss = !empty($propval['css']) ? $propval['css'] : '';
4357
+									$propcssview = !empty($propval['cssview']) ? $propval['cssview'] : '';
4358
+									$propcsslist = !empty($propval['csslist']) ? $propval['csslist'] : '';
4359
+									$prophelp = !empty($propval['help']) ? $propval['help'] : '';
4360
+									$propshowoncombobox = !empty($propval['showoncombobox']) ? $propval['showoncombobox'] : 0;
4361 4361
 									//$propdisabled=$propval['disabled'];
4362
-									$propvalidate = !empty($propval['validate'])?$propval['validate']:0;
4363
-									$propcomment = !empty($propval['comment'])?$propval['comment']:'';
4362
+									$propvalidate = !empty($propval['validate']) ? $propval['validate'] : 0;
4363
+									$propcomment = !empty($propval['comment']) ? $propval['comment'] : '';
4364 4364
 
4365 4365
 									print '<!-- line for object property -->'."\n";
4366 4366
 									print '<tr class="oddeven">';
@@ -4751,14 +4751,14 @@  discard block
 block discarded – undo
4751 4751
 						$i = 0;
4752 4752
 						$maxi = count($dicts['tabname']);
4753 4753
 						while ($i < $maxi) {
4754
-							if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int')-1) {
4754
+							if ($action == 'editdict' && $i == (int) GETPOST('dictionnarykey', 'int') - 1) {
4755 4755
 								print '<tr class="oddeven">';
4756 4756
 								print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
4757 4757
 								print '<input type="hidden" name="token" value="'.newToken().'">';
4758 4758
 								print '<input type="hidden" name="tab" value="dictionaries">';
4759 4759
 								print '<input type="hidden" name="module" value="'.dol_escape_htmltag($module).'">';
4760 4760
 								print '<input type="hidden" name="action" value="updatedictionary">';
4761
-								print '<input type="hidden" name="dictionnarykey" value="'.($i+1).'">';
4761
+								print '<input type="hidden" name="dictionnarykey" value="'.($i + 1).'">';
4762 4762
 
4763 4763
 								print '<td class="tdsticky tdstickygray">';
4764 4764
 								print ($i + 1);
@@ -4854,8 +4854,8 @@  discard block
 block discarded – undo
4854 4854
 								print '</td>';
4855 4855
 
4856 4856
 								print '<td class="center minwidth75 tdstickyright tdstickyghostwhite">';
4857
-								print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editdict&token='.newToken().'&dictionnarykey='.urlencode($i+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'">'.img_edit().'</a>';
4858
-								print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletedict&token='.newToken().'&dictionnarykey='.urlencode($i+1).'&tab='.urlencode($tab).'&module='.urlencode($module).'">'.img_delete().'</a>';
4857
+								print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editdict&token='.newToken().'&dictionnarykey='.urlencode($i + 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'">'.img_edit().'</a>';
4858
+								print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletedict&token='.newToken().'&dictionnarykey='.urlencode($i + 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'">'.img_delete().'</a>';
4859 4859
 								print '</td>';
4860 4860
 
4861 4861
 								print '</tr>';
@@ -5070,7 +5070,7 @@  discard block
 block discarded – undo
5070 5070
 				print_liste_field_titre("", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ', $langs->trans(''));
5071 5071
 				print "</tr>\n";
5072 5072
 
5073
-				$r = count($menus)+1;
5073
+				$r = count($menus) + 1;
5074 5074
 				// for adding menu on module
5075 5075
 				print '<tr>';
5076 5076
 				print '<td class="center tdsticky tdstickygray"><input type="hidden" readonly class="center maxwidth50" name="propenabled" value="#"></td>';
@@ -5095,7 +5095,7 @@  discard block
 block discarded – undo
5095 5095
 				print '<td class="left"><input id="url" type="text" class="left maxwidth100" name="url" value="'.dol_escape_htmltag(GETPOST('url', 'alpha')).'"></td>';
5096 5096
 				print '<td class="left"><input type="text" class="left maxwidth75" name="langs" value="'.strtolower($module).'@'.strtolower($module).'" readonly></td>';
5097 5097
 				// Position
5098
-				print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000+$r).'" readonly></td>';
5098
+				print '<td class="center"><input type="text" class="center maxwidth50 tdstickygray" name="position" value="'.(1000 + $r).'" readonly></td>';
5099 5099
 				// Enabled
5100 5100
 				print '<td class="center">';
5101 5101
 				print '<input type="enabled" class="maxwidth125" value="'.dol_escape_htmltag(GETPOSTISSET('enabled') ? GETPOST('enabled') : 'isModEnabled(\''.$module.'\')').'">';
@@ -5144,7 +5144,7 @@  discard block
 block discarded – undo
5144 5144
 						$propMainmenu = !empty($menu['mainmenu']) ? $menu['mainmenu'] : GETPOST('mainmenu');
5145 5145
 						$propLeftmenu = !empty($menu['leftmenu']) ? $menu['leftmenu'] : GETPOST('leftmenu');
5146 5146
 						$propUrl = !empty($menu['url']) ? $menu['url'] : GETPOST('url', 'alpha');
5147
-						$propPerms = !empty($menu['perms']) ?  $menu['perms'] : GETPOST('perms');
5147
+						$propPerms = !empty($menu['perms']) ? $menu['perms'] : GETPOST('perms');
5148 5148
 						$propUser = !empty($menu['user']) ? $menu['user'] : GETPOST('user');
5149 5149
 						$propTarget = !empty($menu['target']) ? $menu['target'] : GETPOST('target');
5150 5150
 						$propEnabled = !empty($menu['enabled']) ? $menu['enabled'] : GETPOST('enabled');
@@ -5327,7 +5327,7 @@  discard block
 block discarded – undo
5327 5327
 							print '<td class="center minwidth75 tdstickyright tdstickyghostwhite">';
5328 5328
 							if ($menu['titre'] != 'Module'.$module.'Name') {
5329 5329
 									print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editmenu&token='.newToken().'&menukey='.urlencode($i).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_edit().'</a>';
5330
-									print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletemenu&token='.newToken().'&menukey='.urlencode($i-1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
5330
+									print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deletemenu&token='.newToken().'&menukey='.urlencode($i - 1).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
5331 5331
 							}
5332 5332
 							print '</td>';
5333 5333
 						}
@@ -5355,7 +5355,7 @@  discard block
 block discarded – undo
5355 5355
 						}
5356 5356
 					  });
5357 5357
 
5358
-					var groupedRights = ' . $groupedRights_json . ';
5358
+					var groupedRights = ' . $groupedRights_json.';
5359 5359
 					var objectsSelect = $("select[id=\'objects\']");
5360 5360
 					var permsSelect = $("select[id=\'perms\']");
5361 5361
 
@@ -5426,7 +5426,7 @@  discard block
 block discarded – undo
5426 5426
 			$dir = $dirread.'/'.$modulelowercase.'/class';
5427 5427
 			$listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$');
5428 5428
 			$objects = array('myobject');
5429
-			$reg =array();
5429
+			$reg = array();
5430 5430
 			foreach ($listofobject as $fileobj) {
5431 5431
 				$tmpcontent = file_get_contents($fileobj['fullname']);
5432 5432
 				if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg)) {
@@ -5578,7 +5578,7 @@  discard block
 block discarded – undo
5578 5578
 							if (in_array($perm[5], array('lire', 'read', 'creer', 'write', 'effacer', 'delete'))) {
5579 5579
 								print dol_escape_htmltag(ucfirst($perm[4]));
5580 5580
 							} else {
5581
-								print '';	// No particular object
5581
+								print ''; // No particular object
5582 5582
 							}
5583 5583
 							print '</td>';
5584 5584
 
@@ -6418,9 +6418,9 @@  discard block
 block discarded – undo
6418 6418
 
6419 6419
 						print '<td>';
6420 6420
 						if ($tabName[0] === "+") {
6421
-							print '<span class="badge badge-status4 badge-status">' . dol_escape_htmltag($tabName) . '</span>';
6421
+							print '<span class="badge badge-status4 badge-status">'.dol_escape_htmltag($tabName).'</span>';
6422 6422
 						} else {
6423
-							print '<span class="badge badge-status8 badge-status">' . dol_escape_htmltag($tabName) . '</span>';
6423
+							print '<span class="badge badge-status8 badge-status">'.dol_escape_htmltag($tabName).'</span>';
6424 6424
 						}
6425 6425
 						print '</td>';
6426 6426
 
Please login to merge, or discard this patch.
htdocs/modulebuilder/template/admin/setup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 // Parameters
72 72
 $action = GETPOST('action', 'aZ09');
73 73
 $backtopage = GETPOST('backtopage', 'alpha');
74
-$modulepart = GETPOST('modulepart', 'aZ09');	// Used by actions_setmoduleoptions.inc.php
74
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
75 75
 
76 76
 $value = GETPOST('value', 'alpha');
77 77
 $label = GETPOST('label', 'alpha');
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 // HTTP HOST
100 100
 $item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
101
-$item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
101
+$item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://').$_SERVER['HTTP_HOST'];
102 102
 $item->cssClass = 'minwidth500';
103 103
 
104 104
 // Setup conf MYMODULE_MYPARAM1 as a simple string input
Please login to merge, or discard this patch.