<?php
namespace Claromentis\Infocapture\Subscriber;

$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array("_a906349266c8fb7bf22f1eb70" . "250a8d3" => base64_decode("c2F2ZWRfZHJh" . "ZnQ="), "_d3af2f4583f1519f427c4b594941" . "e786" => base64_decode("KSc" . "="), "_3d03729349" . "66db10d3445" . "daa0c00a7b9" => base64_decode("ZGlzY2FyZF9kcmF" . "mdA=="), "project_" . "id" => base64_decode("cHJvamVj" . "dF9pZA=="), "_105276d3485610101145c" . "a32233c1a73" => base64_decode("aW5mb2N" . "hcHR1cm" . "U="), "_42c33007972c054" . "c89c609a2cebb064" . "e" => base64_decode("RHJhZnQgaXNzdWUgZGlzY2FyZGVkLiBQcm9qZ" . "WN0ICc="), "_7dfc646ea8c9714b80e65f9" . "2a5388ed0" => base64_decode("ICg" . "="), "_eca83ba36e" . "5a56856f64e" . "0fc3a976eab" => base64_decode("b25EcmFmdENyZWF0ZW" . "Q="), "_99a1727d246935c" . "d15c5e6f3cdb4952" . "4" => base64_decode("RHJhZnQgaXNz" . "dWUgc2F2ZWQu" . "IFByb2plY3Qg" . "Jw=="), "_64f374f30afdf42e7360f" . "c3d37db1006" => base64_decode("b25EcmFmdE" . "RlbGV0ZWQ="));
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["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_eca83ba36e5a56856f6" . "4e0fc3a976eab"], InfocaptureEvents::IC_ISSUE_DRAFT_DELETED => $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_64f374f30afdf42e736" . "0fc3d37db1006"]];
    }
    public function onDraftCreated(DraftIssueEvent $event)
    {
        $issue = $event->getIssue();
        $projectId = $issue->GetProperty($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["project_i" . "d"]);
        $project = new \HDProject();
        $project->Load($projectId);
        $this->audit->Store(Audit::AUDIT_SUCCESS, $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_105276d3485610101145ca322" . "33c1a73"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_a9063492" . "66c8fb7bf" . "22f1eb702" . "50a8d3"], 0, $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_99a1727d24693" . "5cd15c5e6f3cdb" . "49524"] . $project->GetName() . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_7dfc646ea8" . "c9714b80e65" . "f92a5388ed0"] . $project->GetId() . $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_d3af2f4583f1519f427c4b59494" . "1e786"]);
    }
    public function onDraftDeleted(DraftIssueEvent $event)
    {
        $issue = $event->getIssue();
        $projectId = $issue->GetProperty($GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["proje" . "ct_id"]);
        $project = new \HDProject();
        $project->Load($projectId);
        $this->audit->Store(Audit::AUDIT_SUCCESS, $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_105276d3485610101145ca3" . "2233c1a73"], $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_3d0372934966" . "db10d3445daa0" . "c00a7b9"], 0, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_42c33007972c0" . "54c89c609a2ceb" . "b064e"] . $project->GetName() . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_7dfc646ea8c9714b80e6" . "5f92a5388ed0"] . $project->GetId() . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_d3af2f4583f" . "1519f427c4b5" . "94941e786"]);
    }
}