- renamed class Email to LetoDMS_Email

This commit is contained in:
steinm 2010-11-03 12:33:46 +00:00
parent 69a0fe8f5a
commit 0e30ce6eb3
5 changed files with 82 additions and 82 deletions

View File

@ -122,14 +122,14 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
// if user is not owner send notification to owner
if ($user->getID()!= $this->_ownerID)
Email::toIndividual($user, $this->getOwner(), $subject, $message);
LetoDMS_Email::toIndividual($user, $this->getOwner(), $subject, $message);
$this->_name = $newName;
return true;
@ -157,9 +157,9 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
$this->_comment = $newComment;
@ -228,14 +228,14 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
// if user is not owner send notification to owner
if ($user->getID()!= $this->_ownerID)
Email::toIndividual($user, $this->getOwner(), $subject, $message);
LetoDMS_Email::toIndividual($user, $this->getOwner(), $subject, $message);
return true;
}
@ -270,12 +270,12 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
// Send notification to previous owner.
Email::toIndividual($user, $oldOwner, $subject, $message);
LetoDMS_Email::toIndividual($user, $oldOwner, $subject, $message);
$this->_ownerID = $newOwner->getID();
$this->_owner = $newOwner;
@ -312,9 +312,9 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
$this->_defaultAccess = $mode;
@ -358,9 +358,9 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
// If any of the notification subscribers no longer have read access,
@ -422,9 +422,9 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
$this->_expires = $expires;
@ -849,10 +849,10 @@ class LetoDMS_Document
$message=mydmsDecodeString($message);
if ($isUser) {
Email::toIndividual($user, $obj, $subject, $message);
LetoDMS_Email::toIndividual($user, $obj, $subject, $message);
}
else {
Email::toGroup($user, $obj, $subject, $message);
LetoDMS_Email::toGroup($user, $obj, $subject, $message);
}
}
@ -939,10 +939,10 @@ class LetoDMS_Document
$message=mydmsDecodeString($message);
if ($isUser) {
Email::toIndividual($user, $obj, $subject, $message);
LetoDMS_Email::toIndividual($user, $obj, $subject, $message);
}
else {
Email::toGroup($user, $obj, $subject, $message);
LetoDMS_Email::toGroup($user, $obj, $subject, $message);
}
unset($this->_notifyList);
@ -1063,15 +1063,15 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
}
// if user is not owner send notification to owner
if ($user->getID()!= $this->_ownerID)
Email::toIndividual($user, $this->getOwner(), $subject, $message);
LetoDMS_Email::toIndividual($user, $this->getOwner(), $subject, $message);
return $docResultSet;
}
@ -1231,9 +1231,9 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
return true;
@ -1271,9 +1271,9 @@ class LetoDMS_Document
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
return true;
@ -1344,9 +1344,9 @@ class LetoDMS_Document
// Send notification to subscribers.
$this->getNotifyList();
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
}
@ -1573,9 +1573,9 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $nl["users"], $subject, $message);
LetoDMS_Email::toList($user, $nl["users"], $subject, $message);
foreach ($nl["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
return true;
@ -1732,13 +1732,13 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $recipients, $subject, $message);
LetoDMS_Email::toList($user, $recipients, $subject, $message);
// Send notification to subscribers.
$nl=$this->_document->getNotifyList();
Email::toList($user, $nl["users"], $subject, $message);
LetoDMS_Email::toList($user, $nl["users"], $subject, $message);
foreach ($nl["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
}
@ -1816,9 +1816,9 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($uu, $nl["users"], $subject, $message);
LetoDMS_Email::toList($uu, $nl["users"], $subject, $message);
foreach ($nl["groups"] as $grp) {
Email::toGroup($uu, $grp, $subject, $message);
LetoDMS_Email::toGroup($uu, $grp, $subject, $message);
}
// TODO: if user os not owner send notification to owner
@ -1956,7 +1956,7 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
return (Email::toIndividual($requestUser, $user, $subject, $message) < 0 ? -4 : 0);
return (LetoDMS_Email::toIndividual($requestUser, $user, $subject, $message) < 0 ? -4 : 0);
}
return 0;
}
@ -2033,7 +2033,7 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
return (Email::toGroup($requestUser, $group, $subject, $message) < 0 ? -4 : 0);
return (LetoDMS_Email::toGroup($requestUser, $group, $subject, $message) < 0 ? -4 : 0);
}
return 0;
}
@ -2107,7 +2107,7 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
return (Email::toIndividual($requestUser, $user, $subject, $message) < 0 ? -4 : 0);
return (LetoDMS_Email::toIndividual($requestUser, $user, $subject, $message) < 0 ? -4 : 0);
}
return 0;
}
@ -2184,7 +2184,7 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
return (Email::toGroup($requestUser, $group, $subject, $message) < 0 ? -4 : 0);
return (LetoDMS_Email::toGroup($requestUser, $group, $subject, $message) < 0 ? -4 : 0);
}
return 0;
}
@ -2236,7 +2236,7 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
return (Email::toIndividual($requestUser, $user, $subject, $message) < 0 ? -4 : 0);
return (LetoDMS_Email::toIndividual($requestUser, $user, $subject, $message) < 0 ? -4 : 0);
}
return 0;
}
@ -2288,7 +2288,7 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
return (Email::toGroup($requestUser, $group, $subject, $message) < 0 ? -4 : 0);
return (LetoDMS_Email::toGroup($requestUser, $group, $subject, $message) < 0 ? -4 : 0);
}
return 0;
}
@ -2340,7 +2340,7 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
return (Email::toIndividual($requestUser, $user, $subject, $message) < 0 ? -4 : 0);
return (LetoDMS_Email::toIndividual($requestUser, $user, $subject, $message) < 0 ? -4 : 0);
}
return 0;
}
@ -2392,7 +2392,7 @@ class DocumentContent
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
return (Email::toGroup($requestUser, $group, $subject, $message) < 0 ? -4 : 0);
return (LetoDMS_Email::toGroup($requestUser, $group, $subject, $message) < 0 ? -4 : 0);
}
return 0;
}

