<?php
namespace Claromentis\Projects\Subscribers;

$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"] ?: array()) + array("_67a33ec2e52d50c2dce5c" . "e1b528c6da8" => base64_decode("aXNf" . "cHJp" . "dmF0" . "ZQ=="), "_dadf790baf241afac942824c1" . "e6e37c4" => base64_decode("dHlwZ" . "Q=="), "_19bf4e0d9390cf03d19fc64c1de" . "15756" => base64_decode("UHJvamVjdEhpc3RvcnlUYX" . "NrRGVsZXRlZA=="), "_5ecedeb8c083d4" . "a2a4ebef5526097" . "f58" => base64_decode("YXNzaWduZW" . "Vz"), "_f3378ee2ffbe610a7d709e577c7" . "b3409" => base64_decode("cHJvamVjdHMuaGlzdG9" . "yeS5hcmVhLnByb2plY3" . "Q="), "_02bb9f7da9659769fe77646e" . "2750b60f" => base64_decode("dGFza19kZWxldGV" . "k"), "_feb9037589181b" . "c30fa0f1cf78b9f" . "056" => base64_decode("dGl0b" . "GU="));
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\Core\Localization\Lmsg;
use Claromentis\Projects\Event\TaskEvent;
use Claromentis\Projects\HistoryItem;
use Claromentis\Projects\Permissions;
use Claromentis\Projects\Service\HistoryService;
class HistorySubscriber implements EventSubscriberInterface
{
    
    
    
    
    private $history_service;
    
    
    
    
    private $lmsg;
    public function __construct(HistoryService $history_service, Lmsg $lmsg)
    {
        $this->history_service = $history_service;
        $this->lmsg = $lmsg;
    }
    
    
    
    
    public static function getSubscribedEvents()
    {
        return [
            
            
            
            
            TaskEvent::POST_DELETE_EVENT => $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_19bf4e0d9390cf03d" . "19fc64c1de15756"],
        ];
    }
    
    
    
    
    
    
    
    public function ProjectHistoryTaskDeleted(TaskEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec) : void
    {
        $_696b535739055ed7d827709916d07dea = $_e62ca7bbb93b52cafc82da1c2aefe9ec->GetTask();
        $context = $_e62ca7bbb93b52cafc82da1c2aefe9ec->GetContext();
        $_a82e7c9cba13670954fbe01d604c242a = new HistoryItem();
        $_a82e7c9cba13670954fbe01d604c242a->SetArea(($this->lmsg)($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_f3378ee2ffbe610a" . "7d709e577c7b3409"]));
        $_a82e7c9cba13670954fbe01d604c242a->SetChanges([$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_dadf790" . "baf241af" . "ac942824" . "c1e6e37c" . "4"] => $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_02bb9f7da9659" . "769fe77646e275" . "0b60f"], $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_feb9037589181b" . "c30fa0f1cf78b9f" . "056"] => $_696b535739055ed7d827709916d07dea->GetTitle(), $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_67a33ec2e52d50c2dce5ce" . "1b528c6da8"] => $_696b535739055ed7d827709916d07dea->IsPrivate(), $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_5ecedeb8c083d4" . "a2a4ebef5526097" . "f58"] => $_696b535739055ed7d827709916d07dea->GetAssignees()]);
        if ($_696b535739055ed7d827709916d07dea->IsPrivate()) {
            $_a82e7c9cba13670954fbe01d604c242a->SetPrivate();
        }
        $_a82e7c9cba13670954fbe01d604c242a->SetAssignees($_696b535739055ed7d827709916d07dea->GetAssignees());
        $this->history_service->AddHistory(Permissions::PROJECT_AGGREGATION, $_696b535739055ed7d827709916d07dea->GetProject(), $_a82e7c9cba13670954fbe01d604c242a, $context->GetUserId());
    }
}