Completed
Branch develop (533c32)
by
unknown
25:27
created
htdocs/user/class/user.class.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -586,8 +586,8 @@  discard block
 block discarded – undo
586 586
 			$sql .= " WHERE u.rowid = ".((int) $id);
587 587
 		} else {
588 588
 			if ($entity < 0) {
589
-				if ((! isModEnabled('multicompany') || ! getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) && (! empty($user->entity))) {
590
-					$sql .= " WHERE u.entity IN (0, " . ((int) $conf->entity) . ")";
589
+				if ((!isModEnabled('multicompany') || !getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) && (!empty($user->entity))) {
590
+					$sql .= " WHERE u.entity IN (0, ".((int) $conf->entity).")";
591 591
 				} else {
592 592
 					$sql .= " WHERE u.entity IS NOT NULL"; // multicompany is on in transverse mode or user making fetch is on entity 0, so user is allowed to fetch anywhere into database
593 593
 				}
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 					if ($entity != '' && $entity == 0) {    // If $entity = 0
600 600
 						$sql .= " WHERE u.entity = 0";
601 601
 					} else {                                // if $entity is -1 or > 0
602
-						$sql .= " WHERE u.entity IN (0, " . ((int) ($entity > 0 ? $entity : $conf->entity)) . ")";
602
+						$sql .= " WHERE u.entity IN (0, ".((int) ($entity > 0 ? $entity : $conf->entity)).")";
603 603
 					}
604 604
 				}
605 605
 			}
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 				$this->note_public = $obj->note_public;
694 694
 				$this->note_private = $obj->note_private;
695 695
 
696
-				$this->statut = $obj->status;			// deprecated
696
+				$this->statut = $obj->status; // deprecated
697 697
 				$this->status = $obj->status;
698 698
 
699 699
 				$this->photo = $obj->photo;
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
 			require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php';
838 838
 
839 839
 			$defaultValues = new DefaultValues($this->db);
840
-			$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)
840
+			$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)
841 841
 			//$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)
842 842
 
843 843
 			if (!is_array($result) && $result < 0) {
@@ -954,16 +954,16 @@  discard block
 block discarded – undo
954 954
 		// Special case for external user
955 955
 		if (!empty($this->socid)) {
956 956
 			if ($module == 'societe' && ($permlevel1 == 'creer' || $permlevel1 == 'write')) {
957
-				return 0;	// An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself)
957
+				return 0; // An external user never has the permission ->societe->write to see all thirdparties (always restricted to himself)
958 958
 			}
959 959
 			if ($module == 'societe' && $permlevel1 == 'client' && $permlevel2 == 'voir') {
960
-				return 0;	// An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
960
+				return 0; // An external user never has the permission ->societe->client->voir to see all thirdparties (always restricted to himself)
961 961
 			}
962 962
 			if ($module == 'societe' && $permlevel1 == 'export') {
963
-				return 0;	// An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself)
963
+				return 0; // An external user never has the permission ->societe->export to see all thirdparties (always restricted to himself)
964 964
 			}
965 965
 			if ($module == 'societe' && ($permlevel1 == 'supprimer' || $permlevel1 == 'delete')) {
966
-				return 0;	// An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself)
966
+				return 0; // An external user never has the permission ->societe->delete to see all thirdparties (always restricted to himself)
967 967
 			}
968 968
 		}
969 969
 
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
1112 1112
 			$sql .= " WHERE entity = ".((int) $entity);
1113 1113
 			if (!empty($whereforadd) && $whereforadd != 'allmodules') {
1114
-				$sql .= " AND (".$whereforadd.")";	// Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
1114
+				$sql .= " AND (".$whereforadd.")"; // Note: parenthesis are important because whereforadd can contains OR. Also note that $whereforadd is already sanitized
1115 1115
 			}
1116 1116
 
1117 1117
 			$sqldelete = "DELETE FROM ".$this->db->prefix()."user_rights";
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
 			$sql .= " FROM ".$this->db->prefix()."rights_def";
1248 1248
 			$sql .= " WHERE entity IN (".$this->db->sanitize($entity, 0, 0, 0, 0).")";
1249 1249
 			if (!empty($wherefordel) && $wherefordel != 'allmodules') {
1250
-				$sql .= " AND (".$wherefordel.")";	// Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1250
+				$sql .= " AND (".$wherefordel.")"; // Note: parenthesis are important because wherefordel can contains OR. Also note that $wherefordel is already sanitized
1251 1251
 			}
1252 1252
 
1253 1253
 			// avoid admin to remove his own important rights
@@ -1426,12 +1426,12 @@  discard block
 block discarded – undo
1426 1426
 					$sql .= " AND r.entity = ".((int) $conf->entity);
1427 1427
 				}
1428 1428
 			} else {
1429
-				$sql .= " AND gr.entity = ".((int) $conf->entity);	// Only groups created in current entity
1429
+				$sql .= " AND gr.entity = ".((int) $conf->entity); // Only groups created in current entity
1430 1430
 				// The entity on the table gu=usergroup_user should be useless and should never be used because it is already into gr and r.
1431 1431
 				// but when using MULTICOMPANY_TRANSVERSE_MODE, we may have inserted record that make rubbish result here due to the duplicate record of
1432 1432
 				// other entities, so we are forced to add a filter on gu here
1433 1433
 				$sql .= " AND gu.entity IN (0,".$conf->entity.")";
1434
-				$sql .= " AND r.entity = ".((int) $conf->entity);	// Only permission of modules enabled in current entity
1434
+				$sql .= " AND r.entity = ".((int) $conf->entity); // Only permission of modules enabled in current entity
1435 1435
 			}
1436 1436
 			// End of strange business rule
1437 1437
 			$sql .= " AND gr.fk_usergroup = gu.fk_usergroup";
@@ -1983,7 +1983,7 @@  discard block
 block discarded – undo
1983 1983
 		$this->civility_code = $member->civility_code;
1984 1984
 		$this->lastname     = $member->lastname;
1985 1985
 		$this->firstname    = $member->firstname;
1986
-		$this->gender		= $member->gender;
1986
+		$this->gender = $member->gender;
1987 1987
 		$this->email        = $member->email;
1988 1988
 		$this->fk_member    = $member->id;
1989 1989
 		$this->address      = $member->address;
@@ -2129,43 +2129,43 @@  discard block
 block discarded – undo
2129 2129
 		$this->national_registration_number = trim((string) $this->national_registration_number);
2130 2130
 		$this->employee						= ($this->employee > 0 ? $this->employee : 0);
2131 2131
 		$this->login						= trim((string) $this->login);
2132
-		$this->gender						= trim((string) $this->gender);
2132
+		$this->gender = trim((string) $this->gender);
2133 2133
 
2134 2134
 		$this->pass							= trim((string) $this->pass);
2135
-		$this->api_key						= trim((string) $this->api_key);
2136
-		$this->datestartvalidity			= empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
2137
-		$this->dateendvalidity				= empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
2135
+		$this->api_key = trim((string) $this->api_key);
2136
+		$this->datestartvalidity = empty($this->datestartvalidity) ? '' : $this->datestartvalidity;
2137
+		$this->dateendvalidity = empty($this->dateendvalidity) ? '' : $this->dateendvalidity;
2138 2138
 
2139
-		$this->address						= trim((string) $this->address);
2140
-		$this->zip							= trim((string) $this->zip);
2141
-		$this->town							= trim((string) $this->town);
2139
+		$this->address = trim((string) $this->address);
2140
+		$this->zip = trim((string) $this->zip);
2141
+		$this->town = trim((string) $this->town);
2142 2142
 
2143
-		$this->state_id						= ($this->state_id > 0 ? $this->state_id : 0);
2143
+		$this->state_id = ($this->state_id > 0 ? $this->state_id : 0);
2144 2144
 		$this->country_id					= ($this->country_id > 0 ? $this->country_id : 0);
2145
-		$this->office_phone					= trim((string) $this->office_phone);
2145
+		$this->office_phone = trim((string) $this->office_phone);
2146 2146
 		$this->office_fax					= trim((string) $this->office_fax);
2147
-		$this->user_mobile					= trim((string) $this->user_mobile);
2148
-		$this->personal_mobile				= trim((string) $this->personal_mobile);
2149
-		$this->email						= trim((string) $this->email);
2150
-		$this->personal_email				= trim((string) $this->personal_email);
2151
-
2152
-		$this->job							= trim((string) $this->job);
2153
-		$this->signature					= trim((string) $this->signature);
2154
-		$this->note_public					= trim((string) $this->note_public);
2155
-		$this->note_private					= trim((string) $this->note_private);
2156
-		$this->openid						= trim((string) $this->openid);
2157
-		$this->admin						= ($this->admin > 0 ? $this->admin : 0);
2147
+		$this->user_mobile = trim((string) $this->user_mobile);
2148
+		$this->personal_mobile = trim((string) $this->personal_mobile);
2149
+		$this->email = trim((string) $this->email);
2150
+		$this->personal_email = trim((string) $this->personal_email);
2151
+
2152
+		$this->job = trim((string) $this->job);
2153
+		$this->signature = trim((string) $this->signature);
2154
+		$this->note_public = trim((string) $this->note_public);
2155
+		$this->note_private = trim((string) $this->note_private);
2156
+		$this->openid = trim((string) $this->openid);
2157
+		$this->admin = ($this->admin > 0 ? $this->admin : 0);
2158 2158
 		$this->user_modification_id = $user->id;
2159 2159
 
2160 2160
 		$this->accountancy_code_user_general = trim((string) $this->accountancy_code_user_general);
2161 2161
 		$this->accountancy_code				= trim((string) $this->accountancy_code);
2162
-		$this->color						= trim(str_replace('#', '', (string) $this->color));
2163
-		$this->dateemployment				= empty($this->dateemployment) ? '' : $this->dateemployment;
2162
+		$this->color = trim(str_replace('#', '', (string) $this->color));
2163
+		$this->dateemployment = empty($this->dateemployment) ? '' : $this->dateemployment;
2164 2164
 		$this->dateemploymentend			= empty($this->dateemploymentend) ? '' : $this->dateemploymentend;
2165 2165
 
2166
-		$this->birth						= empty($this->birth) ? '' : $this->birth;
2167
-		$this->fk_warehouse					= (int) $this->fk_warehouse;
2168
-		$this->fk_establishment				= (int) $this->fk_establishment;
2166
+		$this->birth = empty($this->birth) ? '' : $this->birth;
2167
+		$this->fk_warehouse = (int) $this->fk_warehouse;
2168
+		$this->fk_establishment = (int) $this->fk_establishment;
2169 2169
 
2170 2170
 		$this->setUpperOrLowerCase();
2171 2171
 
@@ -2931,7 +2931,7 @@  discard block
 block discarded – undo
2931 2931
 		$sql .= " WHERE fk_user  = ".((int) $this->id);
2932 2932
 		$sql .= " AND fk_usergroup = ".((int) $group);
2933 2933
 		if (empty($entity)) {
2934
-			$sql .= " AND entity IN (0, 1)";	// group may be in entity 0 (so $entity=0) and link with user into entity 1.
2934
+			$sql .= " AND entity IN (0, 1)"; // group may be in entity 0 (so $entity=0) and link with user into entity 1.
2935 2935
 		} else {
2936 2936
 			$sql .= " AND entity = ".((int) $entity);
2937 2937
 		}
@@ -3167,9 +3167,9 @@  discard block
 block discarded – undo
3167 3167
 			$label = '';
3168 3168
 		}
3169 3169
 
3170
-		$baseurl = DOL_URL_ROOT . '/user/card.php';
3170
+		$baseurl = DOL_URL_ROOT.'/user/card.php';
3171 3171
 		if ($option == 'leave') {
3172
-			$baseurl = DOL_URL_ROOT . '/holiday/list.php';
3172
+			$baseurl = DOL_URL_ROOT.'/holiday/list.php';
3173 3173
 		}
3174 3174
 		$query = ['id' => $this->id];
3175 3175
 		if ($option != 'nolink') {
@@ -3193,7 +3193,7 @@  discard block
 block discarded – undo
3193 3193
 				$linkclose .= ' alt="'.dolPrintHTMLForAttribute($label).'"';
3194 3194
 			}
3195 3195
 			$linkclose .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
3196
-			$linkclose .= $dataparams . ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3196
+			$linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
3197 3197
 		} else {
3198 3198
 			$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
3199 3199
 		}
@@ -3432,11 +3432,11 @@  discard block
 block discarded – undo
3432 3432
 		global $conf;
3433 3433
 		$dn = '';
3434 3434
 		if ($mode == 0) {
3435
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')]."," . getDolGlobalString('LDAP_USER_DN');
3435
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')].",".getDolGlobalString('LDAP_USER_DN');
3436 3436
 		} elseif ($mode == 1) {
3437 3437
 			$dn = getDolGlobalString('LDAP_USER_DN');
3438 3438
 		} elseif ($mode == 2) {
3439
-			$dn = getDolGlobalString('LDAP_KEY_USERS') . "=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3439
+			$dn = getDolGlobalString('LDAP_KEY_USERS')."=".$info[getDolGlobalString('LDAP_KEY_USERS')];
3440 3440
 		}
3441 3441
 		return $dn;
3442 3442
 	}
@@ -3903,7 +3903,7 @@  discard block
 block discarded – undo
3903 3903
 			$sql .= " WHERE u.entity IN (".getEntity('user').")";
3904 3904
 		}
3905 3905
 		if ($filter) {
3906
-			$sql .= " AND ".$filter;	// already sanitized
3906
+			$sql .= " AND ".$filter; // already sanitized
3907 3907
 		}
3908 3908
 
3909 3909
 		dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG);
@@ -4235,8 +4235,8 @@  discard block
 block discarded – undo
4235 4235
 					$sql .= " WHERE t.entity IS NOT NULL"; // Show all users
