Completed
Branch develop (049fe9)
by
unknown
25:12
created
htdocs/webportal/controllers/documentlist.controller.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 
20 20
 
21
-require_once __DIR__ . '/abstractdocument.controller.class.php';
21
+require_once __DIR__.'/abstractdocument.controller.class.php';
22 22
 
23 23
 /**
24 24
  * \file        htdocs/webportal/controllers/documentlist.controller.class.php
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 
91 91
 		if (!empty($thirdparty) && $thirdparty->id) {
92 92
 			// 1. Prepare data
93
-			require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
93
+			require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
94 94
 			$client_dir_name = dol_sanitizeFileName($thirdparty->ref);
95
-			$dir_ged_tiers = $conf->societe->dir_output . '/' . $client_dir_name;
95
+			$dir_ged_tiers = $conf->societe->dir_output.'/'.$client_dir_name;
96 96
 			$fileList = dol_dir_list($dir_ged_tiers, 'files', 0, '', '', 'date', SORT_DESC);
97 97
 
98 98
 			// 2. Define the link builder function
@@ -102,8 +102,8 @@  discard block
 block discarded – undo
102 102
 			 * @param	array<string, mixed> $file  File (array) to get url for
103 103
 			 * @return	string						Url for file
104 104
 			 */
105
-			$linkBuilder = static function (array $file) use ($client_dir_name) {
106
-				return DOL_URL_ROOT . '/document.php?modulepart=societe&attachment=1&file=' . urlencode($client_dir_name . '/' . $file['name']);
105
+			$linkBuilder = static function(array $file) use ($client_dir_name) {
106
+				return DOL_URL_ROOT.'/document.php?modulepart=societe&attachment=1&file='.urlencode($client_dir_name.'/'.$file['name']);
107 107
 			};
108 108
 
109 109
 			// 3. Encapsulate the link builder in an array, as required by displayDocumentTable
Please login to merge, or discard this patch.
htdocs/webportal/controllers/shareddocuments.controller.class.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
  * the Free Software Foundation.
8 8
  */
9 9
 
10
-require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
10
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
11 11
 
12
-require_once __DIR__ . '/abstractdocument.controller.class.php';
12
+require_once __DIR__.'/abstractdocument.controller.class.php';
13 13
 
14 14
 /**
15 15
  * \file        htdocs/webportal/controllers/shareddocuments.controller.class.php
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 
94 94
 		// 2. Prepare the paths
95 95
 		$shared_dir_name = getDolGlobalString('WEBPORTAL_SHARED_DOCS_DIR', 'Documentscomptes');
96
-		$base_dir_ged_partage = $conf->ecm->dir_output . '/' . $shared_dir_name;
96
+		$base_dir_ged_partage = $conf->ecm->dir_output.'/'.$shared_dir_name;
97 97
 		// The full path now includes the visited subfolder
98
-		$current_dir_ged_partage = $base_dir_ged_partage . '/' . $sanitized_subdir;
98
+		$current_dir_ged_partage = $base_dir_ged_partage.'/'.$sanitized_subdir;
99 99
 
100 100
 		// 3. List ALL contents (files AND folders) of the current directory
101 101
 		$itemList = dol_dir_list($current_dir_ged_partage, 'all', 0, '', '', 'name', SORT_ASC);
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			foreach ($itemList as $key => $item) {
104 104
 				// If the item is a file and its size is empty...
105 105
 				if ($item['type'] === 'file' && empty($item['size'])) {
106
-					$full_file_path = $current_dir_ged_partage . '/' . $item['name'];
106
+					$full_file_path = $current_dir_ged_partage.'/'.$item['name'];
107 107
 					// ... we recalculate its size and update the table.
108 108
 					// The @ avoids an error if the file is unreadable.
109 109
 					$itemList[$key]['size'] = @filesize($full_file_path);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		$path_so_far = '';
117 117
 		if (!empty($sanitized_subdir)) {
118 118
 			foreach (explode('/', $sanitized_subdir) as $part) {
119
-				$path_so_far .= (empty($path_so_far) ? '' : '/') . $part;
119
+				$path_so_far .= (empty($path_so_far) ? '' : '/').$part;
120 120
 				$breadcrumbs .= '<li class="breadcrumb-item"><a href="'.$baseUrl.'&subdir='.$path_so_far.'">'.dol_htmlentities($part).'</a></li>';
121 121
 			}
122 122
 		}
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
 		// 5. Define functions to build navigation and download links
129 129
 		$linkBuilder = array(
130 130
 			'dir' => /** @param array<string, mixed> $dir */
131
-				function (array $dir) use ($baseUrl, $sanitized_subdir) {
132
-					$new_subdir = (!empty($sanitized_subdir) ? $sanitized_subdir . '/' : '') . $dir['name'];
133
-					return $baseUrl . '&subdir=' . urlencode($new_subdir);
131
+				function(array $dir) use ($baseUrl, $sanitized_subdir) {
132
+					$new_subdir = (!empty($sanitized_subdir) ? $sanitized_subdir.'/' : '').$dir['name'];
133
+					return $baseUrl.'&subdir='.urlencode($new_subdir);
134 134
 				},
135 135
 			'file' => /** @param array<string, mixed> $file */
136
-				function (array $file) use ($shared_dir_name, $sanitized_subdir) {
137
-					$file_path = $shared_dir_name . '/' . (!empty($sanitized_subdir) ? $sanitized_subdir . '/' : '') . $file['name'];
138
-					return DOL_URL_ROOT . '/document.php?modulepart=ecm&file=' . urlencode($file_path);
136
+				function(array $file) use ($shared_dir_name, $sanitized_subdir) {
137
+					$file_path = $shared_dir_name.'/'.(!empty($sanitized_subdir) ? $sanitized_subdir.'/' : '').$file['name'];
138
+					return DOL_URL_ROOT.'/document.php?modulepart=ecm&file='.urlencode($file_path);
139 139
 				}
140 140
 		);
141 141
 		// 6. Call the new display method
Please login to merge, or discard this patch.
htdocs/webportal/controllers/abstractdocument.controller.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  * the Free Software Foundation.
8 8
  */
9 9
 
10
-require_once __DIR__ . '/../class/controller.class.php';
10
+require_once __DIR__.'/../class/controller.class.php';
11 11
 
12 12
 /**
13 13
  * \file        htdocs/webportal/controllers/abstractdocument.controller.class.php
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	{
38 38
 		global $langs;
39 39
 
40
-		echo '<h2>' . htmlspecialchars($title) . '</h2>';
40
+		echo '<h2>'.htmlspecialchars($title).'</h2>';
41 41
 
42 42
 		if (is_array($itemList) && count($itemList) > 0) {
43 43
 			// 1. Separate folders and files
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
 			// 2. Display the table
55 55
 			echo '<table class="table table-hover" width="100%">';
56 56
 			echo '<thead><tr>';
57
-			echo '<th>' . $langs->trans('Name') . '</th>';
58
-			echo '<th style="text-align: right; white-space: nowrap;">' . $langs->trans('Size') . '</th>';
59
-			echo '<th style="text-align: right; white-space: nowrap;">' . $langs->trans('DateM') . '</th>';
57
+			echo '<th>'.$langs->trans('Name').'</th>';
58
+			echo '<th style="text-align: right; white-space: nowrap;">'.$langs->trans('Size').'</th>';
59
+			echo '<th style="text-align: right; white-space: nowrap;">'.$langs->trans('DateM').'</th>';
60 60
 			echo '</tr></thead>';
61 61
 			echo '<tbody>';
62 62
 
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 			foreach ($directories as $dir) {
65 65
 				echo '<tr>';
66 66
 				// The link for a directory is for navigation
67
-				echo '<td><a href="' . $linkBuilder['dir']($dir) . '">
Please login to merge, or discard this patch.
htdocs/expensereport/class/expensereport.class.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -254,12 +254,12 @@  discard block
 block discarded – undo
254 254
 	 * @var float|int
255 255
 	 * @deprecated See $total_localtax1
256 256
 	 */
257
-	public $localtax1;	// for backward compatibility (real field should be total_localtax1 defined into CommonObject)
257
+	public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject)
258 258
 	/**
259 259
 	 * @var float|int
260 260
 	 * @deprecated See $total_localtax2
261 261
 	 */
262
-	public $localtax2;	// for backward compatibility (real field should be total_localtax2 defined into CommonObject)
262
+	public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject)
263 263
 
