From 94b66d541134463e082315177bfc4705a74d7bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sun, 7 Jan 2024 16:57:14 +0100 Subject: [PATCH] clean code of boxes --- .../box_accountancy_last_manual_entries.php | 11 ---------- .../box_accountancy_suspense_account.php | 11 ---------- htdocs/core/boxes/box_actions.php | 9 -------- htdocs/core/boxes/box_actions_future.php | 9 -------- htdocs/core/boxes/box_activity.php | 10 --------- htdocs/core/boxes/box_birthdays.php | 9 -------- htdocs/core/boxes/box_birthdays_members.php | 9 -------- htdocs/core/boxes/box_boms.php | 11 ---------- htdocs/core/boxes/box_bookmarks.php | 11 ---------- htdocs/core/boxes/box_clients.php | 9 -------- htdocs/core/boxes/box_commandes.php | 11 ---------- htdocs/core/boxes/box_comptes.php | 10 --------- htdocs/core/boxes/box_contacts.php | 11 ---------- htdocs/core/boxes/box_contracts.php | 11 ---------- ...box_customers_outstanding_bill_reached.php | 11 +--------- .../core/boxes/box_dolibarr_state_board.php | 13 +---------- htdocs/core/boxes/box_external_rss.php | 9 -------- htdocs/core/boxes/box_factures.php | 11 ---------- htdocs/core/boxes/box_factures_fourn.php | 11 ---------- htdocs/core/boxes/box_factures_fourn_imp.php | 11 ---------- htdocs/core/boxes/box_factures_imp.php | 11 ---------- htdocs/core/boxes/box_ficheinter.php | 11 ---------- htdocs/core/boxes/box_fournisseurs.php | 11 ---------- .../core/boxes/box_funnel_of_prospection.php | 10 --------- htdocs/core/boxes/box_goodcustomers.php | 11 +--------- .../boxes/box_graph_invoices_permonth.php | 8 ------- .../core/boxes/box_graph_invoices_peryear.php | 9 -------- .../box_graph_invoices_supplier_permonth.php | 9 -------- .../boxes/box_graph_nb_ticket_last_x_days.php | 4 ---- .../core/boxes/box_graph_nb_tickets_type.php | 5 ----- .../boxes/box_graph_new_vs_close_ticket.php | 5 ----- .../core/boxes/box_graph_orders_permonth.php | 9 -------- .../box_graph_orders_supplier_permonth.php | 9 -------- .../boxes/box_graph_product_distribution.php | 13 +---------- .../boxes/box_graph_propales_permonth.php | 9 -------- .../boxes/box_graph_ticket_by_severity.php | 10 --------- .../core/boxes/box_last_knowledgerecord.php | 20 ----------------- .../box_last_modified_knowledgerecord.php | 22 +------------------ .../core/boxes/box_last_modified_ticket.php | 9 -------- htdocs/core/boxes/box_last_ticket.php | 9 -------- htdocs/core/boxes/box_lastlogin.php | 10 --------- htdocs/core/boxes/box_members_by_tags.php | 10 --------- htdocs/core/boxes/box_members_by_type.php | 10 --------- .../core/boxes/box_members_last_modified.php | 10 --------- .../boxes/box_members_last_subscriptions.php | 10 --------- .../box_members_subscriptions_by_year.php | 10 --------- htdocs/core/boxes/box_mos.php | 11 ---------- htdocs/core/boxes/box_produits.php | 13 +---------- .../core/boxes/box_produits_alerte_stock.php | 11 ---------- htdocs/core/boxes/box_project.php | 12 +--------- .../core/boxes/box_project_opportunities.php | 12 +--------- htdocs/core/boxes/box_propales.php | 11 ---------- htdocs/core/boxes/box_prospect.php | 9 -------- htdocs/core/boxes/box_scheduled_jobs.php | 14 ------------ htdocs/core/boxes/box_services_contracts.php | 11 ---------- htdocs/core/boxes/box_services_expired.php | 11 ---------- htdocs/core/boxes/box_shipments.php | 11 ---------- htdocs/core/boxes/box_supplier_orders.php | 10 --------- ...box_supplier_orders_awaiting_reception.php | 10 --------- htdocs/core/boxes/box_task.php | 12 +--------- htdocs/core/boxes/box_validated_projects.php | 11 ---------- htdocs/core/boxes/modules_boxes.php | 15 +++++++++++++ .../template/core/boxes/mymodulewidget1.php | 20 ----------------- 63 files changed, 24 insertions(+), 652 deletions(-) diff --git a/htdocs/core/boxes/box_accountancy_last_manual_entries.php b/htdocs/core/boxes/box_accountancy_last_manual_entries.php index 54a1dd0cb63..f10fd4ee61c 100644 --- a/htdocs/core/boxes/box_accountancy_last_manual_entries.php +++ b/htdocs/core/boxes/box_accountancy_last_manual_entries.php @@ -37,17 +37,6 @@ class box_accountancy_last_manual_entries extends ModeleBoxes public $boxlabel = "BoxLastManualEntries"; public $depends = array("accounting"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_accountancy_suspense_account.php b/htdocs/core/boxes/box_accountancy_suspense_account.php index 6d3d9a694e4..49ad1322d15 100644 --- a/htdocs/core/boxes/box_accountancy_suspense_account.php +++ b/htdocs/core/boxes/box_accountancy_suspense_account.php @@ -37,17 +37,6 @@ class box_accountancy_suspense_account extends ModeleBoxes public $boxlabel = "BoxSuspenseAccount"; public $depends = array("accounting"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 111a2a593be..0a876d9a8a0 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -37,17 +37,8 @@ class box_actions extends ModeleBoxes public $boxlabel = "BoxOldestActions"; public $depends = array("agenda"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_actions_future.php b/htdocs/core/boxes/box_actions_future.php index b48f0a79a51..1f7bf8a50f0 100644 --- a/htdocs/core/boxes/box_actions_future.php +++ b/htdocs/core/boxes/box_actions_future.php @@ -37,17 +37,8 @@ class box_actions_future extends ModeleBoxes public $boxlabel = "BoxTitleFutureActions"; public $depends = array("agenda"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 58f48479759..db081ee51d8 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -35,18 +35,8 @@ class box_activity extends ModeleBoxes public $boxlabel = 'BoxGlobalActivity'; public $depends = array("facture"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php index 46318dbc191..3abab74e28a 100644 --- a/htdocs/core/boxes/box_birthdays.php +++ b/htdocs/core/boxes/box_birthdays.php @@ -37,17 +37,8 @@ class box_birthdays extends ModeleBoxes public $boxlabel = "BoxTitleUserBirthdaysOfMonth"; public $depends = array("user"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php index 339d4f69710..8ac73aa4bd0 100644 --- a/htdocs/core/boxes/box_birthdays_members.php +++ b/htdocs/core/boxes/box_birthdays_members.php @@ -37,17 +37,8 @@ class box_birthdays_members extends ModeleBoxes public $boxlabel = "BoxTitleMemberNextBirthdays"; public $depends = array("adherent"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index 13ddfa63296..4f2042f6d2e 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -37,17 +37,6 @@ class box_boms extends ModeleBoxes public $boxlabel = "BoxTitleLatestModifiedBoms"; public $depends = array("bom"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index 4b3fa4db457..0d842ebca8c 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -33,17 +33,6 @@ class box_bookmarks extends ModeleBoxes public $boxlabel = "BoxMyLastBookmarks"; public $depends = array("bookmark"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index 66257dc41bb..ed5c642a2e7 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -37,17 +37,8 @@ class box_clients extends ModeleBoxes public $boxlabel = "BoxLastCustomers"; public $depends = array("societe"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 8e127cc5447..091cd85f244 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -37,17 +37,6 @@ class box_commandes extends ModeleBoxes public $boxlabel = "BoxLastCustomerOrders"; public $depends = array("commande"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index c8f683a86ec..5f53fb46e26 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -38,18 +38,8 @@ class box_comptes extends ModeleBoxes public $boxlabel = "BoxCurrentAccounts"; public $depends = array("banque"); // Box active if module banque active - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index c7ced94d5ea..3c03f64ff2a 100644 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -40,17 +40,6 @@ class box_contacts extends ModeleBoxes public $boxlabel = "BoxLastContacts"; public $depends = array("societe"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 7f63597bb82..54991e25fce 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -36,17 +36,6 @@ class box_contracts extends ModeleBoxes public $boxlabel = "BoxLastContracts"; public $depends = array("contrat"); // conf->contrat->enabled - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php index ce3a0978bce..84bb12b4f79 100644 --- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php +++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php @@ -37,17 +37,8 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes public $boxlabel = "BoxCustomersOutstandingBillReached"; public $depends = array("facture", "societe"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * @@ -56,7 +47,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes */ public function __construct($db, $param = '') { - global $conf, $user; + global $user; $this->db = $db; diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 93be0f71018..29dd0716588 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -37,17 +37,8 @@ class box_dolibarr_state_board extends ModeleBoxes public $boxlabel = "BoxDolibarrStateBoard"; public $depends = array("user"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * @@ -56,8 +47,6 @@ class box_dolibarr_state_board extends ModeleBoxes */ public function __construct($db, $param = '') { - global $conf, $user; - $this->db = $db; } @@ -69,7 +58,7 @@ class box_dolibarr_state_board extends ModeleBoxes */ public function loadBox($max = 5) { - global $user, $langs, $conf; + global $user, $langs; $langs->load("boxes"); $this->max = $max; diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php index f8b7e424a0d..9540cc86ad7 100644 --- a/htdocs/core/boxes/box_external_rss.php +++ b/htdocs/core/boxes/box_external_rss.php @@ -39,17 +39,8 @@ class box_external_rss extends ModeleBoxes public $boxlabel = "BoxLastRssInfos"; public $depends = array("externalrss"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $paramdef; // Params of box definition (not user params) - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 6405566f575..bdd42fc4dd2 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -35,17 +35,6 @@ class box_factures extends ModeleBoxes public $boxlabel = "BoxLastCustomerBills"; public $depends = array("facture"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 1d0335819a4..89cd7af33d0 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -36,17 +36,6 @@ class box_factures_fourn extends ModeleBoxes public $boxlabel = "BoxLastSupplierBills"; public $depends = array("facture", "fournisseur"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index bceb1200974..5133905eea8 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -35,17 +35,6 @@ class box_factures_fourn_imp extends ModeleBoxes public $boxlabel = "BoxOldestUnpaidSupplierBills"; public $depends = array("facture", "fournisseur"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 797f9784df0..6b435790908 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -38,17 +38,6 @@ class box_factures_imp extends ModeleBoxes public $boxlabel = "BoxOldestUnpaidCustomerBills"; public $depends = array("facture"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 41803b7bb16..dd16474a801 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -36,17 +36,6 @@ class box_ficheinter extends ModeleBoxes public $boxlabel = "BoxFicheInter"; public $depends = array("ficheinter"); // conf->contrat->enabled - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index c86de351694..8a62953ea59 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -37,17 +37,6 @@ class box_fournisseurs extends ModeleBoxes public $boxlabel = "BoxLastSuppliers"; public $depends = array("fournisseur"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_funnel_of_prospection.php b/htdocs/core/boxes/box_funnel_of_prospection.php index b2cc183fc2a..73e6a1c7522 100644 --- a/htdocs/core/boxes/box_funnel_of_prospection.php +++ b/htdocs/core/boxes/box_funnel_of_prospection.php @@ -39,16 +39,6 @@ class box_funnel_of_prospection extends ModeleBoxes public $version = 'development'; - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - /** * Constructor * diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php index 8610f9f371f..8cdc6bcc708 100644 --- a/htdocs/core/boxes/box_goodcustomers.php +++ b/htdocs/core/boxes/box_goodcustomers.php @@ -38,17 +38,8 @@ class box_goodcustomers extends ModeleBoxes public $boxlabel = "BoxGoodCustomers"; public $depends = array("societe"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * @@ -57,7 +48,7 @@ class box_goodcustomers extends ModeleBoxes */ public function __construct($db, $param = '') { - global $conf, $user; + global $user; $this->db = $db; diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 4b00c9944c1..8833dac0940 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -33,14 +33,6 @@ class box_graph_invoices_permonth extends ModeleBoxes public $boxlabel = "BoxCustomersInvoicesPerMonth"; public $depends = array("facture"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $info_box_head = array(); - public $info_box_contents = array(); - public $widgettype = 'graph'; diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index cf92c4b38d0..860d84eeb7c 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -33,15 +33,6 @@ class box_graph_invoices_peryear extends ModeleBoxes public $boxlabel = "BoxCustomersInvoicesPerYear"; public $depends = array("facture"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 655eaef5e6a..2a112b07614 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -33,17 +33,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes public $boxlabel = "BoxSuppliersInvoicesPerMonth"; public $depends = array("fournisseur"); - /** - * @var DoliDB Database handler. - */ - public $db; - - 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 84fc3112e23..05837bc526d 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 @@ -35,10 +35,6 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes public $boxlabel; public $depends = array("ticket"); - public $param; - public $info_box_head = array(); - public $info_box_contents = array(); - public $widgettype = 'graph'; /** diff --git a/htdocs/core/boxes/box_graph_nb_tickets_type.php b/htdocs/core/boxes/box_graph_nb_tickets_type.php index 0af8eabf1ad..5dd1c32342d 100644 --- a/htdocs/core/boxes/box_graph_nb_tickets_type.php +++ b/htdocs/core/boxes/box_graph_nb_tickets_type.php @@ -35,13 +35,8 @@ class box_graph_nb_tickets_type extends ModeleBoxes public $boxlabel; public $depends = array("ticket"); - 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 9ece33a9a56..ebf5413e005 100644 --- a/htdocs/core/boxes/box_graph_new_vs_close_ticket.php +++ b/htdocs/core/boxes/box_graph_new_vs_close_ticket.php @@ -35,13 +35,8 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes public $boxlabel; public $depends = array("ticket"); - 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 3b6dd8eec70..573e24f73e2 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -33,17 +33,8 @@ class box_graph_orders_permonth extends ModeleBoxes public $boxlabel = "BoxCustomersOrdersPerMonth"; public $depends = array("commande"); - /** - * @var DoliDB Database handler. - */ - public $db; - - 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 85e3d42d66a..fa9f8503ea4 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -33,17 +33,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes public $boxlabel = "BoxSuppliersOrdersPerMonth"; public $depends = array("fournisseur"); - /** - * @var DoliDB Database handler. - */ - public $db; - - 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 8724b16b02a..7bb406ff64e 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -34,19 +34,8 @@ class box_graph_product_distribution extends ModeleBoxes public $boxlabel = "BoxProductDistribution"; public $depends = array("product|service", "facture|propal|commande"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - public $widgettype = 'graph'; - /** * Constructor * @@ -55,7 +44,7 @@ class box_graph_product_distribution extends ModeleBoxes */ public function __construct($db, $param) { - global $user, $conf; + global $user; $this->db = $db; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 04c1082e80b..4f5d4283298 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -33,17 +33,8 @@ class box_graph_propales_permonth extends ModeleBoxes public $boxlabel = "BoxProposalsPerMonth"; public $depends = array("propal"); - /** - * @var DoliDB Database handler. - */ - public $db; - - 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 b20a72e528c..54826b28378 100644 --- a/htdocs/core/boxes/box_graph_ticket_by_severity.php +++ b/htdocs/core/boxes/box_graph_ticket_by_severity.php @@ -35,18 +35,8 @@ class box_graph_ticket_by_severity extends ModeleBoxes public $boxlabel; public $depends = array("ticket"); - /** - * @var DoliDB Database handler. - */ - public $db; - - 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_last_knowledgerecord.php b/htdocs/core/boxes/box_last_knowledgerecord.php index f1bbb3438bf..7f9f67c71d5 100644 --- a/htdocs/core/boxes/box_last_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_knowledgerecord.php @@ -50,26 +50,6 @@ class box_last_knowledgerecord extends ModeleBoxes */ public $depends = array("knowledgemanagement"); - /** - * @var DoliDB Database handler. - */ - public $db; - - /** - * @var string param - */ - public $param; - - /** - * @var array box info heads - */ - public $info_box_head = array(); - - /** - * @var array box info content - */ - public $info_box_contents = array(); - /** * Constructor * @param DoliDB $db Database handler diff --git a/htdocs/core/boxes/box_last_modified_knowledgerecord.php b/htdocs/core/boxes/box_last_modified_knowledgerecord.php index f15ed3d4d5c..c0095043343 100644 --- a/htdocs/core/boxes/box_last_modified_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_modified_knowledgerecord.php @@ -41,7 +41,7 @@ class box_last_modified_knowledgerecord extends ModeleBoxes public $boximg = "knowledgemanagement"; /** - * @var string boc label + * @var string box label */ public $boxlabel; @@ -50,26 +50,6 @@ class box_last_modified_knowledgerecord extends ModeleBoxes */ public $depends = array("knowledgemanagement"); - /** - * @var DoliDB Database handler. - */ - public $db; - - /** - * @var string param - */ - public $param; - - /** - * @var array box info heads - */ - public $info_box_head = array(); - - /** - * @var array box info content - */ - public $info_box_contents = array(); - /** * Constructor * @param DoliDB $db Database handler diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php index af1f48d539f..9c51b8e9273 100644 --- a/htdocs/core/boxes/box_last_modified_ticket.php +++ b/htdocs/core/boxes/box_last_modified_ticket.php @@ -35,15 +35,6 @@ class box_last_modified_ticket extends ModeleBoxes public $boxlabel; public $depends = array("ticket"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - public $info_box_head = array(); - public $info_box_contents = array(); - /** * Constructor * @param DoliDB $db Database handler diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php index 65662ee2d27..91ba9958424 100644 --- a/htdocs/core/boxes/box_last_ticket.php +++ b/htdocs/core/boxes/box_last_ticket.php @@ -35,15 +35,6 @@ class box_last_ticket extends ModeleBoxes public $boxlabel; public $depends = array("ticket"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - public $info_box_head = array(); - public $info_box_contents = array(); - /** * Constructor * @param DoliDB $db Database handler diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php index 139f3eec4a9..be72337879c 100644 --- a/htdocs/core/boxes/box_lastlogin.php +++ b/htdocs/core/boxes/box_lastlogin.php @@ -35,18 +35,8 @@ class box_lastlogin extends ModeleBoxes public $boxlabel = 'BoxLoginInformation'; public $depends = array("user"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_members_by_tags.php b/htdocs/core/boxes/box_members_by_tags.php index 45404727d96..801c045d8d3 100644 --- a/htdocs/core/boxes/box_members_by_tags.php +++ b/htdocs/core/boxes/box_members_by_tags.php @@ -38,18 +38,8 @@ class box_members_by_tags extends ModeleBoxes public $boxlabel = "BoxTitleMembersByTags"; public $depends = array("adherent", "categorie"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 4a684011139..6ce11bfca44 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -38,18 +38,8 @@ class box_members_by_type extends ModeleBoxes public $boxlabel = "BoxTitleMembersByType"; public $depends = array("adherent"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 2d9d580f8b8..0c7ed55eb57 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -37,18 +37,8 @@ class box_members_last_modified extends ModeleBoxes public $boxlabel = "BoxLastModifiedMembers"; public $depends = array("adherent"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index b7eaad8cd13..7375dda6562 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -37,18 +37,8 @@ class box_members_last_subscriptions extends ModeleBoxes public $boxlabel = "BoxLastMembersSubscriptions"; public $depends = array("adherent"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 9a94f6f071b..6cb43a94187 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -37,18 +37,8 @@ class box_members_subscriptions_by_year extends ModeleBoxes public $boxlabel = "BoxTitleMembersSubscriptionsByYear"; public $depends = array("adherent"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 505ba41acbc..f7ef09fe632 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -37,17 +37,6 @@ class box_mos extends ModeleBoxes public $boxlabel = "BoxTitleLatestModifiedMos"; public $depends = array("mrp"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index 4c52d59aefc..5bfccb7d8e3 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -38,17 +38,6 @@ class box_produits extends ModeleBoxes public $boxlabel = "BoxLastProducts"; public $depends = array("produit"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * @@ -57,7 +46,7 @@ class box_produits extends ModeleBoxes */ public function __construct($db, $param) { - global $conf, $user; + global $user; $this->db = $db; diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index 748c58f2381..3e0b56acc6e 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -40,17 +40,6 @@ class box_produits_alerte_stock extends ModeleBoxes public $boxlabel = "BoxProductsAlertStock"; public $depends = array("produit"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 36e9dc34f54..a2e0f3bdcae 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -34,17 +34,7 @@ class box_project extends ModeleBoxes public $boxcode = "project"; public $boximg = "object_projectpub"; public $boxlabel; - //var $depends = array("projet"); - - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); + // var $depends = array("projet"); /** * Constructor diff --git a/htdocs/core/boxes/box_project_opportunities.php b/htdocs/core/boxes/box_project_opportunities.php index d8a73842e09..9ba1d5a61d9 100644 --- a/htdocs/core/boxes/box_project_opportunities.php +++ b/htdocs/core/boxes/box_project_opportunities.php @@ -34,17 +34,7 @@ class box_project_opportunities extends ModeleBoxes public $boxcode = "project_opportunities"; public $boximg = "object_projectpub"; public $boxlabel; - //var $depends = array("projet"); - - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); + // var $depends = array("projet"); /** * Constructor diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index f793b6facd9..fd84a2e0eaf 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -38,17 +38,6 @@ class box_propales extends ModeleBoxes public $boxlabel = "BoxLastProposals"; public $depends = array("propal"); // conf->propal->enabled - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 0b0287dd2ee..2572ec63070 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -39,17 +39,8 @@ class box_prospect extends ModeleBoxes public $boxlabel = "BoxLastProspects"; public $depends = array("societe"); - /** - * @var DoliDB Database handler. - */ - public $db; - public $enabled = 1; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index 8d9eed0a99f..594ef9261e6 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -37,20 +37,6 @@ class box_scheduled_jobs extends ModeleBoxes public $boxlabel = "BoxScheduledJobs"; public $depends = array("cron"); - /** - * @var DoliDB Database handler. - */ - public $db; - - /** - * @var string params - */ - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index 34f51f2c85f..317c39cdbbb 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -37,17 +37,6 @@ class box_services_contracts extends ModeleBoxes public $boxlabel = "BoxLastProductsInContract"; public $depends = array("service", "contrat"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index 130fad8fd4f..89ae3dd9239 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -34,17 +34,6 @@ class box_services_expired extends ModeleBoxes public $boxlabel = "BoxOldestExpiredServices"; public $depends = array("contrat"); // conf->propal->enabled - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_shipments.php b/htdocs/core/boxes/box_shipments.php index e4e38ea8f43..3d15105f2f0 100644 --- a/htdocs/core/boxes/box_shipments.php +++ b/htdocs/core/boxes/box_shipments.php @@ -37,17 +37,6 @@ class box_shipments extends ModeleBoxes public $boxlabel = "BoxLastCustomerShipments"; public $depends = array("expedition"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 2099dae72f4..66fba8700af 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -35,16 +35,6 @@ class box_supplier_orders extends ModeleBoxes public $boxlabel = "BoxLatestSupplierOrders"; public $depends = array("fournisseur"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 3b7d29d53c4..40d9e7bf726 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -35,16 +35,6 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes public $boxlabel = "BoxLatestSupplierOrdersAwaitingReception"; public $depends = array("fournisseur"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - public $info_box_head = array(); - public $info_box_contents = array(); - - /** * Constructor * diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 70dd49083f8..8bbedfa38f5 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -36,17 +36,7 @@ class box_task extends ModeleBoxes public $boxlabel; public $depends = array("projet"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - public $enabled = 1; // enable because fixed ;-). - - public $info_box_head = array(); - public $info_box_contents = array(); - + public $enabled = 1; /** * Constructor diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index bf43759f3f8..d917e64657c 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -38,19 +38,8 @@ class box_validated_projects extends ModeleBoxes public $boxlabel; //var $depends = array("projet"); - /** - * @var DoliDB Database handler. - */ - public $db; - - public $param; - - public $info_box_head = array(); - public $info_box_contents = array(); - public $enabled = 1; - /** * Constructor * diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 941f12cba82..68ef218b950 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -38,6 +38,21 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box */ public $db; + /** + * @var string param + */ + public $param; + + /** + * @var array box info heads + */ + public $info_box_head = array(); + + /** + * @var array box info content + */ + public $info_box_contents = array(); + /** * @var string Error message */ diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index ace98374461..d9749ce8511 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -57,26 +57,6 @@ class mymodulewidget1 extends ModeleBoxes */ public $depends = array('mymodule'); - /** - * @var DoliDb Database handler - */ - public $db; - - /** - * @var mixed More parameters - */ - public $param; - - /** - * @var array Header informations. Usually created at runtime by loadBox(). - */ - public $info_box_head = array(); - - /** - * @var array Contents informations. Usually created at runtime by loadBox(). - */ - public $info_box_contents = array(); - /** * @var string Widget type ('graph' means the widget is a graph widget) */