From 34cebe6aa3914ed22e2849c3729af78b1379e78e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 14 Jun 2021 01:11:39 +0200 Subject: [PATCH] Look and feel v14 --- htdocs/adherents/stats/byproperties.php | 4 +- htdocs/adherents/stats/geo.php | 4 +- htdocs/adherents/stats/index.php | 8 +- htdocs/comm/propal/stats/index.php | 89 +++++++++++------------ htdocs/commande/stats/index.php | 12 +-- htdocs/compta/deplacement/stats/index.php | 11 +-- htdocs/compta/facture/list.php | 4 +- htdocs/compta/facture/stats/index.php | 25 +++---- htdocs/don/stats/index.php | 52 +++++++------ htdocs/expedition/stats/index.php | 52 +++++++------ htdocs/expensereport/stats/index.php | 10 +-- htdocs/fichinter/stats/index.php | 66 ++++++++--------- htdocs/product/stats/card.php | 6 +- htdocs/projet/stats/index.php | 8 +- htdocs/projet/tasks/stats/index.php | 5 +- htdocs/reception/stats/index.php | 52 +++++++------ htdocs/salaries/stats/index.php | 8 +- htdocs/ticket/index.php | 3 +- htdocs/ticket/stats/index.php | 11 +-- 19 files changed, 212 insertions(+), 218 deletions(-) diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index 1238fd0fe15..f934ebcf0af 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -40,7 +40,7 @@ if ($user->socid > 0) { $result = restrictedArea($user, 'adherent', '', '', 'cotisation'); $year = strftime("%Y", time()); -$startyear = $year - 2; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -69,7 +69,7 @@ $sql .= " d.morphy as code"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid"; $sql .= " WHERE d.entity IN (".getEntity('adherent').")"; -$sql .= " AND d.statut != -1"; // Not draft +$sql .= " AND d.statut <> -1"; // Not draft $sql .= " GROUP BY d.morphy"; $foundphy = $foundmor = 0; diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 74a5c9b014e..e4a7816c002 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -42,7 +42,7 @@ if ($user->socid > 0) { $result = restrictedArea($user, 'adherent', '', '', 'cotisation'); $year = strftime("%Y", time()); -$startyear = $year - 2; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -92,7 +92,7 @@ if ($mode) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid"; $sql .= " WHERE d.entity IN (".getEntity('adherent').")"; - $sql .= " AND d.statut != -1"; + $sql .= " AND d.statut <> -1"; $sql .= " GROUP BY c.label, c.code"; //print $sql; } diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index e820d0a0d23..c216214606d 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -47,7 +47,7 @@ if ($user->socid > 0) { $result = restrictedArea($user, 'adherent', '', '', 'cotisation'); $year = strftime("%Y", time()); -$startyear = $year - 2; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -151,12 +151,14 @@ print ''; print ''; print ''; print ''; print ''; -print ''; +print ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("Member").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); print $form->select_company($id,'memberid','',1); print '
'.$langs->trans("User").''; -print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print '
'; print ''; print '

'; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index c0d92908aab..c1975e309f5 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -53,8 +53,7 @@ if ($user->socid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -254,56 +253,56 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; -//if (empty($socid)) -//{ - // Show filter box - print '
'; - print ''; - print ''; +// Show filter box +print ''; +print ''; +print ''; - print ''; - print ''; - // Company - print ''; - // ThirdParty Type - print ''; +print ''; +print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - $filter = 's.client IN (1,2,3)'; - print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); - print '
'.$langs->trans("ThirdPartyType").''; - $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. - print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1); +print ''; +print ''; +// Company +print ''; +// ThirdParty Type +print ''; - // Category - print ''; - // User - print ''; - // Status - print ''; - // Year - print ''; +// Category +print ''; +// User +print ''; +// Status +print ''; +// Year +print ''; - print ''; - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; +$filter = 's.client IN (1,2,3)'; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +print '
'.$langs->trans("ThirdPartyType").''; +$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 1, 0, 0, '', 0, 0, 0, $sortparam_typent, '', 1); if ($user->admin) { print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } - print '
'.$cat_label.''; - print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); - print '
'.$langs->trans("CreatedBy").''; - print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print '
'.$langs->trans("Status").''; - $formpropal->selectProposalStatus(($object_status != '' ? $object_status : -1), 0, 0, 1, $mode, 'object_status'); - print '
'.$langs->trans("Year").''; +print '
'.$cat_label.''; +print img_picto('', 'category', 'class="pictofixedwidth"'); +print $formother->select_categories($cat_type, $categ_id, 'categ_id', 0, 1, 'widthcentpercentminusx maxwidth300'); +print '
'.$langs->trans("CreatedBy").''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print '
'.$langs->trans("Status").''; +$formpropal->selectProposalStatus(($object_status != '' ? $object_status : -1), 0, 0, 1, $mode, 'object_status'); +print '
'.$langs->trans("Year").''; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } - arsort($arrayyears); - print $form->selectarray('year', $arrayyears, $year, 0); - print '
'; - print ''; - print '

'; -//} +arsort($arrayyears); +print $form->selectarray('year', $arrayyears, $year, 0); +print '
'; +print ''; +print '

'; print '
'; print ''; @@ -336,11 +335,11 @@ foreach ($data as $val) { print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; $oldyear = $year; } diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 090d07baf81..aebed5e3eb4 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -60,8 +60,7 @@ if ($user->socid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -295,7 +294,8 @@ if ($mode == 'customer') { if ($mode == 'supplier') { $filter = 's.fournisseur = 1'; } -print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300'); print ''; // ThirdParty Type print ''; // User print ''; -print ''; +print ''; print '
0 ? '&userid='.$userid : '').'">'.$year.''.$val['nb'].''.round($val['nb_diff']).''.round($val['nb_diff']).'%'.price(price2num($val['total'], 'MT'), 1).''.round($val['total_diff']).''.round($val['total_diff']).'%'.price(price2num($val['avg'], 'MT'), 1).''.round($val['avg_diff']).''.round($val['avg_diff']).'%
'.$langs->trans("ThirdPartyType").''; @@ -315,11 +315,13 @@ if ($mode == 'supplier') { $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); } print '
'.$cat_label.''; +print img_picto('', 'category', 'class="pictofixedwidth"'); print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); print '
'.$langs->trans("CreatedBy").''; -print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); // Status print '
'.$langs->trans("Status").''; if ($mode == 'customer') { @@ -347,7 +349,7 @@ if (!in_array($nowyear, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '
'; print ''; print '

'; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 673cd7c1972..edc590119ef 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -63,8 +63,7 @@ if ($userid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; $mode = GETPOST("mode") ?GETPOST("mode") : 'customer'; @@ -243,7 +242,8 @@ print ''.$langs->tra // Company print ''.$langs->trans("ThirdParty").''; $filter = ''; -print $form->select_company($socid, 'socid', $filter, 1, 1, 0, array(), 0, '', 'style="width: 95%"'); +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', $filter, 1, 1, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); print ''; // User print ''.$langs->trans("User").''; @@ -251,7 +251,8 @@ $include = ''; if (empty($user->rights->deplacement->readall) && empty($user->rights->deplacement->lire_tous)) { $include = 'hierarchy'; } -print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print ''; // Year print ''.$langs->trans("Year").''; @@ -261,7 +262,7 @@ if (!in_array($year, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; -print ''; +print ''; print ''; print ''; print '

'; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 370a0ac4070..cc52984d6d4 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -717,7 +717,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // No $sql .= $hookmanager->resPrint; if (!$sall) { - $sql .= ' GROUP BY f.rowid, f.ref, ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total_ht, f.total_tva, f.total_ttc,'; + $sql .= ' GROUP BY f.rowid, f.ref, ref_client, f.fk_soc, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total_ht, f.total_tva, f.total_ttc,'; $sql .= ' f.localtax1, f.localtax2,'; $sql .= ' f.datef, f.date_valid, f.date_lim_reglement, f.module_source, f.pos_source,'; $sql .= ' f.paye, f.fk_statut, f.close_code,'; @@ -1049,7 +1049,7 @@ if ($resql) { $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth250', 1); $moreforfilter .= '
'; } if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 9fcfff783b3..307e39cbf62 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -65,11 +65,7 @@ if ($user->socid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; -if (!empty($conf->global->INVOICE_STATS_GRAPHS_SHOW_2_YEARS)) { - $startyear = $year - 2; -} else { - $startyear = $year - 1; -} +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; @@ -291,7 +287,8 @@ if ($mode == 'customer') { if ($mode == 'supplier') { $filter = 's.fournisseur = 1'; } -print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1); +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->selectarray('socid', $companies, $socid, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth250', 1); print ''; // ThirdParty Type @@ -315,17 +312,19 @@ if (!empty($conf->category->enabled)) { } print ''.$cat_label.''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1); - print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%"); + print img_picto('', 'category', 'class="pictofixedwidth"'); + print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), 0, 0, 'widthcentpercentminusx maxwidth300'); //print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); print ''; } // User print ''.$langs->trans("CreatedBy").''; -print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print ''; // Status -print ''.$langs->trans("Status").''; +print ''.$langs->trans("Status").''; if ($mode == 'customer') { $liststatus = array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '1,2'=>$langs->trans("BillStatusNotPaid").' / '.$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled")); print $form->selectarray('object_status', $liststatus, $object_status, 1); @@ -346,7 +345,7 @@ if (!in_array($nowyear, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; -print ''; +print ''; print ''; print ''; print '

