Completed
Branch develop (c87f24)
by
unknown
13:17
created
htdocs/reception/list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 $search_date_delivery_endday = GETPOSTINT('search_date_delivery_endday');
66 66
 $search_date_delivery_endmonth = GETPOSTINT('search_date_delivery_endmonth');
67 67
 $search_date_delivery_endyear = GETPOSTINT('search_date_delivery_endyear');
68
-$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);	// Use tzserver
68
+$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); // Use tzserver
69 69
 $search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
70 70
 $search_date_create_startday = GETPOSTINT('search_date_create_startday');
71 71
 $search_date_create_startmonth = GETPOSTINT('search_date_create_startmonth');
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 $search_date_create_endday = GETPOSTINT('search_date_create_endday');
74 74
 $search_date_create_endmonth = GETPOSTINT('search_date_create_endmonth');
75 75
 $search_date_create_endyear = GETPOSTINT('search_date_create_endyear');
76
-$search_date_create_start = dol_mktime(0, 0, 0, $search_date_create_startmonth, $search_date_create_startday, $search_date_create_startyear);	// Use tzserver
76
+$search_date_create_start = dol_mktime(0, 0, 0, $search_date_create_startmonth, $search_date_create_startday, $search_date_create_startyear); // Use tzserver
77 77
 $search_date_create_end = dol_mktime(23, 59, 59, $search_date_create_endmonth, $search_date_create_endday, $search_date_create_endyear);
78 78
 $search_billed = GETPOST("search_billed", 'intcomma');
79 79
 $search_status = GETPOST('search_status', 'intcomma');
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 $object->fields = dol_sort_array($object->fields, 'position');
142 142
 $arrayfields = dol_sort_array($arrayfields, 'position');
143
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
143
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
144 144
 
145 145
 $error = 0;
146 146
 
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 				// if the VAT reverse-charge is activated by default in supplier card to resume the information
332 332
 				$objecttmp->vat_reverse_charge = $soc->vat_reverse_charge;
333 333
 
334
-				$objecttmp->fk_project			= $rcp->fk_project;
334
+				$objecttmp->fk_project = $rcp->fk_project;
335 335
 				//$objecttmp->multicurrency_code = $rcp->multicurrency_code;
336 336
 				if (empty($createbills_onebythird)) {
337 337
 					$objecttmp->ref_supplier = $rcp->ref;
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 					}
365 365
 				}
366 366
 
367
-				$res = $objecttmp->create($user);		// This should create the supplier invoice + links into $objecttmp->linked_objects + add a link to ->origin_id
367
+				$res = $objecttmp->create($user); // This should create the supplier invoice + links into $objecttmp->linked_objects + add a link to ->origin_id
368 368
 
369 369
 				//var_dump($objecttmp->error);exit;
370 370
 				if ($res > 0) {
@@ -571,8 +571,8 @@  discard block
 block discarded – undo
571 571
 			$db->rollback();
572 572
 
573 573
 			$action = 'create';
574
-			$_GET["origin"] = $_POST["origin"];		// Keep this ?
575
-			$_GET["originid"] = $_POST["originid"];	// Keep this ?
574
+			$_GET["origin"] = $_POST["origin"]; // Keep this ?
575
+			$_GET["originid"] = $_POST["originid"]; // Keep this ?
576 576
 			setEventMessages($object->error, $errors, 'errors');
577 577
 			$error++;
578 578
 		}
Please login to merge, or discard this patch.
htdocs/product/fournisseurs.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 
67 67
 // If socid provided by ajax company selector
68 68
 if (GETPOSTINT('search_fourn_id')) {
69
-	$_GET['id_fourn'] = GETPOSTINT('search_fourn_id');	// Keep set to $_GET an $_POST. Used later.
70
-	$_POST['id_fourn'] = GETPOSTINT('search_fourn_id');	// Keep set to $_GET an $_POST. Used later.
69
+	$_GET['id_fourn'] = GETPOSTINT('search_fourn_id'); // Keep set to $_GET an $_POST. Used later.
70
+	$_POST['id_fourn'] = GETPOSTINT('search_fourn_id'); // Keep set to $_GET an $_POST. Used later.
71 71
 }
72 72
 
73 73
 // Security check
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 							// Show field if not hidden
970 970
 							if (!empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
971 971
 								$extratitle = $langs->trans($value);
972
-								$arrayfields['ef.' . $key] = array('label'    => $extratitle, 'checked' => 0,
972
+								$arrayfields['ef.'.$key] = array('label'    => $extratitle, 'checked' => 0,
973 973
 																   'position' => (end($arrayfields)['position'] + 1),
974 974
 																   'langfile' => $extrafields->attributes["product_fournisseur_price"]['langfile'][$key],
975 975
 																   'help'     => $extrafields->attributes["product_fournisseur_price"]['help'][$key]);
@@ -1090,8 +1090,8 @@  discard block
 block discarded – undo
1090 1090
 								} else {
1091 1091
 									$extratitle = $langs->trans($value);
1092 1092
 								}
1093
-								if (!empty($arrayfields['ef.' . $key]['checked'])) {
1094
-									print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.' . $key, '', $param, '', $sortfield, $sortorder, 'right ');
1093
+								if (!empty($arrayfields['ef.'.$key]['checked'])) {
1094
+									print_liste_field_titre($extratitle, $_SERVER["PHP_SELF"], 'ef.'.$key, '', $param, '', $sortfield, $sortorder, 'right ');
1095 1095
 									$nbfields++;
1096 1096
 								}
1097 1097
 							}
Please login to merge, or discard this patch.
htdocs/product/inventory/inventory.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 				$line = $db->fetch_object($resql);
164 164
 
165 165
 				$qty_stock = $line->qty_stock;
166
-				$qty_view = $line->qty_view;		// The quantity viewed by inventorier, the qty we target
166
+				$qty_view = $line->qty_view; // The quantity viewed by inventorier, the qty we target
167 167
 
168 168
 
169 169
 				// Load real stock we have now.
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 						}
221 221
 						$sqlupdate .= " WHERE rowid = ".((int) $line->rowid);
222 222
 						$resqlupdate = $db->query($sqlupdate);
