Passed
Branch develop (b13600)
by
unknown
108:30
created
htdocs/hrm/evaluation_agenda.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,9 @@
 block discarded – undo
100 100
 if (!isModEnabled('hrm')) {
101 101
 	accessforbidden();
102 102
 }
103
-if (!$permissiontoread) accessforbidden();
103
+if (!$permissiontoread) {
104
+	accessforbidden();
105
+}
104 106
 
105 107
 
106 108
 /*
Please login to merge, or discard this patch.
htdocs/bom/tpl/objectline_view.tpl.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 }
66 66
 
67 67
 // add html5 elements
68
-if ($filtertype == 1) $domData  = ' data-element="'.$line->element.'service"';
69
-else $domData  = ' data-element="'.$line->element.'"';
68
+if ($filtertype == 1) $domData = ' data-element="'.$line->element.'service"';
69
+else $domData = ' data-element="'.$line->element.'"';
70 70
 
71 71
 $domData .= ' data-id="'.$line->id.'"';
72 72
 $domData .= ' data-qty="'.$line->qty.'"';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 // Select of all the sub-BOM lines
231 231
 // From this pont to the end of the file, we only take care of sub-BOM lines
232 232
 $sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl';
233
-$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id;
233
+$sql .= ' WHERE fk_bom ='.(int) $tmpbom->id;
234 234
 $resql = $object->db->query($sql);
235 235
 
236 236
 if ($resql) {
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 		if (!empty($sub_bom->id)) {
301 301
 			$sub_bom->calculateCosts();
302 302
 			print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
303
-			$total_cost+= $sub_bom->total_cost * $sub_bom_line->qty * $line->qty;
303
+			$total_cost += $sub_bom->total_cost * $sub_bom_line->qty * $line->qty;
304 304
 		} elseif ($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) {
305 305
 			//Convert qty to hour
306 306
 			$unit = measuringUnitString($sub_bom_line->fk_unit, '', '', 1);
@@ -313,20 +313,20 @@  discard block
 block discarded – undo
313 313
 			$this->total_cost += $line->total_cost;
314 314
 		} elseif ($sub_bom_product->cost_price > 0) {
315 315
 			print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
316
-			$total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty;
316
+			$total_cost += $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty;
317 317
 		} elseif ($sub_bom_product->pmp > 0) {	// PMP if cost price isn't defined
318 318
 			print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
319
-			$total_cost.= $sub_bom_product->pmp * $sub_bom_line->qty * $line->qty;
319
+			$total_cost .= $sub_bom_product->pmp * $sub_bom_line->qty * $line->qty;
320 320
 		} else {	// Minimum purchase price if cost price and PMP aren't defined
321 321
 			$sql_supplier_price = 'SELECT MIN(price) AS min_price, quantity AS qty FROM '.MAIN_DB_PREFIX.'product_fournisseur_price';
322
-			$sql_supplier_price.= ' WHERE fk_product = '. (int) $sub_bom_product->id;
322
+			$sql_supplier_price .= ' WHERE fk_product = '.(int) $sub_bom_product->id;
323 323
 			$resql_supplier_price = $object->db->query($sql_supplier_price);
324 324
 			if ($resql_supplier_price) {
325 325
 				$obj = $object->db->fetch_object($resql_supplier_price);
326
-				$line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty * $line->qty;
326
+				$line_cost = $obj->min_price / $obj->qty * $sub_bom_line->qty * $line->qty;
327 327
 
328 328
 				print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price2num($line_cost, 'MT').'</span></td>';
329
-				$total_cost+= $line_cost;
329
+				$total_cost += $line_cost;
330 330
 			}
331 331
 		}
332 332
 
Please login to merge, or discard this patch.
Braces   +20 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 global $filtertype;
46
-if (empty($filtertype))	$filtertype = 0;
46
+if (empty($filtertype)) {
47
+	$filtertype = 0;
48
+}
47 49
 
48 50
 
49 51
 global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax, $langs;
@@ -65,8 +67,11 @@  discard block
 block discarded – undo
65 67
 }
66 68
 
67 69
 // add html5 elements
68
-if ($filtertype == 1) $domData  = ' data-element="'.$line->element.'service"';
69
-else $domData  = ' data-element="'.$line->element.'"';
70
+if ($filtertype == 1) {
71
+	$domData  = ' data-element="'.$line->element.'service"';
72
+} else {
73
+	$domData  = ' data-element="'.$line->element.'"';
74
+}
70 75
 
71 76
 $domData .= ' data-id="'.$line->id.'"';
72 77
 $domData .= ' data-qty="'.$line->qty.'"';
@@ -162,7 +167,9 @@  discard block
 block discarded – undo
162 167
 
163 168
 		print '<td class="linecolunit nowrap right">';
164 169
 		$coldisplay++;
165
-		if ($res > 0) echo $workstation->getNomUrl();
170
+		if ($res > 0) {
171
+			echo $workstation->getNomUrl();
172
+		}
166 173
 		print '</td>';
167 174
 	}
168 175
 }
@@ -271,7 +278,9 @@  discard block
 block discarded – undo
271 278
 			print '<td class="linecolqty nowrap right" id="sub_bom_qty_'.$sub_bom_line->id.'">'.price($sub_bom_line->qty, 0, '', 0, 0).'</td>';
272 279
 			if (!empty($conf->global->PRODUCT_USE_UNITS)) {
273 280
 				print '<td class="linecoluseunit nowrap left">';
274
-				if ($label !== '') print $langs->trans($label);
281
+				if ($label !== '') {
282
+					print $langs->trans($label);
283
+				}
275 284
 				print '</td>';
276 285
 			}
277 286
 			print '<td class="linecolqtyfrozen nowrap right" id="sub_bom_qty_frozen_'.$sub_bom_line->id.'">'.$langs->trans('Yes').'</td>';
@@ -279,7 +288,9 @@  discard block
 block discarded – undo
279 288
 			print '<td class="linecolqty nowrap right" id="sub_bom_qty_'.$sub_bom_line->id.'">'.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).'</td>';
280 289
 			if (!empty($conf->global->PRODUCT_USE_UNITS)) {
281 290
 				print '<td class="linecoluseunit nowrap left">';
282
-				if ($label !== '') print $langs->trans($label);
291
+				if ($label !== '') {
292
+					print $langs->trans($label);
293
+				}
283 294
 				print '</td>';
284 295
 			}
285 296
 
@@ -307,7 +318,9 @@  discard block
 block discarded – undo
307 318
 			$qty = convertDurationtoHour($sub_bom_line->qty, $unit);
308 319
 			$workstation = new Workstation($this->db);
309 320
 			$res = $workstation->fetch($sub_bom_product->fk_default_workstation);
310
-			if ($res > 0) $sub_bom_line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
321
+			if ($res > 0) {
322
+				$sub_bom_line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
323
+			}
311 324
 
312 325
 			print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom_line->total_cost, 'MT')).'</span></td>';
313 326
 			$this->total_cost += $line->total_cost;
Please login to merge, or discard this patch.
htdocs/compta/facture/card.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 // General $Variables
83 83
 $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
84 84
 
85
-$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int'));    // For backward compatibility
85
+$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
86 86
 $ref = GETPOST('ref', 'alpha');
87 87
 $socid = GETPOST('socid', 'int');
88 88
 $action = GETPOST('action', 'aZ09');
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
 			$error++;
1009 1009
 		}
1010 1010
 
1011
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
1011
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
1012 1012
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver');
1013 1013
 
1014 1014
 		// Replacement invoice
@@ -1037,7 +1037,7 @@  discard block
 block discarded – undo
1037 1037
 				$object->date = $dateinvoice;
1038 1038
 				$object->date_pointoftax = $date_pointoftax;
1039 1039
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1040
-				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1040
+				$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
1041 1041
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1042 1042
 				$object->model_pdf = GETPOST('model', 'alphanohtml');
1043 1043
 				$object->fk_project			= GETPOST('projectid', 'int');
@@ -1090,11 +1090,11 @@  discard block
 block discarded – undo
1090 1090
 				$object->date = $dateinvoice;
1091 1091
 				$object->date_pointoftax = $date_pointoftax;
1092 1092
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1093
-				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1093
+				$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
1094 1094
 				$object->ref_client			= GETPOST('ref_client');
1095 1095
 				$object->model_pdf = GETPOST('model');
1096 1096
 				$object->fk_project			= GETPOST('projectid', 'int');
1097
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1097
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1098 1098
 				$object->mode_reglement_id	= GETPOST('mode_reglement_id', 'int');
1099 1099
 				$object->fk_account = GETPOST('fk_account', 'int');
1100 1100
 				$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1386 1386
 				$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
1387 1387
 				$object->ref_client			= GETPOST('ref_client');
1388
-				$object->ref_customer		= GETPOST('ref_client');
1388
+				$object->ref_customer = GETPOST('ref_client');
1389 1389
 				$object->model_pdf = GETPOST('model');
1390 1390
 				$object->fk_project			= GETPOST('projectid', 'int');
1391 1391
 				$object->cond_reglement_id	= (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -1933,7 +1933,7 @@  discard block
 block discarded – undo
1933 1933
 				$object->fk_project = GETPOST('projectid', 'int');
1934 1934
 				$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
1935 1935
 				$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
1936
-				$object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2);
1936
+				$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
1937 1937
 				$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
1938 1938
 
1939 1939
 				// Proprietes particulieres a facture de remplacement
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
 
2016 2016
 		// Set if we used free entry or predefined product
2017 2017
 		$predef = '';
2018
-		$product_desc =(GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
2018
+		$product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
2019 2019
 
2020 2020
 		$price_ht = '';
2021 2021
 		$price_ht_devise = '';
@@ -2202,8 +2202,8 @@  discard block
 block discarded – undo
2202 2202
 				}
2203 2203
 
2204 2204
 				//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
2205
-				if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
2206
-					$product_desc='';
2205
+				if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
2206
+					$product_desc = '';
2207 2207
 				}
2208 2208
 
2209 2209
 				if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) {
@@ -2453,7 +2453,7 @@  discard block
 block discarded – undo
2453 2453
 		// Define special_code for special lines
2454 2454
 		$special_code = GETPOST('special_code', 'int');
2455 2455
 		if ($special_code == 3) {
2456
-			$special_code = 0;	// Options should not exists on invoices
2456
+			$special_code = 0; // Options should not exists on invoices
2457 2457
 		}
2458 2458
 
2459 2459
 		$line = new FactureLigne($db);
@@ -3067,7 +3067,7 @@  discard block
 block discarded – undo
3067 3067
 
3068 3068
 				if (isModEnabled('multicurrency')) {
3069 3069
 					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3070
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3070
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3071 3071
 				}
3072 3072
 
3073 3073
 				//Replicate extrafields
@@ -3119,7 +3119,7 @@  discard block
 block discarded – undo
3119 3119
 
3120 3120
 	// when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value
3121 3121
 	if ($socid > 0 && $fk_account) {	// A company has already been set and it has a default fk_account
3122
-		$fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account;	// The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company
3122
+		$fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account; // The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company
3123 3123
 	} else {	// No company forced
3124 3124
 		$fk_account = GETPOST("fk_account", 'int');
3125 3125
 	}
@@ -4177,14 +4177,14 @@  discard block
 block discarded – undo
4177 4177
 		$nbMandated = 0;
4178 4178
 		foreach ($object->lines as $line) {
4179 4179
 			$res = $line->fetch_product();
4180
-			if ($res  > 0  ) {
4181
-				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
4180
+			if ($res > 0) {
4181
+				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4182 4182
 					$nbMandated++;
4183 4183
 					break;
4184 4184
 				}
4185 4185
 			}
4186 4186
 		}
4187
-		if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
4187
+		if ($nbMandated > 0) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
4188 4188
 
4189 4189
 
4190 4190
 		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 2);
@@ -5271,7 +5271,7 @@  discard block
 block discarded – undo
5271 5271
 			print '</td>';
5272 5272
 			print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">';
5273 5273
 			//print (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code).' ';
5274
-			print price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td>&nbsp;</td></tr>';
5274
+			print price(price2num($object->multicurrency_tx * $resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td>&nbsp;</td></tr>';
5275 5275
 		}
5276 5276
 
5277 5277
 		// Retained warranty : usualy use on construction industry
@@ -5515,7 +5515,7 @@  discard block
 block discarded – undo
5515 5515
 					$langs->load("contracts");
5516 5516
 
5517 5517
 					if ($usercancreatecontract) {
5518
-						print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>';
5518
+						print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>';
5519 5519
 					}
5520 5520
 				}
5521 5521
 			}
Please login to merge, or discard this patch.
htdocs/compta/bank/class/account.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 * Address of the bank account
173 173
 	 * @var string
174 174
 	 */
