<?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/priority_matrix.html.twig */
class __TwigTemplate_b174dda52ee6c6fe7e7a920eb14b630e 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
        $context["rand"] = Twig\Extension\CoreExtension::random($this->env->getCharset());
        // line 35
        yield "
";
        // line 36
        $context["urgency_options"] = Twig\Extension\CoreExtension::merge(($context["field_options"] ?? null), ["disabled" => (!(        // line 37
($context["canupdate"] ?? null) || ($context["can_requester"] ?? null)))]);
        // line 39
        if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["field_options"] ?? null), "fields_template", [], "any", false, false, false, 39), "isMandatoryField", ["urgency"], "method", false, false, false, 39)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 40
            yield "   ";
            $context["urgency_options"] = Twig\Extension\CoreExtension::merge(($context["urgency_options"] ?? null), ["required" => true]);
        }
        // line 44
        yield "
";
        // line 45
        yield $macros["fields"]->getTemplateForMacro("macro_field", $context, 45, $this->getSourceContext())->macro_field(...["urgency", CoreExtension::getAttribute($this->env, $this->source,         // line 47
($context["item"] ?? null), "dropdownUrgency", [Twig\Extension\CoreExtension::merge(["value" => (($_v0 = CoreExtension::getAttribute($this->env, $this->source,         // line 48
($context["item"] ?? null), "fields", [], "any", false, false, false, 48)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["urgency"] ?? null) : null), "width" => "100%", "display" => false, "rand" =>         // line 51
($context["rand"] ?? null)],         // line 52
($context["urgency_options"] ?? null))], "method", false, false, false, 47), __("Urgency"),         // line 54
($context["field_options"] ?? null)]);
        // line 55
        yield "

";
        // line 57
        $context["impact_options"] = ($context["field_options"] ?? null);
        // line 58
        if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["field_options"] ?? null), "fields_template", [], "any", false, false, false, 58), "isMandatoryField", ["impact"], "method", false, false, false, 58)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 59
            yield "   ";
            $context["impact_options"] = Twig\Extension\CoreExtension::merge(($context["impact_options"] ?? null), ["required" => true]);
        }
        // line 63
        yield "
";
        // line 64
        yield $macros["fields"]->getTemplateForMacro("macro_field", $context, 64, $this->getSourceContext())->macro_field(...["impact", CoreExtension::getAttribute($this->env, $this->source,         // line 66
($context["item"] ?? null), "dropdownImpact", [Twig\Extension\CoreExtension::merge(["value" => (($_v1 = CoreExtension::getAttribute($this->env, $this->source,         // line 67
($context["item"] ?? null), "fields", [], "any", false, false, false, 67)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["impact"] ?? null) : null), "width" => "100%", "display" => false, "rand" =>         // line 70
($context["rand"] ?? null)],         // line 71
($context["impact_options"] ?? null))], "method", false, false, false, 66), __("Impact"),         // line 73
($context["field_options"] ?? null)]);
        // line 74
        yield "

";
        // line 76
        $context["priority_options"] = Twig\Extension\CoreExtension::merge(($context["field_options"] ?? null), ["disabled" => (!        // line 77
($context["canpriority"] ?? null)), "withmajor" => true]);
        // line 80
        if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["field_options"] ?? null), "fields_template", [], "any", false, false, false, 80), "isMandatoryField", ["priority"], "method", false, false, false, 80)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 81
            yield "   ";
            $context["priority_options"] = Twig\Extension\CoreExtension::merge(($context["priority_options"] ?? null), ["required" => true]);
        }
        // line 85
        yield "
";
        // line 86
        yield $macros["fields"]->getTemplateForMacro("macro_field", $context, 86, $this->getSourceContext())->macro_field(...["priority", CoreExtension::getAttribute($this->env, $this->source,         // line 88
($context["item"] ?? null), "dropdownPriority", [Twig\Extension\CoreExtension::merge(["value" => (($_v2 = CoreExtension::getAttribute($this->env, $this->source,         // line 89
($context["item"] ?? null), "fields", [], "any", false, false, false, 89)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["priority"] ?? null) : null), "width" => "100%", "display" => false, "rand" =>         // line 92
($context["rand"] ?? null)], Twig\Extension\CoreExtension::merge(        // line 93
($context["field_options"] ?? null), ($context["priority_options"] ?? null)))], "method", false, false, false, 88), __("Priority"),         // line 95
($context["field_options"] ?? null)]);
        // line 96
        yield "

<script type=\"text/javascript\">
\$(function() {
   \$(\x27#dropdown_urgency";
        // line 100
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield ", #dropdown_impact";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27).on(\x27change.select2\x27, function (e) {
      \$.ajax({
         url: \"";
        // line 102
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\RoutingExtension']->path("/ajax/priority.php"), "html", null, true);
        yield "\",
         datatype: \x27json\x27,
         data: {
            \x27urgency\x27: \$(\x27#dropdown_urgency";
        // line 105
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27).select2(\x27data\x27) ? \$(\x27#dropdown_urgency";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27).select2(\x27data\x27)[0].id : 0,
            \x27impact\x27:  \$(\x27#dropdown_impact";
        // line 106
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27).select2(\x27data\x27) ? \$(\x27#dropdown_impact";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27).select2(\x27data\x27)[0].id : 0,
            \x27_predefined_fields\x27:  \$(\x27input[name=\"_predefined_fields\"]\x27).val(),
            \x27getJson\x27: true,
         }
      }).done(function(data) {
         \$(\x27#dropdown_priority";
        // line 111
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27).val(data.priority);
         \$(\x27#dropdown_priority";
        // line 112
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27).trigger(\x27change\x27);
      });
   })
});
</script>
";
        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  155 => 112,  151 => 111,  141 => 106,  135 => 105,  129 => 102,  122 => 100,  116 => 96,  114 => 95,  113 => 93,  112 => 92,  111 => 89,  110 => 88,  109 => 86,  106 => 85,  102 => 81,  100 => 80,  98 => 77,  97 => 76,  93 => 74,  91 => 73,  90 => 71,  89 => 70,  88 => 67,  87 => 66,  86 => 64,  83 => 63,  79 => 59,  77 => 58,  75 => 57,  71 => 55,  69 => 54,  68 => 52,  67 => 51,  66 => 48,  65 => 47,  64 => 45,  61 => 44,  57 => 40,  55 => 39,  53 => 37,  52 => 36,  49 => 35,  47 => 34,  45 => 33,  42 => 32,);
    }

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