Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
dcd84e0310
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2014-2016 Charlie BENKE <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
* 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 (! empty($conf->global->MAIN_SHOW_PRODUCT_ACTIVITY_TRIM))
|
||||
{
|
||||
if (! empty($conf->product->enabled)) activitytrim(0);
|
||||
if (! empty($conf->service->enabled)) activitytrim(1);
|
||||
|
||||
@ -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".'<div class="fichecenter"><div class="fichehalfleft">'."\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".'<div class="fichecenter"><div class="fichehalfleft">'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "\n".'<div class="fichehalfright"><div class="ficheaddleft">'."\n";
|
||||
}
|
||||
|
||||
// Show graph
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
// Label
|
||||
print '<tr class="liste_titre"><td colspan="2">';
|
||||
print $graphfiles[$key]['label'];
|
||||
print '</td></tr>';
|
||||
// Image
|
||||
print '<tr class="impair"><td colspan="2" class="nohover" align="center">';
|
||||
print $graphfiles[$key]['output'];
|
||||
print '</td></tr>';
|
||||
// Date generation
|
||||
print '<tr>';
|
||||
if ($graphfiles[$key]['output'] && ! $px->isGraphKo())
|
||||
{
|
||||
if (file_exists($dir."/".$graphfiles[$key]['file']) && filemtime($dir."/".$graphfiles[$key]['file'])) print '<td>'.$langs->trans("GeneratedOn",dol_print_date(filemtime($dir."/".$graphfiles[$key]['file']),"dayhour")).'</td>';
|
||||
else print '<td>'.$langs->trans("GeneratedOn",dol_print_date(dol_now(),"dayhour")).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>'.($mesg?'<font class="error">'.$mesg.'</font>':$langs->trans("ChartNotGenerated")).'</td>';
|
||||
}
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?id='.(GETPOST('id')?GETPOST('id'):$object->id).((string) $type != ''?'&type='.$type:'').'&action=recalcul&mode='.$mode.'">'.img_picto($langs->trans("ReCalculate"),'refresh').'</a></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
if ($i % 2 == 0)
|
||||
{
|
||||
print "\n".'</div>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "\n".'</div></div></div>';
|
||||
print '<div class="clear"><div class="fichecenter"><br></div></div>'."\n";
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "\n".'<div class="fichehalfright"><div class="ficheaddleft">'."\n";
|
||||
}
|
||||
|
||||
// Show graph
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
// Label
|
||||
print '<tr class="liste_titre"><td colspan="2">';
|
||||
print $graphfiles[$key]['label'];
|
||||
print '</td></tr>';
|
||||
// Image
|
||||
print '<tr class="impair"><td colspan="2" class="nohover" align="center">';
|
||||
print $graphfiles[$key]['output'];
|
||||
print '</td></tr>';
|
||||
// Date generation
|
||||
print '<tr>';
|
||||
if ($graphfiles[$key]['output'] && ! $px->isGraphKo())
|
||||
{
|
||||
if (file_exists($dir."/".$graphfiles[$key]['file']) && filemtime($dir."/".$graphfiles[$key]['file'])) print '<td>'.$langs->trans("GeneratedOn",dol_print_date(filemtime($dir."/".$graphfiles[$key]['file']),"dayhour")).'</td>';
|
||||
else print '<td>'.$langs->trans("GeneratedOn",dol_print_date(dol_now(),"dayhour")).'</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>'.($mesg?'<font class="error">'.$mesg.'</font>':$langs->trans("ChartNotGenerated")).'</td>';
|
||||
}
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?id='.(GETPOST('id')?GETPOST('id'):$object->id).((string) $type != ''?'&type='.$type:'').'&action=recalcul&mode='.$mode.'">'.img_picto($langs->trans("ReCalculate"),'refresh').'</a></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
if ($i % 2 == 0)
|
||||
{
|
||||
print "\n".'</div>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "\n".'</div></div></div>';
|
||||
print '<div class="clear"><div class="fichecenter"><br></div></div>'."\n";
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
// div not closed
|
||||
if ($i % 2 == 1)
|
||||
|
||||
@ -326,7 +326,7 @@ if ($result)
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free();
|
||||
$db->free($result);
|
||||
|
||||
print "</table>\n";
|
||||
print "<!-- End last thirdparties modified -->\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user