diff --git a/app/contacts/app_config.php b/app/contacts/app_config.php index 5ff94167ae..de26c0be08 100644 --- a/app/contacts/app_config.php +++ b/app/contacts/app_config.php @@ -285,13 +285,14 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the notes."; $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "created"; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "last_mod_date"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Date when the contact was created."; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; - $apps[$x]['db'][$y]['fields'][$z]['name'] = "created_by"; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "last_mod_user"; $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; - $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "The user that created the contact."; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; $y = 1; //table array index $apps[$x]['db'][$y]['table'] = "v_contact_addresses"; diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 9c8246162f..1021c2d4f8 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -133,7 +133,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "contact_category, "; $sql .= "contact_role, "; $sql .= "contact_time_zone, "; - $sql .= "contact_note "; + $sql .= "contact_note, "; + $sql .= "last_mod_date, "; + $sql .= "last_mod_user "; $sql .= ") "; $sql .= "values "; $sql .= "( "; @@ -151,7 +153,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'".$contact_category."', "; $sql .= "'".$contact_role."', "; $sql .= "'".$contact_time_zone."', "; - $sql .= "'".$contact_note."' "; + $sql .= "'".$contact_note."', "; + $sql .= "now(), "; + $sql .= "'".$_SESSION['username']."' "; $sql .= ")"; $db->exec(check_sql($sql)); unset($sql); @@ -216,7 +220,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "contact_category = '".$contact_category."', "; $sql .= "contact_role = '".$contact_role."', "; $sql .= "contact_time_zone = '".$contact_time_zone."', "; - $sql .= "contact_note = '".$contact_note."' "; + $sql .= "contact_note = '".$contact_note."', "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; $sql .= "where domain_uuid = '".$domain_uuid."' "; $sql .= "and contact_uuid = '".$contact_uuid."' "; $db->exec(check_sql($sql)); diff --git a/app/contacts/contact_note_edit.php b/app/contacts/contact_note_edit.php index 8bb62c9006..88129984ff 100644 --- a/app/contacts/contact_note_edit.php +++ b/app/contacts/contact_note_edit.php @@ -47,9 +47,10 @@ else { $action = "add"; } -if (strlen($_GET["contact_uuid"]) > 0) { - $contact_uuid = check_str($_GET["contact_uuid"]); -} +//get the primary id for the contact + if (strlen($_GET["contact_uuid"]) > 0) { + $contact_uuid = check_str($_GET["contact_uuid"]); + } //get http post variables and set them to php variables if (count($_POST)>0) { @@ -60,10 +61,11 @@ if (strlen($_GET["contact_uuid"]) > 0) { if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { - $msg = ''; - if ($action == "update") { - $contact_note_uuid = check_str($_POST["contact_note_uuid"]); - } + //get the primary id for the contact note + $msg = ''; + if ($action == "update") { + $contact_note_uuid = check_str($_POST["contact_note_uuid"]); + } //check for all required data if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {