@@ -80,20 +80,20 @@ |
||
| 80 | 80 | } |
| 81 | 81 | if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active |
| 82 | 82 | // Qty frozen |
| 83 | - print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>'; |
|
| 83 | + print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>'; |
|
| 84 | 84 | |
| 85 | 85 | // Disable stock change |
| 86 | - print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>'; |
|
| 86 | + print '<td class="linecoldisablestockchange right">'.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).'</td>'; |
|
| 87 | 87 | |
| 88 | 88 | // Efficiency |
| 89 | - print '<td class="linecolefficiency right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>'; |
|
| 89 | + print '<td class="linecolefficiency right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>'; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // Service and workstations are active |
| 93 | 93 | if ($filtertype == 1 && isModEnabled('workstation')) { |
| 94 | 94 | // Workstation |
| 95 | 95 | if (isModEnabled('workstation')) { |
| 96 | - print '<td class="linecolworkstation">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>'; |
|
| 96 | + print '<td class="linecolworkstation">'.$form->textwithpicto($langs->trans('DefaultWorkstation'), '').'</td>'; |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
@@ -146,18 +146,18 @@ |
||
| 146 | 146 | if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active |
| 147 | 147 | // Qty frozen |
| 148 | 148 | $coldisplay++; |
| 149 | - print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOSTISSET("qty_frozen") ? (GETPOSTINT('qty_frozen') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')) . '>'; |
|
| 149 | + print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOSTISSET("qty_frozen") ? (GETPOSTINT('qty_frozen') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')).'>'; |
|
| 150 | 150 | print '</td>'; |
| 151 | 151 | |
| 152 | 152 | // Disable stock change |
| 153 | 153 | $coldisplay++; |
| 154 | - print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOSTISSET('disablestockchange') ? (GETPOSTINT("disable_stock_change") ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')) . '">'; |
|
| 154 | + print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOSTISSET('disablestockchange') ? (GETPOSTINT("disable_stock_change") ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')).'">'; |
|
| 155 | 155 | print '</td>'; |
| 156 | 156 | |
| 157 | 157 | // Efficiency |
| 158 | 158 | $coldisplay++; |
| 159 | 159 | print '<td class="nobottom nowrap linecollost right">'; |
| 160 | - print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . $line->efficiency . '"></td>'; |
|
| 160 | + print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>'; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | // Service and workstations are active |
@@ -85,27 +85,27 @@ discard block |
||
| 85 | 85 | print '</span></td>'; |
| 86 | 86 | } |
| 87 | 87 | } else { // Service |
| 88 | - print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
|
| 88 | + print '<td class="linecolunit right">'.$form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
|
| 89 | 89 | } |
| 90 | 90 | if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active |
| 91 | 91 | // Qty frozen |
| 92 | - print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>'; |
|
| 92 | + print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>'; |
|
| 93 | 93 | |
| 94 | 94 | // Disable stock change |
| 95 | - print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>'; |
|
| 95 | + print '<td class="linecoldisablestockchange right">'.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).'</td>'; |
|
| 96 | 96 | |
| 97 | 97 | // Efficiency |
| 98 | - print '<td class="linecollost right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>'; |
|
| 98 | + print '<td class="linecollost right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>'; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | // Service and workstations are active |
| 102 | 102 | if ($filtertype == 1 && isModEnabled('workstation')) { |
| 103 | - print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('Workstation'), '') . '</td>'; |
|
| 103 | + print '<td class="linecolworkstation right">'.$form->textwithpicto($langs->trans('Workstation'), '').'</td>'; |
|
| 104 | 104 | } |
| 105 | 105 | // Cost |
| 106 | - print '<td class="linecoltotalcost right">' . $form->textwithpicto($langs->trans('TotalCost'), '') . '</td>'; |
|
| 106 | + print '<td class="linecoltotalcost right">'.$form->textwithpicto($langs->trans('TotalCost'), '').'</td>'; |
|
| 107 | 107 | |
| 108 | - print '<td class="linecoledit" colspan="' . $colspan . '"> </td>'; |
|
| 108 | + print '<td class="linecoledit" colspan="'.$colspan.'"> </td>'; |
|
| 109 | 109 | print '</tr>'; |
| 110 | 110 | } |
| 111 | 111 | print '<tr class="pair nodrag nodrop nohoverpair'.(($nolinesbefore || $object->element == 'contrat') ? '' : ' liste_titre_create').'">'; |
@@ -180,18 +180,18 @@ discard block |
||
| 180 | 180 | if ($filtertype != 1 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { // Product or stock support for Services is active |
| 181 | 181 | // Qty frozen |
| 182 | 182 | $coldisplay++; |
| 183 | - print '<td class="bordertop nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOST("qty_frozen", 'alpha') ? ' checked="checked"' : '') . '>'; |
|
| 183 | + print '<td class="bordertop nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOST("qty_frozen", 'alpha') ? ' checked="checked"' : '').'>'; |
|
| 184 | 184 | print '</td>'; |
| 185 | 185 | |
| 186 | 186 | // Disable stock change |
| 187 | 187 | $coldisplay++; |
| 188 | - print '<td class="bordertop nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOST("disable_stock_change", 'alpha') ? ' checked="checked"' : '') . '">'; |
|
| 188 | + print '<td class="bordertop nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOST("disable_stock_change", 'alpha') ? ' checked="checked"' : '').'">'; |
|
| 189 | 189 | print '</td>'; |
| 190 | 190 | |
| 191 | 191 | // Efficiency |
| 192 | 192 | $coldisplay++; |
| 193 | 193 | print '<td class="bordertop nobottom nowrap linecollost right">'; |
| 194 | - print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . ((GETPOSTISSET("efficiency") && $action == 'addline') ? GETPOST("efficiency", 'alpha') : 1) . '">'; |
|
| 194 | + print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="'.((GETPOSTISSET("efficiency") && $action == 'addline') ? GETPOST("efficiency", 'alpha') : 1).'">'; |
|
| 195 | 195 | print '</td>'; |
| 196 | 196 | } |
| 197 | 197 | // Service and workstations are active |
@@ -210,8 +210,8 @@ discard block |
||
| 210 | 210 | |
| 211 | 211 | |
| 212 | 212 | $coldisplay += $colspan; |
| 213 | -print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="' . $colspan . '">'; |
|
| 214 | -print '<input type="submit" class="button button-add small" name="addline" id="addline" value="' . $langs->trans('Add') . '">'; |
|
| 213 | +print '<td class="bordertop nobottom linecoledit right valignmiddle" colspan="'.$colspan.'">'; |
|
| 214 | +print '<input type="submit" class="button button-add small" name="addline" id="addline" value="'.$langs->trans('Add').'">'; |
|
| 215 | 215 | print '</td>'; |
| 216 | 216 | print '</tr>'; |
| 217 | 217 | |
@@ -52,9 +52,11 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public static function addPath($path) |
| 54 | 54 | { |
| 55 | - if (false === $path = stream_resolve_include_path($path)) |
|
| 56 | - return false; |
|
| 57 | - else set_include_path($path.PATH_SEPARATOR.get_include_path()); |
|
| 55 | + if (false === $path = stream_resolve_include_path($path)) { |
|
| 56 | + return false; |
|
| 57 | + } else { |
|
| 58 | + set_include_path($path.PATH_SEPARATOR.get_include_path()); |
|
| 59 | + } |
|
| 58 | 60 | return $path; |
| 59 | 61 | } |
| 60 | 62 | |
@@ -67,16 +69,19 @@ discard block |
||
| 67 | 69 | */ |
| 68 | 70 | public static function thereCanBeOnlyOne() |
| 69 | 71 | { |
| 70 | - if (static::$perfectLoaders === spl_autoload_functions()) |
|
| 71 | - return static::$instance; |
|
| 72 | + if (static::$perfectLoaders === spl_autoload_functions()) { |
|
| 73 | + return static::$instance; |
|
| 74 | + } |
|
| 72 | 75 | |
| 73 | - if (false !== $loaders = spl_autoload_functions()) |
|
| 74 | - if (0 < $count = count($loaders)) |
|
| 76 | + if (false !== $loaders = spl_autoload_functions()) { |
|
| 77 | + if (0 < $count = count($loaders)) |
|
| 75 | 78 | for ($i = 0, static::$rogueLoaders += $loaders; |
| 79 | + } |
|
| 76 | 80 | $i < $count && false != ($loader = $loaders[$i]); |
| 77 | - $i++) |
|
| 78 | - if ($loader !== static::$perfectLoaders[0]) |
|
| 81 | + $i++) { |
|
| 82 | + if ($loader !== static::$perfectLoaders[0]) |
|
| 79 | 83 | spl_autoload_unregister($loader); |
| 84 | + } |
|
| 80 | 85 | |
| 81 | 86 | return static::$instance; |
| 82 | 87 | } |
@@ -105,12 +110,14 @@ discard block |
||
| 105 | 110 | return false; |
| 106 | 111 | } |
| 107 | 112 | |
| 108 | - if (empty(static::$classMap[$key])) |
|
| 109 | - static::$classMap[$key] = $value; |
|
| 113 | + if (empty(static::$classMap[$key])) { |
|
| 114 | + static::$classMap[$key] = $value; |
|
| 115 | + } |
|
| 110 | 116 | |
| 111 | - if (is_string($alias = static::$classMap[$key])) |
|
| 112 | - if (isset(static::$classMap[$alias])) |
|
| 117 | + if (is_string($alias = static::$classMap[$key])) { |
|
| 118 | + if (isset(static::$classMap[$alias])) |
|
| 113 | 119 | return static::$classMap[$alias]; |
| 120 | + } |
|
| 114 | 121 | |
| 115 | 122 | return static::$classMap[$key]; |
| 116 | 123 | } |
@@ -138,8 +145,8 @@ discard block |
||
| 138 | 145 | array($dir, 'vendor', 'composer'), |
| 139 | 146 | array($dir, '..', '..', '..', 'php'), |
| 140 | 147 | array($dir, 'vendor', 'php')) |
| 141 | - as $includePath) |
|
| 142 | - if (false !== $path = stream_resolve_include_path( |
|
| 148 | + as $includePath) { |
|
| 149 | + if (false !== $path = stream_resolve_include_path( |
|
| 143 | 150 | implode($slash, $includePath) |
| 144 | 151 | )) |
| 145 | 152 | if ('composer' == end($includePath) && |
@@ -150,18 +157,22 @@ discard block |
||
| 150 | 157 | static::seen(static::loadFile( |
| 151 | 158 | $classmapPath |
| 152 | 159 | )); |
| 160 | + } |
|
| 153 | 161 | $paths = array_merge( |
| 154 | 162 | $paths, |
| 155 | 163 | array_values(static::loadFile( |
| 156 | 164 | "$path{$slash}autoload_namespaces.php" |
| 157 | 165 | )) |
| 158 | 166 | ); |
| 159 | - } else $paths[] = $path; |
|
| 167 | + } else { |
|
| 168 | + $paths[] = $path; |
|
| 169 | + } |
|
| 160 | 170 | |
| 161 | 171 | $paths = array_filter(array_map( |
| 162 | 172 | function ($path) { |
| 163 | - if (false == $realPath = @realpath($path)) |
|
| 164 | - return null; |
|
| 173 | + if (false == $realPath = @realpath($path)) { |
|
| 174 | + return null; |
|
| 175 | + } |
|
| 165 | 176 | return $realPath . DIRECTORY_SEPARATOR; |
| 166 | 177 | }, |
| 167 | 178 | $paths |
@@ -200,9 +211,11 @@ discard block |
||
| 200 | 211 | private function loadPrefixes($className) |
| 201 | 212 | { |
| 202 | 213 | $currentClass = $className; |
| 203 | - if (false !== $pos = strrpos($className, '\\')) |
|
| 204 | - $className = substr($className, $pos); |
|
| 205 | - else $className = "\\$className"; |
|
| 214 | + if (false !== $pos = strrpos($className, '\\')) { |
|
| 215 | + $className = substr($className, $pos); |
|
| 216 | + } else { |
|
| 217 | + $className = "\\$className"; |
|
| 218 | + } |
|
| 206 | 219 | |
| 207 | 220 | for ( |
| 208 | 221 | $i = 0, |
@@ -231,12 +244,13 @@ discard block |
||
| 231 | 244 | private function loadAliases($className) |
| 232 | 245 | { |
| 233 | 246 | $file = false; |
| 234 | - if (preg_match('/(.+)(\\\\\w+$)/U', $className, $parts)) |
|
| 235 | - for ( |
|
| 247 | + if (preg_match('/(.+)(\\\\\w+$)/U', $className, $parts)) { |
|
| 248 | + for ( |
|
| 236 | 249 | $i = 0, |
| 237 | 250 | $aliases = isset(static::$aliases[$parts[1]]) |
| 238 | 251 | ? static::$aliases[$parts[1]] : array(), |
| 239 | 252 | $count = count($aliases); |
| 253 | + } |
|
| 240 | 254 | $i < $count && false === $file; |
| 241 | 255 | $file = $this->discover( |
| 242 | 256 | "{$aliases[$i++]}$parts[2]", |
@@ -263,13 +277,15 @@ discard block |
||
| 263 | 277 | { |
| 264 | 278 | $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR); |
| 265 | 279 | if (isset($loader)) { |
| 266 | - if (false === array_search($loader, $loaders)) |
|
| 267 | - static::$rogueLoaders[] = $loader; |
|
| 280 | + if (false === array_search($loader, $loaders)) { |
|
| 281 | + static::$rogueLoaders[] = $loader; |
|
| 282 | + } |
|
| 268 | 283 | return $this->loadThisLoader($className, $loader); |
| 269 | 284 | } |
| 270 | - foreach ($loaders as $loader) |
|
| 271 | - if (false !== $file = $this->loadThisLoader($className, $loader)) |
|
| 285 | + foreach ($loaders as $loader) { |
|
| 286 | + if (false !== $file = $this->loadThisLoader($className, $loader)) |
|
| 272 | 287 | return $file; |
| 288 | + } |
|
| 273 | 289 | |
| 274 | 290 | return false; |
| 275 | 291 | } |
@@ -342,13 +358,18 @@ discard block |
||
| 342 | 358 | */ |
| 343 | 359 | private function alias($className, $currentClass) |
| 344 | 360 | { |
| 345 | - if ($className == 'Luracast\Restler\string') return; |
|
| 346 | - if ($className == 'Luracast\Restler\mixed') return; |
|
| 361 | + if ($className == 'Luracast\Restler\string') { |
|
| 362 | + return; |
|
| 363 | + } |
|
| 364 | + if ($className == 'Luracast\Restler\mixed') { |
|
| 365 | + return; |
|
| 366 | + } |
|
| 347 | 367 | if ($className != $currentClass |
| 348 | - && false !== strpos($className, $currentClass)) |
|
| 349 | - if (!class_exists($currentClass, false) |
|
| 368 | + && false !== strpos($className, $currentClass)) { |
|
| 369 | + if (!class_exists($currentClass, false) |
|
| 350 | 370 | && class_alias($className, $currentClass)) |
| 351 | 371 | static::seen($currentClass, $className); |
| 372 | + } |
|
| 352 | 373 | } |
| 353 | 374 | |
| 354 | 375 | /** |
@@ -366,11 +387,12 @@ discard block |
||
| 366 | 387 | |
| 367 | 388 | /** The short version we've done this before and found it in cache */ |
| 368 | 389 | if (false !== $file = static::seen($className)) { |
| 369 | - if (!$this->exists($className)) |
|
| 370 | - if (is_callable($file)) |
|
| 390 | + if (!$this->exists($className)) { |
|
| 391 | + if (is_callable($file)) |
|
| 371 | 392 | $file = $this->loadLastResort($className, $file); |
| 372 | - elseif ($file = stream_resolve_include_path($file)) |
|
| 373 | - $file = static::loadFile($file); |
|
| 393 | + } elseif ($file = stream_resolve_include_path($file)) { |
|
| 394 | + $file = static::loadFile($file); |
|
| 395 | + } |
|
| 374 | 396 | |
| 375 | 397 | $this->alias($className, $currentClass); |
| 376 | 398 | return $file; |
@@ -380,15 +402,17 @@ discard block |
||
| 380 | 402 | |
| 381 | 403 | /** replace \ with / and _ in CLASS NAME with / = PSR-0 in 3 lines */ |
| 382 | 404 | $file = preg_replace("/\\\|_(?=\w+$)/", DIRECTORY_SEPARATOR, $className); |
| 383 | - if (false === $file = stream_resolve_include_path("$file.php")) |
|
| 384 | - return false; |
|
| 405 | + if (false === $file = stream_resolve_include_path("$file.php")) { |
|
| 406 | + return false; |
|
| 407 | + } |
|
| 385 | 408 | |
| 386 | 409 | /** have we loaded this file before could this be an alias */ |
| 387 | 410 | if (in_array($file, get_included_files())) { |
| 388 | - if (false !== $sameFile = array_search($file, static::$classMap)) |
|
| 389 | - if (!$this->exists($className, $file)) |
|
| 411 | + if (false !== $sameFile = array_search($file, static::$classMap)) { |
|
| 412 | + if (!$this->exists($className, $file)) |
|
| 390 | 413 | if (false !== strpos($sameFile, $className)) |
| 391 | 414 | $this->alias($sameFile, $className); |
| 415 | + } |
|
| 392 | 416 | |
| 393 | 417 | return $file; |
| 394 | 418 | } |
@@ -396,17 +420,19 @@ discard block |
||
| 396 | 420 | $state = array_merge(get_declared_classes(), get_declared_interfaces()); |
| 397 | 421 | |
| 398 | 422 | if (false !== $result = static::loadFile($file)) { |
| 399 | - if ($this->exists($className, $file)) |
|
| 400 | - $this->alias($className, $currentClass); |
|
| 401 | - elseif (false != $diff = array_diff( |
|
| 402 | - array_merge(get_declared_classes(), get_declared_interfaces()), $state)) |
|
| 403 | - foreach ($diff as $autoLoaded) |
|
| 423 | + if ($this->exists($className, $file)) { |
|
| 424 | + $this->alias($className, $currentClass); |
|
| 425 | + } elseif (false != $diff = array_diff( |
|
| 426 | + array_merge(get_declared_classes(), get_declared_interfaces()), $state)) { |
|
| 427 | + foreach ($diff as $autoLoaded) |
|
| 404 | 428 | if ($this->exists($autoLoaded, $file)) |
| 405 | 429 | if (false !== strpos($autoLoaded, $className)) |
| 406 | 430 | $this->alias($autoLoaded, $className); |
| 431 | + } |
|
| 407 | 432 | |
| 408 | - if (!$this->exists($currentClass)) |
|
| 409 | - $result = false; |
|
| 433 | + if (!$this->exists($currentClass)) { |
|
| 434 | + $result = false; |
|
| 435 | + } |
|
| 410 | 436 | } |
| 411 | 437 | |
| 412 | 438 | return $result; |
@@ -424,10 +450,12 @@ discard block |
||
| 424 | 450 | private function exists($className, $mapping = null) |
| 425 | 451 | { |
| 426 | 452 | if (class_exists($className, false) |
| 427 | - || interface_exists($className, false)) |
|
| 428 | - if (isset($mapping)) |
|
| 453 | + || interface_exists($className, false)) { |
|
| 454 | + if (isset($mapping)) |
|
| 429 | 455 | return static::seen($className, $mapping); |
| 430 | - else return true; |
|
| 456 | + } else { |
|
| 457 | + return true; |
|
| 458 | + } |
|
| 431 | 459 | return false; |
| 432 | 460 | } |
| 433 | 461 | |
@@ -440,23 +468,28 @@ discard block |
||
| 440 | 468 | */ |
| 441 | 469 | public function __invoke($className) |
| 442 | 470 | { |
| 443 | - if (empty($className)) |
|
| 444 | - return false; |
|
| 471 | + if (empty($className)) { |
|
| 472 | + return false; |
|
| 473 | + } |
|
| 445 | 474 | |
| 446 | - if (false !== $includeReference = $this->discover($className)) |
|
| 447 | - return $includeReference; |
|
| 475 | + if (false !== $includeReference = $this->discover($className)) { |
|
| 476 | + return $includeReference; |
|
| 477 | + } |
|
| 448 | 478 | |
| 449 | 479 | // @CHANGE LDR Reduce cases of conflicts with the messy autoload |
| 450 | 480 | //static::thereCanBeOnlyOne(); |
| 451 | 481 | |
| 452 | - if (false !== $includeReference = $this->loadAliases($className)) |
|
| 453 | - return $includeReference; |
|
| 482 | + if (false !== $includeReference = $this->loadAliases($className)) { |
|
| 483 | + return $includeReference; |
|
| 484 | + } |
|
| 454 | 485 | |
| 455 | - if (false !== $includeReference = $this->loadPrefixes($className)) |
|
| 456 | - return $includeReference; |
|
| 486 | + if (false !== $includeReference = $this->loadPrefixes($className)) { |
|
| 487 | + return $includeReference; |
|
| 488 | + } |
|
| 457 | 489 | |
| 458 | - if (false !== $includeReference = $this->loadLastResort($className)) |
|
| 459 | - return $includeReference; |
|
| 490 | + if (false !== $includeReference = $this->loadLastResort($className)) { |
|
| 491 | + return $includeReference; |
|
| 492 | + } |
|
| 460 | 493 | |
| 461 | 494 | static::seen($className, true); |
| 462 | 495 | return null; |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public $price; |
| 145 | 145 | |
| 146 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
| 146 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
| 147 | 147 | |
| 148 | 148 | /** |
| 149 | 149 | * Selling price with tax |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public $price_ttc; |
| 154 | 154 | |
| 155 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
| 155 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
| 156 | 156 | |
| 157 | 157 | /** |
| 158 | 158 | * Minimum price net |
@@ -405,20 +405,20 @@ discard block |
||
| 405 | 405 | |
| 406 | 406 | //! Metric of products |
| 407 | 407 | public $weight; |
| 408 | - public $weight_units; // scale -3, 0, 3, 6 |
|
| 408 | + public $weight_units; // scale -3, 0, 3, 6 |
|
| 409 | 409 | public $length; |
| 410 | - public $length_units; // scale -3, 0, 3, 6 |
|
| 410 | + public $length_units; // scale -3, 0, 3, 6 |
|
| 411 | 411 | public $width; |
| 412 | - public $width_units; // scale -3, 0, 3, 6 |
|
| 412 | + public $width_units; // scale -3, 0, 3, 6 |
|
| 413 | 413 | public $height; |
| 414 | - public $height_units; // scale -3, 0, 3, 6 |
|
| 414 | + public $height_units; // scale -3, 0, 3, 6 |
|
| 415 | 415 | public $surface; |
| 416 | - public $surface_units; // scale -3, 0, 3, 6 |
|
| 416 | + public $surface_units; // scale -3, 0, 3, 6 |
|
| 417 | 417 | public $volume; |
| 418 | - public $volume_units; // scale -3, 0, 3, 6 |
|
| 418 | + public $volume_units; // scale -3, 0, 3, 6 |
|
| 419 | 419 | |
| 420 | 420 | public $net_measure; |
| 421 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
| 421 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
| 422 | 422 | |
| 423 | 423 | public $accountancy_code_sell; |
| 424 | 424 | public $accountancy_code_sell_intra; |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), |
| 621 | 621 | //'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')), |
| 622 | 622 | //'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')), |
| 623 | - 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
| 623 | + 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
| 624 | 624 | ); |
| 625 | 625 | |
| 626 | 626 | /** |
@@ -924,9 +924,9 @@ discard block |
||
| 924 | 924 | |
| 925 | 925 | // update accountancy for this entity |
| 926 | 926 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 927 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
| 927 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
| 928 | 928 | |
| 929 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
| 929 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
| 930 | 930 | $sql .= " fk_product"; |
| 931 | 931 | $sql .= ", entity"; |
| 932 | 932 | $sql .= ", accountancy_code_buy"; |
@@ -937,13 +937,13 @@ discard block |
||
| 937 | 937 | $sql .= ", accountancy_code_sell_export"; |
| 938 | 938 | $sql .= ") VALUES ("; |
| 939 | 939 | $sql .= $this->id; |
| 940 | - $sql .= ", " . $conf->entity; |
|
| 941 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 942 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
| 943 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
| 944 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 945 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
| 946 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
| 940 | + $sql .= ", ".$conf->entity; |
|
| 941 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 942 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
| 943 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
| 944 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 945 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
| 946 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
| 947 | 947 | $sql .= ")"; |
| 948 | 948 | $result = $this->db->query($sql); |
| 949 | 949 | if (!$result) { |
@@ -1323,12 +1323,12 @@ discard block |
||
| 1323 | 1323 | $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null'); |
| 1324 | 1324 | $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; |
| 1325 | 1325 | if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 1326 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 1327 | - $sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
| 1328 | - $sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
| 1329 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 1330 | - $sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
| 1331 | - $sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
| 1326 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 1327 | + $sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
| 1328 | + $sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
| 1329 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 1330 | + $sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
| 1331 | + $sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
| 1332 | 1332 | } |
| 1333 | 1333 | $sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null"); |
| 1334 | 1334 | $sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null'); |
@@ -1359,9 +1359,9 @@ discard block |
||
| 1359 | 1359 | |
| 1360 | 1360 | // update accountancy for this entity |
| 1361 | 1361 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 1362 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
| 1362 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
| 1363 | 1363 | |
| 1364 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
| 1364 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
| 1365 | 1365 | $sql .= " fk_product"; |
| 1366 | 1366 | $sql .= ", entity"; |
| 1367 | 1367 | $sql .= ", accountancy_code_buy"; |
@@ -1372,13 +1372,13 @@ discard block |
||
| 1372 | 1372 | $sql .= ", accountancy_code_sell_export"; |
| 1373 | 1373 | $sql .= ") VALUES ("; |
| 1374 | 1374 | $sql .= $this->id; |
| 1375 | - $sql .= ", " . $conf->entity; |
|
| 1376 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 1377 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
| 1378 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
| 1379 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 1380 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
| 1381 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
| 1375 | + $sql .= ", ".$conf->entity; |
|
| 1376 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 1377 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
| 1378 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
| 1379 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 1380 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
| 1381 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
| 1382 | 1382 | $sql .= ")"; |
| 1383 | 1383 | $result = $this->db->query($sql); |
| 1384 | 1384 | if (!$result) { |
@@ -1456,7 +1456,7 @@ discard block |
||
| 1456 | 1456 | $error++; |
| 1457 | 1457 | } else { |
| 1458 | 1458 | // to keep old entries with the new dir |
| 1459 | - require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; |
|
| 1459 | + require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
|
| 1460 | 1460 | $ecmfiles = new EcmFiles($this->db); |
| 1461 | 1461 | $ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref)); |
| 1462 | 1462 | } |
@@ -1754,7 +1754,7 @@ discard block |
||
| 1754 | 1754 | } |
| 1755 | 1755 | } elseif (isset($this->multilangs[$key])) { |
| 1756 | 1756 | if (empty($this->multilangs["$key"]["label"])) { |
| 1757 | - $this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
| 1757 | + $this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
| 1758 | 1758 | return -1; |
| 1759 | 1759 | } |
| 1760 | 1760 | |
@@ -1949,7 +1949,7 @@ discard block |
||
| 1949 | 1949 | */ |
| 1950 | 1950 | private function getArrayForPriceCompare($level = 0) |
| 1951 | 1951 | { |
| 1952 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
| 1952 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
| 1953 | 1953 | |
| 1954 | 1954 | foreach ($testExit as $field) { |
| 1955 | 1955 | if (!isset($this->$field)) { |
@@ -2593,12 +2593,12 @@ discard block |
||
| 2593 | 2593 | |
| 2594 | 2594 | //For MultiCompany |
| 2595 | 2595 | //PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
| 2596 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
| 2597 | - $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. |
|
| 2596 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
| 2597 | + $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. |
|
| 2598 | 2598 | $visibleWarehousesEntities = $conf->entity; |
| 2599 | 2599 | if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { |
| 2600 | 2600 | if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) { |
| 2601 | - $checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
| 2601 | + $checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
| 2602 | 2602 | if ($this->db->num_rows($checkPMPPerEntity) > 0) { |
| 2603 | 2603 | $separatedEntityPMP = true; |
| 2604 | 2604 | } |
@@ -2606,7 +2606,7 @@ discard block |
||
| 2606 | 2606 | global $mc; |
| 2607 | 2607 | $separatedStock = true; |
| 2608 | 2608 | if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) { |
| 2609 | - $visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']); |
|
| 2609 | + $visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']); |
|
| 2610 | 2610 | } |
| 2611 | 2611 | } |
| 2612 | 2612 | if ($separatedEntityPMP) { |
@@ -2624,10 +2624,10 @@ discard block |
||
| 2624 | 2624 | } |
| 2625 | 2625 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
| 2626 | 2626 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) { |
| 2627 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
| 2627 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
| 2628 | 2628 | } |
| 2629 | 2629 | if ($separatedStock) { |
| 2630 | - $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)."))"; |
|
| 2630 | + $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)."))"; |
|
| 2631 | 2631 | } |
| 2632 | 2632 | |
| 2633 | 2633 | if ($id) { |
@@ -2787,15 +2787,15 @@ discard block |
||
| 2787 | 2787 | $sql .= " WHERE entity IN (".getEntity('productprice').")"; |
| 2788 | 2788 | $sql .= " AND price_level=".((int) $i); |
| 2789 | 2789 | $sql .= " AND fk_product = ".((int) $this->id); |
| 2790 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
| 2791 | - $sql .= " LIMIT 1"; // Only the first one |
|
| 2790 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
| 2791 | + $sql .= " LIMIT 1"; // Only the first one |
|
| 2792 | 2792 | $resql = $this->db->query($sql); |
| 2793 | 2793 | if ($resql) { |
| 2794 | 2794 | $result = $this->db->fetch_array($resql); |
| 2795 | 2795 | |
| 2796 | 2796 | $this->multiprices[$i] = $result ? $result["price"] : null; |
| 2797 | 2797 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
| 2798 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
| 2798 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
| 2799 | 2799 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
| 2800 | 2800 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
| 2801 | 2801 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -3020,7 +3020,7 @@ discard block |
||
| 3020 | 3020 | $obj = $this->db->fetch_object($result); |
| 3021 | 3021 | $this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0; |
| 3022 | 3022 | $this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0; |
| 3023 | - $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
| 3023 | + $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
| 3024 | 3024 | } else { |
| 3025 | 3025 | $this->error = $this->db->error(); |
| 3026 | 3026 | $error++; |
@@ -4526,7 +4526,7 @@ discard block |
||
| 4526 | 4526 | //Addition of a product with the highest rank +1 |
| 4527 | 4527 | $sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
| 4528 | 4528 | $sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".((int) $incdec).", ".((int) $rank).")"; |
| 4529 | - if (! $this->db->query($sql)) { |
|
| 4529 | + if (!$this->db->query($sql)) { |
|
| 4530 | 4530 | dol_print_error($this->db); |
| 4531 | 4531 | return -1; |
| 4532 | 4532 | } else { |
@@ -4647,7 +4647,7 @@ discard block |
||
| 4647 | 4647 | $sql = "UPDATE ".$this->db->prefix()."product_association"; |
| 4648 | 4648 | $sql .= " SET rang = ".((int) $cpt); |
| 4649 | 4649 | $sql .= " WHERE rowid = ".((int) $objrank->rowid); |
| 4650 | - if (! $this->db->query($sql)) { |
|
| 4650 | + if (!$this->db->query($sql)) { |
|
| 4651 | 4651 | dol_print_error($this->db); |
| 4652 | 4652 | return -1; |
| 4653 | 4653 | } |
@@ -5083,7 +5083,7 @@ discard block |
||
| 5083 | 5083 | if (isset($this->sousprods) && is_array($this->sousprods)) { |
| 5084 | 5084 | foreach ($this->sousprods as $prod_name => $desc_product) { |
| 5085 | 5085 | if (is_array($desc_product)) { |
| 5086 | - $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
| 5086 | + $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
| 5087 | 5087 | } |
| 5088 | 5088 | } |
| 5089 | 5089 | } |
@@ -5240,7 +5240,7 @@ discard block |
||
| 5240 | 5240 | $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens |
| 5241 | 5241 | $sql .= " ORDER BY pa.rang"; |
| 5242 | 5242 | |
| 5243 | - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
| 5243 | + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
| 5244 | 5244 | |
| 5245 | 5245 | if ($level == 1) { |
| 5246 | 5246 | $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 |
@@ -5331,7 +5331,7 @@ discard block |
||
| 5331 | 5331 | if (!empty($this->entity)) { |
| 5332 | 5332 | $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, 1); |
| 5333 | 5333 | if ($this->nbphoto > 0) { |
| 5334 | - $datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>'; |
|
| 5334 | + $datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>'; |
|
| 5335 | 5335 | } |
| 5336 | 5336 | } |
| 5337 | 5337 | |
@@ -5341,7 +5341,7 @@ discard block |
||
| 5341 | 5341 | $datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
| 5342 | 5342 | } |
| 5343 | 5343 | if (isset($this->status) && isset($this->status_buy)) { |
| 5344 | - $datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1); |
|
| 5344 | + $datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1); |
|
| 5345 | 5345 | } |
| 5346 | 5346 | |
| 5347 | 5347 | if (!empty($this->ref)) { |
@@ -5389,7 +5389,7 @@ discard block |
||
| 5389 | 5389 | $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units); |
| 5390 | 5390 | } |
| 5391 | 5391 | if ($labelsurfacevolume) { |
| 5392 | - $datas['surface'] = "<br>" . $labelsurfacevolume; |
|
| 5392 | + $datas['surface'] = "<br>".$labelsurfacevolume; |
|
| 5393 | 5393 | } |
| 5394 | 5394 | } |
| 5395 | 5395 | if ($this->isService() && !empty($this->duration_value)) { |
@@ -5431,9 +5431,9 @@ discard block |
||
| 5431 | 5431 | } |
| 5432 | 5432 | // show categories for this record only in ajax to not overload lists |
| 5433 | 5433 | if (isModEnabled('category') && !$nofetch) { |
| 5434 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5434 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5435 | 5435 | $form = new Form($this->db); |
| 5436 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
| 5436 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
| 5437 | 5437 | } |
| 5438 | 5438 | |
| 5439 | 5439 | return $datas; |
@@ -5954,7 +5954,7 @@ discard block |
||
| 5954 | 5954 | if (isModEnabled("supplier_order")) { |
| 5955 | 5955 | $filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4'); |
| 5956 | 5956 | if (isset($includedraftpoforvirtual)) { |
| 5957 | - $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 |
|
| 5957 | + $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 |
|
| 5958 | 5958 | } |
| 5959 | 5959 | $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock); |
| 5960 | 5960 | if ($result < 0) { |
@@ -6386,7 +6386,7 @@ discard block |
||
| 6386 | 6386 | if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { |
| 6387 | 6387 | $dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); |
| 6388 | 6388 | foreach ($dirsociete as $dirroot) { |
| 6389 | - $res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
| 6389 | + $res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
| 6390 | 6390 | if ($res) { |
| 6391 | 6391 | break; |
| 6392 | 6392 | } |
@@ -6714,7 +6714,7 @@ discard block |
||
| 6714 | 6714 | */ |
| 6715 | 6715 | public function getKanbanView($option = '', $arraydata = null) |
| 6716 | 6716 | { |
| 6717 | - global $langs,$conf; |
|
| 6717 | + global $langs, $conf; |
|
| 6718 | 6718 | |
| 6719 | 6719 | $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); |
| 6720 | 6720 | |