mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
FIX Search List Alias Name
This commit is contained in:
parent
291cb1908d
commit
9fef8b7dc2
|
|
@ -548,6 +548,9 @@ $companystatic = new Societe($db);
|
|||
$projectstatic = new Project($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');
|
||||
$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
|
@ -656,11 +659,15 @@ if ($search_project) {
|
|||
if ($search_availability) {
|
||||
$sql .= " AND p.fk_availability IN (".$db->sanitize($db->escape($search_availability)).')';
|
||||
}
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
if(empty($arrayfields['s.name_alias']['checked']) && $search_societe){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
|
||||
} else {
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
}
|
||||
}
|
||||
if ($search_login) {
|
||||
$sql .= natural_search(array("u.login", "u.firstname", "u.lastname"), $search_login);
|
||||
|
|
|
|||
|
|
@ -789,6 +789,9 @@ $company_url_list = array();
|
|||
$formcompany = new FormCompany($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");
|
||||
$help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
|
||||
|
||||
|
|
@ -935,11 +938,15 @@ if ($search_country) {
|
|||
if ($search_type_thirdparty && $search_type_thirdparty != '-1') {
|
||||
$sql .= " AND s.fk_typent IN (".$db->sanitize($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(empty($arrayfields['s.name_alias']['checked']) && $search_company){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||
} else {
|
||||
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_parent_name) {
|
||||
$sql .= natural_search('s2.nom', $search_parent_name);
|
||||
|
|
|
|||
|
|
@ -558,6 +558,9 @@ $companystatic = new Societe($db);
|
|||
$companyparent = new Societe($db);
|
||||
$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';
|
||||
if ($sall || $search_user > 0) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
|
|
@ -670,11 +673,15 @@ if ($search_project_ref) {
|
|||
if ($search_project) {
|
||||
$sql .= natural_search('p.title', $search_project);
|
||||
}
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||
if(empty($arrayfields['s.name_alias']['checked']) && $search_company){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||
} else {
|
||||
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_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_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_startyear = GETPOST('search_date_delivery_startyear', '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 = '';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
|
|
@ -814,11 +817,15 @@ if ($search_refsupp) {
|
|||
if ($sall) {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||
}
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||
if(empty($arrayfields['s.name_alias']['checked']) && $search_company){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||
} else {
|
||||
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_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) {
|
||||
$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) {
|
||||
$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);
|
||||
$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";
|
||||
if ($search_all) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
|
|
@ -506,11 +509,15 @@ if ($search_type != '' && $search_type >= 0) {
|
|||
if ($search_project) {
|
||||
$sql .= natural_search('p.ref', $search_project);
|
||||
}
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||
if(empty($arrayfields['s.name_alias']['checked']) && $search_company){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||
} else {
|
||||
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_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
|
||||
}
|
||||
|
||||
$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.
|
||||
$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,";
|
||||
|
|
@ -465,11 +468,15 @@ if ($search_ref) {
|
|||
if ($search_label) {
|
||||
$sql .= natural_search('p.title', $search_label);
|
||||
}
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
if(empty($arrayfields['s.name_alias']['checked']) && $search_societe){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
|
||||
} else {
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
}
|
||||
}
|
||||
if ($search_opp_amount) {
|
||||
$sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
|
||||
|
|
|
|||
|
|
@ -408,11 +408,15 @@ if ($search_task_progress) {
|
|||
if ($search_task_budget_amount) {
|
||||
$sql .= natural_search('t.budget_amount', $search_task_budget_amount, 1);
|
||||
}
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
if(empty($arrayfields['s.name_alias']['checked']) && $search_societe){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
|
||||
} else {
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
}
|
||||
}
|
||||
if ($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();
|
||||
|
||||
$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 .= " t.fk_product,";
|
||||
$sql .= " pt.ref, pt.label, pt.fk_projet,";
|
||||
|
|
@ -1555,11 +1558,15 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
if ($search_task_ref) {
|
||||
$sql .= natural_search('pt.ref', $search_task_ref);
|
||||
}
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_company_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_company_alias);
|
||||
if(empty($arrayfields['s.name_alias']['checked']) && $search_company){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_company);
|
||||
} else {
|
||||
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_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");
|
||||
}
|
||||
|
||||
$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
|
||||
$tab_level = array();
|
||||
$sql = "SELECT code, label, sortorder";
|
||||
|
|
@ -598,11 +601,16 @@ if (strlen($search_cti)) {
|
|||
if ($search_id > 0) {
|
||||
$sql .= natural_search("s.rowid", $search_id, 1);
|
||||
}
|
||||
if ($search_nom) {
|
||||
$sql .= natural_search("s.nom", $search_nom);
|
||||
}
|
||||
if ($search_alias) {
|
||||
$sql .= natural_search("s.name_alias", $search_alias);
|
||||
if(empty($arrayfields['s.name_alias']['checked']) && $search_nom){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_nom);
|
||||
} else {
|
||||
if ($search_nom) {
|
||||
$sql .= natural_search("s.nom", $search_nom);
|
||||
}
|
||||
|
||||
if ($search_alias) {
|
||||
$sql .= natural_search("s.name_alias", $search_alias);
|
||||
}
|
||||
}
|
||||
if ($search_nom_only) {
|
||||
$sql .= natural_search("s.nom", $search_nom_only);
|
||||
|
|
|
|||
|
|
@ -288,6 +288,9 @@ $formpropal = new FormPropal($db);
|
|||
$companystatic = new Societe($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');
|
||||
$help_url = 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur';
|
||||
|
||||
|
|
@ -362,11 +365,15 @@ if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
|
|||
if ($search_ref) {
|
||||
$sql .= natural_search('sp.ref', $search_ref);
|
||||
}
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
if(empty($arrayfields['s.name_alias']['checked']) && $search_societe){
|
||||
$sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
|
||||
} else {
|
||||
if ($search_societe) {
|
||||
$sql .= natural_search('s.nom', $search_societe);
|
||||
}
|
||||
if ($search_societe_alias) {
|
||||
$sql .= natural_search('s.name_alias', $search_societe_alias);
|
||||
}
|
||||
}
|
||||
if ($search_login) {
|
||||
$sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user