'; @@ -383,11 +382,11 @@ foreach ($data as $val) { print ''; print ' 0 ? '&userid='.$userid : '').'">'.$year.''; print ''.$val['nb'].''; - print ''.round($val['nb_diff']).''; + print ''.($val['nb_diff'] < 0 ? '' : '+').round($val['nb_diff']).'%'; print ''.price(price2num($val['total'], 'MT'), 1).''; - print ''.round($val['total_diff']).''; + print ''.($val['total_diff'] < 0 ? '' : '+').round($val['total_diff']).'%'; print ''.price(price2num($val['avg'], 'MT'), 1).''; - print ''.round($val['avg_diff']).''; + print ''.($val['avg_diff'] < 0 ? '' : '+').round($val['avg_diff']).'%'; print ''; $oldyear = $year; } diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 917e30edb50..23e6c0a46c0 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -42,8 +42,7 @@ if ($user->socid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -209,38 +208,37 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; -//if (empty($socid)) -//{ - // Show filter box - print '
'; - print ''; +// Show filter box +print ''; +print ''; - print ''; - print ''; - // Company - print ''; - // User - print ''; - // Year - print ''; +print ''; +print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); - print '
'.$langs->trans("CreatedBy").''; - print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print '
'.$langs->trans("Year").''; +print ''; +print ''; +// Company +print ''; +// User +print ''; +// Year +print ''; - print ''; - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +print '
'.$langs->trans("CreatedBy").''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print '
'.$langs->trans("Year").''; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } - arsort($arrayyears); - print $form->selectarray('year', $arrayyears, $year, 0); - print '
'; - print ''; - print '

'; -//} +arsort($arrayyears); +print $form->selectarray('year', $arrayyears, $year, 0); +print '
'; +print ''; +print '

'; print '
'; print ''; diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index 6bdc495472c..42cac2d3c92 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -41,8 +41,7 @@ if ($user->socid > 0) { $nowyear = dol_print_date(dol_now(), "%Y"); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -214,38 +213,37 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; -//if (empty($socid)) -//{ - // Show filter box - print '
'; - print ''; +// Show filter box +print ''; +print ''; - print '
'; - print ''; - // Company - print ''; - // User - print ''; - // Year - print ''; +print ''; +print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); - print '
'.$langs->trans("CreatedBy").''; - print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print '
'.$langs->trans("Year").''; +print ''; +print ''; +// Company +print ''; +// User +print ''; +// Year +print ''; - print ''; - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +print '
'.$langs->trans("CreatedBy").''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print '
'.$langs->trans("Year").''; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } - arsort($arrayyears); - print $form->selectarray('year', $arrayyears, $year, 0); - print '
'; - print ''; - print '

'; -//} +arsort($arrayyears); +print $form->selectarray('year', $arrayyears, $year, 0); +print '
'; +print ''; +print '

'; print '
'; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index 87bac2dde1a..ce8add98d54 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -55,8 +55,7 @@ $result = restrictedArea($user, 'expensereport', $id, ''); $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; @@ -225,7 +224,7 @@ print ''.$langs->tra // Company /* print ''.$langs->trans("ThirdParty").''; -print $form->select_company($socid,'socid','',1,1,0,array(),0,'','style="width: 95%"'); +print $form->select_company($socid,'socid','',1,1,0,array(),0,'widthcentpercentminusx maxwidth300',''); print ''; */ // User @@ -234,7 +233,8 @@ $include = ''; if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) { $include = 'hierarchy'; } -print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, $include, '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print ''; // Status print ''.$langs->trans("Status").''; @@ -251,7 +251,7 @@ if (!in_array($year, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; -print ''; +print ''; print ''; print ''; print '

'; diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index 29a5f9976b0..7a7adb639b3 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -44,8 +44,7 @@ if ($user->socid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; $object_status = GETPOST('object_status', 'intcomma'); @@ -211,48 +210,47 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; -//if (empty($socid)) -//{ - // Show filter box - print '
'; - print ''; - print ''; +// Show filter box +print ''; +print ''; +print ''; - print ''; - print ''; - // Company - print ''; - // User - print ''; +print ''; +print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - $filter = 's.client IN (1,2,3)'; - print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); - print '
'.$langs->trans("CreatedBy").''; - print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - // Status - print '
'.$langs->trans("Status").''; - $tmp = $objectstatic->LibStatut(0); // To load $this->statuts_short - $liststatus = $objectstatic->statuts_short; +print ''; +print ''; +// Company +print ''; +// User +print ''; - // Year - print ''; +// Year +print ''; - print ''; - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; +$filter = 's.client IN (1,2,3)'; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +print '
'.$langs->trans("CreatedBy").''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +// Status +print '
'.$langs->trans("Status").''; +$tmp = $objectstatic->LibStatut(0); // To force load of $this->statuts_short +$liststatus = $objectstatic->statuts_short; if (empty($conf->global->FICHINTER_CLASSIFY_BILLED)) { unset($liststatus[2]); // Option deprecated. In a future, billed must be managed with a dedicated field to 0 or 1 } - print $form->selectarray('object_status', $liststatus, $object_status, 1, 0, 0, '', 1); - print '
'.$langs->trans("Year").''; +print $form->selectarray('object_status', $liststatus, $object_status, 1, 0, 0, '', 1); +print '
'.$langs->trans("Year").''; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } - arsort($arrayyears); - print $form->selectarray('year', $arrayyears, $year, 0); - print '
'; - print ''; - print '

'; -//} +arsort($arrayyears); +print $form->selectarray('year', $arrayyears, $year, 0); +print '
'; +print ''; +print '

'; print '
'; print ''; diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index d791100ae4a..6929c70a5ff 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -185,8 +185,8 @@ if ($result || empty($id)) { // Tag if ($conf->categorie->enabled) { print ''; } @@ -208,7 +208,7 @@ if ($result || empty($id)) { print $form->selectarray('search_year', $arrayyears, $search_year, 1, 0, 0, '', 0, 0, 0, '', 'width75'); print ''; print '
'.$langs->trans("Categories").''; - $moreforfilter .= img_picto($langs->trans("Categories"), 'category', 'paddingright'); - $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); + $moreforfilter .= img_picto($langs->trans("Categories"), 'category', 'class="pictofixedwidth"'); + $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1, 1, 'widthcentpercentminusx maxwidth300'); print $moreforfilter; print '
'; - print '
'; + print '
'; print '
'; print '
'; diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index 6b1b0eac4c1..c420e2fbe79 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -45,8 +45,7 @@ if ($user->socid > 0) { } $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -283,7 +282,8 @@ print ''; print ''; // Company print ''; // User /*print ''; -print ''; +print ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; -print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); print '
'.$langs->trans("ProjectCommercial").''; @@ -300,7 +300,7 @@ if (!in_array($nowyear, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '
'; print ''; print '

'; diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index 531b9eb7b3a..76c74ba343c 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -45,8 +45,7 @@ if ($user->socid > 0) { } $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -171,7 +170,7 @@ if (!in_array($nowyear, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print ''; -print ''; +print ''; print ''; print ''; print '

'; diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php index 1fe3397ef66..61098e74322 100644 --- a/htdocs/reception/stats/index.php +++ b/htdocs/reception/stats/index.php @@ -37,8 +37,7 @@ $socid = GETPOST('socid', 'int'); $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; $langs->loadLangs(array("reception", "other", "companies")); @@ -209,38 +208,37 @@ print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); print '
'; -//if (empty($socid)) -//{ - // Show filter box - print '
'; - print ''; +// Show filter box +print ''; +print ''; - print ''; - print ''; - // Company - print ''; - // User - print ''; - // Year - print ''; +print ''; +print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; - print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); - print '
'.$langs->trans("CreatedBy").''; - print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print '
'.$langs->trans("Year").''; +print ''; +print ''; +// Company +print ''; +// User +print ''; +// Year +print ''; - print ''; - print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); +print '
'.$langs->trans("CreatedBy").''; +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); +print '
'.$langs->trans("Year").''; if (!in_array($year, $arrayyears)) { $arrayyears[$year] = $year; } if (!in_array($nowyear, $arrayyears)) { $arrayyears[$nowyear] = $nowyear; } - arsort($arrayyears); - print $form->selectarray('year', $arrayyears, $year, 0); - print '
'; - print ''; - print '

'; -//} +arsort($arrayyears); +print $form->selectarray('year', $arrayyears, $year, 0); +print '
'; +print ''; +print '

'; print ''; print ''; diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php index 1a7f2de6d39..ecc62c2a237 100644 --- a/htdocs/salaries/stats/index.php +++ b/htdocs/salaries/stats/index.php @@ -52,8 +52,7 @@ $result = restrictedArea($user, 'salaries', '', '', ''); $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; @@ -204,7 +203,8 @@ print '
'; print ''; // User print ''; // Year print ''; -print ''; +print ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("Employee").''; -print $form->select_dolusers(($userid ? $userid : -1), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers(($userid ? $userid : -1), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); print '
'.$langs->trans("Year").''; @@ -214,7 +214,7 @@ if (!in_array($year, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '
'; print ''; print '

'; diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 6bebe358af3..9e085d468ef 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -56,8 +56,7 @@ $result = restrictedArea($user, 'ticket', 0, '', '', '', ''); $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; $object = new Ticket($db); diff --git a/htdocs/ticket/stats/index.php b/htdocs/ticket/stats/index.php index 9f6e1cc5471..6e87cd42854 100644 --- a/htdocs/ticket/stats/index.php +++ b/htdocs/ticket/stats/index.php @@ -46,8 +46,7 @@ if ($user->socid > 0) { $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; -//$startyear=$year-2; -$startyear = $year - 1; +$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS))); $endyear = $year; // Load translation files required by the page @@ -223,11 +222,13 @@ print ''; print ''; // Company print ''; // User print ''; -print ''; +print ''; print '
'.$langs->trans("Filter").'
'.$langs->trans("ThirdParty").''; -print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, '', 'style="width: 95%"'); +print img_picto('', 'company', 'class="pictofixedwidth"'); +print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth300', ''); print '
'.$langs->trans("CreatedBy").''; -print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); +print img_picto('', 'user', 'class="pictofixedwidth"'); +print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300'); // Status print '
'.$langs->trans("Status").''; $liststatus = $object->fields['fk_statut']['arrayofkeyval']; @@ -244,7 +245,7 @@ if (!in_array($nowyear, $arrayyears)) { arsort($arrayyears); print $form->selectarray('year', $arrayyears, $year, 0); print '
'; print ''; print '

';