From 886a74341213fa5b75ecc467219e74d3b51cdff8 Mon Sep 17 00:00:00 2001 From: ifarzana Date: Wed, 3 Apr 2019 16:11:23 +0100 Subject: [PATCH 01/81] OSX-396 Total Duration in Proof of Play is not displaying number of days. --- views/stats-proofofplay-page.twig | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/views/stats-proofofplay-page.twig b/views/stats-proofofplay-page.twig index 8201e839b9..859123f00d 100644 --- a/views/stats-proofofplay-page.twig +++ b/views/stats-proofofplay-page.twig @@ -194,7 +194,31 @@ if (type != "display") return ""; - return moment().startOf("day").seconds(data).format("H:mm:ss") + let durationData = moment.duration(data, "seconds"); + let dataM = ''; + + let months = durationData.months(); + if (months > 0) { + durationData.subtract(moment.duration(months,'months')); + dataM += months + 'months '; + } + + let days = durationData.days(); + durationData.subtract(moment.duration(days,'days')); + dataM += days + 'day '; + + let hours = durationData.hours(); + durationData.subtract(moment.duration(hours,'hours')); + dataM += hours + 'hr '; + + let minutes = durationData.minutes(); + durationData.subtract(moment.duration(minutes,'minutes')); + dataM += minutes + 'min '; + + let seconds = durationData.seconds(); + dataM += seconds + 's '; + + return dataM; } }, {"data": "duration"}, From bdf119c4362b2314d9ef3a637a42004e2f3ceff8 Mon Sep 17 00:00:00 2001 From: ifarzana Date: Mon, 8 Apr 2019 16:53:04 +0100 Subject: [PATCH 02/81] OSX-443 Time Disconnected Stats are inaccurate --- lib/Controller/Display.php | 5 ----- lib/Xmds/Soap4.php | 5 ++--- lib/Xmds/Soap5.php | 5 ++--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/Controller/Display.php b/lib/Controller/Display.php index 39d7fa35c4..504ee2f8cc 100644 --- a/lib/Controller/Display.php +++ b/lib/Controller/Display.php @@ -1430,11 +1430,6 @@ public function validateDisplays($displays) $display->loggedIn = 0; $display->save(\Xibo\Entity\Display::$saveOptionsMinimum); - // We put it back again (in memory only) - // this is then used to indicate whether or not this is the first time this display has gone - // offline (for anything that uses the timedOutDisplays return - $display->loggedIn = 1; - // Log the down event $event = $this->displayEventFactory->createEmpty(); $event->displayId = $display->displayId; diff --git a/lib/Xmds/Soap4.php b/lib/Xmds/Soap4.php index c11ea32289..28fdd96f61 100644 --- a/lib/Xmds/Soap4.php +++ b/lib/Xmds/Soap4.php @@ -171,9 +171,6 @@ public function RegisterDisplay($serverKey, $hardwareKey, $displayName, $clientT // Append Local Time $displayElement->setAttribute('localDate', $this->getDate()->getLocalDate($dateNow)); } - - // Send Notification if required - $this->alertDisplayUp(); } } catch (NotFoundException $e) { @@ -206,6 +203,8 @@ public function RegisterDisplay($serverKey, $hardwareKey, $displayName, $clientT $displayElement->setAttribute('message', 'Display is active and ready to start.'); } + // Send Notification if required + $this->alertDisplayUp(); $display->lastAccessed = time(); $display->loggedIn = 1; diff --git a/lib/Xmds/Soap5.php b/lib/Xmds/Soap5.php index 496560a01f..3ef4f00f88 100644 --- a/lib/Xmds/Soap5.php +++ b/lib/Xmds/Soap5.php @@ -221,9 +221,6 @@ public function RegisterDisplay($serverKey, $hardwareKey, $displayName, $clientT // Update the PUB Key only if it has been cleared if ($display->xmrPubKey == '') $display->xmrPubKey = $xmrPubKey; - - // Send Notification if required - $this->alertDisplayUp(); } } catch (NotFoundException $e) { @@ -258,6 +255,8 @@ public function RegisterDisplay($serverKey, $hardwareKey, $displayName, $clientT $displayElement->setAttribute('message', 'Display is active and ready to start.'); } + // Send Notification if required + $this->alertDisplayUp(); $display->lastAccessed = time(); $display->loggedIn = 1; From bbebe180182784e16685aa3b14f51ead5a3b5561 Mon Sep 17 00:00:00 2001 From: ifarzana Date: Mon, 8 Apr 2019 17:15:49 +0100 Subject: [PATCH 03/81] Time Disconnected report date fix --- lib/Controller/Stats.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Controller/Stats.php b/lib/Controller/Stats.php index bafe55d291..5f664a4117 100644 --- a/lib/Controller/Stats.php +++ b/lib/Controller/Stats.php @@ -883,10 +883,16 @@ public function timeDisconnectedGrid() $tags = $this->getSanitizer()->getString('tags'); $onlyLoggedIn = $this->getSanitizer()->getCheckbox('onlyLoggedIn') == 1; - // What if the fromdt and todt are exactly the same? - // in this case assume an entire day from midnight on the fromdt to midnight on the todt (i.e. add a day to the todt) - if ($fromDt == $toDt) { - $toDt->addDay(1); + $currentDate = $this->getDate()->parse()->startOfDay()->format('Y-m-d'); + + // fromDt is always start of selected day + $fromDt = $this->getDate()->parse($fromDt)->startOfDay(); + + // If toDt is current date then make it current datetime + if ($this->getDate()->parse($toDt)->startOfDay()->format('Y-m-d') == $currentDate) { + $toDt = $this->getDate()->parse(); + } else { + $toDt = $this->getDate()->parse()->startOfDay(); } // Get an array of display id this user has access to. From 9fd94fce4462d32ab652808814447737a461ee30 Mon Sep 17 00:00:00 2001 From: ifarzana Date: Tue, 9 Apr 2019 08:53:33 +0100 Subject: [PATCH 04/81] OSX-396 Total Duration translation added --- views/stats-proofofplay-page.twig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/views/stats-proofofplay-page.twig b/views/stats-proofofplay-page.twig index 859123f00d..0211e125cb 100644 --- a/views/stats-proofofplay-page.twig +++ b/views/stats-proofofplay-page.twig @@ -200,23 +200,23 @@ let months = durationData.months(); if (months > 0) { durationData.subtract(moment.duration(months,'months')); - dataM += months + 'months '; + dataM += months + '{% trans "month" %} '; } let days = durationData.days(); durationData.subtract(moment.duration(days,'days')); - dataM += days + 'day '; + dataM += days + '{% trans "day" %} '; let hours = durationData.hours(); durationData.subtract(moment.duration(hours,'hours')); - dataM += hours + 'hr '; + dataM += hours + '{% trans "hr" %} '; let minutes = durationData.minutes(); durationData.subtract(moment.duration(minutes,'minutes')); - dataM += minutes + 'min '; + dataM += minutes + '{% trans "min" %} '; let seconds = durationData.seconds(); - dataM += seconds + 's '; + dataM += seconds + '{% trans "sec" %} '; return dataM; } From ee13f05e54ecbeaf1c328258ccf8d27666a46cca Mon Sep 17 00:00:00 2001 From: maurofmferrao Date: Tue, 9 Apr 2019 13:19:47 +0100 Subject: [PATCH 05/81] Display profile checkbox fix merge --- views/display-page.twig | 22 ++++++++++++++++++++++ views/displayprofile-form-edit.twig | 2 +- views/displayprofile-page.twig | 24 ++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/views/display-page.twig b/views/display-page.twig index 49e22b93ee..5b53fbe58a 100644 --- a/views/display-page.twig +++ b/views/display-page.twig @@ -622,6 +622,28 @@ // Call XiboInitialise on table XiboInitialise('#settings-from-profile'); } + // Custom submit for display form + let $form = $('#displayEditForm'); + let bandwidthLimitField = $form.find("input[name=bandwidthLimit]"); + let bandwidthLimitUnitsField = $form.find("select[name=bandwidthLimitUnits]"); + // Replace all checkboxes with hidden input fields + $form.find('input[type="checkbox"]').each(function () { + // Get checkbox values + let value = $(this).is(':checked') ? 'on' : 'off'; + let id = $(this).attr('id'); + + // Create hidden input + $('') + .attr('id', id) + .attr('name', id) + .val(value) + .appendTo($(this).parent()); + + // Disable checkbox so it won't be submitted + $(this).attr('disabled', true); + }); + + $form.submit();