diff --git a/.github/workflows/assigned-issues-inprogress.yml b/.github/workflows/assigned-issues-inprogress.yml index defa967..67de8d7 100644 --- a/.github/workflows/assigned-issues-inprogress.yml +++ b/.github/workflows/assigned-issues-inprogress.yml @@ -10,6 +10,6 @@ jobs: steps: - uses: alex-page/github-project-automation-plus@v0.2.4 with: - project: FHeD v1.0 - column: In Progress - repo-token: ${{ secrets.AUTO_TOKEN }} + project: v1.0 + column: In progress + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/app/includes/app_functions.php b/app/includes/app_functions.php index 6d7bf28..293a02b 100644 --- a/app/includes/app_functions.php +++ b/app/includes/app_functions.php @@ -67,6 +67,26 @@ return $requests; } + function get_open_subscribed_requests($db) { + $requests = array(); + $sub_tickets_stmt = "SELECT ticket_uuid FROM ticket_subscribers WHERE user_uuid=:uuid AND status != 'Closed'"; + $sub_tickets_sql = $db->prepare($sub_tickets_stmt); + $sub_tickets_sql->bindParam(':uuid', $_SESSION['uuid']); + $sub_tickets_sql->execute(); + $sub_tickets_sql->setFetchMode(PDO::FETCH_ASSOC); + $sub_tickets_result = $sub_tickets_sql->fetchAll(); + foreach ($sub_tickets_result as $tkt) { + $stmt = "SELECT * FROM tickets WHERE uuid=:uuid"; + $sql = $db->prepare($stmt); + $sql->bindParam(':uuid', $tkt['ticket_uuid']); + $sql->execute(); + $sql->setFetchMode(PDO::FETCH_ASSOC); + $result = $sql->fetchAll(); + array_push($requests, $result[0]); + } + return $requests; + } + function get_request($db, $uuid) { $ticket_stmt = "SELECT * FROM tickets WHERE uuid=:uuid"; $ticket_sql = $db->prepare($ticket_stmt); diff --git a/app/public/actions/download.php b/app/public/actions/download.php index 953fcd1..2c914dd 100644 --- a/app/public/actions/download.php +++ b/app/public/actions/download.php @@ -20,7 +20,7 @@ finfo_close($finfo); //Use Content-Disposition: attachment to specify the filename - header('Content-Disposition: attachment; filename='.$remote_filename); + header('Content-Disposition: attachment; filename="'.$remote_filename.'"'); //No cache header('Expires: 0'); diff --git a/app/public/index.php b/app/public/index.php index 596c640..a2c703e 100644 --- a/app/public/index.php +++ b/app/public/index.php @@ -4,7 +4,7 @@ if (is_signed_in()) { $requests = get_my_open_requests($db); - $subscriptions = get_subscribed_requests($db); + $subscriptions = get_open_subscribed_requests($db); } ?>