From db0cf5f03f37cb0ebf9b48dd3c370a87caac4256 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Thu, 9 Jun 2016 18:48:36 +0200 Subject: [PATCH 1/4] remplace level feacture by hidden function --- htdocs/product/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 2f15b98b562..cb061164e5d 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2006 Rodolphe Quiedeville * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2014 Regis Houssin - * Copyright (C) 2014 Charles-Fr BENKE + * Copyright (C) 2014-2016 Charlie BENKE * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify @@ -347,7 +347,7 @@ else // TODO Move this into a page that should be available into menu "accountancy - report - turnover - per quarter" // Also method used for counting must provide the 2 possible methods like done by all other reports into menu "accountancy - report - turnover": // "commitment engagment" method and "cash accounting" method -if ($conf->global->MAIN_FEATURES_LEVEL) +if ($conf->global->MAIN_SHOW_PRODUCT_ACTIVITY_TRIM) { if (! empty($conf->product->enabled)) activitytrim(0); if (! empty($conf->service->enabled)) activitytrim(1); From f40a97481289d5d500486156885b7aa640c50c7d Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 17 Jun 2016 07:54:35 +0200 Subject: [PATCH 2/4] Job Done --- htdocs/product/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/index.php b/htdocs/product/index.php index cb061164e5d..09330b1f1c3 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -347,7 +347,7 @@ else // TODO Move this into a page that should be available into menu "accountancy - report - turnover - per quarter" // Also method used for counting must provide the 2 possible methods like done by all other reports into menu "accountancy - report - turnover": // "commitment engagment" method and "cash accounting" method -if ($conf->global->MAIN_SHOW_PRODUCT_ACTIVITY_TRIM) +if (! empty($conf->global->MAIN_SHOW_PRODUCT_ACTIVITY_TRIM)) { if (! empty($conf->product->enabled)) activitytrim(0); if (! empty($conf->service->enabled)) activitytrim(1); From 260e296f20f5e4e98c0fc53fd12b3cd1271ab63f Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Mon, 18 Jul 2016 02:05:30 +0200 Subject: [PATCH 3/4] add $result on db->free --- htdocs/societe/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 1cc44777438..6e0dcbec113 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -326,7 +326,7 @@ if ($result) $i++; } - $db->free(); + $db->free($result); print "\n"; print "\n"; From f54bc367a426ab9629eb47d6c9e0a151c9274449 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Wed, 20 Jul 2016 01:53:06 +0200 Subject: [PATCH 4/4] fix : warning error if no graphfiles append when we have no element present (start from new) --- htdocs/product/stats/card.php | 115 +++++++++++++++++----------------- 1 file changed, 59 insertions(+), 56 deletions(-) diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index f9f2fe51b5f..c7ada869ecf 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -244,7 +244,7 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') $px = new DolGraph(); - if (! $error) + if (! $error && count($graphfiles)>0) { $mesg = $px->isGraphKo(); if (! $mesg) @@ -301,64 +301,67 @@ if (! empty($id) || ! empty($ref) || GETPOST('id') == 'all') // Show graphs $i=0; - foreach($graphfiles as $key => $val) + if ( count($graphfiles)>0) { - if (! $graphfiles[$key]['file']) continue; - - if ($graphfiles == 'propal' && ! $user->rights->propale->lire) continue; - if ($graphfiles == 'order' && ! $user->rights->commande->lire) continue; - if ($graphfiles == 'invoices' && ! $user->rights->facture->lire) continue; - if ($graphfiles == 'proposals_suppliers' && ! $user->rights->supplier_proposal->lire) continue; - if ($graphfiles == 'invoices_suppliers' && ! $user->rights->fournisseur->facture->lire) continue; - if ($graphfiles == 'orders_suppliers' && ! $user->rights->fournisseur->commande->lire) continue; - - - if ($i % 2 == 0) + foreach($graphfiles as $key => $val) { - print "\n".'
'."\n"; + if (! $graphfiles[$key]['file']) continue; + + if ($graphfiles == 'propal' && ! $user->rights->propale->lire) continue; + if ($graphfiles == 'order' && ! $user->rights->commande->lire) continue; + if ($graphfiles == 'invoices' && ! $user->rights->facture->lire) continue; + if ($graphfiles == 'proposals_suppliers' && ! $user->rights->supplier_proposal->lire) continue; + if ($graphfiles == 'invoices_suppliers' && ! $user->rights->fournisseur->facture->lire) continue; + if ($graphfiles == 'orders_suppliers' && ! $user->rights->fournisseur->commande->lire) continue; + + + if ($i % 2 == 0) + { + print "\n".'
'."\n"; + } + else + { + print "\n".'
'."\n"; + } + + // Show graph + + print ''; + // Label + print ''; + // Image + print ''; + // Date generation + print ''; + if ($graphfiles[$key]['output'] && ! $px->isGraphKo()) + { + if (file_exists($dir."/".$graphfiles[$key]['file']) && filemtime($dir."/".$graphfiles[$key]['file'])) print ''; + else print ''; + } + else + { + print ''; + } + print ''; + print ''; + print '
'; + print $graphfiles[$key]['label']; + print '
'; + print $graphfiles[$key]['output']; + print '
'.$langs->trans("GeneratedOn",dol_print_date(filemtime($dir."/".$graphfiles[$key]['file']),"dayhour")).''.$langs->trans("GeneratedOn",dol_print_date(dol_now(),"dayhour")).''.($mesg?''.$mesg.'':$langs->trans("ChartNotGenerated")).'id).((string) $type != ''?'&type='.$type:'').'&action=recalcul&mode='.$mode.'">'.img_picto($langs->trans("ReCalculate"),'refresh').'
'; + + if ($i % 2 == 0) + { + print "\n".'
'."\n"; + } + else + { + print "\n".'
'; + print '

'."\n"; + } + + $i++; } - else - { - print "\n".'
'."\n"; - } - - // Show graph - - print ''; - // Label - print ''; - // Image - print ''; - // Date generation - print ''; - if ($graphfiles[$key]['output'] && ! $px->isGraphKo()) - { - if (file_exists($dir."/".$graphfiles[$key]['file']) && filemtime($dir."/".$graphfiles[$key]['file'])) print ''; - else print ''; - } - else - { - print ''; - } - print ''; - print ''; - print '
'; - print $graphfiles[$key]['label']; - print '
'; - print $graphfiles[$key]['output']; - print '
'.$langs->trans("GeneratedOn",dol_print_date(filemtime($dir."/".$graphfiles[$key]['file']),"dayhour")).''.$langs->trans("GeneratedOn",dol_print_date(dol_now(),"dayhour")).''.($mesg?''.$mesg.'':$langs->trans("ChartNotGenerated")).'id).((string) $type != ''?'&type='.$type:'').'&action=recalcul&mode='.$mode.'">'.img_picto($langs->trans("ReCalculate"),'refresh').'
'; - - if ($i % 2 == 0) - { - print "\n".'
'."\n"; - } - else - { - print "\n".'
'; - print '

'."\n"; - } - - $i++; } // div not closed if ($i % 2 == 1)