diff --git a/application/DashboardNew/DashboardNewController.php b/application/DashboardNew/DashboardNewController.php index 46d2ba843..739184b4a 100644 --- a/application/DashboardNew/DashboardNewController.php +++ b/application/DashboardNew/DashboardNewController.php @@ -168,27 +168,64 @@ class DashboardNewController extends mfBaseController { PreorderModel::countActive($params); }; - $baufortschritt_140 = $countFunction([">status_code" => "139", " "899"]); $timeline_baufortschritt_140 = $this->getTimeline('weekly-leerrohr', $campaign_ids, $gemeinde_ids); - - $ont_installiert_300 = $countFunction([">status_code" => "299", " "899"]); - $timeline_ont_installiert_300 = $this->getTimeline('weekly-ont-installed', $campaign_ids, $gemeinde_ids); - $baufortschritt_140_base_value_before_history = $baufortschritt_140 - $timeline_baufortschritt_140[0][count($timeline_baufortschritt_140[0]) - 1]['value']; foreach ($timeline_baufortschritt_140[0] as $key => $value) { $timeline_baufortschritt_140[0][$key]['value'] += $baufortschritt_140_base_value_before_history; } + + $ont_installiert_300 = $countFunction([">status_code" => "299", " "899"]); + $timeline_ont_installiert_300 = $this->getTimeline('weekly-ont-installed', $campaign_ids, $gemeinde_ids); $ont_installiert_300_base_value_before_history = $ont_installiert_300 - $timeline_ont_installiert_300[0][count($timeline_ont_installiert_300[0]) - 1]['value']; foreach ($timeline_ont_installiert_300[0] as $key => $value) { $timeline_ont_installiert_300[0][$key]['value'] += $ont_installiert_300_base_value_before_history; } + if ($this->me->address_id === '4807') { + + self::returnJson([ + 'type' => 'rml', + 'order_max_home_addrdb' => $order_max_homes, + 'order_actual_order' => $countFunction([]), + 'order_energie_steiermark' => $countFunction(["partner_id" => [20,5033, 3151, 7685, 7754, 7764]]), + 'order_magenta' => $countFunction(["partner_id" => 4803]), + 'order_salzburg_ag' => $countFunction(["partner_id" => 5668]), + 'baufortschritt_140' => $baufortschritt_140, + + // MAYBE OVERWORK + 'order_efh' => $countFunction(["connection_type" => $efh_connection_types]), + 'installationspaket_erhalten' => $countFunction(["connection_type" => $efh_connection_types], 145), + 'lehrrohr_im_haus' => $countFunction(["connection_type" => $efh_connection_types], 200), + //END MAYBE OVERWORK + 'inhouse_kabel_verlegt_efh' => $countFunction([">status_code" => "243", " "899"]), + 'inhouse_kabel_verlegt_efh_magenta' => $countFunction([">status_code" => "243", " "899", "partner_id" => 4803]), + 'inhouse_kabel_verlegt_efh_salzburg' => $countFunction([">status_code" => "243", " "899", "partner_id" => 5668]), + 'order_mph' => $countFunction(["connection_type" => $mph_connection_types]), + 'inhouse_kabel_verlegt_mph' => $countFunction(["connection_type" => $mph_connection_types], 242), + + 'timeline' => $this->getTimeline('weekly-orders', $campaign_ids, $gemeinde_ids), + 'timeline_leerrohr' => $timeline_baufortschritt_140, + 'timeline_ont_installed' => $timeline_ont_installiert_300, + + // status 244 245 - + 'status_244_245_energie_steiermark' => $countFunction(["partner_id" => [20,5033, 3151, 7685, 7754, 7764], ">status_code" => "243", " "899"]), + 'status_244_245_magenta' => $countFunction(["partner_id" => 4803, ">status_code" => "243", " "899"]), + 'status_244_245_salzburg_ag' => $countFunction(["partner_id" => 5668, ">status_code" => "243", " "899"]), + 'status_500_energy_steiermark' => $countFunction(["partner_id" => [20,5033, 3151, 7685, 7754, 7764], "status_code" => "500"]), + 'status_500_magenta' => $countFunction(["partner_id" => 4803, "status_code" => "500"]), + 'status_500_salzburg_ag' => $countFunction(["partner_id" => 5668, "status_code" => "500"]), + + ]); + + } + self::returnJson([ + 'type' => 'default', 'order_max_home_addrdb' => $order_max_homes, 'order_actual_order' => $countFunction([]), 'order_efh' => $countFunction(["connection_type" => $efh_connection_types]), @@ -210,9 +247,19 @@ class DashboardNewController extends mfBaseController { 'timeline' => $this->getTimeline('weekly-orders', $campaign_ids, $gemeinde_ids), 'timeline_leerrohr' => $timeline_baufortschritt_140, 'timeline_ont_installed' => $timeline_ont_installiert_300 + + ]); } + //Installationsfortschritt Provider + // + + + // jasmin wegkommt + // psc raaba 0316 67 33 00 zollweg michael ( + // zollweg michael + private function getTimeline($type, $campaign_ids, $gemeinde_ids) { //TODO: fix gemeinde $timeline = []; $baseParams = ["preordercampaign_id" => $campaign_ids, "gemeinde_id" => $gemeinde_ids]; diff --git a/public/js/pages/DashboardNew/DashboardNew.js b/public/js/pages/DashboardNew/DashboardNew.js index 04598bb6c..e81393003 100644 --- a/public/js/pages/DashboardNew/DashboardNew.js +++ b/public/js/pages/DashboardNew/DashboardNew.js @@ -58,7 +58,7 @@ Vue.component('tt-dashboard-display-card', { props: ['header', 'icon', 'text', 'subHeaders', 'color'], computed: { cardHeight() { - return `${96 + 25 * this.subHeaders.length}px`; + return `${96 + 25 * this.subHeaders?.length ?? 0}px`; } }, template: ` @@ -188,25 +188,10 @@ Vue.component('tt-timeline-chart', { }); - - -Vue.component('dashboard-new', { +Vue.component('dashboard-default', { + props: ['dashboardData'], template: ` - - - -
- -
+

Bestellungen

+
` +}) + + +Vue.component('dashboard-rml', { + props: ['dashboardData'], + template: ` +
+

Bestellungen

+
+ + + + +
+ +
+

Baufortschritt

+
+ + + + + +
+ +
+

Installationsfortschritt Provider

+
+ + + + + +
+ +
+

Bestellverlauf

+
+ +
+
+ ` +}) + + + +Vue.component('dashboard-new', { + template: ` + + + +
+ +
+ + + + +
`, data() { return { dashboardData: { + type: 'unloaded', order_max_home_addrdb: 0, order_actual_order: "0", order_efh: "0",