From 15531a7ebc92098953a6fc52738659226c6e1761 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Apr 2015 11:50:57 +0200 Subject: [PATCH] Better title for some boxes --- htdocs/core/boxes/box_activity.php | 7 +++-- .../boxes/box_graph_product_distribution.php | 28 ++++++++++--------- htdocs/langs/en_US/boxes.lang | 1 + 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 7fdb3510afe..f7e09d33583 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2013 Laurent Destailleur + * Copyright (C) 2005-2015 Laurent Destailleur * Copyright (C) 2014-2015 Frederic France * * This program is free software; you can redistribute it and/or modify @@ -80,7 +80,7 @@ class box_activity extends ModeleBoxes $nbofyears=2; if (! empty($conf->global->MAIN_BOX_ACTIVITY_DURATION)) $nbofyears=$conf->global->MAIN_BOX_ACTIVITY_DURATION; - $textHead = $langs->trans("Activity").' '.$nbofyears.' '.$langs->trans("DurationYears").''; + $textHead = $langs->trans("Activity").' - '.$langs->trans("LastXMonthRolling", $nbofyears*12); $this->info_box_head = array( 'text' => $textHead, 'limit'=> dol_strlen($textHead), @@ -102,7 +102,8 @@ class box_activity extends ModeleBoxes $refresh = dol_cache_refresh($cachedir, $filename, $cachetime); $data = array(); - if ($refresh) { + if ($refresh) + { $sql = "SELECT f.fk_statut, SUM(f.total_ttc) as Mnttot, COUNT(*) as nb"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 74d106b7f69..eb2d3a183bf 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2013-2015 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,18 +70,6 @@ class box_graph_product_distribution extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; - $text = $langs->trans("BoxProductDistribution",$max); - $this->info_box_head = array( - 'text' => $text, - 'limit'=> dol_strlen($text), - 'graph'=> 1, - 'sublink'=>'', - 'subtext'=>$langs->trans("Filter"), - 'subpicto'=>'filter.png', - 'subclass'=>'linkobject', - 'target'=>'none' // Set '' to get target="_blank" - ); - $param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year'; $param_showinvoicenb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showinvoicenb'; $param_showpropalnb='DOLUSERCOOKIE_box_'.$this->boxcode.'_showpropalnb'; @@ -110,6 +98,20 @@ class box_graph_product_distribution extends ModeleBoxes $nowarray=dol_getdate(dol_now(),true); if (empty($year)) $year=$nowarray['year']; + + $text = $langs->trans("BoxProductDistribution",$max).' - '.$langs->trans("Year").': '.$year; + $this->info_box_head = array( + 'text' => $text, + 'limit'=> dol_strlen($text), + 'graph'=> 1, + 'sublink'=>'', + 'subtext'=>$langs->trans("Filter"), + 'subpicto'=>'filter.png', + 'subclass'=>'linkobject', + 'target'=>'none' // Set '' to get target="_blank" + ); + + $nbofgraph=0; if ($showinvoicenb) $nbofgraph++; if ($showpropalnb) $nbofgraph++; diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index bf118b9b88e..c0180bebdaa 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -94,3 +94,4 @@ BoxProductDistributionFor=Distribution of %s for %s ForCustomersInvoices=Customers invoices ForCustomersOrders=Customers orders ForProposals=Proposals +LastXMonthRolling=The last %s month rolling