Completed
Branch develop (915363)
by
unknown
19:05
created
htdocs/core/class/html.formsetup.class.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -164,12 +164,12 @@  discard block
 block discarded – undo
164 164
 			$out .= $this->htmlBeforeOutputForm;
165 165
 
166 166
 			if ($editMode) {
167
-				$out .= '<form ' . self::generateAttributesStringFromArray($this->formAttributes) . ' >';
167
+				$out .= '<form '.self::generateAttributesStringFromArray($this->formAttributes).' >';
168 168
 
169 169
 				// generate hidden values from $this->formHiddenInputs
170 170
 				if (!empty($this->formHiddenInputs) && is_array($this->formHiddenInputs)) {
171 171
 					foreach ($this->formHiddenInputs as $hiddenKey => $hiddenValue) {
172
-						$out .= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="' . dol_escape_htmltag($hiddenValue) . '">';
172
+						$out .= '<input type="hidden" name="'.dol_escape_htmltag($hiddenKey).'" value="'.dol_escape_htmltag($hiddenValue).'">';
173 173
 					}
174 174
 				}
175 175
 			}
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 			} elseif ($editMode) {
189 189
 				$out .= '<div class="form-setup-button-container center">'; // Todo : remove .center by adding style to form-setup-button-container css class in all themes
190 190
 				$out .= $this->htmlOutputMoreButton;
191
-				$out .= '<input class="button button-save" type="submit" value="' . $this->langs->trans("Save") . '">'; // Todo fix dolibarr style for <button and use <button instead of input
191
+				$out .= '<input class="button button-save" type="submit" value="'.$this->langs->trans("Save").'">'; // Todo fix dolibarr style for <button and use <button instead of input
192 192
 				/*$out .= ' &nbsp;&nbsp; ';
193 193
 				$out .= '<a class="button button-cancel" type="submit" href="' . $this->formAttributes['action'] . '">'.$this->langs->trans('Cancel').'</a>';
194 194
 				*/
@@ -232,8 +232,8 @@  discard block
 block discarded – undo
232 232
 			if (empty($hideTitle)) {
233 233
 				$out .= '<thead>';
234 234
 				$out .= '<tr class="liste_titre">';
235
-				$out .= '	<td>' . $this->langs->trans("Parameter") . '</td>';
236
-				$out .= '	<td>' . $this->langs->trans("Value") . '</td>';
235
+				$out .= '	<td>'.$this->langs->trans("Parameter").'</td>';
236
+				$out .= '	<td>'.$this->langs->trans("Value").'</td>';
237 237
 				$out .= '</tr>';
238 238
 				$out .= '</thead>';
239 239
 			}
@@ -832,7 +832,7 @@  discard block
 block discarded – undo
832 832
 		if (!empty($this->helpText)) {
833 833
 			return $this->helpText;
834 834
 		}
835
-		return (($this->langs->trans($this->confKey . 'Tooltip') != $this->confKey . 'Tooltip') ? $this->langs->trans($this->confKey . 'Tooltip') : '');
835
+		return (($this->langs->trans($this->confKey.'Tooltip') != $this->confKey.'Tooltip') ? $this->langs->trans($this->confKey.'Tooltip') : '');
836 836
 	}
837 837
 
838 838
 	/**
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
 
850 850
 		// if conf defined on entity 0, prepend a picto to indicate it will apply across all entities
851 851
 		if (isModEnabled('multicompany') && $this->entity == 0) {
852
-			$out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh') . '&nbsp;' . $out;
852
+			$out = img_picto($this->langs->trans('AllEntities'), 'fa-globe-americas em088 opacityhigh').'&nbsp;'.$out;
853 853
 		}
854 854
 
855 855
 		return $out;
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 		} elseif ($this->type == 'html') {
898 898
 			$out .= $this->generateInputFieldHtml();
899 899
 		} elseif ($this->type == 'color') {
900
-			$out .=  $this->generateInputFieldColor();
900
+			$out .= $this->generateInputFieldColor();
901 901
 		} elseif ($this->type == 'yesno') {
902 902
 			if (!empty($conf->use_javascript_ajax)) {
903 903
 				$out .= ajax_constantonoff($this->confKey);
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
 	 */
956 956
 	public function generateInputFieldTextarea()