175
-	public $domiciliation;		// deprecated, use now address
175
+	public $domiciliation; // deprecated, use now address
176 176
 	public $address;
177 177
 	public $state_id;
178 178
 	public $state_code;
@@ -454,13 +454,13 @@  discard block
 block discarded – undo
454 454
 		$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (";
455 455
 		$sql .= "fk_bank";
456 456
 		$sql .= ", url_id";
457
-		$sql .= ", url";		// deprecated
457
+		$sql .= ", url"; // deprecated
458 458
 		$sql .= ", label";
459 459
 		$sql .= ", type";
460 460
 		$sql .= ") VALUES (";
461 461
 		$sql .= " ".((int) $line_id);
462 462
 		$sql .= ", ".((int) $url_id);
463
-		$sql .= ", '".$this->db->escape($url)."'";		// dperecated
463
+		$sql .= ", '".$this->db->escape($url)."'"; // dperecated
464 464
 		$sql .= ", '".$this->db->escape($label)."'";
465 465
 		$sql .= ", '".$this->db->escape($type)."'";
466 466
 		$sql .= ")";
@@ -1437,9 +1437,9 @@  discard block
 block discarded – undo
1437 1437
 		}
1438 1438
 		// show categories for this record only in ajax to not overload lists
1439 1439
 		if (isModEnabled('categorie') && !$nofetch) {
1440
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1440
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1441 1441
 			$form = new Form($this->db);
1442
-			$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1);
1442
+			$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1);
1443 1443
 		}
