Merge pull request #23152 from atm-lena/develop_fixsearchlistaliasname
FIX Search Alias / Company
This commit is contained in:
commit
279e161b95
@ -548,6 +548,9 @@ $companystatic = new Societe($db);
|
|||||||
$projectstatic = new Project($db);
|
$projectstatic = new Project($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$title = $langs->trans('ListOfProposals');
|
$title = $langs->trans('ListOfProposals');
|
||||||
$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
|
$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
|
||||||
llxHeader('', $title, $help_url);
|
llxHeader('', $title, $help_url);
|
||||||
@ -656,12 +659,16 @@ if ($search_project) {
|
|||||||
if ($search_availability) {
|
if ($search_availability) {
|
||||||
$sql .= " AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).')';
|
$sql .= " AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).')';
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_societe) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
|
||||||
|
} else {
|
||||||
if ($search_societe) {
|
if ($search_societe) {
|
||||||
$sql .= natural_search('s.nom', $search_societe);
|
$sql .= natural_search('s.nom', $search_societe);
|
||||||
}
|
}
|
||||||
if ($search_societe_alias) {
|
if ($search_societe_alias) {
|
||||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_login) {
|
if ($search_login) {
|
||||||
$sql .= natural_search(array("u.login", "u.firstname", "u.lastname"), $search_login);
|
$sql .= natural_search(array("u.login", "u.firstname", "u.lastname"), $search_login);
|
||||||
}
|
}
|
||||||
@ -1777,7 +1784,7 @@ if ($resql) {
|
|||||||
// Thirdparty
|
// Thirdparty
|
||||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||||
print '<td class="tdoverflowmax150">';
|
print '<td class="tdoverflowmax150">';
|
||||||
print $companystatic->getNomUrl(1, 'customer');
|
print $companystatic->getNomUrl(1, 'customer', 0, 0, 1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
|
|||||||
@ -789,6 +789,9 @@ $company_url_list = array();
|
|||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
$projectstatic = new Project($db);
|
$projectstatic = new Project($db);
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$title = $langs->trans("Orders");
|
$title = $langs->trans("Orders");
|
||||||
$help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
|
$help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
|
||||||
|
|
||||||
@ -935,12 +938,16 @@ if ($search_country) {
|
|||||||
if ($search_type_thirdparty && $search_type_thirdparty != '-1') {
|
if ($search_type_thirdparty && $search_type_thirdparty != '-1') {
|
||||||
$sql .= " AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).')';
|
$sql .= " AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).')';
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_company) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||||
|
} else {
|
||||||
if ($search_company) {
|
if ($search_company) {
|
||||||
$sql .= natural_search('s.nom', $search_company);
|
$sql .= natural_search('s.nom', $search_company);
|
||||||
}
|
}
|
||||||
if ($search_company_alias) {
|
if ($search_company_alias) {
|
||||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_parent_name) {
|
if ($search_parent_name) {
|
||||||
$sql .= natural_search('s2.nom', $search_parent_name);
|
$sql .= natural_search('s2.nom', $search_parent_name);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -558,6 +558,9 @@ $companystatic = new Societe($db);
|
|||||||
$companyparent = new Societe($db);
|
$companyparent = new Societe($db);
|
||||||
$company_url_list = array();
|
$company_url_list = array();
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
if ($sall || $search_user > 0) {
|
if ($sall || $search_user > 0) {
|
||||||
$sql = 'SELECT DISTINCT';
|
$sql = 'SELECT DISTINCT';
|
||||||
@ -670,12 +673,16 @@ if ($search_project_ref) {
|
|||||||
if ($search_project) {
|
if ($search_project) {
|
||||||
$sql .= natural_search('p.title', $search_project);
|
$sql .= natural_search('p.title', $search_project);
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_company) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||||
|
} else {
|
||||||
if ($search_company) {
|
if ($search_company) {
|
||||||
$sql .= natural_search('s.nom', $search_company);
|
$sql .= natural_search('s.nom', $search_company);
|
||||||
}
|
}
|
||||||
if ($search_company_alias) {
|
if ($search_company_alias) {
|
||||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_parent_name) {
|
if ($search_parent_name) {
|
||||||
$sql .= natural_search('s2.nom', $search_parent_name);
|
$sql .= natural_search('s2.nom', $search_parent_name);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ $search_date_order_endyear = GETPOST('search_date_order_endyear', 'int');
|
|||||||
$search_date_order_start = dol_mktime(0, 0, 0, $search_date_order_startmonth, $search_date_order_startday, $search_date_order_startyear); // Use tzserver
|
$search_date_order_start = dol_mktime(0, 0, 0, $search_date_order_startmonth, $search_date_order_startday, $search_date_order_startyear); // Use tzserver
|
||||||
$search_date_order_end = dol_mktime(23, 59, 59, $search_date_order_endmonth, $search_date_order_endday, $search_date_order_endyear);
|
$search_date_order_end = dol_mktime(23, 59, 59, $search_date_order_endmonth, $search_date_order_endday, $search_date_order_endyear);
|
||||||
|
|
||||||
$search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int');
|
$search_date_delivery_starvtday = GETPOST('search_date_delivery_startday', 'int');
|
||||||
$search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int');
|
$search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int');
|
||||||
$search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int');
|
$search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int');
|
||||||
$search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int');
|
$search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int');
|
||||||
@ -751,6 +751,9 @@ if ($search_billed > 0) {
|
|||||||
//$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
|
//$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
|
||||||
$help_url = '';
|
$help_url = '';
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$sql = 'SELECT';
|
$sql = 'SELECT';
|
||||||
if ($sall) {
|
if ($sall) {
|
||||||
$sql = 'SELECT DISTINCT';
|
$sql = 'SELECT DISTINCT';
|
||||||
@ -814,12 +817,16 @@ if ($search_refsupp) {
|
|||||||
if ($sall) {
|
if ($sall) {
|
||||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_company) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||||
|
} else {
|
||||||
if ($search_company) {
|
if ($search_company) {
|
||||||
$sql .= natural_search('s.nom', $search_company);
|
$sql .= natural_search('s.nom', $search_company);
|
||||||
}
|
}
|
||||||
if ($search_company_alias) {
|
if ($search_company_alias) {
|
||||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_request_author) {
|
if ($search_request_author) {
|
||||||
$sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_request_author);
|
$sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_request_author);
|
||||||
}
|
}
|
||||||
@ -872,12 +879,6 @@ if ($search_country) {
|
|||||||
if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
|
if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
|
||||||
$sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
|
$sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
|
||||||
}
|
}
|
||||||
if ($search_company) {
|
|
||||||
$sql .= natural_search('s.nom', $search_company);
|
|
||||||
}
|
|
||||||
if ($search_company_alias) {
|
|
||||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
|
||||||
}
|
|
||||||
if ($search_sale > 0) {
|
if ($search_sale > 0) {
|
||||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
|
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -404,6 +404,9 @@ $facturestatic = new FactureFournisseur($db);
|
|||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
$thirdparty = new Societe($db);
|
$thirdparty = new Societe($db);
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$sql = "SELECT";
|
$sql = "SELECT";
|
||||||
if ($search_all) {
|
if ($search_all) {
|
||||||
$sql = 'SELECT DISTINCT';
|
$sql = 'SELECT DISTINCT';
|
||||||
@ -506,12 +509,16 @@ if ($search_type != '' && $search_type >= 0) {
|
|||||||
if ($search_project) {
|
if ($search_project) {
|
||||||
$sql .= natural_search('p.ref', $search_project);
|
$sql .= natural_search('p.ref', $search_project);
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_company) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||||
|
} else {
|
||||||
if ($search_company) {
|
if ($search_company) {
|
||||||
$sql .= natural_search('s.nom', $search_company);
|
$sql .= natural_search('s.nom', $search_company);
|
||||||
}
|
}
|
||||||
if ($search_company_alias) {
|
if ($search_company_alias) {
|
||||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_town) {
|
if ($search_town) {
|
||||||
$sql .= natural_search('s.town', $search_town);
|
$sql .= natural_search('s.town', $search_town);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -410,6 +410,9 @@ if (count($listofprojectcontacttypeexternal) == 0) {
|
|||||||
$listofprojectcontacttypeexternal[0] = '0'; // To avoid sql syntax error if not found
|
$listofprojectcontacttypeexternal[0] = '0'; // To avoid sql syntax error if not found
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once.
|
$distinct = 'DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once.
|
||||||
$sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,";
|
$sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut as status, p.fk_opp_status, p.public, p.fk_user_creat,";
|
||||||
$sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount,";
|
$sql .= " p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, (p.opp_amount*p.opp_percent/100) as opp_weighted_amount, p.tms as date_update, p.budget_amount,";
|
||||||
@ -469,12 +472,16 @@ if ($search_ref) {
|
|||||||
if ($search_label) {
|
if ($search_label) {
|
||||||
$sql .= natural_search('p.title', $search_label);
|
$sql .= natural_search('p.title', $search_label);
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_societe) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
|
||||||
|
} else {
|
||||||
if ($search_societe) {
|
if ($search_societe) {
|
||||||
$sql .= natural_search('s.nom', $search_societe);
|
$sql .= natural_search('s.nom', $search_societe);
|
||||||
}
|
}
|
||||||
if ($search_societe_alias) {
|
if ($search_societe_alias) {
|
||||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_opp_amount) {
|
if ($search_opp_amount) {
|
||||||
$sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
|
$sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -408,12 +408,16 @@ if ($search_task_progress) {
|
|||||||
if ($search_task_budget_amount) {
|
if ($search_task_budget_amount) {
|
||||||
$sql .= natural_search('t.budget_amount', $search_task_budget_amount, 1);
|
$sql .= natural_search('t.budget_amount', $search_task_budget_amount, 1);
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_societe) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
|
||||||
|
} else {
|
||||||
if ($search_societe) {
|
if ($search_societe) {
|
||||||
$sql .= natural_search('s.nom', $search_societe);
|
$sql .= natural_search('s.nom', $search_societe);
|
||||||
}
|
}
|
||||||
if ($search_societe_alias) {
|
if ($search_societe_alias) {
|
||||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_date_start) {
|
if ($search_date_start) {
|
||||||
$sql .= " AND t.dateo >= '".$db->idate($search_date_start)."'";
|
$sql .= " AND t.dateo >= '".$db->idate($search_date_start)."'";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1510,6 +1510,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||||||
*/
|
*/
|
||||||
$tasks = array();
|
$tasks = array();
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
|
||||||
|
|
||||||
$sql = "SELECT t.rowid, t.fk_task, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm,";
|
$sql = "SELECT t.rowid, t.fk_task, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm,";
|
||||||
$sql .= " t.fk_product,";
|
$sql .= " t.fk_product,";
|
||||||
$sql .= " pt.ref, pt.label, pt.fk_projet,";
|
$sql .= " pt.ref, pt.label, pt.fk_projet,";
|
||||||
@ -1555,12 +1558,16 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||||||
if ($search_task_ref) {
|
if ($search_task_ref) {
|
||||||
$sql .= natural_search('pt.ref', $search_task_ref);
|
$sql .= natural_search('pt.ref', $search_task_ref);
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_company) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||||
|
} else {
|
||||||
if ($search_company) {
|
if ($search_company) {
|
||||||
$sql .= natural_search('s.nom', $search_company);
|
$sql .= natural_search('s.nom', $search_company);
|
||||||
}
|
}
|
||||||
if ($search_company_alias) {
|
if ($search_company_alias) {
|
||||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_project_ref) {
|
if ($search_project_ref) {
|
||||||
$sql .= natural_search('p.ref', $search_project_ref);
|
$sql .= natural_search('p.ref', $search_project_ref);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -442,6 +442,9 @@ if ($type == 'f' && (empty($search_type) || ($search_type == '4'))) {
|
|||||||
$title = $langs->trans("Suppliers");
|
$title = $langs->trans("Suppliers");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
// Select every potentiels, and note each potentiels which fit in search parameters
|
// Select every potentiels, and note each potentiels which fit in search parameters
|
||||||
$tab_level = array();
|
$tab_level = array();
|
||||||
$sql = "SELECT code, label, sortorder";
|
$sql = "SELECT code, label, sortorder";
|
||||||
@ -598,12 +601,17 @@ if (strlen($search_cti)) {
|
|||||||
if ($search_id > 0) {
|
if ($search_id > 0) {
|
||||||
$sql .= natural_search("s.rowid", $search_id, 1);
|
$sql .= natural_search("s.rowid", $search_id, 1);
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_nom) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_nom);
|
||||||
|
} else {
|
||||||
if ($search_nom) {
|
if ($search_nom) {
|
||||||
$sql .= natural_search("s.nom", $search_nom);
|
$sql .= natural_search("s.nom", $search_nom);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($search_alias) {
|
if ($search_alias) {
|
||||||
$sql .= natural_search("s.name_alias", $search_alias);
|
$sql .= natural_search("s.name_alias", $search_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_nom_only) {
|
if ($search_nom_only) {
|
||||||
$sql .= natural_search("s.nom", $search_nom_only);
|
$sql .= natural_search("s.nom", $search_nom_only);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -288,6 +288,9 @@ $formpropal = new FormPropal($db);
|
|||||||
$companystatic = new Societe($db);
|
$companystatic = new Societe($db);
|
||||||
$formcompany = new FormCompany($db);
|
$formcompany = new FormCompany($db);
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$title = $langs->trans('ListOfSupplierProposals');
|
$title = $langs->trans('ListOfSupplierProposals');
|
||||||
$help_url = 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur';
|
$help_url = 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur';
|
||||||
|
|
||||||
@ -362,12 +365,16 @@ if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
|
|||||||
if ($search_ref) {
|
if ($search_ref) {
|
||||||
$sql .= natural_search('sp.ref', $search_ref);
|
$sql .= natural_search('sp.ref', $search_ref);
|
||||||
}
|
}
|
||||||
|
if (empty($arrayfields['s.name_alias']['checked']) && $search_societe) {
|
||||||
|
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
|
||||||
|
} else {
|
||||||
if ($search_societe) {
|
if ($search_societe) {
|
||||||
$sql .= natural_search('s.nom', $search_societe);
|
$sql .= natural_search('s.nom', $search_societe);
|
||||||
}
|
}
|
||||||
if ($search_societe_alias) {
|
if ($search_societe_alias) {
|
||||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($search_login) {
|
if ($search_login) {
|
||||||
$sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login);
|
$sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user