當前位置: 首頁>>代碼示例>>PHP>>正文


PHP InboundEmail::getCaseIdFromCaseNumber方法代碼示例

本文整理匯總了PHP中InboundEmail::getCaseIdFromCaseNumber方法的典型用法代碼示例。如果您正苦於以下問題:PHP InboundEmail::getCaseIdFromCaseNumber方法的具體用法?PHP InboundEmail::getCaseIdFromCaseNumber怎麽用?PHP InboundEmail::getCaseIdFromCaseNumber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在InboundEmail的用法示例。


在下文中一共展示了InboundEmail::getCaseIdFromCaseNumber方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testShouldNotQuery

 /**
  * @param $emailName
  * @dataProvider shouldNotQueryProvider
  */
 public function testShouldNotQuery($emailName)
 {
     $db = $this->getMockForAbstractClass('DBManager');
     $db->expects($this->never())->method('query');
     $ie = new InboundEmail();
     $ie->db = $db;
     $ie->getCaseIdFromCaseNumber($emailName, $this->case);
 }
開發者ID:delkyd,項目名稱:sugarcrm_dev,代碼行數:12,代碼來源:Bug63989Test.php

示例2: email2Send


//.........這裏部分代碼省略.........
         if (isset($_REQUEST['ieId']) && isset($_REQUEST['mbox'])) {
             $emailFromIe = new InboundEmail();
             $emailFromIe->retrieve($_REQUEST['ieId']);
             $emailFromIe->mailbox = $_REQUEST['mbox'];
             if (isset($emailFromIe->id) && $emailFromIe->is_personal) {
                 if ($emailFromIe->isPop3Protocol()) {
                     $emailFromIe->mark_answered($this->uid, 'pop3');
                 } elseif ($emailFromIe->connectMailserver() == 'true') {
                     $emailFromIe->markEmails($this->uid, 'answered');
                     $emailFromIe->mark_answered($this->uid);
                 }
             }
         }
     }
     if ($forceSave || $this->type == 'draft' || isset($request['saveToSugar']) && $request['saveToSugar'] == 1) {
         // saving a draft OR saving a sent email
         $decodedFromName = mb_decode_mimeheader($mail->FromName);
         $this->from_addr = "{$decodedFromName} <{$mail->From}>";
         $this->from_addr_name = $this->from_addr;
         $this->to_addrs = $_REQUEST['sendTo'];
         $this->to_addrs_names = $_REQUEST['sendTo'];
         $this->cc_addrs = $_REQUEST['sendCc'];
         $this->cc_addrs_names = $_REQUEST['sendCc'];
         $this->bcc_addrs = $_REQUEST['sendBcc'];
         $this->bcc_addrs_names = $_REQUEST['sendBcc'];
         $this->assigned_user_id = $current_user->id;
         $this->date_sent = $timedate->now();
         ///////////////////////////////////////////////////////////////////
         ////	LINK EMAIL TO SUGARBEANS BASED ON EMAIL ADDY
         if (isset($_REQUEST['parent_type']) && !empty($_REQUEST['parent_type']) && isset($_REQUEST['parent_id']) && !empty($_REQUEST['parent_id'])) {
             $this->parent_id = $_REQUEST['parent_id'];
             $this->parent_type = $_REQUEST['parent_type'];
             $q = "SELECT count(*) c FROM emails_beans WHERE  email_id = '{$this->id}' AND bean_id = '{$_REQUEST['parent_id']}' AND bean_module = '{$_REQUEST['parent_type']}'";
             $r = $this->db->query($q);
             $a = $this->db->fetchByAssoc($r);
             if ($a['c'] <= 0) {
                 if (isset($beanList[$_REQUEST['parent_type']]) && !empty($beanList[$_REQUEST['parent_type']])) {
                     $className = $beanList[$_REQUEST['parent_type']];
                     if (isset($beanFiles[$className]) && !empty($beanFiles[$className])) {
                         if (!class_exists($className)) {
                             require_once $beanFiles[$className];
                         }
                         $bean = new $className();
                         $bean->retrieve($_REQUEST['parent_id']);
                         if ($bean->load_relationship('emails')) {
                             $bean->emails->add($this->id);
                         }
                         // if
                     }
                     // if
                 }
                 // if
             }
             // if
         } else {
             if (!class_exists('aCase')) {
             } else {
                 $c = new aCase();
                 if ($caseId = InboundEmail::getCaseIdFromCaseNumber($mail->Subject, $c)) {
                     $c->retrieve($caseId);
                     $c->load_relationship('emails');
                     $c->emails->add($this->id);
                     $this->parent_type = "Cases";
                     $this->parent_id = $caseId;
                 }
                 // if
             }
         }
         // else
         ////	LINK EMAIL TO SUGARBEANS BASED ON EMAIL ADDY
         ///////////////////////////////////////////////////////////////////
         $this->save();
     }
     if (!empty($request['fromAccount'])) {
         if (isset($ie->id) && !$ie->isPop3Protocol()) {
             $sentFolder = $ie->get_stored_options("sentFolder");
             if (!empty($sentFolder)) {
                 $data = $mail->CreateHeader() . "\r\n" . $mail->CreateBody() . "\r\n";
                 $ie->mailbox = $sentFolder;
                 if ($ie->connectMailserver() == 'true') {
                     $connectString = $ie->getConnectString($ie->getServiceString(), $ie->mailbox);
                     $returnData = imap_append($ie->conn, $connectString, $data, "\\Seen");
                     if (!$returnData) {
                         $GLOBALS['log']->debug("could not copy email to {$ie->mailbox} for {$ie->name}");
                     }
                     // if
                 } else {
                     $GLOBALS['log']->debug("could not connect to mail serve for folder {$ie->mailbox} for {$ie->name}");
                 }
                 // else
             } else {
                 $GLOBALS['log']->debug("could not copy email to {$ie->mailbox} sent folder as its empty");
             }
             // else
         }
         // if
     }
     // if
     return true;
 }
