Completed
Branch develop (55b96e)
by
unknown
21:39
created
htdocs/societe/list.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -148,20 +148,20 @@  discard block
 block discarded – undo
148 148
 $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth');
149 149
 $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear');
150 150
 $search_date_creation_startday = GETPOSTINT('search_date_creation_startday');
151
-$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);	// Use tzserver
151
+$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver
152 152
 $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth');
153 153
 $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear');
154 154
 $search_date_creation_endday = GETPOSTINT('search_date_creation_endday');
155
-$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);	// Use tzserver
155
+$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver
156 156
 
157 157
 $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth');
158 158
 $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear');
159 159
 $search_date_modif_startday = GETPOSTINT('search_date_modif_startday');
160
-$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear);	// Use tzserver
160
+$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver
161 161
 $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth');
162 162
 $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear');
163 163
 $search_date_modif_endday = GETPOSTINT('search_date_modif_endday');
164
-$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear);	// Use tzserver
164
+$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver
165 165
 
166 166
 $type = GETPOST('type', 'alpha');
167 167
 $place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is string id of table for Bar or Restaurant
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 
340 340
 $object->fields = dol_sort_array($object->fields, 'position');
341 341
 $arrayfields = dol_sort_array($arrayfields, 'position');
342
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
342
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
343 343
 
344 344
 // Security check
345 345
 $socid = GETPOSTINT('socid');
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 }
623 623
 // Search on sale representative
624 624
 if (!empty($search_sale) && $search_sale != '-1') {
625
-	$search_sale_req = array_filter($search_sale, function (string $value): bool {
625
+	$search_sale_req = array_filter($search_sale, function(string $value): bool {
626 626
 		$value = intval($value);
627 627
 		return $value >= 0;
628 628
 	});
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
 			if ($searchCategoryCustomerOperator == 0) {
651 651
 				$searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")";
652 652
 			} else {
653
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
653
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer);
654 654
 			}
655 655
 		}
656 656
 	}
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 			if ($searchCategorySupplierOperator == 0) {
680 680
 				$searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")";
681 681
 			} else {
682
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier);
682
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategorySupplier);
683 683
 			}
684 684
 		}
685 685
 	}
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
 }
966 966
 if (is_array($search_sale)) {
967 967
 	foreach ($search_sale as $sale_id) {
968
-		$param .= '&search_sale[]=' . urlencode($sale_id);
968
+		$param .= '&search_sale[]='.urlencode($sale_id);
969 969
 	}
970 970
 }
971 971
 if ($search_id > 0) {
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 	$param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday));
1127 1127
 }
1128 1128
 if ($search_date_modif_end) {
1129
-	$param .= '&search_date_modif_end=' . urlencode($search_date_modif_end);
1129
+	$param .= '&search_date_modif_end='.urlencode($search_date_modif_end);
1130 1130
 }
1131 1131
 
1132 1132
 // Add $param from extra fields
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 	if (!empty($socid)) {
1197 1197
 		$url .= '&socid='.$socid;
1198 1198
 	}
1199
-	$newcardbutton   = '';
1199
+	$newcardbutton = '';
1200 1200
 	$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
1201 1201
 	$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
1202 1202
 	$newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', $url, '', $user->hasRight('societe', 'creer'));
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
 	$moreforfilter .= '<div class="divsearchfield">';
1298 1298
 	$tmptitle = $langs->trans('SalesRepresentatives');
1299 1299
 	$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"');
1300
-	$moreforfilter .=  $form->multiselectarray('search_sale', $userlist, $search_sale, 0, 0, '', 0, 300, '', '', $langs->trans('SalesRepresentatives'), 1);
1300
+	$moreforfilter .= $form->multiselectarray('search_sale', $userlist, $search_sale, 0, 0, '', 0, 300, '', '', $langs->trans('SalesRepresentatives'), 1);
1301 1301
 	$moreforfilter .= '</div>';
1302 1302
 }
1303 1303
 if (!empty($moreforfilter)) {
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
 }
1311 1311
 
1312 1312
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
1313
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
1313
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
1314 1314
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
1315 1315
 $selectedfields .= ((count($arrayofmassactions) && $contextpage != 'poslist') ? $form->showCheckAddButtons('checkforselect', 1) : '');
1316 1316
 
@@ -1782,20 +1782,20 @@  discard block
 block discarded – undo
1782 1782
 // IP Address
