<?php
namespace Claromentis\Infocapture\Subscriber;

$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] ?: array()) + array("_64f374f" . "30afdf42" . "e7360fc3" . "d37db100" . "6" => base64_decode("b25Ec" . "mFmdE" . "RlbGV" . "0ZWQ="), "_105276d3485610101145ca3" . "2233c1a73" => base64_decode("aW5mb2NhcHR" . "1cmU="), "_d3af2f4583f1519f427c4b594941e" . "786" => base64_decode("K" . "S" . "c" . "="), "_a906349266c8fb7bf" . "22f1eb70250a8d3" => base64_decode("c2F2ZWRfZHJhZn" . "Q="), "projec" . "t_id" => base64_decode("cHJvamV" . "jdF9pZA" . "=="), "_eca83ba36" . "e5a56856f6" . "4e0fc3a976" . "eab" => base64_decode("b25EcmFm" . "dENyZWF0" . "ZWQ="), "_99a1727d246935cd15" . "c5e6f3cdb49524" => base64_decode("RHJhZnQgaXNzdWUgc2F2ZWQuIFB" . "yb2plY3QgJw=="), "_3d0372934966" . "db10d3445daa0" . "c00a7b9" => base64_decode("ZGlzY2FyZF9kcmFm" . "dA=="), "_42c33007972c054" . "c89c609a2cebb064" . "e" => base64_decode("RHJhZnQgaXNzdWUgZGl" . "zY2FyZGVkLiBQcm9qZW" . "N0ICc="), "_7dfc646ea8" . "c9714b80e65" . "f92a5388ed0" => base64_decode("I" . "C" . "g" . "="));
use Claromentis\Core\Audit\Audit;
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\Infocapture\Event\DraftIssueEvent;
use Claromentis\Infocapture\InfocaptureEvents;
class IssueSubscriber implements EventSubscriberInterface
{
    protected Audit $audit;
    public function __construct(Audit $audit)
    {
        $this->audit = $audit;
    }
    public static function getSubscribedEvents()
    {
        return [InfocaptureEvents::IC_ISSUE_DRAFT_CREATED => $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_eca83ba36e5a56856f64e0fc3a" . "976eab"], InfocaptureEvents::IC_ISSUE_DRAFT_DELETED => $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_64f374f30afdf42e" . "7360fc3d37db1006"]];
    }
    public function onDraftCreated(DraftIssueEvent $event)
    {
        $issue = $event->getIssue();
        $projectId = $issue->GetProperty($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["proj" . "ect_" . "id"]);
        $project = new \HDProject();
        $project->Load($projectId);
        $this->audit->Store(Audit::AUDIT_SUCCESS, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_105276d3" . "485610101" . "145ca3223" . "3c1a73"], $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_a906349266c8fb7bf22f1eb7025" . "0a8d3"], 0, $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_99a1727d246935c" . "d15c5e6f3cdb4952" . "4"] . $project->GetName() . $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_7dfc646ea8c971" . "4b80e65f92a5388" . "ed0"] . $project->GetId() . $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_d3af2f458" . "3f1519f427" . "c4b594941e" . "786"]);
    }
    public function onDraftDeleted(DraftIssueEvent $event)
    {
        $issue = $event->getIssue();
        $projectId = $issue->GetProperty($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["project" . "_id"]);
        $project = new \HDProject();
        $project->Load($projectId);
        $this->audit->Store(Audit::AUDIT_SUCCESS, $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_105276d3485610101145ca32233c1a7" . "3"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_3d0372934966db10d3445d" . "aa0c00a7b9"], 0, $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_42c3300797" . "2c054c89c60" . "9a2cebb064e"] . $project->GetName() . $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_7dfc646ea8c9714b80e65f92a5388e" . "d0"] . $project->GetId() . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_d3af2f4583f1519f427c4b594" . "941e786"]);
    }
}