🐛 Display only open subscribed requests on home dash #86

Merged
MrLyallCSIT merged 3 commits from bug/70 into main 2020-08-13 19:47:40 +00:00
4 changed files with 25 additions and 5 deletions

View File

@@ -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 }}

View File

@@ -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);

View File

@@ -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');

View File

@@ -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);
}
?>