4236 4236
 				} else {
4237 4237
 					$sql .= " WHERE t.entity = 0 OR EXISTS (";
4238
-					$sql .= " SELECT ug.rowid FROM " . $this->db->prefix() . "usergroup_user as ug";
4239
-					$sql .= " WHERE ug.fk_user = t.rowid AND ug.entity IN (" . getEntity('usergroup') . "))";
4238
+					$sql .= " SELECT ug.rowid FROM ".$this->db->prefix()."usergroup_user as ug";
4239
+					$sql .= " WHERE ug.fk_user = t.rowid AND ug.entity IN (".getEntity('usergroup')."))";
4240 4240
 				}
4241 4241
 			} else {
4242 4242
 				$sql .= " WHERE t.entity IN (".getEntity('user').")";
Please login to merge, or discard this patch.
htdocs/core/class/html.formmail.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  *       \brief      File of class to generate HTML form to send email of unitary email.
31 31
  */
32 32
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
33
-require_once DOL_DOCUMENT_ROOT.'/core/class/cemailtemplate.class.php';	// So the class ModelMail that was defined into this file in old version is still available when including this file
33
+require_once DOL_DOCUMENT_ROOT.'/core/class/cemailtemplate.class.php'; // So the class ModelMail that was defined into this file in old version is still available when including this file
34 34
 
35 35
 
36 36
 /**
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
 
712 712
 						// Add also company main email
713 713
 						if (getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) {
714
-							$s = getDolGlobalString('MAIN_INFO_SOCIETE_NOM', getDolGlobalString('MAIN_INFO_SOCIETE_EMAIL')).' &lt;' . getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'&gt;';
714
+							$s = getDolGlobalString('MAIN_INFO_SOCIETE_NOM', getDolGlobalString('MAIN_INFO_SOCIETE_EMAIL')).' &lt;'.getDolGlobalString('MAIN_INFO_SOCIETE_MAIL').'&gt;';
715 715
 							$liste['company'] = array('label' => $s, 'data-html' => $s);
716 716
 						}
717 717
 
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 							if (getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && getDolGlobalString('MAIN_MAIL_EMAIL_FROM') != getDolGlobalString('MAIN_INFO_SOCIETE_MAIL')) {
732 732
 								$s = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
733 733
 								if ($this->frommail) {
734
-									$s .= ' &lt;' . getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'&gt;';
734
+									$s .= ' &lt;'.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').'&gt;';
735 735
 								}
736 736
 								$liste['main_from'] = array('label' => $s, 'data-html' => $s);
737 737
 							}
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 						$maxfilesizearray = getMaxFileSizeArray();
970 970
 						$maxmin = $maxfilesizearray['maxmin'];
971 971
 						if ($maxmin > 0) {
972
-							$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
972
+							$out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
973 973
 						}
974 974
 						// Can add other files
975 975
 						if (!getDolGlobalString('FROM_MAIL_DONT_USE_INPUT_FILE_MULTIPLE')) {
@@ -2012,7 +2012,7 @@  discard block
 block discarded – undo
2012 2012
 					}
2013 2013
 				}
2014 2014
 
2015
-				$this->substit_lines[$line->id] = $substit_line;	// @phan-suppress-current-line PhanTypeMismatchProperty
2015
+				$this->substit_lines[$line->id] = $substit_line; // @phan-suppress-current-line PhanTypeMismatchProperty
2016 2016
 			}
2017 2017
 		}
2018 2018
 	}
@@ -2060,7 +2060,7 @@  discard block
 block discarded – undo
2060 2060
 			$tmparray['__OTHER4__'] = 'Other4';
2061 2061
 			$tmparray['__OTHER5__'] = 'Other5';
2062 2062
 
2063
-			$tmparray['__THIRDPARTY_CUSTOMER_CODE__'] = 'CustomerCode';  // If source is a thirdparty
2063
+			$tmparray['__THIRDPARTY_CUSTOMER_CODE__'] = 'CustomerCode'; // If source is a thirdparty
2064 2064
 
2065 2065
 			$tmparray['__CHECK_READ__'] = $langs->trans('TagCheckMail');
2066 2066
 			$tmparray['__UNSUBSCRIBE__'] = $langs->trans('TagUnsubscribe');
Please login to merge, or discard this patch.
htdocs/projet/tasks/task.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
108 108
 	}
109 109
 	if (!$error) {
110
-		$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
110
+		$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
111 111
 
112 112
 		$tmparray = explode('_', GETPOST('task_parent'));
113 113
 		$task_parent = $tmparray[1];
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		$object->date_start = dol_mktime(GETPOSTINT('date_starthour'), GETPOSTINT('date_startmin'), 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear'));
128 128
 		$object->date_end = dol_mktime(GETPOSTINT('date_endhour'), GETPOSTINT('date_endmin'), 0, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear'));
129 129
 		$object->progress = price2num(GETPOST('progress', 'alphanohtml'));
130
-		$object->budget_amount = (GETPOST('budget_amount') != '' ? GETPOSTFLOAT('budget_amount'): null);
130
+		$object->budget_amount = (GETPOST('budget_amount') != '' ? GETPOSTFLOAT('budget_amount') : null);
131 131
 		$object->billable = (GETPOST('billable', 'aZ') == 'yes' ? 1 : 0);
132 132
 		if (GETPOST('progress') == '100') {
133 133
 			$object->status = $object::STATUS_CLOSED;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
 if ($action == 'confirm_merge' && $confirm == 'yes' && $user->hasRight('projet', 'creer')) {
159 159
 	$task_origin_id = GETPOSTINT('task_origin');
160
-	$task_origin = new Task($db);		// The Task that we will delete
160
+	$task_origin = new Task($db); // The Task that we will delete
161 161
 
162 162
 	if ($task_origin_id <= 0) {
163 163
 		$langs->load('errors');
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
 $title = (string) $object->ref;
309 309
 if (!empty($withproject)) {
310
-	$title .= ' | ' . $langs->trans("Project") . (!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '')  ;
310
+	$title .= ' | '.$langs->trans("Project").(!empty($projectstatic->ref) ? ': '.$projectstatic->ref : '');
311 311
 }
312 312
 $help_url = '';
313 313
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 		$cols = 2;
434 434
 		$savobject = $object;
435 435
 		$object = $projectstatic;
436
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
436
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
437 437
 		$object = $savobject;
438 438
 
439 439
 		print '</table>';
Please login to merge, or discard this patch.
htdocs/projet/element.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 $id = GETPOSTINT('id');
159 159
 $ref = GETPOST('ref', 'alpha');
160 160
 $action = GETPOST('action', 'aZ09');
161
-$datesrfc = GETPOST('datesrfc');	// deprecated
162
-$dateerfc = GETPOST('dateerfc');	// deprecated
161
+$datesrfc = GETPOST('datesrfc'); // deprecated
162
+$dateerfc = GETPOST('dateerfc'); // deprecated
163 163
 $dates = dol_mktime(0, 0, 0, GETPOSTINT('datesmonth'), GETPOSTINT('datesday'), GETPOSTINT('datesyear'));
164 164
 $datee = dol_mktime(23, 59, 59, GETPOSTINT('dateemonth'), GETPOSTINT('dateeday'), GETPOSTINT('dateeyear'));
165 165
 if (empty($dates) && !empty($datesrfc)) {	// deprecated
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
 $permissiontoadd = $user->hasRight('projet', 'creer');
210 210
 $permissiontodelete = $user->hasRight('projet', 'supprimer');
211
-$permissiondellink = $user->hasRight('projet', 'creer');	// Used by the include of actions_dellink.inc.php
211
+$permissiondellink = $user->hasRight('projet', 'creer'); // Used by the include of actions_dellink.inc.php
212 212
 $permissiontoeditextra = $permissiontoadd;
213 213
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
214 214
 	// For action 'update_extras', is there a specific permission set for the attribute to update
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 // Quick edit for extrafields
223 223
 if ($action == 'update_extras' && $permissiontoeditextra) {
224 224
 	$error = 0;
225
-	$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
225
+	$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
226 226
 
227 227
 	$attribute_name = GETPOST('attribute', 'aZ09');
228 228
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 		$sql .= " WHERE et.elementtype = 'task'";
259 259
 		$sql .= " AND et.fk_element = ".((int) $taskid);
260 260
 		if ($action == 'updateundefinedwithlasthourlyrate') {	// Test on permission already done
261
-			$sql .= " AND et.thm IS NULL";	// Note: If 0, it is defined, we won't update it.
261
+			$sql .= " AND et.thm IS NULL"; // Note: If 0, it is defined, we won't update it.
262 262
 		}
263 263
 
264 264
 		$resql = $db->query($sql);
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) {
334 334
 	$tmpurl = $_SESSION['pageforbacktolist']['project'];
335 335
 	$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
336
-	$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
336
+	$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
337 337
 } else {
338 338
 	$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
339 339
 }
@@ -1210,7 +1210,7 @@  discard block
 block discarded – undo
1210 1210
 		if (!in_array($tablename, $array_of_element_linkable_with_different_thirdparty)) {
1211 1211
 			$idtofilterthirdparty = empty($object->thirdparty->id) ? 0 : $object->thirdparty->id;
1212 1212
 			if (getDolGlobalString('PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS')) {
1213
-				$idtofilterthirdparty .= ',' . getDolGlobalString('PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS');
1213
+				$idtofilterthirdparty .= ','.getDolGlobalString('PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS');
1214 1214
 			}
1215 1215
 		}
1216 1216
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -876,7 +876,7 @@
 block discarded – undo
876 876
 print '<!-- Begin PROFIT table -->';
877 877
 print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy');
878 878
 
879
-PRINT '<div class="div-table-responsive">';
879
+print '<div class="div-table-responsive">';
880 880
 print '<table class="noborder centpercent">';
881 881
 print '<tr class="liste_titre">';
882 882
 print '<td class="left" width="200">';
Please login to merge, or discard this patch.
htdocs/comm/propal/card.php 1 patch
Spacing   +257 added lines, -257 removed lines patch added patch discarded remove patch
@@ -44,24 +44,24 @@  discard block
 block discarded – undo
44 44
 // Load Dolibarr environment
45 45
 require '../../main.inc.php';
46 46
 require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
47
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
48
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
49
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formpropal.class.php';
50
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php';
51
-require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
52
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
53
-require_once DOL_DOCUMENT_ROOT . '/core/modules/propale/modules_propale.php';
54
-require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php';
55
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
56
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
57
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
47
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
48
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
49
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
50
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
51
+require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
52
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
53
+require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php';
54
+require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
55
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
56
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
57
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
58 58
 if (isModEnabled('project')) {
59
-	require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
60
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
59
+	require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
60
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
61 61
 }
62 62
 
63 63
 if (isModEnabled('variants')) {
64
-	require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductCombination.class.php';
64
+	require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
65 65
 }
66 66
 
67 67
 /**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 $cancel = GETPOST('cancel', 'alpha');
94 94
 $origin = GETPOST('origin', 'alpha');
95 95
 $originid = GETPOSTINT('originid');
96
-$renewal = GETPOST('renewal');	// for contract renewal
96
+$renewal = GETPOST('renewal'); // for contract renewal
97 97
 $confirm = GETPOST('confirm', 'alpha');
98 98
 $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
99 99
 $lineid = GETPOSTINT('lineid');
@@ -178,34 +178,34 @@  discard block
 block discarded – undo
178 178
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
179 179
 }
180 180
 if (empty($reshook)) {
181
-	$backurlforlist = DOL_URL_ROOT . '/comm/propal/list.php';
181
+	$backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php';
182 182
 
183 183
 	if (empty($backtopage) || ($cancel && empty($id))) {
184 184
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
185 185
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
186 186
 				$backtopage = $backurlforlist;
187 187
 			} else {
188
-				$backtopage = DOL_URL_ROOT . '/comm/propal/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
188
+				$backtopage = DOL_URL_ROOT.'/comm/propal/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
189 189
 			}
190 190
 		}
191 191
 	}
192 192
 
193 193
 	if ($cancel) {
194 194
 		if (!empty($backtopageforcancel)) {
195
-			header("Location: " . $backtopageforcancel);
195
+			header("Location: ".$backtopageforcancel);
196 196
 			exit;
197 197
 		} elseif (!empty($backtopage)) {
198
-			header("Location: " . $backtopage);
198
+			header("Location: ".$backtopage);
199 199
 			exit;
200 200
 		}
201 201
 		$action = '';
202 202
 	}
203 203
 
204
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
204
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
205 205
 
206
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
206
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
207 207
 
208
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
208
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
209 209
 	// Action clone object
210 210
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
211 211
 		if (!($socid > 0)) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 							$object->delivery_date = $date_delivery;
240 240
 							foreach ($object->lines as $line) {
241 241
 								if (isset($line->date_start)) {
242
-									$line->date_start +=  $difference;
242
+									$line->date_start += $difference;
243 243
 								}
244 244
 								if (isset($line->date_end)) {
245 245
 									$line->date_end += $difference;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 						setEventMessages('', $warningMsgLineList, 'warnings');
268 268
 					}
269 269
 
270
-					header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
270
+					header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
271 271
 					exit();
272 272
 				} else {
273 273
 					if (count($object->errors) > 0) {
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		// Cancel proposal
282 282
 		$result = $object->setCancel($user);
283 283
 		if ($result > 0) {
284
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
284
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
285 285
 			exit();
286 286
 		} else {
287 287
 			$langs->load("errors");
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 		// Delete proposal
292 292
 		$result = $object->delete($user);
293 293
 		if ($result > 0) {
294
-			header('Location: ' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1');
294
+			header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1');
295 295
 			exit();
296 296
 		} else {
297 297
 			$langs->load("errors");
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 			$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
324 324
 		}
325 325
 
326
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
326
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
327 327
 		exit();
328 328
 	} elseif ($action == 'confirm_delete_subtotalline' && $confirm == 'yes' && $usercancreate) {
329 329
 		// Delete line
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 				$result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
354 354
 			}
355 355
 			if ($result >= 0) {
356
-				header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
356
+				header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
357 357
 				exit();
358 358
 			}
359 359
 		} else {
@@ -625,14 +625,14 @@  discard block
 block discarded – undo
625 625
 
626 626
 					$id = $object->create($user);
627 627
 					if ($id > 0) {
628
-						dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
628
+						dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
629 629
 
630 630
 						$classname = ucfirst($subelement);
631 631
 						$srcobject = new $classname($db);
632
-						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject';  // Can be other class, but CommonObject is too generic
632
+						'@phan-var-force Commande|Propal|Contrat|Fichinter|Expedition $srcobject'; // Can be other class, but CommonObject is too generic
633 633
 						/** @var Commande|Propal|Contrat|Fichinter|Expedition $srcobject */
634 634
 
635
-						dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
635
+						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
636 636
 						$result = $srcobject->fetch($object->origin_id);
637 637
 
638 638
 						if ($result > 0) {
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
 
698 698
 								$tva_tx = $lines[$i]->tva_tx;
699 699
 								if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) {
700
-									$tva_tx .= ' (' . $lines[$i]->vat_src_code . ')';
700
+									$tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
701 701
 								}
702 702
 
703 703
 								$result = $object->addline($desc, $lines[$i]->subprice, $lines[$i]->qty, $tva_tx, $lines[$i]->localtax1_tx, $lines[$i]->localtax2_tx, $lines[$i]->fk_product, $lines[$i]->remise_percent, 'HT', 0, $lines[$i]->info_bits, $product_type, $lines[$i]->rang, $lines[$i]->special_code, $fk_parent_line, $lines[$i]->fk_fournprice, $lines[$i]->pa_ht, $label, $date_start, $date_end, $array_options, $lines[$i]->fk_unit);
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 							}
788 788
 						}
