예제 #1
0
 $dptPhone = $_GET['dptPhone'] + 0;
 // We have the particulars.  We need to verify that the owner name is new.  If
 // it is not, we will retrieve the OwnerNameID from the database to be used with
 // the contact value.
 $contactManager = new ContactManager($domainID, $userID);
 $cvTypes = $contactManager->GetContactValueTypes();
 $priority = new Priority();
 $priority->Get($priorityID);
 /*
 echo '$dpoEmail=\'',$dpoEmail,"'<br>\n";
 echo '$cvTypes[$cvTypeID]->name()=\'', $cvTypes[$cvTypeID]->name(), "'<br>\n";
 echo '$priority->level()=\'', $priority->level(), "'<br>\n";
 */
 // mcb 2010.06.03
 // need to identify to which profile the error message belongs.
 if ($dpoEmail && $cvTypes[$cvTypeID]->name() == "email" && $priority->level() == 1) {
     $errorMessage[$contactProfileObjectID] = '<div class="error" style="width: 700px;">You cannot add a primary email contact to this profile before lowering the priority of the existing primary email contact.</div><br />' . "\n";
     print viewProfiles($userID, $domainID, $errorMessage);
 } elseif ($dptEmail && $cvTypes[$cvTypeID]->name() == "email" && $priority->level() == 2) {
     $errorMessage[$contactProfileObjectID] = '<div class="error" style="width: 700px;">You cannot add a secondary email contact to this profile before lowering the priority of the existing secondary email contact.</div><br />' . "\n";
     print viewProfiles($userID, $domainID, $errorMessage);
 } elseif ($dpoPhone && $cvTypes[$cvTypeID]->name() == "phone" && $priority->level() == 1) {
     $errorMessage[$contactProfileObjectID] = '<div class="error" style="width: 700px;">You cannot add a primary phone contact to this profile before lowering the priority of the existing primary phone contact.</div><br />' . "\n";
     print viewProfiles($userID, $domainID, $errorMessage);
 } elseif ($dptPhone && $cvTypes[$cvTypeID]->name() == "phone" && $priority->level() == 2) {
     $errorMessage[$contactProfileObjectID] = '<div class="error" style="width: 700px;">You cannot add a secondary phone contact to this profile before lowering the priority of the existing secondary phone contact.</div><br />' . "\n";
     print viewProfiles($userID, $domainID, $errorMessage);
 } else {
     // We have an owner name, so we will look it up or create it.
     $owner = new ContactOwner();
     $ownerID = $owner->Get($ownerName);