957 957
 	{
958
-		$out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">' . "\n";
958
+		$out = '<textarea class="flat" name="'.$this->confKey.'" id="'.$this->confKey.'" cols="50" rows="5" wrap="soft">'."\n";
959 959
 		$out .= dol_htmlentities($this->fieldValue);
960 960
 		$out .= "</textarea>\n";
961 961
 		return $out;
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 	public function generateInputFieldHtml()
970 970
 	{
971 971
 		global $conf;
972
-		require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
972
+		require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
973 973
 		$doleditor = new DolEditor($this->confKey, $this->fieldValue, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
974 974
 		return $doleditor->Create(1);
975 975
 	}
@@ -1007,7 +1007,7 @@  discard block
 block discarded – undo
1007 1007
 
1008 1008
 		$out = '';
1009 1009
 		if (preg_match('/emailtemplate:/', $this->type)) {
1010
-			include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
1010
+			include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
1011 1011
 			$formmail = new FormMail($this->db);
1012 1012
 
1013 1013
 			$tmp = explode(':', $this->type);
@@ -1017,10 +1017,10 @@  discard block
 block discarded – undo
1017 1017
 				foreach ($formmail->lines_model as $modelMail) {
1018 1018
 					$moreonlabel = '';
1019 1019
 					if (!empty($arrayOfMessageName[$modelMail->label])) {
1020
-						$moreonlabel = ' <span class="opacitymedium">(' . $this->langs->trans("SeveralLangugeVariatFound") . ')</span>';
1020
+						$moreonlabel = ' <span class="opacitymedium">('.$this->langs->trans("SeveralLangugeVariatFound").')</span>';
1021 1021
 					}
1022 1022
 					// The 'label' is the key that is unique if we exclude the language
1023
-					$arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)) . $moreonlabel;
1023
+					$arrayOfMessageName[$modelMail->id] = $this->langs->trans(preg_replace('/\(|\)/', '', $modelMail->label)).$moreonlabel;
1024 1024
 				}
1025 1025
 			}
1026 1026
 			$out .= $this->form->selectarray($this->confKey, $arrayOfMessageName, $this->fieldValue, 'None', 0, 0, '', 0, 0, 0, '', '', 1);
@@ -1078,11 +1078,11 @@  discard block
 block discarded – undo
1078 1078
 			$max = $genhandler->length2;
1079 1079
 		}
1080 1080
 		$out = '<input required="required" type="password" class="flat" id="'.$this->confKey.'" name="'.$this->confKey.'" value="'.(GETPOST($this->confKey, 'alpha') ? GETPOST($this->confKey, 'alpha') : $this->fieldValue).'"';