789 789
 
790
-						header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
790
+						header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
791 791
 						exit();
792 792
 					} else {
793 793
 						$db->rollback();
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
 					$error++;
836 836
 				} else {
837 837
 					// Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded)
838
-					$locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id;
838
+					$locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id;
839 839
 				}
840 840
 
841 841
 				$deposit = null;
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 					!$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOST('generate_deposit') == 'on'
847 847
 					&& !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')
848 848
 				) {
849
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
849
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
850 850
 
851 851
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
852 852
 					$forceFields = array();
@@ -859,10 +859,10 @@  discard block
 block discarded – undo
859 859
 
860 860
 					if ($deposit) {
861 861
 						setEventMessage('DepositGenerated');
862
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
862
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
863 863
 					} else {
864 864
 						$error++;
865
-						setEventMessages("Failed to create down payment - " . $object->error, $object->errors, 'errors');
865
+						setEventMessages("Failed to create down payment - ".$object->error, $object->errors, 'errors');
866 866
 					}
867 867
 				}
868 868
 
@@ -887,12 +887,12 @@  discard block
 block discarded – undo
887 887
 					}
888 888
 
889 889
 					if ($locationTarget) {
890
-						header('Location: ' . $locationTarget);
890
+						header('Location: '.$locationTarget);
891 891
 						exit;
892 892
 					}
893 893
 				} else {
894 894
 					$object->status = $oldstatus;
895
-					$object->statut = $oldstatus;	// deprecated
895
+					$object->statut = $oldstatus; // deprecated
896 896
 
897 897
 					$db->rollback();
898 898
 					$action = '';
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 				setEventMessages($object->error, $object->errors, 'errors');
912 912
 				$error++;
913 913
 			} else {
914
-				$object->statut = $newstatus;	// deprecated
914
+				$object->statut = $newstatus; // deprecated
915 915
 				$object->status = $newstatus;
916 916
 			}
917 917
 
@@ -929,13 +929,13 @@  discard block
 block discarded – undo
929 929
 
930 930
 		if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) {
931 931
 			if ($fromElement == 'commande') {
932
-				dol_include_once('/' . $fromElement . '/class/' . $fromElement . '.class.php');
932
+				dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php');
933 933
 				$lineClassName = 'OrderLine';
934 934
 			} elseif ($fromElement == 'propal') {
935
-				dol_include_once('/comm/' . $fromElement . '/class/' . $fromElement . '.class.php');
935
+				dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php');
936 936
 				$lineClassName = 'PropaleLigne';
937 937
 			} elseif ($fromElement == 'facture') {
938
-				dol_include_once('/compta/' . $fromElement . '/class/' . $fromElement . '.class.php');
938
+				dol_include_once('/compta/'.$fromElement.'/class/'.$fromElement.'.class.php');
939 939
 				$lineClassName = 'FactureLigne';
940 940
 			} else {
941 941
 				$lineClassName = null;
@@ -1002,14 +1002,14 @@  discard block
 block discarded – undo
1002 1002
 		$object->updateSubtotalLineBlockLines($langs, $object->getRangOfLine($lineid), 'discount', $discount);
1003 1003
 	}
1004 1004
 
1005
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
1005
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
1006 1006
 
1007 1007
 	// Actions to send emails
1008 1008
 	$actiontypecode = 'AC_OTH_AUTO';
1009 1009
 	$triggersendname = 'PROPAL_SENTBYMAIL';
1010 1010
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_PROPOSAL_TO';
1011
-	$trackid = 'pro' . $object->id;
1012
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
1011
+	$trackid = 'pro'.$object->id;
1012
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
1013 1013
 
1014 1014
 
1015 1015
 	// Go back to draft
@@ -1078,7 +1078,7 @@  discard block
 block discarded – undo
1078 1078
 			}
1079 1079
 			$tvatx = $line->tva_tx;
1080 1080
 			if (!empty($line->vat_src_code)) {
1081
-				$tvatx .= ' (' . $line->vat_src_code . ')';
1081
+				$tvatx .= ' ('.$line->vat_src_code.')';
1082 1082
 			}
1083 1083
 			$result = $object->updateline($line->id, $line->subprice, $line->qty, (float) $remise_percent, $tvatx, $line->localtax1_tx, $line->localtax2_tx, $line->desc, 'HT', $line->info_bits, $line->special_code, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->product_type, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
1084 1084
 			$object->lines[$key] = $object->line;
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
 			if ($prod->price_min > $subprice) {
1097 1097
 				$price_subprice  = price($subprice, 0, $outlangs, 1, -1, -1, 'auto');
1098 1098
 				$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1099
-				setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1099
+				setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1100 1100
 			}
1101 1101
 			// Manage $line->subprice and $line->multicurrency_subprice
1102 1102
 			if ($line->subprice <> 0) {
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
 		} else {
1167 1167
 			setEventMessages($object->error, $object->errors, 'errors');
1168 1168
 		}
1169
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1169
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1170 1170
 		exit();
1171 1171
 	} elseif ($action == 'confirm_addsubtotalline' && $usercancreate) {
1172 1172
 		// Handling adding a new subtotal line for subtotals module
@@ -1218,7 +1218,7 @@  discard block
 block discarded – undo
1218 1218
 		} else {
1219 1219
 			setEventMessages($object->error, $object->errors, 'errors');
1220 1220
 		}
1221
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
1221
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
1222 1222
 		exit();
1223 1223
 	} elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && !GETPOST('submitforallmargins', 'alpha') && !GETPOST('markforalllines', 'alpha') && $usercancreate) {
1224 1224
 		// Add line
@@ -1260,8 +1260,8 @@  discard block
 block discarded – undo
1260 1260
 
1261 1261
 		$tva_tx = GETPOST('tva_tx', 'alpha');
1262 1262
 
1263
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
1264
-		$remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0);
1263
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
1264
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
1265 1265
 		if (empty($remise_percent)) {
1266 1266
 			$remise_percent = 0;
1267 1267
 		}
@@ -1273,7 +1273,7 @@  discard block
 block discarded – undo
1273 1273
 		if (is_array($extralabelsline)) {
1274 1274
 			// Get extra fields
1275 1275
 			foreach ($extralabelsline as $key => $value) {
1276
-				unset($_POST["options_" . $key]);
1276
+				unset($_POST["options_".$key]);
1277 1277
 			}
1278 1278
 		}
1279 1279
 
@@ -1345,7 +1345,7 @@  discard block
 block discarded – undo
1345 1345
 
1346 1346
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1347 1347
 					// If price per customer
1348
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1348
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1349 1349
 					$prodcustprice = new ProductCustomerPrice($db);
1350 1350
 					$filter = array('t.fk_product' => (string) $prod->id, 't.fk_soc' => (string) $object->thirdparty->id);
1351 1351
 
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
 					}
1410 1410
 				} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1411 1411
 					// If price per customer
1412
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1412
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1413 1413
 
1414 1414
 					$prodcustprice = new ProductCustomerPrice($db);
1415 1415
 
@@ -1556,23 +1556,23 @@  discard block
 block discarded – undo
1556 1556
 							$outputlangs->load('products');
1557 1557
 						}
1558 1558
 						if (!empty($prod->customcode)) {
1559
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1559
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1560 1560
 						}
1561 1561
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1562 1562
 							$tmptxt .= ' - ';
1563 1563
 						}
1564 1564
 						if (!empty($prod->country_code)) {
1565
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
1565
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
1566 1566
 						}
1567 1567
 					} else {
1568 1568
 						if (!empty($prod->customcode)) {
1569
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1569
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1570 1570
 						}
1571 1571
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1572 1572
 							$tmptxt .= ' - ';
1573 1573
 						}
1574 1574
 						if (!empty($prod->country_code)) {
1575
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
1575
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
1576 1576
 						}
1577 1577
 					}
1578 1578
 					$tmptxt .= ')';
@@ -1611,11 +1611,11 @@  discard block
 block discarded – undo
1611 1611
 			$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty, $mysoc, $tva_npr);
1612 1612
 
1613 1613
 			// Margin
1614
-			$fournprice = (int) (GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : '');	// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1615
-			$buyingprice = price2num((GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1614
+			$fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1615
+			$buyingprice = price2num((GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''), '', 2); // If buying_price is '0', we must keep this value
1616 1616
 
1617
-			$date_start = dol_mktime(GETPOSTINT('date_start' . $predef . 'hour'), GETPOSTINT('date_start' . $predef . 'min'), GETPOSTINT('date_start' . $predef . 'sec'), GETPOSTINT('date_start' . $predef . 'month'), GETPOSTINT('date_start' . $predef . 'day'), GETPOSTINT('date_start' . $predef . 'year'));
1618
-			$date_end = dol_mktime(GETPOSTINT('date_end' . $predef . 'hour'), GETPOSTINT('date_end' . $predef . 'min'), GETPOSTINT('date_end' . $predef . 'sec'), GETPOSTINT('date_end' . $predef . 'month'), GETPOSTINT('date_end' . $predef . 'day'), GETPOSTINT('date_end' . $predef . 'year'));
1617
+			$date_start = dol_mktime(GETPOSTINT('date_start'.$predef.'hour'), GETPOSTINT('date_start'.$predef.'min'), GETPOSTINT('date_start'.$predef.'sec'), GETPOSTINT('date_start'.$predef.'month'), GETPOSTINT('date_start'.$predef.'day'), GETPOSTINT('date_start'.$predef.'year'));
1618
+			$date_end = dol_mktime(GETPOSTINT('date_end'.$predef.'hour'), GETPOSTINT('date_end'.$predef.'min'), GETPOSTINT('date_end'.$predef.'sec'), GETPOSTINT('date_end'.$predef.'month'), GETPOSTINT('date_end'.$predef.'day'), GETPOSTINT('date_end'.$predef.'year'));
1619 1619
 
1620 1620
 			// Prepare a price equivalent for minimum price check
1621 1621
 			$pu_equivalent = $pu_ht;
@@ -1746,7 +1746,7 @@  discard block
 block discarded – undo
1746 1746
 				if ($prod->price_min > $line->subprice) {
1747 1747
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
1748 1748
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
1749
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
1749
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
1750 1750
 				} else {
1751 1751
 					setEventMessages($prod->error, $prod->errors, 'errors');
1752 1752
 				}
@@ -1884,7 +1884,7 @@  discard block
 block discarded – undo
1884 1884
 		$pu_ttc = price2num(GETPOST('price_ttc'), '', 2);
1885 1885
 
1886 1886
 		// Add buying price
1887
-		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : '');	// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1887
+		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1888 1888
 		$buyingprice = price2num((GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''), '', 2); // If buying_price is '0', we must keep this value
1889 1889
 
1890 1890
 		$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2);
@@ -1931,7 +1931,7 @@  discard block
 block discarded – undo
1931 1931
 		if (is_array($extralabelsline)) {
1932 1932
 			// Get extra fields
1933 1933
 			foreach ($extralabelsline as $key => $value) {
1934
-				unset($_POST["options_" . $key]);
1934
+				unset($_POST["options_".$key]);
1935 1935
 			}
1936 1936
 		}
1937 1937
 
@@ -2063,7 +2063,7 @@  discard block
 block discarded – undo
2063 2063
 			}
2064 2064
 		}
2065 2065
 	} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
2066
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); //  To re-display card in edit mode
2066
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); //  To re-display card in edit mode
2067 2067
 		exit();
