Completed
Branch develop (f5af02)
by
unknown
17:35
created
htdocs/admin/oauth.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 
126 126
 
127 127
 				$sql = "UPDATE ".MAIN_DB_PREFIX."oauth_token";
128
-				$sql.= " SET service = '".$db->escape($oldprovider."-".$newlabel)."'";
129
-				$sql.= " WHERE  service = '".$db->escape($oldprovider."-".$oldlabel)."'";
128
+				$sql .= " SET service = '".$db->escape($oldprovider."-".$newlabel)."'";
129
+				$sql .= " WHERE  service = '".$db->escape($oldprovider."-".$oldlabel)."'";
130 130
 
131 131
 
132 132
 				$resql = $db->query($sql);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
 	$globalkey = empty($provider) ? $label : $label.'-'.$provider;
189 189
 
190
-	if (!dolibarr_del_const($db, $globalkey.'_NAME', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_ID', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SECRET', $conf->entity) ||  !dolibarr_del_const($db, $globalkey.'_URLAUTHORIZE', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SCOPE', $conf->entity)) {
190
+	if (!dolibarr_del_const($db, $globalkey.'_NAME', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_ID', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SECRET', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_URLAUTHORIZE', $conf->entity) || !dolibarr_del_const($db, $globalkey.'_SCOPE', $conf->entity)) {
191 191
 		setEventMessages($langs->trans("ErrorInEntryDeletion"), null, 'errors');
192 192
 		$error++;
193 193
 	} else {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 			$provider.'_NAME',
263 263
 			$provider.'_ID',
264 264
 			$provider.'_SECRET',
265
-			$provider.'_URLAUTHORIZE',	// For custom oauth links
265
+			$provider.'_URLAUTHORIZE', // For custom oauth links
266 266
 			$provider.'_SCOPE'			// For custom oauth links
267 267
 		);
268 268
 	}
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 	// $list is defined into oauth.lib.php to the list of supporter OAuth providers.
282 282
 	foreach ($listinsetup as $key) {
283 283
 		$supported = 0;
284
-		$keyforsupportedoauth2array = $key[0];						// May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
284
+		$keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
285 285
 		$keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
286 286
 		$keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
287 287
 		if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
Please login to merge, or discard this patch.
htdocs/api/class/api_setup.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 					$list[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed;
1033 1033
 					$list[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique;
1034 1034
 					$list[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired;
1035
-					$list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : '');	// This may be a string encoded with serialise() or json_encode()
1035
+					$list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode()
1036 1036
 					$list[$tab->elementtype][$tab->name]['pos'] = $tab->pos;
1037 1037
 					$list[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable;
1038 1038
 					$list[$tab->elementtype][$tab->name]['perms'] = $tab->perms;
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 			$num = $this->db->num_rows($result);
1672 1672
 			$min = min($num, ($limit <= 0 ? $num : $limit));
1673 1673
 			for ($i = 0; $i < $min; $i++) {
1674
-				$type =$this->db->fetch_object($result);
1674
+				$type = $this->db->fetch_object($result);
1675 1675
 				$this->translateLabel($type, $lang, 'TicketTypeShort', array('ticket'));
1676 1676
 				$list[] = $type;
1677 1677
 			}
@@ -1734,7 +1734,7 @@  discard block
 block discarded – undo
1734 1734
 			$num = $this->db->num_rows($result);
1735 1735
 			$min = min($num, ($limit <= 0 ? $num : $limit));
1736 1736
 			for ($i = 0; $i < $min; $i++) {
1737
-				$type =$this->db->fetch_object($result);
1737
+				$type = $this->db->fetch_object($result);
1738 1738
 				$list[] = $type;
1739 1739
 			}
1740 1740
 		} else {
@@ -1961,13 +1961,13 @@  discard block
 block discarded – undo
1961 1961
 				throw new RestException(500, $langs->trans('XmlNotFound').': '.$xmlfile);
1962 1962
 			}
1963 1963
 		} else {
1964
-			$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0);	// Accept http or https links on external remote server only. Same is used into filecheck.php.
1964
+			$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php.
1965 1965
 
1966 1966
 			// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
1967 1967
 			if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
1968 1968
 				$xmlfile = $xmlarray['content'];
1969 1969
 				//print "xmlfilestart".$xmlfile."endxmlfile";
1970
-				$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
1970
+				$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
1971 1971
 			} else {
1972 1972
 				$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
1973 1973
 				throw new RestException(500, $errormsg);
Please login to merge, or discard this patch.
htdocs/fourn/class/api_supplier_orders.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
 		if ($source == 'all' || $source == 'external') {
322 322
 			$tmpContacts = $this->order->liste_contact(-1, 'external', 0, $type);
323
-			$contacts =	array_merge($contacts, $tmpContacts);
323
+			$contacts = array_merge($contacts, $tmpContacts);
324 324
 		}
325 325
 
326 326
 		if ($source == 'all' || $source == 'internal') {
@@ -665,9 +665,9 @@  discard block
 block discarded – undo
665 665
 		}
666 666
 
667 667
 		foreach ($lines as $line) {
668
-			$lineObj =(object) $line;
668
+			$lineObj = (object) $line;
669 669
 
670
-			$result=$this->order->dispatchProduct(DolibarrApiAccess::$user,
670
+			$result = $this->order->dispatchProduct(DolibarrApiAccess::$user,
671 671
 				  $lineObj->fk_product,
672 672
 				  $lineObj->qty,
673 673
 				  $lineObj->warehouse,
Please login to merge, or discard this patch.
htdocs/user/group/card.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -446,7 +446,7 @@
 block discarded – undo
446 446
 				print '<td class="liste_titre right" width="5">&nbsp;</td>';
447 447
 				print "</tr>\n";
448 448
 
449
-				$object->fetch($object->id, '', true);	// true to force load of all users, member of the group
449
+				$object->fetch($object->id, '', true); // true to force load of all users, member of the group
450 450
 
451 451
 				if (!empty($object->members)) {
452 452
 					foreach ($object->members as $useringroup) {
Please login to merge, or discard this patch.
htdocs/projet/class/api_projects.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
 			$sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
123 123
 		}
124 124
 		$sql .= " FROM ".MAIN_DB_PREFIX."projet as t";
125
-		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_extrafields AS ef ON ef.fk_object = t.rowid";	// So we will be able to filter on extrafields
125
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields
126 126
 		if ($category > 0) {
127 127
 			$sql .= ", ".MAIN_DB_PREFIX."categorie_project as c";
128 128
 		}
Please login to merge, or discard this patch.
htdocs/core/modules/modTicket.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -332,19 +332,19 @@
 block discarded – undo
332 332
 
333 333
 		// Export list of tickets and attributes
334 334
 		$langs->load("ticket");
335
-		$this->export_code[$r]=$this->rights_class.'_'.$r;
336
-		$this->export_label[$r]='ExportDataset_ticket_1';	// Translation key (used only if key ExportDataset_xxx_z not found)
335
+		$this->export_code[$r] = $this->rights_class.'_'.$r;
336
+		$this->export_label[$r] = 'ExportDataset_ticket_1'; // Translation key (used only if key ExportDataset_xxx_z not found)
337 337
 		$this->export_permission[$r] = array(array("ticket", "export"));
338
-		$this->export_icon[$r]='ticket';
339
-		$keyforclass = 'Ticket';$keyforclassfile='/ticket/class/ticket.class.php';$keyforelement='ticket';
338
+		$this->export_icon[$r] = 'ticket';
339
+		$keyforclass = 'Ticket'; $keyforclassfile = '/ticket/class/ticket.class.php'; $keyforelement = 'ticket';
340 340
 		include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php';
341
-		$keyforselect='ticket'; $keyforaliasextra='extra'; $keyforelement='ticket';
341
+		$keyforselect = 'ticket'; $keyforaliasextra = 'extra'; $keyforelement = 'ticket';
342 342
 		include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
343
-		$this->export_sql_start[$r]='SELECT DISTINCT ';
344
-		$this->export_sql_end[$r]  =' FROM '.MAIN_DB_PREFIX.'ticket as t';
343
+		$this->export_sql_start[$r] = 'SELECT DISTINCT ';
344
+		$this->export_sql_end[$r]  = ' FROM '.MAIN_DB_PREFIX.'ticket as t';
345 345
 		$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'ticket_extrafields as extra on (t.rowid = extra.fk_object)';
346
-		$this->export_sql_end[$r] .=' WHERE 1 = 1';
347
-		$this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('ticket').')';
346
+		$this->export_sql_end[$r] .= ' WHERE 1 = 1';
347
+		$this->export_sql_end[$r] .= ' AND t.entity IN ('.getEntity('ticket').')';
348 348
 		$r++;
349 349
 	}
350 350
 
Please login to merge, or discard this patch.
htdocs/printing/admin/printing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@
 block discarded – undo
201 201
 			$i++;
202 202
 
203 203
 			if ($key['varname'] == 'PRINTGCP_TOKEN_ACCESS') {
204
-				$keyforprovider = '';	// @BUG This must be set
204
+				$keyforprovider = ''; // @BUG This must be set
205 205
 
206 206
 				// Token
207 207
 				print '<tr class="oddeven">';
Please login to merge, or discard this patch.
htdocs/admin/oauthlogintokens.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -147,18 +147,18 @@  discard block
 block discarded – undo
147 147
 				$provider.'_NAME',
148 148
 				$provider.'_ID',
149 149
 				$provider.'_SECRET',
150
-				$provider.'_URLAUTHORIZE',	// For custom oauth links
150
+				$provider.'_URLAUTHORIZE', // For custom oauth links
151 151
 				$provider.'_SCOPE'			// For custom oauth links
152 152
 			);
153 153
 		}
154 154
 	}
155 155
 
156
-	$oauthstateanticsrf = bin2hex(random_bytes(128/8));
156
+	$oauthstateanticsrf = bin2hex(random_bytes(128 / 8));
157 157
 
158 158
 	// $list is defined into oauth.lib.php to the list of supporter OAuth providers.
159 159
 	foreach ($listinsetup as $key) {
160 160
 		$supported = 0;
161
-		$keyforsupportedoauth2array = $key[0];						// May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
161
+		$keyforsupportedoauth2array = $key[0]; // May be OAUTH_GOOGLE_NAME or OAUTH_GOOGLE_xxx_NAME
162 162
 		$keyforsupportedoauth2array = preg_replace('/^OAUTH_/', '', $keyforsupportedoauth2array);
163 163
 		$keyforsupportedoauth2array = preg_replace('/_NAME$/', '', $keyforsupportedoauth2array);
164 164
 		if (preg_match('/^.*-/', $keyforsupportedoauth2array)) {
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		if (getDolGlobalString($key[4])) {
179 179
 			$shortscope = getDolGlobalString($key[4]);
180 180
 		}
181
-		$state = $shortscope;	// TODO USe a better state
181
+		$state = $shortscope; // TODO USe a better state
182 182
 
183 183
 		// Define $urltorenew, $urltodelete, $urltocheckperms
184 184
 		if ($keyforsupportedoauth2array == 'OAUTH_GITHUB_NAME') {
Please login to merge, or discard this patch.
htdocs/admin/defaultvalues.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -140,13 +140,13 @@  discard block
 block discarded – undo
140 140
 
141 141
 	if (!$error) {
142 142
 		if ($action == 'add' || (GETPOST('add') && $action != 'update')) {
143
-			$object->type=$mode;
144
-			$object->user_id=0;
145
-			$object->page=$defaulturl;
146
-			$object->param=$defaultkey;
147
-			$object->value=$defaultvalue;
148
-			$object->entity=$conf->entity;
149
-			$result=$object->create($user);
143
+			$object->type = $mode;
144
+			$object->user_id = 0;
145
+			$object->page = $defaulturl;
146
+			$object->param = $defaultkey;
147
+			$object->value = $defaultvalue;
148
+			$object->entity = $conf->entity;
149
+			$result = $object->create($user);
150 150
 			if ($result < 0) {
151 151
 				$action = '';
152 152
 				setEventMessages($object->error, $object->errors, 'errors');
@@ -159,14 +159,14 @@  discard block
 block discarded – undo
159 159
 			}
160 160
 		}
161 161
 		if (GETPOST('actionmodify')) {
162
-			$object->id=$id;
163
-			$object->type=$mode;
164
-			$object->page=$urlpage;
165
-			$object->param=$key;
166
-			$object->value=$value;
167
-			$object->entity=$conf->entity;
168
-			$result=$object->update($user);
169
-			if ($result<0) {
162
+			$object->id = $id;
163
+			$object->type = $mode;
164
+			$object->page = $urlpage;
165
+			$object->param = $key;
166
+			$object->value = $value;
167
+			$object->entity = $conf->entity;
168
+			$result = $object->update($user);
169
+			if ($result < 0) {
170 170
 				$action = '';
171 171
 				setEventMessages($object->error, $object->errors, 'errors');
172 172
 			} else {
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 
183 183
 // Delete line from delete picto
184 184
 if ($action == 'delete') {
185
-	$object->id=$id;
186
-	$result=$object->delete($user);
187
-	if ($result<0) {
185
+	$object->id = $id;
186
+	$result = $object->delete($user);
187
+	if ($result < 0) {
188 188
 		$action = '';
189 189
 		setEventMessages($object->error, $object->errors, 'errors');
190 190
 	}
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
 // Limit to superadmin
340 340
 if (isModEnabled('multicompany') && !$user->entity) {
341 341
 	print '<td>';
342
-	print '<input type="text" class="flat" size="1" disabled name="entity" value="' . $conf->entity . '">'; // We see environment, but to change it we must switch on other entity
342
+	print '<input type="text" class="flat" size="1" disabled name="entity" value="'.$conf->entity.'">'; // We see environment, but to change it we must switch on other entity
343 343
 	print '</td>';
344 344
 } else {
345 345
 	print '<td class="center">';
346
-	print '<input type="hidden" name="entity" value="' . $conf->entity . '">';
346
+	print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
347 347
 	print '</td>';
348 348
 }
349 349
 print '<td class="center">';
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 print '</td>'."\n";
356 356
 print '</tr>'."\n";
357 357
 
358
-$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode,'t.entity'=>array($user->entity,$conf->entity)));
358
+$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type'=>$mode, 't.entity'=>array($user->entity, $conf->entity)));
359 359
 
360 360
 if (!is_array($result) && $result < 0) {
361 361
 	setEventMessages($object->error, $object->errors, 'errors');
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
 		// Actions
389 389
 		print '<td class="center">';
390
-		if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id)	{
390
+		if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) {
391 391
 			print '<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=edit&token='.newToken().'">'.img_edit().'</a>';
392 392
 			print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=delete&token='.newToken().'">'.img_delete().'</a>';
393 393
 		} else {
Please login to merge, or discard this patch.