Contacts: Primary image (attachment) icon added to Contact List for quick view. Delete attachments when Contact deleted.

This commit is contained in:
Nate
2019-03-28 18:53:01 -06:00
parent 351e8af172
commit 8334eeca2f
2 changed files with 47 additions and 3 deletions
+10 -2
View File
@@ -45,11 +45,11 @@ if (!$included) {
}
}
if (strlen($contact_uuid) > 0) {
if (is_uuid($contact_uuid)) {
//delete addresses
$sql = "delete from v_contact_addresses ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and contact_uuid = '".$contact_uuid."' ";
$sql .= "and contact_uuid = :contact_uuid ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($prep_statement, $sql);
@@ -106,6 +106,14 @@ if (strlen($contact_uuid) > 0) {
$prep_statement->execute();
unset($prep_statement, $sql);
//delete attachments
$sql = "delete from v_contact_attachments ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and contact_uuid = '".$contact_uuid."' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($prep_statement, $sql);
//delete contact users
$sql = "delete from v_contact_users ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";