Skip to content
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

Update list.php #30254

Merged
merged 7 commits into from
Jul 16, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions htdocs/comm/propal/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,16 +635,29 @@
if ($search_availability) {
$sql .= " AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).')';
}
$societe_add_ref_in_list = (!empty(getDolGlobalString('SOCIETE_ADD_REF_IN_LIST')) ? getDolGlobalString('SOCIETE_ADD_REF_IN_LIST') : 0); // Récupérer la valeur de SOCIETE_ADD_REF_IN_LIST
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$societe_add_ref_in_list = getDolGlobalInt('SOCIETE_ADD_REF_IN_LIST'); is more simple and pass the tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok now

if (empty($arrayfields['s.name_alias']['checked']) && $search_societe) {
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
if ($societe_add_ref_in_list == 1) {
$sql .= natural_search(array("s.nom", "s.name_alias", "s.code_client"), $search_societe);
} else {
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
}
} else {
if ($search_societe) {
$sql .= natural_search('s.nom', $search_societe);
if ($societe_add_ref_in_list == 1) {
$sql .= natural_search(array('s.nom', 's.code_client'), $search_societe);
} else {
$sql .= natural_search('s.nom', $search_societe);
}
}
if ($search_societe_alias) {
$sql .= natural_search('s.name_alias', $search_societe_alias);
}
}
// Rechercher dans code_client si SOCIETE_ADD_REF_IN_LIST est égal à 1
if ($societe_add_ref_in_list == 1 && $search_code_client && !$search_societe) {
$sql .= natural_search('s.code_client', $search_code_client);
}
if ($search_login) {
$sql .= natural_search(array("u.login", "u.firstname", "u.lastname"), $search_login);
}
Expand Down
Loading