public function setActiveInactiveTag($iduser, $idcontact)
 {
     $phil_iduser = "******";
     $login_status = $this->GetUserLoginStatus($iduser);
     $do_contact_view = new ContactView();
     $do_contact_view->setUser($phil_iduser);
     $do_tag = new TagInternalMarketing();
     if ($login_status == "Active") {
         $do_contact_view->deleteTag("Inactive", $idcontact);
         $do_contact_view->addTag("Active", $idcontact);
         $do_tag->deleteContactTag("Inactive", $phil_iduser, $idcontact);
         $do_tag->setContactTag("Active", $phil_iduser, $idcontact);
     }
     if ($login_status == "Inactive") {
         $do_contact_view->deleteTag("Active", $idcontact);
         $do_contact_view->addTag("Inactive", $idcontact);
         $do_tag->deleteContactTag("Active", $phil_iduser, $idcontact);
         $do_tag->setContactTag("Inactive", $phil_iduser, $idcontact);
     }
 }
Пример #2
0
 /**
   Method to delete tags from multiple contacts
   Reset the query to NULL if no more tag found by the same, otherwise searching by tag and 
   then deleting will result error due to the query in the session
 */
 function eventDeleteMultipleContactsTag(EventControler $evtcl)
 {
     $tagname = $evtcl->delTagMul;
     $contacts = $evtcl->getParam("ck");
     if ($tagname != '') {
         $do_tag = new Tag();
         $contact_view = new ContactView();
         foreach ($contacts as $idcontact) {
             $contact_view->getId($idcontact);
             $contact_view->deleteTag($tagname);
             $idtag = $do_tag->isTagExistsForReferer($tagname, $idcontact);
             $do_tag->delTagById($idtag);
         }
         $q = new sqlQuery($this->getDbCon());
         $q->query("select * from tag where tag_name = '" . trim($tagname) . "' AND iduser = "******"");
         }
         $contact_view->free();
         // When deleting contact by uisng search by tag and if all the contacts are deleted then we must set the query as empty
         $this->query($this->getSqlQuery());
         if ($this->getNumRows() == 0) {
             $this->clearSearch();
             $this->setSqlQuery("");
         }
     }
     $_SESSION['tag_refresh_now'] = true;
 }
    }
    $do_cont_note = new ContactNotes();
    $do_cont_note->addNew();
    $do_cont_note->idcontact = $idcontact;
    $do_cont_note->note = $firstname . " " . $lastname . " has unsubscribed from the autoresponder series called " . $responder;
    $do_cont_note->date_added = date("Y-m-d");
    $do_cont_note->iduser = $iduser;
    $do_cont_note->add();
    $do_workfeed_uns = new WorkFeedContactUnsubscibeEmails();
    $do_workfeed_uns->addUnsubscribeEmailWorkfeed($do_cont_note, $responder);
    $q = new sqlQuery($GLOBALS['conx']);
    $sql = "DELETE FROM `tag` WHERE iduser={$iduser} AND idreference={$idcontact} AND idtag={$idtag}";
    $q->query($sql);
    $do_contact_view = new ContactView();
    $do_contact_view->setUser($iduser);
    $do_contact_view->deleteTag($do_tag->tag_name, $idcontact);
    //$message = $firstname." ".$lastname.' '._('you have successfully unsubscribed from the autoresponder series called').' '.$responder;
    $message = 'unsub_list_message';
    $data = array("firstname" => $firstname, "lastname" => $lastname, "responder" => $responder);
    $do_contact->sendMessage(new EmailTemplate("unsubscribe_auto_responder"), $data);
} else {
    $message = 'already_unsub_from_list';
}
//header("Location: http://ofuz.com");
//exit();
?>
<div class="loginbg1">
    <!--<div class="loginheader"><a href="/index.php"><img src="/images/ofuz_logo2.jpg" width="170" height="90" alt="" /></a></div>-->
    <div style = "width:500px;margin: 0 auto; padding: 10px; text-align:left;">
        <?php 
if ($message != '') {
Пример #4
0
 /**
  * Function to delete tags for a contact which is shared
  * @param object $Obj , holding the tag data
  */
 function deleteTagShared($Obj)
 {
     $do_contact_sharing = new ContactSharing();
     $do_contact_view = new ContactView();
     $shared_co_workers = $do_contact_sharing->selectAllUsersFromContactSharing($Obj->idreference);
     //print_r($shared_co_workers);exit;
     if ($shared_co_workers !== false) {
         $q = new sqlQuery($this->getDbCon());
         foreach ($shared_co_workers as $user) {
             if ($Obj->iduser != $user) {
                 $idtag = $this->isTagExistsForReferer($Obj->tag_name, $Obj->idreference, $user, $Obj->reference_type);
                 //echo $Obj->tag_name.'----'.$Obj->idcontact.'----'.$Obj->reference_type.'---'.$user;exit;
                 if ($idtag !== false) {
                     $q->query("delete from " . $this->table . " where idtag = " . $idtag . " limit 1 ");
                     $do_contact_view->setUser($user);
                     $do_contact_view->deleteTag($Obj->tag_name, $Obj->idreference);
                 }
             }
         }
     }
 }