mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Moved Edit Recurring Ticket over to the new AJAX modal function
This commit is contained in:
51
ajax.php
51
ajax.php
@@ -284,57 +284,6 @@ if (isset($_GET['share_generate_link'])) {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Looks up info for a given recurring (was scheduled) ticket ID from the database, used to dynamically populate modal edit fields
|
||||
*/
|
||||
if (isset($_GET['recurring_ticket_get_json_details'])) {
|
||||
enforceUserPermission('module_support');
|
||||
|
||||
$client_id = intval($_GET['client_id']);
|
||||
$ticket_id = intval($_GET['ticket_id']);
|
||||
|
||||
// Get all contacts, to allow tickets to be raised under a specific contact
|
||||
$contact_sql = mysqli_query($mysqli, "SELECT contact_id, contact_name FROM contacts
|
||||
WHERE contact_client_id = $client_id
|
||||
AND contact_archived_at IS NULL
|
||||
ORDER BY contact_primary DESC, contact_technical DESC, contact_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($contact_sql)) {
|
||||
$response['contacts'][] = $row;
|
||||
}
|
||||
|
||||
// Get ticket details
|
||||
$ticket_sql = mysqli_query($mysqli, "SELECT * FROM scheduled_tickets
|
||||
WHERE scheduled_ticket_id = $ticket_id
|
||||
AND scheduled_ticket_client_id = $client_id LIMIT 1");
|
||||
while ($row = mysqli_fetch_array($ticket_sql)) {
|
||||
$response['ticket'][] = $row;
|
||||
}
|
||||
|
||||
// Get assets
|
||||
$asset_sql = mysqli_query($mysqli, "SELECT asset_id, asset_name FROM assets WHERE asset_client_id = $client_id AND asset_archived_at IS NULL");
|
||||
while ($row = mysqli_fetch_array($asset_sql)) {
|
||||
$response['assets'][] = $row;
|
||||
}
|
||||
|
||||
// Get technicians to auto assign the ticket to
|
||||
$sql_agents = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT users.user_id, user_name FROM users
|
||||
LEFT JOIN user_settings on users.user_id = user_settings.user_id
|
||||
WHERE user_role > 1
|
||||
AND user_status = 1
|
||||
AND user_archived_at IS NULL
|
||||
ORDER BY user_name ASC"
|
||||
);
|
||||
while ($row = mysqli_fetch_array($sql_agents)) {
|
||||
$response['agents'][] = $row;
|
||||
}
|
||||
|
||||
echo json_encode($response);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns sorted list of active clients
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user