本文整理匯總了PHP中Vtiger_Functions::getMergedDescription方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Functions::getMergedDescription方法的具體用法?PHP Vtiger_Functions::getMergedDescription怎麽用?PHP Vtiger_Functions::getMergedDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Vtiger_Functions
的用法示例。
在下文中一共展示了Vtiger_Functions::getMergedDescription方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getMergedDescription
/**
* This function is used to merge the Template Details with the email description
* @param string $description -body of the mail(ie template)
* @param integer $tid - Id of the entity
* @param string $parent_type - module of the entity
* return string $description - Returns description, merged with the input template.
*/
function getMergedDescription($description, $id, $parent_type)
{
return Vtiger_Functions::getMergedDescription($description, $id, $parent_type);
}
示例2: handleTask
/**
* @param $context \Workflow\VTEntity
* @return mixed
*/
public function handleTask(&$context)
{
global $adb, $current_user;
global $current_language;
if (defined("WF_DEMO_MODE") && constant("WF_DEMO_MODE") == true) {
return "yes";
}
if (!class_exists("Workflow_PHPMailer")) {
require_once "modules/Workflow2/phpmailer/class.phpmailer.php";
}
#$result = $adb->query("select user_name, email1, email2 from vtiger_users where id=1");
#$from_email = "swarnat@praktika.de";
#$from_name = "Stefan Warnat";
$module = $context->getModuleName();
$et = new \Workflow\VTTemplate($context);
$to_email = $et->render(trim($this->get("recepient")), ",");
#
$connected = $this->getConnectedObjects("Absender");
if (count($connected) > 0) {
$from_name = trim($connected[0]->get("first_name") . " " . $connected[0]->get("last_name"));
$from_email = $connected[0]->get("email1");
} else {
$from_name = $et->render(trim($this->get("from_name")), ",");
#
$from_email = $et->render(trim($this->get("from_mail")), ",");
#
}
$cc = $et->render(trim($this->get("emailcc")), ",");
#
$bcc = $et->render(trim($this->get("emailbcc")), ",");
#
/**
* Connected BCC Objects
* @var $connected
*/
$connected = $this->getConnectedObjects("BCC");
$bccs = $connected->get("email1");
if (count($bccs) > 0) {
$bcc = array($bcc);
foreach ($bccs as $bccTMP) {
$bcc[] = $bccTMP;
}
$bcc = trim(implode(",", $bcc), ",");
}
if (strlen(trim($to_email, " \t\n,")) == 0 && strlen(trim($cc, " \t\n,")) == 0 && strlen(trim($bcc, " \t\n,")) == 0) {
return "yes";
}
$storeid = trim($this->get("storeid", $context));
if (empty($storeid) || $storeid == -1 || !is_numeric($storeid)) {
$storeid = $context->getId();
}
$embeddedImages = array();
$content = $this->get("content");
$subject = $this->get("subject");
#$subject = utf8_decode($subject);
#$content = utf8_encode($content);
$content = html_entity_decode(str_replace(" ", " ", $content), ENT_QUOTES, "UTF-8");
#$subject = html_entity_decode(str_replace(" ", " ", $subject), ENT_QUOTES, "UTF-8");
$subject = $et->render(trim($subject));
$content = $et->render(trim($content));
$mailtemplate = $this->get("mailtemplate");
if (!empty($mailtemplate) && $mailtemplate != -1) {
if (strpos($mailtemplate, 's#') === false) {
$sql = "SELECT * FROM vtiger_emailtemplates WHERE templateid = " . intval($mailtemplate);
$result = $adb->query($sql);
$mailtemplate = $adb->fetchByAssoc($result);
$content = str_replace('$mailtext', $content, html_entity_decode($mailtemplate["body"], ENT_COMPAT, 'UTF-8'));
$content = Vtiger_Functions::getMergedDescription($content, $context->getId(), $context->getModuleName());
} else {
$parts = explode('#', $mailtemplate);
switch ($parts[1]) {
case 'emailmaker':
$templateid = $parts[2];
$sql = 'SELECT body, subject FROM vtiger_emakertemplates WHERE templateid = ?';
$result = $adb->pquery($sql, array($templateid));
$EMAILContentModel = \EMAILMaker_EMAILContent_Model::getInstance($this->getModuleName(), $context->getId(), $current_language, $context->getId(), $this->getModuleName());
$EMAILContentModel->setSubject($adb->query_result($result, 0, 'subject'));
$EMAILContentModel->setBody($adb->query_result($result, 0, 'body'));
$EMAILContentModel->getContent(true);
$embeddedImages = $EMAILContentModel->getEmailImages();
$subject = $EMAILContentModel->getSubject();
$content = $EMAILContentModel->getBody();
break;
}
}
}
#$content = htmlentities($content, ENT_NOQUOTES, "UTF-8");
if (getTabid('Emails') && vtlib_isModuleActive('Emails')) {
require_once 'modules/Emails/Emails.php';
$focus = new Emails();
$focus->column_fields["assigned_user_id"] = \Workflow\VTEntity::getUser()->id;
$focus->column_fields["activitytype"] = "Emails";
$focus->column_fields["date_start"] = date("Y-m-d");
$focus->column_fields["parent_id"] = $storeid;
$focus->column_fields["email_flag"] = "SAVED";
$focus->column_fields["subject"] = $subject;
//.........這裏部分代碼省略.........