diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index 707f95d2202..471418b2bd9 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -82,7 +82,7 @@ $title = $langs->trans("Statistics"); llxHeader('', $title, $helpurl); -print load_fiche_titre($title, $mesg, 'product'); +print load_fiche_titre($title, '', 'product'); $param = ''; @@ -101,6 +101,7 @@ if ($mode != '') { $param .= '&mode='.urlencode($mode); } + $h = 0; $head = array(); @@ -115,7 +116,7 @@ $head[$h][2] = 'popularity'; $h++; -print dol_get_fiche_head($head, 'popularity', $langs->trans("Statistics"), -1); +print dol_get_fiche_head($head, 'popularity', '', -1); // Array of liens to show diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index f45a851ecad..21a23fce277 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -51,10 +51,13 @@ $error = 0; $mesg = ''; $graphfiles = array(); -$socid = ''; +$socid = GETPOST('socid', 'int'); if (!empty($user->socid)) { $socid = $user->socid; } +if ($socid < 0) { + $socid = 0; +} // Security check $fieldvalue = ($id > 0 ? $id : $ref); @@ -174,7 +177,7 @@ if ((!($id > 0) && empty($ref)) || $notab) { $head[$h][2] = 'popularity'; $h++; - print dol_get_fiche_head($head, 'chart', $langs->trans("Statistics"), -1); + print dol_get_fiche_head($head, 'chart', '', -1); } @@ -228,6 +231,13 @@ if ($result || !($id > 0)) { arsort($arrayyears); print $form->selectarray('search_year', $arrayyears, $search_year, 1, 0, 0, '', 0, 0, 0, '', 'width75'); print ''; + + // thirdparty + print ''.$langs->trans("ThirdParty").''; + print img_picto('', 'company', 'class="pictofixedwidth"'); + print $form->select_company($socid, 'socid', '', 1, 0, 0, array(), 0, 'widthcentpercentminusx maxwidth400'); + print ''; + print ''; print '
'; print '
'; @@ -235,13 +245,19 @@ if ($result || !($id > 0)) { print '
'; + $param = ''; + $param .= (GETPOSTISSET('id') ? '&id='.GETPOST('id', 'int') : '&id='.$object->id).(($type != '' && $type != '-1') ? '&type='.((int) $type) : '').'&search_year='.((int) $search_year).($notab ? '¬ab='.$notab : ''); + if ($socid > 0) { + $param .= '&socid='.((int) $socid); + } + // Choice of stats mode (byunit or bynumber) if (!empty($conf->dol_use_jmobile)) { print "\n".'
'."\n"; } if ($mode == 'bynumber') { - print ''; + print ''; } else { print ''; } @@ -257,7 +273,7 @@ if ($result || !($id > 0)) { } if ($mode == 'byunit') { - print ''; + print ''; } else { print ''; }