/** * Get the last treePos of the table faculty * * @return biggest treePos * @since 1.5 * */ function search_max_tree_pos() { $extremeTreePos = get_extremesTreePos(); return $extremeTreePos['maximum']; }
} } else { if (empty($_REQUEST['nameCat'])) { $dialogBox->error(get_lang('Category name is required')); } if (empty($_REQUEST['codeCat'])) { $dialogBox->error(get_lang('Category code is required')); } } } /** * If you move the category in the same father of the bom */ if ($cmd == 'exUp' || $cmd == 'exDown') { $noQUERY_STRING = true; $extremesTreePos = get_extremesTreePos(); $treePosMin = $extremesTreePos['minimum']; $treePosMax = $extremesTreePos['maximum']; // Search the category who move in the bom $i = 0; while ($i < count($categories) && $categories[$i]['id'] != $_REQUEST['id']) { $i++; } /** * If Up the category and the treePos of this category isn't the first category */ if ($cmd == 'exUp' && $i >= $treePosMin) { // Search the previous brother of this category $j = $i - 1; while ($j > 0 && $categories[$j]['code_P'] != $categories[$i]['code_P']) { $j--;