<?php
namespace Claromentis\Infocapture\Subscriber;

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array("_42c33007972c054c" . "89c609a2cebb064e" => base64_decode("RHJhZnQgaXNzdWUgZGlzY2FyZGVkLiBQcm9q" . "ZWN0ICc="), "_d3af2f45" . "83f1519f4" . "27c4b5949" . "41e786" => base64_decode("KS" . "c="), "_a906349266" . "c8fb7bf22f1" . "eb70250a8d3" => base64_decode("c2F2" . "ZWRf" . "ZHJh" . "ZnQ="), "_eca83ba" . "36e5a568" . "56f64e0f" . "c3a976ea" . "b" => base64_decode("b25EcmFmdENyZ" . "WF0ZWQ="), "projec" . "t_id" => base64_decode("cHJvamVjd" . "F9pZA=="), "_99a1727d2469" . "35cd15c5e6f3c" . "db49524" => base64_decode("RHJhZnQgaXNzdWUgc2F2ZWQuIFByb2plY3" . "QgJw=="), "_7dfc646ea8c9714b80e65f92a53" . "88ed0" => base64_decode("I" . "C" . "g" . "="), "_105276d3485610101145ca32233c" . "1a73" => base64_decode("aW5mb2NhcHR1cm" . "U="), "_64f374f" . "30afdf42" . "e7360fc3" . "d37db100" . "6" => base64_decode("b25EcmFmdERlbG" . "V0ZWQ="), "_3d0372934966db10d3445" . "daa0c00a7b9" => base64_decode("ZGlzY2FyZF9kcmFmd" . "A=="));
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["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_eca83ba36e5a56856f64e0fc3" . "a976eab"], InfocaptureEvents::IC_ISSUE_DRAFT_DELETED => $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_64f374f3" . "0afdf42e7" . "360fc3d37" . "db1006"]];
    }
    public function onDraftCreated(DraftIssueEvent $event)
    {
        $issue = $event->getIssue();
        $projectId = $issue->GetProperty($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["pro" . "jec" . "t_i" . "d"]);
        $project = new \HDProject();
        $project->Load($projectId);
        $this->audit->Store(Audit::AUDIT_SUCCESS, $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_105276d3485610101145ca3" . "2233c1a73"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_a906349266c8fb7bf22f1eb70250a8" . "d3"], 0, $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_99a1727d246935cd15" . "c5e6f3cdb49524"] . $project->GetName() . $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_7dfc646ea8c9714b" . "80e65f92a5388ed0"] . $project->GetId() . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_d3af2f4583f1519f427c4b594" . "941e786"]);
    }
    public function onDraftDeleted(DraftIssueEvent $event)
    {
        $issue = $event->getIssue();
        $projectId = $issue->GetProperty($GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["proje" . "ct_id"]);
        $project = new \HDProject();
        $project->Load($projectId);
        $this->audit->Store(Audit::AUDIT_SUCCESS, $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_105276d3485610101145" . "ca32233c1a73"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_3d0372934966db10d3445daa0c00a" . "7b9"], 0, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_42c33007972c05" . "4c89c609a2cebb0" . "64e"] . $project->GetName() . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_7dfc646ea8c9714b80e65f" . "92a5388ed0"] . $project->GetId() . $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_d3af2f4583f" . "1519f427c4b5" . "94941e786"]);
    }
}