<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;

/* components/itilobject/fields/global_validation.html.twig */
class __TwigTemplate_d913dacfe1317f4aadc8886ef47b1265 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 32
        yield "
";
        // line 33
        $macros["fields"] = $this->macros["fields"] = $this->load("components/form/fields_macros.html.twig", 33)->unwrap();
        // line 34
        yield "
";
        // line 35
        $context["validation"] = CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "getValidationClassInstance", [], "method", false, false, false, 35);
        // line 36
        yield "
";
        // line 37
        if ((($tmp =  !(null === ($context["validation"] ?? null))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 38
            yield "   ";
            $context["create_right_val"] = Twig\Extension\CoreExtension::constant("CREATE");
            // line 39
            yield "   ";
            $context["validation_right"] = "validate";
            // line 40
            yield "   ";
            if ((CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "getType", [], "method", false, false, false, 40) == "Ticket")) {
                // line 41
                yield "      ";
                if (((($_v0 = ($context["params"] ?? null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["type"] ?? null) : null) == Twig\Extension\CoreExtension::constant("Ticket::INCIDENT_TYPE"))) {
                    // line 42
                    yield "         ";
                    $context["create_right_val"] = Twig\Extension\CoreExtension::constant("TicketValidation::CREATEINCIDENT");
                    // line 43
                    yield "         ";
                    $context["validation_right"] = "validate_incident";
                    // line 44
                    yield "      ";
                } elseif (((($_v1 = ($context["params"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["type"] ?? null) : null) == Twig\Extension\CoreExtension::constant("Ticket::DEMAND_TYPE"))) {
                    // line 45
                    yield "         ";
                    $context["create_right_val"] = Twig\Extension\CoreExtension::constant("TicketValidation::CREATEREQUEST");
                    // line 46
                    yield "         ";
                    $context["validation_right"] = "validate_request";
                    // line 47
                    yield "      ";
                }
                // line 48
                yield "   ";
            }
            // line 49
            yield "   ";
            $context["can_create"] = Session::haveRight($this->extensions['Glpi\Application\View\Extension\PhpExtension']->getStatic(($context["validation"] ?? null), "rightname"), ($context["create_right_val"] ?? null));
            // line 50
            yield "
   ";
            // line 51
            if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "isNewItem", [], "method", false, false, false, 51)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 52
                yield "      ";
                if ((($tmp = ($context["can_create"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                    // line 53
                    yield "         ";
                    $context["required"] = [];
                    // line 54
                    yield "         ";
                    if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["field_options"] ?? null), "fields_template", [], "any", false, false, false, 54), "isMandatoryField", ["_add_validation"], "method", false, false, false, 54)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                        // line 55
                        yield "            ";
                        $context["required"] = ["required" => true];
                        // line 58
                        yield "         ";
                    }
                    // line 59
                    yield "
         ";
                    // line 60
                    yield $macros["fields"]->getTemplateForMacro("macro_field", $context, 60, $this->getSourceContext())->macro_field(...["_add_validation", CoreExtension::getAttribute($this->env, $this->source,                     // line 62
($context["validation"] ?? null), "dropdownValidator", [Twig\Extension\CoreExtension::merge(["name" => "users_id_validate", "entity" => (($_v2 = CoreExtension::getAttribute($this->env, $this->source,                     // line 64
($context["item"] ?? null), "fields", [], "any", false, false, false, 64)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["entities_id"] ?? null) : null), "right" =>                     // line 65
($context["validation_right"] ?? null), "users_id_validate" => (($_v3 =                     // line 66
($context["params"] ?? null)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["users_id_validate"] ?? null) : null), "display" => false, "disabled" => (!                    // line 68
($context["canupdate"] ?? null))],                     // line 69
($context["required"] ?? null))], "method", false, false, false, 62), __("Approval request"),                     // line 71
($context["field_options"] ?? null)]);
                    // line 72
                    yield "

         <input type=\"hidden\" name=\"_add_validation\" value=\"";
                    // line 74
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v4 = ($context["params"] ?? null)) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["_add_validation"] ?? null) : null), "html", null, true);
                    yield "\" />
      ";
                }
                // line 76
                yield "   ";
            } else {
                // line 77
                yield "        ";
                if ((($tmp =  !CoreExtension::getAttribute($this->env, $this->source, ($context["itiltemplate"] ?? null), "isHiddenField", ["global_validation"], "method", false, false, false, 77)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                    // line 78
                    yield "            ";
                    yield $macros["fields"]->getTemplateForMacro("macro_htmlField", $context, 78, $this->getSourceContext())->macro_htmlField(...["global_validation", $this->extensions['Glpi\Application\View\Extension\PhpExtension']->call("TicketValidation::getStatus", [(($_v5 = CoreExtension::getAttribute($this->env, $this->source,                     // line 80
($context["item"] ?? null), "fields", [], "any", false, false, false, 80)) && is_array($_v5) || $_v5 instanceof ArrayAccess ? ($_v5["global_validation"] ?? null) : null), true]), $this->extensions['Glpi\Application\View\Extension\ItemtypeExtension']->getItemtypeName("CommonITILValidation"),                     // line 82
($context["field_options"] ?? null)]);
                    // line 83
                    yield "
        ";
                }
                // line 85
                yield "   ";
            }
        }
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "components/itilobject/fields/global_validation.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  149 => 85,  145 => 83,  143 => 82,  142 => 80,  140 => 78,  137 => 77,  134 => 76,  129 => 74,  125 => 72,  123 => 71,  122 => 69,  121 => 68,  120 => 66,  119 => 65,  118 => 64,  117 => 62,  116 => 60,  113 => 59,  110 => 58,  107 => 55,  104 => 54,  101 => 53,  98 => 52,  96 => 51,  93 => 50,  90 => 49,  87 => 48,  84 => 47,  81 => 46,  78 => 45,  75 => 44,  72 => 43,  69 => 42,  66 => 41,  63 => 40,  60 => 39,  57 => 38,  55 => 37,  52 => 36,  50 => 35,  47 => 34,  45 => 33,  42 => 32,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "components/itilobject/fields/global_validation.html.twig", "C:\\xampp\\htdocs\\itsm\\templates\\components\\itilobject\\fields\\global_validation.html.twig");
    }
}