1081
-		if ($min){
1082
-			$out .= ' minlength="' . $min . '"';
1081
+		if ($min) {
1082
+			$out .= ' minlength="'.$min.'"';
1083 1083
 		}
1084 1084
 		if ($max) {
1085
-			$out .= ' maxlength="' . $max . '"';
1085
+			$out .= ' maxlength="'.$max.'"';
1086 1086
 		}
1087 1087
 		$out .= '>';
1088 1088
 		return $out;
@@ -1208,9 +1208,9 @@  discard block
 block discarded – undo
1208 1208
 		} elseif ($this->type == 'selectUser') {
1209 1209
 			$out .= $this->generateOutputFieldSelectUser();
1210 1210
 		} elseif ($this->type == 'html') {
1211
-			$out .=  $this->fieldValue;
1211
+			$out .= $this->fieldValue;
1212 1212
 		} elseif ($this->type == 'color') {
1213
-			$out .=  $this->generateOutputFieldColor();
1213
+			$out .= $this->generateOutputFieldColor();
1214 1214
 		} elseif ($this->type == 'yesno') {
1215 1215
 			if (!empty($conf->use_javascript_ajax)) {
1216 1216
 				$out .= ajax_constantonoff($this->confKey, array(), $this->entity); // TODO possibility to add $input parameter
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
 			}
1224 1224
 		} elseif (preg_match('/emailtemplate:/', $this->type)) {
1225 1225
 			if ($this->fieldValue > 0) {
1226
-				include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
1226
+				include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
1227 1227
 				$formmail = new FormMail($this->db);
1228 1228
 
1229 1229
 				$tmp = explode(':', $this->type);
@@ -1244,9 +1244,9 @@  discard block
 block discarded – undo
1244 1244
 			$ways = $c->print_all_ways(' &gt;&gt; ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
1245 1245
 			$toprint = array();
1246 1246
 			foreach ($ways as $way) {
1247
-				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
1247
+				$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.$way.'</li>';
1248 1248
 			}
1249
-			$out .= '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
1249
+			$out .= '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
1250 1250
 		} elseif (preg_match('/thirdparty_type/', $this->type)) {
1251 1251
 			if ($this->fieldValue == 2) {
1252 1252
 				$out .= $this->langs->trans("Prospect");
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
 		$outPut = '';
1365 1365
 		$user = new User($this->db);
1366 1366
 		$user->fetch($this->fieldValue);
1367
-		$outPut = $user->firstname . " "  . $user->lastname;
1367
+		$outPut = $user->firstname." ".$user->lastname;
1368 1368
 		return $outPut;
1369 1369
 	}
1370 1370
 
Please login to merge, or discard this patch.
htdocs/ai/admin/setup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 // Parameters
35 35
 $action = GETPOST('action', 'aZ09');
36 36
 $backtopage = GETPOST('backtopage', 'alpha');
37
-$modulepart = GETPOST('modulepart', 'aZ09');	// Used by actions_setmoduleoptions.inc.php
37
+$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
38 38
 
39 39
 if (empty($action)) {
40 40
 	$action = 'edit';
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 	//'gemini' => 'Gemini'
71 71
 );
72 72
 
73
-$item = $formSetup->newItem('AI_API_SERVICE');	// Name of constant must end with _KEY so it is encrypted when saved into database.
73
+$item = $formSetup->newItem('AI_API_SERVICE'); // Name of constant must end with _KEY so it is encrypted when saved into database.
74 74
 $item->setAsSelect($arrayofia);
75 75
 $item->cssClass = 'minwidth150';
76 76
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	$item->defaultFieldValue = '';
81 81
 	$item->cssClass = 'minwidth500';*/
82 82
 
83
-	$item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_KEY')->setAsSecureKey();	// Name of constant must end with _KEY so it is encrypted when saved into database.
83
+	$item = $formSetup->newItem('AI_API_'.strtoupper($ia).'_KEY')->setAsSecureKey(); // Name of constant must end with _KEY so it is encrypted when saved into database.
84 84
 	$item->nameText = $langs->trans("AI_API_KEY").' ('.$ialabel.')';
85 85
 	$item->defaultFieldValue = '';
86 86
 	$item->fieldParams['hideGenerateButton'] = 1;
Please login to merge, or discard this patch.
htdocs/ai/class/ai.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 				if ($this->apiService == 'groq') {
117 117
 					$this->apiEndpoint = 'https://api.groq.com/openai/v1/chat/completions';
118 118
 					if ($model == 'auto') {
119
-						$model = getDolGlobalString('AI_API_GROK_MODEL_TEXT', 'mixtral-8x7b-32768');	// 'llama3-8b-8192', 'gemma-7b-it'
119
+						$model = getDolGlobalString('AI_API_GROK_MODEL_TEXT', 'mixtral-8x7b-32768'); // 'llama3-8b-8192', 'gemma-7b-it'
120 120
 					}
121 121
 				} elseif ($this->apiService == 'chatgpt') {
122 122
 					$this->apiEndpoint = 'https://api.openai.com/v1/chat/completions';
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			]);
161 161
 
162 162
 			$headers = ([
163
-				'Authorization: Bearer ' . $this->apiKey,
163
+				'Authorization: Bearer '.$this->apiKey,
164 164
 				'Content-Type: application/json'
165 165
 			]);
166 166
 			$response = getURLContent($this->apiEndpoint, 'POST', $payload, 1, $headers);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 				throw new Exception('API request failed. No http received');
170 170
 			}
171 171
 			if (!empty($response['http_code']) && $response['http_code'] != 200) {
172
-				throw new Exception('API request failed with status code ' . $response['http_code']);
172
+				throw new Exception('API request failed with status code '.$response['http_code']);
173 173
 			}
174 174
 			// Decode JSON response
175 175
 			$decodedResponse = json_decode($response['content'], true);
Please login to merge, or discard this patch.