Skip to content

Commit

Permalink
[#431] Fix undefined index warnings in user tasks report.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaragunde committed Jan 25, 2022
1 parent c205ad9 commit ac116d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 33 deletions.
40 changes: 9 additions & 31 deletions web/services/getTasksFiltered.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ function maybeEscapeString($string, $csvExport) {
return $csvExport? $string : escape_string($string);
}

$sid = $_GET['sid'];
$sid = $_GET['sid'] ?? NULL;

$csvExport = ($_GET["format"] && $_GET["format"] == "csv");
$csvExport = (isset($_GET["format"]) && $_GET["format"] == "csv");
$csvFile = null;
if ($csvExport)
{
Expand Down Expand Up @@ -162,24 +162,21 @@ function maybeEscapeString($string, $csvExport) {
}

/* Retrieve the data from the request */
$dateFormat = "Y-m-d";
$dateFormat = $_GET['dateFormat'] ?? "Y-m-d";
$filterText = $_GET['filterText'] ?? NULL;
$type = $_GET['type'] ?? NULL;
$projectId = $_GET['projectId'] ?? NULL;
$customerId = $_GET['customerId'] ?? NULL;
$taskStoryId = $_GET['taskStoryId'] ?? NULL;
$filterStory = $_GET['filterStory'] ?? NULL;
$filterStartDate = NULL;
$filterEndDate = NULL;
$telework = NULL;
$onsite = NULL;
$filterText = NULL;
$type = NULL;
$userId = NULL;
$projectId = NULL;
$customerId = NULL;
$taskStoryId = NULL;
$filterStory = NULL;
$emptyText = NULL;
$emptyStory = NULL;
$showProjectNames = false;
if (isset($_GET['dateFormat'])) {
$dateFormat = $_GET['dateFormat'];
}
if (isset($_GET['filterStartDate'])) {
$filterStartDate = DateTime::createFromFormat(
$dateFormat, $_GET['filterStartDate']);
Expand All @@ -204,12 +201,6 @@ function maybeEscapeString($string, $csvExport) {
$onsite = false;
}
}
if (isset($_GET['filterText'])) {
$filterText = $_GET['filterText'];
}
if (isset($_GET['type'])) {
$type = $_GET['type'];
}
if (isset($_GET['userId'])) {
//Request to check user tasks of other user
if($_GET['userId'] != $_SESSION['user']->getId()){
Expand All @@ -220,19 +211,6 @@ function maybeEscapeString($string, $csvExport) {
}
$userId = $_GET['userId'];
}
if (isset($_GET['projectId'])) {
$projectId = $_GET['projectId'];
}
if (isset($_GET['customerId'])) {
$customerId = $_GET['customerId'];
}

if (isset($_GET['taskStoryId'])) {
$taskStoryId = $_GET['taskStoryId'];
}
if (isset($_GET['filterStory'])) {
$filterStory = $_GET['filterStory'];
}
if (isset($_GET['emptyText'])) {
$emptyText = filter_var($_GET['emptyText'],
FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
Expand Down
2 changes: 0 additions & 2 deletions web/userTasksReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

define('PHPREPORT_ROOT', __DIR__ . '/../');

$sid = $_GET["sid"];

/* We check authentication and authorization */
require_once(PHPREPORT_ROOT . '/web/auth.php');

Expand Down

0 comments on commit ac116d9

Please sign in to comment.