Greenbone Vulnerability Manager  8.0.1~git
manage_sql_tickets.h
1 /* GVM
2  * $Id$
3  * Description: GVM management layer SQL: Ticket headers
4  *
5  * Authors:
6  * Matthew Mundell <matthew.mundell@greenbone.net>
7  *
8  * Copyright:
9  * Copyright (C) 2019 Greenbone Networks GmbH
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24  */
25 
26 #ifndef _GVMD_MANAGE_SQL_TICKETS_H
27 #define _GVMD_MANAGE_SQL_TICKETS_H
28 
29 #include "manage.h"
30 
34 #define TICKET_SQL_RESULT_MAY_HAVE_TICKETS \
35  "(SELECT EXISTS (SELECT * FROM tickets" \
36  " WHERE id IN (SELECT ticket FROM ticket_results" \
37  " WHERE result = results.id" \
38  " AND result_location" \
39  " = " G_STRINGIFY (LOCATION_TABLE) ")))"
40 
41 user_t ticket_owner (ticket_t);
42 
43 user_t ticket_assigned_to (ticket_t);
44 
45 gchar *ticket_nvt_name (ticket_t);
46 
47 int
48 delete_ticket (const char *, int);
49 
50 int
51 restore_ticket (const char *);
52 
53 void
55 
56 void
57 check_tickets ();
58 
59 void delete_tickets_user (user_t);
60 
61 void inherit_tickets (user_t, user_t);
62 
63 void tickets_remove_task (task_t);
64 
65 void tickets_remove_tasks_user (user_t);
66 
67 void tickets_trash_task (task_t);
68 
69 void tickets_restore_task (task_t);
70 
71 #endif /* not _GVMD_MANAGE_SQL_TICKETS_H */
void tickets_remove_task(task_t task)
Remove a task from all tickets.
Definition: manage_sql_tickets.c:1598
int delete_ticket(const char *ticket_id, int ultimate)
Delete a ticket.
Definition: manage_sql_tickets.c:696
void tickets_restore_task(task_t task)
Adjust tickets for task being restored.
Definition: manage_sql_tickets.c:1658
void tickets_remove_tasks_user(user_t user)
Remove all of a user's tasks from all tickets.
Definition: manage_sql_tickets.c:1610
int restore_ticket(const char *ticket_id)
Try restore a ticket.
Definition: manage_sql_tickets.c:836
void inherit_tickets(user_t user, user_t inheritor)
Change ownership of tickets, for user deletion.
Definition: manage_sql_tickets.c:1573
void check_tickets(task_t task)
Check if tickets have been resolved.
Definition: manage_sql_tickets.c:1459
user_t ticket_assigned_to(ticket_t ticket)
Return user that ticket is assigned to.
Definition: manage_sql_tickets.c:602
void empty_trashcan_tickets()
Empty ticket trashcans.
Definition: manage_sql_tickets.c:1424
gchar * ticket_nvt_name(ticket_t ticket)
Return NVT name of ticket.
Definition: manage_sql_tickets.c:616
void delete_tickets_user(user_t user)
Delete all tickets owner by a user.
Definition: manage_sql_tickets.c:1541
void tickets_trash_task(task_t task)
Adjust tickets for task being moved to trash.
Definition: manage_sql_tickets.c:1628
user_t ticket_owner(ticket_t ticket)
Return owner of ticket.
Definition: manage_sql_tickets.c:589