2068 2068
 	} elseif ($action == 'classin' && $usercancreate) {
2069 2069
 		// Set project
@@ -2077,8 +2077,8 @@  discard block
 block discarded – undo
2077 2077
 	} elseif ($action == 'setconditions' && $usercancreate) {
2078 2078
 		// Terms of payment
2079 2079
 		$sql = "SELECT code ";
2080
-		$sql .= "FROM " . $db->prefix() . "c_payment_term";
2081
-		$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
2080
+		$sql .= "FROM ".$db->prefix()."c_payment_term";
2081
+		$sql .= " WHERE rowid = ".((int) GETPOST('cond_reglement_id', 'int'));
2082 2082
 		$result = $db->query($sql);
2083 2083
 		if ($result) {
2084 2084
 			$obj = $db->fetch_object($result);
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
 			}
2144 2144
 
2145 2145
 			if ($result >= 0) {
2146
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2146
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2147 2147
 				exit();
2148 2148
 			} else {
2149 2149
 				if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
 			$result = $object->delete_contact($lineid);
2167 2167
 
2168 2168
 			if ($result >= 0) {
2169
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2169
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2170 2170
 				exit();
2171 2171
 			} else {
2172 2172
 				dol_print_error($db);
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
 	// Actions to build doc
2178 2178
 	$upload_dir = !empty($conf->propal->multidir_output[$object->entity ?? $conf->entity]) ? $conf->propal->multidir_output[$object->entity ?? $conf->entity] : $conf->propal->dir_output;
2179 2179
 	$permissiontoadd = $usercancreate;
2180
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
2180
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
2181 2181
 }
2182 2182
 
2183 2183
 
@@ -2194,7 +2194,7 @@  discard block
 block discarded – undo
2194 2194
 	$formproject = new FormProjets($db);
2195 2195
 }
2196 2196
 
2197
-$title = $object->ref . " - " . $langs->trans('Card');
2197
+$title = $object->ref." - ".$langs->trans('Card');
2198 2198
 if ($action == 'create') {
2199 2199
 	$title = $langs->trans("NewPropal");
2200 2200
 }
@@ -2260,11 +2260,11 @@  discard block
 block discarded – undo
2260 2260
 				$element = $subelement = 'expedition';
2261 2261
 			}
2262 2262
 
2263
-			dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
2263
+			dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
2264 2264
 
2265 2265
 			$classname = ucfirst($subelement);
2266 2266
 			$objectsrc = new $classname($db);
2267
-			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc';  // Can be other class, but CommonObject is too generic
2267
+			'@phan-var-force Commande|Propal|Contrat|Expedition $objectsrc'; // Can be other class, but CommonObject is too generic
2268 2268
 			/** @var Commande|Propal|Contrat|Expedition $objectsrc */
2269 2269
 			$objectsrc->fetch($originid);
2270 2270
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
@@ -2340,19 +2340,19 @@  discard block
 block discarded – undo
2340 2340
 		}
2341 2341
 	}
2342 2342
 
2343
-	print '<form name="addprop" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2344
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
2343
+	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2344
+	print '<input type="hidden" name="token" value="'.newToken().'">';
2345 2345
 	print '<input type="hidden" name="action" value="add">';
2346
-	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
2347
-	print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
2346
+	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
2347
+	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2348 2348
 	if ($origin != 'project' && $originid) {
2349
-		print '<input type="hidden" name="origin" value="' . $origin . '">';
2350
-		print '<input type="hidden" name="originid" value="' . $originid . '">';
2349
+		print '<input type="hidden" name="origin" value="'.$origin.'">';
2350
+		print '<input type="hidden" name="originid" value="'.$originid.'">';
2351 2351
 		if ($origin == 'contrat' && !empty($renewal)) {
2352
-			print '<input type="hidden" name="renewal" value="' . $renewal . '">';
2352
+			print '<input type="hidden" name="renewal" value="'.$renewal.'">';
2353 2353
 		}
2354 2354
 	} elseif ($origin == 'project' && !empty($projectid)) {
2355
-		print '<input type="hidden" name="projectid" value="' . $projectid . '">';
2355
+		print '<input type="hidden" name="projectid" value="'.$projectid.'">';
2356 2356
 	}
2357 2357
 
2358 2358
 	print dol_get_fiche_head();
@@ -2365,22 +2365,22 @@  discard block
 block discarded – undo
2365 2365
 		print '<table class="border centpercent">';
2366 2366
 
2367 2367
 		// Reference
2368
-		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td class="valuefieldcreate">' . $langs->trans("Draft") . '</td></tr>';
2368
+		print '<tr class="field_ref"><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td class="valuefieldcreate">'.$langs->trans("Draft").'</td></tr>';
2369 2369
 
2370 2370
 		// Ref customer
2371
-		print '<tr class="field_ref_client"><td class="titlefieldcreate">' . $langs->trans('RefCustomer') . '</td><td class="valuefieldcreate">';
2372
-		print '<input type="text" name="ref_client" value="' . (!empty($ref_client) ? $ref_client : GETPOST('ref_client')) . '"></td>';
2371
+		print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">';
2372
+		print '<input type="text" name="ref_client" value="'.(!empty($ref_client) ? $ref_client : GETPOST('ref_client')).'"></td>';
2373 2373
 		print '</tr>';
2374 2374
 
2375 2375
 		// Third party
2376 2376
 		print '<tr class="field_socid">';
2377
-		print '<td class="titlefieldcreate fieldrequired">' . $langs->trans('Customer') . '</td>';
2377
+		print '<td class="titlefieldcreate fieldrequired">'.$langs->trans('Customer').'</td>';
2378 2378
 		$shipping_method_id = 0;
2379 2379
 		$warehouse_id = 0;
2380 2380
 		if ($socid > 0) {
2381 2381
 			print '<td class="valuefieldcreate">';
2382 2382
 			print $soc->getNomUrl(1, 'customer');
2383
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
2383
+			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
2384 2384
 			print '</td>';
2385 2385
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2386 2386
 				$shipping_method_id = $soc->shipping_method_id;
@@ -2389,7 +2389,7 @@  discard block
 block discarded – undo
2389 2389
 		} else {
2390 2390
 			print '<td class="valuefieldcreate">';
2391 2391
 			$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
2392
-			print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2392
+			print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
2393 2393
 			// reload page to retrieve customer information
2394 2394
 			if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
2395 2395
 				print '<script>
@@ -2405,63 +2405,63 @@  discard block
 block discarded – undo
2405 2405
 				});
2406 2406
 				</script>';
2407 2407
 			}
2408
-			print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&prospect=3&fournisseur=0&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>';
2408
+			print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&prospect=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
2409 2409
 			print '</td>';
2410 2410
 		}
2411
-		print '</tr>' . "\n";
2411
+		print '</tr>'."\n";
2412 2412
 
2413 2413
 		if ($socid > 0) {
2414 2414
 			// Contacts (ask contact only if thirdparty already defined).
2415
-			print '<tr class="field_contactid"><td class="titlefieldcreate">' . $langs->trans("DefaultContact") . '</td><td class="valuefieldcreate">';
2415
+			print '<tr class="field_contactid"><td class="titlefieldcreate">'.$langs->trans("DefaultContact").'</td><td class="valuefieldcreate">';
2416 2416
 			print img_picto('', 'contact', 'class="pictofixedwidth"');
2417 2417
 			//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, '', '', 0, 'minwidth300 widthcentpercentminusx');
2418 2418
 			print $form->select_contact($soc->id, $contactid, 'contactid', 1, '', '', 1, 'maxwidth300 widthcentpercentminusx', true);
2419 2419
 			print '</td></tr>';
2420 2420
 
2421 2421
 			// Third party discounts info line
2422
-			print '<tr class="field_discount_info"><td class="titlefieldcreate">' . $langs->trans('Discounts') . '</td><td class="valuefieldcreate">';
2422
+			print '<tr class="field_discount_info"><td class="titlefieldcreate">'.$langs->trans('Discounts').'</td><td class="valuefieldcreate">';
2423 2423
 
2424 2424
 			$absolute_discount = $soc->getAvailableDiscounts();
2425 2425
 
2426 2426
 			$thirdparty = $soc;
2427 2427
 			$discount_type = 0;
2428
-			$backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid')));
2429
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
2428
+			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
2429
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
2430 2430
 			print '</td></tr>';
2431 2431
 		}
2432 2432
 
2433 2433
 		$newdatepropal = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver');
2434 2434
 		// Date
2435
-		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">' . $langs->trans('DatePropal') . '</td><td class="valuefieldcreate">';
2435
+		print '<tr class="field_addprop"><td class="titlefieldcreate fieldrequired">'.$langs->trans('DatePropal').'</td><td class="valuefieldcreate">';
2436 2436
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2437 2437
 		print $form->selectDate($newdatepropal ? $newdatepropal : $datepropal, '', 0, 0, 0, "addprop", 1, 1);
2438 2438
 		print '</td></tr>';
2439 2439
 
2440 2440
 		// Validaty duration
2441
-		print '<tr class="field_duree_validitee"><td class="titlefieldcreate fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td class="valuefieldcreate">' . img_picto('', 'clock', 'class="pictofixedwidth"') . '<input name="duree_validite" class="width50" value="' . (GETPOSTISSET('duree_validite') ? GETPOST('duree_validite', 'alphanohtml') : getDolGlobalString('PROPALE_VALIDITY_DURATION')) . '"> ' . $langs->trans("days") . '</td></tr>';
2441
+		print '<tr class="field_duree_validitee"><td class="titlefieldcreate fieldrequired">'.$langs->trans("ValidityDuration").'</td><td class="valuefieldcreate">'.img_picto('', 'clock', 'class="pictofixedwidth"').'<input name="duree_validite" class="width50" value="'.(GETPOSTISSET('duree_validite') ? GETPOST('duree_validite', 'alphanohtml') : getDolGlobalString('PROPALE_VALIDITY_DURATION')).'"> '.$langs->trans("days").'</td></tr>';
2442 2442
 
2443 2443
 		// Terms of payment
2444
-		print '<tr class="field_cond_reglement_id"><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2444
+		print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2445 2445
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2446 2446
 		// at last resort we take the payment term id which may be filled by default values set (if not getpostisset)
2447 2447
 		print $form->getSelectConditionsPaiements((int) $cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', $deposit_percent);
2448 2448
 		print '</td></tr>';
2449 2449
 
2450 2450
 		// Mode of payment
2451
-		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">' . $langs->trans('PaymentMode') . '</td><td class="valuefieldcreate">';
2451
+		print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
2452 2452
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2453 2453
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2454 2454
 		print '</td></tr>';
2455 2455
 
2456 2456
 		// Bank Account
2457 2457
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) {
2458
-			print '<tr class="field_fk_account"><td class="titlefieldcreate">' . $langs->trans('BankAccount') . '</td><td class="valuefieldcreate">';
2459
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2458
+			print '<tr class="field_fk_account"><td class="titlefieldcreate">'.$langs->trans('BankAccount').'</td><td class="valuefieldcreate">';
2459
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((int) $fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2460 2460
 			print '</td></tr>';
2461 2461
 		}
2462 2462
 
2463 2463
 		// Source / Channel - What trigger creation
2464
-		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">' . $langs->trans('Source') . '</td><td class="valuefieldcreate">';
2464
+		print '<tr class="field_demand_reason_id"><td class="titlefieldcreate">'.$langs->trans('Source').'</td><td class="valuefieldcreate">';
2465 2465
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2466 2466
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOSTINT('demand_reason_id') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx');
2467 2467
 		print '</td></tr>';
@@ -2471,7 +2471,7 @@  discard block
 block discarded – undo
2471 2471
 			if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) {
2472 2472
 				$shipping_method_id = $soc->shipping_method_id;
2473 2473
 			}
2474
-			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">' . $langs->trans('SendingMethod') . '</td><td class="valuefieldcreate">';
2474
+			print '<tr class="field_shipping_method_id"><td class="titlefieldcreate">'.$langs->trans('SendingMethod').'</td><td class="valuefieldcreate">';
2475 2475
 			print img_picto('', 'dolly', 'class="pictofixedwidth"');
2476 2476
 			$form->selectShippingMethod((string) (GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
2477 2477
 			print '</td></tr>';
@@ -2480,17 +2480,17 @@  discard block
 block discarded – undo
2480 2480
 		$formproduct = null;
2481 2481
 		// Warehouse
2482 2482
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
2483
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2483
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2484 2484
 			$formproduct = new FormProduct($db);
2485
-			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">' . $langs->trans('Warehouse') . '</td><td class="valuefieldcreate">';
2486
-			print img_picto('', 'stock', 'class="pictofixedwidth"') . $formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2485
+			print '<tr class="field_warehouse_id"><td class="titlefieldcreate">'.$langs->trans('Warehouse').'</td><td class="valuefieldcreate">';
2486
+			print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2487 2487
 			print '</td></tr>';
2488 2488
 		}
2489 2489
 
2490 2490
 		// Delivery delay
2491
-		print '<tr class="field_availability_id"><td class="titlefieldcreate">' . $langs->trans('AvailabilityPeriod');
2491
+		print '<tr class="field_availability_id"><td class="titlefieldcreate">'.$langs->trans('AvailabilityPeriod');
2492 2492
 		if (isModEnabled('order')) {
2493
-			print ' (' . $langs->trans('AfterOrder') . ')';
2493
+			print ' ('.$langs->trans('AfterOrder').')';
2494 2494
 		}
2495 2495
 		print '</td><td class="valuefieldcreate">';
2496 2496
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
@@ -2498,7 +2498,7 @@  discard block
 block discarded – undo
2498 2498
 		print '</td></tr>';
2499 2499
 
2500 2500
 		// Delivery date (or manufacturing)
2501
-		print '<tr class="field_date_livraison"><td class="titlefieldcreate">' . $langs->trans("DeliveryDate") . '</td>';
2501
+		print '<tr class="field_date_livraison"><td class="titlefieldcreate">'.$langs->trans("DeliveryDate").'</td>';
2502 2502
 		print '<td class="valuefieldcreate">';
2503 2503
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2504 2504
 		if (is_numeric(getDolGlobalString('DATE_LIVRAISON_WEEK_DELAY'))) {	// If value set to 0 or a num, not empty
@@ -2506,7 +2506,7 @@  discard block
 block discarded – undo
2506 2506
 			$syear = date("Y", $tmpdte);
2507 2507
 			$smonth = date("m", $tmpdte);
2508 2508
 			$sday = date("d", $tmpdte);
2509
-			print $form->selectDate($syear . "-" . $smonth . "-" . $sday, 'date_livraison', 0, 0, 0, "addprop");
2509
+			print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop");
2510 2510
 		} else {
2511 2511
 			$tmp_date_delivery = GETPOST('date_delivery') ?: -1;
2512 2512
 			print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1);
@@ -2527,7 +2527,7 @@  discard block
 block discarded – undo
2527 2527
 		// Incoterms
2528 2528
 		if (isModEnabled('incoterm')) {
2529 2529
 			print '<tr class="field_incoterm_id">';
2530
-			print '<td class="titlefieldcreate"><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1) . '</label></td>';
2530
+			print '<td class="titlefieldcreate"><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $soc->label_incoterms, 1).'</label></td>';
2531 2531
 			print '<td  class="valuefieldcreate maxwidthonsmartphone">';
2532 2532
 			print img_picto('', 'incoterm', 'class="pictofixedwidth"');
2533 2533
 			print $form->select_incoterms((!empty($soc->fk_incoterms) ? $soc->fk_incoterms : ''), (!empty($soc->location_incoterms) ? $soc->location_incoterms : ''));
@@ -2541,7 +2541,7 @@  discard block
 block discarded – undo
2541 2541
 		}
2542 2542
 		// Template to use by default
2543 2543
 		print '<tr class="field_model">';
2544
-		print '<td class="titlefieldcreate">' . $langs->trans("DefaultModel") . '</td>';
2544
+		print '<td class="titlefieldcreate">'.$langs->trans("DefaultModel").'</td>';
2545 2545
 		print '<td class="valuefieldcreate">';
2546 2546
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
2547 2547
 		$liste = ModelePDFPropales::liste_modeles($db);
@@ -2552,15 +2552,15 @@  discard block
 block discarded – undo
2552 2552
 		// Multicurrency
2553 2553
 		if (isModEnabled("multicurrency")) {
2554 2554
 			print '<tr class="field_currency">';
2555
-			print '<td class="titlefieldcreate">' . $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0) . '</td>';
2555
+			print '<td class="titlefieldcreate">'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
2556 2556
 			print '<td class="valuefieldcreate maxwidthonsmartphone">';
2557
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2557
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2558 2558
 			print '</td></tr>';
2559 2559
 		}