1783 1783
 if (!empty($arrayfields['s.ip']['checked'])) {
1784 1784
 	print_liste_field_titre($arrayfields['s.ip']['label'], $_SERVER["PHP_SELF"], "s.ip", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
1785
-	$totalarray['nbfield']++;	// For the column action
1785
+	$totalarray['nbfield']++; // For the column action
1786 1786
 }
1787 1787
 // Date creation
1788 1788
 if (!empty($arrayfields['s.datec']['checked'])) {
1789 1789
 	print_liste_field_titre($arrayfields['s.datec']['label'], $_SERVER["PHP_SELF"], "s.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
1790
-	$totalarray['nbfield']++;	// For the column action
1790
+	$totalarray['nbfield']++; // For the column action
1791 1791
 }
1792 1792
 if (!empty($arrayfields['s.tms']['checked'])) {
1793 1793
 	print_liste_field_titre($arrayfields['s.tms']['label'], $_SERVER["PHP_SELF"], "s.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
1794
-	$totalarray['nbfield']++;	// For the column action
1794
+	$totalarray['nbfield']++; // For the column action
1795 1795
 }
1796 1796
 if (!empty($arrayfields['s.status']['checked'])) {
1797 1797
 	print_liste_field_titre($arrayfields['s.status']['label'], $_SERVER["PHP_SELF"], "s.status", "", $param, '', $sortfield, $sortorder, 'center ');
1798
-	$totalarray['nbfield']++;	// For the column action
1798
+	$totalarray['nbfield']++; // For the column action
1799 1799
 }
1800 1800
 if (!empty($arrayfields['s.note_public']['checked'])) {
1801 1801
 	print_liste_field_titre($arrayfields['s.note_public']['label'], $_SERVER["PHP_SELF"], "s.note_public", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
@@ -1807,7 +1807,7 @@  discard block
 block discarded – undo
1807 1807
 }
1808 1808
 if (!empty($arrayfields['s.import_key']['checked'])) {
1809 1809
 	print_liste_field_titre($arrayfields['s.import_key']['label'], $_SERVER["PHP_SELF"], "s.import_key", "", $param, '', $sortfield, $sortorder, 'center ');
1810
-	$totalarray['nbfield']++;	// For the column action
1810
+	$totalarray['nbfield']++; // For the column action
1811 1811
 }
1812 1812
 // Action column
1813 1813
 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
Please login to merge, or discard this patch.
htdocs/core/modules/security/generate/modGeneratePassPerso.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 			return $pass;
206 206
 		}
207 207
 
208
-		return $this->getNewGeneratedPassword();	// warning, may generate infinite loop if conditions are not possible
208
+		return $this->getNewGeneratedPassword(); // warning, may generate infinite loop if conditions are not possible
209 209
 	}
210 210
 
211 211
 	/**
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 	{
220 220
 		global $langs;
221 221
 
222
-		$this->initAll();	// For the case this method is called alone
222
+		$this->initAll(); // For the case this method is called alone
223 223
 
224 224
 		dol_syslog("modGeneratePassPerso::validatePassword");
225 225
 
Please login to merge, or discard this patch.
test/phpunit/SocieteTest.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  *      \remarks    To run this script as CLI:  phpunit filename.php
26 26
  */
27 27
 
28
-global $conf,$user,$langs,$db;
28
+global $conf, $user, $langs, $db;
29 29
 //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
30 30
 //require_once 'PHPUnit/Autoload.php';
31 31
 require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	public static function setUpBeforeClass(): void
60 60
 	{
61
-		global $conf,$user,$langs,$db;
61
+		global $conf, $user, $langs, $db;
62 62
 
63 63
 		if ($conf->global->SOCIETE_CODECLIENT_ADDON != 'mod_codeclient_monkey') {
64
-			print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '" . getDolGlobalString('SOCIETE_CODECLIENT_ADDON')."'.\n";
64
+			print "\n".__METHOD__." third party ref checker must be setup to 'mod_codeclient_monkey' not to '".getDolGlobalString('SOCIETE_CODECLIENT_ADDON')."'.\n";
65 65
 			die(1);
66 66
 		}
67 67
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 			die(1);
76 76
 		}
77 77
 
78
-		$db->begin();	// This is to have all actions inside a transaction even if test launched without suite.
78
+		$db->begin(); // This is to have all actions inside a transaction even if test launched without suite.
79 79
 
80 80
 		print __METHOD__."\n";
81 81
 	}
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function testSocieteCreate()
89 89
 	{
90
-		global $conf,$user,$langs,$db;
90
+		global $conf, $user, $langs, $db;
91 91
 		$conf = $this->savconf;
92 92
 		$user = $this->savuser;
93 93
 		$langs = $this->savlangs;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$localobject->country_code = 'ES';
101 101
 
102 102
 		$result = $localobject->create($user);
103
-		var_dump($localobject);exit;
103
+		var_dump($localobject); exit;
104 104
 
105 105
 		print __METHOD__." result=".$result."\n";
106 106
 		$this->assertLessThanOrEqual($result, 0);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public function testSocieteFetch($id)
121 121
 	{
122
-		global $conf,$user,$langs,$db;
122
+		global $conf, $user, $langs, $db;
123 123
 		$conf = $this->savconf;
124 124
 		$user = $this->savuser;
125 125
 		$langs = $this->savlangs;
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	public function testSocieteUpdate($localobject)
150 150
 	{
151
-		global $conf,$user,$langs,$db;
151
+		global $conf, $user, $langs, $db;
152 152
 		$conf = $this->savconf;
153 153
 		$user = $this->savuser;
154 154
 		$langs = $this->savlangs;
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
 		$localobject->country_code = 'FR';
225 225
 		$localobject->idprof1 = 493861496;
226 226
 		$localobject->idprof2 = 49386149600021;
227
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be > 0
227
+		$result = $localobject->id_prof_check(1, $localobject); // Must be > 0
228 228
 		print __METHOD__." OK FR idprof1 result=".$result."\n";
229 229
 		$this->assertGreaterThanOrEqual(1, $result);
230
-		$result = $localobject->id_prof_check(2, $localobject);    // Must be > 0
230
+		$result = $localobject->id_prof_check(2, $localobject); // Must be > 0
231 231
 		print __METHOD__." OK FR idprof2 result=".$result."\n";
232 232
 		$this->assertGreaterThanOrEqual(1, $result);
233 233
 
@@ -235,17 +235,17 @@  discard block
 block discarded – undo
235 235
 		$localobject->country_code = 'FR';
236 236
 		$localobject->idprof1 = 'id1ko';
237 237
 		$localobject->idprof2 = 'id2ko';
238
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be <= 0
238
+		$result = $localobject->id_prof_check(1, $localobject); // Must be <= 0
239 239
 		print __METHOD__." KO FR idprof1 result=".$result."\n";
240 240
 		$this->assertLessThan(1, $result);
241
-		$result = $localobject->id_prof_check(2, $localobject);    // Must be <= 0
241
+		$result = $localobject->id_prof_check(2, $localobject); // Must be <= 0
242 242
 		print __METHOD__." KO FR idprof2 result=".$result."\n";
243 243
 		$this->assertLessThan(1, $result);
244 244
 
245 245
 		// KO ES
246 246
 		$localobject->country_code = 'ES';
247 247
 		$localobject->idprof1 = 'id1ko';
248
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be <= 0
248
+		$result = $localobject->id_prof_check(1, $localobject); // Must be <= 0
249 249
 		print __METHOD__." KO ES idprof1 result=".$result."\n";
250 250
 		$this->assertLessThan(1, $result);
251 251
 
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
 		$localobject->country_code = 'AR';
254 254
 		$localobject->idprof1 = 'id1ko';
255 255
 		$localobject->idprof2 = 'id2ko';
256
-		$result = $localobject->id_prof_check(1, $localobject);    // Must be > 0
256
+		$result = $localobject->id_prof_check(1, $localobject); // Must be > 0
257 257
 		print __METHOD__." OK AR idprof1 result=".$result."\n";
258 258
 		$this->assertGreaterThanOrEqual(0, $result);
259
-		$result = $localobject->id_prof_check(2, $localobject);    // Must be > 0
259
+		$result = $localobject->id_prof_check(2, $localobject); // Must be > 0
260 260
 		print __METHOD__." OK AR idprof2 result=".$result."\n";
261 261
 		$this->assertGreaterThanOrEqual(1, $result);
262 262
 
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 	 */
276 276
 	public function testSocieteOther($localobject)
277 277
 	{
278
-		global $conf,$user,$langs,$db;
278
+		global $conf, $user, $langs, $db;
279 279
 		$conf = $this->savconf;
280 280
 		$user = $this->savuser;
281 281
 		$langs = $this->savlangs;
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 	 */
336 336
 	public function testGetOutstandingBills($id)
337 337
 	{
338
-		global $conf,$user,$langs,$db;
338
+		global $conf, $user, $langs, $db;
339 339
 		$conf = $this->savconf;
340 340
 		$user = $this->savuser;
341 341
 		$langs = $this->savlangs;
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 	 */
365 365
 	public function testSocieteDelete($id)
366 366
 	{
367
-		global $conf,$user,$langs,$db;
367
+		global $conf, $user, $langs, $db;
368 368
 		$conf = $this->savconf;
369 369
 		$user = $this->savuser;
370 370
 		$langs = $this->savlangs;
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 	 */
389 389
 	public function testSocieteGetFullAddress()
390 390
 	{
391
-		global $conf,$user,$langs,$db;
391
+		global $conf, $user, $langs, $db;
392 392
 		$conf = $this->savconf;
393 393
 		$user = $this->savuser;
394 394
 		$langs = $this->savlangs;
Please login to merge, or discard this patch.