63 lines
1.4 KiB
PHP
Executable File
63 lines
1.4 KiB
PHP
Executable File
<?php
|
|
|
|
require_once __DIR__ . "/lib/class.EmailTracker.php";
|
|
|
|
class PluginTrackingModule extends Module
|
|
{
|
|
|
|
/**
|
|
* @var EmailTracker
|
|
*/
|
|
private $emailTracker;
|
|
|
|
/**
|
|
* Constructor
|
|
* @param int $id unique id.
|
|
* @param string $folderentryid Entryid of the folder. Data will be selected from this folder.
|
|
* @param array $data list of all actions.
|
|
*/
|
|
function PluginEmailtrackingModule($id, $data)
|
|
{
|
|
$this->store = $GLOBALS['mapisession']->getDefaultMessageStore();
|
|
parent::Module($id, $data);
|
|
}
|
|
|
|
/**
|
|
* Executes all the actions in the $data variable.
|
|
* @return boolean true on success of false on fialure.
|
|
*/
|
|
function execute()
|
|
{
|
|
$this->emailTracker = new EmailTracker();
|
|
|
|
foreach($this->data as $actionType => $actionData)
|
|
{
|
|
if(isset($actionType)) {
|
|
try {
|
|
switch($actionType)
|
|
{
|
|
case "gettrackinglog" :
|
|
$data = $this->getTrackingLog($actionData);
|
|
$this->addActionData('gettrackinglog', $data);
|
|
$GLOBALS['bus']->addData($this->getResponseData());
|
|
break;
|
|
default:
|
|
$this->handleUnknownActionType($actionType);
|
|
}
|
|
} catch (Exception $e) {
|
|
$this->sendFeedback(false, parent::errorDetailsFromException($e));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function getTrackingLog($actionData) {
|
|
$data = array();
|
|
$data["trackingid"] = $actionData["trackingid"];
|
|
$data["log"] = $this->emailTracker->getAllLogs($data["trackingid"]);
|
|
$data["status"] = true;
|
|
|
|
return $data;
|
|
}
|
|
}
|