Completed
Branch develop (b89940)
by
unknown
22:36
created
htdocs/includes/tecnickcom/tcpdf/scripts/doctum.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -7,28 +7,28 @@
 block discarded – undo
7 7
 $rootDir = __DIR__ . '/../';
8 8
 
9 9
 $iterator = Finder::create()
10
-    ->files()
11
-    ->name('*.php')
12
-    ->notPath('cache')
13
-    ->notPath('build')
14
-    ->notPath('fonts')
15
-    ->notPath('vendor')
16
-    ->notPath('tests')
17
-    ->notPath('examples')
18
-    ->in($rootDir);
10
+	->files()
11
+	->name('*.php')
12
+	->notPath('cache')
13
+	->notPath('build')
14
+	->notPath('fonts')
15
+	->notPath('vendor')
16
+	->notPath('tests')
17
+	->notPath('examples')
18
+	->in($rootDir);
19 19
 
20 20
 return new Doctum($iterator, [
21
-    'title'                => 'TCPDF',
22
-    'build_dir'            => $rootDir . '/build',
23
-    'cache_dir'            => $rootDir . '/cache',
24
-    'source_dir'           => $rootDir,
25
-    'remote_repository'    => new GitHubRemoteRepository('tecnickcom/TCPDF', $rootDir),
26
-    'footer_link'          => [
27
-        'href'        => 'https://github.com/tecnickcom/TCPDF#readme',
28
-        'rel'         => 'noreferrer noopener',
29
-        'target'      => '_blank',
30
-        'before_text' => 'This documentation is for',
31
-        'link_text'   => 'TCPDF',
32
-        'after_text'  => 'the PHP library to build PDFs.',
33
-    ],
21
+	'title'                => 'TCPDF',
22
+	'build_dir'            => $rootDir . '/build',
23
+	'cache_dir'            => $rootDir . '/cache',
24
+	'source_dir'           => $rootDir,
25
+	'remote_repository'    => new GitHubRemoteRepository('tecnickcom/TCPDF', $rootDir),
26
+	'footer_link'          => [
27
+		'href'        => 'https://github.com/tecnickcom/TCPDF#readme',
28
+		'rel'         => 'noreferrer noopener',
29
+		'target'      => '_blank',
30
+		'before_text' => 'This documentation is for',
31
+		'link_text'   => 'TCPDF',
32
+		'after_text'  => 'the PHP library to build PDFs.',
33
+	],
34 34
 ]);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use Doctum\RemoteRepository\GitHubRemoteRepository;
5 5
 use Symfony\Component\Finder\Finder;
6 6
 
7
-$rootDir = __DIR__ . '/../';
7
+$rootDir = __DIR__.'/../';
8 8
 
9 9
 $iterator = Finder::create()