1444 1444
 
1445 1445
 		return $datas;
@@ -1918,8 +1918,8 @@  discard block
 block discarded – undo
1918 1918
 	 */
1919 1919
 	public $datev;
1920 1920
 
1921
-	public $amount;					/* Amount of payment in the bank account currency */
1922
-	public $amount_main_currency;	/* Amount in the currency of company if bank account use another currency */
1921
+	public $amount; /* Amount of payment in the bank account currency */
1922
+	public $amount_main_currency; /* Amount in the currency of company if bank account use another currency */
1923 1923
 
1924 1924
 	/**
1925 1925
 	 * @var int ID
Please login to merge, or discard this patch.
htdocs/adherents/class/adherent.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
 		$sql .= ", login = ".($this->login ? "'".$this->db->escape($this->login)."'" : "null");
814 814
 		$sql .= ", societe = ".($this->company ? "'".$this->db->escape($this->company)."'" : ($this->societe ? "'".$this->db->escape($this->societe)."'" : "null"));
815 815
 		if ($this->socid) {
816
-			$sql .= ", fk_soc = ".($this->socid > 0 ? $this->db->escape($this->socid) : "null");	 // Must be modified only when creating from a third-party
816
+			$sql .= ", fk_soc = ".($this->socid > 0 ? $this->db->escape($this->socid) : "null"); // Must be modified only when creating from a third-party
817 817
 		}
818 818
 		$sql .= ", address = ".($this->address ? "'".$this->db->escape($this->address)."'" : "null");
819 819
 		$sql .= ", zip = ".($this->zip ? "'".$this->db->escape($this->zip)."'" : "null");
@@ -2321,9 +2321,9 @@  discard block
 block discarded – undo
2321 2321
 		$datas['address'] = '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs);
2322 2322
 		// show categories for this record only in ajax to not overload lists
2323 2323
 		if (isModEnabled('categorie') && !$nofetch) {
2324
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
2324
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
2325 2325
 			$form = new Form($this->db);
2326
-			$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_MEMBER, 1);
2326
+			$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_MEMBER, 1);
2327 2327
 		}
2328 2328
 		$datas['divclose'] = '</div>';
2329 2329
 
@@ -2453,7 +2453,7 @@  discard block
 block discarded – undo
2453 2453
 			}
2454 2454
 		}
2455 2455
 		global $action;
2456
-		$hookmanager->initHooks(array($this->element . 'dao'));
2456
+		$hookmanager->initHooks(array($this->element.'dao'));
2457 2457
 		$parameters = array('id'=>$this->id, 'getnomurl' => &$result);
2458 2458
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
2459 2459
 		if ($reshook > 0) {
@@ -3308,7 +3308,7 @@  discard block
 block discarded – undo
3308 3308
 		$return .= '<span class="info-box-icon bg-infobox-action">';
3309 3309
 
3310 3310
 		if (property_exists($this, 'photo') || !empty($this->photo)) {
3311
-			$return.= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1);
3311
+			$return .= Form::showphoto('memberphoto', $this, 0, 60, 0, 'photokanban photoref photowithmargin photologintooltip', 'small', 0, 1);
3312 3312
 		} else {
3313 3313
 			$return .= img_picto('', 'user');
3314 3314
 		}
Please login to merge, or discard this patch.
htdocs/ticket/class/ticket.class.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
 	const STATUS_READ = 1;
257 257
 	const STATUS_ASSIGNED = 2;
258 258
 	const STATUS_IN_PROGRESS = 3;
259
-	const STATUS_NEED_MORE_INFO = 5;	// waiting requester feedback
260
-	const STATUS_WAITING = 7;			// on hold
261
-	const STATUS_CLOSED = 8;			// Closed - Solved
262
-	const STATUS_CANCELED = 9;			// Closed - Not solved
259
+	const STATUS_NEED_MORE_INFO = 5; // waiting requester feedback
260
+	const STATUS_WAITING = 7; // on hold
261
+	const STATUS_CLOSED = 8; // Closed - Solved
262
+	const STATUS_CANCELED = 9; // Closed - Not solved
263 263
 
264 264
 
265 265
 	/**
@@ -1448,9 +1448,9 @@  discard block
 block discarded – undo
1448 1448
 		}
1449 1449
 		// show categories for this record only in ajax to not overload lists
1450 1450
 		if (isModEnabled('categorie') && !$nofetch) {
1451
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1451
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1452 1452
 			$form = new Form($this->db);
1453
-			$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_TICKET, 1);
1453
+			$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_TICKET, 1);
1454 1454
 		}
1455 1455
 
1456 1456
 		return $datas;
@@ -1680,7 +1680,7 @@  discard block
 block discarded – undo
1680 1680
 		// Insert entry into agenda with code 'TICKET_MSG'
1681 1681
 		include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
1682 1682
 		$actioncomm = new ActionComm($this->db);
1683
-		$actioncomm->type_code = 'AC_OTH_AUTO';	// This is not an entry that must appears into manual calendar but only into CRM calendar
1683
+		$actioncomm->type_code = 'AC_OTH_AUTO'; // This is not an entry that must appears into manual calendar but only into CRM calendar
1684 1684
 		$actioncomm->code = 'TICKET_MSG';
1685 1685
 		if ($this->private) {
1686 1686
 			$actioncomm->code = 'TICKET_MSG_PRIVATE';
@@ -2299,7 +2299,7 @@  discard block
 block discarded – undo
2299 2299
 			if (is_resource($handle)) {
2300 2300
 				while (($file = readdir($handle)) !== false) {
2301 2301
 					if (!utf8_check($file)) {
2302
-						$file = utf8_encode($file);	// To be sure data is stored in UTF8 in memory
2302
+						$file = utf8_encode($file); // To be sure data is stored in UTF8 in memory
2303 2303
 					}
2304 2304
 					if (dol_is_file($dir.$file)) {
2305 2305
 						return true;
@@ -2746,7 +2746,7 @@  discard block
 block discarded – undo
2746 2746
 									if ($result) {
2747 2747
 										// update last_msg_sent date (for last message sent to external users)
2748 2748
 										$this->date_last_msg_sent = dol_now();
2749
-										$this->update($user, 1);	// disable trigger when updating date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table.
2749
+										$this->update($user, 1); // disable trigger when updating date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table.
2750 2750
 									}
2751 2751
 								}
2752 2752
 							}
@@ -3000,7 +3000,7 @@  discard block
 block discarded – undo
3000 3000
 	 */
