var\cache\dev\twig\27\271d57e45666b6f843bb4a584410a463.php line 33

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* @UVDeskCoreFramework/Snippets/createMemberTicket.html.twig */
  14. class __TwigTemplate_9c671b3b871cb8e24b0b97f1478020a3 extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.     }
  26.     protected function doDisplay(array $context, array $blocks = [])
  27.     {
  28.         $macros $this->macros;
  29.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  30.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@UVDeskCoreFramework/Snippets/createMemberTicket.html.twig"));
  31.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  32.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""@UVDeskCoreFramework/Snippets/createMemberTicket.html.twig"));
  33.         // line 1
  34.         echo "<style>
  35.     .mce-path {
  36.       \t\tdisplay: none !important;
  37. \t}
  38. </style>
  39. ";
  40.         // line 6
  41.         $context["isTicketViewPage"] = ("helpdesk_member_ticket" == twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'6$this->source); })()), "request", [], "any"falsefalsefalse6), "attributes", [], "any"falsefalsefalse6), "get", [=> "_route"], "method"falsefalsefalse6));
  42.         // line 7
  43.         echo "
  44. <div class=\"uv-pop-up-overlay uv-no-error-success-icon\" id=\"create-ticket-modal\">
  45.     <div class=\"uv-pop-up-box uv-pop-up-wide\">
  46.         <span class=\"uv-pop-up-close\"></span>
  47.         <h2>Create Ticket</h2>
  48.         <form action=\"";
  49.         // line 12
  50.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("helpdesk_member_create_ticket");
  51.         echo "\" method=\"post\" id=\"create-ticket-form\" enctype=\"multipart/form-data\">
  52.             ";
  53.         // line 14
  54.         echo "            ";
  55.         if ( !(isset($context["isTicketViewPage"]) || array_key_exists("isTicketViewPage"$context) ? $context["isTicketViewPage"] : (function () { throw new RuntimeError('Variable "isTicketViewPage" does not exist.'14$this->source); })())) {
  56.             // line 15
  57.             echo "                ";
  58.             // line 16
  59.             echo "                <div class=\"uv-element-block\">
  60.                     <label class=\"uv-field-label\">";
  61.             // line 17
  62.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Name"), "html"nulltrue);
  63.             echo "</label>
  64.                     <div class=\"uv-field-block\">
  65.                         <input name=\"name\" class=\"uv-field create-ticket\" type=\"text\" value=\"\">
  66.                     </div>
  67.                     <span class=\"uv-field-info\">";
  68.             // line 21
  69.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Customer full name"), "html"nulltrue);
  70.             echo "</span>
  71.                 </div>
  72.                 ";
  73.             // line 25
  74.             echo "                <div class=\"uv-element-block\">
  75.                     <label class=\"uv-field-label\">";
  76.             // line 26
  77.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Email"), "html"nulltrue);
  78.             echo "</label>
  79.                     <div class=\"uv-field-block\">
  80.                         <input name=\"from\" class=\"uv-field create-ticket\" type=\"text\" value=\"\">
  81.                     </div>
  82.                     <span class=\"uv-field-info\">";
  83.             // line 30
  84.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Customer email address"), "html"nulltrue);
  85.             echo "</span>
  86.                 </div>
  87.             ";
  88.         } else {
  89.             // line 33
  90.             echo "                ";
  91.             // line 34
  92.             echo "                <span class=\"uv-field-info\">";
  93.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Ticket will be created with current ticket's customer"), "html"nulltrue);
  94.             echo "</span>
  95.             ";
  96.         }
  97.         // line 36
  98.         echo "
  99.             ";
  100.         // line 38
  101.         echo "            <div class=\"uv-element-block\">
  102.                 <label class=\"uv-field-label\">";
  103.         // line 39
  104.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Type"), "html"nulltrue);
  105.         echo "</label>
  106.                 <div class=\"uv-field-block\">
  107.                     <select name=\"type\" class=\"uv-select create-ticket\" id=\"type\">
  108.                         <option value=\"\">";
  109.         // line 42
  110.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Select type"), "html"nulltrue);
  111.         echo "</option>
  112.                             ";
  113.         // line 43
  114.         $context['_parent'] = $context;
  115.         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source, (isset($context["ticket_service"]) || array_key_exists("ticket_service"$context) ? $context["ticket_service"] : (function () { throw new RuntimeError('Variable "ticket_service" does not exist.'43$this->source); })()), "getTypes", [], "method"falsefalsefalse43));
  116.         foreach ($context['_seq'] as $context["_key"] => $context["type"]) {
  117.             // line 44
  118.             echo "                                <option value=\"";
  119.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["type"], "id", [], "any"falsefalsefalse44), "html"nulltrue);
  120.             echo "\" ";
  121.             echo (((twig_get_attribute($this->env$this->source, ($context["post"] ?? null), "type", [], "any"truetruefalse44) && (twig_get_attribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'44$this->source); })()), "type", [], "any"falsefalsefalse44) == twig_get_attribute($this->env$this->source$context["type"], "id", [], "any"falsefalsefalse44)))) ? ("selected") : (""));
  122.             echo ">";
  123.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["type"], "name", [], "any"falsefalsefalse44), "html"nulltrue);
  124.             echo "
  125.                                 </option>
  126.                             ";
  127.         }
  128.         $_parent $context['_parent'];
  129.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['type'], $context['_parent'], $context['loop']);
  130.         $context array_intersect_key($context$_parent) + $_parent;
  131.         // line 47
  132.         echo "                    </select>
  133.                 </div>
  134.                 <span class=\"uv-field-info\">";
  135.         // line 49
  136.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Choose ticket type"), "html"nulltrue);
  137.         echo "</span>
  138.             </div>
  139.             ";
  140.         // line 53
  141.         echo "            <div class=\"uv-element-block\">
  142.                 <label class=\"uv-field-label\">";
  143.         // line 54
  144.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Subject"), "html"nulltrue);
  145.         echo "</label>
  146.                 <div class=\"uv-field-block\">
  147.                     <input name=\"subject\" class=\"uv-field create-ticket\" type=\"text\" value=\"\">
  148.                 </div>
  149.                 <span class=\"uv-field-info\">";
  150.         // line 59
  151.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Ticket subject"), "html"nulltrue);
  152.         echo "</span>
  153.             </div>
  154.             ";
  155.         // line 63
  156.         echo "            <div class=\"uv-element-block\">
  157.                 <label class=\"uv-field-label\">";
  158.         // line 64
  159.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Message"), "html"nulltrue);
  160.         echo "</label>
  161.                 <div class=\"uv-field-block\">
  162.                     <textarea name=\"reply\" id=\"create-reply\" class=\"uv-field create-ticket\" type=\"text\">";
  163.         // line 66
  164.         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["ticket_service"]) || array_key_exists("ticket_service"$context) ? $context["ticket_service"] : (function () { throw new RuntimeError('Variable "ticket_service" does not exist.'66$this->source); })()), "getAgentDraftReply", [], "method"falsefalsefalse66), "html"nulltrue);
  165.         echo "</textarea>
  166.                 </div>
  167.                 
  168.                 <span class=\"uv-field-info\">";
  169.         // line 69
  170.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Ticket query message"), "html"nulltrue);
  171.         echo "</span>
  172.             </div>
  173.             ";
  174.         // line 73
  175.         echo "            <div class=\"uv-element-block attachment-block uv-no-error-success-icon\" id=\"uv-attachment-option\">
  176.                 <label>
  177.                     <span class=\"uv-file-label\">";
  178.         // line 75
  179.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Add Attachment"), "html"nulltrue);
  180.         echo "</span>
  181.                 </label>
  182.             </div>
  183.             ";
  184.         // line 80
  185.         echo "            ";
  186.         $context["removeMe"] = [];
  187.         // line 81
  188.         echo "            ";
  189.         if ((isset($context["headerCustomFields"]) || array_key_exists("headerCustomFields"$context) ? $context["headerCustomFields"] : (function () { throw new RuntimeError('Variable "headerCustomFields" does not exist.'81$this->source); })())) {
  190.             // line 82
  191.             echo "                <div class=\"custom-fields clearfix\">
  192.                     ";
  193.             // line 83
  194.             $context['_parent'] = $context;
  195.             $context['_seq'] = twig_ensure_traversable((isset($context["headerCustomFields"]) || array_key_exists("headerCustomFields"$context) ? $context["headerCustomFields"] : (function () { throw new RuntimeError('Variable "headerCustomFields" does not exist.'83$this->source); })()));
  196.             foreach ($context['_seq'] as $context["key"] => $context["customField"]) {
  197.                 // line 84
  198.                 echo "                        <div class=\"uv-element-block input-group ";
  199.                 echo ((twig_length_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "customFieldsDependency", [], "any"falsefalsefalse84))) ? ("dependent") : (""));
  200.                 echo " ";
  201.                 $context['_parent'] = $context;
  202.                 $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["customField"], "customFieldsDependency", [], "any"falsefalsefalse84));
  203.                 foreach ($context['_seq'] as $context["_key"] => $context["customFieldCustomFieldsDependency"]) {
  204.                     echo " dependency";
  205.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customFieldCustomFieldsDependency"], "id", [], "any"falsefalsefalse84), "html"nulltrue);
  206.                 }
  207.                 $_parent $context['_parent'];
  208.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['customFieldCustomFieldsDependency'], $context['_parent'], $context['loop']);
  209.                 $context array_intersect_key($context$_parent) + $_parent;
  210.                 echo "\" style=\"position: relative; ";
  211.                 echo ((twig_length_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "customFieldsDependency", [], "any"falsefalsefalse84))) ? ("display: none;") : (""));
  212.                 echo "\">
  213.                             <label class=\"uv-field-label\" for=\"for";
  214.                 // line 85
  215.                 echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse85) . twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse85)), "html"nulltrue);
  216.                 echo "\">";
  217.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse85), "html"nulltrue);
  218.                 echo "</label>
  219.                             ";
  220.                 // line 86
  221.                 if ((twig_get_attribute($this->env$this->source$context["customField"], "fieldType", [], "any"falsefalsefalse86) == "text")) {
  222.                     // line 87
  223.                     echo "                                <div class=\"uv-field-block\">
  224.                                     <input type=\"";
  225.                     // line 88
  226.                     ((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsetruefalse88), "fieldtype", [], "array"truetruefalse88)) ? (print (twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse88), "fieldtype", [], "array"falsefalsefalse88), "html"nulltrue))) : (print ("text")));
  227.                     echo "\" name=\"customFields[";
  228.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse88), "html"nulltrue);
  229.                     echo "]\" class=\"uv-field create-ticket\" value=\"\" ";
  230.                     echo ((twig_get_attribute($this->env$this->source$context["customField"], "required", [], "any"falsefalsefalse88)) ? ("required") : (""));
  231.                     echo " id=\"for";
  232.                     echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse88) . twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse88)), "html"nulltrue);
  233.                     echo "\" placeholder=\"";
  234.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "placeholder", [], "any"falsefalsefalse88), "html"nulltrue);
  235.                     echo "\">
  236.                                 </div>
  237.                             ";
  238.                 } elseif (twig_in_filter(twig_get_attribute($this->env$this->source,                 // line 91
  239. $context["customField"], "fieldType", [], "any"falsefalsefalse91), [=> "date"=> "time"=> "datetime"])) {
  240.                     // line 92
  241.                     echo "                                <div class=\"uv-field-block\">
  242.                                     <input class=\"uv-field form-control create-ticket uv-date-picker ";
  243.                     // line 93
  244.                     if ((twig_get_attribute($this->env$this->source$context["customField"], "fieldType", [], "any"falsefalsefalse93) == "time")) {
  245.                         echo "time";
  246.                     } else {
  247.                         echo "calendar";
  248.                     }
  249.                     echo " uv-header-";
  250.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "fieldType", [], "any"falsefalsefalse93), "html"nulltrue);
  251.                     echo "\" type=\"text\" name=\"customFields[";
  252.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse93), "html"nulltrue);
  253.                     echo "]\" ";
  254.                     echo ((twig_get_attribute($this->env$this->source$context["customField"], "required", [], "any"falsefalsefalse93)) ? ("required") : (""));
  255.                     echo " id=\"for";
  256.                     echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse93) . twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse93)), "html"nulltrue);
  257.                     echo "\" value=\"\">
  258.                                 </div>
  259.                             ";
  260.                 } elseif ((twig_get_attribute($this->env$this->source,                 // line 95
  261. $context["customField"], "fieldType", [], "any"falsefalsefalse95) == "textarea")) {
  262.                     // line 96
  263.                     echo "                                <div class=\"uv-field-block\">
  264.                                     <textarea name=\"customFields[";
  265.                     // line 97
  266.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse97), "html"nulltrue);
  267.                     echo "]\" class=\"uv-field create-ticket\" ";
  268.                     echo ((twig_get_attribute($this->env$this->source$context["customField"], "required", [], "any"falsefalsefalse97)) ? ("required") : (""));
  269.                     echo " id=\"for";
  270.                     echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse97) . twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse97)), "html"nulltrue);
  271.                     echo "\"></textarea>
  272.                                 </div>
  273.                             ";
  274.                 } elseif (twig_in_filter(twig_get_attribute($this->env$this->source,                 // line 100
  275. $context["customField"], "fieldType", [], "any"falsefalsefalse100), [=> "file"])) {
  276.                     // line 101
  277.                     echo "                                <div class=\"uv-field-block\">
  278.                                     <input type=\"file\" name=\"customFields[";
  279.                     // line 102
  280.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse102), "html"nulltrue);
  281.                     echo "]\" class=\"uv-field create-ticket\" ";
  282.                     echo ((twig_get_attribute($this->env$this->source$context["customField"], "required", [], "any"falsefalsefalse102)) ? ("required") : (""));
  283.                     echo " id=\"for";
  284.                     echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse102) . twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse102)), "html"nulltrue);
  285.                     echo "\">
  286.                                 </div>
  287.                             ";
  288.                 } elseif (twig_in_filter(twig_get_attribute($this->env$this->source,                 // line 105
  289. $context["customField"], "fieldType", [], "any"falsefalsefalse105), [=> "select"])) {
  290.                     // line 106
  291.                     echo "                                ";
  292.                     if ( !twig_test_empty(twig_get_attribute($this->env$this->source$context["customField"], "customFieldValues", [], "any"falsefalsefalse106))) {
  293.                         // line 107
  294.                         echo "                                    <div class=\"uv-field-block\">
  295.                                         <select name=\"customFields[";
  296.                         // line 108
  297.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse108), "html"nulltrue);
  298.                         echo "]\" class=\"uv-select create-ticket\" id=\"for";
  299.                         echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse108) . twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse108)), "html"nulltrue);
  300.                         echo "\" ";
  301.                         echo ((twig_get_attribute($this->env$this->source$context["customField"], "required", [], "any"falsefalsefalse108)) ? ("required") : (""));
  302.                         echo ">
  303.                                             <option value=\"\">";
  304.                         // line 109
  305.                         echo "Select option";
  306.                         echo "</option>
  307.                                             ";
  308.                         // line 110
  309.                         $context['_parent'] = $context;
  310.                         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["customField"], "customFieldValues", [], "any"falsefalsefalse110));
  311.                         foreach ($context['_seq'] as $context["_key"] => $context["customFieldValues"]) {
  312.                             // line 111
  313.                             echo "                                                <option value=\"";
  314.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customFieldValues"], "id", [], "any"falsefalsefalse111), "html"nulltrue);
  315.                             echo "\">";
  316.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customFieldValues"], "name", [], "any"falsefalsefalse111), "html"nulltrue);
  317.                             echo "</option>
  318.                                             ";
  319.                         }
  320.                         $_parent $context['_parent'];
  321.                         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['customFieldValues'], $context['_parent'], $context['loop']);
  322.                         $context array_intersect_key($context$_parent) + $_parent;
  323.                         // line 113
  324.                         echo "                                        </select>
  325.                                     </div>
  326.                                 ";
  327.                     } else {
  328.                         // line 116
  329.                         echo "                                    <!--Hide this beacause choices aren't available-->
  330.                                     ";
  331.                         // line 117
  332.                         $context["removeMe"] = twig_array_merge((isset($context["removeMe"]) || array_key_exists("removeMe"$context) ? $context["removeMe"] : (function () { throw new RuntimeError('Variable "removeMe" does not exist.'117$this->source); })()), [=> (("for" twig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse117)) . twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse117))]);
  333.                         // line 118
  334.                         echo "                                ";
  335.                     }
  336.                     // line 119
  337.                     echo "
  338.                             ";
  339.                 } elseif (twig_in_filter(twig_get_attribute($this->env$this->source,                 // line 120
  340. $context["customField"], "fieldType", [], "any"falsefalsefalse120), [=> "checkbox"])) {
  341.                     // line 121
  342.                     echo "                                ";
  343.                     if ( !twig_test_empty(twig_get_attribute($this->env$this->source$context["customField"], "customFieldValues", [], "any"falsefalsefalse121))) {
  344.                         // line 122
  345.                         echo "                                    ";
  346.                         $context['_parent'] = $context;
  347.                         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["customField"], "customFieldValues", [], "any"falsefalsefalse122));
  348.                         foreach ($context['_seq'] as $context["_key"] => $context["customFieldValues"]) {
  349.                             // line 123
  350.                             echo "                                        <div class=\"uv-split-field\">
  351.                                             <label>
  352.                                                 <div class=\"uv-checkbox\">
  353.                                                     <input type=\"checkbox\" name=\"customFields[";
  354.                             // line 126
  355.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse126), "html"nulltrue);
  356.                             echo "][]\" value=\"";
  357.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customFieldValues"], "id", [], "any"falsefalsefalse126), "html"nulltrue);
  358.                             echo "\" id=\"for";
  359.                             echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customFieldValues"], "name", [], "any"falsefalsefalse126) . twig_get_attribute($this->env$this->source$context["customFieldValues"], "id", [], "any"falsefalsefalse126)), "html"nulltrue);
  360.                             echo "\" class=\"create-ticket\"/>
  361.                                                     <span class=\"uv-checkbox-view\"></span>
  362.                                                 </div>
  363.                                                 <span class=\"uv-radio-label\" for=\"for";
  364.                             // line 129
  365.                             echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customFieldValues"], "name", [], "any"falsefalsefalse129) . twig_get_attribute($this->env$this->source$context["customFieldValues"], "id", [], "any"falsefalsefalse129)), "html"nulltrue);
  366.                             echo "\">";
  367.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customFieldValues"], "name", [], "any"falsefalsefalse129), "html"nulltrue);
  368.                             echo "</span>
  369.                                             </label>
  370.                                         </div>
  371.                                     ";
  372.                         }
  373.                         $_parent $context['_parent'];
  374.                         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['customFieldValues'], $context['_parent'], $context['loop']);
  375.                         $context array_intersect_key($context$_parent) + $_parent;
  376.                         // line 133
  377.                         echo "                                ";
  378.                     } else {
  379.                         // line 134
  380.                         echo "                                    <!--Hide this beacause choices aren't available-->
  381.                                     ";
  382.                         // line 135
  383.                         $context["removeMe"] = twig_array_merge((isset($context["removeMe"]) || array_key_exists("removeMe"$context) ? $context["removeMe"] : (function () { throw new RuntimeError('Variable "removeMe" does not exist.'135$this->source); })()), [=> (("for" twig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse135)) . twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse135))]);
  384.                         // line 136
  385.                         echo "                                ";
  386.                     }
  387.                     // line 137
  388.                     echo "
  389.                             ";
  390.                 } elseif (twig_in_filter(twig_get_attribute($this->env$this->source,                 // line 138
  391. $context["customField"], "fieldType", [], "any"falsefalsefalse138), [=> "radio"])) {
  392.                     // line 139
  393.                     echo "                                ";
  394.                     if ( !twig_test_empty(twig_get_attribute($this->env$this->source$context["customField"], "customFieldValues", [], "any"falsefalsefalse139))) {
  395.                         // line 140
  396.                         echo "                                    ";
  397.                         $context['_parent'] = $context;
  398.                         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["customField"], "customFieldValues", [], "any"falsefalsefalse140));
  399.                         foreach ($context['_seq'] as $context["_key"] => $context["customFieldValues"]) {
  400.                             // line 141
  401.                             echo "                                        <div class=\"uv-split-field\">
  402.                                             <label>
  403.                                                 <div class=\"uv-radio\">
  404.                                                     <input type=\"radio\" name=\"customFields[";
  405.                             // line 144
  406.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse144), "html"nulltrue);
  407.                             echo "]\" value=\"";
  408.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customFieldValues"], "id", [], "any"falsefalsefalse144), "html"nulltrue);
  409.                             echo "\" id=\"for";
  410.                             echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customFieldValues"], "name", [], "any"falsefalsefalse144) . twig_get_attribute($this->env$this->source$context["customFieldValues"], "id", [], "any"falsefalsefalse144)), "html"nulltrue);
  411.                             echo "\" class=\"create-ticket\"/>
  412.                                                     <span class=\"uv-radio-view\"></span>
  413.                                                 </div>
  414.                                                 <span class=\"uv-radio-label\" for=\"for";
  415.                             // line 147
  416.                             echo twig_escape_filter($this->env, (twig_get_attribute($this->env$this->source$context["customFieldValues"], "name", [], "any"falsefalsefalse147) . twig_get_attribute($this->env$this->source$context["customFieldValues"], "id", [], "any"falsefalsefalse147)), "html"nulltrue);
  417.                             echo "\">";
  418.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customFieldValues"], "name", [], "any"falsefalsefalse147), "html"nulltrue);
  419.                             echo "</span>
  420.                                             </label>
  421.                                         </div>
  422.                                     ";
  423.                         }
  424.                         $_parent $context['_parent'];
  425.                         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['customFieldValues'], $context['_parent'], $context['loop']);
  426.                         $context array_intersect_key($context$_parent) + $_parent;
  427.                         // line 151
  428.                         echo "                                ";
  429.                     } else {
  430.                         // line 152
  431.                         echo "                                    <!--Hide this beacause choices aren't available-->
  432.                                     ";
  433.                         // line 153
  434.                         $context["removeMe"] = twig_array_merge((isset($context["removeMe"]) || array_key_exists("removeMe"$context) ? $context["removeMe"] : (function () { throw new RuntimeError('Variable "removeMe" does not exist.'153$this->source); })()), [=> (("for" twig_get_attribute($this->env$this->source$context["customField"], "name", [], "any"falsefalsefalse153)) . twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse153))]);
  435.                         // line 154
  436.                         echo "                                ";
  437.                     }
  438.                     // line 155
  439.                     echo "
  440.                             ";
  441.                 }
  442.                 // line 157
  443.                 echo "                            ";
  444.                 if (twig_get_attribute($this->env$this->source, ($context["formErrors"] ?? null), (("customFields[" twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse157)) . "]"), [], "array"truetruefalse157)) {
  445.                     // line 158
  446.                     echo "                                <div class=\"text-danger\">";
  447.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["formErrors"]) || array_key_exists("formErrors"$context) ? $context["formErrors"] : (function () { throw new RuntimeError('Variable "formErrors" does not exist.'158$this->source); })()), (("customFields[" twig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse158)) . "]"), [], "array"falsefalsefalse158), "html"nulltrue);
  448.                     echo "</div>
  449.                             ";
  450.                 }
  451.                 // line 160
  452.                 echo "                        </div>
  453.                     ";
  454.             }
  455.             $_parent $context['_parent'];
  456.             unset($context['_seq'], $context['_iterated'], $context['key'], $context['customField'], $context['_parent'], $context['loop']);
  457.             $context array_intersect_key($context$_parent) + $_parent;
  458.             // line 162
  459.             echo "                </div>
  460.             ";
  461.         }
  462.         // line 164
  463.         echo "
  464.             <div class=\"uv-element-block\">
  465.                 <button type=\"submit\" id=\"create-ticket-btn\" class=\"uv-btn\">";
  466.         // line 166
  467.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Create Ticket"), "html"nulltrue);
  468.         echo "</button>
  469.             </div>
  470.         </form>
  471.     </div>
  472. </div>
  473. ";
  474.         // line 172
  475.         if ( !twig_in_filter(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'172$this->source); })()), "request", [], "any"falsefalsefalse172), "attributes", [], "any"falsefalsefalse172), "get", [=> "_route"], "method"falsefalsefalse172), [=> "helpdesk_member_ticket"])) {
  476.             // line 173
  477.             echo "    ";
  478.             echo twig_include($this->env$context"@UVDeskCoreFramework\\Templates\\attachment.html.twig");
  479.             echo "
  480. ";
  481.         }
  482.         // line 175
  483.         echo "
  484. ";
  485.         // line 176
  486.         if (twig_get_attribute($this->env$this->source, (isset($context["user_service"]) || array_key_exists("user_service"$context) ? $context["user_service"] : (function () { throw new RuntimeError('Variable "user_service" does not exist.'176$this->source); })()), "isfileExists", [=> "apps/uvdesk/form-component"], "method"falsefalsefalse176)) {
  487.             // line 177
  488.             echo "<script>
  489.     customFieldValidation = {};
  490.     customHandler = function(value, attr, computedState) {
  491.         if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible') && !\$('[name=\"'+ attr + '[]' + '\"]').parents('.uv-element-block').is(':visible')) {
  492.             return false;
  493.         } else {
  494.             var ele = \$('[name=\"'+ attr + '\"]');
  495.             ele = ele.length ? ele : \$('[name=\"'+ attr + '[]' + '\"]');
  496.             if(ele[0].type == 'radio') {
  497.                 var returnMe = true;
  498.                 \$.each(ele, function(key, eleChild) {
  499.                     if(\$(eleChild).is(':checked')) {
  500.                         returnMe = false;
  501.                     }
  502.                 });
  503.                 return returnMe;
  504.             } else if(ele[0].type == 'checkbox') {
  505.                 var returnMe = true;
  506.                 \$.each(ele, function(key, eleChild) {
  507.                     if(\$(eleChild).is(':checked')) {
  508.                         returnMe = false;
  509.                     }
  510.                 });
  511.                 return returnMe;
  512.             } else if(!\$('#create-ticket-form [name=\"'+ attr + '\"]').val()) {
  513.                 return true;
  514.             }
  515.         }
  516.     };
  517.     _.extend(Backbone.Validation.validators, {
  518.         checkAllowedDomain: function(value, attr, customValue, model) {
  519.             if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible'))
  520.                 return false;
  521.             domain = value.substring(value.indexOf(\"@\") + 1);
  522.             if(customValue && customValue.indexOf(domain) === -1) {
  523.                 return true; //return error
  524.             }
  525.         },
  526.         checkRestrictedDomain: function(value, attr, customValue, model) {
  527.             if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible'))
  528.                 return false;
  529.             domain = value.substring(value.indexOf(\"@\") + 1);
  530.             if(customValue && customValue.indexOf(domain) !== -1) {
  531.                 return true; //return error
  532.             }
  533.         },
  534.         checkMaxFileSize: function(value, attr, customValue, model) {
  535.             if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible'))
  536.                 return false;
  537.             fileInput = \$('input[name=\"' + attr + '\"]')[0] ? \$('input[name=\"' + attr + '\"]')[0] : \$('input[name=\"' + attr + '\"]');
  538.             file = fileInput.files? fileInput.files[0] : '';
  539.             filesize = file ? file.size / 1024 : 0;
  540.             maxSize = (customValue && parseInt(customValue)) ? parseInt(customValue) : 5120;
  541.             
  542.             if(filesize > maxSize) {
  543.                 return true; //return error
  544.             }
  545.         },
  546.         patternOrEmpty: function(value, attr, pattern, model) {
  547.             defaultPatterns = Backbone.Validation.patterns;
  548.             if (value && !value.toString().match(defaultPatterns[pattern] || pattern)) {
  549.                 return true; //error
  550.             }
  551.         },
  552.       minOrEmpty: function(value, attr, minValue, model) {
  553.         if (value && (value < minValue)) {
  554.           return true; //error
  555.         }
  556.       },
  557.       maxOrEmpty: function(value, attr, maxValue, model) {
  558.         if (value && (value > maxValue)) {
  559.           return true; //error
  560.         }
  561.       },
  562.       patternCheck: function(value, attr, pattern, model) {
  563.         if (value && !value.toString().match(pattern)) {
  564.             return true; //error
  565.         }
  566.       },
  567.     });
  568.         ";
  569.             // line 257
  570.             if ((array_key_exists("headerCustomFields"$context) && (isset($context["headerCustomFields"]) || array_key_exists("headerCustomFields"$context) ? $context["headerCustomFields"] : (function () { throw new RuntimeError('Variable "headerCustomFields" does not exist.'257$this->source); })()))) {
  571.                 // line 258
  572.                 echo "            ";
  573.                 $context['_parent'] = $context;
  574.                 $context['_seq'] = twig_ensure_traversable((isset($context["headerCustomFields"]) || array_key_exists("headerCustomFields"$context) ? $context["headerCustomFields"] : (function () { throw new RuntimeError('Variable "headerCustomFields" does not exist.'258$this->source); })()));
  575.                 foreach ($context['_seq'] as $context["_key"] => $context["customField"]) {
  576.                     // line 259
  577.                     echo "                ";
  578.                     $context["fieldtype"] = ((("text" != twig_get_attribute($this->env$this->source$context["customField"], "fieldType", [], "array"falsefalsefalse259))) ? (twig_get_attribute($this->env$this->source$context["customField"], "fieldType", [], "array"falsefalsefalse259)) : (((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsetruefalse259), "fieldtype", [], "array"truetruefalse259)) ? (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse259), "fieldtype", [], "array"falsefalsefalse259)) : ("text"))));
  579.                     // line 260
  580.                     echo "                    customFieldValidation['customFields[' + ";
  581.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse260), "html"nulltrue);
  582.                     echo " + ']'] = [
  583.                     ";
  584.                     // line 261
  585.                     if (( !(twig_in_filter((isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'261$this->source); })()), [=> "checkbox"=> "radio"=> "select"]) && twig_test_empty(twig_get_attribute($this->env$this->source$context["customField"], "customFieldValues", [], "array"falsefalsefalse261))) && twig_get_attribute($this->env$this->source$context["customField"], "required", [], "any"falsefalsefalse261))) {
  586.                         // line 262
  587.                         echo "                        {
  588.                         fn : customHandler,
  589.                         msg : '";
  590.                         // line 264
  591.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html"nulltrue);
  592.                         echo "'
  593.                     },
  594.                     ";
  595.                     }
  596.                     // line 267
  597.                     echo "                    ";
  598.                     if (("number" == (isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'267$this->source); })()))) {
  599.                         // line 268
  600.                         echo "                        {
  601.                             patternOrEmpty : 'number',
  602.                             msg: '";
  603.                         // line 270
  604.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Value is not valid number"), "html"nulltrue);
  605.                         echo "',
  606.                         },
  607.                         ";
  608.                         // line 272
  609.                         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse272), "minNo", [], "array"falsefalsefalse272)) {
  610.                             echo 
  611.                             {
  612.                                 minOrEmpty: ";
  613.                             // line 274
  614.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse274), "minNo", [], "array"falsefalsefalse274), "html"nulltrue);
  615.                             echo ",
  616.                                 msg: '";
  617.                             // line 275
  618.                             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide number greater than %min%", ["%min%" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse275), "minNo", [], "array"falsefalsefalse275)]), "html"nulltrue);
  619.                             echo "',
  620.                             },
  621.                         ";
  622.                         }
  623.                         // line 278
  624.                         echo "                        ";
  625.                         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse278), "maxNo", [], "array"falsefalsefalse278)) {
  626.                             echo 
  627.                         {
  628.                             maxOrEmpty: ";
  629.                             // line 280
  630.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse280), "maxNo", [], "array"falsefalsefalse280), "html"nulltrue);
  631.                             echo ",
  632.                             msg: '";
  633.                             // line 281
  634.                             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide number smaller than %max%", ["%max%" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse281), "maxNo", [], "array"falsefalsefalse281)]), "html"nulltrue);
  635.                             echo "',
  636.                         },
  637.                         ";
  638.                         }
  639.                         // line 284
  640.                         echo "                    ";
  641.                     } elseif (("email" == (isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'284$this->source); })()))) {
  642.                         // line 285
  643.                         echo "                        {
  644.                             patternOrEmpty: /^((([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\$/i,
  645.                             msg: '";
  646.                         // line 287
  647.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Email Address is invalid"), "html"nulltrue);
  648.                         echo "',
  649.                         },
  650.                         ";
  651.                         // line 289
  652.                         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse289), "allowedDomain", [], "array"falsefalsefalse289)) {
  653.                             // line 290
  654.                             echo "                            {
  655.                                 checkAllowedDomain: \"";
  656.                             // line 291
  657.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse291), "allowedDomain", [], "array"falsefalsefalse291), "html"nulltrue);
  658.                             echo "\",
  659.                                 msg: '";
  660.                             // line 292
  661.                             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Domain name should be in accepted domains"), "html"nulltrue);
  662.                             echo "',
  663.                             },
  664.                         ";
  665.                         }
  666.                         // line 295
  667.                         echo "                        ";
  668.                         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse295), "restrictedDomain", [], "array"falsefalsefalse295)) {
  669.                             // line 296
  670.                             echo "                            {
  671.                                 checkRestrictedDomain: \"";
  672.                             // line 297
  673.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse297), "restrictedDomain", [], "array"falsefalsefalse297), "html"nulltrue);
  674.                             echo "\",
  675.                                 msg: '";
  676.                             // line 298
  677.                             echo "Domain name should not be in restricted domains";
  678.                             echo "',
  679.                             } ,
  680.                         ";
  681.                         }
  682.                         // line 301
  683.                         echo "                    ";
  684.                     } elseif (("url" == (isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'301$this->source); })()))) {
  685.                         // line 302
  686.                         echo "                        {
  687.                             patternOrEmpty: 'url',
  688.                             msg: '";
  689.                         // line 304
  690.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide a valid url(with protocol)"), "html"nulltrue);
  691.                         echo "',
  692.                         } ,
  693.                     ";
  694.                     } elseif (("file" ==                     // line 306
  695. (isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'306$this->source); })()))) {
  696.                         // line 307
  697.                         echo "                        {
  698.                             checkMaxFileSize: \"";
  699.                         // line 308
  700.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse308), "maxFileSize", [], "array"falsefalsefalse308), "html"nulltrue);
  701.                         echo "\",
  702.                             msg: '";
  703.                         // line 309
  704.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("file size should not exceed %value% KB", ["%value%" => ((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse309), "maxFileSize", [], "array"falsefalsefalse309)) ? (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse309), "maxFileSize", [], "array"falsefalsefalse309)) : ("5120"))]), "html"nulltrue);
  705.                         echo "',
  706.                         } ,
  707.                     ";
  708.                     }
  709.                     // line 312
  710.                     echo "                    ";
  711.                     if ((( !twig_in_filter((isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'312$this->source); })()), [=> "checkbox"=> "radio"=> "select"]) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsetruefalse312), "regex", [], "array"truetruefalse312)) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse312), "regex", [], "array"falsefalsefalse312))) {
  712.                         // line 313
  713.                         echo "                        {
  714.                             patternCheck: \"";
  715.                         // line 314
  716.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse314), "regex", [], "array"falsefalsefalse314), "html"nulltrue);
  717.                         echo "\",
  718.                             msg: \"";
  719.                         // line 315
  720.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This Field Value is not Valid"), "html"nulltrue);
  721.                         echo "\",
  722.                         } ,
  723.                     ";
  724.                     }
  725.                     // line 318
  726.                     echo "                ];
  727.                 Array.isArray(validationParameters) ? validationParameters.push(value) : false;
  728.             ";
  729.                 }
  730.                 $_parent $context['_parent'];
  731.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['customField'], $context['_parent'], $context['loop']);
  732.                 $context array_intersect_key($context$_parent) + $_parent;
  733.                 // line 321
  734.                 echo "        ";
  735.             }
  736.             // line 322
  737.             echo "        ";
  738.             if ((array_key_exists("CustomerCustomFields"$context) && (isset($context["CustomerCustomFields"]) || array_key_exists("CustomerCustomFields"$context) ? $context["CustomerCustomFields"] : (function () { throw new RuntimeError('Variable "CustomerCustomFields" does not exist.'322$this->source); })()))) {
  739.                 // line 323
  740.                 echo "            ";
  741.                 $context['_parent'] = $context;
  742.                 $context['_seq'] = twig_ensure_traversable((isset($context["CustomerCustomFields"]) || array_key_exists("CustomerCustomFields"$context) ? $context["CustomerCustomFields"] : (function () { throw new RuntimeError('Variable "CustomerCustomFields" does not exist.'323$this->source); })()));
  743.                 foreach ($context['_seq'] as $context["_key"] => $context["customField"]) {
  744.                     // line 324
  745.                     echo "                ";
  746.                     $context["fieldtype"] = ((("text" != twig_get_attribute($this->env$this->source$context["customField"], "fieldType", [], "array"falsefalsefalse324))) ? (twig_get_attribute($this->env$this->source$context["customField"], "fieldType", [], "array"falsefalsefalse324)) : (((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsetruefalse324), "fieldtype", [], "array"truetruefalse324)) ? (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse324), "fieldtype", [], "array"falsefalsefalse324)) : ("text"))));
  747.                     // line 325
  748.                     echo "                    customFieldValidation['customFields[' + ";
  749.                     echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["customField"], "id", [], "any"falsefalsefalse325), "html"nulltrue);
  750.                     echo " + ']'] = [
  751.                     ";
  752.                     // line 326
  753.                     if (( !(twig_in_filter((isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'326$this->source); })()), [=> "checkbox"=> "radio"=> "select"]) && twig_test_empty(twig_get_attribute($this->env$this->source$context["customField"], "customFieldValues", [], "array"falsefalsefalse326))) && twig_get_attribute($this->env$this->source$context["customField"], "required", [], "any"falsefalsefalse326))) {
  754.                         // line 327
  755.                         echo "                        {
  756.                         fn : customHandler,
  757.                         msg : '";
  758.                         // line 329
  759.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html"nulltrue);
  760.                         echo "'
  761.                     },
  762.                     ";
  763.                     }
  764.                     // line 332
  765.                     echo "                    ";
  766.                     if (("number" == (isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'332$this->source); })()))) {
  767.                         // line 333
  768.                         echo "                        {
  769.                             patternOrEmpty : 'number',
  770.                             msg: '";
  771.                         // line 335
  772.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Value is not valid number"), "html"nulltrue);
  773.                         echo "',
  774.                         },
  775.                         ";
  776.                         // line 337
  777.                         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse337), "minNo", [], "array"falsefalsefalse337)) {
  778.                             echo 
  779.                             {
  780.                                 minOrEmpty: ";
  781.                             // line 339
  782.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse339), "minNo", [], "array"falsefalsefalse339), "html"nulltrue);
  783.                             echo ",
  784.                                 msg: '";
  785.                             // line 340
  786.                             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide number greater than %min%", ["%min%" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse340), "minNo", [], "array"falsefalsefalse340)]), "html"nulltrue);
  787.                             echo "',
  788.                             },
  789.                         ";
  790.                         }
  791.                         // line 343
  792.                         echo "                        ";
  793.                         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse343), "maxNo", [], "array"falsefalsefalse343)) {
  794.                             echo 
  795.                         {
  796.                             maxOrEmpty: ";
  797.                             // line 345
  798.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse345), "maxNo", [], "array"falsefalsefalse345), "html"nulltrue);
  799.                             echo ",
  800.                             msg: '";
  801.                             // line 346
  802.                             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide number smaller than %max%", ["%max%" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse346), "maxNo", [], "array"falsefalsefalse346)]), "html"nulltrue);
  803.                             echo "',
  804.                         },
  805.                         ";
  806.                         }
  807.                         // line 349
  808.                         echo "                    ";
  809.                     } elseif (("email" == (isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'349$this->source); })()))) {
  810.                         // line 350
  811.                         echo "                        {
  812.                             patternOrEmpty: /^((([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\$/i,
  813.                             msg: '";
  814.                         // line 352
  815.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Email Address is invalid"), "html"nulltrue);
  816.                         echo "',
  817.                         },
  818.                         ";
  819.                         // line 354
  820.                         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse354), "allowedDomain", [], "array"falsefalsefalse354)) {
  821.                             // line 355
  822.                             echo "                            {
  823.                                 checkAllowedDomain: \"";
  824.                             // line 356
  825.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse356), "allowedDomain", [], "array"falsefalsefalse356), "html"nulltrue);
  826.                             echo "\",
  827.                                 msg: '";
  828.                             // line 357
  829.                             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Domain name should be in accepted domains"), "html"nulltrue);
  830.                             echo "',
  831.                             },
  832.                         ";
  833.                         }
  834.                         // line 360
  835.                         echo "                        ";
  836.                         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse360), "restrictedDomain", [], "array"falsefalsefalse360)) {
  837.                             // line 361
  838.                             echo "                            {
  839.                                 checkRestrictedDomain: \"";
  840.                             // line 362
  841.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse362), "restrictedDomain", [], "array"falsefalsefalse362), "html"nulltrue);
  842.                             echo "\",
  843.                                 msg: '";
  844.                             // line 363
  845.                             echo "Domain name should not be in restricted domains";
  846.                             echo "',
  847.                             } ,
  848.                         ";
  849.                         }
  850.                         // line 366
  851.                         echo "                    ";
  852.                     } elseif (("url" == (isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'366$this->source); })()))) {
  853.                         // line 367
  854.                         echo "                        {
  855.                             patternOrEmpty: 'url',
  856.                             msg: '";
  857.                         // line 369
  858.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Provide a valid url(with protocol)"), "html"nulltrue);
  859.                         echo "',
  860.                         } ,
  861.                     ";
  862.                     } elseif (("file" ==                     // line 371
  863. (isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'371$this->source); })()))) {
  864.                         // line 372
  865.                         echo "                        {
  866.                             checkMaxFileSize: \"";
  867.                         // line 373
  868.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse373), "maxFileSize", [], "array"falsefalsefalse373), "html"nulltrue);
  869.                         echo "\",
  870.                             msg: '";
  871.                         // line 374
  872.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("file size should not exceed %value% KB", ["%value%" => ((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse374), "maxFileSize", [], "array"falsefalsefalse374)) ? (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse374), "maxFileSize", [], "array"falsefalsefalse374)) : ("5120"))]), "html"nulltrue);
  873.                         echo "',
  874.                         } ,
  875.                     ";
  876.                     }
  877.                     // line 377
  878.                     echo "                    ";
  879.                     if ((( !twig_in_filter((isset($context["fieldtype"]) || array_key_exists("fieldtype"$context) ? $context["fieldtype"] : (function () { throw new RuntimeError('Variable "fieldtype" does not exist.'377$this->source); })()), [=> "checkbox"=> "radio"=> "select"]) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsetruefalse377), "regex", [], "array"truetruefalse377)) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse377), "regex", [], "array"falsefalsefalse377))) {
  880.                         // line 378
  881.                         echo "                        {
  882.                             patternCheck: \"";
  883.                         // line 379
  884.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["customField"], "validation", [], "array"falsefalsefalse379), "regex", [], "array"falsefalsefalse379), "html"nulltrue);
  885.                         echo "\",
  886.                             msg: \"";
  887.                         // line 380
  888.                         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This Field Value is not Valid"), "html"nulltrue);
  889.                         echo "\",
  890.                         } ,
  891.                     ";
  892.                     }
  893.                     // line 383
  894.                     echo "                ];
  895.                 Array.isArray(validationParameters) ? validationParameters.push(value) : false;
  896.             ";
  897.                 }
  898.                 $_parent $context['_parent'];
  899.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['customField'], $context['_parent'], $context['loop']);
  900.                 $context array_intersect_key($context$_parent) + $_parent;
  901.                 // line 386
  902.                 echo "        ";
  903.             }
  904.             // line 387
  905.             echo "    var validationParameters = true;
  906. </script>
  907. ";
  908.         }
  909.         // line 390
  910.         echo twig_include($this->env$context"@UVDeskSupportCenter/Templates/tinyMCE.html.twig");
  911.         echo "
  912. <script type=\"text/javascript\">
  913.     \$(function () {
  914.         if (typeof(customFieldValidation) == 'undefined') {
  915.             customFieldValidation = {};
  916.         }
  917.         ";
  918.         // line 397
  919.         if (array_key_exists("removeMe"$context)) {
  920.             // line 398
  921.             echo "            \$.each(";
  922.             echo json_encode((isset($context["removeMe"]) || array_key_exists("removeMe"$context) ? $context["removeMe"] : (function () { throw new RuntimeError('Variable "removeMe" does not exist.'398$this->source); })()));
  923.             echo ", function(key, value){
  924.                 \$('label[for=\"' + value + '\"]').parent().hide();
  925.             });
  926.         ";
  927.         }
  928.         // line 402
  929.         echo "
  930.         \$('.uv-header-date').datetimepicker({
  931.             format: 'YYYY-MM-DD',
  932.         });
  933.         \$('.uv-header-time').datetimepicker({
  934.             format: 'LT',
  935.         });
  936.         \$('.uv-header-datetime').datetimepicker({
  937.             format: 'YYYY-MM-DD H:m:s'
  938.         });
  939.         var CreateTicketModel = Backbone.Model.extend({
  940.             idAttribute : \"id\",
  941.             defaults : {
  942.                 path : \"\",
  943.             },
  944.             validation: _.extend(customFieldValidation, {
  945.                 ";
  946.         // line 419
  947.         if ( !(isset($context["isTicketViewPage"]) || array_key_exists("isTicketViewPage"$context) ? $context["isTicketViewPage"] : (function () { throw new RuntimeError('Variable "isTicketViewPage" does not exist.'419$this->source); })())) {
  948.             // line 420
  949.             echo "                    'name' : {
  950.                         required : true,
  951.                         msg : \"";
  952.             // line 422
  953.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html"nulltrue);
  954.             echo "\"
  955.                     },
  956.                     'from' :
  957.                     [{
  958.                         required : true,
  959.                         msg : \"";
  960.             // line 427
  961.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html"nulltrue);
  962.             echo "\"
  963.                     },{
  964.                         pattern : /^[a-zA-Z0-9.!#\$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\$/,
  965.                         msg : \"";
  966.             // line 430
  967.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Email address is invalid"), "html"nulltrue);
  968.             echo "\"
  969.                     }],
  970.                 ";
  971.         }
  972.         // line 433
  973.         echo "                'type' : {
  974.                     required : true,
  975.                     msg : \"";
  976.         // line 435
  977.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html"nulltrue);
  978.         echo "\"
  979.                 },
  980.                 'subject' : {
  981.                     required : true,
  982.                     msg : \"";
  983.         // line 439
  984.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html"nulltrue);
  985.         echo "\"
  986.                 },
  987.                 'reply' : {
  988.                     fn: function(value) {
  989.                             if(!tinyMCE.get(\"uv-edit-create-thread\"))
  990.                                 return false;
  991.                             var html = tinyMCE.get(\"uv-edit-create-thread\").getContent();
  992.                             if(app.appView.stripHTML(html) != '') {
  993.                                 return false;
  994.                             }
  995.                             return true;
  996.                         },
  997.                     msg : \"";
  998.         // line 451
  999.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("This field is mandatory"), "html"nulltrue);
  1000.         echo "\"
  1001.                 },
  1002.             }),
  1003.             urlRoot : \"";
  1004.         // line 454
  1005.         echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("helpdesk_member_create_ticket");
  1006.         echo "\"
  1007.         });
  1008.         sfTinyMce.init({
  1009.             height: '155px',
  1010. \t\t\tselector : '#create-reply',
  1011. \t\t\timages_upload_url: \"\",
  1012.             setup: function(editor) {
  1013.             },
  1014. \t\t\tplugins: [
  1015.             ],
  1016. \t\t\ttoolbar: '| undo redo | bold italic forecolor ',
  1017. \t\t});
  1018.         var CreateTicketForm = Backbone.View.extend({
  1019.             el : \$(\"#create-ticket-modal #create-ticket-form\"),
  1020.             model: new CreateTicketModel(),
  1021.             initialize : function() {
  1022.                 Backbone.Validation.bind(this);
  1023.                 var jsonContext = JSON.parse('";
  1024.         // line 473
  1025.         echo ((array_key_exists("errors"$context)) ? ((isset($context["errors"]) || array_key_exists("errors"$context) ? $context["errors"] : (function () { throw new RuntimeError('Variable "errors" does not exist.'473$this->source); })())) : ("{}"));
  1026.         echo "');
  1027.                 for (var field in jsonContext) {
  1028.                     Backbone.Validation.callbacks.invalid(this, field, jsonContext[field], 'input');
  1029.                 }
  1030.             },
  1031.             events : {
  1032.                 'click #create-ticket-btn': \"saveTicket\",
  1033.                 'change #type': \"updateCustomFields\",
  1034.                 'blur input.create-ticket:not(input[type=file]), textarea.create-ticket, select.create-ticket, checkbox.create-ticket': 'formChanegd',
  1035.                 'change input[type=file].create-ticket': 'formChanegd',
  1036.             },
  1037.             formChanegd: function(e) {
  1038.                 this.model.set(Backbone.\$(e.currentTarget).attr('name'), Backbone.\$(e.currentTarget).val())
  1039.                 this.model.isValid([Backbone.\$(e.currentTarget).attr('name')])
  1040.             },
  1041.             saveTicket: function (e) {
  1042.                 e.preventDefault();
  1043.                 var currentElement = Backbone.\$(e.currentTarget);
  1044.                 var data = currentElement.closest('form').serializeObject();
  1045.                 this.model = new CreateTicketModel();
  1046.                 this.model.set(data);
  1047.                 Backbone.Validation.bind(this);
  1048.                 
  1049.                 if (this.model.isValid(true)) {
  1050.                     \$('#create-ticket-form').submit();
  1051.                     \$('form').find('#create-ticket-btn').attr('disabled', 'disabled');
  1052.                 }
  1053.             },
  1054.             updateCustomFields: function (e) {
  1055.                 const dependentFields = e.currentTarget.value;
  1056.                 this.\$('.dependent').hide();
  1057.                 this.\$('.dependency' + dependentFields).show();
  1058.             }
  1059.         });
  1060.         new CreateTicketForm();
  1061.     });
  1062. </script>";
  1063.         
  1064.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  1065.         
  1066.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  1067.     }
  1068.     public function getTemplateName()
  1069.     {
  1070.         return "@UVDeskCoreFramework/Snippets/createMemberTicket.html.twig";
  1071.     }
  1072.     public function isTraitable()
  1073.     {
  1074.         return false;
  1075.     }
  1076.     public function getDebugInfo()
  1077.     {
  1078.         return array (  1048 => 473,  1026 => 454,  1020 => 451,  1005 => 439,  998 => 435,  994 => 433,  988 => 430,  982 => 427,  974 => 422,  970 => 420,  968 => 419,  949 => 402,  941 => 398,  939 => 397,  929 => 390,  924 => 387,  921 => 386,  913 => 383,  907 => 380,  903 => 379,  900 => 378,  897 => 377,  891 => 374,  887 => 373,  884 => 372,  882 => 371,  877 => 369,  873 => 367,  870 => 366,  864 => 363,  860 => 362,  857 => 361,  854 => 360,  848 => 357,  844 => 356,  841 => 355,  839 => 354,  834 => 352,  830 => 350,  827 => 349,  821 => 346,  817 => 345,  811 => 343,  805 => 340,  801 => 339,  796 => 337,  791 => 335,  787 => 333,  784 => 332,  778 => 329,  774 => 327,  772 => 326,  767 => 325,  764 => 324,  759 => 323,  756 => 322,  753 => 321,  745 => 318,  739 => 315,  735 => 314,  732 => 313,  729 => 312,  723 => 309,  719 => 308,  716 => 307,  714 => 306,  709 => 304,  705 => 302,  702 => 301,  696 => 298,  692 => 297,  689 => 296,  686 => 295,  680 => 292,  676 => 291,  673 => 290,  671 => 289,  666 => 287,  662 => 285,  659 => 284,  653 => 281,  649 => 280,  643 => 278,  637 => 275,  633 => 274,  628 => 272,  623 => 270,  619 => 268,  616 => 267,  610 => 264,  606 => 262,  604 => 261,  599 => 260,  596 => 259,  591 => 258,  589 => 257,  507 => 177,  505 => 176,  502 => 175,  496 => 173,  494 => 172,  485 => 166,  481 => 164,  477 => 162,  470 => 160,  464 => 158,  461 => 157,  457 => 155,  454 => 154,  452 => 153,  449 => 152,  446 => 151,  434 => 147,  424 => 144,  419 => 141,  414 => 140,  411 => 139,  409 => 138,  406 => 137,  403 => 136,  401 => 135,  398 => 134,  395 => 133,  383 => 129,  373 => 126,  368 => 123,  363 => 122,  360 => 121,  358 => 120,  355 => 119,  352 => 118,  350 => 117,  347 => 116,  342 => 113,  331 => 111,  327 => 110,  323 => 109,  315 => 108,  312 => 107,  309 => 106,  307 => 105,  297 => 102,  294 => 101,  292 => 100,  282 => 97,  279 => 96,  277 => 95,  260 => 93,  257 => 92,  255 => 91,  241 => 88,  238 => 87,  236 => 86,  230 => 85,  213 => 84,  209 => 83,  206 => 82,  203 => 81,  200 => 80,  193 => 75,  189 => 73,  183 => 69,  177 => 66,  172 => 64,  169 => 63,  163 => 59,  155 => 54,  152 => 53,  146 => 49,  142 => 47,  128 => 44,  124 => 43,  120 => 42,  114 => 39,  111 => 38,  108 => 36,  102 => 34,  100 => 33,  94 => 30,  87 => 26,  84 => 25,  78 => 21,  71 => 17,  68 => 16,  66 => 15,  63 => 14,  59 => 12,  52 => 7,  50 => 6,  43 => 1,);
  1079.     }
  1080.     public function getSourceContext()
  1081.     {
  1082.         return new Source("<style>
  1083.     .mce-path {
  1084.       \t\tdisplay: none !important;
  1085. \t}
  1086. </style>
  1087. {% set isTicketViewPage = ('helpdesk_member_ticket' == app.request.attributes.get('_route')) %}
  1088. <div class=\"uv-pop-up-overlay uv-no-error-success-icon\" id=\"create-ticket-modal\">
  1089.     <div class=\"uv-pop-up-box uv-pop-up-wide\">
  1090.         <span class=\"uv-pop-up-close\"></span>
  1091.         <h2>Create Ticket</h2>
  1092.         <form action=\"{{ path('helpdesk_member_create_ticket') }}\" method=\"post\" id=\"create-ticket-form\" enctype=\"multipart/form-data\">
  1093.             {# Customer Details #}
  1094.             {% if not isTicketViewPage %}
  1095.                 {# Name #}
  1096.                 <div class=\"uv-element-block\">
  1097.                     <label class=\"uv-field-label\">{{ 'Name'|trans }}</label>
  1098.                     <div class=\"uv-field-block\">
  1099.                         <input name=\"name\" class=\"uv-field create-ticket\" type=\"text\" value=\"\">
  1100.                     </div>
  1101.                     <span class=\"uv-field-info\">{{ 'Customer full name'|trans }}</span>
  1102.                 </div>
  1103.                 {# Email #}
  1104.                 <div class=\"uv-element-block\">
  1105.                     <label class=\"uv-field-label\">{{ 'Email'|trans }}</label>
  1106.                     <div class=\"uv-field-block\">
  1107.                         <input name=\"from\" class=\"uv-field create-ticket\" type=\"text\" value=\"\">
  1108.                     </div>
  1109.                     <span class=\"uv-field-info\">{{ 'Customer email address'|trans }}</span>
  1110.                 </div>
  1111.             {% else %}
  1112.                 {# Retrieve customer details from the current ticket being visited #}
  1113.                 <span class=\"uv-field-info\">{{ \"Ticket will be created with current ticket's customer\"|trans }}</span>
  1114.             {% endif %}
  1115.             {# Ticket Type #}
  1116.             <div class=\"uv-element-block\">
  1117.                 <label class=\"uv-field-label\">{{ 'Type'|trans }}</label>
  1118.                 <div class=\"uv-field-block\">
  1119.                     <select name=\"type\" class=\"uv-select create-ticket\" id=\"type\">
  1120.                         <option value=\"\">{{ 'Select type'|trans }}</option>
  1121.                             {% for type in ticket_service.getTypes()  %}
  1122.                                 <option value=\"{{ type.id }}\" {{ post.type is defined and post.type == type.id ? 'selected' : '' }}>{{ type.name }}
  1123.                                 </option>
  1124.                             {% endfor %}
  1125.                     </select>
  1126.                 </div>
  1127.                 <span class=\"uv-field-info\">{{ 'Choose ticket type'|trans }}</span>
  1128.             </div>
  1129.             {# Ticket Subject #}
  1130.             <div class=\"uv-element-block\">
  1131.                 <label class=\"uv-field-label\">{{ 'Subject'|trans }}</label>
  1132.                 <div class=\"uv-field-block\">
  1133.                     <input name=\"subject\" class=\"uv-field create-ticket\" type=\"text\" value=\"\">
  1134.                 </div>
  1135.                 <span class=\"uv-field-info\">{{ 'Ticket subject'|trans }}</span>
  1136.             </div>
  1137.             {# Ticket Message #}
  1138.             <div class=\"uv-element-block\">
  1139.                 <label class=\"uv-field-label\">{{ 'Message'|trans }}</label>
  1140.                 <div class=\"uv-field-block\">
  1141.                     <textarea name=\"reply\" id=\"create-reply\" class=\"uv-field create-ticket\" type=\"text\">{{ ticket_service.getAgentDraftReply() }}</textarea>
  1142.                 </div>
  1143.                 
  1144.                 <span class=\"uv-field-info\">{{ 'Ticket query message'|trans }}</span>
  1145.             </div>
  1146.             {# Ticket Attachment #}
  1147.             <div class=\"uv-element-block attachment-block uv-no-error-success-icon\" id=\"uv-attachment-option\">
  1148.                 <label>
  1149.                     <span class=\"uv-file-label\">{{ 'Add Attachment'|trans }}</span>
  1150.                 </label>
  1151.             </div>
  1152.             {# CustomFields #}
  1153.             {% set removeMe = [] %}
  1154.             {% if headerCustomFields %}
  1155.                 <div class=\"custom-fields clearfix\">
  1156.                     {% for key, customField in headerCustomFields %}
  1157.                         <div class=\"uv-element-block input-group {{ customField.customFieldsDependency|length ? 'dependent' : '' }} {% for customFieldCustomFieldsDependency in customField.customFieldsDependency %} dependency{{customFieldCustomFieldsDependency.id}}{% endfor %}\" style=\"position: relative; {{ customField.customFieldsDependency|length ? 'display: none;' : '' }}\">
  1158.                             <label class=\"uv-field-label\" for=\"for{{customField.name~customField.id}}\">{{ customField.name }}</label>
  1159.                             {% if customField.fieldType == 'text' %}
  1160.                                 <div class=\"uv-field-block\">
  1161.                                     <input type=\"{{ customField['validation']['fieldtype'] is defined ? customField['validation']['fieldtype'] :'text' }}\" name=\"customFields[{{customField.id}}]\" class=\"uv-field create-ticket\" value=\"\" {{ customField.required ? \"required\" : \"\" }} id=\"for{{customField.name~customField.id}}\" placeholder=\"{{customField.placeholder}}\">
  1162.                                 </div>
  1163.                             {% elseif customField.fieldType in ['date', 'time', 'datetime'] %}
  1164.                                 <div class=\"uv-field-block\">
  1165.                                     <input class=\"uv-field form-control create-ticket uv-date-picker {% if customField.fieldType == 'time' %}time{% else %}calendar{% endif %} uv-header-{{ customField.fieldType }}\" type=\"text\" name=\"customFields[{{customField.id}}]\" {{ customField.required ? \"required\" : \"\" }} id=\"for{{customField.name~customField.id}}\" value=\"\">
  1166.                                 </div>
  1167.                             {% elseif customField.fieldType == 'textarea' %}
  1168.                                 <div class=\"uv-field-block\">
  1169.                                     <textarea name=\"customFields[{{customField.id}}]\" class=\"uv-field create-ticket\" {{ customField.required ? \"required\" : \"\" }} id=\"for{{customField.name~customField.id}}\"></textarea>
  1170.                                 </div>
  1171.                             {% elseif customField.fieldType in ['file'] %}
  1172.                                 <div class=\"uv-field-block\">
  1173.                                     <input type=\"file\" name=\"customFields[{{customField.id}}]\" class=\"uv-field create-ticket\" {{ customField.required ? \"required\" : \"\" }} id=\"for{{customField.name~customField.id}}\">
  1174.                                 </div>
  1175.                             {% elseif customField.fieldType in ['select'] %}
  1176.                                 {% if customField.customFieldValues is not empty %}
  1177.                                     <div class=\"uv-field-block\">
  1178.                                         <select name=\"customFields[{{customField.id}}]\" class=\"uv-select create-ticket\" id=\"for{{customField.name~customField.id}}\" {{ customField.required ? \"required\" : \"\" }}>
  1179.                                             <option value=\"\">{{ 'Select option' }}</option>
  1180.                                             {% for customFieldValues in customField.customFieldValues %}
  1181.                                                 <option value=\"{{customFieldValues.id}}\">{{customFieldValues.name}}</option>
  1182.                                             {% endfor %}
  1183.                                         </select>
  1184.                                     </div>
  1185.                                 {% else %}
  1186.                                     <!--Hide this beacause choices aren't available-->
  1187.                                     {% set removeMe = removeMe|merge([\"for\"~customField.name~customField.id]) %}
  1188.                                 {% endif %}
  1189.                             {% elseif customField.fieldType in ['checkbox'] %}
  1190.                                 {% if customField.customFieldValues is not empty %}
  1191.                                     {% for customFieldValues in customField.customFieldValues %}
  1192.                                         <div class=\"uv-split-field\">
  1193.                                             <label>
  1194.                                                 <div class=\"uv-checkbox\">
  1195.                                                     <input type=\"checkbox\" name=\"customFields[{{customField.id}}][]\" value=\"{{customFieldValues.id}}\" id=\"for{{customFieldValues.name~customFieldValues.id}}\" class=\"create-ticket\"/>
  1196.                                                     <span class=\"uv-checkbox-view\"></span>
  1197.                                                 </div>
  1198.                                                 <span class=\"uv-radio-label\" for=\"for{{customFieldValues.name~customFieldValues.id}}\">{{ customFieldValues.name }}</span>
  1199.                                             </label>
  1200.                                         </div>
  1201.                                     {% endfor %}
  1202.                                 {% else %}
  1203.                                     <!--Hide this beacause choices aren't available-->
  1204.                                     {% set removeMe = removeMe|merge([\"for\"~customField.name~customField.id]) %}
  1205.                                 {% endif %}
  1206.                             {% elseif customField.fieldType in ['radio'] %}
  1207.                                 {% if customField.customFieldValues is not empty %}
  1208.                                     {% for customFieldValues in customField.customFieldValues %}
  1209.                                         <div class=\"uv-split-field\">
  1210.                                             <label>
  1211.                                                 <div class=\"uv-radio\">
  1212.                                                     <input type=\"radio\" name=\"customFields[{{customField.id}}]\" value=\"{{customFieldValues.id}}\" id=\"for{{customFieldValues.name~customFieldValues.id}}\" class=\"create-ticket\"/>
  1213.                                                     <span class=\"uv-radio-view\"></span>
  1214.                                                 </div>
  1215.                                                 <span class=\"uv-radio-label\" for=\"for{{customFieldValues.name~customFieldValues.id}}\">{{ customFieldValues.name }}</span>
  1216.                                             </label>
  1217.                                         </div>
  1218.                                     {% endfor %}
  1219.                                 {% else %}
  1220.                                     <!--Hide this beacause choices aren't available-->
  1221.                                     {% set removeMe = removeMe|merge([\"for\"~customField.name~customField.id]) %}
  1222.                                 {% endif %}
  1223.                             {% endif %}
  1224.                             {% if formErrors['customFields['~customField.id~']'] is defined %}
  1225.                                 <div class=\"text-danger\">{{formErrors['customFields['~customField.id~']']}}</div>
  1226.                             {% endif %}
  1227.                         </div>
  1228.                     {% endfor %}
  1229.                 </div>
  1230.             {% endif %}
  1231.             <div class=\"uv-element-block\">
  1232.                 <button type=\"submit\" id=\"create-ticket-btn\" class=\"uv-btn\">{{ 'Create Ticket'|trans }}</button>
  1233.             </div>
  1234.         </form>
  1235.     </div>
  1236. </div>
  1237. {% if not(app.request.attributes.get('_route') in ['helpdesk_member_ticket']) %}
  1238.     {{ include('@UVDeskCoreFramework\\\\Templates\\\\attachment.html.twig') }}
  1239. {% endif %}
  1240. {% if user_service.isfileExists('apps/uvdesk/form-component') %}
  1241. <script>
  1242.     customFieldValidation = {};
  1243.     customHandler = function(value, attr, computedState) {
  1244.         if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible') && !\$('[name=\"'+ attr + '[]' + '\"]').parents('.uv-element-block').is(':visible')) {
  1245.             return false;
  1246.         } else {
  1247.             var ele = \$('[name=\"'+ attr + '\"]');
  1248.             ele = ele.length ? ele : \$('[name=\"'+ attr + '[]' + '\"]');
  1249.             if(ele[0].type == 'radio') {
  1250.                 var returnMe = true;
  1251.                 \$.each(ele, function(key, eleChild) {
  1252.                     if(\$(eleChild).is(':checked')) {
  1253.                         returnMe = false;
  1254.                     }
  1255.                 });
  1256.                 return returnMe;
  1257.             } else if(ele[0].type == 'checkbox') {
  1258.                 var returnMe = true;
  1259.                 \$.each(ele, function(key, eleChild) {
  1260.                     if(\$(eleChild).is(':checked')) {
  1261.                         returnMe = false;
  1262.                     }
  1263.                 });
  1264.                 return returnMe;
  1265.             } else if(!\$('#create-ticket-form [name=\"'+ attr + '\"]').val()) {
  1266.                 return true;
  1267.             }
  1268.         }
  1269.     };
  1270.     _.extend(Backbone.Validation.validators, {
  1271.         checkAllowedDomain: function(value, attr, customValue, model) {
  1272.             if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible'))
  1273.                 return false;
  1274.             domain = value.substring(value.indexOf(\"@\") + 1);
  1275.             if(customValue && customValue.indexOf(domain) === -1) {
  1276.                 return true; //return error
  1277.             }
  1278.         },
  1279.         checkRestrictedDomain: function(value, attr, customValue, model) {
  1280.             if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible'))
  1281.                 return false;
  1282.             domain = value.substring(value.indexOf(\"@\") + 1);
  1283.             if(customValue && customValue.indexOf(domain) !== -1) {
  1284.                 return true; //return error
  1285.             }
  1286.         },
  1287.         checkMaxFileSize: function(value, attr, customValue, model) {
  1288.             if(!\$('[name=\"'+ attr + '\"]').parents('.uv-element-block').is(':visible'))
  1289.                 return false;
  1290.             fileInput = \$('input[name=\"' + attr + '\"]')[0] ? \$('input[name=\"' + attr + '\"]')[0] : \$('input[name=\"' + attr + '\"]');
  1291.             file = fileInput.files? fileInput.files[0] : '';
  1292.             filesize = file ? file.size / 1024 : 0;
  1293.             maxSize = (customValue && parseInt(customValue)) ? parseInt(customValue) : 5120;
  1294.             
  1295.             if(filesize > maxSize) {
  1296.                 return true; //return error
  1297.             }
  1298.         },
  1299.         patternOrEmpty: function(value, attr, pattern, model) {
  1300.             defaultPatterns = Backbone.Validation.patterns;
  1301.             if (value && !value.toString().match(defaultPatterns[pattern] || pattern)) {
  1302.                 return true; //error
  1303.             }
  1304.         },
  1305.       minOrEmpty: function(value, attr, minValue, model) {
  1306.         if (value && (value < minValue)) {
  1307.           return true; //error
  1308.         }
  1309.       },
  1310.       maxOrEmpty: function(value, attr, maxValue, model) {
  1311.         if (value && (value > maxValue)) {
  1312.           return true; //error
  1313.         }
  1314.       },
  1315.       patternCheck: function(value, attr, pattern, model) {
  1316.         if (value && !value.toString().match(pattern)) {
  1317.             return true; //error
  1318.         }
  1319.       },
  1320.     });
  1321.         {% if headerCustomFields is defined and headerCustomFields %}
  1322.             {% for customField in headerCustomFields %}
  1323.                 {% set fieldtype = ('text' != customField['fieldType']) ? customField['fieldType'] : (customField['validation']['fieldtype'] is defined ? customField['validation']['fieldtype'] : 'text') %}
  1324.                     customFieldValidation['customFields[' + {{ customField.id }} + ']'] = [
  1325.                     {% if not(fieldtype in ['checkbox', 'radio', 'select'] and customField['customFieldValues'] is empty) and customField.required %}
  1326.                         {
  1327.                         fn : customHandler,
  1328.                         msg : '{{ \"This field is mandatory\"|trans }}'
  1329.                     },
  1330.                     {% endif %}
  1331.                     {% if('number' == fieldtype) %}
  1332.                         {
  1333.                             patternOrEmpty : 'number',
  1334.                             msg: '{{ \"Value is not valid number\"|trans }}',
  1335.                         },
  1336.                         {% if customField['validation']['minNo'] %} 
  1337.                             {
  1338.                                 minOrEmpty: {{ customField['validation']['minNo'] }},
  1339.                                 msg: '{{ \"Provide number greater than %min%\"|trans({\"%min%\": customField[\"validation\"][\"minNo\"] }) }}',
  1340.                             },
  1341.                         {% endif %}
  1342.                         {% if customField['validation']['maxNo'] %} 
  1343.                         {
  1344.                             maxOrEmpty: {{ customField['validation']['maxNo'] }},
  1345.                             msg: '{{ \"Provide number smaller than %max%\"|trans({\"%max%\": customField[\"validation\"][\"maxNo\"] }) }}',
  1346.                         },
  1347.                         {% endif %}
  1348.                     {% elseif('email' == fieldtype) %}
  1349.                         {
  1350.                             patternOrEmpty: /^((([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\$/i,
  1351.                             msg: '{{ \"Email Address is invalid\"|trans }}',
  1352.                         },
  1353.                         {% if customField['validation']['allowedDomain'] %}
  1354.                             {
  1355.                                 checkAllowedDomain: \"{{ customField['validation']['allowedDomain'] }}\",
  1356.                                 msg: '{{ \"Domain name should be in accepted domains\"|trans }}',
  1357.                             },
  1358.                         {% endif %}
  1359.                         {% if customField['validation']['restrictedDomain'] %}
  1360.                             {
  1361.                                 checkRestrictedDomain: \"{{ customField['validation']['restrictedDomain'] }}\",
  1362.                                 msg: '{{ \"Domain name should not be in restricted domains\" }}',
  1363.                             } ,
  1364.                         {% endif %}
  1365.                     {% elseif('url' == fieldtype) %}
  1366.                         {
  1367.                             patternOrEmpty: 'url',
  1368.                             msg: '{{ \"Provide a valid url(with protocol)\"|trans }}',
  1369.                         } ,
  1370.                     {% elseif('file' == fieldtype) %}
  1371.                         {
  1372.                             checkMaxFileSize: \"{{ customField['validation']['maxFileSize'] }}\",
  1373.                             msg: '{{ \"file size should not exceed %value% KB\"|trans({\"%value%\": customField[\"validation\"][\"maxFileSize\"] ? : \"5120\"}) }}',
  1374.                         } ,
  1375.                     {% endif %}
  1376.                     {% if (not (fieldtype in ['checkbox', 'radio', 'select'])) and customField['validation']['regex'] is defined and customField['validation']['regex'] %}
  1377.                         {
  1378.                             patternCheck: \"{{ customField['validation']['regex'] }}\",
  1379.                             msg: \"{{ 'This Field Value is not Valid'|trans }}\",
  1380.                         } ,
  1381.                     {% endif %}
  1382.                 ];
  1383.                 Array.isArray(validationParameters) ? validationParameters.push(value) : false;
  1384.             {% endfor %}
  1385.         {% endif %}
  1386.         {% if CustomerCustomFields is defined and CustomerCustomFields %}
  1387.             {% for customField in CustomerCustomFields %}
  1388.                 {% set fieldtype = ('text' != customField['fieldType']) ? customField['fieldType'] : (customField['validation']['fieldtype'] is defined ? customField['validation']['fieldtype'] : 'text') %}
  1389.                     customFieldValidation['customFields[' + {{ customField.id }} + ']'] = [
  1390.                     {% if not(fieldtype in ['checkbox', 'radio', 'select'] and customField['customFieldValues'] is empty) and customField.required %}
  1391.                         {
  1392.                         fn : customHandler,
  1393.                         msg : '{{ \"This field is mandatory\"|trans }}'
  1394.                     },
  1395.                     {% endif %}
  1396.                     {% if('number' == fieldtype) %}
  1397.                         {
  1398.                             patternOrEmpty : 'number',
  1399.                             msg: '{{ \"Value is not valid number\"|trans }}',
  1400.                         },
  1401.                         {% if customField['validation']['minNo'] %} 
  1402.                             {
  1403.                                 minOrEmpty: {{ customField['validation']['minNo'] }},
  1404.                                 msg: '{{ \"Provide number greater than %min%\"|trans({\"%min%\": customField[\"validation\"][\"minNo\"] }) }}',
  1405.                             },
  1406.                         {% endif %}
  1407.                         {% if customField['validation']['maxNo'] %} 
  1408.                         {
  1409.                             maxOrEmpty: {{ customField['validation']['maxNo'] }},
  1410.                             msg: '{{ \"Provide number smaller than %max%\"|trans({\"%max%\": customField[\"validation\"][\"maxNo\"] }) }}',
  1411.                         },
  1412.                         {% endif %}
  1413.                     {% elseif('email' == fieldtype) %}
  1414.                         {
  1415.                             patternOrEmpty: /^((([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\$/i,
  1416.                             msg: '{{ \"Email Address is invalid\"|trans }}',
  1417.                         },
  1418.                         {% if customField['validation']['allowedDomain'] %}
  1419.                             {
  1420.                                 checkAllowedDomain: \"{{ customField['validation']['allowedDomain'] }}\",
  1421.                                 msg: '{{ \"Domain name should be in accepted domains\"|trans }}',
  1422.                             },
  1423.                         {% endif %}
  1424.                         {% if customField['validation']['restrictedDomain'] %}
  1425.                             {
  1426.                                 checkRestrictedDomain: \"{{ customField['validation']['restrictedDomain'] }}\",
  1427.                                 msg: '{{ \"Domain name should not be in restricted domains\" }}',
  1428.                             } ,
  1429.                         {% endif %}
  1430.                     {% elseif('url' == fieldtype) %}
  1431.                         {
  1432.                             patternOrEmpty: 'url',
  1433.                             msg: '{{ \"Provide a valid url(with protocol)\"|trans }}',
  1434.                         } ,
  1435.                     {% elseif('file' == fieldtype) %}
  1436.                         {
  1437.                             checkMaxFileSize: \"{{ customField['validation']['maxFileSize'] }}\",
  1438.                             msg: '{{ \"file size should not exceed %value% KB\"|trans({\"%value%\": customField[\"validation\"][\"maxFileSize\"] ? : \"5120\"}) }}',
  1439.                         } ,
  1440.                     {% endif %}
  1441.                     {% if (not (fieldtype in ['checkbox', 'radio', 'select'])) and customField['validation']['regex'] is defined and customField['validation']['regex'] %}
  1442.                         {
  1443.                             patternCheck: \"{{ customField['validation']['regex'] }}\",
  1444.                             msg: \"{{ 'This Field Value is not Valid'|trans }}\",
  1445.                         } ,
  1446.                     {% endif %}
  1447.                 ];
  1448.                 Array.isArray(validationParameters) ? validationParameters.push(value) : false;
  1449.             {% endfor %}
  1450.         {% endif %}
  1451.     var validationParameters = true;
  1452. </script>
  1453. {% endif %}
  1454. {{ include(\"@UVDeskSupportCenter/Templates/tinyMCE.html.twig\") }}
  1455. <script type=\"text/javascript\">
  1456.     \$(function () {
  1457.         if (typeof(customFieldValidation) == 'undefined') {
  1458.             customFieldValidation = {};
  1459.         }
  1460.         {% if(removeMe is defined) %}
  1461.             \$.each({{ removeMe | json_encode |raw }}, function(key, value){
  1462.                 \$('label[for=\"' + value + '\"]').parent().hide();
  1463.             });
  1464.         {% endif %}
  1465.         \$('.uv-header-date').datetimepicker({
  1466.             format: 'YYYY-MM-DD',
  1467.         });
  1468.         \$('.uv-header-time').datetimepicker({
  1469.             format: 'LT',
  1470.         });
  1471.         \$('.uv-header-datetime').datetimepicker({
  1472.             format: 'YYYY-MM-DD H:m:s'
  1473.         });
  1474.         var CreateTicketModel = Backbone.Model.extend({
  1475.             idAttribute : \"id\",
  1476.             defaults : {
  1477.                 path : \"\",
  1478.             },
  1479.             validation: _.extend(customFieldValidation, {
  1480.                 {% if not isTicketViewPage %}
  1481.                     'name' : {
  1482.                         required : true,
  1483.                         msg : \"{{ 'This field is mandatory'|trans }}\"
  1484.                     },
  1485.                     'from' :
  1486.                     [{
  1487.                         required : true,
  1488.                         msg : \"{{ 'This field is mandatory'|trans }}\"
  1489.                     },{
  1490.                         pattern : /^[a-zA-Z0-9.!#\$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\$/,
  1491.                         msg : \"{{ 'Email address is invalid'|trans }}\"
  1492.                     }],
  1493.                 {% endif %}
  1494.                 'type' : {
  1495.                     required : true,
  1496.                     msg : \"{{ 'This field is mandatory'|trans }}\"
  1497.                 },
  1498.                 'subject' : {
  1499.                     required : true,
  1500.                     msg : \"{{ 'This field is mandatory'|trans }}\"
  1501.                 },
  1502.                 'reply' : {
  1503.                     fn: function(value) {
  1504.                             if(!tinyMCE.get(\"uv-edit-create-thread\"))
  1505.                                 return false;
  1506.                             var html = tinyMCE.get(\"uv-edit-create-thread\").getContent();
  1507.                             if(app.appView.stripHTML(html) != '') {
  1508.                                 return false;
  1509.                             }
  1510.                             return true;
  1511.                         },
  1512.                     msg : \"{{ 'This field is mandatory'|trans }}\"
  1513.                 },
  1514.             }),
  1515.             urlRoot : \"{{ path('helpdesk_member_create_ticket') }}\"
  1516.         });
  1517.         sfTinyMce.init({
  1518.             height: '155px',
  1519. \t\t\tselector : '#create-reply',
  1520. \t\t\timages_upload_url: \"\",
  1521.             setup: function(editor) {
  1522.             },
  1523. \t\t\tplugins: [
  1524.             ],
  1525. \t\t\ttoolbar: '| undo redo | bold italic forecolor ',
  1526. \t\t});
  1527.         var CreateTicketForm = Backbone.View.extend({
  1528.             el : \$(\"#create-ticket-modal #create-ticket-form\"),
  1529.             model: new CreateTicketModel(),
  1530.             initialize : function() {
  1531.                 Backbone.Validation.bind(this);
  1532.                 var jsonContext = JSON.parse('{{ errors is defined ? errors|raw : \"{}\"  }}');
  1533.                 for (var field in jsonContext) {
  1534.                     Backbone.Validation.callbacks.invalid(this, field, jsonContext[field], 'input');
  1535.                 }
  1536.             },
  1537.             events : {
  1538.                 'click #create-ticket-btn': \"saveTicket\",
  1539.                 'change #type': \"updateCustomFields\",
  1540.                 'blur input.create-ticket:not(input[type=file]), textarea.create-ticket, select.create-ticket, checkbox.create-ticket': 'formChanegd',
  1541.                 'change input[type=file].create-ticket': 'formChanegd',
  1542.             },
  1543.             formChanegd: function(e) {
  1544.                 this.model.set(Backbone.\$(e.currentTarget).attr('name'), Backbone.\$(e.currentTarget).val())
  1545.                 this.model.isValid([Backbone.\$(e.currentTarget).attr('name')])
  1546.             },
  1547.             saveTicket: function (e) {
  1548.                 e.preventDefault();
  1549.                 var currentElement = Backbone.\$(e.currentTarget);
  1550.                 var data = currentElement.closest('form').serializeObject();
  1551.                 this.model = new CreateTicketModel();
  1552.                 this.model.set(data);
  1553.                 Backbone.Validation.bind(this);
  1554.                 
  1555.                 if (this.model.isValid(true)) {
  1556.                     \$('#create-ticket-form').submit();
  1557.                     \$('form').find('#create-ticket-btn').attr('disabled', 'disabled');
  1558.                 }
  1559.             },
  1560.             updateCustomFields: function (e) {
  1561.                 const dependentFields = e.currentTarget.value;
  1562.                 this.\$('.dependent').hide();
  1563.                 this.\$('.dependency' + dependentFields).show();
  1564.             }
  1565.         });
  1566.         new CreateTicketForm();
  1567.     });
  1568. </script>""@UVDeskCoreFramework/Snippets/createMemberTicket.html.twig""C:\\xampp\\htdocs\\itdesk\\vendor\\uvdesk\\core-framework\\Resources\\views\\Snippets\\createMemberTicket.html.twig");
  1569.     }
  1570. }