223
-						if (! $resqlupdate) {
223
+						if (!$resqlupdate) {
224 224
 							$error++;
225 225
 							setEventMessages($db->lasterror(), null, 'errors');
226 226
 							break;
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 					if (!empty($line->pmp_real) && getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) {
231 231
 						$sqlpmp = 'UPDATE '.MAIN_DB_PREFIX.'product SET pmp = '.((float) $line->pmp_real).' WHERE rowid = '.((int) $line->fk_product);
232 232
 						$resqlpmp = $db->query($sqlpmp);
233
-						if (! $resqlpmp) {
233
+						if (!$resqlpmp) {
234 234
 							$error++;
235 235
 							setEventMessages($db->lasterror(), null, 'errors');
236 236
 							break;
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 						if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
239 239
 							$sqlpmp = 'UPDATE '.MAIN_DB_PREFIX.'product_perentity SET pmp = '.((float) $line->pmp_real).' WHERE fk_product = '.((int) $line->fk_product).' AND entity='.$conf->entity;
240 240
 							$resqlpmp = $db->query($sqlpmp);
241
-							if (! $resqlpmp) {
241
+							if (!$resqlpmp) {
242 242
 								$error++;
243 243
 								setEventMessages($db->lasterror(), null, 'errors');
244 244
 								break;
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 			$error++;
258 258
 		}
259 259
 
260
-		if (! $error) {
260
+		if (!$error) {
261 261
 			$db->commit();
262 262
 		} else {
263 263
 			$db->rollback();
@@ -297,17 +297,17 @@  discard block
 block discarded – undo
297 297
 						setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors');
298 298
 					}
299 299
 					if ($result > 0) {
300
-						$inventoryline->qty_stock = price2num(GETPOST('stock_qty_'.$lineid, 'alpha'), 'MS');	// The new value that was set in as hidden field
301
-						$inventoryline->qty_view = $qtytoupdate;	// The new value we want
300
+						$inventoryline->qty_stock = price2num(GETPOST('stock_qty_'.$lineid, 'alpha'), 'MS'); // The new value that was set in as hidden field
301
+						$inventoryline->qty_view = $qtytoupdate; // The new value we want
302 302
 						$inventoryline->pmp_real = price2num(GETPOST('realpmp_'.$lineid, 'alpha'), 'MS');
303 303
 						$inventoryline->pmp_expected = price2num(GETPOST('expectedpmp_'.$lineid, 'alpha'), 'MS');
304 304
 						$resultupdate = $inventoryline->update($user);
305 305
 					}
306
-				} elseif (GETPOSTISSET('id_' . $lineid)) {
306
+				} elseif (GETPOSTISSET('id_'.$lineid)) {
307 307
 					// Delete record
308 308
 					$result = $inventoryline->fetch($lineid);
309 309
 					if ($result > 0) {
310
-						$inventoryline->qty_view = null;			// The new value we want
310
+						$inventoryline->qty_view = null; // The new value we want
311 311
 						$inventoryline->pmp_real = price2num(GETPOST('realpmp_'.$lineid, 'alpha'), 'MS');
312 312
 						$inventoryline->pmp_expected = price2num(GETPOST('expectedpmp_'.$lineid, 'alpha'), 'MS');
313 313
 						$resultupdate = $inventoryline->update($user);
@@ -323,12 +323,12 @@  discard block
 block discarded – undo
323 323
 		}
324 324
 
325 325
 		// Update line with id of stock movement (and the start quantity if it has changed this last recording)
326
-		if (! $error) {
326
+		if (!$error) {
327 327
 			$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."inventory";
328 328
 			$sqlupdate .= " SET fk_user_modif = ".((int) $user->id);
329 329
 			$sqlupdate .= " WHERE rowid = ".((int) $object->id);
330 330
 			$resqlupdate = $db->query($sqlupdate);
331
-			if (! $resqlupdate) {
331
+			if (!$resqlupdate) {
332 332
 				$error++;
333 333
 				setEventMessages($db->lasterror(), null, 'errors');
334 334
 			}
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 				}
413 413
 			} else {
414 414
 				// Clear var
415
-				$_POST['batch'] = '';		// TODO Replace this with a var
415
+				$_POST['batch'] = ''; // TODO Replace this with a var
416 416
 				$_POST['qtytoadd'] = '';
417 417
 			}
418 418
 		}
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
 	$num = $db->num_rows($resql);
1017 1017
 
1018 1018
 	if (!empty($limit != 0) || $num > $limit || $page) {
1019
-		print_fleche_navigation($page, $_SERVER["PHP_SELF"], '&id='.$object->id.$paramwithsearch, ($num >= $limit), '<li class="pagination"><span>' . $langs->trans("Page") . ' ' . ($page + 1) . '</span></li>', '', $limit);
1019
+		print_fleche_navigation($page, $_SERVER["PHP_SELF"], '&id='.$object->id.$paramwithsearch, ($num >= $limit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>', '', $limit);
1020 1020
 	}
1021 1021
 
1022 1022
 	$i = 0;
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
 				print '</td>';
1169 1169
 
1170 1170
 				print '<td class="right nowraponall">';
1171
-				print $obj->qty_view;	// qty found
1171
+				print $obj->qty_view; // qty found
1172 1172
 				print '</td>';
1173 1173
 
1174 1174
 				//PMP Real
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
 				$totalRealValuation += $pmp_valuation_real;
1191 1191
 			} else {
1192 1192
 				print '<td class="right nowraponall">';
1193
-				print $obj->qty_view;	// qty found
1193
+				print $obj->qty_view; // qty found
1194 1194
 				print '</td>';
1195 1195
 			}
1196 1196
 			print '<td>';
Please login to merge, or discard this patch.
htdocs/commande/list.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	'typent.code' => array('label' => "ThirdPartyType", 'checked' => $checkedtypetiers, 'position' => 55),
185 185
 	'c.date_commande' => array('label' => "OrderDateShort", 'checked' => 1, 'position' => 60, 'csslist' => 'nowraponall'),
186 186
 	'c.date_delivery' => array('label' => "DateDeliveryPlanned", 'checked' => 1, 'enabled' => !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65, 'csslist' => 'nowraponall'),
187
-	'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66 , 'enabled' => isModEnabled("shipping")),
187
+	'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => -1, 'position' => 66, 'enabled' => isModEnabled("shipping")),
188 188
 	'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => -1, 'position' => 67),
189 189
 	'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => -1, 'position' => 68),
190 190
 	'c.fk_input_reason' => array('label' => "Channel", 'checked' => -1, 'position' => 69),
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	'c.date_cloture' => array('label' => "DateClosing", 'checked' => 0, 'position' => 130),
208 208
 	'c.note_public' => array('label' => 'NotePublic', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 135, 'searchall' => 1),
209 209
 	'c.note_private' => array('label' => 'NotePrivate', 'checked' => 0, 'enabled' => (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 140),
210
-	'shippable' => array('label' => "Shippable", 'checked' => 1,'enabled' => (isModEnabled("shipping")), 'position' => 990),
210
+	'shippable' => array('label' => "Shippable", 'checked' => 1, 'enabled' => (isModEnabled("shipping")), 'position' => 990),
211 211
 	'c.facture' => array('label' => "Billed", 'checked' => 1, 'enabled' => (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995),
212 212
 	'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 999),
213 213
 	'c.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 1000)
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 $object->fields = dol_sort_array($object->fields, 'position');
228 228
 //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
229 229
 $arrayfields = dol_sort_array($arrayfields, 'position');
230
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
230
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
231 231
 
232 232
 
233 233
 // Security check
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 			$db->rollback();
683 683
 
684 684
 			$action = 'create';
685
-			$_GET["origin"] = $_POST["origin"];		// Keep GET and POST here ?
685
+			$_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ?
686 686
 			$_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ?
687 687
 			if (!empty($errors)) {
688 688
 				setEventMessages(null, $errors, 'errors');
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
 			if ($searchCategoryCustomerOperator == 0) {
1043 1043
 				$searchCategoryCustomerSqlList[] = " EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = ".((int) $searchCategoryCustomer).")";
1044 1044
 			} else {
1045
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
1045
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer);
1046 1046
 			}
1047 1047
 		}
1048 1048
 	}
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
 			if ($searchCategoryProductOperator == 0) {
1073 1073
 				$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
1074 1074
 			} else {
1075
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
1075
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct);
1076 1076
 			}
1077 1077
 		}
1078 1078
 	}
@@ -2639,13 +2639,13 @@  discard block
 block discarded – undo
2639 2639
 			print '<td class="center">';
2640 2640
 			if (!empty($show_shippable_command) && isModEnabled('stock')) {
2641 2641
 				if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
2642
-					$generic_commande->getLinesArray(); 	// Load array ->lines
2643
-					$generic_commande->loadExpeditions();	// Load array ->expeditions
2642
+					$generic_commande->getLinesArray(); // Load array ->lines
2643
+					$generic_commande->loadExpeditions(); // Load array ->expeditions
2644 2644
 
2645 2645
 					$numlines = count($generic_commande->lines); // Loop on each line of order
2646 2646
 					for ($lig = 0; $lig < $numlines; $lig++) {
2647 2647
 						if (isset($generic_commande->expeditions[$generic_commande->lines[$lig]->id])) {
2648
-							$reliquat =  $generic_commande->lines[$lig]->qty - $generic_commande->expeditions[$generic_commande->lines[$lig]->id];
2648
+							$reliquat = $generic_commande->lines[$lig]->qty - $generic_commande->expeditions[$generic_commande->lines[$lig]->id];
2649 2649
 						} else {
2650 2650
 							$reliquat = $generic_commande->lines[$lig]->qty;
2651 2651
 						}
Please login to merge, or discard this patch.
htdocs/user/class/user.class.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -599,11 +599,11 @@  discard block
 block discarded – undo
599 599
 				$this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array());
600 600
 				$this->job = $obj->job;
601 601
 				$this->signature = $obj->signature;
602
-				$this->admin		= $obj->admin;
602
+				$this->admin = $obj->admin;
603 603
 				$this->note_public = $obj->note_public;
604 604
 				$this->note_private = $obj->note_private;
605 605
 
606
-				$this->statut		= $obj->status;			// deprecated
606
+				$this->statut		= $obj->status; // deprecated
607 607
 				$this->status		= $obj->status;
608 608
 
609 609
 				$this->photo		= $obj->photo;
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 			require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php';
733 733
 
734 734
 			$defaultValues = new DefaultValues($this->db);
735
-			$result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')');	// User 0 (all) + me (if defined)
735
+			$result = $defaultValues->fetchAll('', '', 0, 0, '(t.user_id:in:0,'.$this->id.') AND (entity:in:'.(isset($this->entity) ? $this->entity : $conf->entity).','.$conf->entity.')'); // User 0 (all) + me (if defined)
736 736
 			//$result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array((isset($this->entity) ? $this->entity : $conf->entity), $conf->entity)));	// User 0 (all) + me (if defined)
737 737
 
738 738
 			if (!is_array($result) && $result < 0) {
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 		// Special case for external user
847 847
 		if (!empty($this->socid)) {
848 848
 			if ($module = 'societe' && $permlevel1 = 'client' && $permlevel2 == 'voir') {
849
-				return 0;	// An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
849
+				return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
850 850
 			}
851 851
 		}
852 852
 
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
995 995
 			$sql .= " WHERE entity = ".((int) $entity);
996 996
 			if (!empty($whereforadd) && $whereforadd != 'allmodules') {
997
-				$sql .= " AND (".$whereforadd.")";	// Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
997
+				$sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
998 998
 			}
999 999
 
1000 1000
 			$sqldelete = "DELETE FROM ".$this->db->prefix()."user_rights";
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
1131 1131
 			$sql .= " WHERE entity = ".((int) $entity);
1132 1132
 			if (!empty($wherefordel) && $wherefordel != 'allmodules') {
1133
-				$sql .= " AND (".$wherefordel.")";	// Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1133
+				$sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1134 1134
 			}
1135 1135
 
1136 1136
 			// avoid admin can remove his own important rights
@@ -1304,12 +1304,12 @@  discard block
 block discarded – undo
1304 1304
 					$sql .= " AND r.entity = ".((int) $conf->entity);
1305 1305
 				}
1306 1306
 			} else {
1307
-				$sql .= " AND gr.entity = ".((int) $conf->entity);	// Only groups created in current entity
1307
+				$sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity
1308 1308
 				// The entity on the table usergroup_user should be useless and should never be used because it is already into gr and r.
1309 1309
 				// but when using MULTICOMPANY_TRANSVERSE_MODE, we may insert record that make rubbish result due to duplicate record of
1310 1310
 				// other entities, so we are forced to add a filter here
1311 1311
 				$sql .= " AND gu.entity IN (0,".$conf->entity.")";
1312
-				$sql .= " AND r.entity = ".((int) $conf->entity);	// Only permission of modules enabled in current entity
1312
+				$sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity
1313 1313
 			}
1314 1314
 			// End of strange business rule
1315 1315
 			$sql .= " AND gr.fk_usergroup = gu.fk_usergroup";
@@ -1843,7 +1843,7 @@  discard block
 block discarded – undo
1843 1843
 		$this->civility_code = $member->civility_id;
1844 1844
 		$this->lastname     = $member->lastname;
1845 1845
 		$this->firstname    = $member->firstname;
1846
-		$this->gender		= $member->gender;
1846
+		$this->gender = $member->gender;
1847 1847
 		$this->email        = $member->email;
1848 1848
 		$this->fk_member    = $member->id;
1849 1849
 		$this->address      = $member->address;
@@ -1981,44 +1981,44 @@  discard block
 block discarded – undo
1981 1981
 		$this->lastname						= trim((string) $this->lastname);
1982 1982
 		$this->firstname					= trim((string) $this->firstname);
1983 1983
 		$this->ref_employee					= trim((string) $this->ref_employee);
1984
-		$this->national_registration_number	= trim((string) $this->national_registration_number);
1984
+		$this->national_registration_number = trim((string) $this->national_registration_number);
1985 1985
 		$this->employee						= ($this->employee > 0 ? $this->employee : 0);
1986 1986
 		$this->login						= trim((string) $this->login);
1987
-		$this->gender						= trim((string) $this->gender);
1987
+		$this->gender = trim((string) $this->gender);
1988 1988
 
1989 1989
 		$this->pass							= trim((string) $this->pass);
1990
-		$this->api_key						= trim((string) $this->api_key);
1991
-		$this->datestartvalidity			= empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
1992
-		$this->dateendvalidity				= empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
1990
+		$this->api_key = trim((string) $this->api_key);
1991
+		$this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
1992
+		$this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
1993 1993
 
1994
-		$this->address						= trim((string) $this->address);
1995
-		$this->zip							= trim((string) $this->zip);
1996
-		$this->town							= trim((string) $this->town);
1994
+		$this->address = trim((string) $this->address);
1995
+		$this->zip = trim((string) $this->zip);
1996
+		$this->town = trim((string) $this->town);
1997 1997
 
1998
-		$this->state_id						= ($this->state_id > 0 ? $this->state_id : 0);
1998
+		$this->state_id = ($this->state_id > 0 ? $this->state_id : 0);
1999 1999
 		$this->country_id					= ($this->country_id > 0 ? $this->country_id : 0);
2000
-		$this->office_phone					= trim((string) $this->office_phone);
2000
+		$this->office_phone = trim((string) $this->office_phone);
2001 2001
 		$this->office_fax					= trim((string) $this->office_fax);
2002
-		$this->user_mobile					= trim((string) $this->user_mobile);
2003
-		$this->personal_mobile				= trim((string) $this->personal_mobile);
2004
-		$this->email						= trim((string) $this->email);
2005
-		$this->personal_email				= trim((string) $this->personal_email);
2006
-
2007
-		$this->job							= trim((string) $this->job);
2008
-		$this->signature					= trim((string) $this->signature);
2009
-		$this->note_public					= trim((string) $this->note_public);
2010
-		$this->note_private					= trim((string) $this->note_private);
2011
-		$this->openid						= trim((string) $this->openid);
2002
+		$this->user_mobile = trim((string) $this->user_mobile);
2003
+		$this->personal_mobile = trim((string) $this->personal_mobile);
2004
+		$this->email = trim((string) $this->email);
2005
+		$this->personal_email = trim((string) $this->personal_email);
2006
+
2007
+		$this->job = trim((string) $this->job);
2008
+		$this->signature = trim((string) $this->signature);
2009
+		$this->note_public = trim((string) $this->note_public);
2010
+		$this->note_private = trim((string) $this->note_private);
2011
+		$this->openid = trim((string) $this->openid);
2012 2012
 		$this->admin						= ($this->admin > 0 ? $this->admin : 0);
2013 2013
 
2014 2014
 		$this->accountancy_code				= trim((string) $this->accountancy_code);
2015 2015
 		$this->color						= trim((string) $this->color);
2016
-		$this->dateemployment				= empty($this->dateemployment) ? '' : $this->dateemployment;
2016
+		$this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment;
2017 2017
 		$this->dateemploymentend			= empty($this->dateemploymentend) ? '' : $this->dateemploymentend;
2018 2018
 
2019
-		$this->birth						= empty($this->birth) ? '' : $this->birth;
2020
-		$this->fk_warehouse					= (int) $this->fk_warehouse;
2021
-		$this->fk_establishment				= (int) $this->fk_establishment;
2019
+		$this->birth = empty($this->birth) ? '' : $this->birth;
2020
+		$this->fk_warehouse = (int) $this->fk_warehouse;
2021
+		$this->fk_establishment = (int) $this->fk_establishment;
2022 2022
 
2023 2023
 		$this->setUpperOrLowerCase();
2024 2024
 
@@ -2773,7 +2773,7 @@  discard block
 block discarded – undo
2773 2773
 		$sql .= " WHERE fk_user  = ".((int) $this->id);
2774 2774
 		$sql .= " AND fk_usergroup = ".((int) $group);
2775 2775
 		if (empty($entity)) {
2776
-			$sql .= " AND entity IN (0, 1)";	// group may be in entity 0 (so $entity=0) and link with user into entity 1.
2776
+			$sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1.
2777 2777
 		} else {
2778 2778
 			$sql .= " AND entity = ".((int) $entity);
2779 2779
 		}
@@ -3035,7 +3035,7 @@  discard block
 block discarded – undo
3035 3035
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
3036 3036
 			}
3037 3037
 			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
3038
-			$linkclose .= $dataparams . ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3038
+			$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3039 3039
 		} else {
3040 3040
 			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
3041 3041
 		}
@@ -3115,7 +3115,7 @@  discard block
 block discarded – undo
3115 3115
 
3116 3116
 		if ($option == 'xxx') {
3117 3117
 			$linkstart = '<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$this->id.'">';
3118
-			$linkend = '</a>';  // @phan-suppress-current-line PhanPluginRedundantAssignment
3118
+			$linkend = '</a>'; // @phan-suppress-current-line PhanPluginRedundantAssignment
3119 3119
 		}
3120 3120
 
3121 3121
 		if ($option == 'nolink') {
@@ -3274,11 +3274,11 @@  discard block
 block discarded – undo
3274 3274
 		global $conf;
3275 3275
 		$dn = '';
3276 3276
 		if ($mode == 0) {
3277
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]."," . getDolGlobalString('LDAP_USER_DN');
3277
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')].",".getDolGlobalString('LDAP_USER_DN');
3278 3278
 		} elseif ($mode == 1) {
3279 3279
 			$dn = getDolGlobalString('LDAP_USER_DN');
3280 3280
 		} elseif ($mode == 2) {
3281
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3281
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3282 3282
 		}
3283 3283
 		return $dn;
3284 3284
 	}
@@ -3491,7 +3491,7 @@  discard block
 block discarded – undo
3491 3491
 		$this->iplastlogin = '127.0.0.1';
3492 3492
 		$this->datepreviouslogin = $now;
3493 3493
 		$this->ippreviouslogin = '127.0.0.1';
3494
-		$this->statut = 1;		// deprecated
3494
+		$this->statut = 1; // deprecated
3495 3495
 		$this->status = 1;
3496 3496
 
3497 3497
 		$this->entity = 1;
Please login to merge, or discard this patch.
htdocs/index.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
33 33
 
34 34
 // If not defined, we select menu "home"
35
-$_GET['mainmenu'] = GETPOST('mainmenu', 'aZ09') ? GETPOST('mainmenu', 'aZ09') : 'home';	// Keep this ?
35
+$_GET['mainmenu'] = GETPOST('mainmenu', 'aZ09') ? GETPOST('mainmenu', 'aZ09') : 'home'; // Keep this ?
36 36
 $action = GETPOST('action', 'aZ09');
37 37
 
38 38
 $hookmanager->initHooks(array('index'));
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 // Title
82 82
 $title = $langs->trans("HomeArea").' - Dolibarr '.DOL_VERSION;
83 83
 if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
84
-	$title = $langs->trans("HomeArea").' - ' . getDolGlobalString('MAIN_APPLICATION_TITLE');
84
+	$title = $langs->trans("HomeArea").' - '.getDolGlobalString('MAIN_APPLICATION_TITLE');
85 85
 }