264 264
 	/**
265 265
 	 * Draft status
@@ -350,8 +350,8 @@  discard block
 block discarded – undo
350 350
 		$this->total_tva = 0;
351 351
 		$this->total_localtax1 = 0;
352 352
 		$this->total_localtax2 = 0;
353
-		$this->localtax1 = 0;	// For backward compatibility
354
-		$this->localtax2 = 0;	// For backward compatibility
353
+		$this->localtax1 = 0; // For backward compatibility
354
+		$this->localtax2 = 0; // For backward compatibility
355 355
 		$this->modepaymentid = 0;
356 356
 
357 357
 		// List of language codes for status
@@ -713,8 +713,8 @@  discard block
 block discarded – undo
713 713
 				$this->total_ht     = $obj->total_ht;
714 714
 				$this->total_tva    = $obj->total_tva;
715 715
 				$this->total_ttc    = $obj->total_ttc;
716
-				$this->localtax1    = $obj->total_localtax1;		// For backward compatibility
717
-				$this->localtax2    = $obj->total_localtax2;		// For backward compatibility
716
+				$this->localtax1    = $obj->total_localtax1; // For backward compatibility
717
+				$this->localtax2    = $obj->total_localtax2; // For backward compatibility
718 718
 				$this->total_localtax1 = $obj->total_localtax1;
719 719
 				$this->total_localtax2 = $obj->total_localtax2;
720 720
 
@@ -977,7 +977,7 @@  discard block
 block discarded – undo
977 977
 
978 978
 		$this->note_private = 'Private note';
979 979
 		$this->note_public = 'SPECIMEN';
980
-		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5);	// We can force the nb of lines to test from command line (but not more than 1000)
980
+		$nbp = min(1000, GETPOSTINT('nblines') ? GETPOSTINT('nblines') : 5); // We can force the nb of lines to test from command line (but not more than 1000)
981 981
 		$xnbp = 0;
982 982
 		while ($xnbp < $nbp) {
983 983
 			$line = new ExpenseReportLine($this->db);
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
 
1188 1188
 				$deplig->rule_warning_message = $objp->rule_warning_message;
1189 1189
 
1190
-				$deplig->rang               = $objp->rang;
1190
+				$deplig->rang = $objp->rang;
1191 1191
 
1192 1192
 				$this->lines[$i] = $deplig;
1193 1193
 
@@ -1735,7 +1735,7 @@  discard block
 block discarded – undo
1735 1735
 		if (getDolGlobalString('EXPENSEREPORT_ADDON')) {
1736 1736
 			$mybool = false;
1737 1737
 
1738
-			$file = getDolGlobalString('EXPENSEREPORT_ADDON') . ".php";
1738
+			$file = getDolGlobalString('EXPENSEREPORT_ADDON').".php";
1739 1739
 			$classname = getDolGlobalString('EXPENSEREPORT_ADDON');
1740 1740
 
1741 1741
 			// Include file with class
@@ -1890,7 +1890,7 @@  discard block
 block discarded – undo
1890 1890
 		$result .= $linkend;
1891 1891
 
1892 1892
 		global $action;
1893
-		$hookmanager->initHooks(array($this->element . 'dao'));
1893
+		$hookmanager->initHooks(array($this->element.'dao'));
1894 1894
 		$parameters = array('id' => $this->id, 'getnomurl' => &$result);
1895 1895
 		$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
1896 1896
 		if ($reshook > 0) {
@@ -1983,8 +1983,8 @@  discard block
 block discarded – undo
1983 1983
 			$this->line = new ExpenseReportLine($this->db);
1984 1984
 
1985 1985
 			// We don't know seller and buyer for expense reports
1986
-			$seller = $mysoc;			// We use same than current company (expense report are often done in same country)
1987
-			$seller->tva_assuj = 1;		// Most seller uses vat
1986
+			$seller = $mysoc; // We use same than current company (expense report are often done in same country)
1987
+			$seller->tva_assuj = 1; // Most seller uses vat
1988 1988
 			$buyer = new Societe($this->db);
1989 1989
 
1990 1990
 			$localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller);
@@ -2066,8 +2066,8 @@  discard block
 block discarded – undo
2066 2066
 
2067 2067
 		// We don't know seller and buyer for expense reports
2068 2068
 		if (!is_object($seller)) {
2069
-			$seller = $mysoc;			// We use same than current company (expense report are often done in same country)
2070
-			$seller->tva_assuj = 1;		// Most seller uses vat
2069
+			$seller = $mysoc; // We use same than current company (expense report are often done in same country)
2070
+			$seller->tva_assuj = 1; // Most seller uses vat
2071 2071
 		}
2072 2072
 
2073 2073
 		$expensereportrule = new ExpenseReportRule($this->db);
@@ -2151,8 +2151,8 @@  discard block
 block discarded – undo
2151 2151
 
2152 2152
 		// We don't know seller and buyer for expense reports
2153 2153
 		if (!is_object($seller)) {
2154
-			$seller = $mysoc;			// We use same than current company (expense report are often done in same country)
2155
-			$seller->tva_assuj = 1;		// Most seller uses vat
2154
+			$seller = $mysoc; // We use same than current company (expense report are often done in same country)
2155
+			$seller->tva_assuj = 1; // Most seller uses vat
2156 2156
 		}
2157 2157
 
2158 2158
 		$expenseik = new ExpenseReportIk($this->db);
@@ -2246,10 +2246,10 @@  discard block
 block discarded – undo
2246 2246
 			$type = 0; // TODO What if type is service ?
2247 2247
 
2248 2248
 			// We don't know seller and buyer for expense reports
2249
-			$seller = $mysoc;			// We use same than current company (expense report are often done in same country)
2250
-			$seller->tva_assuj = 1;		// Most seller uses vat
2251
-			$seller->localtax1_assuj = $mysoc->localtax1_assuj;		// We don't know, we reuse the state of company
2252
-			$seller->localtax2_assuj = $mysoc->localtax1_assuj;		// We don't know, we reuse the state of company
2249
+			$seller = $mysoc; // We use same than current company (expense report are often done in same country)
2250
+			$seller->tva_assuj = 1; // Most seller uses vat
2251
+			$seller->localtax1_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
2252
+			$seller->localtax2_assuj = $mysoc->localtax1_assuj; // We don't know, we reuse the state of company
2253 2253
 			$buyer = new Societe($this->db);
2254 2254
 
2255 2255
 			$localtaxes_type = getLocalTaxesFromRate($vatrate, 0, $buyer, $seller);
@@ -2854,7 +2854,7 @@  discard block
 block discarded – undo
2854 2854
 		$return .= img_picto('', $this->picto);
2855 2855
 		$return .= '</span>';
2856 2856
 		$return .= '<div class="info-box-content">';
2857
-		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->getNomUrl(1) . '</span>';
2857
+		$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.$this->getNomUrl(1).'</span>';
2858 2858
 		if ($selected >= 0) {
2859 2859
 			$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
2860 2860
 		}
Please login to merge, or discard this patch.
htdocs/api/class/api_documents.class.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 				throw new RestException(500, 'Error generating document');
217 217
 			}
218 218
 		} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') {
219
-			require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
219
+			require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
220 220
 			$tmpobject = new FactureFournisseur($this->db);
221 221
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
222 222
 			if (!$result) {
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 				throw new RestException(500, 'Error generating document');
254 254
 			}
255 255
 		} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
256
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
256
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
257 257
 
258 258
 			$tmpobject = new Contrat($this->db);
259 259
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 				throw new RestException(500, 'Error generating document missing doctemplate parameter');
270 270
 			}
271 271
 		} elseif ($modulepart == 'expedition' || $modulepart == 'shipment') {
272
-			require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
272
+			require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
273 273
 
274 274
 			$tmpobject = new Expedition($this->db);
275 275
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 				throw new RestException(500, 'Error generating document missing doctemplate parameter');
286 286
 			}
287 287
 		} elseif ($modulepart == 'mrp') {
288
-			require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
288
+			require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
289 289
 
290 290
 			$tmpobject = new Mo($this->db);
291 291
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
 				throw new RestException(404, 'User not found');
390 390
 			}
391 391
 
392
-			$upload_dir = getMultidirOutput($object) . '/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id;
392
+			$upload_dir = getMultidirOutput($object).'/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id;
393 393
 		} elseif ($modulepart == 'adherent' || $modulepart == 'member') {
394 394
 			require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
395 395
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 				throw new RestException(404, 'Member not found');
404 404
 			}
405 405
 
406
-			$upload_dir = getMultidirOutput($object) . "/".get_exdir(0, 0, 0, 1, $object, 'member');
406
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'member');
407 407
 		} elseif ($modulepart == 'propal' || $modulepart == 'proposal') {
408 408
 			require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
409 409
 
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 				throw new RestException(404, 'Order not found');
446 446
 			}
447 447
 
448
-			$upload_dir = getMultidirOutput($object). "/".get_exdir(0, 0, 0, 1, $object, 'commande');
448
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'commande');
449 449
 		} elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') {
450 450
 			$modulepart = 'supplier_order';
451 451
 
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 				throw new RestException(404, 'Purchase order not found');
462 462
 			}
463 463
 
464
-			$upload_dir = getMultidirOutput($object) . "/commande/".dol_sanitizeFileName($object->ref);
464
+			$upload_dir = getMultidirOutput($object)."/commande/".dol_sanitizeFileName($object->ref);
465 465
 		} elseif ($modulepart == 'shipment' || $modulepart == 'expedition') {
466 466
 			require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
467 467
 
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 				throw new RestException(404, 'Shipment not found');
476 476
 			}
477 477
 
478
-			$upload_dir = getMultidirOutput($object) . "/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment');
478
+			$upload_dir = getMultidirOutput($object)."/sending/".get_exdir(0, 0, 0, 1, $object, 'shipment');
479 479
 		} elseif ($modulepart == 'facture' || $modulepart == 'invoice') {
480 480
 			require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
481 481
 
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
 				throw new RestException(404, 'Invoice not found');
490 490
 			}
491 491
 
492
-			$upload_dir = getMultidirOutput($object) . "/".get_exdir(0, 0, 0, 1, $object, 'invoice');
492
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
493 493
 		} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') {
494 494
 			$modulepart = 'supplier_invoice';
495 495
 
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 				throw new RestException(404, 'Invoice not found');
506 506
 			}
507 507
 
508
-			$upload_dir = getMultidirOutput($object) . "/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
508
+			$upload_dir = getMultidirOutput($object)."/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
509 509
 		} elseif ($modulepart == 'produit' || $modulepart == 'product' || $modulepart == 'service') {
510 510
 			require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
511 511
 
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 				throw new RestException(404, 'Event not found');
536 536
 			}
537 537
 
538
-			$upload_dir = getMultidirOutput($object) . '/'.dol_sanitizeFileName($object->ref);
538
+			$upload_dir = getMultidirOutput($object).'/'.dol_sanitizeFileName($object->ref);
539 539
 		} elseif ($modulepart == 'expensereport') {
540 540
 			require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
541 541
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 				throw new RestException(404, 'Expense report not found');
550 550
 			}
551 551
 
552
-			$upload_dir = getMultidirOutput($object) . '/'.dol_sanitizeFileName($object->ref);
552
+			$upload_dir = getMultidirOutput($object).'/'.dol_sanitizeFileName($object->ref);
553 553
 		} elseif ($modulepart == 'ticket') {
554 554
 			require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
555 555
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 				throw new RestException(404, 'KM article not found');
578 578
 			}
579 579
 
580
-			$upload_dir = getMultidirOutput($object) . '/knowledgerecord/'.dol_sanitizeFileName($object->ref);
580
+			$upload_dir = getMultidirOutput($object).'/knowledgerecord/'.dol_sanitizeFileName($object->ref);
581 581
 		} elseif ($modulepart == 'categorie' || $modulepart == 'category') {
582 582
 			require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
583 583
 
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
 			// $recursive = 0;
611 611
 		} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
612 612
 			$modulepart = 'contrat';
613
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
613
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
614 614
 
615 615
 			$object = new Contrat($this->db);
616 616
 			$result = $object->fetch($id, $ref);
@@ -618,10 +618,10 @@  discard block
 block discarded – undo
618 618
 				throw new RestException(404, 'Contract not found');
619 619
 			}
620 620
 
621
-			$upload_dir = getMultidirOutput($object) . "/" . get_exdir(0, 0, 0, 1, $object, 'contract');
621
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'contract');
622 622
 		} elseif ($modulepart == 'intervention' || $modulepart == 'ficheinter') {
623 623
 			$modulepart = 'ficheinter';
624
-			require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
624
+			require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
625 625
 
626 626
 			$object = new Fichinter($this->db);
627 627
 			$result = $object->fetch($id, $ref);
@@ -629,20 +629,20 @@  discard block
 block discarded – undo
629 629
 				throw new RestException(404, 'Interventional not found');
630 630
 			}
631 631
 
632
-			$upload_dir = $conf->ficheinter->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'ficheinter');
632
+			$upload_dir = $conf->ficheinter->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'ficheinter');
633 633
 		} elseif ($modulepart == 'projet' || $modulepart == 'project') {
634 634
 			$modulepart = 'project';
635
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
635
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
636 636
 
637 637
 			$object = new Project($this->db);
638 638
 			$result = $object->fetch($id, $ref);
639 639
 			if (!$result) {
640 640
 				throw new RestException(404, 'Project not found');
641 641
 			}
642
-			$upload_dir = $conf->project->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'project');
642
+			$upload_dir = $conf->project->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'project');
643 643
 		} elseif ($modulepart == 'task' || $modulepart == 'project_task') {
644 644
 			$modulepart = 'project_task';
645
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php';
645
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
646 646
 
647 647
 			if (!DolibarrApiAccess::$user->hasRight('projet', 'lire')) {
648 648
 				throw new RestException(403);
@@ -660,10 +660,10 @@  discard block
 block discarded – undo
660 660
 				throw new RestException(500, 'Error while fetching project for task');
661 661
 			}
662 662
 
663
-			$upload_dir = $conf->project->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . "/" . dol_sanitizeFileName($object->ref);
663
+			$upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($object->project->ref)."/".dol_sanitizeFileName($object->ref);
664 664
 		} elseif ($modulepart == 'mrp') {
665 665
 			$modulepart = 'mrp';
666
-			require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
666
+			require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
667 667
 
668 668
 			$object = new Mo($this->db);
669 669
 			$result = $object->fetch($id, $ref);
@@ -671,23 +671,23 @@  discard block
 block discarded – undo
671 671
 				throw new RestException(404, 'MO not found');
672 672
 			}
673 673
 
674
-			$upload_dir = getMultidirOutput($object) . "/" . get_exdir(0, 0, 0, 1, $object, 'mrp');
674
+			$upload_dir = getMultidirOutput($object)."/".get_exdir(0, 0, 0, 1, $object, 'mrp');
675 675
 		} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
676 676
 			$modulepart = 'contact';
677 677
 			require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
678 678
 
679 679
 			$object = new Contact($this->db);
680
-			$result = $object->fetch($id?$id:$ref);
680
+			$result = $object->fetch($id ? $id : $ref);
681 681
 			if (!$result) {
682 682
 				throw new RestException(404, 'Contact not found');
683 683
 			}
684
-			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity] . "/contact/" . get_exdir(0, 0, 0, 1, $object, 'contact');
684
+			$upload_dir = $conf->societe->multidir_output[$object->entity ?? $conf->entity]."/contact/".get_exdir(0, 0, 0, 1, $object, 'contact');
685 685
 		} else {
686 686
 			throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
687 687
 		}
688 688
 
689 689
 		$objectType = $modulepart;
690
-		if (! empty($object->id) && ! empty($object->table_element)) {
690
+		if (!empty($object->id) && !empty($object->table_element)) {
691 691
 			$objectType = $object->table_element;
692 692
 		}
693 693
 
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
 					throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror());
706 706
 				} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
707 707
 					$count = count($filearray);
708
-					for ($i = 0 ; $i < $count ; $i++) {
708
+					for ($i = 0; $i < $count; $i++) {
709 709
 						foreach ($ecmfile->lines as $line) {
710 710
 							unset($line->db);
711 711
 							if ($filearray[$i]['name'] == $line->filename) {
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 				$object = new Propal($this->db);
886 886
 			} elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') {
887 887
 				$modulepart = 'agenda';
888
-				require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
888
+				require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
889 889
 				$object = new ActionComm($this->db);
890 890
 			} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
891 891
 				$modulepart = 'contact';
@@ -897,23 +897,23 @@  discard block
 block discarded – undo
897 897
 				require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
898 898
 				$object = new Societe($this->db);
899 899
 				$fetchbyid = true;
900
-			} elseif ($modulepart == 'knowledgemanagement' ) {
900
+			} elseif ($modulepart == 'knowledgemanagement') {
901 901
 				$modulepart = 'knowledgemanagement';
902 902
 				require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php';
903 903
 				$object = new KnowledgeRecord($this->db);
904 904
 				$fetchbyid = true;
905
-			} elseif ($modulepart == 'ticket' ) {
905
+			} elseif ($modulepart == 'ticket') {
906 906
 				$modulepart = 'ticket';
907 907
 				require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
908 908
 				$object = new Ticket($this->db);
909 909
 				$fetchbyid = true;
910 910
 			} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
911 911
 				$modulepart = 'contrat';
912
-				require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
912
+				require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
913 913
 				$object = new Contrat($this->db);
914 914
 			} elseif ($modulepart == 'mrp') {
915 915
 				$modulepart = 'mrp';
916
-				require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
916
+				require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
917 917
 				$object = new Mo($this->db);
918 918
 			} elseif ($modulepart == 'ecm') {
919 919
 				throw new RestException(500, 'Using a non empty "ref" is not compatible with using modulepart = '.$modulepart);
Please login to merge, or discard this patch.