3001 3001
 	public function getKanbanView($option = '', $arraydata = null)
3002 3002
 	{
3003
-		global $langs, $selected,$arrayofselected,$obj;
3003
+		global $langs, $selected, $arrayofselected, $obj;
3004 3004
 		$return = '<div class="box-flex-item box-flex-grow-zero">';
3005 3005
 		$return .= '<div class="info-box info-box-sm">';
3006 3006
 		$return .= '<span class="info-box-icon bg-infobox-action">';
Please login to merge, or discard this patch.
htdocs/comm/action/class/actioncomm.class.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -377,9 +377,9 @@  discard block
 block discarded – undo
377 377
 	/**
378 378
 	 * Properties to manage the recurring events
379 379
 	 */
380
-	public $recurid;		/* A string YYYYMMDDHHMMSS shared by allevent of same serie */
381
-	public $recurrule;		/* Rule of recurring */
382
-	public $recurdateend;	/* Repeat until this date */
380
+	public $recurid; /* A string YYYYMMDDHHMMSS shared by allevent of same serie */
381
+	public $recurrule; /* Rule of recurring */
382
+	public $recurdateend; /* Repeat until this date */
383 383
 
384 384
 	public $calling_duration;
385 385
 
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 						$resql = $this->db->query($sql);
634 634
 						if (!$resql) {
635 635
 							$error++;
636
-							dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR);
636
+							dol_syslog('Error to process userassigned: '.$this->db->lasterror(), LOG_ERR);
637 637
 							$this->errors[] = $this->db->lasterror();
638 638
 						} else {
639 639
 							$already_inserted[$val['id']] = true;
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 						$resql = $this->db->query($sql);
659 659
 						if (!$resql) {
660 660
 							$error++;
661
-							dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR);
661
+							dol_syslog('Error to process socpeopleassigned: '.$this->db->lasterror(), LOG_ERR);
662 662
 							$this->errors[] = $this->db->lasterror();
663 663
 						} else {
664 664
 							$already_inserted[$id] = true;
@@ -895,14 +895,14 @@  discard block
 block discarded – undo
895 895
 				$this->status = $obj->status;
896 896
 
897 897
 				//email information
898
-				$this->email_msgid=$obj->email_msgid;
899
-				$this->email_from=$obj->email_from;
900
-				$this->email_sender=$obj->email_sender;
901
-				$this->email_to=$obj->email_to;
902
-				$this->email_tocc=$obj->email_tocc;
903
-				$this->email_tobcc=$obj->email_tobcc;
904
-				$this->email_subject=$obj->email_subject;
905
-				$this->errors_to=$obj->errors_to;
898
+				$this->email_msgid = $obj->email_msgid;
899
+				$this->email_from = $obj->email_from;
900
+				$this->email_sender = $obj->email_sender;
901
+				$this->email_to = $obj->email_to;
902
+				$this->email_tocc = $obj->email_tocc;
903
+				$this->email_tobcc = $obj->email_tobcc;
904
+				$this->email_subject = $obj->email_subject;
905
+				$this->errors_to = $obj->errors_to;
906 906
 
907 907
 				$this->fetch_optionals();
908 908
 
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 		$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm";
1185 1185
 		$sql .= " SET percent = '".$this->db->escape($this->percentage)."'";
1186 1186
 		$sql .= ", fk_action = ".(int) $this->type_id;
1187
-		$sql .= ", code = " . ($code ? "'".$this->db->escape($code)."'" : "null");
1187
+		$sql .= ", code = ".($code ? "'".$this->db->escape($code)."'" : "null");
1188 1188
 		$sql .= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "null");
