-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mms] Sent-mail maillog entries are now linked to a viewable represen…
…tation of the sent message, if it still exists on the server. Further optimizations could include: - Adding preference to indicate what mailboxes should be searched
- Loading branch information
Showing
9 changed files
with
165 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Maillog display for dynamic view. | ||
* | ||
* @author Michael Slusarz <slusarz@horde.org> | ||
* @copyright 2015 Horde LLC | ||
* @license GPL-2 (http://www.horde.org/licenses/gpl) | ||
*/ | ||
|
||
var ImpMaillog = { | ||
|
||
// Vars set by calling code: | ||
// error_msg | ||
|
||
onDomLoad: function() | ||
{ | ||
var base; | ||
|
||
if (base = ImpCore.baseAvailable()) { | ||
base.HordeCore.notify(this.error_msg, 'horde.error'); | ||
window.close(); | ||
} else { | ||
document.body.insert(this.error_msg.escapeHTML()); | ||
} | ||
} | ||
|
||
}; | ||
|
||
/* Initialize onload handler. */ | ||
document.observe('dom:loaded', ImpMaillog.onDomLoad.bind(ImpMaillog)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
/** | ||
* Copyright 2015 Horde LLC (http://www.horde.org/) | ||
* | ||
* See the enclosed file COPYING for license information (GPL). If you | ||
* did not receive this file, see http://www.horde.org/licenses/gpl. | ||
* | ||
* @category Horde | ||
* @copyright 2015 Horde LLC | ||
* @license http://www.horde.org/licenses/gpl GPL | ||
* @package IMP | ||
*/ | ||
|
||
/** | ||
* Maillog message ID lookup page for dynamic view. | ||
* | ||
* Expects two URL parameters: | ||
* - msgid: Message-ID | ||
* - type: Maillog type | ||
* | ||
* @author Michael Slusarz <slusarz@horde.org> | ||
* @category Horde | ||
* @copyright 2015 Horde LLC | ||
* @license http://www.horde.org/licenses/gpl GPL | ||
* @package IMP | ||
*/ | ||
class IMP_Dynamic_Maillog extends IMP_Dynamic_Base | ||
{ | ||
/** | ||
* @throws IMP_Exception | ||
*/ | ||
protected function _init() | ||
{ | ||
global $notification, $page_output; | ||
|
||
if (isset($this->vars->msgid) && | ||
isset($this->vars->type) && | ||
isset(IMP_Maillog_Storage_History::$drivers[$this->vars->type])) { | ||
$log = new IMP_Maillog_Storage_History::$drivers[$this->vars->type](array( | ||
'msgid' => $this->vars->msgid | ||
)); | ||
|
||
$query = $log->searchQuery(); | ||
|
||
foreach ($log->searchMailboxes() as $val) { | ||
if ($indices = $val->runSearchQuery($query)) { | ||
list($mbox, $uid) = $indices->getSingle(); | ||
$url = IMP_Dynamic_Message::url(); | ||
$url->add($mbox->urlParams($uid)); | ||
$url->redirect(); | ||
} | ||
} | ||
} | ||
|
||
$page_output->addScriptFile('maillog.js'); | ||
|
||
$page_output->addInlineJsVars(array( | ||
'ImpMaillog.error_msg' => _("Could not load message.") | ||
)); | ||
} | ||
|
||
/** | ||
*/ | ||
public static function url(array $opts = array()) | ||
{ | ||
return Horde::url('dynamic.php')->add('page', 'maillog'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters