Completed
Branch develop (c3c152)
by
unknown
24:51
created
htdocs/workstation/workstation_list.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
 $langs->loadLangs(array('mrp', 'other'));
46 46
 
47 47
 $action      = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
48
-$massaction  = GETPOST('massaction', 'alpha');                                   // The bulk action (combo box choice into lists)
49
-$show_files  = GETPOSTINT('show_files');                                    // Show files area generated by bulk actions ?
50
-$confirm     = GETPOST('confirm', 'alpha');                                    // Result of a confirmation
51
-$cancel      = GETPOST('cancel', 'alpha');                                    // We click on a Cancel button
52
-$toselect    = GETPOST('toselect', 'array');                                 // Array of ids of elements selected into a list
48
+$massaction  = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
49
+$show_files  = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
50
+$confirm     = GETPOST('confirm', 'alpha'); // Result of a confirmation
51
+$cancel      = GETPOST('cancel', 'alpha'); // We click on a Cancel button
52
+$toselect    = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
53 53
 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
54
-$backtopage  = GETPOST('backtopage', 'alpha');                                                   // Go back to a dedicated page
55
-$optioncss   = GETPOST('optioncss', 'aZ');                                                      // Option for the css output (always '' except when 'print')
56
-$mode       = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
54
+$backtopage  = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
55
+$optioncss   = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
56
+$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
57 57
 
58 58
 
59 59
 // Load variables for pagination
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 $object = new Workstation($db);
78 78
 $extrafields = new ExtraFields($db);
79 79
 $diroutputmassaction = $conf->workstation->dir_output.'/temp/massgeneration/'.$user->id;
80
-$hookmanager->initHooks(array('workstationlist'));         // Note that conf->hooks_modules contains array
80
+$hookmanager->initHooks(array('workstationlist')); // Note that conf->hooks_modules contains array
81 81
 
82 82
 // Fetch optionals attributes and labels
83 83
 $extrafields->fetch_name_optionals_label($object->table_element);
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 // Default sort order (if not yet defined by previous GETPOST)
89 89
 if (!$sortfield) {
90
-	reset($object->fields);					// Reset is required to avoid key() to return null.
90
+	reset($object->fields); // Reset is required to avoid key() to return null.
91 91
 	$sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
92 92
 }
93 93
 if (!$sortorder) {
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 	$sql .= "t.".$db->escape($key).", ";
332 332
 }
333 333
 // Add fields from extrafields
334
-if (! empty($extrafields->attributes[$object->table_element]['label'])) {
334
+if (!empty($extrafields->attributes[$object->table_element]['label'])) {
335 335
 	foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
336 336
 		// @phan-suppress-next-line PhanTypeArraySuspiciousNullable
337 337
 		$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 }
340 340
 // Add groupby from hooks
341 341
 $parameters = array();
342
-$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object);    // Note that $action and $object may have been modified by hook
342
+$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
343 343
 $sql .= $hookmanager->resPrint;
344 344
 $sql = preg_replace('/,\s*$/', '', $sql);
345 345
 
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 }
506 506
 
507 507
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
508
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
508
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
509 509
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
510 510
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
511 511
 
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
 	} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
613 613
 		$cssforfield .= ($cssforfield ? ' ' : '').'right';
614 614
 	}