1189 1189
 		$sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null');
1190 1190
 		$sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null');
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
 
1327 1327
 		dol_syslog(get_class()."::getActions", LOG_DEBUG);
1328 1328
 
1329
-		require_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
1329
+		require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
1330 1330
 		$hookmanager = new HookManager($this->db);
1331 1331
 		// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
1332 1332
 		$hookmanager->initHooks(array('agendadao'));
@@ -1335,8 +1335,8 @@  discard block
 block discarded – undo
1335 1335
 		$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
1336 1336
 		// Fields from hook
1337 1337
 		$parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype);
1338
-		$reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters);    // Note that $action and $object may have been modified by hook
1339
-		if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint;
1338
+		$reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook
1339
+		if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint;
1340 1340
 		$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
1341 1341
 		if (!empty($socid)) {
1342 1342
 			$sql .= " AND a.fk_soc = ".((int) $socid);
@@ -1357,8 +1357,8 @@  discard block
 block discarded – undo
1357 1357
 		}
1358 1358
 		// Fields where hook
1359 1359
 		$parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype);
1360
-		$reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters);    // Note that $action and $object may have been modified by hook
1361
-		if (!empty($hookmanager->resPrint)) $sql.= $hookmanager->resPrint;
1360
+		$reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook
1361
+		if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint;
1362 1362
 		if ($sortorder && $sortfield) {
1363 1363
 			$sql .= $this->db->order($sortfield, $sortorder);
1364 1364
 		}
