Generic graph

This commit is contained in:
Laurent Destailleur 2020-02-08 17:46:41 +01:00
parent 33addfab01
commit 1ee959a11f
2 changed files with 15 additions and 5 deletions

View File

@ -17,7 +17,7 @@
/**
* \file htdocs/core/customreports.php
* \ingroup sellyoursaas
* \ingroup core
* \brief Page to make custom reports
*/
@ -72,6 +72,7 @@ $picto = '';
$head = array();
$object = null;
$ObjectClassName = '';
// Objects available by default
$arrayoftype = array(
'thirdparty' => array('label' => 'ThirdParties', 'ObjectClassName' => 'Societe', 'enabled' => $conf->societe->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"),
'contact' => array('label' => 'Contacts', 'ObjectClassName' => 'Contact', 'enabled' => $conf->societe->enabled, 'ClassPath' => DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"),
@ -158,8 +159,15 @@ $form=new Form($db);
llxHeader('', $langs->transnoentitiesnoconv('CustomReports'), '');
//print_fiche_titre($langs->trans("DoliCloudArea"));
// Check parameters
if ($mode == 'graph' && $search_graph == 'bars' && count($search_measures) > 3) {
setEventMessages($langs->trans("GraphInBarsAreLimitedTo3Measures"), null, 'warnings');
$search_graph = 'lines';
}
if ($mode == 'graph' && count($search_xaxis) > 1) {
setEventMessages($langs->trans("OnlyOneFieldForXAxisIsPossible"), null, 'warnings');
$search_xaxis = array(0 => $search_xaxis[0]);
}
//$head = commande_prepare_head(null);
@ -307,9 +315,9 @@ if ($mode == 'grid') {
if ($mode == 'graph') {
print '<div class="divadvancedsearchfield">';
$arrayofgraphs = array('bars', 'line'); // also 'pies'
$arrayofgraphs = array('bars' => 'Bars', 'lines' => 'Lines'); // also 'pies'
print '<div class="inline-block opacitymedium"><span class="fas fa-chart-area paddingright" title="'.$langs->trans("Graph").'"></span>'.$langs->trans("Graph").'</div> ';
print $form->selectarray('search_graph', $arrayofgraphs, $search_graph, 0, 0, 'minwidth100', 1);
print $form->selectarray('search_graph', $arrayofgraphs, $search_graph, 0, 0, 0, 'minwidth100', 1);
print '</div>';
}
print '<div class="divadvancedsearchfield">';

View File

@ -30,6 +30,8 @@ PreviousYearOfInvoice=Previous year of invoice date
NextYearOfInvoice=Following year of invoice date
DateNextInvoiceBeforeGen=Date of next invoice (before generation)
DateNextInvoiceAfterGen=Date of next invoice (after generation)
GraphInBarsAreLimitedTo3Measures=Grapics are limited to 3 measures in 'Bars' mode. The mode 'Lines' was automatically selected instead.
OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Only the first selected field has been selected.
Notify_ORDER_VALIDATE=Sales order validated
Notify_ORDER_SENTBYMAIL=Sales order sent by mail