Merge pull request #24909 from mc2contributor/filterChildProjects
Filter child projects out of project list.
This commit is contained in:
commit
da85ee4406
1 changed files with 14 additions and 0 deletions
|
|
@ -124,6 +124,9 @@ if (GETPOSTISSET('formfilteraction')) {
|
|||
$searchCategoryCustomerOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT;
|
||||
}
|
||||
$searchCategoryCustomerList = GETPOST('search_category_customer_list', 'array');
|
||||
if (getDolGlobalInt('PROJECT_ENABLE_SUB_PROJECT')) {
|
||||
$search_omitChildren = GETPOST('search_omitChildren', 'alpha') == 'on' ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
$mine = ((GETPOST('mode') == 'mine') ? 1 : 0);
|
||||
|
|
@ -601,6 +604,12 @@ if ($search_login) {
|
|||
if ($search_import_key) {
|
||||
$sql .= natural_search(array('p.import_key'), $search_import_key);
|
||||
}
|
||||
if (getDolGlobalInt('PROJECT_ENABLE_SUB_PROJECT')) {
|
||||
if ($search_omitChildren == 1) {
|
||||
$sql .= " AND p.fk_project IS NULL";
|
||||
}
|
||||
}
|
||||
|
||||
// Search for tag/category ($searchCategoryProjectList is an array of ID)
|
||||
$searchCategoryProjectList = $search_category_array;
|
||||
$searchCategoryProjectOperator = 0;
|
||||
|
|
@ -1018,6 +1027,11 @@ if (!empty($conf->global->MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST) && isMo
|
|||
$moreforfilter .= '</div>';
|
||||
}
|
||||
|
||||
if (getDolGlobalInt('PROJECT_ENABLE_SUB_PROJECT')) {
|
||||
//Checkbox for omitting child projects filter
|
||||
$moreforfilter .= '<p style="display: inline-block; margin-left: 5px;">'.$langs->trans("Omit sub-projects").' </p><input type="checkbox" style="margin-left: 10px" class="valignmiddle" id="search_omitChildren" name="search_omitChildren"'.($search_omitChildren ? ' checked="checked"' : '').'"> ';
|
||||
}
|
||||
|
||||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
|
|
|
|||
Loading…
Reference in a new issue