本文整理汇总了PHP中User_Model::getEmailAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP User_Model::getEmailAddress方法的具体用法?PHP User_Model::getEmailAddress怎么用?PHP User_Model::getEmailAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_Model
的用法示例。
在下文中一共展示了User_Model::getEmailAddress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rejectFile
public function rejectFile($data)
{
if (is_array($data['files'])) {
foreach ($data['files'] as $file) {
$checkBox[] = array('id' => $file);
}
} else {
$checkBox[] = array('id' => $data['files']);
}
$reviewerComments = 'To= ' . $data['form']['to'] . ';Subject= ' . $data['form']['subject'] . ' ;Comments= ' . $data['form']['comments'];
$date = date('M-d-Y H:i');
$fullName = $this->session->firstName . ' ' . $this->session->lastName;
$reviewerEmail = $this->session->email;
$reviewerPhone = $this->session->phone;
$reviewerDept = $this->userObj->getDeptName();
if ($this->session->admin) {
$idArray = $this->userObj->getAllRevieweeIds();
} else {
$idArray = $this->userObj->getRevieweeIds();
}
foreach ($checkBox as $key => $value) {
// Check to make sure the current file_id is in their list of reviewable ID's
if (in_array($value, $idArray)) {
$fileId = $value['id'];
$newFileObj = new Document_Model($fileId);
$newUserObj = new User_Model($newFileObj->getOwner());
$mailTo = $newUserObj->getEmailAddress();
$deptId = $newFileObj->getDepartment();
if (isset($data['form']['sendToUsers'][0]) && in_array('owner', $data['form']['sendToUsers'])) {
$data['form']['sendToUsers'] = array_slice($data['form']['sendToUsers'], 1);
$emailData = array('reviewer' => $fullName, 'title' => 'Author', 'fileName' => $newFileObj->getRealName(), 'status' => 'Rejected', 'data' => date('l \\t\\h\\e jS'), 'msg' => ' was rejected the document repository.', 'email' => $reviewerEmail, 'siteName' => $this->config->item('site_name'), 'phoneNumber' => $reviewerPhone, 'department' => $reviewerDept, 'comments' => $data['form']['comments']);
$body = $this->load->view('emails/publish_file_email_view', $emailData, true);
$subject = $newFileObj->getRealName() . ' has been rejected by ' . $fullName;
$this->email->setFrom($reviewerEmail, $fullName);
$this->email->addAddress($mailTo, $fullName);
$this->email->Subject = $subject;
$this->email->msgHTML($body);
$this->email->send();
}
$newFileObj->Publishable(-1);
$newFileObj->setReviewerComments($reviewerComments);
AccessLog_Model::addLogEntry($fileId, 'R');
echo json_encode(array('status' => 'success', 'msg' => 'File Status successfully updated.'));
} else {
echo json_encode(array('status' => 'error', 'msg' => 'You cannot alter this files status.'));
exit;
}
}
}
示例2: getFileDetails
//.........这里部分代码省略.........
$reviewer = $fileDataObj->getReviewerName();
$location = $fileDataObj->getLocation();
$fileExt = $fileDataObj->getExt();
$file = $fileDataObj->getBaseName();
$thumbnail = $fileDataObj->getThumbnail();
$lmimetype = File_Model::mimeByExt($fileExt);
$viewFileLink = $this->config->item('dataDir') . $location;
$historyLink = 'history/' . $this->requestId;
$viewInBrowser = null;
$fileUnderReview = $publishable == -1 ? true : false;
$editFileLink = null;
if ($status == 0 && !$publishable && $userPermsObj->canView($this->requestId)) {
$fileUnlocked = true;
} else {
$fileUnlocked = false;
}
if ($status > 0) {
// status != 0 -> file checked out to another user. status = uid of the check-out person
// query to find out who...
$checkoutPersonObj = $fileDataObj->getCheckerOBJ();
$fullName = $checkoutPersonObj->getFullName();
}
switch ($fileExt) {
case 'html':
case 'php':
$viewInBrowser = base_url() . $this->config->item('dataDir') . 'pdf/' . $file . '.pdf';
break;
case 'pdf':
$viewInBrowser = base_url() . $this->config->item('dataDir') . $location;
break;
case 'doc':
case 'docx':
$viewInBrowser = base_url() . $this->config->item('dataDir') . $file . '.pdf';
break;
}
//Get the information for the files revision history
if (!empty($revisionId)) {
$historyResult = $fileDataObj->getRevisionHistory($revisionId);
} else {
$historyResult = $fileDataObj->getCurrentRevision();
}
//get the number of revisions.
$rows = $historyResult->num_rows();
(array) ($fileHistory = null);
foreach ($historyResult->result() as $row) {
$revision = $row->revision;
if (is_file($this->config->item('revisionDir') . $this->requestId . '/' . $this->requestId . "_{$revision}" . '.' . $fileExt)) {
$revision = '<a href="details/' . $this->requestId . "_{$revision}" . '"><div class="revision">' . ($revision + 1) . '</div></a>';
}
$fileHistory[] = array('lastName' => $row->last_name, 'firstName' => $row->first_name, 'modifiedOn' => $row->modified_on, 'note' => $row->note, 'revision' => $revision);
}
if (!is_array($fileHistory)) {
$fileHistory[] = array('lastName' => 'Info', 'firstName' => 'No ', 'modifiedOn' => 'No Info', 'note' => 'No Info', 'revision' => 'No Info');
$revision = '?';
}
// Lets figure out which buttons to show
if ($status == 0 or $status == -1 && $fileDataObj->isOwner($this->session->id)) {
// check if user has modify rights
if ($userPermissionObj->getAuthority($this->requestId, $fileDataObj) >= $this->config->item('WRITE_RIGHT') && !isset($revisionId) && !$archived) {
// if so, display link for checkout
$checkOutLink = site_url() . 'checkout/downloadfile/' . $this->requestId;
$accessRight = 'modify';
switch ($fileExt) {
case 'php':
case 'html':
case 'htm':
$editFileLink = site_url() . 'editor/' . $this->requestId;
break;
default:
break;
}
}
if ($userPermissionObj->getAuthority($this->requestId, $fileDataObj) >= $this->config->item('ADMIN_RIGHT') && !@isset($revisionId) && !$archived) {
if (!$archived) {
$deleteLink = 1;
} else {
$deleteLink = 0;
}
$editLink = site_url() . 'details/editFileDetails/' . $this->requestId;
}
}
// corrections
if ($description == '') {
$description = 'No description available.';
}
if ($comment == '') {
$comment = 'No author comments available.';
}
if ($archived) {
$fileName = $this->config->item('revisionDir') . $location;
$fileSize = $this->globalFunctions->displayFilesize($fileName);
} else {
$fileName = $this->config->item('dataDir') . $location;
if (!isset($fileSize)) {
$fileSize = $this->globalFunctions->displayFilesize($fileName);
}
}
$fileDetail = array('fileUnlocked' => $fileUnlocked, 'realName' => $realName, 'category' => $category, 'fileSize' => $fileSize, 'created' => $this->globalFunctions->fixDate($created), 'ownerEmail' => $userObj->getEmailAddress(), 'owner' => $owner, 'ownerFullname' => $owner, 'description' => wordwrap($description, 50, '<br />'), 'comment' => wordwrap($comment, 50, '<br />'), 'revision' => $revision, 'fileUnderReview' => $fileUnderReview, 'reviewer' => $reviewer, 'status' => $status, 'location' => $location, 'fileInfo' => $lmimetype, 'file' => $file, 'ext' => $fileExt, 'checkOutLink' => $checkOutLink, 'editLink' => $editLink, 'editFileLink' => $editFileLink, 'accessRight' => $accessRight, 'fileHistory' => $fileHistory, 'deleteLink' => $deleteLink, 'viewInBrowser' => $viewInBrowser, 'thumbnail' => $thumbnail);
return json_encode($fileDetail);
}