Quick add: the plus beside Contact, Site, Location, Assigned to and Vendor in New Ticket, Edit Ticket and the asset form opens the usual New Contact, New Location or New Vendor window over the form, saved in the background and picked, in place of the pop-up

This commit is contained in:
johnnyq
2026-11-20 12:49:34 -05:00
parent 4083b7cbf3
commit 2fdb280406
89 changed files with 406 additions and 319 deletions

View File

@@ -119,6 +119,21 @@ function redirect($url = null, $permanent = false) {
}
}
/*
* A New Contact, New Location or New Vendor window opened by the + beside a picker in another
* window (quickAddButton(), js/quick_add.js) posts inline=1: answer it with the new record for the
* picker - ['ok' => true, 'value', 'label', 'message'] - or ['ok' => false, 'error'], in place of
* a message and a reload. Does nothing for an ordinary post.
*/
function inlineSaveAnswer(array $answer): void {
if (empty($_POST['inline'])) {
return;
}
header('Content-Type: application/json');
echo json_encode($answer);
exit;
}
//Flash Alert Function
function flashAlert(string $message, string $type = 'success'): void {
$_SESSION['alert_type'] = $type;