本文整理汇总了PHP中MailTemplate::setAddressFieldsEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP MailTemplate::setAddressFieldsEnabled方法的具体用法?PHP MailTemplate::setAddressFieldsEnabled怎么用?PHP MailTemplate::setAddressFieldsEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MailTemplate
的用法示例。
在下文中一共展示了MailTemplate::setAddressFieldsEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: emailAuthor
/**
* Display the "email author" form
* @param $args array
* @param $request Request
*/
function emailAuthor($args, &$request)
{
$router =& $request->getRouter();
$this->setupTemplate();
$articleId = isset($args[0]) ? $args[0] : 0;
$galleyId = isset($args[1]) ? (int) $args[1] : 0;
$this->validate($request, $articleId, $galleyId);
$journal =& $router->getContext($request);
$article =& $this->article;
$rtDao =& DAORegistry::getDAO('RTDAO');
$journalRt =& $rtDao->getJournalRTByJournal($journal);
$user =& $request->getUser();
if (!$journalRt || !$journalRt->getEmailAuthor() || !$user) {
$request->redirect(null, $router->getRequestedPage($request));
}
import('classes.mail.MailTemplate');
$email = new MailTemplate();
$email->setAddressFieldsEnabled(false);
if ($request->getUserVar('send') && !$email->hasErrors()) {
$authors =& $article->getAuthors();
$author =& $authors[0];
$email->addRecipient($author->getEmail(), $author->getFullName());
$email->send();
$templateMgr =& TemplateManager::getManager();
$templateMgr->display('rt/sent.tpl');
} else {
if (!$request->getUserVar('continued')) {
$email->setSubject('[' . $journal->getLocalizedSetting('initials') . '] ' . strip_tags($article->getLocalizedTitle()));
}
$email->displayEditForm($router->url($request, null, null, 'emailAuthor', array($articleId, $galleyId)), null, 'rt/email.tpl', array('op' => 'emailAuthor'));
}
}
示例2: remindUserMeeting
/**
* Remind reviewers of a meeting
* Added by ayveemallare 7/12/2011
* Moved from sectionEditorAction by EL on March 5th
*/
function remindUserMeeting($meeting, $addresseeId, $mSectionDecisions, $send = false)
{
$journal =& Request::getJournal();
$user =& Request::getUser();
$sectionDecisionDao =& DAORegistry::getDAO('SectionDecisionDAO');
$submissions = (string) '';
$num = 1;
foreach ($mSectionDecisions as $mSectionDecision) {
$sectionDecision = $sectionDecisionDao->getSectionDecision($mSectionDecision->getSectionDecisionId());
$submissions .= $num . ". '" . $sectionDecision->getLocalizedProposalTitle() . "' " . Locale::translate('common.bySomebody') . ' ' . $sectionDecision->getAuthorString(true) . "\n";
$num++;
}
$userDao =& DAORegistry::getDAO('UserDAO');
$addressee = $userDao->getUser($addresseeId);
$reviewerAccessKeysEnabled = $journal->getSetting('reviewerAccessKeysEnabled');
$preventAddressChanges = $reviewerAccessKeysEnabled;
import('classes.mail.MailTemplate');
$email = new MailTemplate('MEETING_REMIND');
if ($preventAddressChanges) {
$email->setAddressFieldsEnabled(false);
}
if ($send && !$email->hasErrors()) {
HookRegistry::call('MeetingAction::remindUserMeeting', array(&$meeting, &$addressee, &$submissions, &$email));
// EL on February 26th 2013
// Replaced "reviewerAccessKyesEnabled" by "reviewerAccessKeysEnabled"
if ($reviewerAccessKeysEnabled) {
import('lib.pkp.classes.security.AccessKeyManager');
import('pages.reviewer.ReviewerHandler');
$accessKeyManager = new AccessKeyManager();
}
if ($preventAddressChanges) {
// Ensure that this messages goes to the reviewers, and the reviewers ONLY.
$email->clearAllRecipients();
$email->addRecipient($addressee->getEmail(), $addressee->getFullName());
}
$email->send();
$meetingAttendanceDao =& DAORegistry::getDAO('MeetingAttendanceDAO');
$meetingAttendanceDao->updateDateReminded(Core::getCurrentDate(), $addresseeId, $meeting);
return true;
} else {
if (!Request::getUserVar('continued') || $preventAddressChanges) {
$email->addRecipient($addressee->getEmail(), $addressee->getFullName());
}
if (!Request::getUserVar('continued')) {
$dateLocation = (string) '';
if ($meeting->getDate() != null) {
$dateLocation .= Locale::translate('editor.reports.meetingDate') . ': ' . strftime('%B %d, %Y %I:%M %p', strtotime($meeting->getDate())) . "\n";
}
if ($meeting->getLength() != null) {
$dateLocation .= Locale::translate('editor.meeting.length') . ': ' . $meeting->getLength() . "mn\n";
}
if ($meeting->getLocation() != null) {
$dateLocation .= Locale::translate('editor.meeting.location') . ': ' . $meeting->getLocation() . "\n";
}
$dateLocation .= Locale::translate('editor.meeting.numberOfProposalsToReview') . ': ' . count($mSectionDecisions) . "\n";
$meetingAttendanceDao =& DAORegistry::getDAO('MeetingAttendanceDAO');
$type = $meetingAttendanceDao->getTypeOfUser($meeting->getId(), $addressee->getId());
$replyUrl = (string) '';
if ($type == MEETING_INVESTIGATOR) {
$urlFirst = true;
foreach ($mSectionDecisions as $mSectionDecision) {
$sectionDecision = $sectionDecisionDao->getSectionDecision($mSectionDecision->getSectionDecisionId());
if ($urlFirst) {
$replyUrl .= Request::url(null, 'author', 'submission', array($sectionDecision->getArticleId(), 'submissionReview'));
$urlFirst = false;
} else {
$replyUrl .= ' ' . Locale::translate("common.or") . ': ' . Request::url(null, 'author', 'submission', array($sectionDecision->getArticleId(), 'submissionReview'));
}
}
} elseif ($type == MEETING_SECRETARY) {
$replyUrl = Request::url(null, 'sectionEditor', 'viewMeeting', $meeting->getId());
} elseif ($type == MEETING_EXTERNAL_REVIEWER || $type == MEETING_ERC_MEMBER) {
$replyUrl = Request::url(null, 'reviewer', 'viewMeeting', $meeting->getId(), $reviewerAccessKeysEnabled ? array('key' => 'ACCESS_KEY') : array());
} else {
return false;
}
$replyUrl = Request::url(null, 'reviewer', 'viewMeeting', $meeting->getId(), $reviewerAccessKeysEnabled ? array('key' => 'ACCESS_KEY') : array());
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$erc =& $sectionDao->getSection($meeting->getUploader());
$paramArray = array('ercTitle' => $erc->getLocalizedTitle(), 'addresseeFullName' => $addressee->getFullName(), 'submissions' => $submissions, 'dateLocation' => $dateLocation, 'replyUrl' => $replyUrl, 'secretaryName' => $user->getFullName(), 'secretaryFunctions' => $user->getErcFunction($meeting->getUploader()));
$email->assignParams($paramArray);
}
// EL on February 26th 2013
// Replaced submissionsIds by submissionIds
// + moved the paramters as additional parameters
$email->displayEditForm(Request::url(null, null, 'remindUserMeeting', array($meeting->getId(), $addresseeId)));
return false;
}
return true;
}