From 82d5c7289dd0c45d4b5191edce9c321c1de158e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Mar 2021 17:02:39 +0100 Subject: [PATCH] Add property widgettype --- htdocs/adherents/index.php | 3 +++ htdocs/core/boxes/box_graph_invoices_permonth.php | 2 ++ .../core/boxes/box_graph_invoices_supplier_permonth.php | 2 ++ htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php | 8 +++----- htdocs/core/boxes/box_graph_nb_tickets_type.php | 9 ++++----- htdocs/core/boxes/box_graph_new_vs_close_ticket.php | 9 ++++----- htdocs/core/boxes/box_graph_orders_permonth.php | 2 ++ htdocs/core/boxes/box_graph_orders_supplier_permonth.php | 2 ++ htdocs/core/boxes/box_graph_product_distribution.php | 2 ++ htdocs/core/boxes/box_graph_propales_permonth.php | 2 ++ htdocs/core/boxes/box_graph_ticket_by_severity.php | 5 ++++- htdocs/core/boxes/modules_boxes.php | 6 ++++++ .../template/core/boxes/mymodulewidget1.php | 6 ++++++ 13 files changed, 42 insertions(+), 16 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 7b4d2f6bba9..7a6b0d7b7d1 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -195,6 +195,7 @@ if ($conf->use_javascript_ajax) { $SommeA = 0; $SommeB = 0; + $SommeC = 0; $SommeD = 0; $total = 0; @@ -492,6 +493,8 @@ print ''; print "\n"; print ""; +print '
'; + print $resultboxes['boxlistb']; print ''."\n"; diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index ca77fec51e4..e4418020bfc 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -41,6 +41,8 @@ class box_graph_invoices_permonth extends ModeleBoxes public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + /** * Constructor diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 21931b1a071..5ecc26c3f90 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -41,6 +41,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + /** * Constructor diff --git a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php index 9595d264ee4..31b6bb20a8d 100644 --- a/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php +++ b/htdocs/core/boxes/box_graph_nb_ticket_last_x_days.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** * Class to manage the box */ -class box_nb_ticket_last_x_days extends ModeleBoxes +class box_graph_nb_ticket_last_x_days extends ModeleBoxes { public $boxcode = "box_nb_ticket_last_x_days"; @@ -36,14 +36,12 @@ class box_nb_ticket_last_x_days extends ModeleBoxes public $boxlabel; public $depends = array("ticket"); - /** - * @var DoliDB Database handler. - */ - public $param; public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + /** * Constructor * @param DoliDB $db Database handler diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index 10eebc05b06..eea0f0ccf77 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** * Class to manage the box */ -class box_nb_tickets_type extends ModeleBoxes +class box_graph_nb_tickets_type extends ModeleBoxes { public $boxcode = "box_nb_tickets_type"; @@ -36,14 +36,13 @@ class box_nb_tickets_type extends ModeleBoxes public $boxlabel; public $depends = array("ticket"); - /** - * @var DoliDB Database handler. - */ - public $param; public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + + /** * Constructor * @param DoliDB $db Database handler diff --git a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php index 32eb82984e7..bd835d6cc07 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** * Class to manage the box */ -class box_new_vs_close_ticket extends ModeleBoxes +class box_graph_new_vs_close_ticket extends ModeleBoxes { public $boxcode = "box_nb_tickets_type"; @@ -36,14 +36,13 @@ class box_new_vs_close_ticket extends ModeleBoxes public $boxlabel; public $depends = array("ticket"); - /** - * @var DoliDB Database handler. - */ - public $param; public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + + /** * Constructor * @param DoliDB $db Database handler diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index ec11d07a28f..48f0bd67ec3 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -41,6 +41,8 @@ class box_graph_orders_permonth extends ModeleBoxes public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + /** * Constructor diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index a6dfead80f0..a394834cd97 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -41,6 +41,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + /** * Constructor diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 5c3e55fcc2f..4a88617de4e 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -44,6 +44,8 @@ class box_graph_product_distribution extends ModeleBoxes public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + /** * Constructor diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index f8028e3bdb8..8a95761ea08 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -41,6 +41,8 @@ class box_graph_propales_permonth extends ModeleBoxes public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + /** * Constructor diff --git a/htdocs/core/boxes/box_graph_ticket_by_severity.php b/htdocs/core/boxes/box_graph_ticket_by_severity.php index 52c3e938798..252769abd0e 100644 --- a/htdocs/core/boxes/box_graph_ticket_by_severity.php +++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"; /** * Class to manage the box */ -class box_ticket_by_severity extends ModeleBoxes +class box_graph_ticket_by_severity extends ModeleBoxes { public $boxcode = "box_ticket_by_severity"; @@ -45,6 +45,9 @@ class box_ticket_by_severity extends ModeleBoxes public $info_box_head = array(); public $info_box_contents = array(); + public $widgettype = 'graph'; + + /** * Constructor * @param DoliDB $db Database handler diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 379a65b7a5d..b7b9d979174 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -109,6 +109,12 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box */ public $note; + /** + * @var string Widget type ('graph' means the widget is a graph widget) + */ + public $widgettype = ''; + + /** * Constructor * diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index e356792ed42..23809eb6a33 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -77,6 +77,12 @@ class mymodulewidget1 extends ModeleBoxes */ public $info_box_contents = array(); + /** + * @var string Widget type ('graph' means the widget is a graph widget) + */ + public $widgettype = 'graph'; + + /** * Constructor *