@@ -952,7 +952,7 @@ discard block |
||
952 | 952 | return $this->LibStatut($this->status, $mode); |
953 | 953 | } |
954 | 954 | |
955 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
955 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
956 | 956 | /** |
957 | 957 | * Return the status |
958 | 958 | * |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | */ |
963 | 963 | public static function LibStatut($status, $mode = 0) |
964 | 964 | { |
965 | - // phpcs:enable |
|
965 | + // phpcs:enable |
|
966 | 966 | global $langs; |
967 | 967 | return ''; |
968 | 968 | } |
@@ -235,10 +235,10 @@ |
||
235 | 235 | $id = $ecmdirtmp->create($user); |
236 | 236 | if ($id > 0) { |
237 | 237 | $newdirsql = array('id' => $id, |
238 | - 'id_mere' => $ecmdirtmp->fk_parent, |
|
239 | - 'label' => $ecmdirtmp->label, |
|
240 | - 'description' => $ecmdirtmp->description, |
|
241 | - 'fullrelativename' => $relativepathmissing); |
|
238 | + 'id_mere' => $ecmdirtmp->fk_parent, |
|
239 | + 'label' => $ecmdirtmp->label, |
|
240 | + 'description' => $ecmdirtmp->description, |
|
241 | + 'fullrelativename' => $relativepathmissing); |
|
242 | 242 | $sqltree[] = $newdirsql; // We complete fulltree for following loops |
243 | 243 | //var_dump($sqltree); |
244 | 244 | $adirwascreated = 1; |
@@ -235,10 +235,10 @@ |
||
235 | 235 | $id = $ecmdirtmp->create($user); |
236 | 236 | if ($id > 0) { |
237 | 237 | $newdirsql = array('id' => $id, |
238 | - 'id_mere' => $ecmdirtmp->fk_parent, |
|
239 | - 'label' => $ecmdirtmp->label, |
|
240 | - 'description' => $ecmdirtmp->description, |
|
241 | - 'fullrelativename' => $relativepathmissing); |
|
238 | + 'id_mere' => $ecmdirtmp->fk_parent, |
|
239 | + 'label' => $ecmdirtmp->label, |
|
240 | + 'description' => $ecmdirtmp->description, |
|
241 | + 'fullrelativename' => $relativepathmissing); |
|
242 | 242 | $sqltree[] = $newdirsql; // We complete fulltree for following loops |
243 | 243 | //var_dump($sqltree); |
244 | 244 | $adirwascreated = 1; |
@@ -713,7 +713,7 @@ discard block |
||
713 | 713 | } |
714 | 714 | } |
715 | 715 | |
716 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
716 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
717 | 717 | /** |
718 | 718 | * Link an object to the category |
719 | 719 | * |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | */ |
725 | 725 | public function add_type($obj, $type = '') |
726 | 726 | { |
727 | - // phpcs:enable |
|
727 | + // phpcs:enable |
|
728 | 728 | global $user; |
729 | 729 | |
730 | 730 | $error = 0; |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | } |
807 | 807 | } |
808 | 808 | |
809 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
809 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
810 | 810 | /** |
811 | 811 | * Delete object from category |
812 | 812 | * |
@@ -817,7 +817,7 @@ discard block |
||
817 | 817 | */ |
818 | 818 | public function del_type($obj, $type) |
819 | 819 | { |
820 | - // phpcs:enable |
|
820 | + // phpcs:enable |
|
821 | 821 | global $user; |
822 | 822 | |
823 | 823 | $error = 0; |
@@ -1064,7 +1064,7 @@ discard block |
||
1064 | 1064 | return $categories; |
1065 | 1065 | } |
1066 | 1066 | |
1067 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1067 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1068 | 1068 | /** |
1069 | 1069 | * Return direct children ids of a category into an array |
1070 | 1070 | * |
@@ -1072,7 +1072,7 @@ discard block |
||
1072 | 1072 | */ |
1073 | 1073 | public function get_filles() |
1074 | 1074 | { |
1075 | - // phpcs:enable |
|
1075 | + // phpcs:enable |
|
1076 | 1076 | $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . "categorie"; |
1077 | 1077 | $sql .= " WHERE fk_parent = " . ((int) $this->id); |
1078 | 1078 | $sql .= " AND entity IN (" . getEntity('category') . ")"; |
@@ -1092,7 +1092,7 @@ discard block |
||
1092 | 1092 | } |
1093 | 1093 | } |
1094 | 1094 | |
1095 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1095 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1096 | 1096 | /** |
1097 | 1097 | * Load the array this->motherof that is array(id_son=>id_parent, ...) |
1098 | 1098 | * |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | */ |
1101 | 1101 | protected function load_motherof() |
1102 | 1102 | { |
1103 | - // phpcs:enable |
|
1103 | + // phpcs:enable |
|
1104 | 1104 | $this->motherof = array(); |
1105 | 1105 | |
1106 | 1106 | // Load array[child]=parent |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | } |
1123 | 1123 | } |
1124 | 1124 | |
1125 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1125 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1126 | 1126 | /** |
1127 | 1127 | * Rebuilding the category tree as an array |
1128 | 1128 | * Return an array of table('id','id_mere',...) sorted to have a human readable tree, with |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | */ |
1145 | 1145 | public function get_full_arbo($type, $fromid = 0, $include = 0) |
1146 | 1146 | { |
1147 | - // phpcs:enable |
|
1147 | + // phpcs:enable |
|
1148 | 1148 | global $langs; |
1149 | 1149 | |
1150 | 1150 | if (!is_numeric($type)) { |
@@ -1295,7 +1295,7 @@ discard block |
||
1295 | 1295 | } |
1296 | 1296 | |
1297 | 1297 | |
1298 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1298 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1299 | 1299 | /** |
1300 | 1300 | * Returns all categories |
1301 | 1301 | * |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | */ |
1306 | 1306 | public function get_all_categories($type = null, $parent = false) |
1307 | 1307 | { |
1308 | - // phpcs:enable |
|
1308 | + // phpcs:enable |
|
1309 | 1309 | if (!is_numeric($type)) { |
1310 | 1310 | $type = $this->MAP_ID[$type]; |
1311 | 1311 | } |
@@ -1334,7 +1334,7 @@ discard block |
||
1334 | 1334 | } |
1335 | 1335 | } |
1336 | 1336 | |
1337 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1337 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1338 | 1338 | /** |
1339 | 1339 | * Returns the top level categories (which are not child) |
1340 | 1340 | * |
@@ -1343,11 +1343,11 @@ discard block |
||
1343 | 1343 | */ |
1344 | 1344 | public function get_main_categories($type = null) |
1345 | 1345 | { |
1346 | - // phpcs:enable |
|
1346 | + // phpcs:enable |
|
1347 | 1347 | return $this->get_all_categories($type, true); |
1348 | 1348 | } |
1349 | 1349 | |
1350 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1350 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1351 | 1351 | /** |
1352 | 1352 | * Check if a category with same label already exists for this cat's parent or root and for this cat's type |
1353 | 1353 | * |
@@ -1355,7 +1355,7 @@ discard block |
||
1355 | 1355 | */ |
1356 | 1356 | public function already_exists() |
1357 | 1357 | { |
1358 | - // phpcs:enable |
|
1358 | + // phpcs:enable |
|
1359 | 1359 | $type = $this->type; |
1360 | 1360 | |
1361 | 1361 | if (!is_numeric($type)) { |
@@ -1396,7 +1396,7 @@ discard block |
||
1396 | 1396 | } |
1397 | 1397 | |
1398 | 1398 | |
1399 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1399 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1400 | 1400 | /** |
1401 | 1401 | * Returns the path of the category, with the names of the categories |
1402 | 1402 | * separated by $sep (" >> " by default) |
@@ -1409,7 +1409,7 @@ discard block |
||
1409 | 1409 | */ |
1410 | 1410 | public function print_all_ways($sep = '>>', $url = '', $nocolor = 0, $addpicto = 0) |
1411 | 1411 | { |
1412 | - // phpcs:enable |
|
1412 | + // phpcs:enable |
|
1413 | 1413 | $ways = array(); |
1414 | 1414 | |
1415 | 1415 | $all_ways = $this->get_all_ways(); // Load array of categories |
@@ -1454,7 +1454,7 @@ discard block |
||
1454 | 1454 | } |
1455 | 1455 | |
1456 | 1456 | |
1457 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1457 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1458 | 1458 | /** |
1459 | 1459 | * Returns an array containing the list of parent categories |
1460 | 1460 | * |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | */ |
1463 | 1463 | public function get_meres() |
1464 | 1464 | { |
1465 | - // phpcs:enable |
|
1465 | + // phpcs:enable |
|
1466 | 1466 | $parents = array(); |
1467 | 1467 | |
1468 | 1468 | $sql = "SELECT fk_parent FROM " . MAIN_DB_PREFIX . "categorie"; |
@@ -1485,7 +1485,7 @@ discard block |
||
1485 | 1485 | } |
1486 | 1486 | } |
1487 | 1487 | |
1488 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1488 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1489 | 1489 | /** |
1490 | 1490 | * Returns in a table all possible paths to get to the category |
1491 | 1491 | * starting with the major categories represented by Tables of categories |
@@ -1494,7 +1494,7 @@ discard block |
||
1494 | 1494 | */ |
1495 | 1495 | public function get_all_ways() |
1496 | 1496 | { |
1497 | - // phpcs:enable |
|
1497 | + // phpcs:enable |
|
1498 | 1498 | $ways = array(); |
1499 | 1499 | |
1500 | 1500 | $parents = $this->get_meres(); |
@@ -1808,7 +1808,7 @@ discard block |
||
1808 | 1808 | } |
1809 | 1809 | |
1810 | 1810 | |
1811 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1811 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1812 | 1812 | /** |
1813 | 1813 | * Add the image uploaded as $file to the directory $sdir/<category>-<id>/photos/ |
1814 | 1814 | * |
@@ -1818,7 +1818,7 @@ discard block |
||
1818 | 1818 | */ |
1819 | 1819 | public function add_photo($sdir, $file) |
1820 | 1820 | { |
1821 | - // phpcs:enable |
|
1821 | + // phpcs:enable |
|
1822 | 1822 | require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/files.lib.php'; |
1823 | 1823 | |
1824 | 1824 | $dir = $sdir . '/' . get_exdir($this->id, 2, 0, 0, $this, 'category') . $this->id . "/"; |
@@ -1856,7 +1856,7 @@ discard block |
||
1856 | 1856 | } |
1857 | 1857 | } |
1858 | 1858 | |
1859 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1859 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1860 | 1860 | /** |
1861 | 1861 | * Return an array with all photos inside the directory |
1862 | 1862 | * |
@@ -1866,7 +1866,7 @@ discard block |
||
1866 | 1866 | */ |
1867 | 1867 | public function liste_photos($dir, $nbmax = 0) |
1868 | 1868 | { |
1869 | - // phpcs:enable |
|
1869 | + // phpcs:enable |
|
1870 | 1870 | include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
1871 | 1871 | |
1872 | 1872 | $nbphoto = 0; |
@@ -1914,7 +1914,7 @@ discard block |
||
1914 | 1914 | return $tabobj; |
1915 | 1915 | } |
1916 | 1916 | |
1917 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1917 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1918 | 1918 | /** |
1919 | 1919 | * Efface la photo de la categorie et sa vignette |
1920 | 1920 | * |
@@ -1923,7 +1923,7 @@ discard block |
||
1923 | 1923 | */ |
1924 | 1924 | public function delete_photo($file) |
1925 | 1925 | { |
1926 | - // phpcs:enable |
|
1926 | + // phpcs:enable |
|
1927 | 1927 | require_once constant('DOL_DOCUMENT_ROOT') . '/core/lib/files.lib.php'; |
1928 | 1928 | |
1929 | 1929 | $dir = dirname($file) . '/'; // Chemin du dossier contenant l'image d'origine |
@@ -1943,7 +1943,7 @@ discard block |
||
1943 | 1943 | } |
1944 | 1944 | } |
1945 | 1945 | |
1946 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1946 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
1947 | 1947 | /** |
1948 | 1948 | * Load size of image file |
1949 | 1949 | * |
@@ -1952,7 +1952,7 @@ discard block |
||
1952 | 1952 | */ |
1953 | 1953 | public function get_image_size($file) |
1954 | 1954 | { |
1955 | - // phpcs:enable |
|
1955 | + // phpcs:enable |
|
1956 | 1956 | $infoImg = getimagesize($file); // Recuperation des infos de l'image |
1957 | 1957 | $this->imgWidth = $infoImg[0]; // Largeur de l'image |
1958 | 1958 | $this->imgHeight = $infoImg[1]; // Hauteur de l'image |
@@ -664,7 +664,7 @@ discard block |
||
664 | 664 | } |
665 | 665 | |
666 | 666 | |
667 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
667 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
668 | 668 | /** |
669 | 669 | * Clean sensible object datas |
670 | 670 | * |
@@ -673,7 +673,7 @@ discard block |
||
673 | 673 | */ |
674 | 674 | protected function _cleanObjectDatas($object) |
675 | 675 | { |
676 | - // phpcs:enable |
|
676 | + // phpcs:enable |
|
677 | 677 | $object = parent::_cleanObjectDatas($object); |
678 | 678 | |
679 | 679 | // Remove fields not relevant to categories |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | return $this->LibStatut($this->status, $mode); |
639 | 639 | } |
640 | 640 | |
641 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
641 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
642 | 642 | /** |
643 | 643 | * Return the status |
644 | 644 | * |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | */ |
649 | 649 | public function LibStatut($status, $mode = 0) |
650 | 650 | { |
651 | - // phpcs:enable |
|
651 | + // phpcs:enable |
|
652 | 652 | if (empty($this->labelStatus) || empty($this->labelStatusShort)) { |
653 | 653 | global $langs; |
654 | 654 | //$langs->load("mymodule"); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | return $this->LibStatut($this->status, $mode); |
362 | 362 | } |
363 | 363 | |
364 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
364 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
365 | 365 | /** |
366 | 366 | * Return the status |
367 | 367 | * |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | */ |
372 | 372 | public function LibStatut($status, $mode = 0) |
373 | 373 | { |
374 | - // phpcs:enable |
|
374 | + // phpcs:enable |
|
375 | 375 | if (empty($this->labelStatus)) { |
376 | 376 | global $langs; |
377 | 377 | //$langs->load("emailcollector"); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | return $this->LibStatut($this->status, $mode); |
362 | 362 | } |
363 | 363 | |
364 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
364 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
|
365 | 365 | /** |
366 | 366 | * Return the status |
367 | 367 | * |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | */ |
372 | 372 | public function LibStatut($status, $mode = 0) |
373 | 373 | { |
374 | - // phpcs:enable |
|
374 | + // phpcs:enable |
|
375 | 375 | if (empty($this->labelStatus)) { |
376 | 376 | global $langs; |
377 | 377 | //$langs->load("emailcollector"); |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
19 | 19 | */ |
20 | 20 | |
21 | - use Luracast\Restler\RestException; |
|
21 | + use Luracast\Restler\RestException; |
|
22 | 22 | |
23 | - require_once constant('DOL_DOCUMENT_ROOT') . '/expedition/class/expedition.class.php'; |
|
23 | + require_once constant('DOL_DOCUMENT_ROOT') . '/expedition/class/expedition.class.php'; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * API class for shipments |
@@ -640,15 +640,15 @@ discard block |
||
640 | 640 | */ |
641 | 641 | |
642 | 642 | /** |
643 | - * Close a shipment (Classify it as "Delivered") |
|
644 | - * |
|
645 | - * @param int $id Expedition ID |
|
646 | - * @param int $notrigger Disabled triggers |
|
647 | - * |
|
648 | - * @url POST {id}/close |
|
649 | - * |
|
650 | - * @return object |
|
651 | - */ |
|
643 | + * Close a shipment (Classify it as "Delivered") |
|
644 | + * |
|
645 | + * @param int $id Expedition ID |
|
646 | + * @param int $notrigger Disabled triggers |
|
647 | + * |
|
648 | + * @url POST {id}/close |
|
649 | + * |
|
650 | + * @return object |
|
651 | + */ |
|
652 | 652 | public function close($id, $notrigger = 0) |
653 | 653 | { |
654 | 654 | if (!DolibarrApiAccess::$user->hasRight('expedition', 'creer')) { |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | return $this->_cleanObjectDatas($this->shipment); |
681 | 681 | } |
682 | 682 | |
683 | - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
683 | + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore |
|
684 | 684 | /** |
685 | 685 | * Clean sensible object datas |
686 | 686 | * |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | */ |
690 | 690 | protected function _cleanObjectDatas($object) |
691 | 691 | { |
692 | - // phpcs:enable |
|
692 | + // phpcs:enable |
|
693 | 693 | $object = parent::_cleanObjectDatas($object); |
694 | 694 | |
695 | 695 | unset($object->canvas); |