86 86
 
87 87
 llxHeader('', $title);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	}
197 197
 
198 198
 	// Number of supplier proposals open (expired)
199
-	if (isModEnabled('supplier_proposal')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('supplier_proposal', 'lire')) {
199
+	if (isModEnabled('supplier_proposal') && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('supplier_proposal', 'lire')) {
200 200
 		$langs->load("supplier_proposal");
201 201
 		include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
202 202
 		$board = new SupplierProposal($db);
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	}
207 207
 
208 208
 	// Number of sales orders
209
-	if (isModEnabled('order')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('commande', 'lire')) {
209
+	if (isModEnabled('order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('commande', 'lire')) {
210 210
 		include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
211 211
 		$board = new Commande($db);
212 212
 		// Number of customer orders to be shipped (validated and in progress)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 	}
221 221
 
222 222
 	// Number of suppliers orders
223
-	if (isModEnabled('supplier_order')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('fournisseur', 'commande', 'lire')) {
223
+	if (isModEnabled('supplier_order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_SUPPLIER') && $user->hasRight('fournisseur', 'commande', 'lire')) {
224 224
 		include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
225 225
 		$board = new CommandeFournisseur($db);
226 226
 		$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	}
229 229
 
230 230
 	// Number of contract / services enabled (delayed)
231
-	if (isModEnabled('contract')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_CONTRACT') && $user->hasRight('contrat', 'lire')) {
231
+	if (isModEnabled('contract') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CONTRACT') && $user->hasRight('contrat', 'lire')) {
232 232
 		include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
233 233
 		$board = new Contrat($db);
234 234
 		$dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive");
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	}
238 238
 
239 239
 	// Number of tickets open
240
-	if (isModEnabled('ticket')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_TICKET') && $user->hasRight('ticket', 'read')) {
240
+	if (isModEnabled('ticket') && !getDolGlobalString('MAIN_DISABLE_BLOCK_TICKET') && $user->hasRight('ticket', 'read')) {
241 241
 		include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
242 242
 		$board = new Ticket($db);
243 243
 		$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
 	}
261 261
 
262 262
 	// Number of transactions to conciliate
263
-	if (isModEnabled('bank')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) {
263
+	if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) {
264 264
 		include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
265 265
 		$board = new Account($db);
266 266
 		$nb = $board->countAccountToReconcile(); // Get nb of account to reconciliate
@@ -271,26 +271,26 @@  discard block
 block discarded – undo
271 271
 
272 272
 
273 273
 	// Number of cheque to send
274
-	if (isModEnabled('bank')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) {
274
+	if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) {
275 275
 		if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT')) {
276
-			include_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php';
276
+			include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
277 277
 			$board = new RemiseCheque($db);
278 278
 			$dashboardlines[$board->element] = $board->load_board($user);
279 279
 		}
280 280
 		if (isModEnabled('prelevement')) {
281 281
 			include_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
282 282
 			$board = new BonPrelevement($db);
283
-			$dashboardlines[$board->element . '_direct_debit'] = $board->load_board($user, 'direct_debit');
283
+			$dashboardlines[$board->element.'_direct_debit'] = $board->load_board($user, 'direct_debit');
284 284
 		}
285 285
 		if (isModEnabled('paymentbybanktransfer')) {
286 286
 			include_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
287 287
 			$board = new BonPrelevement($db);
288
-			$dashboardlines[$board->element . '_credit_transfer'] = $board->load_board($user, 'credit_transfer');
288
+			$dashboardlines[$board->element.'_credit_transfer'] = $board->load_board($user, 'credit_transfer');
289 289
 		}
290 290
 	}
291 291
 
292 292
 	// Number of foundation members
293
-	if (isModEnabled('member')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_ADHERENT') && $user->hasRight('adherent', 'lire') && !$user->socid) {
293
+	if (isModEnabled('member') && !getDolGlobalString('MAIN_DISABLE_BLOCK_ADHERENT') && $user->hasRight('adherent', 'lire') && !$user->socid) {
294 294
 		include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
295 295
 		$board = new Adherent($db);
296 296
 		$dashboardlines[$board->element.'_shift'] = $board->load_board($user, 'shift');
@@ -298,21 +298,21 @@  discard block
 block discarded – undo
298 298
 	}
299 299
 
300 300
 	// Number of expense reports to approve
301
-	if (isModEnabled('expensereport')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'approve')) {
301
+	if (isModEnabled('expensereport') && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'approve')) {
302 302
 		include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
303 303
 		$board = new ExpenseReport($db);
304 304
 		$dashboardlines[$board->element.'_toapprove'] = $board->load_board($user, 'toapprove');
305 305
 	}
306 306
 
307 307
 	// Number of expense reports to pay
308
-	if (isModEnabled('expensereport')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'to_paid')) {
308
+	if (isModEnabled('expensereport') && !getDolGlobalString('MAIN_DISABLE_BLOCK_EXPENSEREPORT') && $user->hasRight('expensereport', 'to_paid')) {
309 309
 		include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
310 310
 		$board = new ExpenseReport($db);
311 311
 		$dashboardlines[$board->element.'_topay'] = $board->load_board($user, 'topay');
312 312
 	}
313 313
 
314 314
 	// Number of holidays to approve
315
-	if (isModEnabled('holiday')  && !getDolGlobalString('MAIN_DISABLE_BLOCK_HOLIDAY') && $user->hasRight('holiday', 'approve')) {
315
+	if (isModEnabled('holiday') && !getDolGlobalString('MAIN_DISABLE_BLOCK_HOLIDAY') && $user->hasRight('holiday', 'approve')) {
316 316
 		include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
317 317
 		$board = new Holiday($db);
318 318
 		$dashboardlines[$board->element] = $board->load_board($user);
Please login to merge, or discard this patch.
htdocs/viewimage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	if (empty($dolibarr_nocache)) {
169 169
 		header('Cache-Control: max-age=3600, public, must-revalidate');
170 170
 		header('Pragma: cache'); // This is to avoid to have Pragma: no-cache set by proxy or web server
171
-		header('Expires: '.gmdate('D, d M Y H:i:s', time() + 3600).' GMT');	// This is to avoid to have Expires set by proxy or web server
171
+		header('Expires: '.gmdate('D, d M Y H:i:s', time() + 3600).' GMT'); // This is to avoid to have Expires set by proxy or web server
172 172
 		//header('Expires: '.strtotime('+1 hour');
173 173
 	} else {
174 174
 		header('Cache-Control: no-cache');
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 }
225 225
 
226 226
 // Security: Delete string ../ or ..\ into $original_file
227
-$original_file = preg_replace('/\.\.+/', '..', $original_file);	// Replace '... or more' with '..'
227
+$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..'
228 228
 $original_file = str_replace('../', '/', $original_file);
229 229
 $original_file = str_replace('..\\', '/', $original_file);
230 230
 
Please login to merge, or discard this patch.
htdocs/core/ajax/onlineSign.php 1 patch
Spacing   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
 if (!defined('NOBROWSERNOTIF')) {
49 49
 	define('NOBROWSERNOTIF', '1');
50 50
 }
51
-$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));	// Keep $_GET and $_POST here. GETPOST not yet defined.
51
+$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); // Keep $_GET and $_POST here. GETPOST not yet defined.
52 52
 if (is_numeric($entity)) {
53 53
 	define("DOLENTITY", $entity);
54 54
 }
55 55
 include '../../main.inc.php';
56
-require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
56
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
57 57
 
58 58
 $action = GETPOST('action', 'aZ09');
59 59
 
60 60
 $signature = GETPOST('signaturebase64');
61 61
 $ref = GETPOST('ref', 'aZ09');
62
-$mode = GETPOST('mode', 'aZ09');    // 'proposal', ...
62
+$mode = GETPOST('mode', 'aZ09'); // 'proposal', ...
63 63
 $SECUREKEY = GETPOST("securekey"); // Secure key
64 64
 $online_sign_name = GETPOST("onlinesignname");
65 65
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	$securekeyseed = getDolGlobalString(strtoupper($type).'_ONLINE_SIGNATURE_SECURITY_TOKEN');
81 81
 }
82 82
 
83
-if (empty($SECUREKEY) || !dol_verifyHash($securekeyseed . $type . $ref . (!isModEnabled('multicompany') ? '' : $entity), $SECUREKEY, '0')) {
84
-	httponly_accessforbidden('Bad value for securitykey. Value provided ' . dol_escape_htmltag($SECUREKEY) . ' does not match expected value for ref=' . dol_escape_htmltag($ref), 403);
83
+if (empty($SECUREKEY) || !dol_verifyHash($securekeyseed.$type.$ref.(!isModEnabled('multicompany') ? '' : $entity), $SECUREKEY, '0')) {
84
+	httponly_accessforbidden('Bad value for securitykey. Value provided '.dol_escape_htmltag($SECUREKEY).' does not match expected value for ref='.dol_escape_htmltag($ref), 403);
85 85
 }
86 86
 
87 87
 
@@ -105,29 +105,29 @@  discard block
 block discarded – undo
105 105
 		$data = base64_decode($signature);
106 106
 
107 107
 		if ($mode == "propale" || $mode == 'proposal') {
108
-			require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
109
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
108
+			require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
109
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
110 110
 			$object = new Propal($db);
111 111
 			$object->fetch(0, $ref);
112 112
 
113 113
 			$upload_dir = !empty($conf->propal->multidir_output[$object->entity]) ? $conf->propal->multidir_output[$object->entity] : $conf->propal->dir_output;
114
-			$upload_dir .= '/' . dol_sanitizeFileName($object->ref) . '/';
114
+			$upload_dir .= '/'.dol_sanitizeFileName($object->ref).'/';
115 115
 
116
-			$default_font_size = pdf_getPDFFontSize($langs);    // Must be after pdf_getInstance
117
-			$default_font = pdf_getPDFFont($langs);    // Must be after pdf_getInstance
116
+			$default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
117
+			$default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance
118 118
 			$langs->loadLangs(array("main", "companies"));
119 119
 
120 120
 			$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
121
-			$filename = "signatures/" . $date . "_signature.png";
122
-			if (!is_dir($upload_dir . "signatures/")) {
123
-				if (!dol_mkdir($upload_dir . "signatures/")) {
124
-					$response = "Error mkdir. Failed to create dir " . $upload_dir . "signatures/";
121
+			$filename = "signatures/".$date."_signature.png";
122
+			if (!is_dir($upload_dir."signatures/")) {
123
+				if (!dol_mkdir($upload_dir."signatures/")) {
124
+					$response = "Error mkdir. Failed to create dir ".$upload_dir."signatures/";
125 125
 					$error++;
126 126
 				}
127 127
 			}
128 128
 
129 129
 			if (!$error) {
130
-				$return = file_put_contents($upload_dir . $filename, $data);
130
+				$return = file_put_contents($upload_dir.$filename, $data);
131 131
 				if ($return == false) {
132 132
 					$error++;
133 133
 					$response = 'Error file_put_content: failed to create signature file.';
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
 			if (!$error) {
138 138
 				// Defined modele of doc
139 139
 				$last_main_doc_file = $object->last_main_doc;
140
-				$directdownloadlink = $object->getLastMainDocLink('proposal');    // url to download the $object->last_main_doc
140
+				$directdownloadlink = $object->getLastMainDocLink('proposal'); // url to download the $object->last_main_doc
141 141
 
142 142
 				if (preg_match('/\.pdf/i', $last_main_doc_file)) {
143 143
 					// TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile
144
-					$newpdffilename = $upload_dir . $ref . "_signed-" . $date . ".pdf";
145
-					$sourcefile = $upload_dir . $ref . ".pdf";
144
+					$newpdffilename = $upload_dir.$ref."_signed-".$date.".pdf";
145
+					$sourcefile = $upload_dir.$ref.".pdf";
146 146
 
147 147
 					if (dol_is_file($sourcefile)) {
148 148
 						// We build the new PDF
@@ -158,13 +158,13 @@  discard block
 block discarded – undo
158 158
 						}
159 159
 
160 160
 						//$pdf->Open();
161
-						$pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
161
+						$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
162 162
 
163 163
 						$param = array();
164 164
 						$param['online_sign_name'] = $online_sign_name;
165
-						$param['pathtoimage'] = $upload_dir . $filename;
165
+						$param['pathtoimage'] = $upload_dir.$filename;
166 166
 
167
-						$s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
167
+						$s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
168 168
 						for ($i = 1; $i < ($pagecount + 1); $i++) {
169 169
 							try {
170 170
 								$tppl = $pdf->importPage($i);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 									dolPrintSignatureImage($pdf, $langs, $param);
184 184
 								}
185 185
 							} catch (Exception $e) {
186
-								dol_syslog("Error when manipulating the PDF " . $sourcefile . " by onlineSign: " . $e->getMessage(), LOG_ERR);
186
+								dol_syslog("Error when manipulating the PDF ".$sourcefile." by onlineSign: ".$e->getMessage(), LOG_ERR);
187 187
 								$response = $e->getMessage();
188 188
 								$error++;
189 189
 							}
@@ -220,14 +220,14 @@  discard block
 block discarded – undo
220 220
 
221 221
 				$online_sign_ip = getUserRemoteIP();
222 222
 
223
-				$sql = "UPDATE " . MAIN_DB_PREFIX . "propal";
224
-				$sql .= " SET fk_statut = " . ((int) $object::STATUS_SIGNED) . ", note_private = '" . $db->escape($object->note_private) . "',";
225
-				$sql .= " date_signature = '" . $db->idate(dol_now()) . "',";
226
-				$sql .= " online_sign_ip = '" . $db->escape($online_sign_ip) . "'";
223
+				$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
224
+				$sql .= " SET fk_statut = ".((int) $object::STATUS_SIGNED).", note_private = '".$db->escape($object->note_private)."',";
225
+				$sql .= " date_signature = '".$db->idate(dol_now())."',";
226
+				$sql .= " online_sign_ip = '".$db->escape($online_sign_ip)."'";
227 227
 				if ($online_sign_name) {
228
-					$sql .= ", online_sign_name = '" . $db->escape($online_sign_name) . "'";
228
+					$sql .= ", online_sign_name = '".$db->escape($online_sign_name)."'";
229 229
 				}
230
-				$sql .= " WHERE rowid = " . ((int) $object->id);
230
+				$sql .= " WHERE rowid = ".((int) $object->id);
231 231
 
232 232
 				dol_syslog(__FILE__, LOG_DEBUG);
233 233
 				$resql = $db->query($sql);
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 						$result = $object->call_trigger('PROPAL_CLOSE_SIGNED', $user);
247 247
 						if ($result < 0) {
248 248
 							$error++;
249
-							$response = "error in trigger " . $object->error;
249
+							$response = "error in trigger ".$object->error;
250 250
 						} else {
251 251
 							$response = "success";
252 252
 						}
@@ -267,25 +267,25 @@  discard block
 block discarded – undo
267 267
 				}
268 268
 			}
269 269
 		} elseif ($mode == 'contract') {
270
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
271
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
270
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
271
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
272 272
 			$object = new Contrat($db);
273 273
 			$object->fetch(0, $ref);
274 274
 
275 275
 			$upload_dir = !empty($conf->contrat->multidir_output[$object->entity]) ? $conf->contrat->multidir_output[$object->entity] : $conf->contrat->dir_output;
276
-			$upload_dir .= '/' . dol_sanitizeFileName($object->ref) . '/';
276
+			$upload_dir .= '/'.dol_sanitizeFileName($object->ref).'/';
277 277
 
278 278
 			$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
279
-			$filename = "signatures/" . $date . "_signature.png";
280
-			if (!is_dir($upload_dir . "signatures/")) {
281
-				if (!dol_mkdir($upload_dir . "signatures/")) {
282
-					$response = "Error mkdir. Failed to create dir " . $upload_dir . "signatures/";
279
+			$filename = "signatures/".$date."_signature.png";
280
+			if (!is_dir($upload_dir."signatures/")) {
281
+				if (!dol_mkdir($upload_dir."signatures/")) {
282
+					$response = "Error mkdir. Failed to create dir ".$upload_dir."signatures/";
283 283
 					$error++;
284 284
 				}
285 285
 			}
286 286
 
287 287
 			if (!$error) {
288
-				$return = file_put_contents($upload_dir . $filename, $data);
288
+				$return = file_put_contents($upload_dir.$filename, $data);
289 289
 				if ($return == false) {
290 290
 					$error++;
291 291
 					$response = 'Error file_put_content: failed to create signature file.';
@@ -295,11 +295,11 @@  discard block
 block discarded – undo
295 295
 			if (!$error) {
296 296
 				// Defined modele of doc
297 297
 				$last_main_doc_file = $object->last_main_doc;
298
-				$directdownloadlink = $object->getLastMainDocLink('contrat');    // url to download the $object->last_main_doc
298
+				$directdownloadlink = $object->getLastMainDocLink('contrat'); // url to download the $object->last_main_doc
299 299
 				if (preg_match('/\.pdf/i', $last_main_doc_file)) {
300 300
 					// TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile
301
-					$newpdffilename = $upload_dir . $ref . "_signed-" . $date . ".pdf";
302
-					$sourcefile = $upload_dir . $ref . ".pdf";
301
+					$newpdffilename = $upload_dir.$ref."_signed-".$date.".pdf";
302
+					$sourcefile = $upload_dir.$ref.".pdf";
303 303
 
304 304
 					if (dol_is_file($sourcefile)) {
305 305
 						// We build the new PDF
@@ -315,13 +315,13 @@  discard block
 block discarded – undo
315 315
 						}
316 316
 
317 317
 						//$pdf->Open();
318
-						$pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
318
+						$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
319 319
 
320 320
 						$param = array();
321 321
 						$param['online_sign_name'] = $online_sign_name;
322
-						$param['pathtoimage'] = $upload_dir . $filename;
322
+						$param['pathtoimage'] = $upload_dir.$filename;
323 323
 
324
-						$s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
324
+						$s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
325 325
 						for ($i = 1; $i < ($pagecount + 1); $i++) {
326 326
 							try {
327 327
 								$tppl = $pdf->importPage($i);
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 									dolPrintSignatureImage($pdf, $langs, $param);
341 341
 								}
342 342
 							} catch (Exception $e) {
343
-								dol_syslog("Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
343
+								dol_syslog("Error when manipulating some PDF by onlineSign: ".$e->getMessage(), LOG_ERR);
344 344
 								$response = $e->getMessage();
345 345
 								$error++;
346 346
 							}
@@ -375,8 +375,8 @@  discard block
 block discarded – undo
375 375
 				}
376 376
 			}
377 377
 		} elseif ($mode == 'fichinter') {
378
-			require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
379
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
378
+			require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
379
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
380 380
 			$object = new Fichinter($db);
381 381
 			$object->fetch(0, $ref);
382 382
 
@@ -385,20 +385,20 @@  discard block
 block discarded – undo
385 385
 
386 386
 			$langs->loadLangs(array("main", "companies"));
387 387
 
388
-			$default_font_size = pdf_getPDFFontSize($langs);	// Must be after pdf_getInstance
389
-			$default_font = pdf_getPDFFont($langs);	// Must be
388
+			$default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
389
+			$default_font = pdf_getPDFFont($langs); // Must be
390 390
 
391 391
 			$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
392
-			$filename = "signatures/" . $date . "_signature.png";
393
-			if (!is_dir($upload_dir . "signatures/")) {
394
-				if (!dol_mkdir($upload_dir . "signatures/")) {
395
-					$response = "Error mkdir. Failed to create dir " . $upload_dir . "signatures/";
392
+			$filename = "signatures/".$date."_signature.png";
393
+			if (!is_dir($upload_dir."signatures/")) {
394
+				if (!dol_mkdir($upload_dir."signatures/")) {
395
+					$response = "Error mkdir. Failed to create dir ".$upload_dir."signatures/";
396 396
 					$error++;
397 397
 				}
398 398
 			}
399 399
 
400 400
 			if (!$error) {
401
-				$return = file_put_contents($upload_dir . $filename, $data);
401
+				$return = file_put_contents($upload_dir.$filename, $data);
402 402
 				if ($return == false) {
403 403
 					$error++;
404 404
 					$response = 'Error file_put_content: failed to create signature file.';
@@ -408,11 +408,11 @@  discard block
 block discarded – undo
408 408
 			if (!$error) {
409 409
 				// Defined modele of doc
410 410
 				$last_main_doc_file = $object->last_main_doc;
411
-				$directdownloadlink = $object->getLastMainDocLink('fichinter');    // url to download the $object->last_main_doc
411
+				$directdownloadlink = $object->getLastMainDocLink('fichinter'); // url to download the $object->last_main_doc
412 412
 				if (preg_match('/\.pdf/i', $last_main_doc_file)) {
413 413
 					// TODO Use the $last_main_doc_file to defined the $newpdffilename and $sourcefile
414
-					$newpdffilename = $upload_dir . $ref . "_signed-" . $date . ".pdf";
415
-					$sourcefile = $upload_dir . $ref . ".pdf";
414
+					$newpdffilename = $upload_dir.$ref."_signed-".$date.".pdf";
415
+					$sourcefile = $upload_dir.$ref.".pdf";
416 416
 
417 417
 					if (dol_is_file($sourcefile)) {
418 418
 						// We build the new PDF
@@ -428,13 +428,13 @@  discard block
 block discarded – undo
428 428
 						}
429 429
 
430 430
 						//$pdf->Open();
431
-						$pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
431
+						$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
432 432
 
433 433
 						$param = array();
434 434
 						$param['online_sign_name'] = $online_sign_name;
435
-						$param['pathtoimage'] = $upload_dir . $filename;
435
+						$param['pathtoimage'] = $upload_dir.$filename;
436 436
 
437
-						$s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
437
+						$s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
438 438
 						for ($i = 1; $i < ($pagecount + 1); $i++) {
439 439
 							try {
440 440
 								$tppl = $pdf->importPage($i);
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 									dolPrintSignatureImage($pdf, $langs, $param);
454 454
 								}
455 455
 							} catch (Exception $e) {
456
-								dol_syslog("Error when manipulating some PDF by onlineSign: " . $e->getMessage(), LOG_ERR);
456
+								dol_syslog("Error when manipulating some PDF by onlineSign: ".$e->getMessage(), LOG_ERR);
457 457
 								$response = $e->getMessage();
458 458
 								$error++;
459 459
 							}
@@ -489,8 +489,8 @@  discard block
 block discarded – undo
489 489
 			}
490 490
 		} elseif ($mode == "societe_rib") {
491 491
 			$langs->load('withdrawals');
492
-			require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
493
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/pdf.lib.php';
492
+			require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
493
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
494 494
 			$modelpath = "core/modules/bank/doc/";
495 495
 			$object = new CompanyBankAccount($db);
496 496
 			$object->fetch($ref);
@@ -498,23 +498,23 @@  discard block
 block discarded – undo
498 498
 				$object->fetch_thirdparty();
499 499
 
500 500
 
501
-				$upload_dir = $conf->societe->multidir_output[$object->thirdparty->entity] . '/' . dol_sanitizeFileName($object->thirdparty->id) . '/';
501
+				$upload_dir = $conf->societe->multidir_output[$object->thirdparty->entity].'/'.dol_sanitizeFileName($object->thirdparty->id).'/';
502 502
 
503
-				$default_font_size = pdf_getPDFFontSize($langs);    // Must be after pdf_getInstance
504
-				$default_font = pdf_getPDFFont($langs);    // Must be after pdf_getInstance
503
+				$default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
504
+				$default_font = pdf_getPDFFont($langs); // Must be after pdf_getInstance
505 505
 				$langs->loadLangs(array("main", "companies"));
506 506
 
507 507
 				$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
508
-				$filename = "signatures/" . $date . "_signature.png";
509
-				if (!is_dir($upload_dir . "signatures/")) {
510
-					if (!dol_mkdir($upload_dir . "signatures/")) {
511
-						$response = "Error mkdir. Failed to create dir " . $upload_dir . "signatures/";
508
+				$filename = "signatures/".$date."_signature.png";
509
+				if (!is_dir($upload_dir."signatures/")) {
510
+					if (!dol_mkdir($upload_dir."signatures/")) {
511
+						$response = "Error mkdir. Failed to create dir ".$upload_dir."signatures/";
512 512
 						$error++;
513 513
 					}
514 514
 				}
515 515
 
516 516
 				if (!$error) {
517
-					$return = file_put_contents($upload_dir . $filename, $data);
517
+					$return = file_put_contents($upload_dir.$filename, $data);
518 518
 					if ($return == false) {
519 519
 						$error++;
520 520
 						$response = 'Error file_put_content: failed to create signature file.';
@@ -525,14 +525,14 @@  discard block
 block discarded – undo
525 525
 					// Defined modele of doc
526 526
 					$last_main_doc_file = $object->last_main_doc;
527 527
 					$last_modelpdf = $object->model_pdf;
528
-					$directdownloadlink = $object->getLastMainDocLink('company');    // url to download the $object->last_main_doc
528
+					$directdownloadlink = $object->getLastMainDocLink('company'); // url to download the $object->last_main_doc
529 529
 
530 530
 					if (preg_match('/\.pdf/i', $last_main_doc_file)) {
531 531
 						$sourcefile = '';
532 532
 						$newpdffilename = '';
533 533
 						if ($last_modelpdf == 'sepamandate') {
534
-							$newpdffilename = $upload_dir . $langs->transnoentitiesnoconv("SepaMandateShort") . ' ' . dol_sanitizeFileName($object->ref) . "-" . dol_sanitizeFileName($object->rum) . "_signed-" . $date . ".pdf";
535
-							$sourcefile = $upload_dir . $langs->transnoentitiesnoconv("SepaMandateShort") . ' ' . dol_sanitizeFileName($object->ref) . "-" . dol_sanitizeFileName($object->rum) . ".pdf";
534
+							$newpdffilename = $upload_dir.$langs->transnoentitiesnoconv("SepaMandateShort").' '.dol_sanitizeFileName($object->ref)."-".dol_sanitizeFileName($object->rum)."_signed-".$date.".pdf";
535
+							$sourcefile = $upload_dir.$langs->transnoentitiesnoconv("SepaMandateShort").' '.dol_sanitizeFileName($object->ref)."-".dol_sanitizeFileName($object->rum).".pdf";
536 536
 						}
537 537
 						if (dol_is_file($sourcefile)) {
538 538
 							// We build the new PDF
@@ -548,9 +548,9 @@  discard block
 block discarded – undo
548 548
 							}
549 549
 
550 550
 							//$pdf->Open();
551
-							$pagecount = $pdf->setSourceFile($sourcefile);        // original PDF
551
+							$pagecount = $pdf->setSourceFile($sourcefile); // original PDF
552 552
 
553
-							$s = array();    // Array with size of each page. Example array(w'=>210, 'h'=>297);
553
+							$s = array(); // Array with size of each page. Example array(w'=>210, 'h'=>297);
554 554
 							for ($i = 1; $i < ($pagecount + 1); $i++) {
555 555
 								try {
556 556
 									$tppl = $pdf->importPage($i);
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 									$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
559 559
 									$pdf->useTemplate($tppl);
560 560
 								} catch (Exception $e) {
561
-									dol_syslog("Error when manipulating the PDF " . $sourcefile . " by onlineSign: " . $e->getMessage(), LOG_ERR);
561
+									dol_syslog("Error when manipulating the PDF ".$sourcefile." by onlineSign: ".$e->getMessage(), LOG_ERR);
562 562
 									$response = $e->getMessage();
563 563
 									$error++;
564 564
 								}
@@ -574,18 +574,18 @@  discard block
 block discarded – undo
574 574
 								$dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
575 575
 							}
576 576
 							foreach ($dirmodels as $reldir) {
577
-								$file = "pdf_" . $last_modelpdf . ".modules.php";
577
+								$file = "pdf_".$last_modelpdf.".modules.php";
578 578
 								// On vérifie l'emplacement du modele
579
-								$file = dol_buildpath($reldir . $modelpath . $file, 0);
579
+								$file = dol_buildpath($reldir.$modelpath.$file, 0);
580 580
 								if (file_exists($file)) {
581 581
 									$filefound = $file;
582
-									$classname = 'pdf_' . $last_modelpdf;
582
+									$classname = 'pdf_'.$last_modelpdf;
583 583
 									break;
584 584
 								}
585 585
 							}
586 586
 
587 587
 							if ($filefound === '') {
588
-								$response = $langs->trans("Error") . ' Failed to load doc generator with modelpaths=' . $modelpath . ' - modele=' . $last_modelpdf;
588
+								$response = $langs->trans("Error").' Failed to load doc generator with modelpaths='.$modelpath.' - modele='.$last_modelpdf;
589 589
 								dol_syslog($response, LOG_ERR);
590 590
 								$error++;
591 591
 							}
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 
610 610
 								$param = array();
611 611
 								$param['online_sign_name'] = $online_sign_name;
612
-								$param['pathtoimage'] = $upload_dir . $filename;
612
+								$param['pathtoimage'] = $upload_dir.$filename;
613 613
 
614 614
 								// A signature image file is 720 x 180 (ratio 1/4) but we use only the size into PDF
615 615
 								// TODO Get position of box from PDF template
@@ -644,16 +644,16 @@  discard block
 block discarded – undo
644 644
 
645 645
 				$online_sign_ip = getUserRemoteIP();
646 646
 
647
-				$sql = "UPDATE " . MAIN_DB_PREFIX . $object->table_element;
647
+				$sql = "UPDATE ".MAIN_DB_PREFIX.$object->table_element;
648 648
 				$sql .= " SET ";
649
-				$sql .= " date_signature = '" . $db->idate(dol_now()) . "',";
650
-				$sql .= " online_sign_ip = '" . $db->escape($online_sign_ip) . "'";
649
+				$sql .= " date_signature = '".$db->idate(dol_now())."',";
650
+				$sql .= " online_sign_ip = '".$db->escape($online_sign_ip)."'";
651 651
 				if ($online_sign_name) {
652
-					$sql .= ", online_sign_name = '" . $db->escape($online_sign_name) . "'";
652
+					$sql .= ", online_sign_name = '".$db->escape($online_sign_name)."'";
653 653
 				}
654 654
 				//$sql .= ", last_main_doc = '" . $db->escape($object->element'..') . "'";
655 655
 
656
-				$sql .= " WHERE rowid = " . ((int) $object->id);
656
+				$sql .= " WHERE rowid = ".((int) $object->id);
657 657
 
658 658
 				dol_syslog(__FILE__, LOG_DEBUG);
659 659
 				$resql = $db->query($sql);
@@ -702,8 +702,8 @@  discard block
 block discarded – undo
702 702
  */
703 703
 function dolPrintSignatureImage(TCPDF $pdf, $langs, $params)
704 704
 {
705
-	$default_font_size = pdf_getPDFFontSize($langs);	// Must be after pdf_getInstance
706
-	$default_font = pdf_getPDFFont($langs);	// Must be
705
+	$default_font_size = pdf_getPDFFontSize($langs); // Must be after pdf_getInstance
706
+	$default_font = pdf_getPDFFont($langs); // Must be
707 707
 	$xforimgstart = $params['xforimgstart'];
708 708
 	$yforimgstart = $params['yforimgstart'];
709 709
 	$wforimg = $params['wforimg'];
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 	$pdf->SetXY($xforimgstart, $yforimgstart + round($wforimg / 4) - 4);
712 712
 	$pdf->SetFont($default_font, '', $default_font_size - 1);
713 713
 	$pdf->SetTextColor(80, 80, 80);
714
-	$pdf->MultiCell($wforimg, 4, $langs->trans("Signature") . ': ' . dol_print_date(dol_now(), "day", false, $langs, true). ' - '.$params['online_sign_name'], 0, 'L');
714
+	$pdf->MultiCell($wforimg, 4, $langs->trans("Signature").': '.dol_print_date(dol_now(), "day", false, $langs, true).' - '.$params['online_sign_name'], 0, 'L');
715 715
 	//$pdf->SetXY($xforimgstart, $yforimgstart + round($wforimg / 4));
716 716
 	//$pdf->MultiCell($wforimg, 4, $langs->trans("Lastname") . ': ' . $online_sign_name, 0, 'L');
717 717
 
Please login to merge, or discard this patch.
htdocs/modulebuilder/index.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 		// Copy last 'html.formsetup.class.php' to backport folder
251 251
 		if (getDolGlobalInt('MODULEBUILDER_SUPPORT_COMPATIBILITY_V16')) {
252 252
 			$tryToCopyFromSetupClass = true;
253
-			$backportDest = $destdir .'/backport/v16/core/class';
253
+			$backportDest = $destdir.'/backport/v16/core/class';
254 254
 			$backportFileSrc = DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
255 255
 			$backportFileDest = $backportDest.'/html.formsetup.class.php';
256 256
 			$result = dol_mkdir($backportDest);
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 			);
356 356
 
357 357
 			if (getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR')) {
358
-				$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
358
+				$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' '.getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
359 359
 			}
360 360
 
361 361
 			// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
 		clearstatcache(true);
386 386
 		if (function_exists('opcache_invalidate')) {
387
-			opcache_reset();	// remove the include cache hell !
387
+			opcache_reset(); // remove the include cache hell !
388 388
 		}
389 389
 
390 390
 		header("Location: ".$_SERVER["PHP_SELF"].'?module='.$modulename);
@@ -879,7 +879,7 @@  discard block
 block discarded – undo
879 879
 			}
880 880
 			$stringLog = implode("\n", $strreplace);
881 881
 			// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
882
-			dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '','__CHANGELOG__' => $stringLog));
882
+			dolReplaceInFile($destfile, array('//include::ChangeLog.md[]' => '', '__CHANGELOG__' => $stringLog));
883 883
 		}
884 884
 
885 885
 		// Delete old documentation files
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
 			}
1534 1534
 		}
1535 1535
 		$menus = $moduleobj->menu;
1536
-		$counter = 0 ;
1536
+		$counter = 0;
1537 1537
 		foreach ($menus as $menu) {
1538 1538
 			if ($menu['leftmenu'] == strtolower($objectname)) {
1539 1539
 				$counter++;
@@ -1575,7 +1575,7 @@  discard block
 block discarded – undo
1575 1575
 			);
1576 1576
 
1577 1577
 			if (getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR')) {
1578
-				$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
1578
+				$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' '.getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
1579 1579
 			}
1580 1580
 
1581 1581
 			$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
@@ -1675,7 +1675,7 @@  discard block
 block discarded – undo
1675 1675
 		} else {
1676 1676
 			createNewDictionnary($module, $moduledescriptorfile, $newdicname, $dictionaries);
1677 1677
 			if (function_exists('opcache_invalidate')) {
1678
-				opcache_reset();	// remove the include cache hell !
1678
+				opcache_reset(); // remove the include cache hell !
1679 1679
 			}
1680 1680
 			clearstatcache(true);
1681 1681
 			header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''));
@@ -1770,7 +1770,7 @@  discard block
 block discarded – undo
1770 1770
 				'isameasure' => GETPOSTINT('propisameasure'),
1771 1771
 				'comment' => GETPOST('propcomment', 'alpha'),
1772 1772
 				'help' => GETPOST('prophelp', 'alpha'),
1773
-				'css' => GETPOST('propcss', 'alpha'),        // Can be 'maxwidth500 widthcentpercentminusxx' for example
1773
+				'css' => GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example
1774 1774
 				'cssview' => GETPOST('propcssview', 'alpha'),
1775 1775
 				'csslist' => GETPOST('propcsslist', 'alpha'),
1776 1776
 				'default' => GETPOST('propdefault', 'restricthtml'),
@@ -1925,7 +1925,7 @@  discard block
 block discarded – undo
1925 1925
 
1926 1926
 			clearstatcache(true);
1927 1927
 			if (function_exists('opcache_invalidate')) {
1928
-				opcache_reset();	// remove the include cache hell !
1928
+				opcache_reset(); // remove the include cache hell !
1929 1929
 			}
1930 1930
 
1931 1931
 			header("Location: ".$_SERVER["PHP_SELF"].'?module=deletemodule');
@@ -2017,7 +2017,7 @@  discard block
 block discarded – undo
2017 2017
 
2018 2018
 			clearstatcache(true);
2019 2019
 			if (function_exists('opcache_invalidate')) {
2020
-				opcache_reset();	// remove the include cache hell !
2020
+				opcache_reset(); // remove the include cache hell !
2021 2021
 			}
2022 2022
 			$resultko = 0;
2023 2023
 			foreach ($filetodelete as $tmpfiletodelete) {
@@ -2037,7 +2037,7 @@  discard block
 block discarded – undo
2037 2037
 	}
2038 2038
 
2039 2039
 	$action = '';
2040
-	if (! $error) {
2040
+	if (!$error) {
2041 2041
 		$tabobj = 'newobject';
2042 2042
 	} else {
2043 2043
 		$tabobj = 'deleteobject';
@@ -2140,7 +2140,7 @@  discard block
 block discarded – undo
2140 2140
 			setEventMessages($langs->trans("DictionaryDeleted", ucfirst(substr($newdicname, 2))), null);
2141 2141
 		}
2142 2142
 		if (function_exists('opcache_invalidate')) {
2143
-			opcache_reset();	// remove the include cache hell !
2143
+			opcache_reset(); // remove the include cache hell !
2144 2144
 		}
2145 2145
 		clearstatcache(true);
2146 2146
 		header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''));
@@ -2148,7 +2148,7 @@  discard block
 block discarded – undo
2148 2148
 	}
2149 2149
 }
2150 2150
 if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) {
2151
-	$keydict = GETPOST('dictionnarykey') - 1 ;
2151
+	$keydict = GETPOST('dictionnarykey') - 1;
2152 2152
 
2153 2153
 	$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
2154 2154
 	$destdir = $dirins.'/'.strtolower($module);
@@ -2182,7 +2182,7 @@  discard block
 block discarded – undo
2182 2182
 				setEventMessages($langs->trans("DictionaryNameUpdated", ucfirst(GETPOST('tablib'))), null);
2183 2183
 			}
2184 2184
 			if (function_exists('opcache_invalidate')) {
2185
-				opcache_reset();	// remove the include cache hell !
2185
+				opcache_reset(); // remove the include cache hell !
2186 2186
 			}
2187 2187
 			clearstatcache(true);
2188 2188
 			header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : ''));
@@ -2357,7 +2357,7 @@  discard block
 block discarded – undo
2357 2357
 
2358 2358
 		clearstatcache(true);
2359 2359
 		if (function_exists('opcache_invalidate')) {
2360
-			opcache_reset();	// remove the include cache hell !
2360
+			opcache_reset(); // remove the include cache hell !
2361 2361
 		}
2362 2362
 		header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
2363 2363
 		exit;
@@ -2463,7 +2463,7 @@  discard block
 block discarded – undo
2463 2463
 			setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null);
2464 2464
 			clearstatcache(true);
2465 2465
 			if (function_exists('opcache_invalidate')) {
2466
-				opcache_reset();	// remove the include cache hell !
2466
+				opcache_reset(); // remove the include cache hell !
2467 2467
 			}
2468 2468
 			header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
2469 2469
 			exit;
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
 
2514 2514
 			clearstatcache(true);
2515 2515
 			if (function_exists('opcache_invalidate')) {
2516
-				opcache_reset();	// remove the include cache hell !
2516
+				opcache_reset(); // remove the include cache hell !
2517 2517
 			}
2518 2518
 
2519 2519
 			header("Location: ".DOL_URL_ROOT.'/modulebuilder/index.php?tab=permissions&module='.$module);
@@ -2683,7 +2683,7 @@  discard block
 block discarded – undo
2683 2683
 
2684 2684
 		clearstatcache(true);
2685 2685
 		if (function_exists('opcache_invalidate')) {
2686
-			opcache_reset();	// remove the include cache hell !
2686
+			opcache_reset(); // remove the include cache hell !
2687 2687
 		}
2688 2688
 
2689 2689
 		setEventMessages($langs->trans('MenuDeletedSuccessfuly'), null);
@@ -2740,7 +2740,7 @@  discard block
 block discarded – undo
2740 2740
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Url")), null, 'errors');
2741 2741
 	}
2742 2742
 	if (!empty(GETPOST('target'))) {
2743
-		$targets = array('_blank','_self','_parent','_top','');
2743
+		$targets = array('_blank', '_self', '_parent', '_top', '');
2744 2744
 		if (!in_array(GETPOST('target'), $targets)) {
2745 2745
 			$error++;
2746 2746
 			setEventMessages($langs->trans("ErrorFieldValue", $langs->transnoentities("target")), null, 'errors');
@@ -2846,7 +2846,7 @@  discard block
 block discarded – undo
2846 2846
 
2847 2847
 // Modify a menu entry
2848 2848
 if ($dirins && $action == "update_menu" && GETPOSTINT('menukey') && GETPOST('tabobj')) {
2849
-	$objectname =  GETPOST('tabobj');
2849
+	$objectname = GETPOST('tabobj');
2850 2850
 	$dirins = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
2851 2851
 	$destdir = $dirins.'/'.strtolower($module);
2852 2852
 	$objects = dolGetListOfObjectClasses($destdir);
@@ -2941,7 +2941,7 @@  discard block
 block discarded – undo
2941 2941
 			}
2942 2942
 		}
2943 2943
 	} else {
2944
-		$_POST['type'] = '';	// TODO Use a var here and later
2944
+		$_POST['type'] = ''; // TODO Use a var here and later
2945 2945
 		$_POST['titre'] = '';
2946 2946
 		$_POST['fk_menu'] = '';
2947 2947
 		$_POST['leftmenu'] = '';
@@ -4010,8 +4010,8 @@  discard block
 block discarded – undo
4010 4010
 				}
4011 4011
 				print '</table><br>'."\n";
4012 4012
 				print '<div class="center">';
4013
-				print '<input type="submit" class="button button-save" name="add" value="' . dol_escape_htmltag($langs->trans('Create')) . '">';
4014
-				print '<input type="button" class="button button-cancel" name="cancel" value="' . dol_escape_htmltag($langs->trans('Cancel')) . '" onclick="goBack()">';
4013
+				print '<input type="submit" class="button button-save" name="add" value="'.dol_escape_htmltag($langs->trans('Create')).'">';
4014
+				print '<input type="button" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans('Cancel')).'" onclick="goBack()">';
4015 4015
 				print '</div>';
4016 4016
 				print '</form>';
4017 4017
 				// javascript
@@ -4116,16 +4116,16 @@  discard block
 block discarded – undo
4116 4116
 						// Define path for sql file
4117 4117
 						$pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql';
4118 4118
 						$result = dol_buildpath($pathtosql);
4119
-						if (! dol_is_file($result)) {
4119
+						if (!dol_is_file($result)) {
4120 4120
 							$pathtosql = strtolower($module).'/sql/llx_'.strtolower($module).'_'.strtolower($tabobj).'.sql';
4121 4121
 							$result = dol_buildpath($pathtosql);
4122
-							if (! dol_is_file($result)) {
4122
+							if (!dol_is_file($result)) {
4123 4123
 								$pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'_'.strtolower($tabobj).'-'.strtolower($module).'.sql';
4124 4124
 								$result = dol_buildpath($pathtosql);
4125
-								if (! dol_is_file($result)) {
4125
+								if (!dol_is_file($result)) {
4126 4126
 									$pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'-'.strtolower($module).'.sql';
4127 4127
 									$result = dol_buildpath($pathtosql);
4128
-									if (! dol_is_file($result)) {
4128
+									if (!dol_is_file($result)) {
4129 4129
 										$pathtosql = 'install/mysql/tables/llx_'.strtolower($module).'.sql';
4130 4130
 										$pathtosqlextra = 'install/mysql/tables/llx_'.strtolower($module).'_extrafields.sql';
4131 4131
 										$result = dol_buildpath($pathtosql);
@@ -4144,7 +4144,7 @@  discard block
 block discarded – undo
4144 4144
 						$pathtosqlroot = preg_replace('/\/llx_.*$/', '', $pathtosql);
4145 4145
 
4146 4146
 						$pathtosqlkey   = preg_replace('/\.sql$/', '.key.sql', $pathtosql);
4147
-						$pathtosqlextrakey   = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra);
4147
+						$pathtosqlextrakey = preg_replace('/\.sql$/', '.key.sql', $pathtosqlextra);
4148 4148
 
4149 4149
 						$pathtolib      = strtolower($module).'/lib/'.strtolower($module).'.lib.php';
4150 4150
 						$pathtoobjlib   = strtolower($module).'/lib/'.strtolower($module).'_'.strtolower($tabobj).'.lib.php';
@@ -5430,7 +5430,7 @@  discard block
 block discarded – undo
5430 5430
 						}
5431 5431
 					  });
5432 5432
 
5433
-					var groupedRights = ' . $groupedRights_json . ';
5433
+					var groupedRights = ' . $groupedRights_json.';
5434 5434
 					var objectsSelect = $("select[id=\'objects\']");
5435 5435
 					var permsSelect = $("select[id=\'perms\']");
5436 5436
 
@@ -5653,7 +5653,7 @@  discard block
 block discarded – undo
5653 5653
 							if (in_array($perm[5], array('lire', 'read', 'creer', 'write', 'effacer', 'delete'))) {
5654 5654
 								print dol_escape_htmltag(ucfirst($perm[4]));
5655 5655
 							} else {
5656
-								print '';	// No particular object
5656
+								print ''; // No particular object
5657 5657
 							}
5658 5658
 							print '</td>';
5659 5659
 
@@ -6545,9 +6545,9 @@  discard block
 block discarded – undo
6545 6545
 
6546 6546
 						print '<td>';
6547 6547
 						if ($tabName[0] === "+") {
6548
-							print '<span class="badge badge-status4 badge-status">' . dol_escape_htmltag($tabName) . '</span>';
6548
+							print '<span class="badge badge-status4 badge-status">'.dol_escape_htmltag($tabName).'</span>';
6549 6549
 						} else {
6550
-							print '<span class="badge badge-status8 badge-status">' . dol_escape_htmltag($tabName) . '</span>';
6550
+							print '<span class="badge badge-status8 badge-status">'.dol_escape_htmltag($tabName).'</span>';
6551 6551
 						}
6552 6552
 						print '</td>';
6553 6553
 
Please login to merge, or discard this patch.