<?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/linked_tickets.html.twig */
class __TwigTemplate_009877efabf30471ac063355282b98dd 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 "
<input type=\"hidden\" name=\"_link[tickets_id_1]\" value=\"";
        // line 33
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v0 = CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "fields", [], "any", false, false, false, 33)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["id"] ?? null) : null), "html", null, true);
        yield "\" />

";
        // line 35
        $context["linked_tickets"] = ((array_key_exists("linked_tickets", $context)) ? (Twig\Extension\CoreExtension::default(($context["linked_tickets"] ?? null), CoreExtension::getAttribute($this->env, $this->source, ($context["ticket_ticket"] ?? null), "getLinkedTicketsTo", [(($_v1 = CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "fields", [], "any", false, false, false, 35)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["id"] ?? null) : null), true], "method", false, false, false, 35))) : (CoreExtension::getAttribute($this->env, $this->source, ($context["ticket_ticket"] ?? null), "getLinkedTicketsTo", [(($_v2 = CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "fields", [], "any", false, false, false, 35)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["id"] ?? null) : null), true], "method", false, false, false, 35)));
        // line 36
        if ((($tmp = Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["linked_tickets"] ?? null))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 37
            yield "<div class=\"card\">
   <div class=\"list-group list-group-flush list-group-hoverable\">
      ";
            // line 39
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(($context["linked_tickets"] ?? null));
            foreach ($context['_seq'] as $context["id"] => $context["linked"]) {
                // line 40
                yield "      ";
                $context["new_ticket"] = $this->extensions['Glpi\Application\View\Extension\ItemtypeExtension']->getItem("Ticket", (($_v3 = $context["linked"]) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["tickets_id"] ?? null) : null));
                // line 41
                yield "      <div class=\"list-group-item\">
         <div class=\"row\">
            <div class=\"col-auto\">
               ";
                // line 44
                yield $this->extensions['Glpi\Application\View\Extension\PhpExtension']->call("Ticket_Ticket::getLinkName", [(($_v4 =                 // line 45
$context["linked"]) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["link"] ?? null) : null), CoreExtension::getAttribute($this->env, $this->source,                 // line 46
$context["linked"], "tickets_id_1", [], "array", true, true, false, 46), true]);
                // line 48
                yield "
            </div>
            <div class=\"col text-truncate\">
               <a href=\"";
                // line 51
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\ItemtypeExtension']->getItemtypeFormPath("Ticket", (($_v5 = $context["linked"]) && is_array($_v5) || $_v5 instanceof ArrayAccess ? ($_v5["tickets_id"] ?? null) : null)), "html", null, true);
                yield "\" class=\"col-9 overflow-hidden text-nowrap\">
                  ";
                // line 52
                yield CoreExtension::getAttribute($this->env, $this->source, ($context["new_ticket"] ?? null), "getStatusIcon", [(($_v6 = CoreExtension::getAttribute($this->env, $this->source, ($context["new_ticket"] ?? null), "fields", [], "any", false, false, false, 52)) && is_array($_v6) || $_v6 instanceof ArrayAccess ? ($_v6["status"] ?? null) : null)], "method", false, false, false, 52);
                yield "
                  <span title=\"";
                // line 53
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\DataHelpersExtension']->getVerbatimValue((($_v7 = CoreExtension::getAttribute($this->env, $this->source, ($context["new_ticket"] ?? null), "fields", [], "any", false, false, false, 53)) && is_array($_v7) || $_v7 instanceof ArrayAccess ? ($_v7["name"] ?? null) : null)), "html", null, true);
                yield "\" data-bs-toggle=\"tooltip\">
                     ";
                // line 54
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\DataHelpersExtension']->getVerbatimValue((($_v8 = CoreExtension::getAttribute($this->env, $this->source, ($context["new_ticket"] ?? null), "fields", [], "any", false, false, false, 54)) && is_array($_v8) || $_v8 instanceof ArrayAccess ? ($_v8["name"] ?? null) : null)), "html", null, true);
                yield "
                  </span>
                  (";
                // line 56
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v9 = CoreExtension::getAttribute($this->env, $this->source, ($context["new_ticket"] ?? null), "fields", [], "any", false, false, false, 56)) && is_array($_v9) || $_v9 instanceof ArrayAccess ? ($_v9["id"] ?? null) : null), "html", null, true);
                yield ")
               </a>
            </div>

            ";
                // line 60
                if ((($tmp = ($context["canupdate"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                    // line 61
                    yield "               <div class=\"col-auto\">
                  <button type=\"submit\"
                          form=\"linked_tickets_";
                    // line 63
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["main_rand"] ?? null), "html", null, true);
                    yield "\"
                          name=\"id\"
                          value=\"";
                    // line 65
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["id"], "html", null, true);
                    yield "\"
                          class=\"btn btn-sm btn-ghost-danger\"
                          title=\"";
                    // line 67
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(_x("button", "Delete permanently"), "html", null, true);
                    yield "\"
                          data-bs-toggle=\"tooltip\">
                     <i class=\"fas fa-unlink\"></i>
                  </button>
               </div>
            ";
                }
                // line 73
                yield "         </div>
      </div>
      ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['id'], $context['linked'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 76
            yield "   </div>
</div>
";
        }
        // line 79
        yield "
";
        // line 80
        if ((($context["canupdate"] ?? null) &&  !(($_v10 = ($context["params"] ?? null)) && is_array($_v10) || $_v10 instanceof ArrayAccess ? ($_v10["template_preview"] ?? null) : null))) {
            // line 81
            yield "   ";
            $context["has_pending_link"] = (Twig\Extension\CoreExtension::length($this->env->getCharset(), (($_v11 = (($_v12 = ($context["params"] ?? null)) && is_array($_v12) || $_v12 instanceof ArrayAccess ? ($_v12["_link"] ?? null) : null)) && is_array($_v11) || $_v11 instanceof ArrayAccess ? ($_v11["tickets_id_2"] ?? null) : null)) > 0);
            // line 82
            yield "   <div class=\"mt-2\">
      <button class=\"btn btn-sm btn-ghost-secondary ";
            // line 83
            yield (((($tmp = ($context["has_pending_link"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("d-none") : (""));
            yield "\" type=\"button\"
               data-bs-toggle=\"collapse\" data-bs-target=\"#link_ticket_dropdowns\"
               aria-expanded=\"false\" aria-controls=\"link_ticket_dropdowns\" onclick=\"\$(this).hide();\">
         <i class=\"fas fa-plus\"></i>
         <span>";
            // line 87
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Add"), "html", null, true);
            yield "</span>
      </button>

      <span class=\"collapse ";
            // line 90
            yield (((($tmp = ($context["has_pending_link"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("show") : (""));
            yield "\" id=\"link_ticket_dropdowns\">
         ";
            // line 91
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["ticket_ticket"] ?? null), "dropdownLinks", ["_link[link]", (((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source,             // line 93
($context["params"] ?? null), "_link", [], "array", false, true, false, 93), "link", [], "array", true, true, false, 93) &&  !(null === (($_v13 = (($_v14 = ($context["params"] ?? null)) && is_array($_v14) || $_v14 instanceof ArrayAccess ? ($_v14["_link"] ?? null) : null)) && is_array($_v13) || $_v13 instanceof ArrayAccess ? ($_v13["link"] ?? null) : null)))) ? ((($_v15 = (($_v16 = ($context["params"] ?? null)) && is_array($_v16) || $_v16 instanceof ArrayAccess ? ($_v16["_link"] ?? null) : null)) && is_array($_v15) || $_v15 instanceof ArrayAccess ? ($_v15["link"] ?? null) : null)) : (""))], "method", false, false, false, 91), "html", null, true);
            // line 94
            yield "

         ";
            // line 96
            yield CoreExtension::getAttribute($this->env, $this->source, ($context["item"] ?? null), "dropdown", [["name" => "_link[tickets_id_2]", "used" => [(($_v17 = CoreExtension::getAttribute($this->env, $this->source,             // line 98
($context["item"] ?? null), "fields", [], "any", false, false, false, 98)) && is_array($_v17) || $_v17 instanceof ArrayAccess ? ($_v17["id"] ?? null) : null)], "displaywith" => ["id"], "display" => false, "value" => (((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source,             // line 101
($context["params"] ?? null), "_link", [], "array", false, true, false, 101), "tickets_id_2", [], "array", true, true, false, 101) &&  !(null === (($_v18 = (($_v19 = ($context["params"] ?? null)) && is_array($_v19) || $_v19 instanceof ArrayAccess ? ($_v19["_link"] ?? null) : null)) && is_array($_v18) || $_v18 instanceof ArrayAccess ? ($_v18["tickets_id_2"] ?? null) : null)))) ? ((($_v20 = (($_v21 = ($context["params"] ?? null)) && is_array($_v21) || $_v21 instanceof ArrayAccess ? ($_v21["_link"] ?? null) : null)) && is_array($_v20) || $_v20 instanceof ArrayAccess ? ($_v20["tickets_id_2"] ?? null) : null)) : (""))]], "method", false, false, false, 96);
            // line 102
            yield "
      </span>
   </div>
";
        }
        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  180 => 102,  178 => 101,  177 => 98,  176 => 96,  172 => 94,  170 => 93,  169 => 91,  165 => 90,  159 => 87,  152 => 83,  149 => 82,  146 => 81,  144 => 80,  141 => 79,  136 => 76,  128 => 73,  119 => 67,  114 => 65,  109 => 63,  105 => 61,  103 => 60,  96 => 56,  91 => 54,  87 => 53,  83 => 52,  79 => 51,  74 => 48,  72 => 46,  71 => 45,  70 => 44,  65 => 41,  62 => 40,  58 => 39,  54 => 37,  52 => 36,  50 => 35,  45 => 33,  42 => 32,);
    }

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