@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | |
| 566 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 566 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 567 | 567 | /** |
| 568 | 568 | * Return list of all warehouses |
| 569 | 569 | * |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | */ |
| 573 | 573 | public function list_array($status = 1) |
| 574 | 574 | { |
| 575 | - // phpcs:enable |
|
| 575 | + // phpcs:enable |
|
| 576 | 576 | $liste = array(); |
| 577 | 577 | |
| 578 | 578 | $sql = "SELECT rowid, ref as label"; |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | return $liste; |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 597 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 598 | 598 | /** |
| 599 | 599 | * Return number of unique different product into a warehouse |
| 600 | 600 | * |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | */ |
| 603 | 603 | public function nb_different_products() |
| 604 | 604 | { |
| 605 | - // phpcs:enable |
|
| 605 | + // phpcs:enable |
|
| 606 | 606 | $ret = array(); |
| 607 | 607 | |
| 608 | 608 | $sql = "SELECT count(distinct p.rowid) as nb"; |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | return $ret; |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 628 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 629 | 629 | /** |
| 630 | 630 | * Return stock and value of warehosue |
| 631 | 631 | * |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | public function nb_products() |
| 635 | 635 | { |
| 636 | 636 | global $conf; |
| 637 | - // phpcs:enable |
|
| 637 | + // phpcs:enable |
|
| 638 | 638 | $ret = array(); |
| 639 | 639 | |
| 640 | 640 | //For MultiCompany PMP per entity |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | return $this->LibStatut($this->statut, $mode); |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 687 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 688 | 688 | /** |
| 689 | 689 | * Return label of a given status |
| 690 | 690 | * |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | */ |
| 695 | 695 | public function LibStatut($status, $mode = 0) |
| 696 | 696 | { |
| 697 | - // phpcs:enable |
|
| 697 | + // phpcs:enable |
|
| 698 | 698 | global $langs; |
| 699 | 699 | |
| 700 | 700 | $statusType = 'status5'; |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | return 1; |
| 869 | 869 | } |
| 870 | 870 | |
| 871 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 871 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 872 | 872 | /** |
| 873 | 873 | * Return full path to current warehouse |
| 874 | 874 | * |
@@ -876,7 +876,7 @@ discard block |
||
| 876 | 876 | */ |
| 877 | 877 | public function get_full_arbo() |
| 878 | 878 | { |
| 879 | - // phpcs:enable |
|
| 879 | + // phpcs:enable |
|
| 880 | 880 | global $user, $langs, $conf; |
| 881 | 881 | |
| 882 | 882 | $TArbo = array($this->label); |
@@ -909,7 +909,7 @@ discard block |
||
| 909 | 909 | return implode(' >> ', array_reverse($TArbo)); |
| 910 | 910 | } |
| 911 | 911 | |
| 912 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 912 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 913 | 913 | /** |
| 914 | 914 | * Return array of children warehouses ids from $id warehouse (recursive function) |
| 915 | 915 | * |
@@ -919,7 +919,7 @@ discard block |
||
| 919 | 919 | */ |
| 920 | 920 | public function get_children_warehouses($id, &$TChildWarehouses) |
| 921 | 921 | { |
| 922 | - // phpcs:enable |
|
| 922 | + // phpcs:enable |
|
| 923 | 923 | |
| 924 | 924 | $sql = "SELECT rowid |
| 925 | 925 | FROM " . $this->db->prefix() . "entrepot |
@@ -166,7 +166,7 @@ |
||
| 166 | 166 | /** |
| 167 | 167 | * Warehouse open and any operations are allowed, but warehouse is not included into calculation of stock. |
| 168 | 168 | */ |
| 169 | - const STATUS_OPENEXT_ALL = 3; // TODO Implement this |
|
| 169 | + const STATUS_OPENEXT_ALL = 3; // TODO Implement this |
|
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | return $this->LibStatut($this->status, $mode); |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 579 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 580 | 580 | /** |
| 581 | 581 | * Return the status |
| 582 | 582 | * |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | */ |
| 588 | 588 | public function LibStatut($status, $mode = 0) |
| 589 | 589 | { |
| 590 | - // phpcs:enable |
|
| 590 | + // phpcs:enable |
|
| 591 | 591 | global $langs; |
| 592 | 592 | |
| 593 | 593 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | ); |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 298 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 299 | 299 | /** |
| 300 | 300 | * Clean sensible object datas |
| 301 | 301 | * |
@@ -304,30 +304,30 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | public function _cleanObjectDatas($object) |
| 306 | 306 | { |
| 307 | - // phpcs:disable |
|
| 308 | - $object = parent::_cleanObjectDatas($object); |
|
| 309 | - |
|
| 310 | - return $object; |
|
| 311 | - } |
|
| 312 | - |
|
| 313 | - /** |
|
| 314 | - * Validate fields before create or update object |
|
| 315 | - * |
|
| 316 | - * @param array $data Array of data to validate |
|
| 317 | - * @param array $fields Array of fields needed |
|
| 318 | - * @return array |
|
| 319 | - * |
|
| 320 | - * @throws RestException |
|
| 321 | - */ |
|
| 322 | - private function validate($data, $fields) |
|
| 323 | - { |
|
| 324 | - $hook = array(); |
|
| 325 | - foreach ($fields as $field) { |
|
| 326 | - if (!isset($data[$field])) { |
|
| 327 | - throw new RestException(400, $field." field missing"); |
|
| 328 | - } |
|
| 329 | - $hook[$field] = $data[$field]; |
|
| 330 | - } |
|
| 331 | - return $hook; |
|
| 332 | - } |
|
| 307 | + // phpcs:disable |
|
| 308 | + $object = parent::_cleanObjectDatas($object); |
|
| 309 | + |
|
| 310 | + return $object; |
|
| 311 | + } |
|
| 312 | + |
|
| 313 | + /** |
|
| 314 | + * Validate fields before create or update object |
|
| 315 | + * |
|
| 316 | + * @param array $data Array of data to validate |
|
| 317 | + * @param array $fields Array of fields needed |
|
| 318 | + * @return array |
|
| 319 | + * |
|
| 320 | + * @throws RestException |
|
| 321 | + */ |
|
| 322 | + private function validate($data, $fields) |
|
| 323 | + { |
|
| 324 | + $hook = array(); |
|
| 325 | + foreach ($fields as $field) { |
|
| 326 | + if (!isset($data[$field])) { |
|
| 327 | + throw new RestException(400, $field." field missing"); |
|
| 328 | + } |
|
| 329 | + $hook[$field] = $data[$field]; |
|
| 330 | + } |
|
| 331 | + return $hook; |
|
| 332 | + } |
|
| 333 | 333 | } |
@@ -324,7 +324,7 @@ |
||
| 324 | 324 | $hook = array(); |
| 325 | 325 | foreach ($fields as $field) { |
| 326 | 326 | if (!isset($data[$field])) { |
| 327 | - throw new RestException(400, $field." field missing"); |
|
| 327 | + throw new RestException(400, $field . " field missing"); |
|
| 328 | 328 | } |
| 329 | 329 | $hook[$field] = $data[$field]; |
| 330 | 330 | } |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | return $this->LibStatut($this->status, $mode); |
| 838 | 838 | } |
| 839 | 839 | |
| 840 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 840 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 841 | 841 | /** |
| 842 | 842 | * Return the label of a given status |
| 843 | 843 | * |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | */ |
| 848 | 848 | public function LibStatut($status, $mode = 0) |
| 849 | 849 | { |
| 850 | - // phpcs:enable |
|
| 850 | + // phpcs:enable |
|
| 851 | 851 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
| 852 | 852 | global $langs; |
| 853 | 853 | |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | return $this->LibStatut($this->status, $mode); |
| 848 | 848 | } |
| 849 | 849 | |
| 850 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 850 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 851 | 851 | /** |
| 852 | 852 | * Return the status |
| 853 | 853 | * |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | */ |
| 858 | 858 | public function LibStatut($status, $mode = 0) |
| 859 | 859 | { |
| 860 | - // phpcs:enable |
|
| 860 | + // phpcs:enable |
|
| 861 | 861 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
| 862 | 862 | global $langs; |
| 863 | 863 | //$langs->load("agenda"); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | return $object; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 84 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 85 | 85 | /** |
| 86 | 86 | * Set content of ->tpl array, to use into template |
| 87 | 87 | * |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function assign_values(&$action, $id) |
| 93 | 93 | { |
| 94 | - // phpcs:enable |
|
| 94 | + // phpcs:enable |
|
| 95 | 95 | global $conf, $langs, $user, $canvas; |
| 96 | 96 | global $form, $formcompany, $objsoc; |
| 97 | 97 | |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 278 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 279 | 279 | /** |
| 280 | 280 | * Assign POST values into object |
| 281 | 281 | * |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | */ |
| 284 | 284 | private function assign_post() |
| 285 | 285 | { |
| 286 | - // phpcs:enable |
|
| 286 | + // phpcs:enable |
|
| 287 | 287 | global $langs, $mysoc; |
| 288 | 288 | |
| 289 | 289 | $this->object->socid = GETPOSTINT("socid"); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | return $out; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 77 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 78 | 78 | /** |
| 79 | 79 | * Assign custom values for canvas |
| 80 | 80 | * |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function assign_values(&$action, $id) |
| 86 | 86 | { |
| 87 | - // phpcs:enable |
|
| 87 | + // phpcs:enable |
|
| 88 | 88 | global $conf, $db, $langs, $user; |
| 89 | 89 | global $form; |
| 90 | 90 | |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | return $this->LibStatut($this->status, $mode); |
| 827 | 827 | } |
| 828 | 828 | |
| 829 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 829 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
| 830 | 830 | /** |
| 831 | 831 | * Return the label of a given status |
| 832 | 832 | * |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | */ |
| 837 | 837 | public function LibStatut($status, $mode = 0) |
| 838 | 838 | { |
| 839 | - // phpcs:enable |
|
| 839 | + // phpcs:enable |
|
| 840 | 840 | global $langs; |
| 841 | 841 | |
| 842 | 842 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public $fk_website; |
| 71 | 71 | |
| 72 | - public $fk_page; // If translation of another page |
|
| 72 | + public $fk_page; // If translation of another page |
|
| 73 | 73 | |
| 74 | 74 | public $pageurl; |
| 75 | 75 | public $aliasalt; |
@@ -134,8 +134,8 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public $fk_object; |
| 136 | 136 | |
| 137 | - const STATUS_DRAFT = 0; // offline |
|
| 138 | - const STATUS_VALIDATED = 1; // online |
|
| 137 | + const STATUS_DRAFT = 0; // offline |
|
| 138 | + const STATUS_VALIDATED = 1; // online |
|
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | /** |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | return $this->_cleanObjectDatas($multicurrency); |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 342 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 343 | 343 | /** |
| 344 | 344 | * Clean sensible object datas |
| 345 | 345 | * |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | */ |
| 349 | 349 | protected function _cleanObjectDatas($object) |
| 350 | 350 | { |
| 351 | - // phpcs:enable |
|
| 351 | + // phpcs:enable |
|
| 352 | 352 | $object = parent::_cleanObjectDatas($object); |
| 353 | 353 | |
| 354 | 354 | // Clear all fields out of interest |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | return $object; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 368 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
| 369 | 369 | /** |
| 370 | 370 | * Clean sensible MultiCurrencyRate object datas |
| 371 | 371 | * |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | protected function _cleanObjectDatasRate($object) |
| 376 | 376 | { |
| 377 | - // phpcs:enable |
|
| 377 | + // phpcs:enable |
|
| 378 | 378 | $object = parent::_cleanObjectDatas($object); |
| 379 | 379 | |
| 380 | 380 | // Clear all fields out of interest |