Greenbone Vulnerability Manager  22.4.0~dev1
manage_sql_tickets.h
1 /* Copyright (C) 2019-2022 Greenbone Networks GmbH
2  *
3  * SPDX-License-Identifier: AGPL-3.0-or-later
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as
7  * published by the Free Software Foundation, either version 3 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef _GVMD_MANAGE_SQL_TICKETS_H
20 #define _GVMD_MANAGE_SQL_TICKETS_H
21 
22 #include "manage.h"
23 
27 #define TICKET_SQL_RESULT_MAY_HAVE_TICKETS \
28  "(SELECT EXISTS (SELECT * FROM tickets" \
29  " WHERE id IN (SELECT ticket FROM ticket_results" \
30  " WHERE result = results.id" \
31  " AND result_location" \
32  " = " G_STRINGIFY (LOCATION_TABLE) ")))"
33 
34 user_t
35 ticket_owner (ticket_t);
36 
37 user_t
38 ticket_assigned_to (ticket_t);
39 
40 gchar *
41 ticket_nvt_name (ticket_t);
42 
43 int
44 delete_ticket (const char *, int);
45 
46 int
47 restore_ticket (const char *);
48 
49 void
51 
52 void
53 check_tickets ();
54 
55 void
56 delete_tickets_user (user_t);
57 
58 void
59 inherit_tickets (user_t, user_t);
60 
61 void
62 tickets_remove_task (task_t);
63 
64 void
65 tickets_remove_report (report_t);
66 
67 void
69 
70 void
71 tickets_trash_task (task_t);
72 
73 void
74 tickets_restore_task (task_t);
75 
76 #endif /* not _GVMD_MANAGE_SQL_TICKETS_H */
user_t ticket_owner(ticket_t ticket)
Return owner of ticket.
Definition: manage_sql_tickets.c:593
int delete_ticket(const char *ticket_id, int ultimate)
Delete a ticket.
Definition: manage_sql_tickets.c:703
int restore_ticket(const char *ticket_id)
Try restore a ticket.
Definition: manage_sql_tickets.c:844
void check_tickets(task_t task)
Check if tickets have been resolved.
Definition: manage_sql_tickets.c:1464
void tickets_trash_task(task_t task)
Adjust tickets for task being moved to trash.
Definition: manage_sql_tickets.c:1651
void tickets_remove_report(report_t report)
Remove a report from all tickets.
Definition: manage_sql_tickets.c:1612
gchar * ticket_nvt_name(ticket_t ticket)
Return NVT name of ticket.
Definition: manage_sql_tickets.c:621
user_t ticket_assigned_to(ticket_t ticket)
Return user that ticket is assigned to.
Definition: manage_sql_tickets.c:607
void tickets_restore_task(task_t task)
Adjust tickets for task being restored.
Definition: manage_sql_tickets.c:1681
void empty_trashcan_tickets()
Empty ticket trashcans.
Definition: manage_sql_tickets.c:1429
void tickets_remove_task(task_t task)
Remove a task from all tickets.
Definition: manage_sql_tickets.c:1600
void tickets_remove_tasks_user(user_t user)
Remove all of a user's tasks from all tickets.
Definition: manage_sql_tickets.c:1633
void inherit_tickets(user_t user, user_t inheritor)
Change ownership of tickets, for user deletion.
Definition: manage_sql_tickets.c:1577
void delete_tickets_user(user_t user)
Delete all tickets owner by a user.
Definition: manage_sql_tickets.c:1545