From 81487d76b2b0611904251b8ab5c489b5a0ccc526 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 12 Apr 2021 15:37:26 +0200 Subject: [PATCH] Clean code of ol deprecated option --- htdocs/adherents/index.php | 36 ++------------------ htdocs/comm/index.php | 53 ------------------------------ htdocs/comm/mailing/index.php | 2 +- htdocs/comm/propal/index.php | 24 +------------- htdocs/commande/index.php | 19 ++++------- htdocs/contrat/index.php | 24 -------------- htdocs/don/index.php | 2 +- htdocs/expedition/index.php | 12 ------- htdocs/fichinter/index.php | 14 -------- htdocs/fourn/commande/index.php | 13 -------- htdocs/product/index.php | 3 +- htdocs/product/stock/index.php | 2 +- htdocs/projet/activity/index.php | 34 +------------------ htdocs/projet/index.php | 33 ------------------- htdocs/reception/index.php | 2 +- htdocs/supplier_proposal/index.php | 16 --------- 16 files changed, 16 insertions(+), 273 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 0340af431f7..998736e137f 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -155,42 +155,10 @@ if ($result) { $db->free(); } -$searchbox = ''; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search contact/address - if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire) { - $listofsearchfields['search_member'] = array('text'=>'Member'); - } - - if (count($listofsearchfields)) { - $searchbox .='
'; - $searchbox .=''; - $searchbox .='
'; - $searchbox .=''; - $i = 0; - foreach ($listofsearchfields as $key => $value) { - if ($i == 0) { - $searchbox .=''; - } - $searchbox .=''; - $searchbox .=''; - if ($i == 0) { - $searchbox .=''; - } - $searchbox .=''; - $i++; - } - $searchbox .='
'.$langs->trans("Search").'
:
'; - $searchbox .='
'; - $searchbox .='
'; - $searchbox .='
'; - } -} - - /* * Statistics */ + $boxgraph = ''; if ($conf->use_javascript_ajax) { $boxgraph .='
'; @@ -258,7 +226,7 @@ print '
'; print '
'; print '
'; -print $searchbox; + print $boxgraph; print $resultboxes['boxlista']; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 14cf54c8cdc..a3826fa7dcd 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -100,59 +100,6 @@ print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial'); print '
'; -// This is useless due to the global search combo -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { - // Search proposal - if (!empty($conf->propal->enabled) && $user->rights->propal->lire) { - $listofsearchfields['search_proposal'] = array('text'=>'Proposal'); - } - // Search customer order - if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { - $listofsearchfields['search_customer_order'] = array('text'=>'CustomerOrder'); - } - // Search supplier proposal - if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { - $listofsearchfields['search_supplier_proposal'] = array('text'=>'SupplierProposalShort'); - } - // Search supplier order - if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled)) && $user->rights->fournisseur->commande->lire) { - $listofsearchfields['search_supplier_order'] = array('text'=>'SupplierOrder'); - } - // Search intervention - if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) { - $listofsearchfields['search_intervention'] = array('text'=>'Intervention'); - } - // Search contract - if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { - $listofsearchfields['search_contract'] = array('text'=>'Contract'); - } - - if (count($listofsearchfields)) { - print '
'; - print ''; - print '
'; - print ''; - $i = 0; - foreach ($listofsearchfields as $key => $value) { - if ($i == 0) { - print ''; - } - print ''; - print ''; - if ($i == 0) { - print ''; - } - print ''; - $i++; - } - print '
'.$langs->trans("Search").'
'; - print '
'; - print '
'; - print '
'; - } -} - - /* * Draft customer proposals */ diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index a5052786679..026acfc43b8 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -57,7 +57,7 @@ print '
'; //if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo //{ - // Recherche emails + // Search into emailings print '
'; print ''; print '
'; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index a47ae365635..445fd9b5773 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -65,32 +65,10 @@ print load_fiche_titre($langs->trans("ProspectionArea"), '', 'propal'); print '
'; print '
'; -// This is useless due to the global search combo -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { - print ''; - print '
'; - print ''; - print ''; - - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - - print '
'.$langs->trans("Search").'
'.$langs->trans("Proposal").':
'; - print '
'; - print ''; - print '
'; -} - /* * Statistics */ + $listofstatus = array(Propal::STATUS_DRAFT, Propal::STATUS_VALIDATED, Propal::STATUS_SIGNED, Propal::STATUS_NOTSIGNED, Propal::STATUS_BILLED); $sql = "SELECT count(p.rowid) as nb, p.fk_statut as status"; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index ecbffa75028..dc15b85525c 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -50,6 +50,12 @@ if ($user->socid > 0) { $socid = $user->socid; } +$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT; + +// Maximum elements of the tables +$maxDraftCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; +$maxLatestEditCount = 5; +$maxOpenCount = empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD; /* @@ -70,19 +76,6 @@ print load_fiche_titre($langs->trans("OrdersArea"), '', 'order'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search customer orders - print '
'; - print ''; - print '
'; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("CustomerOrder").':