@@ -1634,9 +1634,9 @@  discard block
 block discarded – undo
1634 1634
 		}
1635 1635
 		// show categories for this record only in ajax to not overload lists
1636 1636
 		if (isModEnabled('categorie') && !$nofetch) {
1637
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
1637
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
1638 1638
 			$form = new Form($this->db);
1639
-			$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1);
1639
+			$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1);
1640 1640
 		}
1641 1641
 
1642 1642
 		return $datas;
@@ -1728,8 +1728,8 @@  discard block
 block discarded – undo
1728 1728
 		}
1729 1729
 		if (!empty($this->note_private)) {
1730 1730
 			$tooltip .= '<br><br><b>'.$langs->trans('Description').':</b><br>';
1731
-			$texttoshow = dolGetFirstLineOfText($this->note_private, 10);	// Try to limit length of content
1732
-			$tooltip .= '<div class="tenlinesmax">';						// Restrict height of content into the tooltip
1731
+			$texttoshow = dolGetFirstLineOfText($this->note_private, 10); // Try to limit length of content
1732
+			$tooltip .= '<div class="tenlinesmax">'; // Restrict height of content into the tooltip
1733 1733
 			$tooltip .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '<br>', $texttoshow));
1734 1734
 			$tooltip .= '</div>';
1735 1735
 		}
@@ -2374,7 +2374,7 @@  discard block
 block discarded – undo
2374 2374
 	 */
2375 2375
 	public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id)
2376 2376
 	{
2377
-		$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'actioncomm SET fk_element = ' . ((int) $dest_id) . ' WHERE elementtype="product" AND fk_element = '.((int) $origin_id);
2377
+		$sql = 'UPDATE '.MAIN_DB_PREFIX.'actioncomm SET fk_element = '.((int) $dest_id).' WHERE elementtype="product" AND fk_element = '.((int) $origin_id);
2378 2378
 		// using $dbs, not $this->db because function is static
2379 2379
 		if (!$dbs->query($sql)) {
2380 2380
 			//$this->errors = $dbs->lasterror();
Please login to merge, or discard this patch.