View File

@ -18,7 +18,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
class Email {
class LetoDMS_Email {
function toIndividual($sender, $recipient, $subject, $message) {

View File

@ -101,9 +101,9 @@ class LetoDMS_Folder
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
$this->_name = $newName;
@ -133,9 +133,9 @@ class LetoDMS_Folder
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
$this->_comment = $newComment;
@ -205,9 +205,9 @@ class LetoDMS_Folder
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
return true;
@ -244,9 +244,9 @@ class LetoDMS_Folder
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
$this->_ownerID = $newOwner->getID();
@ -285,9 +285,9 @@ class LetoDMS_Folder
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
$this->_defaultAccess = $mode;
@ -333,9 +333,9 @@ class LetoDMS_Folder
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
// If any of the notification subscribers no longer have read access,
@ -412,9 +412,9 @@ class LetoDMS_Folder
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
return $newFolder;
@ -556,9 +556,9 @@ class LetoDMS_Folder
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
return array($document, $res);
@ -614,9 +614,9 @@ class LetoDMS_Folder
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toList($user, $this->_notifyList["users"], $subject, $message);
LetoDMS_Email::toList($user, $this->_notifyList["users"], $subject, $message);
foreach ($this->_notifyList["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
}
@ -972,10 +972,10 @@ class LetoDMS_Folder
$message=mydmsDecodeString($message);
if ($isUser) {
Email::toIndividual($user, $obj, $subject, $message);
LetoDMS_Email::toIndividual($user, $obj, $subject, $message);
}
else {
Email::toGroup($user, $obj, $subject, $message);
LetoDMS_Email::toGroup($user, $obj, $subject, $message);
}
unset($this->_notifyList);
@ -1060,10 +1060,10 @@ class LetoDMS_Folder
$message=mydmsDecodeString($message);
if ($isUser) {
Email::toIndividual($user, $obj, $subject, $message);
LetoDMS_Email::toIndividual($user, $obj, $subject, $message);
}
else {
Email::toGroup($user, $obj, $subject, $message);
LetoDMS_Email::toGroup($user, $obj, $subject, $message);
}
unset($this->_notifyList);

View File

@ -120,13 +120,13 @@ if ($_POST["approvalType"] == "ind") {
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toIndividual($user, $content->getUser(), $subject, $message);
LetoDMS_Email::toIndividual($user, $content->getUser(), $subject, $message);
// Send notification to subscribers.
$nl=$document->getNotifyList();
Email::toList($user, $nl["users"], $subject, $message);
LetoDMS_Email::toList($user, $nl["users"], $subject, $message);
foreach ($nl["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
}
}
@ -174,13 +174,13 @@ else if ($_POST["approvalType"] == "grp") {
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toIndividual($user, $content->getUser(), $subject, $message);
LetoDMS_Email::toIndividual($user, $content->getUser(), $subject, $message);
// Send notification to subscribers.
$nl=$document->getNotifyList();
Email::toList($user, $nl["users"], $subject, $message);
LetoDMS_Email::toList($user, $nl["users"], $subject, $message);
foreach ($nl["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
}
}

View File

@ -115,13 +115,13 @@ if ($_POST["reviewType"] == "ind") {
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toIndividual($user, $content->getUser(), $subject, $message);
LetoDMS_Email::toIndividual($user, $content->getUser(), $subject, $message);
// Send notification to subscribers.
$nl=$document->getNotifyList();
Email::toList($user, $nl["users"], $subject, $message);
LetoDMS_Email::toList($user, $nl["users"], $subject, $message);
foreach ($nl["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
}
}
@ -168,13 +168,13 @@ else if ($_POST["reviewType"] == "grp") {
$subject=mydmsDecodeString($subject);
$message=mydmsDecodeString($message);
Email::toIndividual($user, $content->getUser(), $subject, $message);
LetoDMS_Email::toIndividual($user, $content->getUser(), $subject, $message);
// Send notification to subscribers.
$nl=$document->getNotifyList();
Email::toList($user, $nl["users"], $subject, $message);
LetoDMS_Email::toList($user, $nl["users"], $subject, $message);
foreach ($nl["groups"] as $grp) {
Email::toGroup($user, $grp, $subject, $message);
LetoDMS_Email::toGroup($user, $grp, $subject, $message);
}
}
}
@ -253,12 +253,12 @@ if ($_POST["reviewStatus"]==-1){
if ($dastat["type"] == 0) {
$approver = getUser($dastat["required"]);
Email::toIndividual($document->getOwner(), $approver, $subject, $message);
LetoDMS_Email::toIndividual($document->getOwner(), $approver, $subject, $message);
}
else if ($dastat["type"] == 1) {
$group = getGroup($dastat["required"]);
Email::toGroup($document->getOwner(), $group, $subject, $message);
LetoDMS_Email::toGroup($document->getOwner(), $group, $subject, $message);
}
}
}