\n"; -} - - /* * Statistics */ diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 46a89209996..8ab94ca6793 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -75,29 +75,9 @@ llxHeader(); print load_fiche_titre($langs->trans("ContractsArea"), '', 'contract'); -//print ''; -//print '\n"; } } -//if ($totalinprocess != $total) -//print ''; print ''; print "
'; print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search contract - if (!empty($conf->contrat->enabled)) { - print '
'; - print ''; - - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'.$langs->trans("Contract").':
\n"; - print "
"; - } -} - - /* * Statistics */ @@ -250,8 +230,6 @@ foreach ($listofstatus as $status) { print "
'.$langs->trans("Total").' ('.$langs->trans("ServicesRunning").')'.$totalinprocess.'
'.$langs->trans("Total").''.$total.'

"; @@ -320,7 +298,6 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { } -//print ''; print '
'; @@ -645,7 +622,6 @@ if ($resql) { } -//print ''; print '
'; $parameters = array('user' => $user); diff --git a/htdocs/don/index.php b/htdocs/don/index.php index dfdeb76f2a9..2a314068830 100644 --- a/htdocs/don/index.php +++ b/htdocs/don/index.php @@ -89,7 +89,7 @@ print load_fiche_titre($langs->trans("DonationsArea"), '', 'object_donation'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // TODO Add a search into global search combo so we can remove this if (!empty($conf->don->enabled) && $user->rights->don->lire) { $listofsearchfields['search_donation'] = array('text'=>'Donation'); } diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index 5ea3b923e91..defd1ddf9b4 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -53,18 +53,6 @@ print load_fiche_titre($langs->trans("SendingsArea"), '', 'dolly'); print '
'; - -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - print '
'; - print ''; - print '
'; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("Shipment").':

\n"; -} - /* * Shipments to validate */ diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 52bde29e660..2d69046b4ba 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -67,20 +67,6 @@ print load_fiche_titre($langs->trans("InterventionsArea"), '', 'intervention'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search ficheinter - $var = false; - print '
'; - print ''; - print '
'; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("Intervention").':

\n"; -} - - /* * Statistics */ diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 9164a223d04..e8365261e1a 100644 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -60,19 +60,6 @@ print load_fiche_titre($langs->trans("SuppliersOrdersArea"), '', 'supplier_order print '
'; - -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - print '
'; - print ''; - print '
'; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("SupplierOrder").':

\n"; -} - - /* * Statistics */ diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 7d5f59c1ed9..e2cb4799965 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -88,7 +88,8 @@ print load_fiche_titre($transAreaType, $linkback, 'product'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be + is useless due to the global search combo // Search contract if ((!empty($conf->product->enabled) || !empty($conf->service->enabled)) && ($user->rights->produit->lire || $user->rights->service->lire)) { $listofsearchfields['search_product'] = array('text'=>'ProductOrService'); diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index ff2c99c0b09..b64068df48b 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -60,7 +60,7 @@ print load_fiche_titre($langs->trans("StocksArea"), '', 'stock'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be useless due to the global search combo print '
'; print ''; print '
'; diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index fe2188de904..0191cc74ef8 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -108,40 +108,8 @@ print_barre_liste($form->textwithpicto($title, $tooltiphelp), 0, $_SERVER["PHP_S print '
'; +/* Show list of project today */ -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search project - if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { - $listofsearchfields['search_task'] = array('text'=>'Task'); - } - - if (count($listofsearchfields)) { - print ''; - print ''; - print '
'; - print ''; - $i = 0; - foreach ($listofsearchfields as $key => $value) { - if ($i == 0) { - print ''; - } - print ''; - print ''; - if ($i == 0) { - print ''; - } - print ''; - $i++; - } - print '
'.$langs->trans("Search").'
'; - print '
'; - print ''; - print '
'; - } -} - - -/* Affichage de la liste des projets d'aujourd'hui */ print '
'; print ''; print ''; diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index f42a0553893..c464cf1694b 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -182,39 +182,6 @@ if ($resql) { print '
'; - -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - // Search project - if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { - $listofsearchfields['search_project'] = array('text'=>'Project'); - } - - if (count($listofsearchfields)) { - print '
'; - print ''; - print '
'; - print '
'; - $i = 0; - foreach ($listofsearchfields as $key => $value) { - if ($i == 0) { - print ''; - } - print ''; - print ''; - if ($i == 0) { - print ''; - } - print ''; - $i++; - } - print '
'.$langs->trans("Search").'
'; - print '
'; - print ''; - print '
'; - } -} - - /* * Statistics */ diff --git a/htdocs/reception/index.php b/htdocs/reception/index.php index a54eea592c0..9eadc3be41a 100644 --- a/htdocs/reception/index.php +++ b/htdocs/reception/index.php @@ -61,7 +61,7 @@ print load_fiche_titre($langs->trans("ReceptionsArea"), '', 'dollyrevert'); print '
'; -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo +if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This may be useless due to the global search combo print '
'; print ''; print '
'; diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php index 9a7b6fcbb95..0cfdc5a09b6 100644 --- a/htdocs/supplier_proposal/index.php +++ b/htdocs/supplier_proposal/index.php @@ -61,22 +61,6 @@ print load_fiche_titre($langs->trans("SupplierProposalArea"), '', 'supplier_prop print '
'; - -// Search form - -if (!empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) { // This is useless due to the global search combo - print ''; - print ''; - print '
'; - print ''; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Search").'
'; - print $langs->trans("SupplierProposal").':

\n"; -} - - // Statistics $sql = "SELECT count(p.rowid), p.fk_statut";