Skip to content

Commit

Permalink
doc(MailMgr) function headers and some whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed Apr 4, 2023
1 parent f8f34bc commit 56b5d8c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion modules/MailManager/src/connectors/Connector.php
Expand Up @@ -401,7 +401,7 @@ public function getFolderList() {
if (is_array($list)) {
foreach ($list as $val) {
$folder = $this->convertCharacterEncoding($val, 'ISO-8859-1', 'UTF7-IMAP'); //Decode folder name
$folderList[] = preg_replace("/{(.*?)}/", "", $folder);
$folderList[] = preg_replace('/{(.*?)}/', '', $folder);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/MailManager/src/controllers/RelationController.php
Expand Up @@ -226,7 +226,7 @@ public function process(MailManager_Request $request) {
* Returns the Parent for Tickets module
* @global Users Instance $current_user
* @param integer $parent - crmid of Parent
* @param Email Address $from - Email Address of the received mail
* @param array Email Address of the received mail
* @return integer - Parent(crmid)
*/
public function setParentForHelpDesk($parent, $from) {
Expand Down
86 changes: 43 additions & 43 deletions modules/MailManager/src/models/Message.php
Expand Up @@ -15,33 +15,33 @@ class MailManager_Model_Message extends Vtiger_MailRecord {

/**
* Sets the Imap connection
* @var String
* @var string
*/
protected $mBox;

/**
* Marks the mail Read/UnRead
* @var Boolean
* @var boolean
*/
protected $mRead = false;

/**
* Sets the Mail Message Number
* @var Integer
* @var integer
*/
protected $mMsgNo;

/**
* Sets the Mail Unique Number
* @var Integer
* @var integer
*/
protected $mUid;

/**
* Constructor which gets the Mail details from the server
* @param string $mBox - Mail Box Connection string
* @param Integer $msgno - Mail Message Number
* @param Boolean $fetchbody - Used to save the mail information to DB
* @param integer $msgno - Mail Message Number
* @param boolean $fetchbody - Used to save the mail information to DB
*/
public function __construct($mBox = false, $msgno = false, $fetchbody = false) {
if ($mBox && $msgno) {
Expand Down Expand Up @@ -72,9 +72,9 @@ public function __construct($mBox = false, $msgno = false, $fetchbody = false) {
/**
* Gets the Mail Body and Attachments
* @param string $imap - Mail Box connection string
* @param Integer $messageid - Mail Number
* @param Object $p
* @param Integer $partno
* @param integer $messageid - Mail Number
* @param object $p
* @param integer $partno
*/
// Modified: http://in2.php.net/manual/en/function.imap-fetchstructure.php#85685
public function __getpart($imap, $messageid, $p, $partno) {
Expand Down Expand Up @@ -157,7 +157,7 @@ public function __getpart($imap, $messageid, $p, $partno) {
* Clears the cache data
* @global PearDataBase Instance $adb
* @global Users Instance $current_user
* @param Integer $waybacktime
* @param integer $waybacktime
*/
public static function pruneOlderInDB($waybacktime) {
global $adb, $current_user;
Expand All @@ -173,7 +173,7 @@ public static function pruneOlderInDB($waybacktime) {
* Used to remove the saved attachments
* @global Users Instance $current_user
* @global PearDataBase Instance $adb
* @param Integer $waybacktime - timestamp
* @param integer $waybacktime - timestamp
*/
public static function removeSavedAttachmentFiles($waybacktime) {
global $current_user, $adb;
Expand All @@ -199,8 +199,8 @@ public static function removeSavedAttachmentFiles($waybacktime) {
* Reads the Mail information from the Database
* @global PearDataBase Instance $adb
* @global User Instance $current_user
* @param Integer $uid
* @return Boolean
* @param integer $uid
* @return boolean
*/
public function readFromDB($uid) {
global $adb, $current_user;
Expand Down Expand Up @@ -235,8 +235,8 @@ public function readFromDB($uid) {
* Loads the Saved Attachments from the DB
* @global PearDataBase Instance$adb
* @global Users Instance $current_user
* @global Array $upload_badext - List of bad extensions
* @param Boolean $withContent - Used to load the Attachments with/withoud content
* @global array $upload_badext - List of bad extensions
* @param boolean $withContent - Used to load the Attachments with/withoud content
* @param string $aName - Attachment Name
*/
protected function loadAttachmentsFromDB($withContent, $aName = false) {
Expand Down Expand Up @@ -286,8 +286,8 @@ protected function loadAttachmentsFromDB($withContent, $aName = false) {
* Save the Mail information to DB
* @global PearDataBase Instance $adb
* @global Users Instance $current_user
* @param Integer $uid - Mail Unique Number
* @return Boolean
* @param integer $uid - Mail Unique Number
* @return boolean
*/
protected function saveToDB($uid) {
global $adb, $current_user;
Expand Down Expand Up @@ -343,10 +343,10 @@ protected function saveToDB($uid) {
* Save the Mail Attachments to DB
* @global PearDataBase Instance $adb
* @global Users Instance $current_user
* @global Array $upload_badext
* @global array $upload_badext
* @param string $filename - name of the file
* @param Text $filecontent
* @return Array with attachment information
* @param string $filecontent
* @return array with attachment information
*/
public function __SaveAttachmentFile($filename, $filecontent) {
require_once 'modules/Settings/MailScanner/core/MailAttachmentMIME.php';
Expand Down Expand Up @@ -381,9 +381,9 @@ public function __SaveAttachmentFile($filename, $filecontent) {

/**
* Gets the Mail Attachments
* @param Boolean $withContent
* @param boolean $withContent
* @param string $aName
* @return List of Attachments
* @return array of Attachments
*/
public function attachments($withContent = true, $aName = false) {
$this->loadAttachmentsFromDB($withContent, $aName);
Expand All @@ -392,8 +392,8 @@ public function attachments($withContent = true, $aName = false) {

/**
* Gets the Mail Subject
* @param Boolean $safehtml
* @return String
* @param boolean $safehtml
* @return string
*/
public function subject($safehtml = true) {
if ($safehtml) {
Expand All @@ -412,17 +412,17 @@ public function setSubject($subject) {

/**
* Gets the Mail Body
* @param Boolean $safehtml
* @return String
* @param boolean $safehtml
* @return string
*/
public function body($safehtml = true) {
return $this->getBodyHTML($safehtml);
}

/**
* Gets the Mail Body
* @param Boolean $safehtml
* @return String
* @param boolean $safehtml
* @return string
*/
public function getBodyHTML($safehtml = true) {
$bodyhtml = parent::getBodyHTML();
Expand All @@ -434,7 +434,7 @@ public function getBodyHTML($safehtml = true) {

/**
* Gets the Mail From
* @param Integer $maxlen
* @param integer $maxlen
* @return string
*/
public function from($maxlen = 0) {
Expand All @@ -447,7 +447,7 @@ public function from($maxlen = 0) {

/**
* Sets the Mail From Email Address
* @param Email $from
* @param string Email from
*/
public function setFrom($from) {
$mailFrom = str_replace('_', ' ', $from);
Expand All @@ -456,47 +456,47 @@ public function setFrom($from) {

/**
* Gets the Mail To Email Addresses
* @return Email(s)
* @return string Email(s)
*/
public function to() {
return $this->_to;
}

/**
* Gets the Mail To Email Addresses
* @return Email(s)
* @return string Email(s)
*/
public function replyto() {
return $this->_reply_to;
}

/**
* Gets the Mail CC Email Addresses
* @return Email(s)
* @return string Email(s)
*/
public function cc() {
return $this->_cc;
}

/**
* Gets the Mail BCC Email Addresses
* @return Email(s)
* @return string Email(s)
*/
public function bcc() {
return $this->_bcc;
}

/**
* Gets the Mail Unique Identifier
* @return String
* @return string
*/
public function uniqueid() {
return $this->_uniqueid;
}

/**
* Gets the Mail Unique Number
* @return Integer
* @return integer
*/
public function muid() {
// unique message sequence id = imap_uid($msgno)
Expand All @@ -505,7 +505,7 @@ public function muid() {

/**
* Gets the Mail Date
* @param Boolean $format
* @param boolean $format
* @return Date
*/
public function date($format = false) {
Expand Down Expand Up @@ -537,40 +537,40 @@ public function setDate($date) {

/**
* Checks if the Mail is read
* @return Boolean
* @return boolean
*/
public function isRead() {
return $this->mRead;
}

/**
* Sets if the Mail is read
* @param Boolean $read
* @param boolean $read
*/
public function setRead($read) {
$this->mRead = $read;
}

/**
* Gets the Mail Message Number
* @param Integer $offset
* @return Integer
* @param integer $offset
* @return integer
*/
public function msgNo($offset = 0) {
return $this->mMsgNo + $offset;
}

/**
* Sets the Mail Message Number
* @param Integer $msgno
* @param integer $msgno
*/
public function setMsgNo($msgno) {
$this->mMsgNo = $msgno;
}

/**
* Sets the Mail Headers
* @param Object $result
* @param object $result
* @return self
*/
public static function parseOverview($result) {
Expand Down

0 comments on commit 56b5d8c

Please sign in to comment.