2560 2560
 
2561 2561
 		// Public note
2562 2562
 		print '<tr class="field_note_public">';
2563
-		print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePublic') . '</td>';
2563
+		print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePublic').'</td>';
2564 2564
 		print '<td class="valuefieldcreate">';
2565 2565
 		$note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : getDolGlobalString('PROPALE_ADDON_NOTE_PUBLIC_DEFAULT', null)), 'restricthtml');
2566 2566
 		$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
@@ -2569,7 +2569,7 @@  discard block
 block discarded – undo
2569 2569
 		// Private note
2570 2570
 		if (empty($user->socid)) {
2571 2571
 			print '<tr class="field_note_private">';
2572
-			print '<td class="titlefieldcreate tdtop">' . $langs->trans('NotePrivate') . '</td>';
2572
+			print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePrivate').'</td>';
2573 2573
 			print '<td class="valuefieldcreate">';
2574 2574
 			$note_private = $object->getDefaultCreateValueFor('note_private', ((!empty($origin) && !empty($originid) && is_object($objectsrc)) ? $objectsrc->note_private : null));
2575 2575
 			$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
@@ -2579,7 +2579,7 @@  discard block
 block discarded – undo
2579 2579
 		}
2580 2580
 
2581 2581
 		// Other attributes
2582
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
2582
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
2583 2583
 
2584 2584
 		// Lines from source
2585 2585
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
@@ -2591,13 +2591,13 @@  discard block
 block discarded – undo
2591 2591
 				$objectsrc->update_price(1, 'auto', 1);
2592 2592
 			}
2593 2593
 
2594
-			print "\n<!-- " . $classname . " info -->";
2594
+			print "\n<!-- ".$classname." info -->";
2595 2595
 			print "\n";
2596
-			print '<input type="hidden" name="amount"         value="' . $objectsrc->total_ht . '">' . "\n";
2597
-			print '<input type="hidden" name="total"          value="' . $objectsrc->total_ttc . '">' . "\n";
2598
-			print '<input type="hidden" name="tva"            value="' . $objectsrc->total_tva . '">' . "\n";
2599
-			print '<input type="hidden" name="origin"         value="' . $objectsrc->element . '">';
2600
-			print '<input type="hidden" name="originid"       value="' . $objectsrc->id . '">';
2596
+			print '<input type="hidden" name="amount"         value="'.$objectsrc->total_ht.'">'."\n";
2597
+			print '<input type="hidden" name="total"          value="'.$objectsrc->total_ttc.'">'."\n";
2598
+			print '<input type="hidden" name="tva"            value="'.$objectsrc->total_tva.'">'."\n";
2599
+			print '<input type="hidden" name="origin"         value="'.$objectsrc->element.'">';
2600
+			print '<input type="hidden" name="originid"       value="'.$objectsrc->id.'">';
2601 2601
 
2602 2602
 			$newclassname = $classname;
2603 2603
 			if ($newclassname == 'Propal') {
@@ -2610,22 +2610,22 @@  discard block
 block discarded – undo
2610 2610
 				$newclassname = 'Intervention';
2611 2611
 			}
2612 2612
 
2613
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2614
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td></tr>';
2615
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2613
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2614
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
2615
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2616 2616
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1
2617
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2617
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2618 2618
 			}
2619 2619
 
2620 2620
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2
2621
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2621
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2622 2622
 			}
2623
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . "</td></tr>";
2623
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc, 0, $langs, 1, -1, -1, $conf->currency)."</td></tr>";
2624 2624
 
2625 2625
 			if (isModEnabled("multicurrency")) {
2626
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2627
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2628
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2626
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2627
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2628
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2629 2629
 			}
2630 2630
 		}
2631 2631
 
@@ -2646,16 +2646,16 @@  discard block
 block discarded – undo
2646 2646
 			// For backward compatibility
2647 2647
 			print '<tr>';
2648 2648
 			print '<td><input type="radio" name="createmode" value="copy"></td>';
2649
-			print '<td>' . $langs->trans("CopyPropalFrom") . ' </td>';
2649
+			print '<td>'.$langs->trans("CopyPropalFrom").' </td>';
2650 2650
 			print '<td>';
2651 2651
 			$liste_propal = array();
2652 2652
 			$liste_propal[0] = '';
2653 2653
 
2654 2654
 			$sql = "SELECT p.rowid as id, p.ref, s.nom";
2655
-			$sql .= " FROM " . MAIN_DB_PREFIX . "propal p";
2656
-			$sql .= ", " . MAIN_DB_PREFIX . "societe s";
2655
+			$sql .= " FROM ".MAIN_DB_PREFIX."propal p";
2656
+			$sql .= ", ".MAIN_DB_PREFIX."societe s";
2657 2657
 			$sql .= " WHERE s.rowid = p.fk_soc";
2658
-			$sql .= " AND p.entity IN (" . getEntity('propal') . ")";
2658
+			$sql .= " AND p.entity IN (".getEntity('propal').")";
2659 2659
 			$sql .= " AND p.fk_statut <> 0";
2660 2660
 			$sql .= " ORDER BY Id";
2661 2661
 
@@ -2665,7 +2665,7 @@  discard block
 block discarded – undo
2665 2665
 				$i = 0;
2666 2666
 				while ($i < $num) {
2667 2667
 					$row = $db->fetch_row($resql);
2668
-					$propalRefAndSocName = $row[1] . " - " . $row[2];
2668
+					$propalRefAndSocName = $row[1]." - ".$row[2];
2669 2669
 					$liste_propal[$row[0]] = $propalRefAndSocName;
2670 2670
 					$i++;
2671 2671
 				}
@@ -2676,7 +2676,7 @@  discard block
 block discarded – undo
2676 2676
 			print '</td></tr>';
2677 2677
 
2678 2678
 			print '<tr><td class="tdtop"><input type="radio" name="createmode" value="empty" checked></td>';
2679
-			print '<td valign="top" colspan="2">' . $langs->trans("CreateEmptyPropal") . '</td></tr>';
2679
+			print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
2680 2680
 			print '</table>';
2681 2681
 		}
2682 2682
 	}
@@ -2756,9 +2756,9 @@  discard block
 block discarded – undo
2756 2756
 		//Form to close proposal (signed or not)
2757 2757
 		$formquestion = array();
2758 2758
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2759
-			$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)));
2759
+			$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)));
2760 2760
 		}
2761
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2761
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2762 2762
 
2763 2763
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2764 2764
 			// This is a hidden option:
@@ -2768,7 +2768,7 @@  discard block
 block discarded – undo
2768 2768
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2769 2769
 
2770 2770
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2771
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2771
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2772 2772
 
2773 2773
 				$object->fetchObjectLinked();
2774 2774
 
@@ -2854,7 +2854,7 @@  discard block
 block discarded – undo
2854 2854
 						'type' => 'onecolumn',
2855 2855
 						'value' => '
2856 2856
 							<script>
2857
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2857
+								let signedValue = ' . $object::STATUS_SIGNED.';
2858 2858
 
