Example #1
0
 function testAnswerMail()
 {
     $data = $this->mail_data;
     $mail = MailManager::createMail($data);
     $dir = MailManager::loadDirectoryFromName(MAILBOX, $this->author_id);
     //MailManager::addMailToDir($mail, $dir);
     $data = $this->mail_data2;
     $data["repliesTo"] = 1;
     $mail2 = MailManager::answerMail($mail, $data);
     //MailManager::addMailToDir($mail2, $dir);
     $dir2 = MailManager::loadDirectory($dir->getID());
     //echo "<p>" . serialize($oldreadstatus) . "<br />" . serialize($newstatus) . "</p>"; //DEBUG
     if ($mail2->getRepliesTo() != $mail->getID()) {
         return "<br />Answer test NOT PASSED: not answered";
     }
     return "<br />Answer test passed";
 }
Example #2
0
 private static function doDirectoryAction($request)
 {
     require_once 'mail/MailManager.php';
     if (isset(self::$currentID) && self::$currentID != null) {
         self::$currentObject = MailManager::loadDirectory(self::$currentID);
     }
     switch (self::$requestedAction) {
         case "Edit":
             require_once 'mail/MailPage.php';
             MailPage::showEditDirectoryForm(self::$currentObject);
             break;
         case "Mails":
             require_once 'mail/MailPage.php';
             foreach (self::$currentObject->getMails() as $mail) {
                 MailPage::showShortMail($mail);
             }
             break;
         case "Delete":
             MailManager::deleteDirectory(self::$currentObject);
             $inbox = MailManager::loadDirectoryFromName(MAILBOX, self::$currentObject->getUser());
             header("location: " . FileManager::appendToRootPath("Directory/" . $inbox->getID()));
             break;
         case "Sent":
             $mails = MailManager::getMailSent(self::$user);
             foreach ($mails->getMails() as $mail) {
                 MailPage::showShortMail($mail);
             }
             break;
         case "Unread":
             //@deprecated non ce n'รจ bisogno...
             $inbox = MailManager::loadDirectoryFromName(MAILBOX, self::$user);
             header("location: " . FileManager::appendToRootPath("Directory/" . $inbox->getID()));
             break;
         case "New":
             require_once 'mail/MailPage.php';
             MailPage::showNewDirectoryForm();
             break;
         case "Search":
         default:
             require_once 'search/SearchPage.php';
             SearchPage::showMailSearchForm();
             break;
     }
 }