<?php
namespace Claromentis\Projects\View;

$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"] ?: array()) + array("_dadf790baf241a" . "fac942824c1e6e3" . "7c4" => base64_decode("dHlwZQ" . "=="), "_44357266707" . "3a876d130667" . "41ac29ddc" => base64_decode("Y3VycmVudF90" . "YXNrX2ZpbHRl" . "cg=="), "_52789c385d501c3bef" . "52dd18f122b683" => base64_decode("c3RhdHVzX2ZpbHRlcl9jb3Vu" . "dA=="), "_41a7e5071c1ab9b4f1a73b4694b797" . "df" => base64_decode("dGFza3NfcGVyX3BhZ" . "2U="), "_bd71c3b5c201fc11db82ed14ce424de" . "5" => base64_decode("aW5fYXJyY" . "Xk="), "_bbd8fd6125dfd64a" . "840290d7589402c4" => base64_decode("dXNlcl9maWx0ZXIudXNlcm" . "lk"), "_e8ab057b" . "fdbbf917e" . "39b957a6b" . "d13dc4" => base64_decode("ZHVyYXRpb25fdW5pd" . "HM="), "_029e56d1" . "3d3fd0cf1" . "9c57147a7" . "cbc1d3" => base64_decode("c3RhdHVz" . "X2ZpbHRl" . "cnMuanNv" . "bg=="), "_5a41aa96" . "1f592408a" . "9a61999dd" . "5e8716" => base64_decode("dGFza3M" . "="), "_849b247e636da664a5c71f3" . "d72b52312" => base64_decode("ZmlsdGVyZWRfdXNlcl9pZ" . "HM="), "_74c47fccaadd7" . "a9eb1895d29639" . "5ee66" => base64_decode("dGFza19jb3V" . "udA=="), "_450a3d298c253fb6ae7598" . "9a3c8672bd" => base64_decode("YmxvY2tlZF91c2V" . "y"), "_7ad145538a0defd90f2675b9e2" . "670690" => base64_decode("dGFza3Mu" . "anNvbg=="), "_a9834e0cb9aa774e14" . "63ccab7f3d96ae" => base64_decode("c2VhcmNo" . "VGVybXM="), "_3c438e5e63445b53f7de51913730eea" . "b" => base64_decode("bnVsbA" . "=="), "_f53d35a1a1e233d" . "98d9ce73d92ab3bb" . "1" => base64_decode("Y291bnQ" . "="), "_d289957c11571e628c94b" . "0697f80d114" => base64_decode("dGFza1" . "9maWx0" . "ZXJzLm" . "pzb24="), "_4d707fab93bebb00bbe" . "69e8159697c90" => base64_decode(""), "_fc4348025b81b628b67a2" . "a0ced823688" => base64_decode("bGFiZWw" . "="), "_eda98f944736a5fcdd2f1c1da57d9a3" . "3" => base64_decode("dGFza19maWx0ZXJfY291" . "bnQ="), "_e6e7dfad56c171" . "da06b2b3836fabb" . "749" => base64_decode("aW5pdGlhbF91c2VyX2ZpbHRlcg=" . "="), "_8049953e4dc05c920624bfc96" . "99ec914" => base64_decode("dXNlcl" . "9maWx0" . "ZXJfbm" . "FtZQ=="), "_94da6f8e3935231c" . "6388b960af6c66a0" => base64_decode("Y3VycmVudF9zdGF" . "0dXNfZmlsdGVy"), "_ab4dfd87d14" . "5d75d75de516" . "340ef9ff7" => base64_decode("Y3VycmVudF9w" . "YWdl"));
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["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_7ad14553" . "8a0defd90" . "f2675b9e2" . "670690"]] = $this->GetTaskListJson($_5a41aa961f592408a9a61999dd5e8716);
        $this->args[$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_74c47fccaadd7a9eb1895d2" . "96395ee66"]] = $_f53d35a1a1e233d98d9ce73d92ab3bb1;
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_41a7e5071c1ab9b4f1a73b4694b7" . "97df"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetLimit();
        $this->args[$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_ab4dfd87d145d75d75de5163" . "40ef9ff7"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetOffset() / $_6daeec015ee6c52ced92781b59ff89b5->GetLimit() + 1;
        $this->args[$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_d289957c11571e628c94b0697f80d11" . "4"]] = $this->GetTaskFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context);
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_029e56d13d3fd0cf19c57147a7" . "cbc1d3"]] = $this->GetStatusFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context);
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_443572667073a876d13066741" . "ac29ddc"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetTaskFilterName();
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_94da6f8e39" . "35231c6388b" . "960af6c66a0"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetStatusFilterName();
        $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_a9834e0cb9aa774e1463ccab7f3d9" . "6ae"]] = $_6daeec015ee6c52ced92781b59ff89b5->GetSearch();
        $this->args[$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_e8ab057bfdbbf917e39b957" . "a6bd13dc4"]] = $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_4d707fab93bebb00bbe69e8159" . "697c90"];
        $_7945aa6526b98d01ea0f6f6f7037bd6e = $_6daeec015ee6c52ced92781b59ff89b5->GetUserFilter();
        if ($_7945aa6526b98d01ea0f6f6f7037bd6e !== null) {
            $this->args[$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_e6e7dfad56c171da06b2b3836fab" . "b749"]] = $_7945aa6526b98d01ea0f6f6f7037bd6e;
            $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_bbd8fd6125dfd64" . "a840290d7589402c" . "4"]] = $_7945aa6526b98d01ea0f6f6f7037bd6e;
        } else {
            $this->args[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_e6e7dfad56c171da06b2b3836f" . "abb749"]] = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_3c438e5e63445b53f7de5191373" . "0eeab"];
        }
    }
    public function GetTaskListJsonView(TaskListFilter $_6daeec015ee6c52ced92781b59ff89b5, $_5a41aa961f592408a9a61999dd5e8716, $_74c47fccaadd7a9eb1895d296395ee66, SecurityContext $context)
    {
        $_24e0e36600d6af77406a44bb618a6253 = new \User($_6daeec015ee6c52ced92781b59ff89b5->GetUserFilter());
        $_24e0e36600d6af77406a44bb618a6253->Load();
        $_cf4bba54dac7e0a2bbda16ef041e6ddf = $_6daeec015ee6c52ced92781b59ff89b5->GetUsersFilter();
        $_5a41aa961f592408a9a61999dd5e8716 = array($GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_5a41aa961f592408a9a61999dd5e8" . "716"] => $this->GetTaskListJson($_5a41aa961f592408a9a61999dd5e8716), $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_74c47fccaadd7a" . "9eb1895d296395e" . "e66"] => $_74c47fccaadd7a9eb1895d296395ee66, $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_41a7e5071c1ab9b4f1a73b46" . "94b797df"] => $_6daeec015ee6c52ced92781b59ff89b5->GetLimit(), $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_ab4dfd87d145d75d7" . "5de516340ef9ff7"] => $_6daeec015ee6c52ced92781b59ff89b5->GetOffset() / $_6daeec015ee6c52ced92781b59ff89b5->GetLimit() + 1, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_eda98f944736a" . "5fcdd2f1c1da57" . "d9a33"] => $this->GetTaskFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context), $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_52789c385d501c3be" . "f52dd18f122b683"] => $this->GetStatusFilterCounts($_6daeec015ee6c52ced92781b59ff89b5, $context), $GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_849b247e636d" . "a664a5c71f3d7" . "2b52312"] => $_cf4bba54dac7e0a2bbda16ef041e6ddf, $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_8049953e4dc05c920624bfc" . "9699ec914"] => $_24e0e36600d6af77406a44bb618a6253->GetFullname());
        
        
        if ($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_bd71c3b5c2" . "01fc11db82e" . "d14ce424de5"](TaskRepository::BLOCKED_USER_ID, $_cf4bba54dac7e0a2bbda16ef041e6ddf)) {
            $_5a41aa961f592408a9a61999dd5e8716[$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_450a3d298c253fb" . "6ae75989a3c8672b" . "d"]] = 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["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_dadf790baf241afac94" . "2824c1e6e37c4"] => $_03e9164d0a343b742df4793268b80767, $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_f53d35a1a1e233d98d9ce73d92ab3" . "bb1"] => $_f53d35a1a1e233d98d9ce73d92ab3bb1, $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_fc4348025b81b628b67a2a0ced8" . "23688"] => $_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["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_dadf790baf241afac9428" . "24c1e6e37c4"] => $_03e9164d0a343b742df4793268b80767, $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_f53d35a1a1e233d98d9ce" . "73d92ab3bb1"] => $_f53d35a1a1e233d98d9ce73d92ab3bb1, $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_fc4348025b81b628b67a2" . "a0ced823688"] => $_6daeec015ee6c52ced92781b59ff89b5->GetFilterLabel($_03e9164d0a343b742df4793268b80767));
        }
        return $_4d7412964bbce5f789ca5d293d29f5bf;
    }
}