<?php
namespace Claromentis\Projects\View;

$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] = (@$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"] ?: array()) + array("_dadf790baf241afac942824c1e6" . "e37c4" => base64_decode("dH" . "lw" . "ZQ" . "=="), "_3c438e5e63445b53f7de51913730eea" . "b" => base64_decode("bnVsbA=" . "="), "_443572667073a876d13066741ac29d" . "dc" => base64_decode("Y3VycmVudF90YXNrX2ZpbHRlc" . "g=="), "_bd71c3b5c201fc11db" . "82ed14ce424de5" => base64_decode("aW5fYXJyYXk" . "="), "_74c47fccaadd7a9eb1" . "895d296395ee66" => base64_decode("dGFza19jb3VudA=" . "="), "_a9834e0" . "cb9aa774" . "e1463cca" . "b7f3d96a" . "e" => base64_decode("c2VhcmNoVGVy" . "bXM="), "_5a41aa961f59240" . "8a9a61999dd5e871" . "6" => base64_decode("dGFza3" . "M="), "_94da6f8e3935231c6388b" . "960af6c66a0" => base64_decode("Y3VycmVudF9zdGF0dXNfZmlsdG" . "Vy"), "_450a3d298c253fb6ae75989a3" . "c8672bd" => base64_decode("YmxvY2tl" . "ZF91c2Vy"), "_8049953e4dc05c920624bfc9699e" . "c914" => base64_decode("dXNlcl9maWx0ZXJfbmFtZ" . "Q=="), "_fc4348025b81b628b67a2a0ced8236" . "88" => base64_decode("bGF" . "iZW" . "w="), "_849b247e636da664a5c71f3d7" . "2b52312" => base64_decode("ZmlsdGVyZWRfdXNlcl9pZ" . "HM="), "_52789c385d501c3bef52dd18f" . "122b683" => base64_decode("c3RhdHVzX2ZpbHRlcl9jb3Vu" . "dA=="), "_bbd8fd6125dfd64a840290d75" . "89402c4" => base64_decode("dXNlcl" . "9maWx0" . "ZXIudX" . "Nlcmlk"), "_41a7e5071c1ab9b4f1a" . "73b4694b797df" => base64_decode("dGFza3NfcG" . "VyX3BhZ2U="), "_4d707fab93bebb00bbe69e8" . "159697c90" => base64_decode(""), "_7ad145538a0" . "defd90f2675b" . "9e2670690" => base64_decode("dGFza3MuanNvbg" . "=="), "_e6e7dfad56c171da06b2b3836fab" . "b749" => base64_decode("aW5pdGlhbF91c2VyX2ZpbHRl" . "cg=="), "_e8ab057bfdbbf917e39b" . "957a6bd13dc4" => base64_decode("ZHVyYXRpb25fdW" . "5pdHM="), "_f53d35a1" . "a1e233d98" . "d9ce73d92" . "ab3bb1" => base64_decode("Y291bn" . "Q="), "_eda98f94473" . "6a5fcdd2f1c1" . "da57d9a33" => base64_decode("dGFza19maWx0ZXJfY" . "291bnQ="), "_ab4dfd87d145d75d75de516340e" . "f9ff7" => base64_decode("Y3VycmVudF9wYW" . "dl"), "_029e56d13d3fd0cf19c5714" . "7a7cbc1d3" => base64_decode("c3RhdHVz" . "X2ZpbHRl" . "cnMuanNv" . "bg=="), "_d289957c11571e" . "628c94b0697f80d" . "114" => base64_decode("dGFza19maWx0ZXJzLmpzb2" . "4="));
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["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_7ad145538a0defd90f2675b9e26706" . "90"]] = $this->GetTaskListJson($_5a41aa961f592408a9a61999dd5e8716);
        $this->args[$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_74c47fcca" . "add7a9eb18" . "95d296395e" . "e66"]] = $_f53d35a1a1e233d98d9ce73d92ab3bb1;
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_41a7e5071c1ab9b4f1a73b4694" . "b797df"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetLimit();
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_ab4dfd87d145d75d75de51634" . "0ef9ff7"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetOffset() / $_6daeec015ee6c52ced92781b59ff89b5->GetLimit() + 1;
        $this->args[$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_d289957c11571e628c94b0" . "697f80d114"]] = $this->GetTaskFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context);
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_029e56d13d3fd0cf19c57147a7cbc1" . "d3"]] = $this->GetStatusFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context);
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_443572667073" . "a876d13066741" . "ac29ddc"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetTaskFilterName();
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_94da6f8e3935231c" . "6388b960af6c66a0"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetStatusFilterName();
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_a9834e0cb9aa774e1463c" . "cab7f3d96ae"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetSearch();
        $this->args[$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_e8ab057bfdbb" . "f917e39b957a6" . "bd13dc4"]] = $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_4d707fab93be" . "bb00bbe69e815" . "9697c90"];
        $_7945aa6526b98d01ea0f6f6f7037bd6e = $_6daeec015ee6c52ced92781b59ff89b5->GetUserFilter();
        if ($_7945aa6526b98d01ea0f6f6f7037bd6e !== null) {
            $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_e6e7dfad5" . "6c171da06b" . "2b3836fabb" . "749"]] = $_7945aa6526b98d01ea0f6f6f7037bd6e;
            $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_bbd8fd6125dfd64a8402" . "90d7589402c4"]] = $_7945aa6526b98d01ea0f6f6f7037bd6e;
        } else {
            $this->args[$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_e6e7dfad56c171da06b2b3836fabb" . "749"]] = $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_3c438e5e63445b53f7d" . "e51913730eeab"];
        }
    }
    public function GetTaskListJsonView(TaskListFilter $_6daeec015ee6c52ced92781b59ff89b5, $_5a41aa961f592408a9a61999dd5e8716, $_74c47fccaadd7a9eb1895d296395ee66, SecurityContext $context)
    {
        $_24e0e36600d6af77406a44bb618a6253 = new \User($_6daeec015ee6c52ced92781b59ff89b5->GetUserFilter());
        $_24e0e36600d6af77406a44bb618a6253->Load();
        $_cf4bba54dac7e0a2bbda16ef041e6ddf = $_6daeec015ee6c52ced92781b59ff89b5->GetUsersFilter();
        $_5a41aa961f592408a9a61999dd5e8716 = array($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_5a41aa961f592408a9a619" . "99dd5e8716"] => $this->GetTaskListJson($_5a41aa961f592408a9a61999dd5e8716), $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_74c47fccaadd7a9eb1895d296395" . "ee66"] => $_74c47fccaadd7a9eb1895d296395ee66, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_41a7e5071c1ab9b4f1a73b4" . "694b797df"] => $_6daeec015ee6c52ced92781b59ff89b5->GetLimit(), $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_ab4dfd87d145d75d" . "75de516340ef9ff7"] => $_6daeec015ee6c52ced92781b59ff89b5->GetOffset() / $_6daeec015ee6c52ced92781b59ff89b5->GetLimit() + 1, $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_eda98f944" . "736a5fcdd2" . "f1c1da57d9" . "a33"] => $this->GetTaskFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context), $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_52789c385d501c3bef52dd18f12" . "2b683"] => $this->GetStatusFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context), $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_849b247e636da664a5c71f3d72b5231" . "2"] => $_cf4bba54dac7e0a2bbda16ef041e6ddf, $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_8049953e4dc05c920624bfc9699" . "ec914"] => $_24e0e36600d6af77406a44bb618a6253->GetFullname());
        
        
        if ($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_bd71c3b5c201fc11db82ed1" . "4ce424de5"](TaskRepository::BLOCKED_USER_ID, $_cf4bba54dac7e0a2bbda16ef041e6ddf)) {
            $_5a41aa961f592408a9a61999dd5e8716[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_450a3d298c253fb6ae" . "75989a3c8672bd"]] = 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["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_dadf790baf241afac942824c1e6e" . "37c4"] => $_03e9164d0a343b742df4793268b80767, $GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_f53d35a1a1e233d98d" . "9ce73d92ab3bb1"] => $_f53d35a1a1e233d98d9ce73d92ab3bb1, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_fc4348025b81b6" . "28b67a2a0ced823" . "688"] => $_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["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_dadf790baf241afac9" . "42824c1e6e37c4"] => $_03e9164d0a343b742df4793268b80767, $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_f53d35a" . "1a1e233d" . "98d9ce73" . "d92ab3bb" . "1"] => $_f53d35a1a1e233d98d9ce73d92ab3bb1, $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_fc4348025b81b628b67a2a0c" . "ed823688"] => $_6daeec015ee6c52ced92781b59ff89b5->GetFilterLabel($_03e9164d0a343b742df4793268b80767));
        }
        return $_4d7412964bbce5f789ca5d293d29f5bf;
    }
}