diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 39e4ae13f608f8fbd474cf03a9b512f9519cb914..6a24717aea3d062d57ad37052fa29b25d1a36f82 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -63,7 +63,6 @@ $result = restrictedArea($user,'societe',$id,'&societe'); $action = GETPOST('action'); $mode = GETPOST("mode"); -$modesearch = GETPOST("mode_search"); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -202,33 +201,6 @@ $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$title,$help_url); -/* -if ($mode == 'search') -{ - if ($modesearch == 'soc') - { - // TODO move to DAO class - $sql = "SELECT s.rowid"; - if (!$user->rights->societe->client->voir && !$id) $sql .= ", sc.fk_soc, sc.fk_user "; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; - if (!$user->rights->societe->client->voir && !$id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'"; - if (!$user->rights->societe->client->voir && !$id) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - } - - $resql=$db->query($sql); - if ($resql) - { - if ( $db->num_rows($resql) == 1) - { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - } - $db->free($resql); - } -} -*/ - if ($id > 0) { $head = societe_prepare_head($object); diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 6c2d902390219b16f58ab4e71168b7adc0636652..db9d4e623ca9b25862476a916d7e22ba75b32dce 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -43,7 +43,6 @@ accessforbidden(); $langs->load("companies"); $mode=GETPOST("mode"); -$modesearch=GETPOST("mode_search"); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -70,20 +69,15 @@ if ($action == 'note') $result = $db->query($sql); } -if ($mode == 'search') { - if ($modesearch == 'soc') { - $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s "; - $sql.= " WHERE s.nom LIKE '%".$db->escape(strtolower($socname))."%'"; - $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; - } - +if ($mode == 'search') +{ $resql=$db->query($sql); if ($resql) { if ( $db->num_rows($resql) == 1) { $obj = $db->fetch_object($resql); $socid = $obj->rowid; } - $db->free(); + $db->free($resql); } } diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index f9200810bdde163974bc9a5c5f79e0e0de828eed..2e837fcbaae9a4b2c92e42a93b79f3e828cbbddd 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -22,16 +22,19 @@ */ -// This script is called with a POST method. -// Directory to scan (full path) is inside POST['dir']. +// This script is called with a POST method or as an include. -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! isset($usedbyinclude) || empty($usedbyinclude)) +{ + if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1); // Disables token renewal + //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); + if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); + if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); + if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); + + $res=@include '../../main.inc.php'; +} -$res=@include '../../main.inc.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php'; //global $hookmanager; @@ -44,85 +47,85 @@ $arrayresult=array(); // Define $searchform if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) { - $arrayresult['searchintothirdparty']=array('text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintothirdparty']=array('img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire) { - $arrayresult['searchintocontact']=array('text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintocontact']=array('img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue)); } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) { - $arrayresult['searchintoproduct']=array('text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoproduct']=array('img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue),'text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { - $arrayresult['searchintoprojects']=array('text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); + $arrayresult['searchintoprojects']=array('img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue)); } if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { - $arrayresult['searchintotasks']=array('text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php?search_all='.urlencode($search_boxvalue)); + $arrayresult['searchintotasks']=array('img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php?search_all='.urlencode($search_boxvalue)); } if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) { - $arrayresult['searchintomember']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintomember']=array('img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire) { - $arrayresult['searchintouser']=array('text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintouser']=array('img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire) { - $arrayresult['searchintopropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintopropal']=array('img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->rights->commande->lire) { - $arrayresult['searchintoorder']=array('text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoorder']=array('img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) { - $arrayresult['searchintoinvoice']=array('text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoinvoice']=array('img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) { - $arrayresult['searchintoshipment']=array('text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoshipment']=array('img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire) { - $arrayresult['searchintosupplierpropal']=array('text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintosupplierpropal']=array('img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) && $user->rights->fournisseur->commande->lire) { - $arrayresult['searchintosupplierorder']=array('text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue)); + $arrayresult['searchintosupplierorder']=array('img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue)); } if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) && $user->rights->fournisseur->facture->lire) { - $arrayresult['searchintosupplierinvoice']=array('text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintosupplierinvoice']=array('img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire) { - $arrayresult['searchintocontract']=array('text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintocontract']=array('img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue)); } if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->rights->ficheinter->lire) { - $arrayresult['searchintointervention']=array('text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue)); + $arrayresult['searchintointervention']=array('img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue)); } // HR if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire) { - $arrayresult['searchintoexpensereport']=array('text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoexpensereport']=array('img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); } if (! empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read) { - $arrayresult['searchintoleaves']=array('text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); + $arrayresult['searchintoleaves']=array('img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue)); } @@ -144,6 +147,10 @@ if (empty($reshook)) else $arrayresult=$hookmanager->resArray; -print json_encode($arrayresult); +// Print output if called by ajax or do nothing (var $arrayresult will be used) if called by an include +if (! isset($usedbyinclude) || empty($usedbyinclude)) +{ + print json_encode($arrayresult); + if (is_object($db)) $db->close(); +} -if (is_object($db)) $db->close(); diff --git a/htdocs/core/class/google.class.php b/htdocs/core/class/google.class.php index b0649f575fc5fb699cec22a21195751fe5e25cfd..e923ec122520a0514d9598fd97130c4c2773f9b6 100644 --- a/htdocs/core/class/google.class.php +++ b/htdocs/core/class/google.class.php @@ -59,7 +59,7 @@ class GoogleAPI $i=0; // Desired address - $urladdress = "http://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".$this->key; + $urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".$this->key; // Retrieve the URL contents $page = file_get_contents($urladdress); diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index b6122d8fe4b6ad752b3e88dfe3fbd8ba0ca19122..1c29cae5d4b1415bc1560b96cc56c99bf5bc243a 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -174,7 +174,7 @@ function print_text_menu_entry_auguria($text, $showmode, $url, $id, $idsel, $cla if ($showmode == 1) { - print '<a class="tmenuimage" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; + print '<a class="tmenuimage" tabindex="-1" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>'; print '</a>'; print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index f186a45b6dd553643a2039d0ee6c7b0c8c724342..1e7918bb48524361e89722da58112187339f5a36 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -383,7 +383,7 @@ function print_text_menu_entry($text, $showmode, $url, $id, $idsel, $classname, if ($showmode == 1) { - print '<a class="tmenuimage" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; + print '<a class="tmenuimage" tabindex="-1" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; print '<div class="'.$id.' '.$idsel.' topmenuimage"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>'; print '</a>'; print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 69dd5769356088a610d0a245e0b51b3584fe9605..6bc3df987ccd4fadda2aec502ce275df989f6ecb 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -348,7 +348,7 @@ function print_text_menu_entry_empty($text, $showmode, $url, $id, $idsel, $class if ($showmode == 1) { - print '<a class="tmenuimage" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; + print '<a class="tmenuimage" tabindex="-1" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; print '<div class="'.$id.' '.$idsel.'"><span class="'.$id.' tmenuimage" id="mainmenuspan_'.$idsel.'"></span></div>'; print '</a>'; print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($atarget?' target="'.$atarget.'"':'').'>'; diff --git a/htdocs/core/search_page.php b/htdocs/core/search_page.php index e3cca7a73c71673f24fad9187bfe10697a9cc86f..09b37f4bb8a454bc009109ab7db55ec4b0924d7c 100644 --- a/htdocs/core/search_page.php +++ b/htdocs/core/search_page.php @@ -77,48 +77,25 @@ else { $conf->global->MAIN_HTML5_PLACEHOLDER = 1; - // Define $searchform - if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && $user->rights->societe->lire) - { - $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_picto('','object_company','', 0, 1)); - //$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', 'notitle'); - } - - if (! empty($conf->societe->enabled) && $user->rights->societe->lire) - { - $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_picto('','object_contact','', 0, 1)); - //$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', 'notitle'); - } - - if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) - ) - { - $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_picto('','object_product','', 0, 1)); - //$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', 'notitle'); - } - - if (! empty($conf->projet->enabled) && $user->rights->projet->lire) - { - $langs->load("projects"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_picto('','object_projectpub','', 0, 1)); - //$searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', 'notitle'); - } - - if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire) - { - $langs->load("members"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_picto('','object_user','', 0, 1)); - //$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', 'notitle'); - } - - if (! empty($conf->user->enabled) && $user->rights->user->user->lire) + + $usedbyinclude = 1; // Used into next include + include DOL_DOCUMENT_ROOT.'/core/ajax/selectsearchbox.php'; + + $accesskeyalreadyassigned=array(); + foreach($arrayresult as $key => $val) { - $langs->load("users"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/user/index.php', DOL_URL_ROOT.'/user/index.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_picto('','object_user','', 0, 1)); - //$searchform.=printSearchForm(DOL_URL_ROOT.'/user/index.php', DOL_URL_ROOT.'/user/index.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', 'notitle'); + $tmp=explode('?', $val['url']); + $urlaction=$tmp[0]; + $keysearch=$tmp[1]; + $keysearch=preg_replace('/mainmenu=(.*)&/','',$keysearch); + $keysearch=preg_replace('/=/','',$keysearch); + $accesskey=''; + if (! $accesskeyalreadyassigned[$val['label'][0]]) + { + $accesskey=$val['label'][0]; + $accesskeyalreadyassigned[$accesskey]=$accesskey; + } + $searchform.=printSearchForm($urlaction, $urlaction, $val['label'], 'minwidth200', $keysearch, $accesskey, $key, img_picto('',$val['img'],'', 0, 1)); } } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 40e9c516ea8e8c56635bcc5c35ff6424ab6ceb86..50ac51e973b711d0dae6acf7980c3fc2c867bae7 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -82,7 +82,7 @@ $fieldstosearchall = array( 's.nom'=>"ThirdParty", 'e.note_public'=>'NotePublic', ); -if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate"; +if (empty($user->socid)) $fieldstosearchall["e.note_private"]="NotePrivate"; $checkedtypetiers=0; $arrayfields=array( diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c1d3cef9fd9107951d2df7bb40bf5d855acbc60d..5ff5535ac10788c02a43e8ae662f543166ba19ff 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -92,7 +92,7 @@ if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not do $path=$_SERVER["CONTEXT_PREFIX"]; // example '/dolibarr/' when using an apache alias. if (! preg_match('/\/$/', $path)) $path.='/'; } - else if (preg_match('/index\.php', $_SERVER['PHP_SELF'])) + else if (preg_match('/index\.php/', $_SERVER['PHP_SELF'])) { // When we ask index.php, we MUST BE SURE that $path is '' at the end. This is required to make install process // when using apache alias like '/dolibarr/' that point to htdocs. @@ -113,11 +113,11 @@ if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not do if (empty($TDir[$i]) || $TDir[$i] == 'htdocs') break; if ($TDir[$i] == 'dolibarr') break; if (substr($TDir[$i], -4, 4) == '.php') continue; - + $path .= '../'; } } - + header("Location: ".$path."install/index.php"); exit; } diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index d234ea01bcb18241e116528d627cf98cc4120f7e..374abf6a659de35d287f5f06724958d09e09288a 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -58,7 +58,6 @@ if ($user->societe_id > 0) } $mode=GETPOST("mode"); -$modesearch=GETPOST("mode_search"); $search_product_category=GETPOST('search_product_category','int'); $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha'); @@ -215,27 +214,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOS $option=''; } -if ($mode == 'search') -{ - if ($modesearch == 'soc') - { - $sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s "; - $sql.= " WHERE s.nom LIKE '%".$db->escape($socname)."%'"; - $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; - } - - $resql=$db->query($sql); - if ($resql) - { - if ( $db->num_rows($resql) == 1) - { - $obj = $db->fetch_object($resql); - $socid = $obj->rowid; - } - $db->free($resql); - } -} - if (empty($reshook)) { // Mass actions. Controls on number of lines checked diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index 6e554c6545eebaf11110d900f53ad7a392ab6adb..c5846801e52d163a2e043e5ba714ac32c5dcfbe6 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -7,8 +7,8 @@ History=History ListOfSuppliers=List of suppliers ShowSupplier=Show supplier OrderDate=Order date -BuyingPriceMin=Minimum purchase price -BuyingPriceMinShort=Min purchase price +BuyingPriceMin=Best purchase price +BuyingPriceMinShort=Best purchase price TotalBuyingPriceMinShort=Total of subproducts purchase prices TotalSellingPriceMinShort=Total of subproducts sell prices SomeSubProductHaveNoPrices=Some sub-products have no price defined diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index eac673e5143e548536bb464e3f8d57ba059a2106..c04f33fcd9026450d57319103e683af042f92655 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1572,38 +1572,38 @@ function left_menu($menu_array_before, $helppagename='', $notused='', $menu_arra if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && $user->rights->societe->lire) { $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'soc', 'sall', 'T', 'searchleftt', img_object('','company')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/societe/list.php', DOL_URL_ROOT.'/societe/list.php', $langs->trans("ThirdParties"), 'maxwidth100', 'sall', 'T', 'searchleftt', img_object('','company')); } if (! empty($conf->societe->enabled) && $user->rights->societe->lire) { $langs->load("companies"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'sall', 'A', 'searchleftc', img_object('','contact')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'maxwidth100', 'sall', 'A', 'searchleftc', img_object('','contact')); } if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) ) { $langs->load("products"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'maxwidth100', 'sall', 'P', 'searchleftp', img_object('','product')); } if (! empty($conf->projet->enabled) && $user->rights->projet->lire) { $langs->load("projects"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'project', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/projet/list.php', DOL_URL_ROOT.'/projet/list.php', $langs->trans("Projects"), 'maxwidth100', 'search_all', 'Q', 'searchleftproj', img_object('','projectpub')); } if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire) { $langs->load("members"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'maxwidth100', 'sall', 'M', 'searchleftm', img_object('','user')); } if (! empty($conf->user->enabled) && $user->rights->user->user->lire) { $langs->load("users"); - $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'user', 'sall', 'M', 'searchleftuser', img_object('','user')); + $searchform.=printSearchForm(DOL_URL_ROOT.'/user/list.php', DOL_URL_ROOT.'/user/list.php', $langs->trans("Users"), 'maxwidth100', 'sall', 'M', 'searchleftuser', img_object('','user')); } } @@ -1798,14 +1798,14 @@ function getHelpParamFor($helppagename,$langs) * @param string $urlaction Url post * @param string $urlobject Url of the link under the search box * @param string $title Title search area - * @param string $htmlmodesearch Value to set into parameter "mode_search" ('soc','contact','products','member',...) + * @param string $htmlmorecss Add more css * @param string $htmlinputname Field Name input form * @param string $accesskey Accesskey * @param string $prefhtmlinputname Complement for id to avoid multiple same id in the page * @param string $img Image to use * @return string */ -function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinputname,$accesskey='', $prefhtmlinputname='',$img='') +function printSearchForm($urlaction, $urlobject, $title, $htmlmorecss, $htmlinputname, $accesskey='', $prefhtmlinputname='',$img='') { global $conf,$langs; @@ -1830,13 +1830,12 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinput } $ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $ret.='<input type="hidden" name="mode" value="search">'; - $ret.='<input type="hidden" name="mode_search" value="'.$htmlmodesearch.'">'; - $ret.='<input type="text" class="flat"'; + $ret.='<input type="text" class="flat '.$htmlmorecss.'"'; if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $ret.=' style="text-indent: 22px; background-image: url(\''.$img.'\'); background-repeat: no-repeat; background-position: 3px;"'; $ret.=($accesskey?' accesskey="'.$accesskey.'"':''); if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $ret.=' placeholder="'.strip_tags($title).'"'; // Will work only if MAIN_HTML5_PLACEHOLDER is set to 1 else $ret.=' title="'.$langs->trans("SearchOf").''.strip_tags($title).'"'; - $ret.=' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" size="10" />'; + $ret.=' name="'.$htmlinputname.'" id="'.$prefhtmlinputname.$htmlinputname.'" />'; $ret.='<input type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px" value="'.$langs->trans("Go").'">'; $ret.="</form>\n"; return $ret; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 475257e6d1c9654a479703bb135f22ac2a1c6069..1045f1f1119787030a694cc155f19b92585ad457 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2280,6 +2280,12 @@ table.noborder tr, div.noborder form { border-top-color: rgb(<?php echo $colortopbordertitle1 ?>); border-top-style: solid; } +.liste_titre_add td, .liste_titre_add .tagtd +{ + border-top-width: 1px; + border-top-color: rgb(<?php echo $colortopbordertitle1 ?>); + border-top-style: solid; +} table.liste th, table.noborder th, table.noborder tr.liste_titre td { padding: 8px 2px 8px 3px; /* t r b l */