2859 2859
 								$(document).ready(function() {
2860 2860
 									$("[name=generate_deposit]").change(function () {
@@ -2894,7 +2894,7 @@  discard block
 block discarded – undo
2894 2894
 		}
2895 2895
 
2896 2896
 		if (isModEnabled('notification')) {
2897
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2897
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2898 2898
 			$notify = new Notify($db);
2899 2899
 			$formquestion = array_merge($formquestion, array(
2900 2900
 				array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
@@ -2904,7 +2904,7 @@  discard block
 block discarded – undo
2904 2904
 		if (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) {
2905 2905
 			$formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2906 2906
 		} else {
2907
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2907
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2908 2908
 		}
2909 2909
 	} elseif ($action == 'cancel') {
2910 2910
 		// Confirm cancel
@@ -2917,7 +2917,7 @@  discard block
 block discarded – undo
2917 2917
 		$formconfirm = $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id]), $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
2918 2918
 	} elseif ($action == 'ask_deleteline') {
2919 2919
 		// Confirmation delete product/service line
2920
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2920
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2921 2921
 	} elseif ($action == 'ask_subtotal_deleteline') {
2922 2922
 		// Confirmation de la suppression d'une ligne subtotal
2923 2923
 		$langs->load("subtotals");
@@ -2928,7 +2928,7 @@  discard block
 block discarded – undo
2928 2928
 			$title = "DeleteTitleLine";
2929 2929
 			$question = "ConfirmDeleteTitleLine";
2930 2930
 		}
2931
-		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2931
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2932 2932
 	} elseif ($action == 'validate') {
2933 2933
 		// Confirm validate proposal
2934 2934
 		$error = 0;
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
 
2948 2948
 		$text = $langs->trans('ConfirmValidateProp', $numref);
2949 2949
 		if (isModEnabled('notification')) {
2950
-			require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2950
+			require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2951 2951
 			$notify = new Notify($db);
2952 2952
 			$text .= '<br>';
2953 2953
 			$text .= $notify->confirmMessage('PROPAL_VALIDATE', $object->socid, $object);
@@ -2957,7 +2957,7 @@  discard block
 block discarded – undo
2957 2957
 		$nbMandated = 0;
2958 2958
 		foreach ($object->lines as $line) {
2959 2959
 			$res = $line->fetch_product();
2960
-			if ($res  > 0) {
2960
+			if ($res > 0) {
2961 2961
 				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2962 2962
 					$nbMandated++;
2963 2963
 					break;
@@ -2969,7 +2969,7 @@  discard block
 block discarded – undo
2969 2969
 				setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2970 2970
 				$error++;
2971 2971
 			} else {
2972
-				$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2972
+				$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2973 2973
 			}
2974 2974
 		}
2975 2975
 
@@ -2993,16 +2993,16 @@  discard block
 block discarded – undo
2993 2993
 
2994 2994
 	// Proposal card
2995 2995
 
2996
-	$linkback = '<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
2996
+	$linkback = '<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2997 2997
 
2998 2998
 	$morehtmlref = '<div class="refidno">';
2999 2999
 	// Ref customer
3000 3000
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
3001
-	$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);
3001
+	$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);
3002 3002
 	// Thirdparty
3003
-	$morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer');
3003
+	$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
3004 3004
 	if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $soc->id > 0) {
3005
-		$morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/comm/propal/list.php?socid=' . $soc->id . '&search_societe=' . urlencode($soc->name) . '">' . $langs->trans("OtherProposals") . '</a>)';
3005
+		$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$soc->id.'&search_societe='.urlencode($soc->name).'">'.$langs->trans("OtherProposals").'</a>)';
3006 3006
 	}
3007 3007
 	// Project
3008 3008
 	if (isModEnabled('project')) {
@@ -3011,16 +3011,16 @@  discard block
 block discarded – undo
3011 3011
 		if ($usercancreate) {
3012 3012
 			$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
3013 3013
 			if ($action != 'classify') {
3014
-				$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
3014
+				$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
3015 3015
 			}
3016
-			$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
3016
+			$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
3017 3017
 		} else {
3018 3018
 			if (!empty($object->fk_project)) {
3019 3019
 				$proj = new Project($db);
3020 3020
 				$proj->fetch($object->fk_project);
3021 3021
 				$morehtmlref .= $proj->getNomUrl(1);
3022 3022
 				if ($proj->title) {
3023
-					$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
3023
+					$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
3024 3024
 				}
3025 3025
 			}
3026 3026
 		}
@@ -3050,7 +3050,7 @@  discard block
 block discarded – undo
3050 3050
 			$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3051 3051
 		}
3052 3052
 
3053
-		print '<tr><td class="titlefieldmax45">' . $langs->trans('Discounts') . '</td><td>';
3053
+		print '<tr><td class="titlefieldmax45">'.$langs->trans('Discounts').'</td><td>';
3054 3054
 
3055 3055
 		$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3056 3056
 		$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3061,8 +3061,8 @@  discard block
 block discarded – undo
3061 3061
 
3062 3062
 		$thirdparty = $soc;
3063 3063
 		$discount_type = 0;
3064
-		$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3065
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3064
+		$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3065
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3066 3066
 
3067 3067
 		print '</td></tr>';
3068 3068
 
@@ -3081,12 +3081,12 @@  discard block
 block discarded – undo
3081 3081
 		print $form->editfieldkey("DatePropal", 'date', '', $object, (int) $editenable);
3082 3082
 		print '</td><td class="valuefield">';
3083 3083
 		if ($action == 'editdate' && $usercancreate && $caneditfield) {
3084
-			print '<form name="editdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3085
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3084
+			print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3085
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3086 3086
 			print '<input type="hidden" name="action" value="setdate">';
3087
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3087
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3088 3088
 			print $form->selectDate($object->date, 're', 0, 0, 0, "editdate");
3089
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3089
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3090 3090
 			print '</form>';
3091 3091
 		} else {
3092 3092
 			if ($object->date) {
@@ -3104,17 +3104,17 @@  discard block
 block discarded – undo
3104 3104
 		print $langs->trans('DateEndPropal');
3105 3105
 		print '</td>';
3106 3106
 		if ($action != 'editecheance' && $usercancreate && $caneditfield) {
3107
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editecheance&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>';
3107
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editecheance&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
3108 3108
 		}
3109 3109
 		print '</tr></table>';
3110 3110
 		print '</td><td class="valuefield">';
3111 3111
 		if ($action == 'editecheance' && $usercancreate && $caneditfield) {
3112
-			print '<form name="editecheance" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3113
-			print '<input type="hidden" name="token" value="' . newToken() . '">';
3112
+			print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3113
+			print '<input type="hidden" name="token" value="'.newToken().'">';
3114 3114
 			print '<input type="hidden" name="action" value="setecheance">';
3115
-			print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3115
+			print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3116 3116
 			print $form->selectDate($object->fin_validite, 'ech', 0, 0, 0, "editecheance");
3117
-			print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3117
+			print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3118 3118
 			print '</form>';
3119 3119
 		} else {
3120 3120
 			if (!empty($object->fin_validite)) {
@@ -3135,14 +3135,14 @@  discard block
 block discarded – undo
3135 3135
 		print $langs->trans('PaymentConditionsShort');
3136 3136
 		print '</td>';
3137 3137
 		if ($action != 'editconditions' && $usercancreate && $caneditfield) {
3138
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetConditions'), 1) . '</a></td>';
3138
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'</a></td>';
3139 3139
 		}
3140 3140
 		print '</tr></table>';
3141 3141
 		print '</td><td class="valuefield">';
3142 3142
 		if ($action == 'editconditions' && $usercancreate && $caneditfield) {
3143
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3143
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 0, '', 1, $object->deposit_percent);
3144 3144
 		} else {
3145
-			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3145
+			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 0, '', 1, $object->deposit_percent);
3146 3146
 		}
3147 3147
 		print '</td>';
3148 3148
 		print '</tr>';
@@ -3154,14 +3154,14 @@  discard block
 block discarded – undo
3154 3154
 		print $langs->trans('PaymentMode');
3155 3155
 		print '</td>';
3156 3156
 		if ($action != 'editmode' && $usercancreate && $caneditfield) {
3157
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMode'), 1) . '</a></td>';
3157
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>';
3158 3158
 		}
3159 3159
 		print '</tr></table>';
3160 3160
 		print '</td><td class="valuefieldcreate">';
3161 3161
 		if ($action == 'editmode' && $usercancreate && $caneditfield) {
3162
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3162
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3163 3163
 		} else {
3164
-			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3164
+			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3165 3165
 		}
3166 3166
 		print '</td></tr>';
3167 3167
 
@@ -3177,20 +3177,20 @@  discard block
 block discarded – undo
3177 3177
 		print '<tr class="fielddeliverydelay"><td>';
3178 3178
 		print '<table class="nobordernopadding centpercent"><tr><td>';
3179 3179
 		if (isModEnabled('order')) {
3180
-			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod') . ' (' . $langs->trans('AfterOrder') . ')');
3180
+			print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')');
3181 3181
 		} else {
3182 3182
 			print $langs->trans('AvailabilityPeriod');
3183 3183
 		}
3184 3184
 		print '</td>';
3185 3185
 		if ($action != 'editavailability' && $usercancreate && $caneditfield) {
3186
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editavailability&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1) . '</a></td>';
3186
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editavailability&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).'</a></td>';
3187 3187
 		}
3188 3188
 		print '</tr></table>';
3189 3189
 		print '</td><td class="valuefield">';
3190 3190
 		if ($action == 'editavailability' && $usercancreate && $caneditfield) {
3191
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3191
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3192 3192
 		} else {
3193
-			$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3193
+			$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3194 3194
 		}
3195 3195
 
3196 3196
 		print '</td>';
@@ -3203,14 +3203,14 @@  discard block
 block discarded – undo
3203 3203
 			print $langs->trans('SendingMethod');
3204 3204
 			print '</td>';
3205 3205
 			if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) {
3206
-				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editshippingmethod&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetShippingMode'), 1) . '</a></td>';
3206
+				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
3207 3207
 			}
3208 3208
 			print '</tr></table>';
3209 3209
 			print '</td><td class="valuefield">';
3210 3210
 			if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) {
3211
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3211
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3212 3212
 			} else {
3213
-				$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3213
+				$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3214 3214
 			}
3215 3215
 			print '</td>';
3216 3216
 			print '</tr>';
@@ -3219,16 +3219,16 @@  discard block
 block discarded – undo
3219 3219
 		// Warehouse
3220 3220
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL')) {
3221 3221
 			$langs->load('stocks');
3222
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3222
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3223 3223
 			$formproduct = new FormProduct($db);
3224 3224
 			print '<tr class="field_warehouse_id"><td>';
3225 3225
 			$editenable = $usercancreate;
3226 3226
 			print $form->editfieldkey("Warehouse", 'warehouse', '', $object, $editenable);
3227 3227
 			print '</td><td class="valuefieldcreate">';
3228 3228
 			if ($action == 'editwarehouse') {
3229
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3229
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3230 3230
 			} else {
3231
-				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3231
+				$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3232 3232
 			}
3233 3233
 			print '</td>';
3234 3234
 			print '</tr>';
@@ -3240,14 +3240,14 @@  discard block
 block discarded – undo
3240 3240
 		print $langs->trans('Source');
3241 3241
 		print '</td>';
3242 3242
 		if ($action != 'editdemandreason' && $usercancreate) {
3243
-			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editdemandreason&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1) . '</a></td>';
3243
+			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdemandreason&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).'</a></td>';
3244 3244
 		}
3245 3245
 		print '</tr></table>';
3246 3246
 		print '</td><td class="valuefield">';
3247 3247
 		if ($action == 'editdemandreason' && $usercancreate) {
3248
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3248
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3249 3249
 		} else {
3250
-			$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3250
+			$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3251 3251
 		}
3252 3252
 		print '</td>';
3253 3253
 		print '</tr>';
@@ -3259,7 +3259,7 @@  discard block
 block discarded – undo
3259 3259
 			print '</td><td class="valuefield">';
3260 3260
 			$arrayoutstandingbills = $soc->getOutstandingBills();
3261 3261
 			print($arrayoutstandingbills['opened'] > $soc->outstanding_limit ? img_warning() : '');
3262
-			print price($arrayoutstandingbills['opened']) . ' / ';
3262
+			print price($arrayoutstandingbills['opened']).' / ';
3263 3263
 			print price($soc->outstanding_limit, 0, $langs, 1, -1, -1, $conf->currency);
3264 3264
 			print '</td>';
3265 3265
 			print '</tr>';
@@ -3272,14 +3272,14 @@  discard block
 block discarded – undo
3272 3272
 			print $langs->trans('BankAccount');
3273 3273
 			print '</td>';
3274 3274
 			if ($action != 'editbankaccount' && $usercancreate) {
3275
-				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>';
3275
+				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>';
3276 3276
 			}
3277 3277
 			print '</tr></table>';
3278 3278
 			print '</td><td class="valuefield">';
3279 3279
 			if ($action == 'editbankaccount') {
3280
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3280
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3281 3281
 			} else {
3282
-				$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3282
+				$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3283 3283
 			}
3284 3284
 			print '</td>';
3285 3285
 			print '</tr>';
@@ -3290,13 +3290,13 @@  discard block
 block discarded – undo
3290 3290
 			$totalWeight = isset($tmparray['weight']) ? $tmparray['weight'] : 0;
3291 3291
 			$totalVolume = isset($tmparray['volume']) ? $tmparray['volume'] : 0;
3292 3292
 			if ($totalWeight) {
3293
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3293
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3294 3294
 				print '<td class="valuefield">';
3295 3295
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'), 1);
3296 3296
 				print '</td></tr>';
3297 3297
 			}
3298 3298
 			if ($totalVolume) {
3299
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3299
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3300 3300
 				print '<td class="valuefield">';
3301 3301
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'), 1);
3302 3302
 				print '</td></tr>';
@@ -3310,7 +3310,7 @@  discard block
 block discarded – undo
3310 3310
 			print $langs->trans('IncotermLabel');
3311 3311
 			print '<td><td class="right">';
3312 3312
 			if ($action != 'editincoterm' && $usercancreate && $caneditfield) {
3313
-				print '<a class="editfielda" href="' . DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id . '&action=editincoterm&token=' . newToken() . '">' . img_edit() . '</a>';
3313
+				print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
3314 3314
 			} else {
3315 3315
 				print '&nbsp;';
3316 3316
 			}
@@ -3318,7 +3318,7 @@  discard block
 block discarded – undo
3318 3318
 			print '</td>';
3319 3319
 			print '<td class="valuefield">';
3320 3320
 			if ($action == 'editincoterm' && $usercancreate && $caneditfield) {
3321
-				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
3321
+				print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3322 3322
 			} else {
3323 3323
 				print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3324 3324
 			}
@@ -3353,7 +3353,7 @@  discard block
 block discarded – undo
3353 3353
 		}
3354 3354
 
3355 3355
 		// Other attributes
3356
-		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3356
+		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3357 3357
 
3358 3358
 		print '</table>';
3359 3359
 
@@ -3363,53 +3363,53 @@  discard block
 block discarded – undo
3363 3363
 
3364 3364
 		print '<table class="border tableforfield centpercent">';
3365 3365
 
3366
-		include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3366
+		include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3367 3367
 
3368 3368
 		print '<tr>';
3369
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3370
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3369
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3370
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3371 3371
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3372
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3372
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3373 3373
 		}
3374 3374
 		print '</tr>';
3375 3375
 
3376 3376
 		print '<tr>';
3377
-		print '<td>' . $langs->trans('AmountVAT') . '</td>';
3378
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3377
+		print '<td>'.$langs->trans('AmountVAT').'</td>';
3378
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3379 3379
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3380
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3380
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3381 3381
 		}
3382 3382
 		print '</tr>';
3383 3383
 
3384 3384
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3385 3385
 			print '<tr>';
3386
-			print '<td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3387
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3386
+			print '<td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3387
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3388 3388
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3389 3389
 				$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3390 3390
 
3391
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3391
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3392 3392
 			}
3393 3393
 			print '</tr>';
3394 3394
 		}
3395 3395
 
3396 3396
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3397 3397
 			print '<tr>';
3398
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3399
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3398
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3399
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3400 3400
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3401 3401
 				$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3402 3402
 
3403
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3403
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3404 3404
 			}
3405 3405
 			print '</tr>';
3406 3406
 		}
3407 3407
 
3408 3408
 		print '<tr>';
3409
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
3410
-		print '<td class="nowrap amountcard right">' . price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency) . '</td>';
3409
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
3410
+		print '<td class="nowrap amountcard right">'.price($object->total_ttc, 0, $langs, 1, -1, -1, $conf->currency).'</td>';
3411 3411
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3412
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
3412
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, 0, $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
3413 3413
 		}
3414 3414
 		print '</tr>';
3415 3415
 
@@ -3428,13 +3428,13 @@  discard block
 block discarded – undo
3428 3428
 		if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3429 3429
 			$blocname = 'contacts';
3430 3430
 			$title = $langs->trans('ContactsAddresses');
3431
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3431
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3432 3432
 		}
3433 3433
 
3434 3434
 		if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3435 3435
 			$blocname = 'notes';
3436 3436
 			$title = $langs->trans('Notes');
3437
-			include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3437
+			include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3438 3438
 		}
3439 3439
 