開發者ID:rgauss,項目名稱:sugarcrm_dev,代碼行數:101,代碼來源:Email.php

示例3: testgetCaseIdFromCaseNumber

 public function testgetCaseIdFromCaseNumber()
 {
     $inboundEmail = new InboundEmail();
     $result = $inboundEmail->getCaseIdFromCaseNumber('test', new aCase());
     $this->assertEquals(false, $result);
 }
開發者ID:sacredwebsite,項目名稱:SuiteCRM,代碼行數:6,代碼來源:InboundEmailTest.php

示例4: email2Send


//.........這裏部分代碼省略.........
                 } elseif ($emailFromIe->connectMailserver() == 'true') {
                     $emailFromIe->markEmails($this->uid, 'answered');
                     $emailFromIe->mark_answered($this->uid);
                 }
             }
         }
     }
     if ($forceSave || $this->type == 'draft' || $this->type == 'archived' || isset($request['saveToSugar']) && $request['saveToSugar'] == 1) {
         // Set Up From Name and Address Information
         if ($this->type == 'archived') {
             $this->from_addr = empty($request['archive_from_address']) ? '' : $request['archive_from_address'];
         } elseif (!empty($mailConfig)) {
             $sender = $mailConfig->getFrom();
             $decodedFromName = mb_decode_mimeheader($sender->getName());
             $this->from_addr = "{$decodedFromName} <" . $sender->getEmail() . ">";
         } else {
             $ret = $current_user->getUsersNameAndEmail();
             if (empty($ret['email'])) {
                 $systemReturn = $current_user->getSystemDefaultNameAndEmail();
                 $ret['email'] = $systemReturn['email'];
                 $ret['name'] = $systemReturn['name'];
             }
             $decodedFromName = mb_decode_mimeheader($ret['name']);
             $this->from_addr = "{$decodedFromName} <" . $ret['email'] . ">";
         }
         $this->from_addr_name = $this->from_addr;
         $this->to_addrs = $_REQUEST['sendTo'];
         $this->to_addrs_names = $_REQUEST['sendTo'];
         $this->cc_addrs = $_REQUEST['sendCc'];
         $this->cc_addrs_names = $_REQUEST['sendCc'];
         $this->bcc_addrs = $_REQUEST['sendBcc'];
         $this->bcc_addrs_names = $_REQUEST['sendBcc'];
         $this->team_id = isset($_REQUEST['primaryteam']) ? $_REQUEST['primaryteam'] : $current_user->getPrivateTeamID();
         $teamSet = BeanFactory::getBean('TeamSets');
         $teamIdsArray = isset($_REQUEST['teamIds']) ? explode(",", $_REQUEST['teamIds']) : array($current_user->getPrivateTeamID());
         $this->team_set_id = $teamSet->addTeams($teamIdsArray);
         $this->assigned_user_id = $current_user->id;
         $this->date_sent = $timedate->now();
         ///////////////////////////////////////////////////////////////////
         ////	LINK EMAIL TO SUGARBEANS BASED ON EMAIL ADDY
         if (!empty($_REQUEST['parent_type']) && !empty($_REQUEST['parent_id'])) {
             $this->parent_id = $this->db->quote($_REQUEST['parent_id']);
             $this->parent_type = $this->db->quote($_REQUEST['parent_type']);
             $a = $this->db->fetchOne("SELECT count(*) c FROM emails_beans WHERE  email_id = '{$this->id}' AND bean_id = '{$this->parent_id}' AND bean_module = '{$this->parent_type}'");
             if ($a['c'] == 0) {
                 $bean = BeanFactory::getBean($_REQUEST['parent_type'], $_REQUEST['parent_id']);
                 if (!empty($bean)) {
                     if (!empty($bean->field_defs['emails']['type']) && $bean->field_defs['emails']['type'] == 'link') {
                         $email_link = "emails";
                     } else {
                         $email_link = $this->findEmailsLink($bean);
                     }
                     if ($email_link && $bean->load_relationship($email_link)) {
                         $bean->{$email_link}->add($this);
                     }
                 }
             }
             // if
         } else {
             $c = BeanFactory::getBean('Cases');
             if ($caseId = InboundEmail::getCaseIdFromCaseNumber($subject, $c)) {
                 $c->retrieve($caseId);
                 $c->load_relationship('emails');
                 $c->emails->add($this->id);
                 $this->parent_type = "Cases";
                 $this->parent_id = $caseId;
             }
             // if
         }
         // else
         ////	LINK EMAIL TO SUGARBEANS BASED ON EMAIL ADDY
         ///////////////////////////////////////////////////////////////////
         $this->save();
     }
     /**** --------------------------------- ?????????
     		if(!empty($request['fromAccount'])) {
                 $ie = new InboundEmail();
                 $ie->retrieve($request['fromAccount']);
     			if (isset($ie->id) && !$ie->isPop3Protocol() && $mail->oe->mail_smtptype != 'gmail') {
     				$sentFolder = $ie->get_stored_options("sentFolder");
     				if (!empty($sentFolder)) {
     					$data = $mail->CreateHeader() . "\r\n" . $mail->CreateBody() . "\r\n";
     					$ie->mailbox = $sentFolder;
     					if ($ie->connectMailserver() == 'true') {
     						$connectString = $ie->getConnectString($ie->getServiceString(), $ie->mailbox);
     						$returnData = imap_append($ie->conn,$connectString, $data, "\\Seen");
     						if (!$returnData) {
     							$GLOBALS['log']->debug("could not copy email to {$ie->mailbox} for {$ie->name}");
     						} // if
     					} else {
     						$GLOBALS['log']->debug("could not connect to mail serve for folder {$ie->mailbox} for {$ie->name}");
     					} // else
     				} else {
     					$GLOBALS['log']->debug("could not copy email to {$ie->mailbox} sent folder as its empty");
     				} // else
     			} // if
     		} // if
             ------------------------------------- ****/
     return true;
 }
開發者ID:jglaine,項目名稱:sugar761-ent,代碼行數:101,代碼來源:Email.php


注:本文中的InboundEmail::getCaseIdFromCaseNumber方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。