10 10
     ->files()
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 
20 20
 return new Doctum($iterator, [
21 21
     'title'                => 'TCPDF',
22
-    'build_dir'            => $rootDir . '/build',
23
-    'cache_dir'            => $rootDir . '/cache',
22
+    'build_dir'            => $rootDir.'/build',
23
+    'cache_dir'            => $rootDir.'/cache',
24 24
     'source_dir'           => $rootDir,
25 25
     'remote_repository'    => new GitHubRemoteRepository('tecnickcom/TCPDF', $rootDir),
26 26
     'footer_link'          => [
Please login to merge, or discard this patch.
htdocs/includes/tecnickcom/tcpdf/tcpdf_barcodes_2d.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * <li>$arrcode['num_cols'] required number of columns</li>
64 64
 	 * <li>$arrcode['bcode'][$r][$c] value of the cell is $r row and $c column (0 = transparent, 1 = black)</li></ul>
65 65
 	 * @param string $code code to print
66
- 	 * @param string $type type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parameters are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
66
+	 * @param string $type type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parameters are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
67 67
 	 */
68 68
 	public function __construct($code, $type) {
69 69
 		$this->setBarcode($code, $type);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
 	/**
73 73
 	 * Return an array representations of barcode.
74
- 	 * @return array
74
+	 * @return array
75 75
 	 */
76 76
 	public function getBarcodeArray() {
77 77
 		return $this->barcode_array;
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @param int $w Width of a single rectangle element in user units.
83 83
 	 * @param int $h Height of a single rectangle element in user units.
84 84
 	 * @param string $color Foreground color (in SVG format) for bar elements (background is transparent).
85
- 	 * @public
85
+	 * @public
86 86
 	 */
87 87
 	public function getBarcodeSVG($w=3, $h=3, $color='black') {
88 88
 		// send headers
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 	 * @param int $w Width of a single rectangle element in user units.
103 103
 	 * @param int $h Height of a single rectangle element in user units.
104 104
 	 * @param string $color Foreground color (in SVG format) for bar elements (background is transparent).
105
- 	 * @return string SVG code.
106
- 	 * @public
105
+	 * @return string SVG code.
106
+	 * @public
107 107
 	 */
108 108
 	public function getBarcodeSVGcode($w=3, $h=3, $color='black') {
109 109
 		// replace table for special characters
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 	 * @param int $w Width of a single rectangle element in pixels.
139 139
 	 * @param int $h Height of a single rectangle element in pixels.
140 140
 	 * @param string $color Foreground color for bar elements (background is transparent).
141
- 	 * @return string HTML code.
142
- 	 * @public
141
+	 * @return string HTML code.
142
+	 * @public
143 143
 	 */
144 144
 	public function getBarcodeHTML($w=10, $h=10, $color='black') {
145 145
 		$html = '<div style="font-size:0;position:relative;width:'.($w * $this->barcode_array['num_cols']).'px;height:'.($h * $this->barcode_array['num_rows']).'px;">'."\n";
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	 * @param int $w Width of a single rectangle element in pixels.
168 168
 	 * @param int $h Height of a single rectangle element in pixels.
169 169
 	 * @param array $color RGB (0-255) foreground color for bar elements (background is transparent).
170
- 	 * @public
170
+	 * @public
171 171
 	 */
172 172
 	public function getBarcodePNG($w=3, $h=3, $color=array(0,0,0)) {
173 173
 		$data = $this->getBarcodePngData($w, $h, $color);
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
 	 * @param int $w Width of a single rectangle element in pixels.
188 188
 	 * @param int $h Height of a single rectangle element in pixels.
189 189
 	 * @param array $color RGB (0-255) foreground color for bar elements (background is transparent).
190
- 	 * @return string|Imagick|false image or false in case of error.
191
- 	 * @public
190
+	 * @return string|Imagick|false image or false in case of error.
191
+	 * @public
192 192
 	 */
193 193
 	public function getBarcodePngData($w=3, $h=3, $color=array(0,0,0)) {
194 194
 		// calculate image size
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 	/**
247 247
 	 * Set the barcode.
248 248
 	 * @param string $code code to print
249
- 	 * @param string $type type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parameters are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
250
- 	 * @return void
249
+	 * @param string $type type of barcode: <ul><li>DATAMATRIX : Datamatrix (ISO/IEC 16022)</li><li>PDF417 : PDF417 (ISO/IEC 15438:2006)</li><li>PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parameters are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".</li><li>QRCODE : QRcode Low error correction</li><li>QRCODE,L : QRcode Low error correction</li><li>QRCODE,M : QRcode Medium error correction</li><li>QRCODE,Q : QRcode Better error correction</li><li>QRCODE,H : QR-CODE Best error correction</li><li>RAW: raw mode - comma-separad list of array rows</li><li>RAW2: raw mode - array rows are surrounded by square parenthesis.</li><li>TEST : Test matrix</li></ul>
250
+	 * @return void
251 251
 	 */
252 252
 	public function setBarcode($code, $type) {
253 253
 		$mode = explode(',', $type);
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 * @param string $color Foreground color (in SVG format) for bar elements (background is transparent).
85 85
  	 * @public
86 86
 	 */
87
-	public function getBarcodeSVG($w=3, $h=3, $color='black') {
87
+	public function getBarcodeSVG($w = 3, $h = 3, $color = 'black') {
88 88
 		// send headers
89 89
 		$code = $this->getBarcodeSVGcode($w, $h, $color);
90 90
 		header('Content-Type: application/svg+xml');
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
  	 * @return string SVG code.
106 106
  	 * @public
107 107
 	 */
108
-	public function getBarcodeSVGcode($w=3, $h=3, $color='black') {
108
+	public function getBarcodeSVGcode($w = 3, $h = 3, $color = 'black') {
109 109
 		// replace table for special characters
110 110
 		$repstr = array("\0" => '', '&' => '&amp;', '<' => '&lt;', '>' => '&gt;');
111 111
 		$svg = '<'.'?'.'xml version="1.0" standalone="no"'.'?'.'>'."\n";
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
  	 * @return string HTML code.
142 142
  	 * @public
143 143
 	 */
144
-	public function getBarcodeHTML($w=10, $h=10, $color='black') {
144
+	public function getBarcodeHTML($w = 10, $h = 10, $color = 'black') {
145 145
 		$html = '<div style="font-size:0;position:relative;width:'.($w * $this->barcode_array['num_cols']).'px;height:'.($h * $this->barcode_array['num_rows']).'px;">'."\n";
146 146
 		// print barcode elements
147 147
 		$y = 0;
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 	 * @param array $color RGB (0-255) foreground color for bar elements (background is transparent).
170 170
  	 * @public
171 171
 	 */
172
-	public function getBarcodePNG($w=3, $h=3, $color=array(0,0,0)) {
172
+	public function getBarcodePNG($w = 3, $h = 3, $color = array(0, 0, 0)) {
173 173
 		$data = $this->getBarcodePngData($w, $h, $color);
174 174
 		// send headers
175 175
 		header('Content-Type: image/png');
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
  	 * @return string|Imagick|false image or false in case of error.
191 191
  	 * @public
192 192
 	 */
193
-	public function getBarcodePngData($w=3, $h=3, $color=array(0,0,0)) {
193
+	public function getBarcodePngData($w = 3, $h = 3, $color = array(0, 0, 0)) {
194 194
 		// calculate image size
195 195
 		$width = ($this->barcode_array['num_cols'] * $w);
196 196
 		$height = ($this->barcode_array['num_rows'] * $h);
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 			}
294 294
 			case 'QRCODE': { // QR-CODE
295 295
 				require_once(dirname(__FILE__).'/include/barcodes/qrcode.php');
296
-				if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) {
296
+				if (!isset($mode[1]) OR (!in_array($mode[1], array('L', 'M', 'Q', 'H')))) {
297 297
 					$mode[1] = 'L'; // Ddefault: Low error correction
298 298
 				}
299 299
 				$qrcode = new QRcode($code, strtoupper($mode[1]));
@@ -329,11 +329,11 @@  discard block
 block discarded – undo
329 329
 				$this->barcode_array['num_rows'] = 5;
330 330
 				$this->barcode_array['num_cols'] = 15;
331 331
 				$this->barcode_array['bcode'] = array(
332
-					array(1,1,1,0,1,1,1,0,1,1,1,0,1,1,1),
333
-					array(0,1,0,0,1,0,0,0,1,0,0,0,0,1,0),
334
-					array(0,1,0,0,1,1,0,0,1,1,1,0,0,1,0),
335
-					array(0,1,0,0,1,0,0,0,0,0,1,0,0,1,0),
336
-					array(0,1,0,0,1,1,1,0,1,1,1,0,0,1,0));
332
+					array(1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1),
333
+					array(0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0),
334
+					array(0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0),
335
+					array(0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0),
336
+					array(0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0));
337 337
 				$this->barcode_array['code'] = $code;
338 338
 				break;
339 339
 			}
Please login to merge, or discard this patch.
htdocs/comm/remise.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
 
96 96
 $form = new Form($db);
97 97
 
98
-if (! ($socid > 0)) {
98
+if (!($socid > 0)) {
99 99
 	accessforbidden('Record not found');
100 100
 }
101 101
 
Please login to merge, or discard this patch.
htdocs/comm/action/index.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	$conf->global->AGENDA_EXT_NB = 5;
51 51
 }
52 52
 $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB');
53
-$DELAYFORCACHE = 300;	// 300 seconds
53
+$DELAYFORCACHE = 300; // 300 seconds
54 54
 
55 55
 $disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
56 56
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
 $mode = GETPOST('mode', 'aZ09');
109 109
 if (empty($mode) && preg_match('/show_/', $action)) {
110
-	$mode = $action;	// For backward compatibility
110
+	$mode = $action; // For backward compatibility
111 111
 }
112 112
 $resourceid = GETPOST("search_resourceid", 'int');
113 113
 $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y");
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
 	$status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
142 142
 }
143 143
 
144
-$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month');	// default for app
145
-$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview);	// default for user
144
+$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month'); // default for app
145
+$defaultview = getDolUserString('AGENDA_DEFAULT_VIEW', $defaultview); // default for user
146 146
 if (empty($mode) && !GETPOSTISSET('mode')) {
147 147
 	$mode = $defaultview;
148 148
 }
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 
538 538
 $viewmode .= '</div>';
539 539
 
540
-$viewmode .= '<span class="marginrightonly"></span>';	// To add a space before the navigation tools
540
+$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools
541 541
 
542 542
 
543 543
 $newcardbutton = '';
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
 	$newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode);
549 549
 
550 550
 	//$param='month='.$monthshown.'&year='.$year;
551
-	$hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000';	// Set $hourminsec to '100000' to auto set hour to 10:00 at creation
551
+	$hourminsec = dol_print_date(dol_mktime(10, 0, 0, 1, 1, 1970, 'gmt'), '%H', 'gmt').'0000'; // Set $hourminsec to '100000' to auto set hour to 10:00 at creation
552 552
 
553 553
 	$urltocreateaction = DOL_URL_ROOT.'/comm/action/card.php?action=create';
554 554
 	$urltocreateaction .= '&apyear='.$tmpforcreatebutton['year'].'&apmonth='.$tmpforcreatebutton['mon'].'&apday='.$tmpforcreatebutton['mday'].'&aphour='.$tmpforcreatebutton['hours'].'&apmin='.$tmpforcreatebutton['minutes'];
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	$sql .= " WHERE bc.status = 1";
575 575
 	$sql .= " AND ba.status = 1";
576 576
 	if (!empty($filtert) && $filtert != -1) {
577
-		$sql .= " AND bc.visibility = ".(int) $filtert ;
577
+		$sql .= " AND bc.visibility = ".(int) $filtert;
578 578
 	}
579 579
 	$resql = $db->query($sql);
580 580
 	if ($resql) {
@@ -628,9 +628,9 @@  discard block
 block discarded – undo
628 628
 	if ($user->hasRight("holiday", "read")) {
629 629
 		$s .= '
630 630
             <div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"' . ($check_holiday
631
-					? ' checked' : '') . '>
631
+					? ' checked' : '').'>
632 632
                 <label for="check_holiday" class="labelcalendar">
633
-                    <span class="check_holiday_text">' . $langs->trans("Holidays") . '</span>
633
+                    <span class="check_holiday_text">' . $langs->trans("Holidays").'</span>
634 634
                 </label> &nbsp;
635 635
             </div>';
636 636
 	}
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 		$s .= '</script>'."\n";
657 657
 
658 658
 		foreach ($showextcals as $val) {
659
-			$htmlname = md5($val['name']);	// not used for security purpose, only to get a string with no special char
659
+			$htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char
660 660
 
661 661
 			if (!empty($val['default']) || GETPOSTINT('check_ext'.$htmlname)) {
662 662
 				$default = "checked";
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 		// event->datep and event->datef must be GMT date.
902 902
 		if ($event->fulldayevent) {
903 903
 			$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
904
-			$event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver');	// If saved in $tzforfullday = gmt, we must invert date to be in user tz
904
+			$event->datep = $db->jdate($obj->datep, $tzforfullday ? 'tzuser' : 'tzserver'); // If saved in $tzforfullday = gmt, we must invert date to be in user tz
905 905
 			$event->datef = $db->jdate($obj->datep2, $tzforfullday ? 'tzuser' : 'tzserver');
906 906
 		} else {
907 907
 			// Example: $obj->datep = '1970-01-01 01:00:00', jdate will return 0 if TZ of PHP server is Europe/Berlin (+1)
@@ -978,8 +978,8 @@  discard block
 block discarded – undo
978 978
 			// Loop on each day covered by action to prepare an index to show on calendar
979 979
 			$loop = true;
980 980
 			$j = 0;
981
-			$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');	// $mois, $jour, $annee has been set for user tz
982
-			$daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt');	// $moisend, $jourend, $anneeend has been set for user tz
981
+			$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz
982
+			$daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz
983 983
 			/*
984 984
 			 print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>';
985 985
 			 print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>';
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
 
1108 1108
 	if ($mode == 'show_day') {
1109 1109
 		// Request only leaves for the current selected day
1110
-		$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin";	// date_debut and date_fin are date without time
1110
+		$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time
1111 1111
 	} elseif ($mode == 'show_week') {
1112 1112
 		// Restrict on current month (we get more, but we will filter later)
1113 1113
 		$sql .= " AND date_debut < '".$db->idate(dol_get_last_day($year, $month))."'";
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
 
1654 1654
 	for ($iter_day = 0; $iter_day < 7; $iter_day++) {
1655 1655
 		// Show days of the current week
1656
-		$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');		// $firstdaytoshow is in timezone of server
1656
+		$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server
1657 1657
 		$tmpday = dol_print_date($curtime, '%d', 'tzuserrel');
1658 1658
 		$tmpmonth = dol_print_date($curtime, '%m', 'tzuserrel');
1659 1659
 		$tmpyear = dol_print_date($curtime, '%Y', 'tzuserrel');
@@ -1883,9 +1883,9 @@  discard block
 block discarded – undo
1883 1883
 	$tmpholiday = new Holiday($db);
1884 1884
 
1885 1885
 	foreach ($eventarray as $daykey => $notused) {		// daykey is the 'YYYYMMDD' to show according to user
1886
-		$annee = dol_print_date($daykey, '%Y', 'gmt');	// We use gmt because we want the value represented by string 'YYYYMMDD'
1887
-		$mois =  dol_print_date($daykey, '%m', 'gmt');	// We use gmt because we want the value represented by string 'YYYYMMDD'
1888
-		$jour =  dol_print_date($daykey, '%d', 'gmt');	// We use gmt because we want the value represented by string 'YYYYMMDD'
1886
+		$annee = dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1887
+		$mois = dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1888
+		$jour = dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
1889 1889
 
1890 1890
 		//print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."<br>\n";
1891 1891
 		//print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' day='.$day.' month='.$month.' year='.$year."<br>\n";
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
 								$event->label = $titletoshow;
2178 2178
 								// Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user.
2179 2179
 								$titletoshow = (($event->type_picto || $event->type_code) ? $event->getTypePicto() : '');
2180
-								$titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title valignmiddle', '', 0, 0);	// do not add 'inline-block' in css here: it makes the title transformed completely into '...'
2180
+								$titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title valignmiddle', '', 0, 0); // do not add 'inline-block' in css here: it makes the title transformed completely into '...'
2181 2181
 								$event->label = $savlabel;
2182 2182
 							}
2183 2183
 
Please login to merge, or discard this patch.
htdocs/product/class/product.class.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	 */
143 143
 	public $price;
144 144
 
145
-	public $price_formated;			// used by takepos/ajax/ajax.php
145
+	public $price_formated; // used by takepos/ajax/ajax.php
146 146
 
147 147
 	/**
148 148
 	 * Selling price with tax
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 	 */
152 152
 	public $price_ttc;
153 153
 
154
-	public $price_ttc_formated;		// used by takepos/ajax/ajax.php
154
+	public $price_ttc_formated; // used by takepos/ajax/ajax.php
155 155
 
156 156
 	/**
157 157
 	 * Minimum price net
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 	public $packaging;
232 232
 
233 233
 
234
-	public $lifetime;	// In seconds
234
+	public $lifetime; // In seconds
235 235
 
236 236
 	public $qc_frequency;
237 237
 
@@ -392,20 +392,20 @@  discard block
 block discarded – undo
392 392
 
393 393
 	//! Metric of products
394 394
 	public $weight;
395
-	public $weight_units;	// scale -3, 0, 3, 6
395
+	public $weight_units; // scale -3, 0, 3, 6
396 396
 	public $length;
397
-	public $length_units;	// scale -3, 0, 3, 6
397
+	public $length_units; // scale -3, 0, 3, 6
398 398
 	public $width;
399
-	public $width_units;	// scale -3, 0, 3, 6
399
+	public $width_units; // scale -3, 0, 3, 6
400 400
 	public $height;
401
-	public $height_units;	// scale -3, 0, 3, 6
401
+	public $height_units; // scale -3, 0, 3, 6
402 402
 	public $surface;
403
-	public $surface_units;	// scale -3, 0, 3, 6
403
+	public $surface_units; // scale -3, 0, 3, 6
404 404
 	public $volume;
405
-	public $volume_units;	// scale -3, 0, 3, 6
405
+	public $volume_units; // scale -3, 0, 3, 6
406 406
 
407 407
 	public $net_measure;
408
-	public $net_measure_units;	// scale -3, 0, 3, 6
408
+	public $net_measure_units; // scale -3, 0, 3, 6
409 409
 
410 410
 	public $accountancy_code_sell;
411 411
 	public $accountancy_code_sell_intra;
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 		'import_key'    => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
598 598
 		//'tosell'       =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
599 599
 		//'tobuy'        =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
600
-		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1,  'notnull' => 1, 'default' => '0', 'index' => 1,  'position' => 1000),
600
+		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000),
601 601
 	);
602 602
 
603 603
 	/**
@@ -901,9 +901,9 @@  discard block
 block discarded – undo
901 901
 
902 902
 							// update accountancy for this entity
903 903
 							if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
904
-								$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity));
904
+								$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
905 905
 
906
-								$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
906
+								$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
907 907
 								$sql .= " fk_product";
908 908
 								$sql .= ", entity";
909 909
 								$sql .= ", accountancy_code_buy";
@@ -914,13 +914,13 @@  discard block
 block discarded – undo
914 914
 								$sql .= ", accountancy_code_sell_export";
915 915
 								$sql .= ") VALUES (";
916 916
 								$sql .= $this->id;
917
-								$sql .= ", " . $conf->entity;
918
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
919
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
920
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
921
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
922
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
923
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
917
+								$sql .= ", ".$conf->entity;
918
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
919
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
920
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
921
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
922
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
923
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
924 924
 								$sql .= ")";
925 925
 								$result = $this->db->query($sql);
926 926
 								if (!$result) {
@@ -1300,12 +1300,12 @@  discard block
 block discarded – undo
1300 1300
 			$sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null');
1301 1301
 			$sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'";
1302 1302
 			if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1303
-				$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";
1304
-				$sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1305
-				$sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1306
-				$sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'";
1307
-				$sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1308
-				$sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1303
+				$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
1304
+				$sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1305
+				$sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'";
1306
+				$sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
1307
+				$sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1308
+				$sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'";
1309 1309
 			}
1310 1310
 			$sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null");
1311 1311
 			$sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null');
@@ -1336,9 +1336,9 @@  discard block
 block discarded – undo
1336 1336
 
1337 1337
 				// update accountancy for this entity
1338 1338
 				if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1339
-					$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity));
1339
+					$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
1340 1340
 
1341
-					$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
1341
+					$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
1342 1342
 					$sql .= " fk_product";
1343 1343
 					$sql .= ", entity";
1344 1344
 					$sql .= ", accountancy_code_buy";
@@ -1349,13 +1349,13 @@  discard block
 block discarded – undo
1349 1349
 					$sql .= ", accountancy_code_sell_export";
1350 1350
 					$sql .= ") VALUES (";
1351 1351
 					$sql .= $this->id;
1352
-					$sql .= ", " . $conf->entity;
1353
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1354
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1355
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1356
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1357
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1358
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1352
+					$sql .= ", ".$conf->entity;
1353
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1354
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1355
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
1356
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1357
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1358
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
1359 1359
 					$sql .= ")";
1360 1360
 					$result = $this->db->query($sql);
1361 1361
 					if (!$result) {
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
 				}
1727 1727
 			} elseif (isset($this->multilangs[$key])) {
1728 1728
 				if (empty($this->multilangs["$key"]["label"])) {
1729
-					$this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
1729
+					$this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
1730 1730
 					return -1;
1731 1731
 				}
1732 1732
 
@@ -1921,7 +1921,7 @@  discard block
 block discarded – undo
1921 1921
 	 */
1922 1922
 	private function getArrayForPriceCompare($level = 0)
1923 1923
 	{
1924
-		$testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly');
1924
+		$testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly');
1925 1925
 
1926 1926
 		foreach ($testExit as $field) {
1927 1927
 			if (!isset($this->$field)) {
@@ -2565,12 +2565,12 @@  discard block
 block discarded – undo
2565 2565
 
2566 2566
 		//For MultiCompany
2567 2567
 		//PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
2568
-		$separatedEntityPMP = false;	// Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2569
-		$separatedStock = false;		// Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2568
+		$separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2569
+		$separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2570 2570
 		$visibleWarehousesEntities = $conf->entity;
2571 2571
 		if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
2572 2572
 			if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
2573
-				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2573
+				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2574 2574
 				if ($this->db->num_rows($checkPMPPerEntity) > 0) {
2575 2575
 					$separatedEntityPMP = true;
2576 2576
 				}
@@ -2578,7 +2578,7 @@  discard block
 block discarded – undo
2578 2578
 			global $mc;
2579 2579
 			$separatedStock = true;
2580 2580
 			if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) {
2581
-				$visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']);
2581
+				$visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']);
2582 2582
 			}
2583 2583
 		}
2584 2584
 		if ($separatedEntityPMP) {
@@ -2596,10 +2596,10 @@  discard block
 block discarded – undo
2596 2596
 		}
2597 2597
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2598 2598
 		if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) {
2599
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
2599
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
2600 2600
 		}
2601 2601
 		if ($separatedStock) {
2602
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2602
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2603 2603
 		}
2604 2604
 
2605 2605
 		if ($id) {
@@ -2759,15 +2759,15 @@  discard block
 block discarded – undo
2759 2759
 						$sql .= " WHERE entity IN (".getEntity('productprice').")";
2760 2760
 						$sql .= " AND price_level=".((int) $i);
2761 2761
 						$sql .= " AND fk_product = ".((int) $this->id);
2762
-						$sql .= " ORDER BY date_price DESC, rowid DESC";	// Get the most recent line
2763
-						$sql .= " LIMIT 1";									// Only the first one
2762
+						$sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line
2763
+						$sql .= " LIMIT 1"; // Only the first one
2764 2764
 						$resql = $this->db->query($sql);
2765 2765
 						if ($resql) {
2766 2766
 							$result = $this->db->fetch_array($resql);
2767 2767
 
2768 2768
 							$this->multiprices[$i] = $result ? $result["price"] : null;
2769 2769
 							$this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null;
2770
-							$this->multiprices_min[$i] =  $result ? $result["price_min"] : null;
2770
+							$this->multiprices_min[$i] = $result ? $result["price_min"] : null;
2771 2771
 							$this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null;
2772 2772
 							$this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null;
2773 2773
 							// Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on
@@ -2992,7 +2992,7 @@  discard block
 block discarded – undo
2992 2992
 				$obj = $this->db->fetch_object($result);
2993 2993
 				$this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0;
2994 2994
 				$this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0;
2995
-				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0;		// qty may be a float due to the SUM()
2995
+				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM()
2996 2996
 			} else {
2997 2997
 				$this->error = $this->db->error();
2998 2998
 				$error++;
@@ -4498,7 +4498,7 @@  discard block
 block discarded – undo
4498 4498
 				//Addition of a product with the highest rank +1
4499 4499
 				$sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)";
4500 4500
 				$sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".price2num($incdec, 'MS').", ".((int) $rank).")";
4501
-				if (! $this->db->query($sql)) {
4501
+				if (!$this->db->query($sql)) {
4502 4502
 					dol_print_error($this->db);
4503 4503
 					return -1;
4504 4504
 				} else {
@@ -4619,7 +4619,7 @@  discard block
 block discarded – undo
4619 4619
 				$sql = "UPDATE ".$this->db->prefix()."product_association";
4620 4620
 				$sql .= " SET rang = ".((int) $cpt);
4621 4621
 				$sql .= " WHERE rowid = ".((int) $objrank->rowid);
4622
-				if (! $this->db->query($sql)) {
4622
+				if (!$this->db->query($sql)) {
4623 4623
 					dol_print_error($this->db);
4624 4624
 					return -1;
4625 4625
 				}
@@ -5055,7 +5055,7 @@  discard block
 block discarded – undo
5055 5055
 		if (isset($this->sousprods) && is_array($this->sousprods)) {
5056 5056
 			foreach ($this->sousprods as $prod_name => $desc_product) {
5057 5057
 				if (is_array($desc_product)) {
5058
-					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load);	// This set $this->res
5058
+					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res
5059 5059
 				}
5060 5060
 			}
5061 5061
 		}
@@ -5212,7 +5212,7 @@  discard block
 block discarded – undo
5212 5212
 		$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
5213 5213
 		$sql .= " ORDER BY pa.rang";
5214 5214
 
5215
-		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5215
+		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5216 5216
 
5217 5217
 		if ($level == 1) {
5218 5218
 			$alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately
@@ -5303,7 +5303,7 @@  discard block
 block discarded – undo
5303 5303
 		if (!empty($this->entity)) {
5304 5304
 			$tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, 1);
5305 5305
 			if ($this->nbphoto > 0) {
5306
-				$datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>';
5306
+				$datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>';
5307 5307
 			}
5308 5308
 		}
5309 5309
 
@@ -5313,7 +5313,7 @@  discard block
 block discarded – undo
5313 5313
 			$datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>';
5314 5314
 		}
5315 5315
 		if (isset($this->status) && isset($this->status_buy)) {
5316
-			$datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1);
5316
+			$datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1);
5317 5317
 		}
5318 5318
 
5319 5319
 		if (!empty($this->ref)) {
@@ -5361,7 +5361,7 @@  discard block
 block discarded – undo
5361 5361
 				$labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units);
5362 5362
 			}
5363 5363
 			if ($labelsurfacevolume) {
5364
-				$datas['surface'] = "<br>" . $labelsurfacevolume;
5364
+				$datas['surface'] = "<br>".$labelsurfacevolume;
5365 5365
 			}
5366 5366
 		}
5367 5367
 		if ($this->type == Product::TYPE_SERVICE && !empty($this->duration_value)) {
@@ -5403,9 +5403,9 @@  discard block
 block discarded – undo
5403 5403
 		}
5404 5404
 		// show categories for this record only in ajax to not overload lists
5405 5405
 		if (isModEnabled('category') && !$nofetch) {
5406
-			require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5406
+			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5407 5407
 			$form = new Form($this->db);
5408
-			$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5408
+			$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5409 5409
 		}
5410 5410
 
5411 5411
 		return $datas;
@@ -5926,7 +5926,7 @@  discard block
 block discarded – undo
5926 5926
 		if (isModEnabled("supplier_order")) {
5927 5927
 			$filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4');
5928 5928
 			if (isset($includedraftpoforvirtual)) {
5929
-				$filterStatus = '0,1,2,'.$filterStatus;	// 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
5929
+				$filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
5930 5930
 			}
5931 5931
 			$result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock);
5932 5932
 			if ($result < 0) {
@@ -6358,7 +6358,7 @@  discard block
 block discarded – undo
6358 6358
 		if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
6359 6359
 			$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
6360 6360
 			foreach ($dirsociete as $dirroot) {
6361
-				$res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6361
+				$res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6362 6362
 				if ($res) {
6363 6363
 					break;
6364 6364
 				}
@@ -6686,7 +6686,7 @@  discard block
 block discarded – undo
6686 6686
 	 */
6687 6687
 	public function getKanbanView($option = '', $arraydata = null)
6688 6688
 	{
6689
-		global $langs,$conf;
6689
+		global $langs, $conf;
6690 6690
 
6691 6691
 		$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
6692 6692
 
Please login to merge, or discard this patch.
htdocs/expensereport/payment/list.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -58,20 +58,20 @@  discard block
 block discarded – undo
58 58
 	$socid = $user->socid;
59 59
 }
60 60
 
61
-$search_ref				= GETPOST('search_ref', 'alpha');
62
-$search_date_startday	= GETPOSTINT('search_date_startday');
63
-$search_date_startmonth	= GETPOSTINT('search_date_startmonth');
64
-$search_date_startyear	= GETPOSTINT('search_date_startyear');
61
+$search_ref = GETPOST('search_ref', 'alpha');
62
+$search_date_startday = GETPOSTINT('search_date_startday');
63
+$search_date_startmonth = GETPOSTINT('search_date_startmonth');
64
+$search_date_startyear = GETPOSTINT('search_date_startyear');
65 65
 $search_date_endday		= GETPOSTINT('search_date_endday');
66
-$search_date_endmonth	= GETPOSTINT('search_date_endmonth');
66
+$search_date_endmonth = GETPOSTINT('search_date_endmonth');
67 67
 $search_date_endyear	= GETPOSTINT('search_date_endyear');
68
-$search_date_start		= dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
69
-$search_date_end		= dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
70
-$search_user			= GETPOST('search_user', 'alpha');
68
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
69
+$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
70
+$search_user = GETPOST('search_user', 'alpha');
71 71
 $search_payment_type	= GETPOST('search_payment_type');
72
-$search_cheque_num		= GETPOST('search_cheque_num', 'alpha');
72
+$search_cheque_num = GETPOST('search_cheque_num', 'alpha');
73 73
 $search_bank_account	= GETPOST('search_bank_account', 'int');
74
-$search_amount			= GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
74
+$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
75 75
 
76 76
 $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
77 77
 $sortfield				= GETPOST('sortfield', 'aZ09comma');
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 	'pndf.amount'			=> array('label' => "Amount", 'checked' => 1, 'position' => 70),
113 113
 );
114 114
 $arrayfields = dol_sort_array($arrayfields, 'position');
115
-'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';  // dol_sort_array looses type for Phan
115
+'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
116 116
 
117 117
 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
118 118
 $hookmanager->initHooks(array('paymentexpensereportlist'));
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
 	$sql .= natural_search('pndf.rowid', $search_ref);
214 214
 }
215 215
 if ($search_date_start) {
216
-	$sql .= " AND pndf.datep >= '" . $db->idate($search_date_start) . "'";
216
+	$sql .= " AND pndf.datep >= '".$db->idate($search_date_start)."'";
217 217
 }
218 218
 if ($search_date_end) {
219
-	$sql .= " AND pndf.datep <= '" . $db->idate($search_date_end) . "'";
219
+	$sql .= " AND pndf.datep <= '".$db->idate($search_date_end)."'";
220 220
 }
221 221
 
222 222
 if ($search_user) {
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 }
417 417
 
418 418
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
419
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
419
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
420 420
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
421 421
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
422 422
 
Please login to merge, or discard this patch.
htdocs/core/login/functions_openid_connect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
134 134
 		return false;
135 135
 	} elseif ($userinfo_response['http_code'] >= 400 && $userinfo_response['http_code'] < 500) {
136 136
 		// HTTP Error
137
-		$_SESSION["dol_loginmesg"] = "OpenID Connect user info error: " . $userinfo_response['content'];
137
+		$_SESSION["dol_loginmesg"] = "OpenID Connect user info error: ".$userinfo_response['content'];
138 138
 		dol_syslog("functions_openid_connect::check_user_password_openid_connect::".$userinfo_response['content'], LOG_ERR);
139 139
 		return false;
140 140
 	} elseif ($userinfo_content->error) {
Please login to merge, or discard this patch.
htdocs/core/modules/hrm/doc/pdf_standard.modules.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 				$pdf->SetFont(pdf_getPDFFont($outputlangs));
212 212
 				// Set path to the background PDF File
213 213
 				if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')) {
214
-					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
214
+					$pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
215 215
 					$tplidx = $pdf->importPage(1);
216 216
 				}
217 217
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 					$tab_top = 65;
253 253
 
254 254
 					$pdf->SetFont('', 'B', $default_font_size);
255
-					$pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes") . ":", 0, 'L', 0, 0, 12, $tab_top);
255
+					$pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes").":", 0, 'L', 0, 0, 12, $tab_top);
256 256
 					$tab_top += 4;
257 257
 					$pdf->SetFont('', '', $default_font_size - 1);
258 258
 					$pdf->writeHTMLCell(190, 3, $this->posxnotes + 1, $tab_top + 1, dol_htmlentitiesbr($object->note_public), 0, 1);
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 			// No fill color
485 485
 			$pdf->SetFillColor(255, 255, 255);
486 486
 		}
487
-		$result = (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->rankorder . "/" . $objectligne->required_rank : "-");
487
+		$result = (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->rankorder."/".$objectligne->required_rank : "-");
488 488
 		$pdf->MultiCell($this->posxresult - 210 - 0.8 - 4, 4, $result, 0, 'C', 1);
489 489
 
490 490
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 		$comment = $skill->label;
504 504
 
505 505
 		if (!empty($skill->description)) {
506
-			$comment .= '<br>' . $outputlangs->trans("Description").': '.$skill->description;
506
+			$comment .= '<br>'.$outputlangs->trans("Description").': '.$skill->description;
507 507
 		}
508 508
 		$pdf->writeHTMLCell($this->posxrankemp - $this->posxskill - 0.8, 4, $this->posxskill - 1, $curY, $comment, 0, 1);
509 509
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 			// employee information
588 588
 			$employee = new User($this->db);
589 589
 			$employee->fetch($object->fk_user);
590
-			$carac_emetteur .= ($carac_emetteur ? "\n" : '').$outputlangs->transnoentities('Employee').' : '.$outputlangs->convToOutputCharset(ucfirst($employee->firstname) . ' ' . strtoupper($employee->lastname));
590
+			$carac_emetteur .= ($carac_emetteur ? "\n" : '').$outputlangs->transnoentities('Employee').' : '.$outputlangs->convToOutputCharset(ucfirst($employee->firstname).' '.strtoupper($employee->lastname));
591 591
 
592 592
 			// Position
593 593
 			include_once DOL_DOCUMENT_ROOT.'/hrm/class/job.class.php';
Please login to merge, or discard this patch.