templates/base.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <meta http-equiv="Content-Language" content="fr">
  7.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  8.     <meta name="msapplication-tap-highlight" content="no">
  9.     <meta name="author" lang="fr" content="Cedric BERARD & Curtis MARTY JACKSON & Levon BAGHDASARYAN & Axel SOFONEA & Delfine SIKORA & Hamza BOURHAIL BENHADI">
  10.     {% block meta %}{% endblock %}
  11.     <title>{% block title %}Visio{% endblock %}</title>
  12.     <link rel="icon" href="{{ asset('images/logo_pm_sm.png') }}">
  13.     <link href="{{ asset('main.87c0748b313a1dda75f5.css') }}" rel="stylesheet">
  14.     <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  15.     <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.css">
  16.     <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.7.0/css/buttons.dataTables.min.css">
  17.     <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css">
  18.     <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
  19.     <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
  20.     <!-- Fichier JS helpers -->
  21.     <script type="text/javascript" src="{{ asset('assets/scripts/helpers.js') }}"></script>
  22.     <link href="{{ asset('css/loading.css') }}" rel="stylesheet">
  23.     <link href="{{ asset('css/main.css') }}" rel="stylesheet">
  24.     <link href="{{ asset('css/custom-style.css') }}" rel="stylesheet">
  25.     <style>
  26.     .card-header{
  27.           height:35px;
  28.     }
  29.     </style>
  30.     {% block stylesheets %}{% endblock %}
  31. </head>
  32. <body>
  33. {% block complete_body %}
  34.     <div class="app-container app-theme-white body-tabs-shadow fixed-header fixed-sidebar fixed-footer">
  35.         <div class="app-header header-shadow">
  36.             <div class="app-header__logo">
  37.                 <a href="{{ path('index') }}"><div class="logo-src"></div></a>
  38.                 <div class="header__pane ml-auto">
  39.                     <div>
  40.                         <button type="button" class="hamburger close-sidebar-btn hamburger--elastic is-active" data-class="closed-sidebar">
  41.                                                                 <span class="hamburger-box">
  42.                                                                         <span class="hamburger-inner"></span>
  43.                                                                  </span>
  44.                         </button>
  45.                     </div>
  46.                 </div>
  47.             </div>
  48.             <div class="app-header__mobile-menu">
  49.                 <div>
  50.                     <button type="button" class="hamburger hamburger--elastic mobile-toggle-nav">
  51.                                                         <span class="hamburger-box">
  52.                                                                 <span class="hamburger-inner"></span>
  53.                                                          </span>
  54.                     </button>
  55.                 </div>
  56.             </div>
  57.             <div class="app-header__menu">
  58.                                      <span>
  59.                                          <button type="button" class="btn-icon btn-icon-only btn btn-primary btn-sm mobile-toggle-header-nav">
  60.                                             <span class="btn-icon-wrapper">
  61.                                                 <i class="fa fa-ellipsis-v fa-w-6"></i>
  62.                                              </span>
  63.                                          </button>
  64.                                      </span>
  65.             </div>
  66.             <div class="app-header__content">
  67.                 <div class="app-header-left">
  68.                     <div class="search-wrapper">
  69.                         <div class="input-holder">
  70.                             <input id="search-input-id"
  71.                                    type="text"
  72.                                    class="search-input"
  73.                                    placeholder="{{ 'menu.search'|trans }}"
  74.                                    >
  75.                             <button id="search-icon-id"
  76.                                     class="search-icon"
  77.                                     data-container="body"
  78.                                     data-toggle="popover"
  79.                                     data-placement="bottom"
  80.                                     data-content=" "
  81.                                     data-original-title= ""
  82.                                     title= "">
  83.                                 <span></span>
  84.                             </button>
  85.                         </div>
  86.                         <button id="search-icon-close-id" class="close"></button>
  87.                     </div>
  88.                 </div>
  89.             </div>
  90.             <div class="app-header__content">
  91.                 <div class="app-header-left">
  92.                 </div>
  93.                 <div class="app-header-right">
  94.                     {% if app.session.get('accesMemo') %}
  95.                         <div class="mr-3">
  96.                             <form method="post" action="https://memo.planet-monetic.fr/login.php" target="_blank" id="acces_memo_form">
  97. {#                                Par la suite il faudra activer validation CSRF dans le fichier security#}
  98. {#                                csrf_protection: true#}
  99. {#                                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">#}
  100.                                 <input type="hidden" value="{{ app.user.mail }}" name="username">
  101.                                 {% set key = app.user.mail ~ ':' ~ "now"|date("DMY") ~ 'PM' %}
  102.                                 {% set key = key|md5 %}
  103.                                 {% set key = key|base64_encode %}
  104.                                 <input type="hidden" value="{{ key }}" name="key">
  105.                                 <button type="submit" name="acces_memo_btn" class="btn btn-info">{{ "administration.acces_memo"|trans }}</button>
  106.                             </form>
  107.                         </div>
  108.                     {% endif %}
  109.                     <div class="header-dots">
  110.                         <!-- News icon -->
  111.                         {{ render(controller('App\\Controller\\GlobalController::newsMenuRenderControllerTwig', {})) }}
  112.                         <div class="dropdown">
  113.                             <button type="button" data-toggle="dropdown" class="p-0 mr-2 btn btn-link">
  114.                             <span class="icon-wrapper icon-wrapper-alt rounded-circle">
  115.                                     <span class="icon-wrapper-bg bg-focus"></span>
  116.                                {% if app.request.locale == 'en' %}
  117.                                    <span class="language-icon opacity-8 flag large GB"></span>
  118.                                {% else %}
  119.                                    <span class="language-icon opacity-8 flag large  {{ app.request.locale|upper }}"></span>
  120.                                {% endif %}
  121.                             </span>
  122.                             </button>
  123.                             <div tabindex="-1" role="menu" aria-hidden="true" class="rm-pointers dropdown-menu dropdown-menu-right">
  124.                                 <a href="{{ path(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'fr'})) }}">
  125.                                     <button type="button" tabindex="0" class="dropdown-item">
  126.                                         <span class="mr-3 opacity-8 flag large FR"></span>
  127.                                         Français
  128.                                     </button></a>
  129.                                 <a href="{{ path(app.request.get('_route'), app.request.attributes.get('_route_params')|merge({'_locale': 'en'})) }}">
  130.                                     <button type="button" tabindex="0" class="dropdown-item">
  131.                                         <span class="mr-3 opacity-8 flag large GB"></span>
  132.                                         English
  133.                                     </button>
  134.                                 </a>
  135.                             </div>
  136.                         </div>
  137.                         <div class="header-btn-lg pr-0">
  138.                             <div class="widget-content p-0">
  139.                                 <div class="widget-content-wrapper">
  140.                                     <div class="widget-content-left">
  141.                                         <div class="btn-group">
  142.                                             <a data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="p-0 btn">
  143.                                                 <img width="32" class="rounded-circle" src="{{ asset('assets/images/avatars/user.png') }}" alt="">
  144.                                                 <i class="fa fa-angle-down ml-2 opacity-8"></i>
  145.                                             </a>
  146.                                             <div tabindex="-1" role="menu" aria-hidden="true" class="rm-pointers dropdown-menu-lg dropdown-menu dropdown-menu-right">
  147.                                                 <div class="dropdown-menu-header">
  148.                                                     <div class="dropdown-menu-header-inner profil_banner">
  149.                                                         <div class="menu-header-image opacity-2"></div>
  150.                                                         <div class="menu-header-content text-left">
  151.                                                             <div class="widget-content p-0">
  152.                                                                 <div class="widget-content-wrapper">
  153.                                                                     <div class="widget-content-left mr-3">
  154.                                                                         <img width="32" class="rounded-circle" src="{{ asset('assets/images/avatars/user.png') }}" alt="">
  155.                                                                     </div>
  156.                                                                     <div class="widget-content-left">
  157.                                                                         <div class="widget-heading">
  158.                                                                             {{ app.user }}
  159.                                                                         </div>
  160.                                                                         <div class="widget-subheading opacity-8">
  161.                                                                             {{ app.session.get('profil').libelle|lower }}
  162.                                                                         </div>
  163.                                                                     </div>
  164.                                                                     <div class="widget-content-right mr-2">
  165.                                                                         <a href="{{ path('app_logout') }}" class="btn-pill btn-shadow btn-shine btn btn-danger ">{{ "menu.deconnexion"|trans }}
  166.                                                                         </a>
  167.                                                                     </div>
  168.                                                                 </div>
  169.                                                             </div>
  170.                                                         </div>
  171.                                                     </div>
  172.                                                 </div>
  173.                                                 <div class="scroll-area-xs" style="height: 150px;">
  174.                                                     <div class="scrollbar-container ps">
  175.                                                         <ul class="nav flex-column">
  176.                                                             <li class="nav-item-header nav-item">{{ "menu.compte"|trans }}
  177.                                                             </li>
  178.                                                         </ul>
  179.                                                     </div>
  180.                                                 </div>
  181.                                             </div>
  182.                                         </div>
  183.                                     </div>
  184.                                     <div class="widget-content-left  ml-3 header-user-info">
  185.                                         <div class="widget-heading">
  186.                                             {{ app.user }}
  187.                                         </div>
  188.                                         <div class="widget-subheading">
  189.                                             {{ app.user.fonction }}
  190.                                         </div>
  191.                                     </div>
  192.                                 </div>
  193.                             </div>
  194.                         </div>
  195.                     </div>
  196.                 </div>
  197.             </div>
  198.         </div>
  199.         <div class="app-main">
  200.             <div class="loader">
  201.                 <div class="big-loader-PM">
  202.                     <span>{{ 'loading_progress' | trans }}</span>
  203.                     <div class="dot-loader" id="loader-2">
  204.                         <span></span>
  205.                         <span></span>
  206.                         <span></span>
  207.                     </div>
  208.                 </div>
  209.             </div>
  210.             <div class="app-sidebar sidebar-shadow">
  211.                 <div class="scrollbar-sidebar">
  212.                     <div class="app-sidebar__inner">
  213.                         <ul class="vertical-nav-menu">
  214.                             {% block sidebar %}
  215.                                 <li class="app-sidebar__heading">MENU</li>
  216.                                 <li><a href="{{ path('index') }}"><i
  217.                                                 class="metismenu-icon pe-7s-home"></i>{{ "menuvertical.accueil"|trans }}
  218.                                     </a></li>
  219.                                 {% for key_menu, menu in app.session.get('menu') %}
  220.                                     {% if menu.menu.seul == true %}
  221.                                         {% set activeLi = 'mm-active'%}
  222.                                         {% if menu.menu.url in app.request.pathinfo %}
  223.                                         <li class="{{ activeLi }}">
  224.                                         {% else %}
  225.                                             <li>
  226.                                         {% endif %}
  227.                                         <a href="{{ '/' ~ app.request.locale ~ '/' ~ menu.menu.url }}"><i
  228.                                                     class="metismenu-icon {{ menu.menu.icone }}"></i>{{ menu.menu.libelle|trans }}
  229.                                         </a>
  230.                                     {% else %}
  231.                                         {% set activeLi = 'mm-active' %}
  232.                                         {% set activeLink = false %}
  233.                                         {% set activeUl = 'mm-collapse' %}
  234.                                         <li>
  235.                                         <a href="#" aria-expanded="{{ activeLink }}"><i
  236.                                                     class="metismenu-icon {{ menu.menu.icone }}"></i>{{ menu.menu.libelle|trans }}
  237.                                             <i class="metismenu-state-icon pe-7s-angle-down caret-left"></i></a>
  238.                                         <ul class="{{ activeUl }}">
  239.                                             {% for key_sous_menu, sous_menu in menu.sous_menu %}
  240.                                                 {% if sous_menu.libelle is not empty %}
  241.                                                     <li>
  242.                                                     <i class="metismenu-icon"></i><a
  243.                                                         href="#">{{ sous_menu.libelle|trans }}<i
  244.                                                             class="metismenu-state-icon pe-7s-angle-down caret-left"></i></a>
  245.                                                     <ul>
  246.                                                 {% endif %}
  247.                                                 {% for key_page, page in sous_menu.page %}
  248.                                                     {% if page.url in app.request.pathinfo %}
  249.                                                         {% if page.url|length > 18 %}
  250.                                                         <li class="{{ activeLi }} scrollable-line">
  251.                                                         {% else %}
  252.                                                             <li class="{{ activeLi }}">
  253.                                                         {% endif %}
  254.                                                     {% else %}
  255.                                                         {% if page.url|length > 18 %}
  256.                                                             <li class="scrollable-line">
  257.                                                         {% else %}
  258.                                                             <li>
  259.                                                         {% endif %}
  260.                                                     {% endif %}
  261.                                                     {% set pathinfoSplit = app.request.pathinfo|split('/') %}
  262.                                                     {% set nbElement = pathinfoSplit|length-1 %}
  263.                                                     {% if page.url == pathinfoSplit[nbElement] %}
  264.                                                     <a href="{{ '/' ~ app.request.locale ~ '/' ~ menu.menu.url ~ '/' ~ page.url }}"
  265.                                                        class="mm-active" aria-expanded="{{ activeLink }}">
  266.                                                     {% else %}
  267.                                                     <a href="{{ '/' ~ app.request.locale ~ '/' ~ menu.menu.url ~ '/' ~ page.url }}">
  268.                                                     {% endif %}
  269.                                                     <i class="metismenu-icon"></i>
  270.                                                     <span>{{ page.page |trans }}</span>
  271.                                                     </a>
  272.                                                     </li>
  273.                                                 {% endfor %}
  274.                                                 {% if sous_menu.libelle is not empty %}
  275.                                                     </ul>
  276.                                                     </li>
  277.                                                 {% endif %}
  278.                                             {% endfor %}
  279.                                         </ul>
  280.                                     {% endif %}
  281.                                     </li>
  282.                                 {% endfor %}
  283.                             {% endblock %}
  284.                         </ul>
  285.                     </div>
  286.                 </div>
  287.             </div>
  288.             <div class="app-main__outer">
  289.                 <div class="app-main__inner">
  290.                     {% block title_page %}{% endblock %}
  291.                     {% block message_body %}
  292.                         {% for label, messages in app.flashes %}
  293.                             {% for message in messages %}
  294.                                 <div class="alert alert-{{ label }}">
  295.                                     {{ message | raw }}
  296.                                     <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  297.                                         <span aria-hidden="true">&times;</span>
  298.                                     </button>
  299.                                 </div>
  300.                             {% endfor %}
  301.                         {% endfor %}
  302.                     {% endblock %}
  303.                     {% block body %}<h1>Bienvenue {{ app.user }}</h1>{% endblock %}
  304.                     {% block after_body %}{% endblock %}
  305.                 </div>
  306.                 {% block footer %}
  307.                     <div class="app-wrapper-footer">
  308.                         <div class="app-footer">
  309.                             <div class="app-footer__inner">
  310.                                 <div class="app-footer" >
  311.                                     <p style="text-align: center;">
  312.                                         Visio© 2009-{{ "now"|date("Y") }}
  313.                                         <br> <a href="https://www.planet-monetic.fr/politique-de-confidentialite/" target="_blank">{{'titre_info_politique_conficdentialite'|trans}}</a> - {{ 'menu.footer'|trans }} <a href="http://www.mozilla.org/firefox/" target="_blank">FIREFOX©</a> & <a href="http://www.google.com/chrome/" target="_blank">CHROME©</a>
  314.                                     </p>
  315.                                 </div>
  316.                             </div>
  317.                         </div>
  318.                     </div>
  319.                 {% endblock %}
  320.             </div>
  321.         </div>
  322.     </div>
  323. {% endblock %}
  324. {#<script src="scripts-init/"></script>#}
  325. <!-- Scripts DataTables & JQuery Classique -->
  326. <script type="text/javascript" charset="utf8" src=https://code.jquery.com/jquery-3.5.1.js></script>
  327. <script src=https://code.jquery.com/ui/1.12.1/jquery-ui.js integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script>
  328. <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.2/moment.js"></script>
  329. <script type="text/javascript" charset="utf8" src=https://cdn.datatables.net/1.12.1/js/jquery.dataTables.js></script>
  330. <script src="https://cdn.datatables.net/buttons/2.0.1/js/dataTables.buttons.min.js"></script>
  331. <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
  332. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
  333. <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
  334. <script src="https://cdn.datatables.net/buttons/2.0.1/js/buttons.html5.min.js"></script>
  335. <script src="https://cdn.datatables.net/buttons/2.0.1/js/buttons.print.min.js"></script>
  336. <script src="https://cdn.datatables.net/scroller/2.0.5/js/dataTables.scroller.min.js"></script>
  337. <script src="https://cdn.datatables.net/datetime/1.1.2/js/dataTables.dateTime.min.js"></script>
  338. <!-- Inclure Popper.js -->
  339. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.9.2/umd/popper.min.js" integrity="sha512-2rNj2KJ+D8s1ceNasTIex6z4HWyOnEYLVC3FigGOmyQCZc2eBXKgOxQmo3oKLHyfcj53uz4QMsRCWNbLd32Q1g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  340. <!-- Scripts Date Range Picker -->
  341. {#<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>#}
  342. {#<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>#}
  343. <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
  344. <!-- Scripts -->
  345. <script type="text/javascript" charset="utf8" src=https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js></script>
  346. <script src=https://cdn.ckeditor.com/ckeditor5/23.1.0/classic/ckeditor.js></script>
  347. <script src=https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js></script>
  348. <!-- Scripts Template -->
  349. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
  350. <script type="text/javascript" src="{{ asset('assets/scripts/main.87c0748b313a1dda75f5.js') }}"></script>
  351. <script type="text/javascript" src="{{ asset('assets/scripts/jquery.maphilight.min.js') }}"></script>
  352. <script src="https://cdn.jsdelivr.net/npm/bootstrap-modal-js/dist/bootstrap-modal-js.min.js"></script>
  353. {#<script type="text/javascript" src="{{ asset('assets/scripts/helpers.js') }}"></script>#}
  354. <!-- Scripts Perso -->
  355. <script type="text/javascript">
  356.     // alert('Branché sur PROD, ne pas faire un test.');
  357.     $(".loader").show();
  358.     $(window).on('load', function() { $(".loader").fadeOut("2000"); });
  359.     var clickedButtons = {};
  360.     var dotLoaderDiv = document.getElementById("loader-2");
  361.     function showDotLoader(buttonClass, isMini = true) {
  362.         let buttonElement = document.querySelector(buttonClass);
  363.         let parentElement = buttonElement.parentNode;
  364.         let loader = dotLoaderDiv.cloneNode(true);
  365.         loader.style.width = buttonElement.offsetWidth + 'px';
  366.         loader.style.height = buttonElement.offsetHeight + 'px';
  367.         let buttonComputedStyle = window.getComputedStyle(buttonElement);
  368.         let buttonMarginLeft = parseInt(buttonComputedStyle.marginLeft);
  369.         let buttonMarginRight = parseInt(buttonComputedStyle.marginRight);
  370.         let buttonMarginTop = parseInt(buttonComputedStyle.marginTop);
  371.         let buttonMarginBottom = parseInt(buttonComputedStyle.marginBottom);
  372.         loader.style.margin = buttonMarginTop + 'px ' + buttonMarginRight + 'px ' + buttonMarginBottom + 'px ' + buttonMarginLeft + 'px';
  373.         if (isMini) {
  374.             loader.classList.add("mini-loader");
  375.             parentElement.replaceChild(loader, buttonElement);
  376.             clickedButtons[buttonClass] = { buttonElement: buttonElement, loader: loader };
  377.         } else {
  378.             let microLoader = dotLoaderDiv.cloneNode(true);
  379.             microLoader.classList.add("micro-loader");
  380.             buttonElement.parentNode.appendChild(microLoader);
  381.             buttonElement.classList.add("d-none");
  382.         }
  383.     }
  384.     function hideDotLoader(buttonClass, isMini = true) {
  385.         if (isMini) {
  386.             let buttonInfo = clickedButtons[buttonClass];
  387.             let parentElement = buttonInfo.loader.parentNode;
  388.             parentElement.replaceChild(buttonInfo.buttonElement, buttonInfo.loader);
  389.             delete clickedButtons[buttonClass];
  390.         } else {
  391.             let buttonElement = document.querySelector(buttonClass);
  392.             let loader = document.querySelector(".micro-loader");
  393.             loader.classList.add("d-none");
  394.             buttonElement.classList.remove("d-none");
  395.         }
  396.     }
  397.     function ValidAjax(url,data,function_return){
  398.         if (typeof function_return == 'undefined') {
  399.             function_return = false;
  400.         }
  401.         $.ajax({
  402.             url: url,
  403.             type: 'POST',
  404.             dataType:'json',
  405.             async: true,
  406.             data: { 'post': data},
  407.             success: function(response) {
  408.                 var res = response.toString().split('|');
  409.                 if(res[0] == "valide"){
  410.                     $(function() {
  411.                         toastr.success('', res[1], {positionClass: "toast-bottom-right"});
  412.                     });
  413.                 }
  414.                 else if(res[0] == "html"){
  415.                     $('#'+res[1]).html(res[3]);
  416.                     if(res[2] == 'referentiel'){
  417.                         datatable_referentiel();
  418.                     }
  419.                     else if(res[2] == 'affichage_materiel_cc'){
  420.                         affichageMaterielCc();
  421.                     }
  422.                     else if (res[2] === 'recherche'){
  423.                         retourAjaxRecherche();
  424.                     }
  425.                     if(typeof res[4] != 'undefined' && res[4] == "html"){
  426.                         $('#'+res[5]).html(res[7]);
  427.                     }
  428.                 }
  429.                 else if(res[0] == "html_append"){
  430.                     // $('#'+res[5]).html($('#'+res[5]).html() + res[7]);
  431.                     $('#'+res[1]).html($('#'+res[1]).html() + res[3]);
  432.                 }
  433.                 else if(res[0] == "no_toastr") {
  434.                     $(".loader").hide();
  435.                 }
  436.                 else {
  437.                     $(function() {
  438.                         toastr.error('', res[1], {positionClass: "toast-bottom-right"});
  439.                     });
  440.                     $(".loader").hide();
  441.                 }
  442.                 if(function_return == true){
  443.                     RetourAjax(res[2]);
  444.                 }
  445.             },
  446.             error : function(xhr, textStatus, errorThrown) {
  447.                 $(function() {
  448.                     toastr.error (errorThrown, textStatus, {positionClass: "toast-bottom-right"});
  449.                     console.log(errorThrown);
  450.                     console.log(textStatus);
  451.                 });
  452.             }
  453.         });
  454.     }
  455.     /* Empecher la Soumisson d'un formulaire sous rafraichissmeent de la page (que sur le click = Submit) */
  456.     function preventFormSubmitOnPageRefresh() {
  457.         if ( window.history.replaceState ) {
  458.             window.history.replaceState( null, null, window.location.href );
  459.         }
  460.     }
  461. </script>
  462. {% block javascripts %}{% endblock %}
  463. <script>
  464.     /* Partie popover et bouton recherche */
  465.     let ariaDescribedby = "";
  466.     $('#search-icon-id').click(()=>{
  467.         if($('#search-icon-id').hasClass("open")){
  468.             $(function(){removeAttributesSearchIcon();});
  469.         }else {
  470.             $('#search-icon-id').addClass("open");
  471.             $('#search-icon-id').addClass("bg-tempting-azure");
  472.             $('#search-icon-id').attr("style", "transform: rotate(-0.25turn);");
  473.             $('#search-input-id').attr("disabled" , true);
  474.             $(function(){
  475.                 ariaDescribedby = $('#search-icon-id').attr("aria-describedby");
  476.                 let identifierPopoverElement = ariaDescribedby + "-body";
  477.                 $('.popover-body').append("<div id='loader-popover-search' class='loader' style='background-size: 95%'></div><div class='popover-body-child'><div style='width: 50px; height: 50px'></div></div>");
  478.                 $('.popover-body-child').attr("id", identifierPopoverElement);
  479.                 afficherContenuPopoverRecherche(identifierPopoverElement);
  480.             });
  481.         }
  482.     });
  483.     function removeAttributesSearchIcon(){
  484.         $('#search-icon-id').removeClass("open");
  485.         $('#search-icon-id').removeClass("bg-tempting-azure");
  486.         $('#search-icon-id').removeAttr("style");
  487.     }
  488.     $('#search-icon-close-id').click(function() {
  489.         $('#link-search-button-popover').removeAttr('href');
  490.         $('#search-input-id').val("");
  491.         if($('#search-icon-id').hasClass("open")){
  492.             $('#search-icon-id').trigger("click");
  493.         }
  494.     });
  495.     function afficherContenuPopoverRecherche(identifierPopoverElement){
  496.         ValidAjax(
  497.             "https://{{ app.request.server.get('HTTP_HOST') }}/{{ app.request.getLocale() }}/recherche/formulaire",
  498.             identifierPopoverElement,
  499.             false
  500.         );
  501.     }
  502.     function toggleSearchButtonPopover(element){
  503.         if(((element.val().trim()).length > 3) && ($('[name = search-radio]:checked').attr("id") ===
  504.             "search-radio-serial")){
  505.             $('#search-button-popover').removeAttr("disabled");
  506.         }else if(((element.val().trim()).length > 7) && ($('[name = search-radio]:checked').attr("id") ===
  507.             "search-radio-tracking")){
  508.             $('#search-button-popover').removeAttr("disabled");
  509.         }else if(element.val().trim() !== "" && $('[name = search-radio]:checked').attr("id") !==
  510.             "search-radio-tracking" && $('[name = search-radio]:checked').attr("id") !==
  511.             "search-radio-serial"){
  512.             $('#search-button-popover').removeAttr("disabled");
  513.         }else{
  514.             $('#search-button-popover').attr("disabled", true);
  515.         }
  516.     }
  517.     function retourAjaxRecherche(){
  518.         $("#loader-popover-search").hide();
  519.         if($('#search-input-id').val() !== ""){
  520.             toggleSearchButtonPopover($('#search-input-id'));
  521.         }
  522.         $('#search-input-id').removeAttr("disabled");
  523.         $('#search-input-id').focus();
  524.         $('#search-input-id').keyup(function() {
  525.             toggleSearchButtonPopover($(this));
  526.         });
  527.         $('#search-button-popover').click(function() {
  528.             let type = $('[name = search-radio]:checked').attr("id").split("-")[2];
  529.             let search = $('#search-input-id').val();
  530.             let url = "https://{{ app.request.server.get('HTTP_HOST') }}/{{ app.request.getLocale()}}/recherche/"
  531.             $('#search-input-id').attr("disabled" , true);
  532.             $('#link-search-button-popover').attr('href', (url + encodeURIComponent(type) + "/" + encodeURIComponent(search.trim())));
  533.             $('#link-search-button-popover').trigger("click");
  534.             $('#loader-popover-search').show();
  535.         });
  536.         $('#liste-client-radio-button').click(function() {
  537.             $('#search-radio-client-2').trigger("click");
  538.         });
  539.         $('#liste-client-radio-button').change(function() {
  540.             $('#search-input-id').val("");
  541.             $('#search-input-id').val($(this).val())
  542.             toggleSearchButtonPopover($('#search-input-id'));
  543.         });
  544.         $('[name = search-radio]').click(function() {
  545.             if($(this).attr("id") === 'search-radio-client-2'){
  546.                 $('#search-input-id').attr("disabled" , true);
  547.                 $('#search-input-id').off("focus");
  548.                 $('#search-input-id').val("");
  549.                 $('#search-input-id').val($('#liste-client-radio-button').val())
  550.                 toggleSearchButtonPopover($('#search-input-id'));
  551.             }else{
  552.                 $('#search-input-id').removeAttr("disabled");
  553.                 $('#search-input-id').focus();
  554.                 $('#liste-client-radio-button #default').prop("selected", "selected");
  555.                 toggleSearchButtonPopover($('#search-input-id'));
  556.             }
  557.             let id = $(this).prop('id');
  558.             $('[name = search-radio]:not(#' + id + ')').removeAttr('checked');
  559.             $('#' + id).attr('checked', 'checked');
  560.         });
  561.         $('#search-input-id').keydown(function(e){
  562.             var key = e.which;
  563.             if(key === 9){
  564.                 $(function (){$('#search-input-id').focus()});
  565.             }
  566.             if(key === 13){
  567.                 if($('#search-button-popover').attr("disabled") !== true){
  568.                     $('#search-button-popover').trigger("click")
  569.                 }
  570.             }
  571.         })
  572.         $('#search-input-id').on('paste', function(){
  573.             let element = $(this);
  574.             setTimeout(function(){
  575.                 toggleSearchButtonPopover(element)
  576.             },0);
  577.         });
  578.     }
  579.     /* Fin de la partie recherche */
  580.     function datatable_referentiel(){
  581.         if($('#liste_referentiel')){
  582.             let oTable = $('#liste_referentiel').DataTable({
  583.                 "bInfo": false,
  584.                 "lengthChange": false,
  585.                 "targets": 'no-sort',
  586.                 "bSort": false,
  587.                 "pageLength": 15,
  588.                 "dom": '<"bottom"tp><"clear">',
  589.                 "language": {
  590.                     "url": "{{ "datatable.langue"|trans }}"
  591.                 },
  592.                 "drawCallback": function() {
  593.                     $("#liste_referentiel thead").remove();
  594.                     $("#liste_referentiel").removeClass('no-footer'); // On supprime cette classe pour supprimer le border-bottom
  595.                 }
  596.             });
  597.             $('#mySearch').keyup(function(){
  598.                 oTable.search($(this).val()).draw() ;
  599.             });
  600.         }
  601.     }
  602.     $(document).ready(function() {
  603.         datatable_referentiel();
  604.     } );
  605.     function choixMateriel(id, typeRefCC) {
  606.         if (typeof typeRefCC == undefined) {
  607.             typeRefCC = null;
  608.         }
  609.         let idSplit = id.split('_')[1];
  610.         //Si c'est le popup CC materiel
  611.         if (typeRefCC != null && typeRefCC == true) {
  612.             let saveMatOld = $('#materiel_popup_choisi').val();
  613.             //Si c'est vide, on fait un reset
  614.             if (saveMatOld != '' && $('#materiel_popup_choisi').val() != idSplit) {
  615.                 $('#mat_' + saveMatOld).val('');
  616.                 $('#qty_mat_' + saveMatOld).val('');
  617.                 $('#qty_block_' + saveMatOld).hide();
  618.             }
  619.             //On sauvegarde l'element selectioné
  620.             $('#materiel_popup_choisi').val(idSplit);
  621.             //On affiche le block
  622.             $('#qty_block_' + idSplit).show();
  623.         }
  624.         $('#mat_selectionne').val(id.replace('td_', ''));
  625.         $('.td_referentiel').css({'background': 'none', 'color': '#0099ff'});
  626.         $('#' + id).css({'background-color': '#007bff', 'color': '#fff'});
  627.     }
  628.     function ValidechoixMateriel(){
  629.         var dest = $('#destination_selection').val();
  630.         var mat =  $('#mat_selectionne').val();
  631.         var nom_mat =  $('#nom_mat_'+mat).val();
  632.         if($('#inPopup').val() != '' && $('#inPopup').val() == 'true') {
  633.             choixMaterielStd(mat);
  634.         }
  635.         else {
  636.             $('#ref_mat_'+dest).val(mat).trigger('change');
  637.             $('#em_'+dest).html(nom_mat);
  638.             $('#em_'+dest).css('color','#5bc0de');
  639.         }
  640.     }
  641.     function InfoPanneModal(val){
  642.         $('#td_panne_16_autre').hide();
  643.         $('#td_panne_43_autre').hide();
  644.         $('#td_panne_16_autre').val("");
  645.         $('#td_panne_43_autre').val("");
  646.         $('.list_choix_panne').css({'background': 'none', 'color': '#0099ff'});
  647.         $('#destination_panne_selection').val(val);
  648.         var val_panne = $('#type_panne_'+val).val();
  649.         var liste_panne = "";
  650.         var pannes = val_panne.split('|');
  651.         for(var i=0;i<pannes.length;i++){
  652.             if(pannes[i] != ""){
  653.                 if(pannes[i].indexOf('*_*') > -1){
  654.                     var autrePb =  pannes[i].split('*_*');
  655.                     liste_panne += "td_panne_" + autrePb[0] + '|';
  656.                     $('#td_panne_' + autrePb[0]).css({'background-color': '#007bff', 'color': '#fff'});
  657.                     if($('#td_panne_' + autrePb[0] + '_autre').length){
  658.                         $('#td_panne_' + autrePb[0] + '_autre').val(autrePb[1]);
  659.                         $('#td_panne_' + autrePb[0] + '_autre').show();
  660.                     } else {
  661.                         $('#td_panne_' + autrePb[0]).html($('#td_panne_' + autrePb[0]).html() + '<input type="text" id="td_panne_' + autrePb[0]+'_autre" value="'+autrePb[1]+'"/>');
  662.                     }
  663.                 } else {
  664.                     liste_panne += "td_panne_" + pannes[i] + '|';
  665.                     $('#td_panne_' + pannes[i]).css({'background-color': '#007bff', 'color': '#fff'});
  666.                 }
  667.             }
  668.         }
  669.         $('#panne_selectionne').val(liste_panne);
  670.     }
  671.                     function choixPanne(id, draggable){
  672.                         if(typeof draggable == undefined) {
  673.                             draggable = null;
  674.                         }
  675.                         // //Si le draggable est true, alors on sort du fonction pour ne pas sélectionner les éléments
  676.                         // if(draggable != null) {
  677.                         //     return true;
  678.                         // }
  679.                         var panne =  $('#panne_selectionne').val();
  680.                         //Si on clique sur autre
  681.                         if(id == 'td_panne_16' || id == 'td_panne_43') {
  682.                             //Si on n'a pas encore cliqué sur autre, alors on insert le texte champ
  683.                             if(!$('#' + id).attr('data-clique')) {
  684.                                 if(id == 'td_panne_16'){
  685.                                     $('#' + id).attr('data-clique', 'td_16_changee');
  686.                                 } else {
  687.                                     $('#' + id).attr('data-clique', 'td_43_changee');
  688.                                 }
  689.                                 if($('#td_panne_' + id + '_autre').length == 0){
  690.                                     $('#' + id).html($('#' + id).html() + '<input type="text" id="'+ id +'_autre" />');
  691.                                 }
  692.                             }
  693.                         }
  694.                         //Si le draggable est true, alors on sort du fonction pour ne pas sélectionner les éléments
  695.                         if(draggable != null) {
  696.                             return true;
  697.                         }
  698.                         //Code qui va bloquer la cloque sur le champ autre problème (pour ne pas fermer)
  699.                         $('#'+id + '_autre').click(function (event) {
  700.                             return false;
  701.                         });
  702.                         if(panne.indexOf(id+'|') > -1){
  703.                             $('#panne_selectionne').val(panne.replace(id+'|',''));
  704.                             $('#'+id).css({'background': 'none', 'color': '#0099ff'});
  705.                             $('#'+id + '_autre').hide();
  706.                         }
  707.                         else {
  708.                             $('#panne_selectionne').val(panne+id+'|');
  709.                             $('#'+id).css({'background-color': '#007bff', 'color': '#fff'});
  710.                             $('#'+id + '_autre').show();
  711.                         }
  712.                     }
  713.                     function ValideChoixPanne(){
  714.                         var dest = $('#destination_panne_selection').val();
  715.                         var pannes =  $('#panne_selectionne').val().split('|');
  716.                         var pannes_value = "";
  717.                         var pannes_text = "";
  718.                         var text = "";
  719.                         for(var i=0;i<pannes.length;i++){
  720.                             if(pannes[i] != "") {
  721.                                 //Si on a sélectionné un autre problème, alors on récupère depuis ce champ
  722.                                 if(pannes[i] == "td_panne_16" || pannes[i] == "td_panne_43") {
  723.                                     text = $('#' + pannes[i] + '_autre').val()
  724.                                     pannes_text +=text + " ";
  725.                                     pannes_value += pannes[i].replace('td_panne_', '') + '*_*'+text+'|';
  726.                                 }
  727.                                 else {
  728.                                     pannes_value += pannes[i].replace('td_panne_', '') + '|';
  729.                                     pannes_text += $('#' + pannes[i]).text() + " ";
  730.                                 }
  731.                             }
  732.                         }
  733.                         if(pannes_text == ""){
  734.                             pannes_text = "{{ 'type_panne'|trans }}";
  735.                         }
  736.                         if(pannes_text == ' ') {
  737.                             pannes_text = "{{ 'pas_de_panne'|trans }}";
  738.                         }
  739.                         $('#type_panne_'+dest).val(pannes_value);
  740.                         $('#em_panne_'+dest).html(pannes_text);
  741.                         $('.list_choix_panne').css({'background': 'none', 'color': '#0099ff'});
  742.                         $('#destination_panne_selection').val('');
  743.                         $('#panne_selectionne').val('');
  744.                     }
  745.                     function UploadFile(name_input_file,destination,reference,name_progess,name_visu,name_del,name_link, fileDrop, mimeTypes, hiddenField, fileNameCustom){
  746.                         if (typeof name_progess == 'undefined') {
  747.                             name_progess = null;
  748.                         }
  749.                         if (typeof name_visu == 'undefined') {
  750.                             name_visu = null;
  751.                         }
  752.                         if (typeof name_del == 'undefined') {
  753.                             name_del = null;
  754.                         }
  755.                         if (typeof name_link == 'undefined') {
  756.                             name_link = null;
  757.                         }
  758.                         if (typeof fileDrop == 'undefined') {
  759.                             fileDrop = null;
  760.                         }
  761.                         if (typeof mimeTypes == 'undefined' || mimeTypes == null) {
  762.                             mimeTypes = {
  763.                                 'image/jpeg': '.jpg, .jpeg',// Par défaut
  764.                             };
  765.                         }
  766.                         if (typeof hiddenField == 'undefined') {
  767.                             hiddenField = null;
  768.                         }
  769.                         if (typeof fileNameCustom == 'undefined' || fileNameCustom == '') {
  770.                             fileNameCustom = null;
  771.                         }
  772.                         // Si fileDrop ne pas null, ça veut dire qu'on utilise le drag and drop
  773.                         let files = null;
  774.                         if(fileDrop !== null) {
  775.                             files = fileDrop;
  776.                         }else {
  777.                             files = document.querySelector('#'+name_input_file).files;
  778.                         }
  779.                         //On fait une boucle pour parcourire les fichiers (si multiple)
  780.                         let filesData = {};
  781.                         $.each(files, (key, file) => {
  782.                             if(Object.keys(mimeTypes).indexOf(file.type) != -1) {
  783.                                 //Nommage fichier
  784.                                 let date = new Date();
  785.                                 let time = date.getHours() + "_" + date.getMinutes() + "_" + date.getSeconds() +'_'+ date.getMilliseconds();
  786.                                 let fileName = file.name.replace(/[!"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~ ]/g, "_");
  787.                                 let nomDuFichier = fileName.replace(/_([^_]*)$/, ".$1"); // Pour avoir un point avant l'extension
  788.                                 let nomDuFichierWithoutExt = nomDuFichier.split('.')[0] + '_' + time;
  789.                                 let fileExtension = nomDuFichier.split('.')[1];
  790.                                 nomDuFichierWithoutExt = nomDuFichierWithoutExt.toLowerCase();
  791.                                 nomDuFichier = nomDuFichierWithoutExt + '.' + fileExtension;
  792.                                 let nomDuFichier_ = nomDuFichier.replace(/\./g, '_');
  793.                                 //Si hiddenField existe, par la suite possibilité de faire dynamiquement
  794.                                 if(hiddenField != null) {
  795.                                     filesData[nomDuFichier] = nomDuFichier;
  796.                                     $('#'+ hiddenField).html($('#'+ hiddenField).html() + '<span id="item_img_'+ nomDuFichier_ +'"><a a href="/uploads/'+ destination +'/'+ nomDuFichier +'" class="mr-2" target="_blank">'+ nomDuFichier +'</a><a href="#step-5" id="pieceJointeSuppBtn" onclick="pieceJointeSuppBtn(\''+nomDuFichier_+'\')"><i class="pe-7s-trash"> </i></a></span>');
  797.                                 }
  798.                                 // upload file now
  799.                                 let data = new FormData();
  800.                                 //If we use a custom filename
  801.                                 if(fileNameCustom != null) {
  802.                                     nomDuFichierWithoutExt = fileNameCustom;
  803.                                 }
  804.                                 // file selected by the user
  805.                                 data.append('file', file);
  806.                                 data.append('dst',destination);
  807.                                 data.append('ref',nomDuFichierWithoutExt);
  808.                                 let request = new XMLHttpRequest();
  809.                                 request.open('POST', '/{{ app.request.locale }}/upload');
  810.                                 if(name_progess !== null) {
  811.                                     $('#'+ name_progess +'progress-box').css('display', 'block');
  812.                                     $('#'+ name_progess +'progress_bar_percent').attr('class', "progress-bar progress-bar-animated bg-info progress-bar-striped");
  813.                                     // upload progress event
  814.                                     request.upload.addEventListener('progress', function(e) {
  815.                                         let percent_complete = Math.round((e.loaded / e.total)*100);
  816.                                         // percentage of upload completed
  817.                                         $('#'+ name_progess +'progress_bar_percent').attr('aria-valuenow', percent_complete).css('width', percent_complete+'%');
  818.                                         if(percent_complete === 100){
  819.                                             $('#'+ name_progess +'progress_bar_percent').attr('class', "progress-bar progress-bar-animated bg-success progress-bar-striped");
  820.                                             $('#'+ name_progess +'progress-box').fadeOut( 3000, function() {
  821.                                                 $(this).css('display', 'none');
  822.                                                 $('#'+ name_progess +'progress_bar_percent').attr('aria-valuenow', 0).css('width', '0%');
  823.                                             });
  824.                                         }
  825.                                     });
  826.                                 }
  827.                                 // AJAX request finished event
  828.                                 request.addEventListener('load', function(e) {
  829.                                     // HTTP status message
  830.                                     const response = JSON.parse(request.response);
  831.                                     if(request.status === 200){
  832.                                         toastr.success ('',response[0], {positionClass: "toast-bottom-right"});
  833.                                         //Reactivate the Save button CC
  834.                                         $('#facturation_form_btn_update').prop('disabled', false);
  835.                                         if(name_visu !== null) {
  836.                                             $("#"+name_visu).css('display', 'block');
  837.                                         }
  838.                                         if(name_del !== null) {
  839.                                             $("#"+name_del).css('display', 'block');
  840.                                         }
  841.                                         if(name_link !== null) {
  842.                                             $("#"+name_link).attr('href', response[1]);
  843.                                         }
  844.                                     } else {
  845.                                         toastr.error ('',response[0], {positionClass: "toast-bottom-right"});
  846.                                     }
  847.                                 });
  848.                                 // send POST request to server side script
  849.                                 request.send(data);
  850.                             }
  851.                             else {
  852.                                 $('#param-livraison-upload-error').html('{{ "message.format_fichier_non_valide"|trans }}<br>{{ "message.format_fichier_non_valide_format_accepte"|trans }} ' + Object.values(mimeTypes).join(', '));
  853.                                 $("#param-livraison-upload-file h5").html('{{ "cc_param_livraison_fichier_drag_and_drop1"|trans }}<br>{{ "ou"|trans }}<br>{{ "cc_param_livraison_fichier_drag_and_drop2"|trans }}');
  854.                                 setTimeout(function(){
  855.                                     $('#param-livraison-upload-error').hide();
  856.                                 }, 10000);
  857.                             }
  858.                         });
  859.                         return filesData;
  860.                     }
  861.                     function DeleteUploadFile(dst,ref,name_visu,name_del,name_link){
  862.                         // user has not chosen any file
  863.                         if(!confirm("{{ "message.confirmationsuppression"|trans }}")) {
  864.                             return false;
  865.                         } else {
  866.                             let data = new FormData();
  867.                             data.append('dst',dst);
  868.                             data.append('ref',ref);
  869.                             let request = new XMLHttpRequest();
  870.                             request.open('POST', '/{{ app.request.locale }}/delupload');
  871.                             // AJAX request finished event
  872.                             request.addEventListener('load', function(e) {
  873.                                 // HTTP status message
  874.                                 const response = JSON.parse(request.response);
  875.                                 if(request.status === 200){
  876.                                     toastr.success ('',response[0], {positionClass: "toast-bottom-right"});
  877.                                     $("#"+name_visu).css('display', 'none');
  878.                                     $("#"+name_del).css('display', 'none');
  879.                                     $("#"+name_link).attr('href', "");
  880.                                 } else {
  881.                                     toastr.error ('',response[0], {positionClass: "toast-bottom-right"});
  882.                                 }
  883.                             });
  884.                             // send POST request to server side script
  885.                             request.send(data);
  886.                             return true;
  887.                         }
  888.                     }
  889.                     /*
  890.                         Code JS pour e commande client matériel
  891.                     */
  892.                     function affichageMaterielCc()
  893.                     {
  894.                         //Revendeur
  895.                         $('#table_produits_revendeur').DataTable({
  896.                             "bLengthChange" : false,
  897.                             "bInfo": false,
  898.                             "pageLength": 10,
  899.                             "ordering": false,
  900.                             "drawCallback": function() {
  901.                                 $("#table_produits_revendeur thead").remove();
  902.                             }
  903.                         });
  904.                         $('#table_produits_revendeur_filter input[type=search]').addClass('form-control mt-2').attr('style', 'width: 500px;');
  905.                         $('#table_produits_revendeur_filter label').addClass('produit_recherche');
  906.                         //Planet
  907.                         $('#table_produits_planet').DataTable({
  908.                             "bLengthChange" : false,
  909.                             "bInfo": false,
  910.                             "pageLength": 10,
  911.                             "ordering": false,
  912.                             "drawCallback": function() {
  913.                                 $("#table_produits_planet thead").remove();
  914.                             }
  915.                         });
  916.                         $('#table_produits_planet_filter input[type=search]').addClass('form-control mt-2').attr('style', 'width: 500px;');
  917.                         $('#table_produits_planet_filter label').addClass('produit_recherche');
  918.                     }
  919.                     function desactiveEntrer(e){
  920.                         if (e.keyCode == 13) {
  921.                             return false;
  922.                         }
  923.                     }
  924.                     function getDateDifference(){
  925.                         let d1 = $('#cc_update_status_form_dateDebut').val();
  926.                         let splitDate1 = d1.split('-');
  927.                         let day1 = splitDate1[2];
  928.                         let month1 = splitDate1[1];
  929.                         let year1 = splitDate1[0];
  930.                         let d2 = $('#cc_update_status_form_dateFin').val();
  931.                         let splitDate2 = d2.split('-');
  932.                         let day2 = splitDate2[2];
  933.                         let month2 = splitDate2[1];
  934.                         let year2 = splitDate2[0];
  935.                         let calculateDayDifference = (day2 - day1);
  936.                         let calculateMonthDifference = (month2 - month1);
  937.                         let calculateYearDifference = (year2 - year1);
  938.                         if(calculateMonthDifference > 3 && calculateDayDifference === 0) {
  939.                             alert("La période de recherche ne doit pas dépasser 3 mois");
  940.                             return false;
  941.                         } else if (calculateYearDifference == 1 && calculateMonthDifference > 3) {
  942.                             alert("La période de recherche ne doit pas dépasser 3 mois");
  943.                             return false;
  944.                         } else if (calculateYearDifference > 2) {
  945.                             alert("La période de recherche ne doit pas dépasser 3 mois");
  946.                             return false;
  947.                         } else if (calculateMonthDifference >= 3 && calculateDayDifference >= 1) {
  948.                             alert("La période de recherche ne doit pas dépasser 3 mois");
  949.                             return false;
  950.                         } else {
  951.                             $('#cc_update_status_form').submit();
  952.                         }
  953.                     }
  954.                     /*
  955.                         Code pour afficher/masquer le tableau type panne
  956.                      */
  957.                     function checkboxPasDePanne()
  958.                     {
  959.                         $('#choix_mat_table').hide();
  960.                         $("#type_panne_pas_de_panne").change(function() {
  961.                             if(this.checked) {
  962.                                 $('#choix_mat_table').hide();
  963.                                 $('#panne_selectionne').val('td_panne_44');
  964.                             }
  965.                             else {
  966.                                 $('#choix_mat_table').show();
  967.                                 $('#panne_selectionne').val('');
  968.                             }
  969.                         });
  970.                     }
  971.                     function imprimer(event){
  972.                         if($('#print_authorisation').html() == "false") {
  973.                             alert("Vous n'avez pas le droit d'imprimer cette étiquette");
  974.                             event.preventDefault();
  975.                         } else {
  976.                             var stock = $("#stock").html();
  977.                             var modele = $("#modele").html();
  978.                             var serial = $("#serial").html();
  979.                             var etat = $("#etat").html();
  980.                             let post = "type=btn_print";
  981.                             post += "&stock="+stock;
  982.                             post += "&modele="+modele;
  983.                             post += "&serial="+serial;
  984.                             post += "&etat="+etat;
  985.                             ValidAjax('{{ app.request.uri }}', post, true);
  986.                             event.preventDefault();
  987.                         }
  988.                     }
  989.                     function datatableExportBtn(type, customizeOptions)
  990.                     {
  991.                         if (typeof type == 'undefined') {
  992.                             type = 'csv';
  993.                         }
  994.                         let baseOptions = {
  995.                             "extend": type,
  996.                             "text": '<img src="/images/excel.png" alt="Logo" />',
  997.                             "fieldSeparator": ';',
  998.                             "className": 'btn_export_datatable',
  999.                             "exportOptions": {
  1000.                                 "format": {
  1001.                                     "header": function (data) {
  1002.                                         data = data.replace(/<[^>]+>/g, '');
  1003.                                         data = data.trim().replace(/\s+/g, ' ');
  1004.                                         return data;
  1005.                                     },
  1006.                                     "body": function (data) {
  1007.                                         data = data.replace(/<[^>]+>/g, '');
  1008.                                         data = data.trim().replace(/\s+/g, ' ');
  1009.                                         return data;
  1010.                                     }
  1011.                                 }
  1012.                             }
  1013.                         };
  1014.                         if (typeof customizeOptions === 'function') {
  1015.                             var additionalOptions = customizeOptions();
  1016.                             $.extend(true, baseOptions, additionalOptions);
  1017.                         }
  1018.                         return [baseOptions];
  1019.                     }
  1020.                     function togglePasswordVisibility() {
  1021.                         if($('#authentification_form_motdepasse').attr('type') === 'password') {
  1022.                             $('#authentification_form_motdepasse').attr('type', 'text');
  1023.                             $('#toggle-visibility-span').attr('title', '{{ 'hide_password'|trans }}');
  1024.                             $('#login-form-password-icon').removeClass('fa-eye').addClass('fa-eye-slash');
  1025.                         } else {
  1026.                             $('#authentification_form_motdepasse').attr('type', 'password');
  1027.                             $('#toggle-visibility-span').attr('title', '{{ 'show_password'|trans }}');
  1028.                             $('#login-form-password-icon').removeClass('fa-eye-slash').addClass('fa-eye');
  1029.                         }
  1030.                     }
  1031.                 </script>
  1032.                 <style>
  1033.                     .scrollable-line {
  1034.                         display: inline-block;
  1035.                         white-space: nowrap;
  1036.                         overflow: hidden;
  1037.                         text-overflow: ellipsis;
  1038.                     }
  1039.                     .scrollable-line:hover > a > span, .one-line:focus > a > span {
  1040.                         display: inline-block;
  1041.                         animation-name: scroll-text;
  1042.                         animation-duration: 7s;
  1043.                         animation-timing-function: linear;
  1044.                         animation-delay: 0s;
  1045.                         animation-iteration-count: infinite;
  1046.                         animation-direction: normal;
  1047.                     }
  1048.                     @keyframes scroll-text {
  1049.                         0% {
  1050.                             transform: translateX(0%);
  1051.                         }
  1052.                         90% {
  1053.                             transform: translateX(-50%);
  1054.                         }
  1055.                         95% {
  1056.                             transform: translateX(0%);
  1057.                         }
  1058.                         100% {
  1059.                             transform: translateX(0%);
  1060.                         }
  1061.                     }
  1062.                     .client-data:hover{
  1063.                         cursor: pointer;
  1064.                     }
  1065.                     .choix_liste_td td{
  1066.                         color: #0099ff;
  1067.                         text-align:center;
  1068.                         font-size:9pt;
  1069.                     }
  1070.                     .choix_liste_td td:hover{
  1071.                         background-color: #007bff;
  1072.                         color: #fff;
  1073.                         cursor: pointer;
  1074.                     }
  1075.                     /* Table des installations Clients */
  1076.                     .tableFixHead{
  1077.                         overflow: auto;
  1078.                         height: 100px;
  1079.                     }
  1080.                     .tableFixHead thead th {
  1081.                         position: sticky; top: 0;
  1082.                         z-index: 1;
  1083.                         background: white;
  1084.                         font-size: 12px;
  1085.                     }
  1086.                     #no_install{
  1087.                         font-weight: bolder;
  1088.                         color: red;
  1089.                     }
  1090.                     /* HIDE RADIO */
  1091.                     .contact_choix {
  1092.                         position: absolute;
  1093.                         opacity: 0;
  1094.                         width: 0;
  1095.                         height: 0;
  1096.                     }
  1097.                     /* IMAGE STYLES */
  1098.                     .contact_choix + img {
  1099.                         cursor: pointer;
  1100.                     }
  1101.                     /* CHECKED STYLES */
  1102.                     .selected + img {
  1103.                         border: 2px solid #73AD21;
  1104.                         border-radius: 25px;
  1105.                     }
  1106.                     .btn-etat:hover {
  1107.                         background: #3ac47d;
  1108.                         color:white;
  1109.                     }
  1110.                     /* Faire Apparaitre le commentaire du Tech sur Hover de la ligne ATT_HISTORIQUE */
  1111.                     .tooltip .tooltiptext {
  1112.                         visibility: hidden;
  1113.                     }
  1114.                     .tooltip:hover .tooltiptext {
  1115.                         visibility: visible;
  1116.                     }
  1117.                     /* Etat Btn Cloture ATT */
  1118.                     .selected-cloture-att{
  1119.                         background-color: #3ac47d;
  1120.                         color:white;
  1121.                     }
  1122.                     /* Style de la Table ATT HISTORIQUE */
  1123.                     .table_att_historique th, .table_att_historique td {
  1124.                         font-size: 12px;
  1125.                     }
  1126.                     .table_att_liste th, .table_att_liste td {
  1127.                         font-size: 12px;
  1128.                     }
  1129.                     .table_att_historique{
  1130.                         border-left: 6px solid #2d87c3;
  1131.                     }
  1132.                     .table_att_liste{
  1133.                         border-left: 6px solid #009800;
  1134.                     }
  1135.                     /* Style de la Table ETAT CLOTURE */
  1136.                     .table_etat_att th, .table_etat_att td {
  1137.                         font-size: 14px;
  1138.                     }
  1139.                     /* Style de la Table Retour SEARCH_CLIENT */
  1140.                     #table_result_search_client th, #table_result_search_client td{
  1141.                         font-size: 12px;
  1142.                     }
  1143.                 </style>
  1144.         {% block modal %}
  1145.         {% endblock %}
  1146.         </body>
  1147. </html>