';
print '
';
@@ -336,11 +335,11 @@ foreach ($data as $val) {
print '';
print '| 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.' | ';
print ''.$val['nb'].' | ';
- print ''.round($val['nb_diff']).' | ';
+ print ''.round($val['nb_diff']).'% | ';
print ''.price(price2num($val['total'], 'MT'), 1).' | ';
- print ''.round($val['total_diff']).' | ';
+ print ''.round($val['total_diff']).'% | ';
print ''.price(price2num($val['avg'], 'MT'), 1).' | ';
- print ''.round($val['avg_diff']).' | ';
+ print ''.round($val['avg_diff']).'% | ';
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 '| '.$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 ' |
';
// 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');
// 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 ' |
';
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 ? '&socid='.$socid : '').($userid > 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 '
';
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 '
';
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 '
';
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 '| '.$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 ' |
';
}
@@ -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 '
';
- 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 '| '.$langs->trans("Filter").' |
';
// Company
print '| '.$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 ' |
';
// User
/*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 ' |
';
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 '
';
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 '| '.$langs->trans("Filter").' |
';
// User
print '| '.$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 ' |
';
// Year
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 ' |
';
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 '| '.$langs->trans("Filter").' |
';
// Company
print '| '.$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 ' |
';
// 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');
// 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 ' |
';
print '
';
print '';
print '
';