3440 3440
 		/*
@@ -3449,20 +3449,20 @@  discard block
 block discarded – undo
3449 3449
 		global $inputalsopricewithtax;
3450 3450
 		$inputalsopricewithtax = 1;
3451 3451
 
3452
-		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3453
-		<input type="hidden" name="token" value="' . newToken() . '">
3454
-		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3452
+		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3453
+		<input type="hidden" name="token" value="' . newToken().'">
3454
+		<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3455 3455
 		<input type="hidden" name="mode" value="">
3456 3456
 		<input type="hidden" name="page_y" value="">
3457
-		<input type="hidden" name="backtopage" value="' . $backtopage . '">
3458
-		<input type="hidden" name="id" value="' . $object->id . '">
3457
+		<input type="hidden" name="backtopage" value="' . $backtopage.'">
3458
+		<input type="hidden" name="id" value="' . $object->id.'">
3459 3459
 		';
3460 3460
 
3461 3461
 		if (!empty($conf->use_javascript_ajax) && $object->status == Propal::STATUS_DRAFT) {
3462 3462
 			if (isModEnabled('subtotals')) {
3463
-				include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3463
+				include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3464 3464
 			} else {
3465
-				include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3465
+				include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3466 3466
 			}
3467 3467
 		}
3468 3468
 
@@ -3517,7 +3517,7 @@  discard block
 block discarded – undo
3517 3517
 		if (empty($reshook)) {
3518 3518
 			if ($action != 'editline') {
3519 3519
 				// Subtotal
3520
-				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3520
+				if ($object->status == Propal::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
3521 3521
 					$langs->load('subtotals');
3522 3522
 
3523 3523
 					$url_button = array();
@@ -3527,7 +3527,7 @@  discard block
 block discarded – undo
3527 3527
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3528 3528
 						'perm' => (bool) $usercancreate,
3529 3529
 						'label' => $langs->trans('AddTitleLine'),
3530
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
3530
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
3531 3531
 					);
3532 3532
 
3533 3533
 					$url_button[] = array(
@@ -3535,7 +3535,7 @@  discard block
 block discarded – undo
3535 3535
 						'enabled' => (isModEnabled('propal') && $object->status == Propal::STATUS_DRAFT),
3536 3536
 						'perm' => (bool) $usercancreate,
3537 3537
 						'label' => $langs->trans('AddSubtotalLine'),
3538
-						'url' => '/comm/propal/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()
3538
+						'url' => '/comm/propal/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()
3539 3539
 					);
3540 3540
 
3541 3541
 					print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true);
@@ -3546,9 +3546,9 @@  discard block
 block discarded – undo
3546 3546
 					|| ($object->status == Propal::STATUS_DRAFT && getDolGlobalString('PROPAL_ENABLE_NEGATIVE') && count($object->lines) > 0)
3547 3547
 				) {
3548 3548
 					if ($usercanvalidate) {
3549
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=validate&token=' . newToken() . '">' . (!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')) . '</a>';
3549
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=validate&token='.newToken().'">'.(!getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') ? $langs->trans('Validate') : $langs->trans('ValidateAndSign')).'</a>';
3550 3550
 					} else {
3551
-						print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans('Validate') . '</a>';
3551
+						print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans('Validate').'</a>';
3552 3552
 					}
3553 3553
 				}
3554 3554
 				// Create event
@@ -3558,23 +3558,23 @@  discard block
 block discarded – undo
3558 3558
 				}*/
3559 3559
 				// Edit
3560 3560
 				if ($object->status == Propal::STATUS_VALIDATED && $usercancreate) {
3561
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=modif&token=' . newToken() . '">' . $langs->trans('Modify') . '</a>';
3561
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=modif&token='.newToken().'">'.$langs->trans('Modify').'</a>';
3562 3562
 				}
3563 3563
 
3564 3564
 				// ReOpen
3565 3565
 				if (((getDolGlobalString('PROPAL_REOPEN_UNSIGNED_ONLY') && $object->status == Propal::STATUS_NOTSIGNED) || (!getDolGlobalString('PROPAL_REOPEN_UNSIGNED_ONLY') && ($object->status == Propal::STATUS_SIGNED || $object->status == Propal::STATUS_NOTSIGNED || $object->status == Propal::STATUS_BILLED || $object->status == Propal::STATUS_CANCELED)))) {
3566 3566
 					if ($usercanreopen) {
3567
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=reopen&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen') . '"';
3568
-						print '>' . $langs->trans('ReOpen') . '</a>';
3567
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#reopen').'"';
3568
+						print '>'.$langs->trans('ReOpen').'</a>';
3569 3569
 					} else {
3570
-						print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ReOpen") . '</a>';
3570
+						print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ReOpen").'</a>';
3571 3571
 					}
3572 3572
 				}
3573 3573
 
3574 3574
 				// Send
3575 3575
 				if (empty($user->socid)) {
3576 3576
 					if ($object->status == Propal::STATUS_VALIDATED || $object->status == Propal::STATUS_SIGNED || getDolGlobalString('PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS')) {
3577
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '', $usercansend);
3577
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '', $usercansend);
3578 3578
 					}
3579 3579
 				}
3580 3580
 
@@ -3586,7 +3586,7 @@  discard block
 block discarded – undo
3586 3586
 					'enabled' => (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED),
3587 3587
 					'perm' => $usercancreateorder,
3588 3588
 					'label' => 'AddOrder',
3589
-					'url' => '/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3589
+					'url' => '/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3590 3590
 				);
3591 3591
 				/*if (isModEnabled('order') && $object->status == Propal::STATUS_SIGNED) {
3592 3592
 					if ($usercancreateorder) {
@@ -3601,7 +3601,7 @@  discard block
 block discarded – undo
3601 3601
 						'enabled' => ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")),
3602 3602
 						'perm' => $usercancreatepurchaseorder,
3603 3603
 						'label' => 'AddPurchaseOrder',
3604
-						'url' => '/fourn/commande/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3604
+						'url' => '/fourn/commande/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3605 3605
 					);
3606 3606
 					/*if ($object->status == Propal::STATUS_SIGNED && isModEnabled("supplier_order")) {
3607 3607
 						if ($usercancreatepurchaseorder) {
@@ -3616,7 +3616,7 @@  discard block
 block discarded – undo
3616 3616
 					'enabled' => (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED),
3617 3617
 					'perm' => $usercancreateintervention,
3618 3618
 					'label' => 'AddIntervention',
3619
-					'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3619
+					'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3620 3620
 				);
3621 3621
 				/*if (isModEnabled("service") && isModEnabled('intervention') && $object->status == Propal::STATUS_SIGNED) {
3622 3622
 					if ($usercancreateintervention) {
@@ -3631,7 +3631,7 @@  discard block
 block discarded – undo
3631 3631
 					'enabled' => (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED),
3632 3632
 					'perm' => $usercancreatecontract,
3633 3633
 					'label' => 'AddContract',
3634
-					'url' => '/contrat/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid)
3634
+					'url' => '/contrat/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid)
3635 3635
 				);
3636 3636
 				/*if (isModEnabled('contract') && $object->status == Propal::STATUS_SIGNED) {
3637 3637
 					$langs->load("contracts");
@@ -3648,7 +3648,7 @@  discard block
 block discarded – undo
3648 3648
 						'enabled' => isModEnabled('invoice'),
3649 3649
 						'perm' => $usercancreateinvoice,
3650 3650
 						'label' => 'CreateBill',
3651
-						'url' => '/compta/facture/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
3651
+						'url' => '/compta/facture/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid),
3652 3652
 					];
3653 3653
 					/*if (isModEnabled('invoice') && $usercancreateinvoice) {
3654 3654
 						print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
@@ -3657,7 +3657,7 @@  discard block
 block discarded – undo
3657 3657
 
3658 3658
 				$actionButtonsParameters = [
3659 3659
 					"areDropdownButtons" => !getDolGlobalInt("MAIN_REMOVE_DROPDOWN_CREATE_BUTTONS_ON_ORDER"),
3660
-					"backtopage" => $_SERVER["PHP_SELF"] . "?id=" . ((int) $id)
3660
+					"backtopage" => $_SERVER["PHP_SELF"]."?id=".((int) $id)
3661 3661
 				];
3662 3662
 
3663 3663
 				if ($numlines > 0) {
@@ -3670,9 +3670,9 @@  discard block
 block discarded – undo
3670 3670
 					$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
3671 3671
 					if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || !getDolGlobalString('WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED')) {
3672 3672
 						if ($usercanclose) {
3673
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled&token=' . newToken() . '&socid=' . $object->socid . '">' . $langs->trans("ClassifyBilled") . '</a>';
3673
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=classifybilled&token='.newToken().'&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").'</a>';
3674 3674
 						} else {
3675
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '">' . $langs->trans("ClassifyBilled") . '</a>';
3675
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("ClassifyBilled").'</a>';
3676 3676
 						}
3677 3677
 					}
3678 3678
 				}
@@ -3681,33 +3681,33 @@  discard block
 block discarded – undo
3681 3681
 					// Close as accepted/refused
3682 3682
 					if ($object->status == Propal::STATUS_VALIDATED) {
3683 3683
 						if ($usercanclose) {
3684
-							print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3685
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3684
+							print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3685
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3686 3686
 						} else {
3687
-							print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("NotEnoughPermissions") . '"';
3688
-							print '>' . $langs->trans('SetAcceptedRefused') . '</a>';
3687
+							print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
3688
+							print '>'.$langs->trans('SetAcceptedRefused').'</a>';
3689 3689
 						}
3690 3690
 					}
3691 3691
 				} else {
3692 3692
 					// Set not signed (close)
3693 3693
 					if ($object->status == Propal::STATUS_DRAFT && $usercanclose) {
3694
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token=' . newToken() . '&action=closeas&token=' . newToken() . (!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close') . '"';
3695
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3694
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(!getDolGlobalString('MAIN_JUMP_TAG') ? '' : '#close').'"';
3695
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3696 3696
 					}
3697 3697
 				}
3698 3698
 
3699 3699
 				// Cancel propal
3700 3700
 				if ($object->status > Propal::STATUS_DRAFT && $usercanclose) {
3701
-					print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelPropal") . '</a>';
3701
+					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelPropal").'</a>';
3702 3702
 				}
3703 3703
 
3704 3704
 				// Clone
3705 3705
 				if ($usercancreate) {
3706
-					print '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&token=' . newToken() . '&object=' . $object->element . '">' . $langs->trans("ToClone") . '</a>';
3706
+					print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object='.$object->element.'">'.$langs->trans("ToClone").'</a>';
3707 3707
 				}
3708 3708
 
3709 3709
 				// Delete
3710
-				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=delete&token=' . newToken(), 'delete', $usercandelete);
3710
+				print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $usercandelete);
3711 3711
 			}
3712 3712
 		}
3713 3713
 
@@ -3726,8 +3726,8 @@  discard block
 block discarded – undo
3726 3726
 		 * Generated documents
3727 3727
 		 */
3728 3728
 		$objref = dol_sanitizeFileName($object->ref);
3729
-		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity] . "/" . dol_sanitizeFileName($object->ref);
3730
-		$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3729
+		$filedir = $conf->propal->multidir_output[$object->entity ?? $conf->entity]."/".dol_sanitizeFileName($object->ref);
3730
+		$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3731 3731
 		$genallowed = $usercanread;
3732 3732
 		$delallowed = $usercancreate;
3733 3733
 		$tooltipAfterComboOfModels = '';
@@ -3754,19 +3754,19 @@  discard block
 block discarded – undo
3754 3754
 
3755 3755
 		if ($object->status != Propal::STATUS_DRAFT && $useonlinesignature) {
3756 3756
 			print '<br><!-- Link to sign -->';
3757
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/signature.lib.php';
3758
-			print showOnlineSignatureUrl('proposal', $object->ref, $object) . '<br>';
3757
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
3758
+			print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>';
3759 3759
 		}
3760 3760
 
3761 3761
 		print '</div><div class="fichehalfright">';
3762 3762
 
3763 3763
 		$MAXEVENT = 10;
3764 3764
 
3765
-		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/comm/propal/messaging.php?id=' . $object->id);
3766
-		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/comm/propal/agenda.php?id=' . $object->id);
3765
+		$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/comm/propal/messaging.php?id='.$object->id);
3766
+		$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/comm/propal/agenda.php?id='.$object->id);
3767 3767
 
3768 3768
 		// List of actions on element
3769
-		include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3769
+		include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3770 3770
 		$formactions = new FormActions($db);
3771 3771
 		$somethingshown = $formactions->showactions($object, 'propal', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3772 3772
 
@@ -3777,9 +3777,9 @@  discard block
 block discarded – undo
3777 3777
 	$modelmail = 'propal_send';
3778 3778
 	$defaulttopic = 'SendPropalRef';
3779 3779
 	$diroutput = $conf->propal->multidir_output[$object->entity ?? $conf->entity];
3780
-	$trackid = 'pro' . $object->id;
3780
+	$trackid = 'pro'.$object->id;
3781 3781
 
3782
-	include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3782
+	include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3783 3783
 }
3784 3784
 
3785 3785
 // End of page
Please login to merge, or discard this patch.
htdocs/contrat/card.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
 $object = new Contrat($db);
105 105
 $extrafields = new ExtraFields($db);
106 106
 $ret = 0;
107
-$pu_ht = null;  // Init for static analysis
108
-$pu_ttc = null;  // Init for static analysis
107
+$pu_ht = null; // Init for static analysis
108
+$pu_ttc = null; // Init for static analysis
109 109
 
110 110
 // Load object
111 111
 if ($id > 0 || !empty($ref) && $action != 'add') {
@@ -127,10 +127,10 @@  discard block
 block discarded – undo
127 127
 $permissionnote = $user->hasRight('contrat', 'creer'); // Used by the include of actions_setnotes.inc.php
128 128
 $permissiondellink = $user->hasRight('contrat', 'creer'); // Used by the include of actions_dellink.inc.php
129 129
 $permissiontodelete = ($user->hasRight('contrat', 'creer') && $object->status == $object::STATUS_DRAFT) || $user->hasRight('contrat', 'supprimer');
130
-$permissiontoadd   = $user->hasRight('contrat', 'creer');     //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
130
+$permissiontoadd   = $user->hasRight('contrat', 'creer'); //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
131 131
 $permissiontoedit = $permissiontoadd;
132 132
 $permissiontoactivate = $user->hasRight('contrat', 'activer');
133
-$permissiontodisable = $user->hasRight('contrat', 'desactiver');	// TODO use same than $permissiontoactivate
133
+$permissiontodisable = $user->hasRight('contrat', 'desactiver'); // TODO use same than $permissiontoactivate
134 134
 $permissiontoeditextra = $permissiontoadd;
135 135
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
136 136
 	// For action 'update_extras', is there a specific permission set for the attribute to update
@@ -157,14 +157,14 @@  discard block
 block discarded – undo
157 157
 	setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
158 158
 }
