OpenPGP (#53) Beta

Archive  (Closes #110)
Delete, Spam and Archive button in mail view when preview pane is off  (Closes #72)
Small fixes  (Closes #101)
This commit is contained in:
RainLoop Team 2014-04-02 03:58:24 +04:00
parent ab817e1396
commit cae0cc2f77
45 changed files with 1390 additions and 172 deletions

View file

@ -17,5 +17,5 @@ class FolderType
const TRASH = 5;
const IMPORTANT = 10;
const STARRED = 11;
const ALLMAIL = 12;
const ARCHIVE = 12;
}

View file

@ -295,7 +295,7 @@ class Folder
case \in_array('\all', $aFlags):
case \in_array('\archive', $aFlags):
case \in_array('\allmail', $aFlags):
$iXListType = \MailSo\Imap\Enumerations\FolderType::ALLMAIL;
$iXListType = \MailSo\Imap\Enumerations\FolderType::ARCHIVE;
break;
}
}

View file

@ -1162,6 +1162,7 @@ class Actions
$aResult['DraftFolder'] = $oSettings->GetConf('DraftFolder', '');
$aResult['SpamFolder'] = $oSettings->GetConf('SpamFolder', '');
$aResult['TrashFolder'] = $oSettings->GetConf('TrashFolder', '');
$aResult['ArchiveFolder'] = $oSettings->GetConf('ArchiveFolder', '');
$aResult['NullFolder'] = $oSettings->GetConf('NullFolder', '');
$aResult['EditorDefaultType'] = $oSettings->GetConf('EditorDefaultType', $aResult['EditorDefaultType']);
$aResult['ShowImages'] = (bool) $oSettings->GetConf('ShowImages', $aResult['ShowImages']);
@ -1909,8 +1910,9 @@ class Actions
$oSettings->SetConf('SentFolder', $this->GetActionParam('SentFolder', ''));
$oSettings->SetConf('DraftFolder', $this->GetActionParam('DraftFolder', ''));
$oSettings->SetConf('TrashFolder', $this->GetActionParam('TrashFolder', ''));
$oSettings->SetConf('SpamFolder', $this->GetActionParam('SpamFolder', ''));
$oSettings->SetConf('TrashFolder', $this->GetActionParam('TrashFolder', ''));
$oSettings->SetConf('ArchiveFolder', $this->GetActionParam('ArchiveFolder', ''));
$oSettings->SetConf('NullFolder', $this->GetActionParam('NullFolder', ''));
return $this->DefaultResponse(__FUNCTION__,
@ -3347,6 +3349,7 @@ class Actions
$aCache = array(
'Sent' => \MailSo\Imap\Enumerations\FolderType::SENT,
'Send' => \MailSo\Imap\Enumerations\FolderType::SENT,
'Sent Item' => \MailSo\Imap\Enumerations\FolderType::SENT,
'Sent Items' => \MailSo\Imap\Enumerations\FolderType::SENT,
@ -3358,6 +3361,7 @@ class Actions
'Send Mails' => \MailSo\Imap\Enumerations\FolderType::SENT,
'Draft' => \MailSo\Imap\Enumerations\FolderType::DRAFTS,
'Drafts' => \MailSo\Imap\Enumerations\FolderType::DRAFTS,
'Draft Mail' => \MailSo\Imap\Enumerations\FolderType::DRAFTS,
'Draft Mails' => \MailSo\Imap\Enumerations\FolderType::DRAFTS,
@ -3365,14 +3369,22 @@ class Actions
'Drafts Mails' => \MailSo\Imap\Enumerations\FolderType::DRAFTS,
'Spam' => \MailSo\Imap\Enumerations\FolderType::SPAM,
'Junk' => \MailSo\Imap\Enumerations\FolderType::SPAM,
'Bulk Mail' => \MailSo\Imap\Enumerations\FolderType::SPAM,
'Bulk Mails' => \MailSo\Imap\Enumerations\FolderType::SPAM,
'Trash' => \MailSo\Imap\Enumerations\FolderType::TRASH,
'Deleted' => \MailSo\Imap\Enumerations\FolderType::TRASH,
'Bin' => \MailSo\Imap\Enumerations\FolderType::TRASH
'Bin' => \MailSo\Imap\Enumerations\FolderType::TRASH,
'Archive' => \MailSo\Imap\Enumerations\FolderType::ARCHIVE,
'All' => \MailSo\Imap\Enumerations\FolderType::ARCHIVE,
'All Mail' => \MailSo\Imap\Enumerations\FolderType::ARCHIVE,
'All Mails' => \MailSo\Imap\Enumerations\FolderType::ARCHIVE,
'AllMail' => \MailSo\Imap\Enumerations\FolderType::ARCHIVE,
'AllMails' => \MailSo\Imap\Enumerations\FolderType::ARCHIVE,
);
$this->Plugins()->RunHook('filter.system-folders-names', array($oAccount, &$aCache));
@ -3403,7 +3415,8 @@ class Actions
\MailSo\Imap\Enumerations\FolderType::SENT,
\MailSo\Imap\Enumerations\FolderType::DRAFTS,
\MailSo\Imap\Enumerations\FolderType::SPAM,
\MailSo\Imap\Enumerations\FolderType::TRASH
\MailSo\Imap\Enumerations\FolderType::TRASH,
\MailSo\Imap\Enumerations\FolderType::ARCHIVE
)))
{
$aResult[$iFolderXListType] = $oFolder->FullNameRaw();
@ -3428,7 +3441,8 @@ class Actions
\MailSo\Imap\Enumerations\FolderType::SENT,
\MailSo\Imap\Enumerations\FolderType::DRAFTS,
\MailSo\Imap\Enumerations\FolderType::SPAM,
\MailSo\Imap\Enumerations\FolderType::TRASH
\MailSo\Imap\Enumerations\FolderType::TRASH,
\MailSo\Imap\Enumerations\FolderType::ARCHIVE
)))
{
$aResult[$iFolderType] = $oFolder->FullNameRaw();
@ -3473,6 +3487,7 @@ class Actions
if ($oFolderCollection instanceof \MailSo\Mail\FolderCollection)
{
$aSystemFolders = array();
$this->recFoldersTypes($oAccount, $oFolderCollection, $aSystemFolders);
$oFolderCollection->SystemFolders = $aSystemFolders;
@ -3500,6 +3515,10 @@ class Actions
{
$aList[] = \MailSo\Imap\Enumerations\FolderType::TRASH;
}
if ('' === $this->GetActionParam('ArchiveFolder', ''))
{
$aList[] = \MailSo\Imap\Enumerations\FolderType::ARCHIVE;
}
$this->Plugins()->RunHook('filter.folders-system-types', array($oAccount, &$aList));
@ -6284,8 +6303,9 @@ class Actions
*/
private function hashFolderFullName($sFolderFullName)
{
return \in_array(\strtolower($sFolderFullName), array('inbox', 'sent', 'send', 'drafts', 'spam', 'junk', 'bin', 'trash')) ?
\ucfirst(\strtolower($sFolderFullName)) : \md5($sFolderFullName);
return \in_array(\strtolower($sFolderFullName), array('inbox', 'sent', 'send', 'drafts',
'spam', 'junk', 'bin', 'trash', 'archive', 'allmail')) ?
\ucfirst(\strtolower($sFolderFullName)) : \md5($sFolderFullName);
// return \in_array(\strtolower($sFolderFullName), array('inbox', 'sent', 'send', 'drafts', 'spam', 'junk', 'bin', 'trash')) ?
// \ucfirst(\strtolower($sFolderFullName)) :

View file

@ -21,14 +21,17 @@
</ul>
</div>
<div class="btn-group">&nbsp;</div>
<div class="btn-group btn-group-custom-margin">
<a class="btn buttonDelete" data-placement="bottom" data-bind="command: deleteCommand, tooltip: 'MESSAGE_LIST/BUTTON_DELETE'">
<i class="icon-trash"></i>
<span data-bind="text: 1 < messageListCheckedOrSelectedUidsWithSubMails().length ? ' (' + messageListCheckedOrSelectedUidsWithSubMails().length + ')' : ''"></span>
<div class="btn-group">
<a class="btn btn-dark-disabled-border button-archive" data-placement="bottom" data-bind="visible: !isArchiveFolder() && !isArchiveDisabled(), command: archiveCommand, tooltip: 'MESSAGE_LIST/BUTTON_ARCHIVE'">
<i class="icon-archive"></i>
</a>
<a class="btn buttonSpam" data-placement="bottom" data-bind="visible: !isSpamFolder() && !isSpamDisabled(), command: spamCommand, tooltip: 'MESSAGE_LIST/BUTTON_SPAM'">
<a class="btn btn-dark-disabled-border button-spam" data-placement="bottom" data-bind="visible: !isSpamFolder() && !isSpamDisabled(), command: spamCommand, tooltip: 'MESSAGE_LIST/BUTTON_SPAM'">
<i class="icon-bug"></i>
</a>
<a class="btn btn-dark-disabled-border button-delete" data-placement="bottom" data-bind="command: deleteCommand, tooltip: 'MESSAGE_LIST/BUTTON_DELETE'">
<i class="icon-trash"></i>
<span data-bind="text: printableMessageCountForDeletion()"></span>
</a>
</div>
<div class="btn-group">&nbsp;</div>
<div class="btn-group">

View file

@ -14,24 +14,27 @@
</a>
</div>
<div class="btn-group" data-bind="visible: !isDraftFolder()">
<a class="btn buttonReply" data-placement="bottom" data-bind="command: replyCommand, tooltip: 'MESSAGE/BUTTON_REPLY'">
<a class="btn btn-dark-disabled-border buttonReply" data-placement="bottom" data-bind="command: replyCommand, tooltip: 'MESSAGE/BUTTON_REPLY'">
<i class="icon-reply"></i>
</a>
<a class="btn buttonReplyAll" data-placement="bottom" data-bind="command: replyAllCommand, tooltip: 'MESSAGE/BUTTON_REPLY_ALL'">
<a class="btn btn-dark-disabled-border buttonReplyAll" data-placement="bottom" data-bind="command: replyAllCommand, tooltip: 'MESSAGE/BUTTON_REPLY_ALL'">
<i class="icon-reply-all"></i>
</a>
<a class="btn buttonForward" data-placement="bottom" data-bind=" command: forwardCommand, tooltip: 'MESSAGE/BUTTON_FORWARD'">
<a class="btn btn-dark-disabled-border buttonForward" data-placement="bottom" data-bind=" command: forwardCommand, tooltip: 'MESSAGE/BUTTON_FORWARD'">
<i class="icon-forward"></i>
</a>
</div>
<div class="btn-group">&nbsp;</div>
<div class="btn-group btn-group-custom-margin">
<a class="btn btn-danger buttonDelete" data-placement="bottom" data-bind="command: deleteCommand, tooltip: 'MESSAGE/BUTTON_DELETE'">
<i class="icon-trash icon-white"></i>
<div class="btn-group">
<a class="btn btn-dark-disabled-border button-archive" data-placement="bottom" data-bind="visible: !isArchiveFolder() && !isArchiveDisabled(), command: archiveCommand, tooltip: 'MESSAGE/BUTTON_ARCHIVE'">
<i class="icon-archive"></i>
</a>
<a class="btn buttonSpam" data-placement="bottom" data-bind="visible: !isDraftFolder(), command: spamCommand, tooltip: 'MESSAGE/BUTTON_SPAM'">
<a class="btn btn-dark-disabled-border button-spam" data-placement="bottom" data-bind="visible: !isDraftFolder() && !isSpamFolder() && !isSpamDisabled(), command: spamCommand, tooltip: 'MESSAGE/BUTTON_SPAM'">
<i class="icon-bug"></i>
</a>
<a class="btn btn-dark-disabled-border button-delete" data-placement="bottom" data-bind="command: deleteCommand, tooltip: 'MESSAGE/BUTTON_DELETE'">
<i class="icon-trash"></i>
</a>
</div>
<div class="btn-group">&nbsp;</div>
<div class="btn-group">
@ -201,15 +204,14 @@
<div class="pgpSigned" data-bind="visible: message() && message().isPgpSigned() && isPgpActionVisible(), click: function() { verifyPgpSignedClearMessage(message()); }">
<i class="icon-lock"></i>
&nbsp;&nbsp;
OpenPGP signed message (click to verify)
<span class="i18n" data-i18n-text="MESSAGE/PGP_SIGNED_MESSAGE_DESC"></span>
</div>
<div class="pgpEncrypted" data-bind="visible: message() && message().isPgpEncrypted()">
<div class="pgpEncrypted" data-bind="visible: message() && message().isPgpEncrypted() && isPgpActionVisible()">
<i class="icon-lock"></i>
&nbsp;&nbsp;
<span data-bind="click: function() { decryptPgpEncryptedMessage(message()); }">
OpenPGP encrypted message (click to decrypt)
</span>
<input type="password" />
<span class="i18n" data-i18n-text="MESSAGE/PGP_ENCRYPTED_MESSAGE_DESC" data-bind="click: function() { decryptPgpEncryptedMessage(message()); }"></span>
&nbsp;&nbsp;
<input type="password" class="i18n span3 inputPgpPassword" style="margin-bottom: 0" data-i18n-placeholder="MESSAGE/PGP_PASSWORD_INPUT_PLACEHOLDER" data-bind="value: viewPgpPassword" />
</div>
<div class="attachmentsPlace" data-bind="visible: message() && message().hasVisibleAttachments()">
<ul class="attachmentList" data-bind="foreach: message() ? message().attachments() : []">

View file

@ -14,16 +14,18 @@
</div>
<br />
<div class="control-group">
<label data-bind="click: function () { sign(!sign()); }">
<i data-bind="css: sign() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/LABEL_SIGN"></span>
</label>
<label data-bind="click: function () { encrypt(!encrypt()); }">
<i data-bind="css: encrypt() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/LABEL_ENCRYPT"></span>
</label>
<div class="controls">
<label data-bind="click: function () { sign(!sign()); }">
<i data-bind="css: sign() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/LABEL_SIGN"></span>
</label>
<label data-bind="click: function () { encrypt(!encrypt()); }">
<i data-bind="css: encrypt() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/LABEL_ENCRYPT"></span>
</label>
</div>
</div>
<div class="control-group">
<label class="i18n control-label" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/LABEL_PASSWORD"></label>
@ -38,7 +40,9 @@
<a class="btn buttonDo" data-bind="command: doCommand">
<i data-bind="css: {'icon-key': !submitRequest(), 'icon-spinner animated': submitRequest()}"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/BUTTON_DO"></span>
<span class="i18n" data-bind="visible: sign() && !encrypt()" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/BUTTON_SIGN"></span>
<span class="i18n" data-bind="visible: !sign() && encrypt()" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/BUTTON_ENCRYPT"></span>
<span class="i18n" data-bind="visible: (sign() && encrypt()) || (!sign() && !encrypt())" data-i18n-text="POPUPS_COMPOSE_OPEN_PGP/BUTTON_SIGN_AND_ENCRYPT"></span>
</a>
</div>
</div>

View file

@ -34,8 +34,8 @@
</div>
<div class="btn-group">
<a class="btn btn-danger button-delete" data-bind="command: deleteCommand">
<i class="icon-trash icon-white"></i>
<a class="btn button-delete" data-bind="command: deleteCommand">
<i class="icon-trash"></i>
<span data-bind="text: 1 < contactsCheckedOrSelected().length ? ' (' + contactsCheckedOrSelected().length + ')' : ''"></span>
</a>
</div>

View file

@ -48,6 +48,15 @@
optionsText: 'name', optionsValue: 'id', optionsAfterRender: $root.defautOptionsAfterRender"></select>
</div>
</div>
<div class="control-group">
<label class="control-label">
<span class="i18n" data-i18n-text="POPUPS_SYSTEM_FOLDERS/LABEL_ARCHIVE"></span>
</label>
<div class="controls">
<select data-bind="options: folderSelectList, value: archiveFolder,
optionsText: 'name', optionsValue: 'id', optionsAfterRender: $root.defautOptionsAfterRender"></select>
</div>
</div>
</div>
</div>
</div>