From ffc2741e8a37ee2472b04e110836983ae916d527 Mon Sep 17 00:00:00 2001 From: Sae126V Date: Wed, 30 Aug 2023 08:45:20 +0000 Subject: [PATCH] [GT-187] Update code to improve wording --- .../controllers/downtime/downtime_utils.php | 13 +++++++------ .../controllers/downtime/edit_downtime.php | 6 +++--- htdocs/web_portal/views/downtime/add_downtime.php | 10 ++++++++-- htdocs/web_portal/views/downtime/edit_downtime.php | 4 ++-- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/htdocs/web_portal/controllers/downtime/downtime_utils.php b/htdocs/web_portal/controllers/downtime/downtime_utils.php index c7c2b8302..35c1937f7 100644 --- a/htdocs/web_portal/controllers/downtime/downtime_utils.php +++ b/htdocs/web_portal/controllers/downtime/downtime_utils.php @@ -63,12 +63,12 @@ function endpointToServiceMapping($impactedIDs) * * @param array $servWithEndpoints Used for displaying affected service * with endpoint(s). - * @param array $siteDetails Each site ID will have `services` which - * stores all affected service ID(s) and - * `endpoints` which stores all affected + * @param array $siteDetails Each site ID will have a `services` that + * stores all affected service ID(s) and an + * `endpoints` that stores all affected * endpoint ID(s). * @param bool $hasMultipleTimezones If the user selects multiple sites in - * web portal along with the option + * the web portal along with the option * "site timezone" it will be true; * otherwise, it will be false. * @param mixed $downtimeDetails Downtime information. @@ -107,7 +107,7 @@ function addParentServiceForEndpoints( /** * Converts UTC start and end timestamps to the local timezone - * of a specific site based on its timezone. + * of a specific site based on that site's timezone. * * @param mixed $downtimeDetails Downtime information. * @param integer $siteID Site ID @@ -150,7 +150,8 @@ function setLocalTimeForSites($downtimeDetails, $siteID) * Unset a given variable, helper method to destroy the specified variables. * * @param mixed $downtimeObj Object to destroy specified variables. - * @param string $fromLocation Location from where the function is being called. + * @param string $fromLocation Location from where + * the function is being called. */ function unsetVariables($downtimeObj, $fromLocation) { diff --git a/htdocs/web_portal/controllers/downtime/edit_downtime.php b/htdocs/web_portal/controllers/downtime/edit_downtime.php index ca1f15e86..369a15572 100644 --- a/htdocs/web_portal/controllers/downtime/edit_downtime.php +++ b/htdocs/web_portal/controllers/downtime/edit_downtime.php @@ -78,8 +78,8 @@ function draw(\User $user = null) { } /** - * Retrieves the raw edited downtime's data from a portal request - * and submit it to the services layer's downtime functions. + * Retrieves the raw edited downtime data from a portal request + * and submits it to the services layer's downtime functions. * * @param \User $user current user * @@ -112,7 +112,7 @@ function submit(\User $user = null) $downtimeInfo = getDowntimeFormData(); /** - * Need to sort the impacted_ids into + * Need to sort the `impacted_ids` into * impacted services and impacted endpoints. */ list( diff --git a/htdocs/web_portal/views/downtime/add_downtime.php b/htdocs/web_portal/views/downtime/add_downtime.php index b515d3df2..ad3410ad4 100644 --- a/htdocs/web_portal/views/downtime/add_downtime.php +++ b/htdocs/web_portal/views/downtime/add_downtime.php @@ -264,7 +264,10 @@ function updateStartEndTimesInUtc() let endTimeContent = $('#endTimeContent').val(); if (startDateContent && startTimeContent) { - let startDateInUTC = getDateTimeInUTC(startDateContent, startTimeContent); + let startDateInUTC = getDateTimeInUTC( + startDateContent, + startTimeContent + ); M_START_UTC = updateTimeInSiteTimezone(startDateInUTC); $('#startUtcLabel').text( @@ -278,7 +281,10 @@ function updateStartEndTimesInUtc() // Calculate the end date time in UTC if (endDateContent && endTimeContent) { - let endDateInUTC = getDateTimeInUTC(endDateContent, endTimeContent); + let endDateInUTC = getDateTimeInUTC( + endDateContent, + endTimeContent + ); M_END_UTC = updateTimeInSiteTimezone(endDateInUTC); $('#endUtcLabel').text( diff --git a/htdocs/web_portal/views/downtime/edit_downtime.php b/htdocs/web_portal/views/downtime/edit_downtime.php index 8ef690100..a1b9b64b4 100644 --- a/htdocs/web_portal/views/downtime/edit_downtime.php +++ b/htdocs/web_portal/views/downtime/edit_downtime.php @@ -234,7 +234,6 @@ class="form-control" * Set the start and finish times (don't echo in the full date, * just the time values, time widget didn't like timestamp with date) */ - $('#startTime').data("DateTimePicker").date(""); $('#endTime').data("DateTimePicker").date(""); // By default select the original affected services and endpoints @@ -396,7 +395,8 @@ function loadSitesServicesAndEndpoints() * loading the downtime and the site. */ $('#chooseServices').load( - 'index.php?Page_Type=Edit_Downtime_view_endpoint_tree&dt_id=' + dtId, + 'index.php?Page_Type=Edit_Downtime_view_endpoint_tree&dt_id=' + + dtId, {site_id: siteId}, function(response, status, xhr) {