159 159
 if (empty($reshook)) {
160
-	$backurlforlist = dolBuildUrl(DOL_URL_ROOT . '/contrat/list.php');
160
+	$backurlforlist = dolBuildUrl(DOL_URL_ROOT.'/contrat/list.php');
161 161
 
162 162
 	if (empty($backtopage) || ($cancel && empty($id))) {
163 163
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
164 164
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
165 165
 				$backtopage = $backurlforlist;
166 166
 			} else {
167
-				$backtopage = dolBuildUrl(DOL_URL_ROOT . '/contrat/card.php', ['id'=> ((!empty($id) && $id > 0) ? $id : '__ID__')]);
167
+				$backtopage = dolBuildUrl(DOL_URL_ROOT.'/contrat/card.php', ['id'=> ((!empty($id) && $id > 0) ? $id : '__ID__')]);
168 168
 			}
169 169
 		}
170 170
 	}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
 	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
186 186
 
187
-	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';  // Must be 'include', not 'include_once'
187
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
188 188
 
189 189
 	if ($action == 'confirm_active' && $confirm == 'yes' && $permissiontoactivate) {
190 190
 		$date_start = '';
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	} elseif ($action == 'confirm_sign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) {
208 208
 		$result = $object->setSignedStatus($user, GETPOSTINT('signed_status'), 0, 'CONTRACT_MODIFY');
209 209
 		if ($result >= 0) {
210
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
210
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
211 211
 			exit;
212 212
 		} else {
213 213
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	} elseif ($action == 'confirm_unsign' && $confirm == 'yes' && $user->hasRight('contract', 'creer')) {
216 216
 		$result = $object->setSignedStatus($user, Contrat::$SIGNED_STATUSES['STATUS_NO_SIGNATURE'], 0, 'CONTRACT_MODIFY');
217 217
 		if ($result >= 0) {
218
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
218
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
219 219
 			exit;
220 220
 		} else {
221 221
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
 
347 347
 					$classname = ucfirst($subelement);
348 348
 					$srcobject = new $classname($db);
349
-					'@phan-var-force Commande|Propal|Facture $srcobject';  // Can be other class, but CommonObject is too Generic
349
+					'@phan-var-force Commande|Propal|Facture $srcobject'; // Can be other class, but CommonObject is too Generic
350 350
 
351 351
 					dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
352 352
 					$result = $srcobject->fetch($object->origin_id);
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 			}
772 772
 			$objectline->fetch_optionals();
773 773
 
774
-			$objectline->oldcopy = dol_clone($objectline, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
774
+			$objectline->oldcopy = dol_clone($objectline, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
775 775
 		} else {
776 776
 			$objectline = null;
777 777
 		}
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
 	} elseif ($action == 'confirm_activate' && $confirm == 'yes' && $permissiontoactivate) {
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');
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
 		print '<td>';
1264 1264
 		print img_picto('', 'company', 'class="pictofixedwidth"');
1265 1265
 		print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, array(), 0, 'minwidth150 widthcentpercentminusxx maxwidth500');
1266
-		print ' <a href="'.dolBuildUrl(DOL_URL_ROOT . '/societe/card.php', ['action' => 'create', 'customer' => 3, 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['action' => 'create'])]).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
1266
+		print ' <a href="'.dolBuildUrl(DOL_URL_ROOT.'/societe/card.php', ['action' => 'create', 'customer' => 3, 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['action' => 'create'])]).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
1267 1267
 		print '</td>';
1268 1268
 	}
1269 1269
 	print '</tr>'."\n";
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
 		print '<tr><td>'.$langs->trans("Project").'</td><td>';
1312 1312
 		print img_picto('', 'project', 'class="pictofixedwidth"');
1313 1313
 		$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, "projectid", 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'minwidth150 maxwidth300 widthcentpercentminusxx');
1314
-		print ' &nbsp; <a href="' . dolBuildUrl(DOL_URL_ROOT . '/projet/card.php', ['socid' => $soc->id, 'action' => 'create', 'status' => 1, 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['action' => 'create', 'socid' => $soc->id])]) . '"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
1314
+		print ' &nbsp; <a href="'.dolBuildUrl(DOL_URL_ROOT.'/projet/card.php', ['socid' => $soc->id, 'action' => 'create', 'status' => 1, 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['action' => 'create', 'socid' => $soc->id])]).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
1315 1315
 		print "</td></tr>";
1316 1316
 	}
1317 1317
 
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
 		$morehtmlref .= '<div class="refidno">';
1487 1487
 		// Ref customer
1488 1488
 		$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1);
1489
-		$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');
1489
+		$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');
1490 1490
 		// Ref supplier
1491 1491
 		$morehtmlref .= '<br>';
1492 1492
 		$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->hasRight('contrat', 'creer'), 'string', '', 0, 1);
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
 		}
1580 1580
 
1581 1581
 
1582
-		$arrayothercontracts = $object->getListOfContracts('others');	// array or -1 if technical error
1582
+		$arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error
1583 1583
 
1584 1584
 		/*
1585 1585
 		 * Lines of contracts
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
 							$description = $objp->description;
1712 1712
 
1713 1713
 							if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
1714
-								print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '') . $text;
1714
+								print (!empty($line->fk_parent_line) ? img_picto('', 'rightarrow') : '').$text;
1715 1715
 								if (!getDolGlobalInt('PRODUIT_DESC_IN_FORM')) {
1716 1716
 									print $form->textwithpicto('', $description);
1717 1717
 								}
@@ -1847,7 +1847,7 @@  discard block
 block discarded – undo
1847 1847
 								print $objp->label ? ' - '.dol_trunc($objp->label, 32) : '';
1848 1848
 								print '<input type="hidden" name="idprod" value="'.$currentLineProductId.'">';
1849 1849
 							} else {
1850
-								$senderissupplier = 0;	// @TODO Option to allow purchased products ?
1850
+								$senderissupplier = 0; // @TODO Option to allow purchased products ?
1851 1851
 								if (empty($senderissupplier)) {
1852 1852
 									if (getDolGlobalString('CONTRACT_SUPPORT_PRODUCTS')) {
1853 1853
 										$filtertype = '';
@@ -2357,9 +2357,9 @@  discard block
 block discarded – undo
2357 2357
 				// Sign
2358 2358
 				if (getDolGlobalString('CONTRACT_SHOW_SIGNATURE_STATUS_WITH_SERVICE_STATUS') && $object->status > Contrat::STATUS_DRAFT) {
2359 2359
 					if ($object->signed_status != Contrat::$SIGNED_STATUSES['STATUS_SIGNED_ALL']) {
2360
-						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>';
2360
+						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>';
2361 2361
 					} else {
2362
-						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>';
2362
+						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>';
2363 2363
 					}
2364 2364
 				}
2365 2365
 
Please login to merge, or discard this patch.
htdocs/product/stock/class/mouvementstock.class.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 				'skip_batch'       => &$skip_batch,
260 260
 				'id_product_batch' => &$id_product_batch
261 261
 			);
262
-			$reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action);    // Note that $action and $object may have been modified by some hooks
262
+			$reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
263 263
 
264 264
 			if ($reshook < 0) {
265 265
 				if (!empty($hookmanager->resPrint)) {
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 			// Update stock quantity
603 603
 			if (!$error) {
604 604
 				if ($alreadyarecord > 0) {
605
-					$sql = "UPDATE ".$this->db->prefix()."product_stock SET reel = " . ((float) $oldqtywarehouse + (float) $qty);
605
+					$sql = "UPDATE ".$this->db->prefix()."product_stock SET reel = ".((float) $oldqtywarehouse + (float) $qty);
606 606
 					$sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product);
607 607
 				} else {
608 608
 					$sql = "INSERT INTO ".$this->db->prefix()."product_stock";
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 
673 673
 		if ($movestock && !$error) {
674 674
 			// Call trigger
675
-			if ($product->stockable_product != Product::DISABLED_STOCK ) {
675
+			if ($product->stockable_product != Product::DISABLED_STOCK) {
676 676
 				$result = $this->call_trigger('STOCK_MOVEMENT', $user);
677 677
 				if ($result < 0) {
678 678
 					$error++;
@@ -752,11 +752,11 @@  discard block
 block discarded – undo
752 752
 				$this->price = $obj->price;
753 753
 				$this->fk_user_author = $obj->fk_user_author;
754 754
 				$this->label = $obj->label;
755
-				$this->fk_origin = $obj->origin_id;		// For backward compatibility
756
-				$this->origintype = $obj->origin_type;	// For backward compatibility
755
+				$this->fk_origin = $obj->origin_id; // For backward compatibility
756
+				$this->origintype = $obj->origin_type; // For backward compatibility
757 757
 				$this->origin_id = $obj->origin_id;
758 758
 				$this->origin_type = $obj->origin_type;
759
-				$this->inventorycode = $obj->movementcode;	// For backward compatibility
759
+				$this->inventorycode = $obj->movementcode; // For backward compatibility
760 760
 				$this->movementcode = $obj->movementcode;
761 761
 				$this->batch = $obj->batch;
762 762
 				$this->eatby = $this->db->jdate($obj->eatby);
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 						$this->errors[] = $langs->trans('ErrorNoteAlsoThatSubProductCantBeFollowedByLot');
827 827
 					}
828 828
 					$error = $result;
829
-					dol_syslog(__METHOD__ . ' Error : ' . $this->errorsToString(), LOG_ERR);
829
+					dol_syslog(__METHOD__.' Error : '.$this->errorsToString(), LOG_ERR);
830 830
 					break;
831 831
 				}
832 832
 				unset($tmpmove);
@@ -983,8 +983,8 @@  discard block
 block discarded – undo
983 983
 			} else {					// product_batch record not found
984 984
 				$pdluo->fk_product_stock = $vfk_product_stock;
985 985
 				$pdluo->qty = $qty;
986
-				$pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby'];		// No more used. Now eatby date is store in table of lot, no more into prouct_batch table.
987
-				$pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby'];		// No more used. Now sellby date is store in table of lot, no more into prouct_batch table.
986
+				$pdluo->eatby = empty($dluo['eatby']) ? '' : $dluo['eatby']; // No more used. Now eatby date is store in table of lot, no more into prouct_batch table.
987
+				$pdluo->sellby = empty($dluo['sellby']) ? '' : $dluo['sellby']; // No more used. Now sellby date is store in table of lot, no more into prouct_batch table.
988 988
 				$pdluo->batch = $vbatchnumber;
989 989
 
990 990
 				$result = $pdluo->create($user, 1);
@@ -1180,11 +1180,11 @@  discard block
 block discarded – undo
1180 1180
 		$label .= '<div width="100%">';
1181 1181
 		$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->id;
1182 1182
 		$label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
1183
-		$qtylabel = (($this->qty > 0) ? '<span class="stockmovemententry">+' : '<span class="stockmovementexit">') . $this->qty . '</span>';
1183
+		$qtylabel = (($this->qty > 0) ? '<span class="stockmovemententry">+' : '<span class="stockmovementexit">').$this->qty.'</span>';
1184 1184
 		if ($this->inventorycode) {
1185 1185
 			$label .= '<br><b>'.$langs->trans('InventoryCode').':</b> '.$this->inventorycode;
1186 1186
 		}
1187
-		$label .= '<br><b>'.$langs->trans('Qty').':</b> ' . $qtylabel;
1187
+		$label .= '<br><b>'.$langs->trans('Qty').':</b> '.$qtylabel;
1188 1188
 		if ($this->batch) {
1189 1189
 			$label .= '<br><b>'.$langs->trans('Batch').':</b> '.$this->batch;
1190 1190
 		}
@@ -1312,8 +1312,8 @@  discard block
 block discarded – undo
1312 1312
 		$sql = "SELECT sum(pb.qty) as cpt";
1313 1313
 		$sql .= " FROM ".$this->db->prefix()."product_batch as pb";
1314 1314
 		$sql .= " INNER JOIN ".$this->db->prefix()."product_stock as ps ON ps.rowid = pb.fk_product_stock";
1315
-		$sql .= " WHERE ps.fk_product = " . ((int) $fk_product);
1316
-		$sql .= " AND pb.batch = '" . $this->db->escape($batch) . "'";
1315
+		$sql .= " WHERE ps.fk_product = ".((int) $fk_product);
1316
+		$sql .= " AND pb.batch = '".$this->db->escape($batch)."'";
1317 1317
 
1318 1318
 		$result = $this->db->query($sql);
1319 1319
 		if ($result) {
@@ -1340,7 +1340,7 @@  discard block
 block discarded – undo
1340 1340
 	{
1341 1341
 		global $user;
1342 1342
 
1343
-		$formattedDate = "REVERT-" .($this->inventorycode ? $this->inventorycode : dol_print_date($this->datem, '%Y%m%d%His'));
1343
+		$formattedDate = "REVERT-".($this->inventorycode ? $this->inventorycode : dol_print_date($this->datem, '%Y%m%d%His'));
1344 1344
 		if ($this->inventorycode == $formattedDate) {
1345 1345
 			return -1;
1346 1346
 		}
@@ -1386,11 +1386,11 @@  discard block
 block discarded – undo
1386 1386
 	{
1387 1387
 		$date = '';
1388 1388
 
1389
-		$sql = 	"SELECT MAX(datem) as datem";
1389
+		$sql = "SELECT MAX(datem) as datem";
1390 1390
 		$sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement";
1391
-		$sql .= " WHERE fk_product = " . ((int) $fk_product);
1392
-		$sql .= " AND fk_entrepot  = " .((int) $fk_entrepot);
1393
-		$sql .= " AND batch = '" . $this->db->escape($batch) . "'";
1391
+		$sql .= " WHERE fk_product = ".((int) $fk_product);
1392
+		$sql .= " AND fk_entrepot  = ".((int) $fk_entrepot);
1393
+		$sql .= " AND batch = '".$this->db->escape($batch)."'";
1394 1394
 
1395 1395
 		$result = $this->db->query($sql);
1396 1396
 		if ($result) {
Please login to merge, or discard this patch.