$newCvStatus = $_GET['cvStatus']; $oldCvStatus = $_GET['oldCvStatus']; //echo '$oldCvStatus=\'', $oldCvStatus, "'<br>\n"; //echo '$newCvStatus=\'', $newCvStatus, "'<br>\n"; $contactProfileObjectID = $_GET['profileObjectId'] + 0; $contactProfileID = $_GET['profileId'] + 0; $contactUseID = $_GET['contactUseId'] + 0; $contactManager = new ContactManager($domainID, $userID); $contactProfile = new ContactProfile(); $contactProfile->Get($contactProfileID); $emailBody = ""; //echo "newCvStatus={$newCvStatus}, oldCvStatus={$oldCvStatus}, " . strcmp($newCvStatus, $oldCvStatus) . "<br>\n"; if ($newCvStatus == "DeleteFromAll") { // We need to delete any reference to this contact value ID // regardless of contact profile or use. $contactManager->DeleteContactValue($contactValueID); $emailBody = "User " . $userObject->fullName() . " of " . $userObject->Domains(0)->description() . " deleted the " . $cvsType->Description() . " " . $cvType->Description() . " contact of " . $oldContactValue . " for all uses and all contact profiles at " . date("H:i:s") . " on " . date("l, F j, Y"); } elseif ($newCvStatus == "DeleteFromUse") { // We need to delete the reference to this contact value ID // from this contact profile for this use. $contactProfile->Delete(); $emailBody = "User " . $userObject->fullName() . " of " . $userObject->Domains(0)->description() . " deleted the " . $cvsType->Description() . " " . $cvType->Description() . " contact of " . $oldContactValue . " for the contact use of " . $contactProfile->contactUse()->description() . " at " . date("H:i:s") . " on " . date("l, F j, Y") . ".\n\nThe affected contact profile is " . $contactProfile->object()->description(); } elseif ($newCvStatus != $oldCvStatus) { if ($newCvStatus == "InactiveForAll") { // We need to inactivate the contact value record for this // contact value ID. $contactValue = new ContactValue(); $contactValue->Get($contactValueID); $contactValue->isInactive(true); $contactValue->Put($userID); $emailBody = "User " . $userObject->fullName() . " of " . $userObject->Domains(0)->description() . " inactivated the " . $cvsType->Description() . " " . $cvType->Description() . " contact of " . $oldContactValue . " for all uses and all contact profiles at " . date("H:i:s") . " on " . date("l, F j, Y");