615
-	$cssforfield = preg_replace('/small\s*/', '', $cssforfield);	// the 'small' css must not be used for the title label
615
+	$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
616 616
 	if (!empty($arrayfields['t.'.$key]['checked'])) {
617 617
 		print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
618 618
 		$totalarray['nbfield']++;
@@ -622,12 +622,12 @@  discard block
 block discarded – undo
622 622
 // usergroups
623 623
 if (!empty($arrayfields['wug.fk_usergroup']['checked'])) {
624 624
 	// @phan-suppress-next-line PhanTypeInvalidDimOffset
625
-	print getTitleFieldOfList($arrayfields['wug.fk_usergroup']['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, '') . "\n";
625
+	print getTitleFieldOfList($arrayfields['wug.fk_usergroup']['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, '')."\n";
626 626
 }
627 627
 
628 628
 // resources
629 629
 if (!empty($arrayfields['wr.fk_resource']['checked'])) {
630
-	print getTitleFieldOfList($arrayfields['wr.fk_resource']['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, '') . "\n";
630
+	print getTitleFieldOfList($arrayfields['wr.fk_resource']['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, '')."\n";
631 631
 }
632 632
 
633 633
 // Extra fields
@@ -773,11 +773,11 @@  discard block
 block discarded – undo
773 773
 			foreach ($object->usergroups as $id_group) {
774 774
 				$g = new UserGroup($db);
775 775
 				$g->fetch($id_group);
776
-				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories'.($cssforli ? ' '.$cssforli : '').'" style="background: #bbb">' . $g->getNomUrl(1, '', 0, 'categtextwhite') . '</li>';
776
+				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories'.($cssforli ? ' '.$cssforli : '').'" style="background: #bbb">'.$g->getNomUrl(1, '', 0, 'categtextwhite').'</li>';
777 777
 			}
778 778
 
779 779
 			print '<td class="minwidth300imp nowraponall">';
780
-			print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
780
+			print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
781 781
 			print '</td>';
782 782
 		}
783 783
 
@@ -792,11 +792,11 @@  discard block
 block discarded – undo
792 792
 			foreach ($object->resources as $id_resource) {
793 793
 				$r = new Dolresource($db);
794 794
 				$r->fetch($id_resource);
795
-				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories'.($cssforli ? ' '.$cssforli : '').'" style="background: #bbb">' . $r->getNomUrl(1, '', '', 0, 'categtextwhite') . '</li>';
795
+				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories'.($cssforli ? ' '.$cssforli : '').'" style="background: #bbb">'.$r->getNomUrl(1, '', '', 0, 'categtextwhite').'</li>';
796 796
 			}
797 797
 
798 798
 			print '<td class="minwidth300imp">';
799
-			print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
799
+			print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
800 800
 			print '</td>';
801 801
 		}
802 802
 
Please login to merge, or discard this patch.
htdocs/contrat/card.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 $object = new Contrat($db);
103 103
 $extrafields = new ExtraFields($db);
104 104
 $ret = 0;
105
-$pu_ht = null;  // Init for static analysis
106
-$pu_ttc = null;  // Init for static analysis
105
+$pu_ht = null; // Init for static analysis
106
+$pu_ttc = null; // Init for static analysis
107 107
 
108 108
 // Load object
109 109
 if ($id > 0 || !empty($ref) && $action != 'add') {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php
126 126
 $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php
127 127
 $permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->status == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer');
128
-$permissiontoadd   = $user->hasRight('contrat', 'creer');     //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
128
+$permissiontoadd   = $user->hasRight('contrat', 'creer'); //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
129 129
 $permissiontoedit = $permissiontoadd;
130 130
 $permissiontoactivate = $user->hasRight('contrat', 'activer');
131 131
 $error = 0;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
 	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
177 177
 
178
-	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';  // Must be 'include', not 'include_once'
178
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
179 179
 
180 180
 	if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) {
181 181
 		$date_start = '';
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	} elseif ($action == 'confirm_sign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) {
199 199
 		$result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'CONTRACT_MODIFY');
200 200
 		if ($result >= 0) {
201
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
201
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
202 202
 			exit;
203 203
 		} else {
204 204
 			$mesg = $object->error;
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	} elseif ($action == 'confirm_unsign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) {
207 207
 		$result = $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES['STATUS_NO_SIGNATURE'], 0, 'CONTRACT_MODIFY');
208 208
 		if ($result >= 0) {
209
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
209
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
210 210
 			exit;
211 211
 		} else {
212 212
 			$mesg = $object->error;
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 
338 338
 					$classname = ucfirst($subelement);
339 339
 					$srcobject = new $classname($db);
340
-					'@phan-var-force Commande|Propal|Facture $srcobject';  // Can be other class, but CommonObject is too Generic
340
+					'@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic
341 341
 
342 342
 					dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
343 343
 					$result = $srcobject->fetch($object->origin_id);
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 			}
766 766
 			$objectline->fetch_optionals();
767 767
 
768
-			$objectline->oldcopy = dol_clone($objectline, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
768
+			$objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
769 769
 		} else {
770 770
 			$objectline = null;
771 771
 		}
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 			// update price_ht with discount
815 815
 			// TODO Use object->updateline instead objectline->update
816 816
 
817
-			$price_ht =  price2num(GETPOST('elprice'), 'MU');
817
+			$price_ht = price2num(GETPOST('elprice'), 'MU');
818 818
 			$remise_percent = price2num(GETPOST('elremise_percent'), '', 2);
819 819
 			if ($remise_percent > 0) {
820 820
 				$remise = round(((float) $price_ht * (float) $remise_percent / 100), 2);
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
 	} elseif ($action == 'confirm_activate' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) {
922 922
 		$date_start = dol_mktime(12, 0, 0, GETPOSTINT('d_startmonth'), GETPOSTINT('d_startday'), GETPOSTINT('d_startyear'));
923 923
 		$date_end   = dol_mktime(12, 0, 0, GETPOSTINT('d_endmonth'), GETPOSTINT('d_endday'), GETPOSTINT('d_endyear'));
924
-		$comment      = GETPOST('comment', 'alpha');
924
+		$comment = GETPOST('comment', 'alpha');
925 925
 		$result = $object->activateAll($user, $date_start, 0, $comment, $date_end);
926 926
 		if ($result < 0) {
927 927
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -1483,7 +1483,7 @@  discard block
 block discarded – undo
1483 1483
 		$morehtmlref .= '<div class="refidno">';
1484 1484
 		// Ref customer
1485 1485
 		$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1);
1486
-		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef');
1486
+		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1, 'getFormatedCustomerRef');
1487 1487
 		// Ref supplier
1488 1488
 		$morehtmlref .= '<br>';
1489 1489
 		$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1);
@@ -1577,7 +1577,7 @@  discard block
 block discarded – undo
1577 1577
 		}
1578 1578
 
1579 1579
 
1580
-		$arrayothercontracts = $object->getListOfContracts('others');	// array or -1 if technical error
1580
+		$arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error
1581 1581
 
1582 1582
 		/*
1583 1583
 		 * Lines of contracts
@@ -1830,7 +1830,7 @@  discard block
 block discarded – undo
1830 1830
 							print $objp->label ? ' - '.dol_trunc($objp->label, 32) : '';
1831 1831
 							print '<input type="hidden" name="idprod" value="'.$currentLineProductId.'">';
1832 1832
 						} else {
1833
-							$senderissupplier = 0;	// @TODO Option to allow purchased products ?
1833
+							$senderissupplier = 0; // @TODO Option to allow purchased products ?
1834 1834
 							if (empty($senderissupplier)) {
1835 1835
 								if (getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) {
1836 1836
 									$filtertype = '';
@@ -2332,9 +2332,9 @@  discard block
 block discarded – undo
2332 2332
 				// Sign
2333 2333
 				if ($object->status > Contrat::STATUS_DRAFT) {
2334 2334
 					if ($object->signed_status != Contrat::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) {
2335
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=sign&token=' . newToken() . '">' . $langs->trans("ContractSign") . '</a></div>';
2335
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sign&token='.newToken().'">'.$langs->trans("ContractSign").'</a></div>';
2336 2336
 					} else {
2337
-						print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=unsign&token=' . newToken() . '">' . $langs->trans("ContractUnsign") . '</a></div>';
2337
+						print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=unsign&token='.newToken().'">'.$langs->trans("ContractUnsign").'</a></div>';
2338 2338
 					}
2339 2339
 				}
2340 2340
 
Please login to merge, or discard this patch.
htdocs/comm/propal/card.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 							$object->delivery_date = $date_delivery;
229 229
 							foreach ($object->lines as $line) {
230 230
 								if (isset($line->date_start)) {
231
-									$line->date_start +=  $difference;
231
+									$line->date_start += $difference;
232 232
 								}
233 233
 								if (isset($line->date_end)) {
234 234
 									$line->date_end += $difference;
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 
577 577
 						$classname = ucfirst($subelement);
578 578
 						$srcobject = new $classname($db);
579
-						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject';  // Can be other class, but CommonObject is too generic
579
+						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic
580 580
 
581 581
 						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
582 582
 						$result = $srcobject->fetch($object->origin_id);
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 					$error++;
767 767
 				} else {
768 768
 					// Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded)
769
-					$locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id;
769
+					$locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id;
770 770
 				}
771 771
 
772 772
 				$deposit = null;
@@ -777,7 +777,7 @@  discard block
 block discarded – undo
777 777
 					!$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on'
778 778
 					&& !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')
779 779
 				) {
780
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
780
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
781 781
 
782 782
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
783 783
 					$forceFields = array();
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 
791 791
 					if ($deposit) {
792 792
 						setEventMessage('DepositGenerated');
793
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
793
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
794 794
 					} else {
795 795
 						$error++;
796 796
 						setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors');
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
 					}
819 819
 
820 820
 					if ($locationTarget) {
821
-						header('Location: ' . $locationTarget);
821
+						header('Location: '.$locationTarget);
822 822
 						exit;
823 823
 					}
824 824
 				} else {
@@ -1750,8 +1750,8 @@  discard block
 block discarded – undo
1750 1750
 	} elseif ($action == 'setconditions' && $usercancreate) {
1751 1751
 		// Terms of payment
1752 1752
 		$sql = "SELECT code ";
1753
-		$sql .= "FROM " . $db->prefix() . "c_payment_term";
1754
-		$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
1753
+		$sql .= "FROM ".$db->prefix()."c_payment_term";
1754
+		$sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int'));
1755 1755
 		$result = $db->query($sql);
1756 1756
 		if ($result) {
1757 1757
 			$obj = $db->fetch_object($result);
@@ -1936,7 +1936,7 @@  discard block
 block discarded – undo
1936 1936
 
1937 1937
 			$classname = ucfirst($subelement);
1938 1938
 			$objectsrc = new $classname($db);
1939
-			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc';  // Can be other class, but CommonObject is too generic
1939
+			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic
1940 1940
 			$objectsrc->fetch($originid);
1941 1941
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
1942 1942
 				$objectsrc->fetch_lines();
@@ -1950,7 +1950,7 @@  discard block
 block discarded – undo
1950 1950
 
1951 1951
 			$cond_reglement_id  = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
1952 1952
 			$mode_reglement_id  = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
1953
-			$warehouse_id      = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
1953
+			$warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
1954 1954
 
1955 1955
 			// Replicate extrafields
1956 1956
 			$objectsrc->fetch_optionals();
@@ -2014,7 +2014,7 @@  discard block
 block discarded – undo
2014 2014
 	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2015 2015
 	print '<input type="hidden" name="token" value="'.newToken().'">';
2016 2016
 	print '<input type="hidden" name="action" value="add">';
2017
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
2017
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
2018 2018
 	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2019 2019
 	if ($origin != 'project' && $originid) {
2020 2020
 		print '<input type="hidden" name="origin" value="'.$origin.'">';
@@ -2408,7 +2408,7 @@  discard block
 block discarded – undo
2408 2408
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2409 2409
 			$formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
2410 2410
 		}
2411
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2411
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2412 2412
 
2413 2413
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2414 2414
 			// This is a hidden option:
@@ -2418,7 +2418,7 @@  discard block
 block discarded – undo
2418 2418
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2419 2419
 
2420 2420
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2421
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2421
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2422 2422
 
2423 2423
 				$object->fetchObjectLinked();
2424 2424
 
@@ -2502,7 +2502,7 @@  discard block
 block discarded – undo
2502 2502
 						'type' => 'onecolumn',
2503 2503
 						'value' => '
2504 2504
 							<script>
2505
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2505
+								let signedValue = ' . $object::STATUS_SIGNED.';
2506 2506
 
2507 2507
 								$(document).ready(function() {
2508 2508
 									$("[name=generate_deposit]").change(function () {
@@ -2552,7 +2552,7 @@  discard block
 block discarded – undo
2552 2552
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2553 2553
 			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2554 2554
 		} else {
2555
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2555
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2556 2556
 		}
2557 2557
 	} elseif ($action == 'cancel') {
2558 2558
 		// Confirm cancel
@@ -2594,7 +2594,7 @@  discard block
 block discarded – undo
2594 2594
 		$nbMandated = 0;
2595 2595
 		foreach ($object->lines as $line) {
2596 2596
 			$res = $line->fetch_product();
2597
-			if ($res  > 0) {
2597
+			if ($res > 0) {
2598 2598
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2599 2599
 					$nbMandated++;
2600 2600
 					break;
@@ -2635,7 +2635,7 @@  discard block
 block discarded – undo
2635 2635
 	$morehtmlref = '<div class="refidno">';
2636 2636
 	// Ref customer
2637 2637
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
2638
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2638
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2639 2639
 	// Thirdparty
2640 2640
 	$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2641 2641
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) {
@@ -2977,50 +2977,50 @@  discard block
 block discarded – undo
2977 2977
 		include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
2978 2978
 
2979 2979
 		print '<tr>';
2980
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2981
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2980
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2981
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2982 2982
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2983
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2983
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2984 2984
 		}
2985 2985
 		print '</tr>';
2986 2986
 
2987 2987
 		print '<tr>';
2988
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
2989
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2988
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
2989
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2990 2990
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2991
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2991
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2992 2992
 		}
2993 2993
 		print '</tr>';
2994 2994
 
2995 2995
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2996 2996
 			print '<tr>';
2997
-			print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2998
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
2997
+			print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2998
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
2999 2999
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3000 3000
 				$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3001 3001
 
3002
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3002
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3003 3003
 			}
3004 3004
 			print '</tr>';
3005 3005
 		}
3006 3006
 
3007 3007
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3008 3008
 			print '<tr>';
3009
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3010
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3009
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3010
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3011 3011
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3012 3012
 				$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3013 3013
 
3014
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3014
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3015 3015
 			}
3016 3016
 			print '</tr>';
3017 3017
 		}
3018 3018
 
3019 3019
 		print '<tr>';
3020
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
3021
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3020
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
3021
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3022 3022
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3023
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3023
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3024 3024
 		}
3025 3025
 		print '</tr>';
3026 3026
 
@@ -3163,7 +3163,7 @@  discard block
 block discarded – undo
3163 3163
 					'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED),
3164 3164
 					'perm' => $usercancreateorder,
3165 3165
 					'label' => 'AddOrder',
3166
-					'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3166
+					'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3167 3167
 				);
3168 3168
 				/*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) {
3169 3169
 					if ($usercancreateorder) {
@@ -3178,7 +3178,7 @@  discard block
 block discarded – undo
3178 3178
 						'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")),
3179 3179
 						'perm' => $usercancreatepurchaseorder,
3180 3180
 						'label' => 'AddPurchaseOrder',
3181
-						'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3181
+						'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3182 3182
 					);
3183 3183
 					/*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
3184 3184
 						if ($usercancreatepurchaseorder) {
@@ -3193,7 +3193,7 @@  discard block
 block discarded – undo
3193 3193
 					'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED),
3194 3194
 					'perm' => $usercancreateintervention,
3195 3195
 					'label' => 'AddIntervention',
3196
-					'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3196
+					'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3197 3197
 				);
3198 3198
 				/*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) {
3199 3199
 					if ($usercancreateintervention) {
@@ -3208,7 +3208,7 @@  discard block
 block discarded – undo
3208 3208
 					'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED),
3209 3209
 					'perm' => $usercancreatecontract,
3210 3210
 					'label' => 'AddContract',
3211
-					'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3211
+					'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3212 3212
 				);
3213 3213
 				/*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) {
3214 3214
 					$langs->load("contracts");
@@ -3234,7 +3234,7 @@  discard block
 block discarded – undo
3234 3234
 
3235 3235
 				$actionButtonsParameters = [
3236 3236
 					"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
3237
-					"backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id)
3237
+					"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
3238 3238
 				];
3239 3239
 
3240 3240
 				if ($numlines > 0) {
@@ -3268,8 +3268,8 @@  discard block
 block discarded – undo
3268 3268
 				} else {
3269 3269
 					// Set not signed (close)
3270 3270
 					if ($object->status == Propal::STATUS_DRAFT && $usercanclose) {
3271
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token='.newToken().'&action=closeas&token='.newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3272
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3271
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3272
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3273 3273
 					}
3274 3274
 				}
3275 3275
 
Please login to merge, or discard this patch.
htdocs/user/group/card.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 	if (($action == 'adduser' || $action == 'removeuser') && $permissiontoedit) {
178 178
 		if ($userid > 0) {
179 179
 			$object->fetch($id);
180
-			$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
180
+			$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
181 181
 
182 182
 			$edituser = new User($db);
183 183
 			$edituser->fetch($userid);
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 
204 204
 		$object->fetch($id);
205 205
 
206
-		$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
206
+		$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
207 207
 
208 208
 		$object->name = GETPOST("nom", 'alphanohtml');
209 209
 		$object->note = dol_htmlcleanlastbr(trim(GETPOST("note", 'restricthtml')));
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 				print '<td class="liste_titre right" width="5">&nbsp;</td>';
441 441
 				print "</tr>\n";
442 442
 
443
-				$object->fetch($object->id, '', true);	// true to force load of all users, member of the group
443
+				$object->fetch($object->id, '', true); // true to force load of all users, member of the group
444 444
 
445 445
 				if (!empty($object->members)) {
446 446
 					foreach ($object->members as $useringroup) {
Please login to merge, or discard this patch.
htdocs/user/card.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 $dateendvalidity = dol_mktime(0, 0, 0, GETPOSTINT('dateendvaliditymonth'), GETPOSTINT('dateendvalidityday'), GETPOSTINT('dateendvalidityyear'));
96 96
 $dateofbirth = dol_mktime(0, 0, 0, GETPOSTINT('dateofbirthmonth'), GETPOSTINT('dateofbirthday'), GETPOSTINT('dateofbirthyear'));
97 97
 
98
-$childids = $user->getAllChildIds(1);	// For later, test on salary visibility
98
+$childids = $user->getAllChildIds(1); // For later, test on salary visibility
99 99
 
100 100
 $object = new User($db);
101 101
 $extrafields = new ExtraFields($db);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 			if (!$error) {
449 449
 				$object->fetch($id);
450 450
 
451
-				$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
451
+				$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
452 452
 
453 453
 				$db->begin();
454 454
 
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 						}
574 574
 					}
575 575
 
576
-					$ret = $object->update($user);		// This may include call to setPassword if password has changed
576
+					$ret = $object->update($user); // This may include call to setPassword if password has changed
577 577
 					if ($ret < 0) {
578 578
 						$error++;
579 579
 						if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 				$object->fetch($id);
688 688
 
689 689
 				if (GETPOST("password", "password")) {	// If pass is empty, we do not change it.
690
-					$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
690
+					$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
691 691
 
692 692
 					$ret = $object->setPassword($user, GETPOST("password", "password"));
693 693
 					if (is_int($ret) && $ret < 0) {
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 	) {
705 705
 		$object->fetch($id);
706 706
 
707
-		$newpassword = $object->setPassword($user, '');	// This will generate a new password
707
+		$newpassword = $object->setPassword($user, ''); // This will generate a new password
708 708
 		if (is_int($newpassword) && $newpassword < 0) {
709 709
 			// Echec
710 710
 			setEventMessages($langs->trans("ErrorFailedToSetNewPassword"), null, 'errors');
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
 						$action = "";
833 833
 
834 834
 						$mesg = $langs->trans("ErrorProductAlreadyExists", $clone->ref);
835
-						$mesg .= ' <a href="' . $_SERVER["PHP_SELF"] . '?ref=' . $clone->ref . '">' . $langs->trans("ShowCardHere") . '</a>.';
835
+						$mesg .= ' <a href="'.$_SERVER["PHP_SELF"].'?ref='.$clone->ref.'">'.$langs->trans("ShowCardHere").'</a>.';
836 836
 						setEventMessages($mesg, null, 'errors');
837 837
 					} else {
838 838
 						setEventMessages(empty($clone->error) ? '' : $langs->trans($clone->error), $clone->errors, 'errors');
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 				} else {
847 847
 					$db->commit();
848 848
 					$db->close();
849
-					header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
849
+					header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
850 850
 					exit;
851 851
 				}
852 852
 			} else {
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
 			$ldap = new Ldap();
1552 1552
 			$result = $ldap->connectBind();
1553 1553
 			if ($result > 0) {
1554
-				$userSearchFilter = '(' . getDolGlobalString('LDAP_FILTER_CONNECTION').'('.$ldap->getUserIdentifier().'='.$object->login.'))';
1554
+				$userSearchFilter = '('.getDolGlobalString('LDAP_FILTER_CONNECTION').'('.$ldap->getUserIdentifier().'='.$object->login.'))';
1555 1555
 				$entries = $ldap->fetch($object->login, $userSearchFilter);
1556 1556
 				if (!$entries) {
1557 1557
 					setEventMessages($ldap->error, $ldap->errors, 'errors');
@@ -2069,7 +2069,7 @@  discard block
 block discarded – undo
2069 2069
 				print '<td>';
2070 2070
 				if (!empty($object->api_key)) {
2071 2071
 					print '<span class="opacitymedium">';
2072
-					print showValueWithClipboardCPButton($object->api_key, 1, $langs->transnoentities("Hidden"));		// TODO Add an option to also reveal the hash, not only copy paste
2072
+					print showValueWithClipboardCPButton($object->api_key, 1, $langs->transnoentities("Hidden")); // TODO Add an option to also reveal the hash, not only copy paste
2073 2073
 					print '</span>';
2074 2074
 				}
2075 2075
 				print '</td></tr>';
@@ -2130,7 +2130,7 @@  discard block
 block discarded – undo
2130 2130
 						$langs->load("mails");
2131 2131
 						$params['attr']['title'] = $langs->trans('NoEMail');
2132 2132
 					}
2133
-					print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=presend&mode=init#formmailbeforetitle', '', $canSendMail, $params);
2133
+					print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', $canSendMail, $params);
2134 2134
 				}
2135 2135
 
2136 2136
 				if ($permissiontoedit && (!isModEnabled('multicompany') || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) {
@@ -2195,13 +2195,13 @@  discard block
 block discarded – undo
2195 2195
 				if ($user->id != $id && $permissiontodisable && $object->statut == 0 &&
2196 2196
 				((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) {
2197 2197
 					unset($params['attr']['title']);
2198
-					print dolGetButtonAction($langs->trans('Reactivate'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=enable&token='.newToken(), '', true, $params);
2198
+					print dolGetButtonAction($langs->trans('Reactivate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', true, $params);
2199 2199
 				}
2200 2200
 				// Disable user
2201 2201
 				if ($user->id != $id && $permissiontodisable && $object->statut == 1 &&
2202 2202
 				((!isModEnabled('multicompany') && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || (getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE') && $object->entity == 1))) {
2203 2203
 					unset($params['attr']['title']);
2204
-					print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=disable&token='.newToken(), '', true, $params);
2204
+					print dolGetButtonAction($langs->trans('DisableUser'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', true, $params);
2205 2205
 				} else {
2206 2206
 					if ($user->id == $id) {
2207 2207
 						$params['attr']['title'] = $langs->trans('CantDisableYourself');
Please login to merge, or discard this patch.
htdocs/website/index.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 	$algo .= 'sitefiles';
342 342
 }
343 343
 
344
-$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid');	// or 'none', must be same as $searchstring
344
+$searchkey = GETPOST('searchstring', 'restricthtmlallowunvalid'); // or 'none', must be same as $searchstring
345 345
 
346 346
 if ($sortfield == '') {
347 347
 	if ($action == 'file_manager') {	// Test on permission not required
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 }
370 370
 
371 371
 $usercanedit = $user->hasRight('website', 'write');
372
-$permissiontoadd = $user->hasRight('website', 'write');	// Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
372
+$permissiontoadd = $user->hasRight('website', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
373 373
 $permissiontodelete = $user->hasRight('website', 'delete');
374 374
 
375 375
 
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 if ($sortorder) {
437 437
 	$backtopage .= '&sortorder='.urlencode($sortorder);
438 438
 }
439
-include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';	// This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file.
439
+include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; // This manage 'sendit', 'confirm_deletefile', 'renamefile' action when submitting new file.
440 440
 
441 441
 $backtopage = $savbacktopage;
442 442
 //var_dump($backtopage);
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 
602 602
 // Replacement of string into pages
603 603
 if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) {
604
-	$replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid');	// or 'none', must be same then $searchstring
604
+	$replacestring = GETPOST('replacestring', 'restricthtmlallowunvalid'); // or 'none', must be same then $searchstring
605 605
 
606 606
 	$dolibarrdataroot = preg_replace('/([\\/]+)$/i', '', DOL_DATA_ROOT);
607 607
 	$allowimportsite = true;
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 		$objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha');
1176 1176
 		$objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml'));
1177 1177
 		$objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0;
1178
-		$objectpage->htmlheader = GETPOST('htmlheader', 'none');	// Must accept tags like '<script>' and '<link>'
1178
+		$objectpage->htmlheader = GETPOST('htmlheader', 'none'); // Must accept tags like '<script>' and '<link>'
1179 1179
 		$objectpage->author_alias = GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml');
1180 1180
 		$objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS');
1181 1181
 		$objectpage->fk_object = GETPOST('WEBSITE_OBJECTID');
@@ -1208,7 +1208,7 @@  discard block
 block discarded – undo
1208 1208
 		$content = '';
1209 1209
 		if (GETPOSTISSET('content')) {
1210 1210
 			//$content = GETPOST('content', 'restricthtmlallowunvalid');	// @TODO Use a restricthtmlallowunvalidwithphp
1211
-			$content = GETPOST('content', 'none');	// @TODO Use a restricthtmlallowunvalidwithphp
1211
+			$content = GETPOST('content', 'none'); // @TODO Use a restricthtmlallowunvalidwithphp
1212 1212
 
1213 1213
 			$objectpage->content = make_substitutions($content, $substitutionarray);
1214 1214
 		} else {
@@ -1586,7 +1586,7 @@  discard block
 block discarded – undo
1586 1586
 					$error++;
1587 1587
 					setEventMessages($langs->trans('ErrorFaviconMustBeASquaredImage'), array(), 'errors');
1588 1588
 				}
1589
-				if (! $error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) {
1589
+				if (!$error && ($filesize[0] != 16 && $filesize[0] != 32 && $filesize[0] != 64)) {
1590 1590
 					$error++;
1591 1591
 					setEventMessages($langs->trans('ErrorFaviconSize'), array(), 'errors');
1592 1592
 				}
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
 				if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
1599 1599
 					$action = 'preview';
1600 1600
 					if ($backtopage) {
1601
-						$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
1601
+						$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
1602 1602
 						header("Location: ".$backtopage);
1603 1603
 						exit;
1604 1604
 					}
@@ -1622,7 +1622,7 @@  discard block
 block discarded – undo
1622 1622
 			}
1623 1623
 
1624 1624
 
1625
-			$dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript'));		// Must accept tags like '<script>' and '<link>'
1625
+			$dataposted = trim(GETPOST('WEBSITE_HTML_HEADER', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>'
1626 1626
 
1627 1627
 			$dataposted = preg_replace(array('/<html>\n*/ims', '/<\/html>\n*/ims'), array('', ''), $dataposted);
1628 1628
 			$dataposted = str_replace('<?=', '<?php', $dataposted);
@@ -1632,7 +1632,7 @@  discard block
 block discarded – undo
1632 1632
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1633 1633
 
1634 1634
 			// Security analysis
1635
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1635
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1636 1636
 
1637 1637
 			if (!$errorphpcheck) {
1638 1638
 				$htmlheadercontent = '';
@@ -1670,7 +1670,7 @@  discard block
 block discarded – undo
1670 1670
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1671 1671
 
1672 1672
 			// Security analysis
1673
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1673
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1674 1674
 
1675 1675
 			if (!$errorphpcheck) {
1676 1676
 				$csscontent = '';
@@ -1713,7 +1713,7 @@  discard block
 block discarded – undo
1713 1713
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1714 1714
 
1715 1715
 			// Security analysis
1716
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1716
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1717 1717
 
1718 1718
 			if (!$errorphpcheck) {
1719 1719
 				$jscontent = '';
@@ -1751,7 +1751,7 @@  discard block
 block discarded – undo
1751 1751
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1752 1752
 
1753 1753
 			// Security analysis
1754
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1754
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1755 1755
 
1756 1756
 			if (!$errorphpcheck) {
1757 1757
 				$robotcontent = '';
@@ -1789,7 +1789,7 @@  discard block
 block discarded – undo
1789 1789
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1790 1790
 
1791 1791
 			// Security analysis
1792
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1792
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1793 1793
 
1794 1794
 			if (!$errorphpcheck) {
1795 1795
 				if ($dataposted) {
@@ -1817,7 +1817,7 @@  discard block
 block discarded – undo
1817 1817
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1818 1818
 
1819 1819
 			// Security analysis
1820
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1820
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1821 1821
 
1822 1822
 			if (!$errorphpcheck) {
1823 1823
 				$manifestjsoncontent = '';
@@ -1856,7 +1856,7 @@  discard block
 block discarded – undo
1856 1856
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1857 1857
 
1858 1858
 			// Security analysis
1859
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1859
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1860 1860
 
1861 1861
 			if (!$errorphpcheck) {
1862 1862
 				$readmecontent = '';
@@ -1895,7 +1895,7 @@  discard block
 block discarded – undo
1895 1895
 			$phpfullcodestring = dolKeepOnlyPhpCode($dataposted);
1896 1896
 
1897 1897
 			// Security analysis
1898
-			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring);	// Contains the setEventMessages
1898
+			$errorphpcheck = checkPHPCode($phpfullcodestringold, $phpfullcodestring); // Contains the setEventMessages
1899 1899
 
1900 1900
 			if (!$errorphpcheck) {
1901 1901
 				$licensecontent = '';
@@ -1937,7 +1937,7 @@  discard block
 block discarded – undo
1937 1937
 			if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
1938 1938
 				$action = 'preview';
1939 1939
 				if ($backtopage) {
1940
-					$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
1940
+					$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
1941 1941
 					header("Location: ".$backtopage);
1942 1942
 					exit;
1943 1943
 				}
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
 			$sourcestring = "";
1995 1995
 			foreach ($sourcekeys as $key => $source) {
1996 1996
 				if (is_array($source)) {
1997
-					$sourcestring .= " data: ". implode(" ", $source);
1997
+					$sourcestring .= " data: ".implode(" ", $source);
1998 1998
 				} else {
1999 1999
 					$directivetype = $directivesarray[$directive]["data-directivetype"];
2000 2000
 					$sourcetype = $sourcesarray[$directivetype][$source]["data-sourcetype"];
@@ -2005,7 +2005,7 @@  discard block
 block discarded – undo
2005 2005
 					}
2006 2006
 				}
2007 2007
 			}
2008
-			$securityspstring .= $directive . $sourcestring;
2008
+			$securityspstring .= $directive.$sourcestring;
2009 2009
 		}
2010 2010
 		$res = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSP', $securityspstring, 'chaine', 0, '', $conf->entity);
2011 2011
 		if ($res <= 0) {
@@ -2050,7 +2050,7 @@  discard block
 block discarded – undo
2050 2050
 	if (!GETPOSTISSET('updateandstay')) {	// If we click on "Save And Stay", we don not make the redirect
2051 2051
 		$action = 'preview';
2052 2052
 		if ($backtopage) {
2053
-			$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage);	// Clean backtopage url
2053
+			$backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url
2054 2054
 			header("Location: ".$backtopage);
2055 2055
 			exit;
2056 2056
 		}
@@ -2068,7 +2068,7 @@  discard block
 block discarded – undo
2068 2068
 
2069 2069
 	$object->fk_default_home = $pageid;
2070 2070
 	$res = $object->update($user);
2071
-	if (! ($res > 0)) {
2071
+	if (!($res > 0)) {
2072 2072
 		$error++;
2073 2073
 		setEventMessages($object->error, $object->errors, 'errors');
2074 2074
 	}
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
 		$objectpage->image = GETPOST('WEBSITE_IMAGE', 'alpha');
2184 2184
 		$objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml'));
2185 2185
 		$objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09') ? 1 : 0;
2186
-		$objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript'));		// Must accept tags like '<script>' and '<link>'
2186
+		$objectpage->htmlheader = trim(GETPOST('htmlheader', 'restricthtmlallowlinkscript')); // Must accept tags like '<script>' and '<link>'
2187 2187
 		$objectpage->fk_page = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0);
2188 2188
 		$objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml'));
2189 2189
 		$objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha');
@@ -2462,7 +2462,7 @@  discard block
 block discarded – undo
2462 2462
 
2463 2463
 			$phpfullcodestringold = dolKeepOnlyPhpCode($objectpage->content);
2464 2464
 
2465
-			$objectpage->content = GETPOST('PAGE_CONTENT', 'none');	// any HTML content allowed
2465
+			$objectpage->content = GETPOST('PAGE_CONTENT', 'none'); // any HTML content allowed
2466 2466
 
2467 2467
 			$phpfullcodestring = dolKeepOnlyPhpCode($objectpage->content);
2468 2468
 
@@ -2685,7 +2685,7 @@  discard block
 block discarded – undo
2685 2685
 				$fileofzip = '';
2686 2686
 				if (GETPOSTISSET('templateuserfile')) {
2687 2687
 					// Case we selected one template
2688
-					$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha');	// $fileofzip will be sanitized later into the importWebSite()
2688
+					$fileofzip = DOL_DATA_ROOT.'/doctemplates/websites/'.GETPOST('templateuserfile', 'alpha'); // $fileofzip will be sanitized later into the importWebSite()
2689 2689
 				} elseif (!empty($_FILES) && is_array($_FILES['userfile'])) {
2690 2690
 					// Case we upload a new template
2691 2691
 					if (is_array($_FILES['userfile']['tmp_name'])) {
@@ -2767,7 +2767,7 @@  discard block
 block discarded – undo
2767 2767
 	if ($website->virtualhost) {
2768 2768
 		$domainname = $website->virtualhost;
2769 2769
 	}
2770
-	if (! preg_match('/^http/i', $domainname)) {
2770
+	if (!preg_match('/^http/i', $domainname)) {
2771 2771
 		$domainname = 'https://'.$domainname;
2772 2772
 	}
2773 2773
 
@@ -2833,7 +2833,7 @@  discard block
 block discarded – undo
2833 2833
 				$url->appendChild($lastmod);
2834 2834
 				// Add suggested frequency for refresh
2835 2835
 				if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) {
2836
-					$changefreq = $domtree->createElement('changefreq', 'weekly');	// TODO Manage other values
2836
+					$changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values
2837 2837
 					$url->appendChild($changefreq);
2838 2838
 				}
2839 2839
 				// Add higher priority for home page
@@ -2938,7 +2938,7 @@  discard block
 block discarded – undo
2938 2938
 				$url->appendChild($lastmod);
2939 2939
 				// Add suggested frequency for refresh
2940 2940
 				if (getDolGlobalString('WEBSITE_SITEMAPS_ADD_WEEKLY_FREQ')) {
2941
-					$changefreq = $domtree->createElement('changefreq', 'weekly');	// TODO Manage other values
2941
+					$changefreq = $domtree->createElement('changefreq', 'weekly'); // TODO Manage other values
2942 2942
 					$url->appendChild($changefreq);
2943 2943
 				}
2944 2944
 
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
 			$sourcestring = "";
3029 3029
 			foreach ($sourcekeys as $key => $source) {
3030 3030
 				if (is_array($source)) {
3031
-					$sourcestring .= " data: ". implode(" ", $source);
3031
+					$sourcestring .= " data: ".implode(" ", $source);
3032 3032
 				} else {
3033 3033
 					$directivetype = $directivesarray[$directive]["data-directivetype"];
3034 3034
 					$sourcetype = $sourcesarray[$directivetype][$source]["data-sourcetype"];
@@ -3039,7 +3039,7 @@  discard block
 block discarded – undo
3039 3039
 					}
3040 3040
 				}
3041 3041
 			}
3042
-			$securityspstring .= $directive . $sourcestring;
3042
+			$securityspstring .= $directive.$sourcestring;
3043 3043
 		}
3044 3044
 		$res = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSP', $securityspstring, 'chaine', 0, '', $conf->entity);
3045 3045
 		if ($res <= 0) {
@@ -3311,11 +3311,11 @@  discard block
 block discarded – undo
3311 3311
 
3312 3312
 			// // Export web site
3313 3313
 			$extraCssClass = getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE') ? 'hideobject' : '';
3314
-			print '<input type="submit" class="button bordertransp ' . $extraCssClass . '" ' . $disabledexport . ' value="' . dol_escape_htmltag($exportlabel) . '" name="exportsite">';
3314
+			print '<input type="submit" class="button bordertransp '.$extraCssClass.'" '.$disabledexport.' value="'.dol_escape_htmltag($exportlabel).'" name="exportsite">';
3315 3315
 
3316 3316
 			if (getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')) {
3317 3317
 				// Overwrite template in sources
3318
-				$overwriteGitUrl = $_SERVER["PHP_SELF"] . '?action=overwritesite&website=' . urlencode($website->ref);
3318
+				$overwriteGitUrl = $_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref);
3319 3319
 				print dolButtonToOpenExportDialog('exportpopup', $langs->trans('ExportOptions'), $langs->trans('ExportSite'), 'exportsite', $overwriteGitUrl, $website);
3320 3320
 				//print '<a href="'.$_SERVER["PHP_SELF"].'?action=overwritesite&website='.urlencode($website->ref).'" class="button bordertransp hideobject" title="'.dol_escape_htmltag($langs->trans("ExportIntoGIT").". Directory ".getDolGlobalString('WEBSITE_ALLOW_OVERWRITE_GIT_SOURCE')).'">'.dol_escape_htmltag($langs->trans("ExportIntoGIT")).'</a>';
3321 3321
 			}
@@ -3700,7 +3700,7 @@  discard block
 block discarded – undo
3700 3700
 				print '<!-- button EditInLine and ShowSubcontainers -->'."\n";
3701 3701
 				print '<div class="websiteselectionsection inline-block">';
3702 3702
 
3703
-				print '<div class="inline-block marginrightonly">';	// Button includes dynamic content
3703
+				print '<div class="inline-block marginrightonly">'; // Button includes dynamic content
3704 3704
 				print $langs->trans("ShowSubcontainers");
3705 3705
 				if (!getDolGlobalString('WEBSITE_SUBCONTAINERSINLINE')) {
3706 3706
 					print '<a class="nobordertransp nohoverborder marginleftonlyshort valignmiddle"'.$disabled.' href="'.$_SERVER["PHP_SELF"].'?website='.$object->ref.'&pageid='.$websitepage->id.'&action=setshowsubcontainers&token='.newToken().'">'.img_picto($langs->trans("ShowSubContainersOnOff", $langs->transnoentitiesnoconv("Off")), 'switch_off', '', 0, 0, 0, '', 'nomarginleft').'</a>';
@@ -3709,7 +3709,7 @@  discard block
 block discarded – undo
3709 3709
 				}
3710 3710
 				print '</div>';
3711 3711
 
3712
-				print '<div class="inline-block marginrightonly">';	// Button edit inline
3712
+				print '<div class="inline-block marginrightonly">'; // Button edit inline
3713 3713
 
3714 3714
 				print '<span id="switchckeditorinline">'."\n";
3715 3715
 				// Enable CKEditor inline with js on section and div with conteneditable=true
@@ -3809,15 +3809,15 @@  discard block
 block discarded – undo
3809 3809
 													// Sending data via AJAX to update section
3810 3810
 													$.ajax({
3811 3811
 														type: \'POST\',
3812
-														url: \'' . DOL_URL_ROOT . '/core/ajax/editinline.php\',
3812
+														url: \'' . DOL_URL_ROOT.'/core/ajax/editinline.php\',
3813 3813
 														data: {
3814 3814
 															website_ref: \''.dol_escape_js($website->ref).'\',
3815
-															page_id: \'' . ((int) $websitepage->id) . '\',
3815
+															page_id: \'' . ((int) $websitepage->id).'\',
3816 3816
 															content: content,
3817 3817
 															element_id: elementId,
3818 3818
 															element_type: elementType,
3819 3819
 															action: \'updatedElementContent\',
3820
-															token: \'' . newToken() . '\'
3820
+															token: \'' . newToken().'\'
3821 3821
 														},
3822 3822
 														success: function(response) {
3823 3823
 															console.log(response);
@@ -3908,7 +3908,7 @@  discard block
 block discarded – undo
3908 3908
 				} else {
3909 3909
 					$disabled = '';
3910 3910
 					$title = '';
3911
-					$url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref);	// action=delete for webpage, deletesite for website
3911
+					$url = $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&pageid='.((int) $websitepage->id).'&website='.urlencode($website->ref); // action=delete for webpage, deletesite for website
3912 3912
 				}
3913 3913
 				print '<a href="'.$url.'" class="button buttonDelete bordertransp'.($disabled ? ' disabled' : '').'"'.$disabled.' title="'.dol_escape_htmltag($title).'">'.img_picto('', 'delete', 'class=""').'<span class="hideonsmartphone paddingleft">'.$langs->trans("Delete").'</span></a>';
3914 3914
 				print '</span>';
@@ -4101,7 +4101,7 @@  discard block
 block discarded – undo
4101 4101
 		// Clean the php htmlheader file to remove php code and get only html part
4102 4102
 		$htmlheadercontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htmlheadercontent);
4103 4103
 	} else {
4104
-		$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none');		// Must accept tags like '<script>' and '<link>'
4104
+		$htmlheadercontent = GETPOST('WEBSITE_HTML_HEADER', 'none'); // Must accept tags like '<script>' and '<link>'
4105 4105
 	}
4106 4106
 	if (!trim($htmlheadercontent)) {
4107 4107
 		$htmlheadercontent = "<html>\n";
@@ -4132,7 +4132,7 @@  discard block
 block discarded – undo
4132 4132
 		// Clean the php htaccesscontent file to remove php code and get only html part
4133 4133
 		$htaccesscontent = preg_replace('/<\?php \/\/ BEGIN PHP[^\?]*END PHP( \?>)?\n*/ims', '', $htaccesscontent);
4134 4134
 	} else {
4135
-		$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml');	// We must use 'nohtml' and not 'alphanohtml' because we must accept "
4135
+		$htaccesscontent = GETPOST('WEBSITE_HTACCESS', 'nohtml'); // We must use 'nohtml' and not 'alphanohtml' because we must accept "
4136 4136
 	}
4137 4137
 
4138 4138
 	if (!GETPOSTISSET('WEBSITE_MANIFEST_JSON')) {
@@ -4232,7 +4232,7 @@  discard block
 block discarded – undo
4232 4232
 	$maxfilesizearray = getMaxFileSizeArray();
4233 4233
 	$maxmin = $maxfilesizearray['maxmin'];
4234 4234
 	if ($maxmin > 0) {
4235
-		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
4235
+		print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
4236 4236
 	}
4237 4237
 	print '<input type="file" class="flat minwidth300" name="addedfile" id="addedfile"/>';
4238 4238
 
@@ -4274,7 +4274,7 @@  discard block
 block discarded – undo
4274 4274
 	print '<tr><td class="tdtop">';
4275 4275
 	print $langs->trans('WEBSITE_HTML_HEADER');
4276 4276
 	$htmlhelp = $langs->trans("Example").' :<br>';
4277
-	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault));	// do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4277
+	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
4278 4278
 	$textwithhelp = $form->textwithpicto('', $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
4279 4279
 	$htmlhelp2 = $langs->trans("LinkAndScriptsHereAreNotLoadedInEditor").'<br>';
4280 4280
 	print $form->textwithpicto($textwithhelp, $htmlhelp2, 1, 'warning', '', 0, 2, 'htmlheadertooltip2');
@@ -4641,7 +4641,7 @@  discard block
 block discarded – undo
4641 4641
 		$maxfilesizearray = getMaxFileSizeArray();
4642 4642
 		$maxmin = $maxfilesizearray['maxmin'];
4643 4643
 		if ($maxmin > 0) {
4644
-			print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
4644
+			print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
4645 4645
 		}
4646 4646
 		print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">';
4647 4647
 		print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">';
@@ -5164,7 +5164,7 @@  discard block
 block discarded – undo
5164 5164
 	print '<tr><td class="tdhtmlheader tdtop">';
5165 5165
 	$htmlhelp = $langs->trans("EditTheWebSiteForACommonHeader").'<br><br>';
5166 5166
 	$htmlhelp .= $langs->trans("Example").' :<br>';
5167
-	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault));	// do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
5167
+	$htmlhelp .= dol_nl2br(dol_htmlentities($htmlheadercontentdefault)); // do not use dol_htmlentitiesbr here, $htmlheadercontentdefault is HTML with content like <link> and <script> that we want to be html encode as they must be show as doc content not executable instruction.
5168 5168
 	print $form->textwithpicto($langs->transnoentitiesnoconv('HtmlHeaderPage'), $htmlhelp, 1, 'help', '', 0, 2, 'htmlheadertooltip');
5169 5169
 	print '</td><td>';
5170 5170
 	$poscursor = array('x' => GETPOST('htmlheader_x'), 'y' => GETPOST('htmlheader_y'));
@@ -5301,7 +5301,7 @@  discard block
 block discarded – undo
5301 5301
 	print '<div class="fiche"><br>';
5302 5302
 
5303 5303
 	$module = 'medias';
5304
-	$formalreadyopen = 2;	// So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php
5304
+	$formalreadyopen = 2; // So the form to submit a new file will not be open another time inside the core/tpl/filemanager.tpl.php
5305 5305
 	if (empty($url)) {
5306 5306
 		$url = DOL_URL_ROOT.'/website/index.php'; // Must be an url without param
5307 5307
 	}
@@ -5538,8 +5538,8 @@  discard block
 block discarded – undo
5538 5538
 			print getTitleFieldOfList("Categories", 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
5539 5539
 			print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
5540 5540
 			print getTitleFieldOfList("UserCreation", 0, $_SERVER['PHP_SELF'], 'fk_user_creat', '', $param, '', $sortfield, $sortorder, '')."\n";
5541
-			print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n";		// Date creation
5542
-			print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n";		// Date last modif
5541
+			print getTitleFieldOfList("DateCreation", 0, $_SERVER['PHP_SELF'], 'date_creation', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date creation
5542
+			print getTitleFieldOfList("DateLastModification", 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n"; // Date last modif
5543 5543
 			print getTitleFieldOfList("", 0, $_SERVER['PHP_SELF']);
5544 5544
 			// Action column
5545 5545
 			if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
Please login to merge, or discard this patch.
htdocs/core/ajax/editinline.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	$objectpage = new WebsitePage($db);
76 76
 	$res = $objectpage->fetch((int) $page_id);
77 77
 	if (!$res) {
78
-		print "Cannot find page with ID = " . $page_id . ".";
78
+		print "Cannot find page with ID = ".$page_id.".";
79 79
 		exit;
80 80
 	}
81 81
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	$objectwebsite = new Website($db);
84 84
 	$res = $objectwebsite->fetch($objectpage->fk_website);
85 85
 	if (!$res) {
86
-		print "Cannot find website with REF " . $objectpage->fk_website . ".";
86
+		print "Cannot find website with REF ".$objectpage->fk_website.".";
87 87
 		exit;
88 88
 	}
89 89
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	$error = 0;
92 92
 
93 93
 	// Replace element content into database and tpl file
94
-	$objectpage->content = preg_replace('/<' . $element_type . '[^>]*id="' . $element_id . '"[^>]*>\K(.*?)(?=<\/' . $element_type . '>)/s', $content, $objectpage->content, 1);
94
+	$objectpage->content = preg_replace('/<'.$element_type.'[^>]*id="'.$element_id.'"[^>]*>\K(.*?)(?=<\/'.$element_type.'>)/s', $content, $objectpage->content, 1);
95 95
 	$res = $objectpage->update($user);
96 96
 	if ($res) {
97 97
 		global $dolibarr_main_data_root;
@@ -100,17 +100,17 @@  discard block
 block discarded – undo
100 100
 
101 101
 		$result = dolSavePageContent($filetpl, $objectwebsite, $objectpage, 1);
102 102
 		if (!$result) {
103
-			print "Failed to write file " . $filetpl . ".";
103
+			print "Failed to write file ".$filetpl.".";
104 104
 			$error++;
105 105
 		}
106 106
 	} else {
107
-		print "Failed to save changes error " . $objectpage->error . ".";
107
+		print "Failed to save changes error ".$objectpage->error.".";
108 108
 		$error++;
109 109
 	}
110 110
 
111 111
 	if (!$error) {
112 112
 		$db->commit();
113
-		print "Changes are saved for " . $element_type . " with id " . $element_id;
113
+		print "Changes are saved for ".$element_type." with id ".$element_id;
114 114
 	} else {
115 115
 		$db->rollback();
116 116
 	}
Please login to merge, or discard this patch.
htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 								$body_assignee = 'TicketAssignedEmailBody';
87 87
 								$see_ticket_assignee = 'SeeThisTicketIntomanagementInterface';
88 88
 
89
-								$old_MAIN_MAIL_AUTOCOPY_TO = null;  // For static analysis
89
+								$old_MAIN_MAIL_AUTOCOPY_TO = null; // For static analysis
90 90
 								if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO')) {
91 91
 									$old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('MAIN_MAIL_AUTOCOPY_TO');
92 92
 									$conf->global->MAIN_MAIL_AUTOCOPY_TO = '';
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 									 * @param array{source:string,id:int,rowid:int,email:string,civility:string,firstname:string,lastname:string,labeltype:string,libelle:string,socid:int,code:string,status:int,statuscontact:int,fk_c_typecontact:int,phone:string,phone_mobile:string,phone_perso?:string,nom:string} $contact
315 315
 									 * @return bool
316 316
 									 */
317
-									static function ($contact) {
317
+									static function($contact) {
318 318
 										return in_array($contact['source'], ['external', 'thirdparty']);
319 319
 									}
320 320
 								),
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 						}
334 334
 
335 335
 						if ($contactObj === null) {
336
-							$error_msg = $langs->trans('Error'). ': ';
336
+							$error_msg = $langs->trans('Error').': ';
337 337
 							$error_msg .= $langs->transnoentities('TicketWrongContact');
338 338
 							setEventMessages($error_msg, [], 'errors');
339 339
 							$ok = 0;
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 		$message_admin .= '<p>'.$langs->trans('Message').' : <br><br>'.$message.'</p><br>';
417 417
 		$message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
418 418
 
419
-		$from = (getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' ' : '') . '<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
419
+		$from = (getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' ' : '').'<'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
420 420
 
421 421
 		$trackid = 'tic'.$object->id;
422 422
 
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 				}
488 488
 
489 489
 				if ($qualified) {
490
-					$message_customer .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
490
+					$message_customer .= '<li>'.$langs->trans($key).' : '.$value.'</li>';
491 491
 				}
492 492
 			}
493 493
 		}
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 			$message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmailNoInterface').'</p>';
509 509
 		}
510 510
 
511
-		$from = (getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' ' : '').'<' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
511
+		$from = (getDolGlobalString('MAIN_INFO_SOCIETE_NOM') ? getDolGlobalString('MAIN_INFO_SOCIETE_NOM').' ' : '').'<'.getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>';
512 512
 
513 513
 		$trackid = 'tic'.$object->id;
514 514
 
Please login to merge, or discard this patch.
htdocs/core/modules/societe/mod_codecompta_aquarium.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 		$texte .= '<input type="hidden" name="param1" value="COMPANY_AQUARIUM_MASK_SUPPLIER">';
110 110
 		$texte .= '<input type="hidden" name="param2" value="COMPANY_AQUARIUM_MASK_CUSTOMER">';
111 111
 		$texte .= '<table class="nobordernopadding" width="100%">';
112
-		$s1 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value1" value="' . getDolGlobalString('COMPANY_AQUARIUM_MASK_SUPPLIER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name);
113
-		$s2 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value2" value="' . getDolGlobalString('COMPANY_AQUARIUM_MASK_CUSTOMER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name);
112
+		$s1 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value1" value="'.getDolGlobalString('COMPANY_AQUARIUM_MASK_SUPPLIER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name);
113
+		$s2 = $form->textwithpicto('<input type="text" class="flat" size="4" name="value2" value="'.getDolGlobalString('COMPANY_AQUARIUM_MASK_CUSTOMER').'">', $tooltip, 1, 'help', 'valignmiddle', 0, 3, $this->name);
114 114
 		$texte .= '<tr><td>';
115 115
 		// trans remove html entities
116 116
 		$texte .= $langs->trans("ModuleCompanyCodeCustomer".$this->name, '{s2}')."<br>\n";
@@ -121,11 +121,11 @@  discard block
 block discarded – undo
121 121
 			$texte .= $langs->trans('RemoveSpecialChars').' = '.yn(1)."<br>\n";
122 122
 		}
123 123
 		if (getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX')) {
124
-			$texte .= $langs->trans('COMPANY_AQUARIUM_CLEAN_REGEX').' = ' . getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX')."<br>\n";
124
+			$texte .= $langs->trans('COMPANY_AQUARIUM_CLEAN_REGEX').' = '.getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX')."<br>\n";
125 125
 		}
126 126
 
127 127
 		if (getDolGlobalString('COMPANY_AQUARIUM_NO_PREFIX')) {
128
-			$texte .= $langs->trans('COMPANY_AQUARIUM_NO_PREFIX').' = ' . getDolGlobalString('COMPANY_AQUARIUM_NO_PREFIX')."<br>\n";
128
+			$texte .= $langs->trans('COMPANY_AQUARIUM_NO_PREFIX').' = '.getDolGlobalString('COMPANY_AQUARIUM_NO_PREFIX')."<br>\n";
129 129
 		}
130 130
 		$texte .= '</td>';
131 131
 		$texte .= '<td class="right"><input type="submit" class="button button-edit reposition smallpaddingimp" name="modify" value="'.$langs->trans("Modify").'"></td>';
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		}
197 197
 		// Apply a regex replacement pattern on code if COMPANY_AQUARIUM_CLEAN_REGEX is set. Value must be a regex with parenthesis. The part into parenthesis is kept, the rest removed.
198 198
 		if (getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX')) {	// Example: $conf->global->COMPANY_AQUARIUM_CLEAN_REGEX='^..(..)..';
199
-			$codetouse = preg_replace('/' . getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX').'/', '\1\2\3', (string) $codetouse);
199
+			$codetouse = preg_replace('/'.getDolGlobalString('COMPANY_AQUARIUM_CLEAN_REGEX').'/', '\1\2\3', (string) $codetouse);
200 200
 		}
201 201
 
202 202
 		$codetouse = $prefix.strtoupper((string) $codetouse);
Please login to merge, or discard this patch.