<?php
namespace Claromentis\Projects\Controller;

$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"] ?: array()) + array("_23ee3a3acf1" . "36b0ea01bdf2" . "e160d70d8" => base64_decode("dXNlcl9m" . "aWx0ZXJb" . "XQ=="), "_e2b890faba95" . "4638ed5fb0b91" . "6074b17" => base64_decode("c3RhdHVzX2ZpbH" . "Rlcg=="), "_fe55f93e48d864ac4b43fc2e85a1" . "009b" => base64_decode("Zm9s" . "bG93" . "aW5n"), "_e1b7238fbb" . "46439026e86" . "9e060d6ca47" => base64_decode("Zm" . "9y" . "bW" . "F0"), "_e2cd02b34604b" . "b4da597fe440cf" . "e476e" => base64_decode("c2Vhc" . "mNo"), "_221da17e3055fae8d3ff5" . "16b832a5f3b" => base64_decode("cG" . "Fn" . "ZQ" . "=="), "_f1def1d21fe735cbe235c3" . "ee7c3f40e8" => base64_decode("bXlfdGFz" . "a3M="), "_3ad1a241788d519" . "21db8e8da90d8e23" . "3" => base64_decode("cHJvamVjdHMudGFza3M" . "uYWxsX3Rhc2tzLnBhZ2" . "VfdGl0bGU="), "_010f509c58" . "d10b12c9e4b" . "dac039c949b" => base64_decode("cHJvamVjdHMvdGF" . "za3MuaHRtbA=="), "_1176607" . "3989415d" . "b2de3cb7" . "58629f2f" . "1" => base64_decode("b3" . "Bl" . "bg" . "=="), "_7276e0af756e529d30af7aaaf" . "e4e7784" => base64_decode("YXJ" . "jaG" . "l2Z" . "WQ="), "_8a3181b19afc8e1b261825a5c" . "3caaad4" => base64_decode("dGFza19" . "maWx0ZX" . "I="), "_e523fcec62349451c998f12cda4b" . "c14f" => base64_decode("cmVjZW50bHlfY29tcGx" . "ldGU="), "_060fa61" . "33a3ca86" . "189c7d11" . "1690787c" . "a" => base64_decode("YWxsX3Rhc2t" . "z"), "_ed5f03d686c37933b5943f29" . "5c6b4a43" => base64_decode("anNvbg" . "=="));
use Claromentis\Core\Http\RequestData;
use Claromentis\Core\Localization\Lmsg;
use Claromentis\Core\TextUtil\ClaText;
use Claromentis\People\Repository\UserRepository;
use Claromentis\Core\Http\JsonPrettyResponse;
use Claromentis\Core\Http\TemplaterCallResponse;
use Claromentis\Core\Security\SecurityContext;
use Claromentis\People\Service\UserExtranetService;
use Claromentis\People\UrlGenerator;
use Claromentis\Projects\DisplayOrder;
use Claromentis\Projects\PermissionsChecker;
use Claromentis\Projects\Repository\ProjectRepository;
use Claromentis\Projects\TaskListFilter;
use Claromentis\Projects\Repository\TaskRepository;
use Claromentis\Projects\View\TaskListView;




