-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEW add company type on filter #30267
Open
defrance
wants to merge
3
commits into
Dolibarr:develop
Choose a base branch
from
defrance:patch-340
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
* Copyright (C) 2015 Raphaël Doursenaud <[email protected]> | ||
* Copyright (C) 2018 Frédéric France <[email protected]> | ||
* Copyright (C) 2022 Alexandre Spangaro <[email protected]> | ||
* Copyright (C) 2024 Charlene Benke <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
|
@@ -35,6 +36,7 @@ | |
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; | ||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; | ||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; | ||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; | ||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; | ||
|
||
// Load translation files required by the page | ||
|
@@ -94,6 +96,7 @@ | |
$date_endyear = GETPOSTINT("date_endyear"); | ||
$date_endmonth = GETPOSTINT("date_endmonth"); | ||
$date_endday = GETPOSTINT("date_endday"); | ||
$typent_id = GETPOST('typent_id', 'int'); | ||
if (empty($year)) { | ||
$year_current = dol_print_date(dol_now(), '%Y'); | ||
$month_current = dol_print_date(dol_now(), '%m'); | ||
|
@@ -191,6 +194,9 @@ | |
$tableparams['search_town'] = $search_town; | ||
$tableparams['search_country'] = $search_country; | ||
$tableparams['subcat'] = ($subcat === true) ? 'yes' : ''; | ||
if (!empty($typent_id)) { | ||
$tableparams['typent_id'] = $typent_id; | ||
} | ||
|
||
// Adding common parameters | ||
$allparams = array_merge($commonparams, $headerparams, $tableparams); | ||
|
@@ -345,6 +351,9 @@ | |
if ($search_country > 0) { | ||
$sql .= ' AND s.fk_pays = '.((int) $search_country); | ||
} | ||
if ($typent_id >0) { | ||
$sql .= " AND s.fk_typent = ".((int) $typent_id); | ||
} | ||
$sql .= " AND f.entity IN (".getEntity('invoice').")"; | ||
if ($socid) { | ||
$sql .= " AND f.fk_soc = ".((int) $socid); | ||
|
@@ -449,7 +458,7 @@ | |
|
||
// Category filter | ||
print '<tr class="liste_titre">'; | ||
print '<td class="nowraponall">'; | ||
print '<td class="nowraponall" colspan=4>'; | ||
print img_picto('', 'category', 'class="paddingrightonly"'); | ||
print $formother->select_categories(Categorie::TYPE_CUSTOMER, $selected_cat, 'search_categ', 0, $langs->trans("Category")); | ||
print ' '; | ||
|
@@ -458,8 +467,18 @@ | |
if ($subcat) { | ||
print ' checked'; | ||
} | ||
print'></td>'; | ||
print '<td colspan="7" class="right">'; | ||
|
||
print'>'; | ||
// type filter (produit/service) | ||
print ' '; | ||
print ' '; | ||
print $langs->trans("Type").': '; | ||
$formcompany = new FormCompany($db); | ||
$sortparam = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use of $conf->global-> is forbidden. Use getDolGlobal... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, i have made this ugrade for a customer on 14.0.5 ... |
||
print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam, '', 1); | ||
|
||
print '</td>'; | ||
print '<td colspan="3" class="right">'; | ||
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"), 'search.png', '', '', 1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; | ||
print '</td>'; | ||
print '</tr>'; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In look and feel of recent version, labels of filters must be included as the placeholder of the combobox (to move into the param$shwo_empty of selectarray