mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Update the remaining logic to take advantage of the moved contact_primary and contact_location fields
This commit is contained in:
@@ -21,11 +21,7 @@ if (isset($_POST['add_contact'])) {
|
||||
$contact_id = mysqli_insert_id($mysqli);
|
||||
|
||||
//Update Primary contact in clients if primary contact is checked
|
||||
if ($contact_primary == 1) {
|
||||
// Old way of adding contact_primary Set for Removal
|
||||
mysqli_query($mysqli,"UPDATE clients SET primary_contact = $contact_id WHERE client_id = $client_id");
|
||||
|
||||
// New Way of setting primary contact
|
||||
if ($contact_primary == 1) {
|
||||
mysqli_query($mysqli,"UPDATE contacts SET contact_primary = 0 WHERE contact_client_id = $client_id");
|
||||
mysqli_query($mysqli,"UPDATE contacts SET contact_primary = 1, contact_important = 1 WHERE contact_id = $contact_id");
|
||||
}
|
||||
@@ -80,9 +76,6 @@ if (isset($_POST['edit_contact'])) {
|
||||
|
||||
// Update Primary contact in clients if primary contact is checked
|
||||
if ($contact_primary == 1) {
|
||||
// Old way of adding contact_primary Set for Removal
|
||||
mysqli_query($mysqli,"UPDATE clients SET primary_contact = $contact_id WHERE client_id = $client_id");
|
||||
|
||||
mysqli_query($mysqli,"UPDATE contacts SET contact_primary = 0 WHERE contact_client_id = $client_id");
|
||||
mysqli_query($mysqli,"UPDATE contacts SET contact_primary = 1, contact_important = 1 WHERE contact_id = $contact_id");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user