From 0ad0c2c9553acb75236b659fd5c0faf0b4bfef8d Mon Sep 17 00:00:00 2001 From: wrongecho Date: Wed, 11 Sep 2024 17:12:30 +0100 Subject: [PATCH] Guest Link Sharing - Allow links to be emailed to non-contacts by typing their email - Don't show archived contacts on the dropdown - Removed unused email send check (handled via queue now) --- ajax.php | 7 +------ js/share_modal.js | 8 ++++++++ share_modal.php | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ajax.php b/ajax.php index fb0520d5..796d56ec 100644 --- a/ajax.php +++ b/ajax.php @@ -321,12 +321,7 @@ if (isset($_GET['share_generate_link'])) { ] ]; - $mail = addToMailQueue($mysqli, $data); - - if ($mail !== true) { - mysqli_query($mysqli,"INSERT INTO notifications SET notification_type = 'Mail', notification = 'Failed to send email to $item_email'"); - mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Mail', log_action = 'Error', log_description = 'Failed to send email to $item_email regarding $subject. $item_mail', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id"); - } + addToMailQueue($mysqli, $data); } diff --git a/js/share_modal.js b/js/share_modal.js index c6bd2ce4..7f782223 100644 --- a/js/share_modal.js +++ b/js/share_modal.js @@ -12,6 +12,14 @@ function populateShareModal(client_id, item_type, item_ref_id) { // Show form and generate button document.getElementById("div_share_link_form").hidden = false; document.getElementById("div_share_link_generate").hidden = false; + + $(document).ready(function() { + $('#share_email').select2({ + tags: true, + placeholder: 'Select or type a value', + allowClear: true + }); + }); } function generateShareLink() { diff --git a/share_modal.php b/share_modal.php index b3652d59..0f1ed665 100644 --- a/share_modal.php +++ b/share_modal.php @@ -53,7 +53,7 @@ '' ORDER BY contact_name ASC"); + $sql_client_contacts_select = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_client_id = $client_id AND contact_email <> '' AND contact_archived_at IS NULL ORDER BY contact_name ASC"); while ($row = mysqli_fetch_array($sql_client_contacts_select)) { $contact_id_select = intval($row['contact_id']); $contact_name_select = nullable_htmlentities($row['contact_name']); @@ -91,3 +91,4 @@ +