mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03:00
Add copy message functionality to drag&drop (drag + shift) [#42]
+ Update jquery to 1.10.2
This commit is contained in:
parent
74af8f793a
commit
f22b90dbe3
16 changed files with 318 additions and 201 deletions
|
|
@ -561,6 +561,32 @@ class MailClient
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sFromFolder
|
||||
* @param string $sToFolder
|
||||
* @param array $aIndexRange
|
||||
* @param bool $bIndexIsUid
|
||||
*
|
||||
* @return \MailSo\Mail\MailClient
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\InvalidArgumentException
|
||||
* @throws \MailSo\Net\Exceptions\Exception
|
||||
* @throws \MailSo\Imap\Exceptions\Exception
|
||||
*/
|
||||
public function MessageCopy($sFromFolder, $sToFolder, $aIndexRange, $bIndexIsUid)
|
||||
{
|
||||
if (0 === \strlen($sFromFolder) || 0 === \strlen($sToFolder) ||
|
||||
!\is_array($aIndexRange) || 0 === \count($aIndexRange))
|
||||
{
|
||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException();
|
||||
}
|
||||
|
||||
$this->oImapClient->FolderSelect($sFromFolder);
|
||||
$this->oImapClient->MessageCopy($sToFolder, \implode(',', $aIndexRange), $bIndexIsUid);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource $rMessageStream
|
||||
* @param int $iMessageStreamSize
|
||||
|
|
|
|||
|
|
@ -4316,6 +4316,40 @@ class Actions
|
|||
'' === $sHash ? false : array($sFromFolder, $sHash));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* @throws \MailSo\Base\Exceptions\Exception
|
||||
*/
|
||||
public function DoMessageCopy()
|
||||
{
|
||||
$this->initMailClientConnection();
|
||||
|
||||
$sFromFolder = $this->GetActionParam('FromFolder', '');
|
||||
$sToFolder = $this->GetActionParam('ToFolder', '');
|
||||
$aUids = explode(',', (string) $this->GetActionParam('Uids', ''));
|
||||
|
||||
$aFilteredUids = array_filter($aUids, function (&$mUid) {
|
||||
$mUid = (int) trim($mUid);
|
||||
return 0 < $mUid;
|
||||
});
|
||||
|
||||
try
|
||||
{
|
||||
$this->MailClient()->MessageCopy($sFromFolder, $sToFolder,
|
||||
$aFilteredUids, true);
|
||||
|
||||
$sHash = $this->MailClient()->FolderHash($sFromFolder);
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CantCopyMessage, $oException);
|
||||
}
|
||||
|
||||
return $this->DefaultResponse(__FUNCTION__,
|
||||
'' === $sHash ? false : array($sFromFolder, $sHash));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sFileName
|
||||
* @param string $sContentType
|
||||
|
|
|
|||
|
|
@ -1,101 +1,102 @@
|
|||
<?php
|
||||
|
||||
namespace RainLoop;
|
||||
|
||||
class Notifications
|
||||
{
|
||||
const InvalidToken = 101;
|
||||
const AuthError = 102;
|
||||
const AccessError = 103;
|
||||
const ConnectionError = 104;
|
||||
const CaptchaError = 105;
|
||||
const SocialFacebookLoginAccessDisable = 106;
|
||||
const SocialTwitterLoginAccessDisable = 107;
|
||||
const SocialGoogleLoginAccessDisable = 108;
|
||||
const DomainNotAllowed = 109;
|
||||
const AccountNotAllowed = 110;
|
||||
|
||||
const CantGetMessageList = 201;
|
||||
const CantGetMessage = 202;
|
||||
const CantDeleteMessage = 203;
|
||||
const CantMoveMessage = 204;
|
||||
|
||||
const CantSaveMessage = 301;
|
||||
const CantSendMessage = 302;
|
||||
const InvalidRecipients = 303;
|
||||
|
||||
const CantCreateFolder = 400;
|
||||
const CantRenameFolder = 401;
|
||||
const CantDeleteFolder = 402;
|
||||
const CantSubscribeFolder = 403;
|
||||
const CantUnsubscribeFolder = 404;
|
||||
const CantDeleteNonEmptyFolder = 405;
|
||||
|
||||
const CantSaveSettings = 501;
|
||||
const CantSavePluginSettings = 502;
|
||||
|
||||
const DomainAlreadyExists = 601;
|
||||
|
||||
const CantInstallPackage = 701;
|
||||
const CantDeletePackage = 702;
|
||||
const InvalidPluginPackage = 703;
|
||||
const UnsupportedPluginPackage = 704;
|
||||
|
||||
const LicensingServerIsUnavailable = 710;
|
||||
const LicensingExpired = 711;
|
||||
const LicensingBanned = 712;
|
||||
|
||||
const DemoSendMessageError = 750;
|
||||
|
||||
const AccountAlreadyExists = 801;
|
||||
|
||||
const MailServerError = 901;
|
||||
const UnknownNotification = 998;
|
||||
const UnknownError = 999;
|
||||
|
||||
static public function GetNotificationsMessage($iCode)
|
||||
{
|
||||
static $aMap = array(
|
||||
self::InvalidToken => 'InvalidToken',
|
||||
self::AuthError => 'AuthError',
|
||||
self::AccessError => 'AccessError',
|
||||
self::ConnectionError => 'ConnectionError',
|
||||
self::CaptchaError => 'CaptchaError',
|
||||
self::SocialFacebookLoginAccessDisable => 'SocialFacebookLoginAccessDisable',
|
||||
self::SocialTwitterLoginAccessDisable => 'SocialTwitterLoginAccessDisable',
|
||||
self::SocialGoogleLoginAccessDisable => 'SocialGoogleLoginAccessDisable',
|
||||
self::DomainNotAllowed => 'DomainNotAllowed',
|
||||
self::AccountNotAllowed => 'AccountNotAllowed',
|
||||
self::CantGetMessageList => 'CantGetMessageList',
|
||||
self::CantGetMessage => 'CantGetMessage',
|
||||
self::CantDeleteMessage => 'CantDeleteMessage',
|
||||
self::CantMoveMessage => 'CantMoveMessage',
|
||||
self::CantSaveMessage => 'CantSaveMessage',
|
||||
self::CantSendMessage => 'CantSendMessage',
|
||||
self::InvalidRecipients => 'InvalidRecipients',
|
||||
self::CantCreateFolder => 'CantCreateFolder',
|
||||
self::CantRenameFolder => 'CantRenameFolder',
|
||||
self::CantDeleteFolder => 'CantDeleteFolder',
|
||||
self::CantSubscribeFolder => 'CantSubscribeFolder',
|
||||
self::CantUnsubscribeFolder => 'CantUnsubscribeFolder',
|
||||
self::CantDeleteNonEmptyFolder => 'CantDeleteNonEmptyFolder',
|
||||
self::CantSaveSettings => 'CantSaveSettings',
|
||||
self::CantSavePluginSettings => 'CantSavePluginSettings',
|
||||
self::DomainAlreadyExists => 'DomainAlreadyExists',
|
||||
self::CantInstallPackage => 'CantInstallPackage',
|
||||
self::CantDeletePackage => 'CantDeletePackage',
|
||||
self::InvalidPluginPackage => 'InvalidPluginPackage',
|
||||
self::UnsupportedPluginPackage => 'UnsupportedPluginPackage',
|
||||
self::LicensingServerIsUnavailable => 'LicensingServerIsUnavailable',
|
||||
self::LicensingExpired => 'LicensingExpired',
|
||||
self::LicensingBanned => 'LicensingBanned',
|
||||
self::DemoSendMessageError => 'DemoSendMessageError',
|
||||
self::AccountAlreadyExists => 'AccountAlreadyExists',
|
||||
self::MailServerError => 'MailServerError',
|
||||
self::UnknownNotification => 'UnknownNotification',
|
||||
self::UnknownError => 'UnknownError'
|
||||
);
|
||||
|
||||
return isset($aMap[$iCode]) ? $aMap[$iCode].'['.$iCode.']' : 'UnknownNotification['.$iCode.']';
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace RainLoop;
|
||||
|
||||
class Notifications
|
||||
{
|
||||
const InvalidToken = 101;
|
||||
const AuthError = 102;
|
||||
const AccessError = 103;
|
||||
const ConnectionError = 104;
|
||||
const CaptchaError = 105;
|
||||
const SocialFacebookLoginAccessDisable = 106;
|
||||
const SocialTwitterLoginAccessDisable = 107;
|
||||
const SocialGoogleLoginAccessDisable = 108;
|
||||
const DomainNotAllowed = 109;
|
||||
const AccountNotAllowed = 110;
|
||||
|
||||
const CantGetMessageList = 201;
|
||||
const CantGetMessage = 202;
|
||||
const CantDeleteMessage = 203;
|
||||
const CantMoveMessage = 204;
|
||||
const CantCopyMessage = 205;
|
||||
|
||||
const CantSaveMessage = 301;
|
||||
const CantSendMessage = 302;
|
||||
const InvalidRecipients = 303;
|
||||
|
||||
const CantCreateFolder = 400;
|
||||
const CantRenameFolder = 401;
|
||||
const CantDeleteFolder = 402;
|
||||
const CantSubscribeFolder = 403;
|
||||
const CantUnsubscribeFolder = 404;
|
||||
const CantDeleteNonEmptyFolder = 405;
|
||||
|
||||
const CantSaveSettings = 501;
|
||||
const CantSavePluginSettings = 502;
|
||||
|
||||
const DomainAlreadyExists = 601;
|
||||
|
||||
const CantInstallPackage = 701;
|
||||
const CantDeletePackage = 702;
|
||||
const InvalidPluginPackage = 703;
|
||||
const UnsupportedPluginPackage = 704;
|
||||
|
||||
const LicensingServerIsUnavailable = 710;
|
||||
const LicensingExpired = 711;
|
||||
const LicensingBanned = 712;
|
||||
|
||||
const DemoSendMessageError = 750;
|
||||
|
||||
const AccountAlreadyExists = 801;
|
||||
|
||||
const MailServerError = 901;
|
||||
const UnknownNotification = 998;
|
||||
const UnknownError = 999;
|
||||
|
||||
static public function GetNotificationsMessage($iCode)
|
||||
{
|
||||
static $aMap = array(
|
||||
self::InvalidToken => 'InvalidToken',
|
||||
self::AuthError => 'AuthError',
|
||||
self::AccessError => 'AccessError',
|
||||
self::ConnectionError => 'ConnectionError',
|
||||
self::CaptchaError => 'CaptchaError',
|
||||
self::SocialFacebookLoginAccessDisable => 'SocialFacebookLoginAccessDisable',
|
||||
self::SocialTwitterLoginAccessDisable => 'SocialTwitterLoginAccessDisable',
|
||||
self::SocialGoogleLoginAccessDisable => 'SocialGoogleLoginAccessDisable',
|
||||
self::DomainNotAllowed => 'DomainNotAllowed',
|
||||
self::AccountNotAllowed => 'AccountNotAllowed',
|
||||
self::CantGetMessageList => 'CantGetMessageList',
|
||||
self::CantGetMessage => 'CantGetMessage',
|
||||
self::CantDeleteMessage => 'CantDeleteMessage',
|
||||
self::CantMoveMessage => 'CantMoveMessage',
|
||||
self::CantSaveMessage => 'CantSaveMessage',
|
||||
self::CantSendMessage => 'CantSendMessage',
|
||||
self::InvalidRecipients => 'InvalidRecipients',
|
||||
self::CantCreateFolder => 'CantCreateFolder',
|
||||
self::CantRenameFolder => 'CantRenameFolder',
|
||||
self::CantDeleteFolder => 'CantDeleteFolder',
|
||||
self::CantSubscribeFolder => 'CantSubscribeFolder',
|
||||
self::CantUnsubscribeFolder => 'CantUnsubscribeFolder',
|
||||
self::CantDeleteNonEmptyFolder => 'CantDeleteNonEmptyFolder',
|
||||
self::CantSaveSettings => 'CantSaveSettings',
|
||||
self::CantSavePluginSettings => 'CantSavePluginSettings',
|
||||
self::DomainAlreadyExists => 'DomainAlreadyExists',
|
||||
self::CantInstallPackage => 'CantInstallPackage',
|
||||
self::CantDeletePackage => 'CantDeletePackage',
|
||||
self::InvalidPluginPackage => 'InvalidPluginPackage',
|
||||
self::UnsupportedPluginPackage => 'UnsupportedPluginPackage',
|
||||
self::LicensingServerIsUnavailable => 'LicensingServerIsUnavailable',
|
||||
self::LicensingExpired => 'LicensingExpired',
|
||||
self::LicensingBanned => 'LicensingBanned',
|
||||
self::DemoSendMessageError => 'DemoSendMessageError',
|
||||
self::AccountAlreadyExists => 'AccountAlreadyExists',
|
||||
self::MailServerError => 'MailServerError',
|
||||
self::UnknownNotification => 'UnknownNotification',
|
||||
self::UnknownError => 'UnknownError'
|
||||
);
|
||||
|
||||
return isset($aMap[$iCode]) ? $aMap[$iCode].'['.$iCode.']' : 'UnknownNotification['.$iCode.']';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue