<?php
namespace Claromentis\Projects\View;

$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] ?: array()) + array("_41a7e5071c1ab9b4f" . "1a73b4694b797df" => base64_decode("dGFza3NfcGVyX3" . "BhZ2U="), "_fc4348025b81b628b6" . "7a2a0ced823688" => base64_decode("bGFiZWw" . "="), "_849b247e636da664a5c71f3d72" . "b52312" => base64_decode("ZmlsdGVyZW" . "RfdXNlcl9p" . "ZHM="), "_f53d35a1a1e233d98" . "d9ce73d92ab3bb1" => base64_decode("Y291bnQ" . "="), "_bbd8fd6125dfd64a840290d75894" . "02c4" => base64_decode("dXNlcl9maWx0ZXIudXNlcm" . "lk"), "_5a41aa961" . "f592408a9a" . "61999dd5e8" . "716" => base64_decode("dGFza3M" . "="), "_3c438e5e63445b53f7d" . "e51913730eeab" => base64_decode("bnVsbA=" . "="), "_bd71c3b5c201fc11db82e" . "d14ce424de5" => base64_decode("aW5fYXJy" . "YXk="), "_ab4dfd87d145d75d75de" . "516340ef9ff7" => base64_decode("Y3VycmVudF9wYW" . "dl"), "_443572667073a876d130667" . "41ac29ddc" => base64_decode("Y3VycmVu" . "dF90YXNr" . "X2ZpbHRl" . "cg=="), "_94da6f8e3935231c6388b960af6c66a" . "0" => base64_decode("Y3VycmVudF9zdGF0dXNfZmls" . "dGVy"), "_4d707fab" . "93bebb00b" . "be69e8159" . "697c90" => base64_decode(""), "_8049953e" . "4dc05c920" . "624bfc969" . "9ec914" => base64_decode("dXNlcl9maWx0ZX" . "JfbmFtZQ=="), "_029e56d13d3fd0cf1" . "9c57147a7cbc1d3" => base64_decode("c3RhdHVzX2ZpbHRlcnMuanNvb" . "g=="), "_450a3d298" . "c253fb6ae7" . "5989a3c867" . "2bd" => base64_decode("YmxvY2tlZF91" . "c2Vy"), "_dadf790" . "baf241af" . "ac942824" . "c1e6e37c" . "4" => base64_decode("dHlwZQ" . "=="), "_eda98f944736a5fcdd" . "2f1c1da57d9a33" => base64_decode("dGFza19maWx0" . "ZXJfY291bnQ="), "_7ad145538a0defd90f2675b9e26706" . "90" => base64_decode("dGFza3Muan" . "Nvbg=="), "_e6e7dfad56c171da06b2b3836fabb74" . "9" => base64_decode("aW5pdGlhbF91c2VyX2Zpb" . "HRlcg=="), "_a9834e0cb9aa774e1463ccab" . "7f3d96ae" => base64_decode("c2Vhcm" . "NoVGVy" . "bXM="), "_e8ab057bfdbbf917e39b957a6bd1" . "3dc4" => base64_decode("ZHVyYXRpb25fdW5pd" . "HM="), "_74c47fccaadd7a9eb189" . "5d296395ee66" => base64_decode("dGFza19jb3" . "VudA=="), "_52789c385d501c3bef" . "52dd18f122b683" => base64_decode("c3RhdHVz" . "X2ZpbHRl" . "cl9jb3Vu" . "dA=="), "_d289957c1157" . "1e628c94b0697" . "f80d114" => base64_decode("dGFza19m" . "aWx0ZXJz" . "Lmpzb24="));
use Claromentis\Core\Localization\Lmsg;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\Core\TextUtil\ClaText;
use Claromentis\People\Repository\UserRepository;
use Claromentis\People\Service\UserExtranetService;
use Claromentis\People\UrlGenerator;
use Claromentis\Projects\PermissionsChecker;
use Claromentis\Projects\Repository\ProjectRepository;
use Claromentis\Projects\Model\Task;
use Claromentis\Projects\TaskListFilter;
use Claromentis\Projects\Repository\TaskRepository;
class TaskListView
{
    const TASKS_PER_PAGE = 20;
    
    
    protected TaskRepository $task_repository;
    
    
    protected ProjectRepository $project_repository;
    
    
    protected array $args;
    
    
    protected PermissionsChecker $permissions_checker;
    
    
    protected UserRepository $user_repository;
    
    
    protected UrlGenerator $url_generator;
    
    
    protected UserExtranetService $extranets;
    
    
    protected SecurityContext $security_context;
    protected Lmsg $lmsg;
    
    
    protected ClaText $cla_text;
    public function __construct(TaskRepository $task_repository, ProjectRepository $project_repository, PermissionsChecker $permissions_checker, UserRepository $user_repository, UrlGenerator $url_generator, UserExtranetService $extranets, Lmsg $lmsg, SecurityContext $security_context, ClaText $cla_text)
    {
        $this->task_repository = $task_repository;
        $this->project_repository = $project_repository;
        $this->permissions_checker = $permissions_checker;
        $this->user_repository = $user_repository;
        $this->url_generator = $url_generator;
        $this->extranets = $extranets;
        $this->lmsg = $lmsg;
        $this->security_context = $security_context;
        $this->cla_text = $cla_text;
    }
    public function SetArgsArray(&$_bbcdf77b6167a26a35212c8181097030)
    {
        $this->args =& $_bbcdf77b6167a26a35212c8181097030;
    }
    public function GetTaskListJson($_5a41aa961f592408a9a61999dd5e8716)
    {
        $task_view = new TaskView($this->permissions_checker, $this->project_repository, $this->user_repository, $this->url_generator, $this->extranets, $this->lmsg, $this->security_context, $this->cla_text);
        $_e28dabd9c9509a974c59500c4c91b342 = array();
        foreach ($_5a41aa961f592408a9a61999dd5e8716 as $_696b535739055ed7d827709916d07dea) {
            
            
            $_e28dabd9c9509a974c59500c4c91b342[] = $task_view->ShowTaskJs($_696b535739055ed7d827709916d07dea->GetInfo());
        }
        return $_e28dabd9c9509a974c59500c4c91b342;
    }
    public function ShowTaskList(TaskListFilter $_6daeec015ee6c52ced92781b59ff89b5, $_5a41aa961f592408a9a61999dd5e8716, $_f53d35a1a1e233d98d9ce73d92ab3bb1, SecurityContext $context)
    {
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_7ad145538a0defd90f2675b9e26706" . "90"]] = $this->GetTaskListJson($_5a41aa961f592408a9a61999dd5e8716);
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_74c47fccaadd7a" . "9eb1895d296395e" . "e66"]] = $_f53d35a1a1e233d98d9ce73d92ab3bb1;
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_41a7e5071c1" . "ab9b4f1a73b4" . "694b797df"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetLimit();
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_ab4dfd87" . "d145d75d7" . "5de516340" . "ef9ff7"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetOffset() / $_6daeec015ee6c52ced92781b59ff89b5->GetLimit() + 1;
        $this->args[$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_d289957c11571e628c94" . "b0697f80d114"]] = $this->GetTaskFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context);
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_029e56d" . "13d3fd0c" . "f19c5714" . "7a7cbc1d" . "3"]] = $this->GetStatusFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context);
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_443572667073a876d13066741ac29dd" . "c"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetTaskFilterName();
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_94da6f8e3935231c6388b960af6c66a" . "0"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetStatusFilterName();
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_a9834e0cb9aa774e1463ccab7" . "f3d96ae"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetSearch();
        $this->args[$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_e8ab057bfdbbf917e39b957a6bd" . "13dc4"]] = $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_4d707fa" . "b93bebb0" . "0bbe69e8" . "159697c9" . "0"];
        $_7945aa6526b98d01ea0f6f6f7037bd6e = $_6daeec015ee6c52ced92781b59ff89b5->GetUserFilter();
        if ($_7945aa6526b98d01ea0f6f6f7037bd6e !== null) {
            $this->args[$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_e6e7dfad56c" . "171da06b2b38" . "36fabb749"]] = $_7945aa6526b98d01ea0f6f6f7037bd6e;
            $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_bbd8fd6125dfd64a84" . "0290d7589402c4"]] = $_7945aa6526b98d01ea0f6f6f7037bd6e;
        } else {
            $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_e6e7dfad56c171da06b2b3836fa" . "bb749"]] = $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_3c438e5e" . "63445b53f" . "7de519137" . "30eeab"];
        }
    }
    public function GetTaskListJsonView(TaskListFilter $_6daeec015ee6c52ced92781b59ff89b5, $_5a41aa961f592408a9a61999dd5e8716, $_74c47fccaadd7a9eb1895d296395ee66, SecurityContext $context)
    {
        $_24e0e36600d6af77406a44bb618a6253 = new \User($_6daeec015ee6c52ced92781b59ff89b5->GetUserFilter());
        $_24e0e36600d6af77406a44bb618a6253->Load();
        $_cf4bba54dac7e0a2bbda16ef041e6ddf = $_6daeec015ee6c52ced92781b59ff89b5->GetUsersFilter();
        $_5a41aa961f592408a9a61999dd5e8716 = array($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_5a41aa961f59" . "2408a9a61999d" . "d5e8716"] => $this->GetTaskListJson($_5a41aa961f592408a9a61999dd5e8716), $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_74c47fccaadd" . "7a9eb1895d296" . "395ee66"] => $_74c47fccaadd7a9eb1895d296395ee66, $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_41a7e5071c1ab9b4f" . "1a73b4694b797df"] => $_6daeec015ee6c52ced92781b59ff89b5->GetLimit(), $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_ab4dfd87d145d75d75de5163" . "40ef9ff7"] => $_6daeec015ee6c52ced92781b59ff89b5->GetOffset() / $_6daeec015ee6c52ced92781b59ff89b5->GetLimit() + 1, $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_eda98f944736a5fcdd2f1c1da" . "57d9a33"] => $this->GetTaskFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context), $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_52789c385d501c3bef52dd18f12" . "2b683"] => $this->GetStatusFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context), $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_849b247e636da664a5c71f3d72" . "b52312"] => $_cf4bba54dac7e0a2bbda16ef041e6ddf, $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_8049953e4dc05c920624bfc9699ec9" . "14"] => $_24e0e36600d6af77406a44bb618a6253->GetFullname());
        
        
        if ($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_bd71c3b5c201fc11db82ed14c" . "e424de5"](TaskRepository::BLOCKED_USER_ID, $_cf4bba54dac7e0a2bbda16ef041e6ddf)) {
            $_5a41aa961f592408a9a61999dd5e8716[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_450a3d298c253fb6ae75989a" . "3c8672bd"]] = 1;
        }
        return $_5a41aa961f592408a9a61999dd5e8716;
    }
    protected function GetTaskFilterCounts(TaskListFilter $_6daeec015ee6c52ced92781b59ff89b5, SecurityContext $context)
    {
        $_5b11047499451be637673be6c81ac563 = $this->task_repository->GetTaskFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context);
        $_4d7412964bbce5f789ca5d293d29f5bf = array();
        foreach ($_5b11047499451be637673be6c81ac563 as $_03e9164d0a343b742df4793268b80767 => $_f53d35a1a1e233d98d9ce73d92ab3bb1) {
            $_4d7412964bbce5f789ca5d293d29f5bf[] = array($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_dadf790baf241afac942824c1e6e" . "37c4"] => $_03e9164d0a343b742df4793268b80767, $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_f53d35a1a1e233d98d9ce73d92ab" . "3bb1"] => $_f53d35a1a1e233d98d9ce73d92ab3bb1, $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_fc4348025b81b628b67" . "a2a0ced823688"] => $_6daeec015ee6c52ced92781b59ff89b5->GetFilterLabel($_03e9164d0a343b742df4793268b80767));
        }
        return $_4d7412964bbce5f789ca5d293d29f5bf;
    }
    protected function GetStatusFilterCounts(TaskListFilter $_6daeec015ee6c52ced92781b59ff89b5, SecurityContext $context)
    {
        $_5b11047499451be637673be6c81ac563 = $this->task_repository->GetStatusFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context);
        $_4d7412964bbce5f789ca5d293d29f5bf = array();
        foreach ($_5b11047499451be637673be6c81ac563 as $_03e9164d0a343b742df4793268b80767 => $_f53d35a1a1e233d98d9ce73d92ab3bb1) {
            $_4d7412964bbce5f789ca5d293d29f5bf[] = array($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_dadf790baf241afac942824" . "c1e6e37c4"] => $_03e9164d0a343b742df4793268b80767, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_f53d35a1a1e233d98" . "d9ce73d92ab3bb1"] => $_f53d35a1a1e233d98d9ce73d92ab3bb1, $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_fc4348025b81b628b67a2a0" . "ced823688"] => $_6daeec015ee6c52ced92781b59ff89b5->GetFilterLabel($_03e9164d0a343b742df4793268b80767));
        }
        return $_4d7412964bbce5f789ca5d293d29f5bf;
    }
}