class TaskListController
{
    public function ShowAllTasks(RequestData $request_data, PermissionsChecker $permissions_checker, ProjectRepository $project_repository, TaskRepository $task_repository, SecurityContext $context, UserRepository $user_repository, UrlGenerator $url_generator, UserExtranetService $extranets, Lmsg $lmsg, ClaText $cla_text)
    {
        $_e2cd02b34604bb4da597fe440cfe476e = $request_data->Get($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_e2cd02b34604bb4da" . "597fe440cfe476e"], null);
        $_8a3181b19afc8e1b261825a5c3caaad4 = $request_data->Get($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_8a3181b19afc" . "8e1b261825a5c" . "3caaad4"], null);
        $_e2b890faba954638ed5fb0b916074b17 = $request_data->Get($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_e2b890faba95463" . "8ed5fb0b916074b1" . "7"], null);
        $_e1b7238fbb46439026e869e060d6ca47 = $request_data->Get($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_e1b7238fbb46439" . "026e869e060d6ca4" . "7"], null);
        $_221da17e3055fae8d3ff516b832a5f3b = $request_data->Get($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_221da17e3" . "055fae8d3f" . "f516b832a5" . "f3b"], 1);
        $_cf4bba54dac7e0a2bbda16ef041e6ddf = $request_data->Get($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_23ee3a3acf136" . "b0ea01bdf2e160" . "d70d8"], []);
        switch ($_8a3181b19afc8e1b261825a5c3caaad4) {
            case $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_fe55f93e48d" . "864ac4b43fc2" . "e85a1009b"]:
                $_8a3181b19afc8e1b261825a5c3caaad4 = TaskListFilter::FILTER_FOLLOWING;
                break;
            case $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_060fa6133a3ca86189c7d11" . "1690787ca"]:
                $_8a3181b19afc8e1b261825a5c3caaad4 = TaskListFilter::FILTER_ALL_TASKS;
                break;
            case $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_f1def1d21fe735cbe235" . "c3ee7c3f40e8"]:
            default:
                $_8a3181b19afc8e1b261825a5c3caaad4 = TaskListFilter::FILTER_MY_TASKS;
                break;
        }
        switch ($_e2b890faba954638ed5fb0b916074b17) {
            case $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_e523fcec62349451c998f12cda4bc1" . "4f"]:
                $_e2b890faba954638ed5fb0b916074b17 = TaskListFilter::FILTER_RECENTLY_COMPLETE;
                break;
            case $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_7276e0af7" . "56e529d30a" . "f7aaafe4e7" . "784"]:
                $_e2b890faba954638ed5fb0b916074b17 = TaskListFilter::FILTER_ARCHIVED;
                break;
            case $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_11766073989415db2de3cb758629f" . "2f1"]:
            default:
                $_e2b890faba954638ed5fb0b916074b17 = TaskListFilter::FILTER_OPEN;
                break;
        }
        $_6daeec015ee6c52ced92781b59ff89b5 = new TaskListFilter();
        if ($_8a3181b19afc8e1b261825a5c3caaad4 !== null) {
            $_6daeec015ee6c52ced92781b59ff89b5->SetTaskFilter($_8a3181b19afc8e1b261825a5c3caaad4);
            $_6daeec015ee6c52ced92781b59ff89b5->SetStatusFilter($_e2b890faba954638ed5fb0b916074b17);
        }
        $_6daeec015ee6c52ced92781b59ff89b5->SetUsersFilter($_cf4bba54dac7e0a2bbda16ef041e6ddf);
        $_6daeec015ee6c52ced92781b59ff89b5->SetSearch($_e2cd02b34604bb4da597fe440cfe476e);
        $_6daeec015ee6c52ced92781b59ff89b5->SetLimit(TaskListView::TASKS_PER_PAGE);
        $_6daeec015ee6c52ced92781b59ff89b5->SetOffset(($_221da17e3055fae8d3ff516b832a5f3b - 1) * TaskListView::TASKS_PER_PAGE);
        $_b1303d0f07feee61ff8309d770fe04ca = $permissions_checker->DoIHaveFullAccess();
        if ($_b1303d0f07feee61ff8309d770fe04ca) {
            $_6daeec015ee6c52ced92781b59ff89b5->SetIsAdmin(true);
        } else {
            $_6daeec015ee6c52ced92781b59ff89b5->SetProjectIds($project_repository->GetMyProjects());
        }
        $_5a41aa961f592408a9a61999dd5e8716 = $task_repository->GetTasks($_6daeec015ee6c52ced92781b59ff89b5, $context, DisplayOrder::TYPE_MY_TASKS);
        $_74c47fccaadd7a9eb1895d296395ee66 = $task_repository->GetTaskCount($_6daeec015ee6c52ced92781b59ff89b5, $context);
        $view = new TaskListView($task_repository, $project_repository, $permissions_checker, $user_repository, $url_generator, $extranets, $lmsg, $context, $cla_text);
        if ($_e1b7238fbb46439026e869e060d6ca47 === $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_ed5f03d686c37933b594" . "3f295c6b4a43"]) {
            return new JsonPrettyResponse($view->GetTaskListJsonView($_6daeec015ee6c52ced92781b59ff89b5, $_5a41aa961f592408a9a61999dd5e8716, $_74c47fccaadd7a9eb1895d296395ee66, $context));
        }
        $_bbcdf77b6167a26a35212c8181097030 = array();
        $view->SetArgsArray($_bbcdf77b6167a26a35212c8181097030);
        $view->ShowTaskList($_6daeec015ee6c52ced92781b59ff89b5, $_5a41aa961f592408a9a61999dd5e8716, $_74c47fccaadd7a9eb1895d296395ee66, $context);
        $_678d945258a520c3df1c42fe4b558f34 = $lmsg($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_3ad1a2417" . "88d51921db" . "8e8da90d8e" . "233"]);
        $_a0624a55e60ee7aae11f61e56eea7c0c = $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_010f509c58d10b12c9" . "e4bdac039c949b"];
        return new TemplaterCallResponse($_a0624a55e60ee7aae11f61e56eea7c0c, $_bbcdf77b6167a26a35212c8181097030, $_678d945258a520c3df1c42fe4b558f34);
    }
}