{"xsrfToken":"B7HP-RVU7-8F2E-SJ3U_8e770f9c2cd7e6d283fb364ae95e2a5ab2203519_lin","user":{"key":"anonymous","userName":"Anonymous","avatars":{"xsmall":"https://jira.zurichseguros.com.co/secure/useravatar?size=xsmall&avatarId=10349","small":"https://jira.zurichseguros.com.co/secure/useravatar?size=small&avatarId=10349","medium":"https://jira.zurichseguros.com.co/secure/useravatar?size=medium&avatarId=10349","large":"https://jira.zurichseguros.com.co/secure/useravatar?avatarId=10349","xlarge":"https://jira.zurichseguros.com.co/secure/useravatar?avatarId=10349"},"displayName":"Servicio al Cliente","email":"johanna.1.ruiz@zurich.com","timezone":{"id":"JIRA","regionKey":"JIRA","city":"Bogotá","gmtOffset":"(GMT-05:00)"},"calendarResource":"jira.webresources:calendar-es","language":{"key":"es_ES","displayName":"español (España) [Predeterminado]"},"canChangePassword":true,"canUpdateUser":true,"allOpenRequestsCount":48285,"pendingApprovalsCount":0,"approvalsCount":0,"customMenuLinks":[],"notificationType":"html","canAdministerJIRA":false,"agentForPortal":false},"branding":{"id":"6","key":"rac","name":"Recibidos Atención Cliente","portalBaseUrl":"/servicedesk/customer/portal/6"},"helpCenterBranding":{"logoUrl":""},"portal":{"id":"6","key":"rac","projectId":13001,"serviceDeskId":6,"name":"Recibidos Atención Cliente","description":"<p>Bienvenido. Puede generar una solicitud Recibidos Atención Cliente a partir de las opciones proporcionadas.</p>","portalBaseUrl":"/servicedesk/customer/portal/6","onlyPortal":false,"reqTypes":[],"reqGroups":[],"orderMapping":{},"kbs":{"kbEnabled":false,"serviceDeskId":-1},"createPermission":true,"openRequestCount":0,"announcement":{"header":"","headerWiki":"","message":"","messageWiki":"","canEditAnnouncement":false,"portalId":6}},"sharedPortal":{"name":"Centro de asistencia","description":"<p>Bienvenido al centro de ayuda, estamos aquí para ayudarlo. Genere una solicitud a partir de las opciones proporcionadas.</p>","kbs":{"kbEnabled":false}},"announcement":{"header":"","headerWiki":"","message":"","messageWiki":"","canEditAnnouncement":false,"portalId":null},"organisations":{"organisations":[]},"portalWebFragments":{"headerPanels":[{"params":{},"key":"tig.jira.extension.tigGlobalScriptExtension:gs-customer-portal-header","name":"Global Script Customer Portal Header","html":"<html>\n <div id=\"global-css-header\">\n <!-- Global CSS & JS for Jira, CSS section --><style>\n@import url(\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css\");\n.vp-optional{\ncolor: white !important;\n}\n .field-label{\ncolor: white !important;\n}\nbody:not(.custom-portal-layout-flag).aui-page-fixed .aui-page-panel-inner.cv-smart-portal-panel-inner {\nmin-height: 400px;\nwidth: 100% !important;\n}\n#isuuesP{\nfloat: none;\nmargin: 0 auto;\nalign-items: center;\n}\n\n.anon-login-menu{ /*Botón Log In */\n display:none;\n}\n#user-options{ /*Botón Log In */\n display:none;\n}\n.aui-nav{ /*Botón Solicitudes y botón perfil */\n display:none;\n}\n.custom-control.image-checkbox {\n position: relative;\n padding-left: 0;\n}\n\n.custom-control.image-checkbox .custom-control-input:checked ~ .custom-control-label:after, .custom-control.image-checkbox .custom-control-input:checked ~ .custom-control-label:before {\n opacity: 1;\n}\n\n.custom-control.image-checkbox label {\n cursor: pointer;\n}\n\n.custom-control.image-checkbox label:before {\n border-color: #007bff;\n background-color: #007bff;\n}\n\n.custom-control.image-checkbox label:after, .custom-control.image-checkbox label:before {\n transition: opacity .3s ease;\n opacity: 0;\n left: .25rem;\n}\n\n.custom-control.image-checkbox label:focus, .custom-control.image-checkbox label:hover {\n opacity: .8;\n}\n\n.custom-control.image-checkbox label img {\n border-radius: 2.5px;\n}\n\n.form-group-image-checkbox.is-invalid label {\n color: #dc3545;\n}\n\n.form-group-image-checkbox.is-invalid .invalid-feedback {\n display: block;\n}\n#cv-request-content{\nmin-height: 15px !important;\n}\n.cv-landing-list .cv-request-type{\ndisplay: none !important;\n}\nbody:not(.custom-portal-layout-flag) .cv-page-1col .aui-page-panel-inner {\n\nwidth: 65% !important;\n\n}\n\n#CrearSiniestro{\nposition:relative;\ntop: 35px;\nborder-radius: 12px !important;\n}\n#CrearPoliza{\nposition:relative;\ntop: 35px;\nborder-radius: 12px !important;\n}\n\n input:required:invalid, input:focus:invalid {\nbackground-image: url(http://172.22.6.62:8080/images/required.png);\nbackground-position: right top;\nbackground-repeat: no-repeat;\nbackground-size: 30px 30px;\n }\n input:required:valid {\nbackground-image: url(http://172.22.6.62:8080/images/ok.png);\nbackground-position: right top;\nbackground-repeat: no-repeat;\nbackground-size: 30px 30px;\n }\n\ninput[type=number]::-webkit-inner-spin-button,\ninput[type=number]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.activity-item.request-fields > dl > dt {\ncolor: white !important;\n}\n\n\n.container {\n padding: 20px 10%;\n}\n\n.box {\n position: relative;\n background: #2caee5;\n width: 100%;\n}\n\n.box-header {\n color: #FFF;\n display: block;\n padding: 10px;\n position: relative;\n border-bottom: 1px solid #f4f4f4;\n margin-bottom: 10px;\n}\n\n.box-tools {\n position: absolute;\n right: 10px;\n top: 5px;\n}\n\n.dropzone-wrapper {\n border: 2px #91b0b3;\n color: #6D7278;\n position: relative;\n height: 150px;\n background-color:#FFF;\n border-radius:12px;\n}\n\n.dropzone-desc {\n position: absolute;\n margin: 0 auto;\n left: 0;\n right: 0;\n text-align: left;\n width: 95%;\n top: 20px;\n font-size: 16px;\n}\n\n.dropzone,\n.dropzone:focus {\n \n outline: none !important;\n width: 100%;\n height: 150px;\n cursor: pointer;\n opacity: 0;\n}\n\n.dropzone-wrapper:hover,\n.dropzone-wrapper.dragover {\n background: #f1e3e3;\n}\n\n.preview-zone {\n text-align: letf;\n}\n\n.preview-zone .box {\n box-shadow: none;\n border-radius: 0;\n margin-bottom: 0;\n}\n.borde-iz{\n-webkit-border-image: -webkit-gradient(linear, left top, left bottom, from(#555), to(#fff), color-stop(0.5, #fff), color-stop(0.5, #66cc00)) 21 30 30 21 repeat repeat;\n\n}\n.top-to-bottom {\nborder-width: 1px;\nborder-style: solid;\n-webkit-border-image:\n -webkit-gradient(linear, 0 0, 0 100%, from(red), to(rgba(0, 0, 0, 0))) 1 100%;\n-webkit-border-image:\n -webkit-linear-gradient(pink, rgba(0, 0, 0, 0)) 1 100%;\n-moz-border-image:\n -moz-linear-gradient(rgba(23, 162, 184, 1), rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)) 1 50%; \n-o-border-image:\n -o-linear-gradient(green, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)) 1 50%;\nborder-image:\n linear-gradient( blue, white) 1, 100% ;\n}\n.cv-description{\ntext-align: center;\n\n}\nhr {\n height: 4px;\n margin-left: 2px;\n margin-top: .5rem !important;\n margin-right: 2px;\n}\nhrw{\n \nborder: none;\nborder-left: 1px solid hsla(200, 10%, 50%,100);\nheight: 100vh;\nwidth: 1px; \n}\n.hr-warning{\n background-image: -webkit-linear-gradient(left, rgba(210,105,30,.8), rgba(210,105,30,.6), rgba(0,0,0,0));\n}\n.hr-success{\n background-image: -webkit-linear-gradient(left, rgba(15,157,88,.8), rgba(15, 157, 88,.6), rgba(0,0,0,0));\n}\n.hr-primary{\n background-image: -webkit-linear-gradient(left, rgba(64, 102, 179, 1), rgba(64, 102, 179, 1), rgba(64, 102, 179, 1));\n width: 90%;\n float: right;\n}\n.hr-danger{\n background-image: -webkit-linear-gradient(left, rgba(244,67,54,.8), rgba(244,67,54,.6), rgba(0,0,0,0));\n}\n\n.breadcrumb {\n background: rgba(245, 245, 245, 0);\n border: 0px solid rgba(245, 245, 245, 1);\n border-radius: 25px;\n display: block;\n}\n\n.btn-bread{\nmargin-top:10px;\nfont-size: 12px;\n\nborder-radius: 3px;\n}\n.textoBoton{\nfont-size:12px !important;\n}\n.textoAzulLight{\ncolor: #003399 !important;\nfont-weight: lighter;\n}\n.textoAzul{\ncolor: #003399 !important;\n\n}\n.textoAzulBold{\ncolor: #003399 !important;\n\nfont-weight: bold;\n}\n.textoBlancoLight{\ncolor: #FFFFFF !important;\nfont-weight: lighter;\n\n}\n.textoBlanco{\ncolor: #FFFFFF !important;\n\n}\n.textoBlancoBold{\ncolor: #FFFFFF !important;\n\nfont-weight: bold;\nline-height: 21px;\n}\n.texto32{\nfont-size: 32px !important;\n}\n.texto16{\nfont-size: 16px !important;\n}\n.texto17{\nfont-size: 24px !important;\n}\n.texto24{\nfont-size: 24px !important;\n}\n.texto32{\nfont-size: 32px !important;\n}\n.texto14{\nfont-size: 14px !important;\n}\n.texto20{\nfont-size: 20px !important;\n}\n.texto19{\nfont-size: 19px !important;\n}\n.texto13{\nfont-size: 13px !important;\n}\n#cv-request-content p {\ndisplay:none;\n}\n.btn-warning{\nbackground-color:#f69c00 !important;\n\n}\n.cv-smart-portal-input-container{\nbackground-color:#E7ECEB !important;\n}\n.bg-primary, .btn-primary{\nbackground-color:#009ee0 !important;\nborder-color:#009ee0 !important;\n}\n.bg-light{\nbackground-color:#E7ECEB !important;\nbackground-color:#E7ECEB !important;\n\n}\n.bg-info{\nbackground-color:#2caee5 !important;\n\n}\n.rounded-medio {\nborder-radius: 12px!important;\nmax-width: 150px;\nmax-height: 110px;\nmin-width: 150px;\nmin-height: 110px;\n\n}\n\n.cv-page-body {\n\nborder-bottom-width: 0px !important;\n}\n.vl {\n border-left: 1px solid #009EE0;\n height: 113px;\n padding-right: 50px;\n margin-left: 25px;\n position: relative;\ntop: -20px;\n}\n.v2 {\n\nborder-left: 1px solid #009EE0;\nheight: 113px;\nmargin-left: 35px;\nmargin-right: 35px;\nposition: relative;\ntop: -20px;\n\n}\n.linkFo{\nmargin-bottom: 0.3rem; !important;\n}\n.lineH20{\nline-height : 20px;\n}\n.paddingOP{\npadding-top: 2rem !important;\npadding-bottom: 0.35rem !important;\n}\n.paddingOP2{\npadding-top: 2rem !important;\npadding-bottom: 2rem !important;\n}\n.paddingBox{\npadding-right: 35px!important;\npadding-left: 35px!important;\n}\n.cv-kb-search-results-box .cv-smart-portal-sub-header {\nfont-size: 20px;\ncolor: #039 !important;\nfont-weight: bold !important;\npadding-top: 30px;\n}\n.cv-smart-portal-kb-header {\ncolor: #039 !important;\n}\n.cv-smart-portal-kb-article-name{\ncolor: #039 !important;\n}\n.cv-smart-portal-kb-result .cv-smart-portal-kb-description { \ncolor: #039 !important;\nfont-weight: lighter !important;\n}\n.cv-search-results-container{\nmargin-left: 20% !important;\nmargin-right: 20% !important;\n}\n.cv-help-center-panel-inner{\nwidth: 90% !important\n}\n.cv-browse-container{\n\nmargin-left: 20%;\nmargin-right: 20%;\n}\n.cv-smart-portal-sub-header{\ncolor: #039 !important;\nfont-weight: bold !important;\n}\n.cv-smart-portal-request-type-name{\ncolor: #039 !important;\n}\n.aui-dialog2-content{\ncolor: #039 !important;\n}\n.custom-control-label::before {\nposition: absolute;\ntop: -.1rem !important;\nleft: -2.1rem !important;\ndisplay: block;\nwidth: 2rem !important;\nheight: 2rem !important;\npointer-events: none;\ncontent: \"\";\nbackground-color: #2caee5 !important;\nborder: #ffffff solid 1px !important;\n}\n.custom-control-label::after {\nposition: absolute;\ntop: -.1rem !important;\nleft: -2.1rem !important;\ndisplay: block;\nwidth: 2rem !important;\nheight: 2rem !important;\ncontent: \"\";\n\n}\n.custom-control-inline {\ndisplay: -ms-inline-flexbox;\ndisplay: inline-flex;\nmargin-right: 1rem;\npadding-left: 4rem !important;\n}\nelemento {\n\n}\n.cv-smart-portal-search-input-container .cv-smart-portal-search-input.text {\n \nfont-weight: lighter;\n\n}\n.cv-smart-portal-search-help{\nmargin-bottom: 15px !important;\n}\n.cv-smart-portal-input-box-container{/*This class show customer portal search bar (Confluence) */\n\tdisplay:none;\n}\n.aui-button{\n\tdisplay:none;\n}\n.cardPP{\n\n}\n.col-md-10{\npadding-left: 4rem;\npadding-right: 4rem;\n}\n.col-md-12{\npadding-left: 4rem;\npadding-right: 4rem;\n}\n.card-header{\npadding: .75rem 2.25rem !important;\n}\ntextarea.form-control {\n\n\nborder-radius: 12px;\n\n}\n#menuContextual{\npadding-top: 40px;\n}\n#menuContextual2{\npadding-top: 0px !important;\npadding-bottom: 0px! important;\n\n}\n.triangle-down {\nwidth: 0;\nheight: 0;\nborder-left: 15px solid transparent;\nborder-right: 15px solid transparent;\nborder-top: 13px solid #F69C00;\nposition: relative;\ntop: 35px;\nleft: 130px;\n\n}\n.cv-request-type-group{\ndisplay:none !important;\n}\n.cv-requests-list table.aui > tbody > tr > td {\nvertical-align: middle;\nbackground-color: #FFF;\nborder-bottom-color: #2caee5 !important;\n}\n\n.btnSug{\nmin-width: 150px;\nmin-height: 50px;\nborder-radius: 12px !important;\n\n}\n.paddingBox2{\npadding-button: 50px!important;\n}\n.noMargin{\nmargin-top: 6px !important;\n margin-bottom: 0px !important;\n}\n#issuesP2{\npadding-bottom: 80px !important;\nfloat: none;\nmargin: 0 auto;\nalign-items: center;\n}\ntable.aui{\nborder-radius: 20px;\n background: white;\nbox-shadow: 0px 2px 6px 0px;\n}\n.cv-main {\n background: 200px #009ee0;\n padding: 50px;\n box-shadow: 0px 2px 4px 0px;\n }\n.cv-requests-list .cv-pagination-position {\n margin-top: 60px;\n}\n\n.aui-nav-pagination>li {\n margin-top: 50px;\n}\ntable.aui>tbody>tr, table.aui>tfoot>tr{\nbackground-color:transparent !important;\n\n}\n.cv-requests-list table.aui > tbody > tr > td{\nbackground-color:transparent !important;\n\n}\n.cv-requests-list{\nfont-size: 12px !important;\ncolor: #6D7278 !important;\n\n\n}\n\nbody:not(.custom-portal-layout-flag) .cv-requests-list .cv-portal-cell .cv-cell-content {\n\n color: #6D7278 !important;\n}\n.cv-requester-cell{\ncolor: #6D7278 !important;\n\n}\n.custom-select{\n\nbackground: url(\"https://eladndepowerpivot.com/wp-content/uploads/2019/04/arrow-icon-clip-art-file-down-arrow-icon-png-balin-icon-arrow-right-32-300x300.png\") no-repeat right .75rem center/30px 30px !important;\nbackground-color: #fff !important;\n}\n.vp-activity-list{\nbackground-color: #009ee0;color: white;\npadding: 15px;\n}\ndd a{\ncolor: white;\n}\n.activity-item header time{\ncolor: white;\n}\n.activity-item header h4 {\n color: white;\n}\n.cv-request-options{\nbackground-color:#009ee0;\ncolor:white;\npadding:15px;\n}\n.cv-request-actions a{\ncolor:white;\n}\n.cv-request-options a .aui-icon{\ncolor:white;\npadding-right: 25px;\n}\n.cv-request-option-title{\ncolor:white;\n}\n.sd-user-tag{\ncolor:white;\n}\n.sd-user.sd-user-tagged .sd-user-tag{\ncolor:white;\n}\n</style><!-- End Global CSS & JS for Jira, CSS section-->\n </div>\n</html>"}],"subheaderPanels":[],"footerPanels":[{"params":{},"key":"tig.jira.extension.tigGlobalScriptExtension:gs-customer-portal-footer","name":"Global Script Customer Portal Footer","html":"<html>\n <div id=\"global-js-footer\">\n <!-- Global CSS & JS for Jira, JS section --><script>\n\nif (jQuery.browser.msie) {\n alert(\"Hola, para mejorar tu experiencia de usuario recomendamos usar Google Chrome o Firefox. \");\n}\nif (navigator.userAgent.search(\"MSIE\") >= 0) {\n alert(\"Hola, para mejorar tu experiencia de usuario recomendamos usar Google Chrome o Firefox. \");\n}\nelse if (navigator.userAgent.search(\"Edge\") >= 0) {\n alert(\"Hola, para mejorar tu experiencia de usuario recomendamos usar Google Chrome o Firefox. \");\n}\n/*\n\n****************************************\n***** * * * *****\n* * * * * * *\n***** * * * * ****\n* * * * * * * * *\n* * * * * *****\n****************************************\n\n//-------------------------------------\n// \n// Resumen\n// \n//-------------------------------------\n\n@DESCRIPTION\nScrip para la personalización del protal\nde usuario de Jira service desk\n\n@Author\nEfrain Ramirez (RAVE)\n\nDiciembre-Enero 2020\n\nBootStrap + Jquery + API jira\n*/\n\nvar cssId = 'myCss'; \n</script>\n\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/annyang/2.6.0/annyang.min.js\">\n</script>\n<script src=\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js\" integrity=\"sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1\" crossorigin=\"anonymous\">\n</script>\n<script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js\" integrity=\"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM\" crossorigin=\"anonymous\">\n</script>\n\n<script>\nfunction calculaANS(maxDias){\n\nvar d=new Date();\n\nvar fiestas=new Array(new Array(1,0),new Array(6,0),new Array(23,2),new Array(9,3),new Array(10,3),new Array(1,4),new Array(25,4),new Array(15,5),new Array(22,5),new Array(29,5),new Array(20,6),new Array(7,7),new Array(17,7),new Array(12,9),new Array(2,10),new Array(16,10),new Array(8,11),new Array(25,11));\n//se revisa si no es sabado o domingo\nvar contadorDias=0;\nvar contadorFestivos=0;\nwhile(contadorDias<maxDias){\n d.setDate(d.getDate()+1);\nif ((d.getDay()==0) || (d.getDay()==6)){\nconsole.log(\"soy domingo o sabado\");\n}\nelse {\ncontadorFestivos=0;\nfor (var i=0;i<fiestas.length; i++) {\nif ((d.getMonth()==fiestas[i][1]) && (d.getDate()==fiestas[i][0])){\ncontadorFestivos++;\n}\n}\nif(contadorFestivos==0){\ncontadorDias++;\n}\n\n}\n\n}\nreturn d.getFullYear()+\"-\"+((d.getMonth())+1)+\"-\"+d.getDate();\n\n}\n //se realizan todos los coambios una vez el DOM esta listo\n jQuery( document ).ready(function() {\n \n//PARAMETROS de URL\nvar llaveIs=\"ACZ\";\nvar iteracionAPI=0;\nvar selectedTema=\"\";\nvar urlPortalZurich=\"https://www.zurichseguros.com.co/es-co\"; \nvar urlBase=\"https://jira.zurichseguros.com.co\";\nvar linkPortal=urlBase+\"/servicedesk/customer/portal/6\";\nvar linkPortals = urlBase+\"servicedesk/customer/portals\";\nvar query=\"q=\";\nvar linkSiniestros =urlBase+\"/servicedesk/customer/portal/1/create/14\";\nvar linkOtrasSolicitudes=urlBase+\"/servicedesk/customer/portal/1/create/15\";\nvar urlAttach = 'https://icons-for-free.com/iconfiles/png/512/attachment+clip+paper+clip+icon-1320166579616077328.png';\nvar urlDoc = \"https://icons.iconarchive.com/icons/pelfusion/long-shadow-media/512/Document-icon.png\";\n\nvar linkInfoGeneral=urlBase+\"/servicedesk/customer/portal/6?info=true\";\nvar linkInfoGeneralBase=urlBase+\"/servicedesk/customer/portal/6/create/27\";\n//Equivalente a polizas\nvar linkDerechos=urlBase+\"/servicedesk/customer/portal/6?poli=true\";\nvar linkDerechosBase=urlBase+\"/servicedesk/customer/portal/6/create/28\";\n//Sugerencias\nvar linkSugerencias=urlBase+\"/servicedesk/customer/portal/6?suge=true\";\nvar linkSugerenciasBase=urlBase+\"/servicedesk/customer/portal/6/create/37\";\n//Gestion\nvar linkGestion=urlBase+\"/servicedesk/customer/portal/6?gest=true\";\nvar linkGestionBase=urlBase+\"/servicedesk/customer/portal/6/create/29\";\n//Habeas\nvar linkHabeas=urlBase+\"/servicedesk/customer/portal/6?habe=true\";\nvar linkHabeasBase=urlBase+\"/servicedesk/customer/portal/6/create/32\";\n//Certificados\nvar linkCertificados=urlBase+\"/servicedesk/customer/portal/6?cert=true\";\nvar linkCertificadosBase=urlBase+\"/servicedesk/customer/portal/6/create/33\";\n//quejas y sugerencias\nvar linkQuejaSugerencia=urlBase+\"/servicedesk/customer/portal/6?qesu=true\";\nvar linkQuejaSugerenciaBase=urlBase+\"/servicedesk/customer/portal/6/create/99\";\n//queja\nvar linkQueja=urlBase+\"/servicedesk/customer/portal/6?quej=true\";\nvar linkQuejaBase=urlBase+\"/servicedesk/customer/portal/6/create/13\";\n//derecho\nvar linkDerechosPeticion=urlBase+\"/servicedesk/customer/portal/6?peti=true\";\nvar linkDerechosPeticionBase=urlBase+\"/servicedesk/customer/portal/6/create/98\";\nvar linkConsultar=linkPortal;\nvar linkConsultar2=linkPortal;\nconsole.log(jQuery(\"#header\").html().toString())\n\nvar logo=\"https://www.zurichseguros.com.co/-/media/project/zwp/colombia/images/campaign-risk-engineering-workshop-2019/zurich-logo-big.png?h=96&la=es-CO&w=156&hash=1F3B1C0D25D8C8B3F988B993BBF968E4\";\nvar paginaPPL =urlBase+\"/servicedesk/customer/portal/6\";\nvar URLactual = window.location;\nvar UrlVerificar=\"portal/3\";\nif(URLactual.toString().indexOf(UrlVerificar)>-1){\n URLactual=paginaPPL;\n window.location.href = paginaPPL;\n}\nvar formSiniestro =\"\";\nvar formInfo =\"\";\n\nvar usuario=\"Anonymous\";\nvar contrasena=\"Anonymous\";\nvar BASIC_AUTH=\"Basic QW5vbnltb3VzOkFub255bW91cw==\";\nvar tipoSolicitudNombre=\"\";\nvar tipoSolicitudCode='';\nvar tipoSolicitudNombreInformacion=\"Requerimiento información\";\nvar tipoSolicitudNombrePolizas=\"Requerimiento información\";\nvar tipoSolicitudNombreSugerencias=\"Sugerencias\";\nvar tipoSolicitudSugerencias=\"pqrz/600ea1da-b58f-49d9-b00d-b1e12d1829f1\";\nvar tipoSolicitudPolizas=\"pqrz/6e828641-e610-4cba-8f9b-f96ded3734b5\";\nvar tipoSolicitudNombreOtras=\"Otras solicitudes\";\nvar tipoSolicitudSiniestro=\"zur/daed9a8d-8257-45a6-a5f9-f1cbfd478933\";\nvar tipoSolicitudInformacion=\"pqrz/cbc98d37-7df5-4eac-a8cc-e26fa55decbe\";\nvar tipoSolicitudNombreGestion=\"Requerimiento información\";\nvar tipoSolicitudGestion=\"pqrz/77f9b610-af49-416b-8f04-0fa63c07d0c9\";\nvar tipoSolicitudNombreHabeas=\"Requerimiento información\";\nvar tipoSolicitudHabeas=\"pqrz/3849d1a5-b3ca-4ebf-89c6-811a7020f766\";\nvar tipoSolicitudNombreCertificados=\"Requerimiento información\";\nvar tipoSolicitudCertificados=\"pqrz/717e5e43-983d-4c69-9038-00daa1a157f1\";\nvar tipoSolicitudNombreQueja=\"Queja o Reclamo\";\nvar tipoSolicitudQueja=\"pqrz/efadfe36-4dba-416a-9824-3f16b46ac52f\";\n\nvar tipoSolicitudNombrePeticion=\"Derecho de petición\";\nvar tipoSolicitudPeticion=\"pqrz/1ff447d3-6a44-4099-aee6-7414b07d8c9e\";\nvar tipoSolicitudOtras=\"zur/fccb6266-68c7-49c0-8066-f0d128ecfed3\";\nvar fechaANS;\n//****CARGUE DINAMICO DE CONTENIDOS******//\n//se validadn los links del box de confluense\n//SINIESTROS\nif(URLactual.toString().indexOf(linkSiniestros)>-1 && URLactual.toString()!=linkSiniestros){\nURLactual=linkSiniestros;\nwindow.location.href = linkSiniestros;\n}\n//REQUERIMIENTO DE INFORMACION\nif(URLactual.toString().indexOf(linkInfoGeneralBase)>-1 && URLactual.toString()!=linkInfoGeneralBase){\nURLactual=linkInfoGeneral;\nwindow.location.href = linkInfoGeneral;\n}\n//POLIZAS\nif(URLactual.toString().indexOf(linkDerechosBase)>-1 && URLactual.toString()!=linkDerechosBase){\nURLactual=linkDerechos;\nwindow.location.href = linkDerechos;\n}\n//SUGERENCIAS\nif(URLactual.toString().indexOf(linkSugerenciasBase)>-1 && URLactual.toString()!=linkSugerenciasBase){\nURLactual=linkSugerencias;\nwindow.location.href = linkSugerencias;\n}\n//GESTION\nif(URLactual.toString().indexOf(linkGestionBase)>-1 && URLactual.toString()!=linkGestionBase){\nURLactual=linkGestion;\nwindow.location.href = linkGestion;\n}\n//HABEAS\nif(URLactual.toString().indexOf(linkHabeasBase)>-1 && URLactual.toString()!=linkHabeasBase){\nURLactual=linkHabeas;\nwindow.location.href = linkHabeas;\n}\n//CERTIFICADOS\nif(URLactual.toString().indexOf(linkCertificadosBase)>-1 && URLactual.toString()!=linkCertificadosBase){\nURLactual=linkCertificados;\nwindow.location.href = linkCertificados;\n}\n//QUEJA\nif(URLactual.toString().indexOf(linkQuejaBase)>-1 && URLactual.toString()!=linkQuejaBase){\nURLactual=linkQueja;\nwindow.location.href = linkQueja;\n}\n//DERECHO\nif(URLactual.toString().indexOf(linkDerechosPeticionBase)>-1 && URLactual.toString()!=linkDerechosPeticionBase){\nURLactual=linkDerechosPeticion;\nwindow.location.href = linkDerechosPeticion;\n}\n\nif(URLactual==linkSiniestros)\n{\ntraerTiposSinistros();\n}\nif(URLactual==linkInfoGeneral)\n{\nvar iteracionAPI=3;\ntipoSolicitudNombre=tipoSolicitudNombreInformacion;\ntipoSolicitudCode=tipoSolicitudInformacion;\ntraerInfoGeneral();\n}\n//Esto es para productos y polizas\nif(URLactual==linkDerechos)\n{\niteracionAPI=3;\nselectedTema=\"18839\";\ntipoSolicitudNombre=tipoSolicitudNombrePolizas;\ntipoSolicitudCode=tipoSolicitudPolizas;\ntraerDerechos();\n}\nif(URLactual==linkSugerencias)\n{\niteracionAPI=3;\ntipoSolicitudNombre=tipoSolicitudNombreSugerencias;\ntipoSolicitudCode=tipoSolicitudSugerencias;\ntraerSugerencias();\n}\nif(URLactual==linkQueja)\n{\n//iteracionAPI=3;\niteracionAPI=3;\ntipoSolicitudNombre=tipoSolicitudNombreQueja;\ntipoSolicitudCode=tipoSolicitudQueja;\ntraerQuejas();\n}\nif(URLactual==linkGestion)\n{\niteracionAPI=1;\nselectedTema=\"18836\";\ntipoSolicitudNombre=tipoSolicitudNombreGestion;\ntipoSolicitudCode=tipoSolicitudGestion;\ntraerGestion();\n}\nif(URLactual==linkHabeas)\n{\niteracionAPI=3;\nselectedTema=\"18837\";\ntipoSolicitudNombre=tipoSolicitudNombreHabeas;\ntipoSolicitudCode=tipoSolicitudHabeas;\ntraerHabeas();\n}\nif(URLactual==linkCertificados)\n{\niteracionAPI=1;\ntipoSolicitudNombre=tipoSolicitudNombreCertificados;\ntipoSolicitudCode=tipoSolicitudCertificados;\ntraerCertificados();\n}\nif(URLactual==linkDerechosPeticion)\n{\niteracionAPI=3;\ntipoSolicitudNombre=tipoSolicitudNombrePeticion;\ntipoSolicitudCode=tipoSolicitudPeticion;\ntraerPeticiones();\n}\n\n/*Parametros campos*/\nvar campoTipoSolicitud=\"customfield_14901\";\nvar campoEmail=\"customfield_15156\";\nvar campoNombre=\"customfield_11319\";\nvar campoTelefono=\"customfield_11323\";\nvar campoIdentificacion=\"customfield_11318\";\nvar campoCategoriaSiniestro=\"customfield_10204\";\nvar campoComo=\"customfield_10200\";\nvar campoTipoID=\"customfield_15615\";\n//var campoTipoProducto=\"customfield_15641\";\n//var campoTipoProductoRel=\"customfield_15641\";\nvar campoTipoProducto=\"customfield_17900\";\nvar campoTipoProductoRel=\"customfield_17900\";\n//var campoTema=\"customfield_11352\";\nvar campoTema=\"customfield_17901\";\n//var campoCertificado=\"customfield_15705\";\nvar campoCertificado=\"customfield_17800\";\nvar campoDepartamento=\"customfield_15149\";\nvar campoPoliza=\"customfield_11330\";\nvar campoFechaMax=\"customfield_11335\";\nvar opcionesCampoCategoriaSiniestro=\"<option value='-1' Selected>Ninguno</option>\";\n//var opcionesCampoTipoProducto=\"\";\nvar opcionesCampoTipoID=\"<div class='custom-control custom-radio custom-control-inline'><input type='radio' style='display:none' value='-1' id='customRadioInline0' checked name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline0'>Ninguno</label></div>\";\nvar opcionesCampoTipoProducto=\"<option value='-1' Selected>¿Se trata de un producto específico? (Opcional)</option>\";\nvar opcionesCampoTema=\"<option value='-1' selected disabled>¿Qué quieres solicitar?</option>\";\nvar opcionesCampoTemaSub=\"<option value='-1' selected disabled>¿Qué quieres solicitar?</option>\";\nvar opcionesCampoCertificado=\"<option value='-1' selected disabled>El certificado que necesitas está relacionado a:</option>\";\nvar opcionesCampoMunicipio=\"<option value='-1' selected disabled>¿Departamento?</option>\";\nvar opcionesCampoCiudad=\"<option value='-1' selected disabled>¿De qué ciudad nos contactas?</option>\";\nvar valorComo1=\"10100\";\nvar valorComo2=\"10101\";\nvar valorComo3=\"10102\";\nvar valorComo4=\"10103\";\nvar valorComo5=\"10104\";\n\nconsole.log( \"ready!\" );\n//*************************************************//\n// //\n//----CARGA DE CAMPOS Y FORMULARIO SINIESTROS----//\n// //\n//************************************************//\n\n//*************************************************//\n// //\n//----CARGA DE CAMPOS Y FORMULARIO SINIESTROS----//\n// //\n//************************************************//\nfunction traerTiposSinistros (){\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(8);\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de siniestro\nif(campoCategoriaSiniestro==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoCategoriaSiniestro=opcionesCampoCategoriaSiniestro+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline'><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\njQuery('.aui-page-panel-content').empty();\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='h5 text-center '><br>Sabemos que este no es el mejor de los momentos y estamos de tu lado para facilitarte las cosas en este proceso<br><br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row text-center'><div class='col-md-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-2'><div class='custom-control custom-radio image-checkbox'><input type='radio' class='custom-control-input' id='ck2a' name='ck2' value='\"+valorComo1+\"'>\";\nformSiniestro=formSiniestro+\"<label class='custom-control-label' for='ck2a'><img src='\"+urlBase+\"/images/Group1.png' width='50px' height='auto' alt='#' class='img-fluid img-circle'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>Nada bien, me siento muy afectad@ por mi situación</p></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-2'><div class='custom-control custom-radio image-checkbox'><input type='radio' class='custom-control-input' id='ck2b' name='ck2' value='\"+valorComo2+\"'><label class='custom-control-label' for='ck2b'>\";\nformSiniestro=formSiniestro+\"<img src='\"+urlBase+\"/images/Group2.png' width='50px' height='auto' alt='#' class='img-fluid'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>Me siento muy contrariad@ y muy nervios@</p></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-2'><div class='custom-control custom-radio image-checkbox'><input type='radio' class='custom-control-input' id='ck2c' name='ck2' value='\"+valorComo3+\"' >\";\nformSiniestro=formSiniestro+\"<label class='custom-control-label' for='ck2c'><img src='\"+urlBase+\"/images/Group3.png' alt='#' width='50px' height='auto' class='img-fluid'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>creo que lo peor ya paso, estoy a la espectativa de lo que sigue</p></div>\";\nformSiniestro=formSiniestro+\"</div><div class='col-md-2'><div class='custom-control custom-radio image-checkbox'><input type='radio' class='custom-control-input' id='ck2d' name='ck2' value='\"+valorComo4+\"'>\";\nformSiniestro=formSiniestro+\"<label class='custom-control-label' for='ck2d'>\";\nformSiniestro=formSiniestro+\"<img src='\"+urlBase+\"/images/Group4.png' alt='#' width='50px' height='auto' class='img-fluid'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>Estoy tranquil@ se que todo va a mejorar</p></div></div><div class='col-md-2'>\";\nformSiniestro=formSiniestro+\"<div class='custom-control custom-radio image-checkbox'>\";\nformSiniestro=formSiniestro+\"<input type='radio' class='custom-control-input' id='ck2e' name='ck2' value='\"+valorComo5+\"' checked>\";\nformSiniestro=formSiniestro+\"<label class='custom-control-label' for='ck2e'>\";\nformSiniestro=formSiniestro+\"<img src='\"+urlBase+\"/images/Group5.png' alt='#' width='50px' height='auto' class='img-fluid'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>Estoy muy bien me siento muy respaldado y seguro</p></div></div><div class='col-md-1'></div>\";\nformSiniestro=formSiniestro+\"</div><br><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='h3 '>Cuentanos un poco sobre ti</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class=' '>\";\nformSiniestro=formSiniestro+\"<label class='sr-only' for='inlineFormInputGroup'>Username</label><div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text'>#</div></div>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control ' id='telefonoUser' placeholder='A veces es mas práctico hablar por teléfono, ¿Cómo es tu numero?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-primary'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre que sucedió<br></p><br></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='siniestro' aria-label='Summary'>\"; \nformSiniestro=formSiniestro+opcionesCampoCategoriaSiniestro;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+\"<div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos un poco sobre el incidente' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearSiniestro' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\"\nformSiniestro=formSiniestro+\"</div></div></div></div><div id='xxx'><div class='spinner-border text-secondary' role='status'><span class='sr-only'>Enviando...</span></div></div>\";\n\n//Fin generacion del HTML\n//Se antepone el contenido\njQuery('.aui-page-panel-content').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\n\njQuery(\"#CrearSiniestro\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar radioComo = jQuery(\"input[name='ck2']:checked\").val();\nvar telefono =jQuery('#telefonoUser').val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoSiniestro=jQuery('#siniestro').val();\n// TO DO\n//Se debe validar el tipo de siniestro para enviar o no siertos datos\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudSiniestro+'\",\"'+campoCategoriaSiniestro+'\":{\"id\":\"'+valorTipoSiniestro+'\"},\"'+campoEmail+'\":\"'+email+'\",\"'+campoTelefono+'\":'+telefono+',\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoComo+'\":{\"id\":\"'+radioComo+'\"},\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"'+resumen+'\",\"description\": \"Creating\",\"issuetype\": {\"name\": \"Reclamo / Siniestro\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'>SOLICITUD CREADA \"+issueKey+\"</div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='h2'>Señor user_name, su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='badge badge-dark'> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n}\n});\n}\n});\n}\n});\n\n}//Hasta aqui permite salvar el código\n\n\n/*****************************\n\nINICIO INFORMACION GENERAL\n\n****************************/\nfunction traerInfoGeneral (){\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(8);\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\nif(campoTipoProducto==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoTipoProducto=opcionesCampoTipoProducto+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\n\n//FULL INFO\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\nformSiniestro=formSiniestro+\"<div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-transparent border-0'><div class='card-body cardPP'><div class='row'><div class='col-sm'>\";\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='textoBlanco texto24 text-center '><br>Si no encontraste lo que buscabas en nuestra base de información o simplemente prefieres escribirnos sigue los siguentes pasos<br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\n\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='textoBlancoLight texto32 '>Cuéntanos un poco sobre ti</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre lo que buscas</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='producto' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTipoProducto;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos sobre lo que necesitas o quieres saber' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\normSiniestro=formSiniestro+\"<div class='row d-none'><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='input-group mb-3'> <div class='custom-file'><input type='file' class='custom-file-input' id='adjuntoOld' aria-describedby='inputGroupFileAddon03'><label class='custom-file-label' for='inputGroupFile03'>Choose file</label> </div></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='container2'><div class='row'><div class='col-sm-1'></div><div class='col-md-10'><div class='form-group'><label class='control-label'></label>\";\nformSiniestro=formSiniestro+\"<div class='preview-zone hidden'><div class='box box-solid'><div class='box-header with-border'><div><b>Archivo</b></div>\";\nformSiniestro=formSiniestro+\"<div class='box-tools pull-right'><button type='button' class='btn btn-primary btn-xs remove-preview'><i class='fa fa-times'></i> Vaciar campo</button></div></div>\";\nformSiniestro=formSiniestro+\"<div class='box-body'></div></div></div><div class='dropzone-wrapper'><div class='dropzone-desc'>\";\nformSiniestro=formSiniestro+\"<p>¿Quieres añadir algún documento?<br>Arrastra y suelta los documentos aquí</p><img src='\"+urlAttach+\"' width='50px' height='auto' alt='#' class='img-fluid img-circle'>Busca los archivos en tu computador</div><input type='file' name='img_logo' class='dropzone' id='adjunto' multiple></div></div></div></div><div class='col-sm-1'></div></div><div id='zzz' style='display:none ;color:red !important'><p id='fallaAjax'>fallo</p></div><div id='yyy' style='display:none'><p class='textoAzulLight texto13'>Enviando</p><div class='spinner-grow text-success' role='status'><span class='sr-only'>Enviando...</span></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearSiniestro' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div>\";\n//Fin generacion del HTML\n//Se antepone el contenido\n//jQuery('.aui-page-panel-content').prepend(formSiniestro);\njQuery('#formInfo').empty();\njQuery('#formInfo').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\nfunction readFile(input)\n{\n\n if (input.files && input.files[0]) {\nvar reader = new FileReader();\n\nreader.onload = function(e) {\nvar htmlPreview ='';\nvar contAtt2;\nfor (contAtt2=0;contAtt2<jQuery(\"#adjunto\")[0].files.length;contAtt2++){\n htmlPreview =htmlPreview+\n'<img src=\"'+urlDoc+'\" width=\"50px\" height=\"auto\" alt=\"#\" class=\"img-fluid img-circle\">' +\n'<p>' + input.files[contAtt2].name + '</p>';\n}\n\n\n var wrapperZone = jQuery(input).parent();\n var previewZone = jQuery(input).parent().parent().find('.preview-zone');\n var boxZone = jQuery(input).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n boxZone.append(htmlPreview);\n};\n\nreader.readAsDataURL(input.files[0]);\n }\n \n}\n\nfunction reset(e) {\n e.wrap('<form>').closest('form').get(0).reset();\n e.unwrap();\n}\n\njQuery(\".dropzone\").change(function() {\nvar sizeAtt=0;\nvar contAtt3;\nfor (contAtt3=0;contAtt3<jQuery(this)[0].files.length;contAtt3++){\nsizeAtt=sizeAtt+jQuery(this)[0].files[contAtt3].size;\nconsole.log(sizeAtt);\n}\n\n\nif(sizeAtt > 25000000){\nalert(\"wuama\");\n var wrapperZone = jQuery(this).parent();\n var previewZone = jQuery(this).parent().parent().find('.preview-zone');\n var boxZone = jQuery(this).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n;\n boxZone.append(\"<p style='color:red; font-size:24px'>El peso máximo es de 25Mb</p>\");\n this.value = \"\";\n }\n else{\n readFile(this);\n }\n});\n\njQuery('.dropzone-wrapper').on('dragover', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).addClass('dragover');\n});\n\njQuery('.dropzone-wrapper').on('dragleave', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).removeClass('dragover');\n});\n\njQuery('.remove-preview').on('click', function() {\n var boxZone = jQuery(this).parents('.preview-zone').find('.box-body');\n var previewZone = jQuery(this).parents('.preview-zone');\n var dropzone = jQuery(this).parents('.form-group').find('.dropzone');\n boxZone.empty();\n previewZone.addClass('hidden');\n reset(dropzone);\n});\njQuery(\"#CrearSiniestro\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\n//alert(jQuery(\"#adjunto\").val());\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\njQuery(\"#yyy\").show();\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoProducto=jQuery('#producto').val();\nvar valorTipoProductoLabel = jQuery('#producto option:selected').text();\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudCode+'\",\"'+campoTipoProducto+'\":{\"id\":\"'+valorTipoProducto+'\"},\"'+campoEmail+'\":\"'+email+'\",\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"Información general para '+valorTipoProductoLabel+'\",\"description\": \"'+resumen+'\",\"issuetype\": {\"name\": \"'+tipoSolicitudNombre+'\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n },\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\nvar formdata = new FormData();\nformdata.append('task',\"C:\\\\bot\\\\salida.csv\");\nvar data = new FormData();\n/*jQuery.each(jQuery('#adjunto')[0].files, function(i, file) {\ndata.append('file-'+i, file);\nconsole.log('f'+file)\n});*/\n\n/*esto sirve\nif(jQuery(\"#adjunto\")[0].files.length>0){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[0]);\n}\n FIN esto sirve*/\nvar contAtt;\nfor (contAtt=0;contAtt<jQuery(\"#adjunto\")[0].files.length;contAtt++){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[contAtt]);\n}\n\njQuery.support.cors = true;\nvar datastring = new FormData(jQuery(\"#ppform\")[0]);\nif( document.getElementById(\"adjunto\").files.length == 0 ){\n //alert(\"no files selected\");\n}\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\"+value+\"/attachments\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\n//dataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ndata: data,\ncontentType: false,\nprocessData: false,\ncache: false,\nheaders: {\n\"X-Atlassian-Token\": \"nocheck\"\n},\n//contentType: \"multipart/form-data\",\nsuccess: function (result){\nconsole.log(\"result\"+result);\n}\n});\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div style='float:right;width:80%'><div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'><p class='texto32 textoBlancoBold'>SOLICITUD CREADA</p></div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='textoBlancoLight texto32'>Señor(a) \"+nombre+\", su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='card-text textoBlanco texto19 '> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div></div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n},\nerror: function(xhr,status,data){jQuery(\"#yyy\").hide();\njQuery(\"#zzz\").show();\njQuery(\"#zzz\").html(\"Lo sentimos, no fue posible guardar la solicitud<br>\"+xhr.responseText);\n}\n});\n}\n});\n}\n});\n\n}\n/*****************************\n\nINICIO Derechos\n\n****************************/\nfunction traerPeticiones (){\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(10);\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\nif(campoTipoProducto==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoTipoProducto=opcionesCampoTipoProducto+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\n\n//FULL INFO\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\nformSiniestro=formSiniestro+\"<div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-transparent border-0'><div class='card-body cardPP'><div class='row'><div class='col-sm'>\";\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='textoBlanco texto24 text-center '><br>Si no encontraste lo que buscabas en nuestra base de información o simplemente prefieres escribirnos sigue los siguentes pasos<br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\n\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='textoBlancoLight texto32 '>Cuéntanos un poco sobre ti</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre lo que buscas</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='producto' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTipoProducto;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'><input type='text' class='form-control rounded' id='poliza' placeholder='Número de Póliza (Con éste nuestro tiempo de respuesta disminuye en 30%)'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos sobre lo que necesitas o quieres saber' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\normSiniestro=formSiniestro+\"<div class='row d-none'><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='input-group mb-3'> <div class='custom-file'><input type='file' class='custom-file-input' id='adjuntoOld' aria-describedby='inputGroupFileAddon03'><label class='custom-file-label' for='inputGroupFile03'>Choose file</label> </div></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='container2'><div class='row'><div class='col-sm-1'></div><div class='col-md-10'><div class='form-group'><label class='control-label'></label>\";\nformSiniestro=formSiniestro+\"<div class='preview-zone hidden'><div class='box box-solid'><div class='box-header with-border'><div><b>Archivo</b></div>\";\nformSiniestro=formSiniestro+\"<div class='box-tools pull-right'><button type='button' class='btn btn-primary btn-xs remove-preview'><i class='fa fa-times'></i> Vaciar campo</button></div></div>\";\nformSiniestro=formSiniestro+\"<div class='box-body'></div></div></div><div class='dropzone-wrapper'><div class='dropzone-desc'>\";\nformSiniestro=formSiniestro+\"<p>¿Quieres añadir algún documento?<br>Arrastra y suelta los documentos aquí</p><img src='\"+urlAttach+\"' width='50px' height='auto' alt='#' class='img-fluid img-circle'>Busca los archivos en tu computador</div><input type='file' name='img_logo' class='dropzone' id='adjunto' multiple></div></div></div></div><div class='col-sm-1'></div></div><div id='zzz' style='display:none ;color:red !important'><p id='fallaAjax'>fallo</p></div><div id='yyy' style='display:none'><p class='textoAzulLight texto13'>Enviando</p><div class='spinner-grow text-success' role='status'><span class='sr-only'>Enviando...</span></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearSiniestro' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div><div id='xxx'></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div></div></div>\";\n//Fin generacion del HTML\n//Se antepone el contenido\n//jQuery('.aui-page-panel-content').prepend(formSiniestro);\njQuery('#formInfo').empty();\njQuery('#formInfo').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\nfunction readFile(input)\n{\n\n if (input.files && input.files[0]) {\nvar reader = new FileReader();\n\nreader.onload = function(e) {\nvar htmlPreview ='';\nvar contAtt2;\nfor (contAtt2=0;contAtt2<jQuery(\"#adjunto\")[0].files.length;contAtt2++){\n htmlPreview =htmlPreview+\n'<img src=\"'+urlDoc+'\" width=\"50px\" height=\"auto\" alt=\"#\" class=\"img-fluid img-circle\">' +\n'<p>' + input.files[contAtt2].name + '</p>';\n}\n\n\n var wrapperZone = jQuery(input).parent();\n var previewZone = jQuery(input).parent().parent().find('.preview-zone');\n var boxZone = jQuery(input).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n boxZone.append(htmlPreview);\n};\n\nreader.readAsDataURL(input.files[0]);\n }\n \n}\n\nfunction reset(e) {\n e.wrap('<form>').closest('form').get(0).reset();\n e.unwrap();\n}\n\njQuery(\".dropzone\").change(function() {\nvar sizeAtt=0;\nvar contAtt3;\nfor (contAtt3=0;contAtt3<jQuery(this)[0].files.length;contAtt3++){\nsizeAtt=sizeAtt+jQuery(this)[0].files[contAtt3].size;\nconsole.log(sizeAtt);\n}\n\n\nif(sizeAtt > 25000000){\nalert(\"wuama\");\n var wrapperZone = jQuery(this).parent();\n var previewZone = jQuery(this).parent().parent().find('.preview-zone');\n var boxZone = jQuery(this).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n;\n boxZone.append(\"<p style='color:red; font-size:24px'>El peso máximo es de 25Mb</p>\");\n this.value = \"\";\n }\n else{\n readFile(this);\n }\n});\n\njQuery('.dropzone-wrapper').on('dragover', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).addClass('dragover');\n});\n\njQuery('.dropzone-wrapper').on('dragleave', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).removeClass('dragover');\n});\n\njQuery('.remove-preview').on('click', function() {\n var boxZone = jQuery(this).parents('.preview-zone').find('.box-body');\n var previewZone = jQuery(this).parents('.preview-zone');\n var dropzone = jQuery(this).parents('.form-group').find('.dropzone');\n boxZone.empty();\n previewZone.addClass('hidden');\n reset(dropzone);\n});\njQuery(\"#CrearSiniestro\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\n//alert(jQuery(\"#adjunto\").val());\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\njQuery(\"#yyy\").show();\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoProducto=jQuery('#producto').val();\nvar valorTipoProductoLabel = jQuery('#producto option:selected').text();\nvar valorPoliza=jQuery('#poliza').val();\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudCode+'\",\"'+campoTipoProducto+'\":{\"id\":\"'+valorTipoProducto+'\"},\"'+campoEmail+'\":\"'+email+'\",\"'+campoPoliza+'\":\"'+valorPoliza+'\",\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"Derecho de petición para '+valorTipoProductoLabel+'\",\"description\": \"'+resumen+'\",\"issuetype\": {\"name\": \"'+tipoSolicitudNombre+'\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n },\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\nvar formdata = new FormData();\nformdata.append('task',\"C:\\\\bot\\\\salida.csv\");\nvar data = new FormData();\n/*jQuery.each(jQuery('#adjunto')[0].files, function(i, file) {\ndata.append('file-'+i, file);\nconsole.log('f'+file)\n});*/\n\n/*esto sirve\nif(jQuery(\"#adjunto\")[0].files.length>0){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[0]);\n}\n FIN esto sirve*/\nvar contAtt;\nfor (contAtt=0;contAtt<jQuery(\"#adjunto\")[0].files.length;contAtt++){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[contAtt]);\n}\n\njQuery.support.cors = true;\nvar datastring = new FormData(jQuery(\"#ppform\")[0]);\nif( document.getElementById(\"adjunto\").files.length == 0 ){\n //alert(\"no files selected\");\n}\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\"+value+\"/attachments\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\n//dataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ndata: data,\ncontentType: false,\nprocessData: false,\ncache: false,\nheaders: {\n\"X-Atlassian-Token\": \"nocheck\"\n},\n//contentType: \"multipart/form-data\",\nsuccess: function (result){\nconsole.log(\"result\"+result);\n}\n});\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div style='float:right;width:80%'><div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'><p class='texto32 textoBlancoBold'>SOLICITUD CREADA</p></div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='textoBlancoLight texto32'>Señor(a) \"+nombre+\", su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='card-text textoBlanco texto19 '> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div></div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n},\nerror: function(xhr,status,data){jQuery(\"#yyy\").hide();\njQuery(\"#zzz\").show();\njQuery(\"#zzz\").html(\"Lo sentimos, no fue posible guardar la solicitud<br>\"+xhr.responseText);\n}\n});\n}\n});\n}\n});\n\n}\n/************************************\n\nPRODUCTOS Y POLIZAS\n\n\n************************************/\nfunction traerDerechos (){\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(8);\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\nif(campoTipoProducto==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\n\n\nopcionesCampoTipoProducto=opcionesCampoTipoProducto+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n\n});\n\n}\n});\n}\n//Se llena el campo de tema de producto\nif(campoTema==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\n\n\nif(selectedTema==value8.id){\nopcionesCampoTema=opcionesCampoTema+\"<option selected value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\njQuery.each(value8.children, function(key9, value9){\nopcionesCampoTemaSub=opcionesCampoTemaSub+\"<option value='\"+value9.id+\"'>\"+value9.value+\"</option>\";\nconsole.log(value9.id+\"id-val\"+value9.value);\n \n});\n\n}\nelse{\nopcionesCampoTema=opcionesCampoTema+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n}\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\n\n\n//Se carga dinamicamente el subtema\n\n\n\n//FULL TEMA\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\nformSiniestro=formSiniestro+\"<div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-transparent border-0'><div class='card-body cardPP'><div class='row'><div class='col-sm'>\";\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='textoBlanco texto24 text-center '><br>Si no encontraste lo que buscabas en nuestra base de información o simplemente prefieres escribirnos sigue los siguentes pasos<br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\n\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='textoBlancoLight texto32 '>Cuéntanos un poco sobre ti</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre lo que buscas</p><br></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='producto' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTipoProducto;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='tema' style='display:none' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTema;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='temaHijo' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTemaSub;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos algunos detalles sobre tu solicitud, esto nos puede ayudar a responderte más pronto.' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row d-none'><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='input-group mb-3'> <div class='custom-file'><input type='file' class='custom-file-input' id='adjuntoOld' aria-describedby='inputGroupFileAddon03'><label class='custom-file-label' for='inputGroupFile03'>Choose file</label> </div></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='container2'><div class='row'><div class='col-sm-1'></div><div class='col-md-10'><div class='form-group'><label class='control-label'></label>\";\nformSiniestro=formSiniestro+\"<div class='preview-zone hidden'><div class='box box-solid'><div class='box-header with-border'><div><b>Archivo</b></div>\";\nformSiniestro=formSiniestro+\"<div class='box-tools pull-right'><button type='button' class='btn btn-primary btn-xs remove-preview'><i class='fa fa-times'></i> Vaciar campo</button></div></div>\";\nformSiniestro=formSiniestro+\"<div class='box-body'></div></div></div><div class='dropzone-wrapper'><div class='dropzone-desc'><p>¿Quieres agregar un documento?<br>Arrastra y suelta los documentos aquí</p><img src='\"+urlAttach+\"' width='50px' height='auto' alt='#' class='img-fluid img-circle'>Busca los archivos en tu computador\";\nformSiniestro=formSiniestro+\"</div><input type='file' name='img_logo' class='dropzone' id='adjunto' multiple></div></div></div></div><div class='col-sm-1'></div></div><div id='zzz' style='display:none ;color:red !important'><p id='fallaAjax'>fallo</p></div><div id='yyy' style='display:none'><p class='textoAzulLight texto13'>Enviando</p><div class='spinner-grow text-success' role='status'><span class='sr-only'>Enviando...</span></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearPoliza' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div><div id='xxx'></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div></div></div>\";\n//Fin generacion del HTML\n//Se antepone el contenido\n//jQuery('.aui-page-panel-content').prepend(formSiniestro);\njQuery('#formInfo').empty();\njQuery('#formInfo').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\nfunction readFile(input)\n{\n\n if (input.files && input.files[0]) {\nvar reader = new FileReader();\n\nreader.onload = function(e) {\nvar htmlPreview ='';\nvar contAtt2;\nfor (contAtt2=0;contAtt2<jQuery(\"#adjunto\")[0].files.length;contAtt2++){\n htmlPreview =htmlPreview+\n'<img src=\"'+urlDoc+'\" width=\"50px\" height=\"auto\" alt=\"#\" class=\"img-fluid img-circle\">' +\n'<p>' + input.files[contAtt2].name + '</p>';\n}\n\n\n var wrapperZone = jQuery(input).parent();\n var previewZone = jQuery(input).parent().parent().find('.preview-zone');\n var boxZone = jQuery(input).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n boxZone.append(htmlPreview);\n};\n\nreader.readAsDataURL(input.files[0]);\n }\n \n}\n\nfunction reset(e) {\n e.wrap('<form>').closest('form').get(0).reset();\n e.unwrap();\n}\n\njQuery(\".dropzone\").change(function() {\nvar sizeAtt=0;\nvar contAtt3;\nfor (contAtt3=0;contAtt3<jQuery(this)[0].files.length;contAtt3++){\nsizeAtt=sizeAtt+jQuery(this)[0].files[contAtt3].size;\nconsole.log(sizeAtt);\n}\n\n\nif(sizeAtt > 25000000){\nalert(\"wuama\");\n var wrapperZone = jQuery(this).parent();\n var previewZone = jQuery(this).parent().parent().find('.preview-zone');\n var boxZone = jQuery(this).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n;\n boxZone.append(\"<p style='color:red; font-size:24px'>El peso máximo es de 25Mb</p>\");\n this.value = \"\";\n }\n else{\n readFile(this);\n }\n});\n\njQuery('.dropzone-wrapper').on('dragover', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).addClass('dragover');\n});\n\njQuery('.dropzone-wrapper').on('dragleave', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).removeClass('dragover');\n});\n\njQuery('.remove-preview').on('click', function() {\n var boxZone = jQuery(this).parents('.preview-zone').find('.box-body');\n var previewZone = jQuery(this).parents('.preview-zone');\n var dropzone = jQuery(this).parents('.form-group').find('.dropzone');\n boxZone.empty();\n previewZone.addClass('hidden');\n reset(dropzone);\n});\njQuery(document).on('change','#tema',function () {\n var idTema = jQuery(this).val();\n\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\n\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\n\n//Se llena el campo de tema de producto\nif(campoTema==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"id-val\"+value8.value);\nif(idTema==value8.id){\nvar opcionesCampoTema2=\"<option value='-1' selected disabled>(Opcional)</option>\";\njQuery.each(value8.children, function(key9, value9){\nopcionesCampoTema2=opcionesCampoTema2+\"<option value='\"+value9.id+\"'>\"+value9.value+\"</option>\";\nconsole.log(value9.id+\"id-val\"+value9.value);\n jQuery(\"#temaHijo\").html(opcionesCampoTema2);\n});\n}\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n},\nerror: function(xhr,status,data){jQuery(\"#yyy\").hide();\njQuery(\"#zzz\").show();\njQuery(\"#zzz\").html(\"Lo sentimos, no fue posible guardar la solicitud<br>\"+xhr.responseText);\n}\n});\n});\n\njQuery(\"#CrearPoliza\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\n//alert(jQuery(\"#adjunto\").val());\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\njQuery(\"#yyy\").show();\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoProducto=jQuery('#producto').val();\nvar valorTema=jQuery('#tema').val();\nvar valorTemaHijo=jQuery('#temaHijo').val();\nvar valorTipoProductoLabel = jQuery('#temaHijo option:selected').text();\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudCode+'\",\"'+campoTema+'\":{\"id\":\"'+valorTema+'\",\"child\":{\"id\":\"'+valorTemaHijo+'\"}},\"'+campoTipoProducto+'\":{\"id\":\"'+valorTipoProducto+'\"},\"'+campoEmail+'\":\"'+email+'\",\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"Productos y pólizas para '+valorTipoProductoLabel+'\",\"description\": \"'+resumen+'\",\"issuetype\": {\"name\": \"'+tipoSolicitudNombre+'\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n },\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\nvar formdata = new FormData();\nformdata.append('task',\"C:\\\\bot\\\\salida.csv\");\nvar data = new FormData();\n/*jQuery.each(jQuery('#adjunto')[0].files, function(i, file) {\ndata.append('file-'+i, file);\nconsole.log('f'+file)\n});*/\n\n/*esto sirve\nif(jQuery(\"#adjunto\")[0].files.length>0){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[0]);\n}\n FIN esto sirve*/\nvar contAtt;\nfor (contAtt=0;contAtt<jQuery(\"#adjunto\")[0].files.length;contAtt++){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[contAtt]);\n}\n\njQuery.support.cors = true;\nvar datastring = new FormData(jQuery(\"#ppform\")[0]);\nif( document.getElementById(\"adjunto\").files.length == 0 ){\n //alert(\"no files selected\");\n}\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\"+value+\"/attachments\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\n//dataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ndata: data,\ncontentType: false,\nprocessData: false,\ncache: false,\nheaders: {\n\"X-Atlassian-Token\": \"nocheck\"\n},\n//contentType: \"multipart/form-data\",\nsuccess: function (result){\nconsole.log(\"result\"+result);\n}\n});\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div style='float:right;width:80%'><div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'><p class='texto32 textoBlancoBold'>SOLICITUD CREADA</p></div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='textoBlancoLight texto32'>Señor(a) \"+nombre+\", su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='card-text textoBlanco texto19 '> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div></div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n},\nerror: function(xhr,status,data){jQuery(\"#yyy\").hide();\njQuery(\"#zzz\").show();\njQuery(\"#zzz\").html(\"Lo sentimos, no fue posible guardar la solicitud<br>\"+xhr.responseText);\n}\n});\n}\n});\n}\n});\n\n}\n/*****************************\n\nINICIO QUEJA\n\n****************************/\nfunction traerQuejas (){\n\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(8);\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\nif(campoTipoProductoRel==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoTipoProducto=opcionesCampoTipoProducto+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n});\n\n}\n});\n}\nif(campoDepartamento==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoMunicipio=opcionesCampoMunicipio+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\n\n//FULL INFO\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\nformSiniestro=formSiniestro+\"<div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-transparent border-0'><div class='card-body cardPP'><div class='row'><div class='col-sm'>\";\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='textoBlanco texto24 text-center '><br>Si no encontraste lo que buscabas en nuestra base de información o simplemente prefieres escribirnos sigue los siguentes pasos<br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\n\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='textoBlancoLight texto32 '></p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>#</div></div>\";\nformSiniestro=formSiniestro+\"<input type='text' required class='form-control rounded-right' id='telefonoUser' placeholder='¿Cuál es tu número telefónico? (Te contactaremos solo en caso de ser necesario)'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-row'>\";\nformSiniestro=formSiniestro+\"<div class='col'><select class='custom-select rounded' id='municipio' aria-label='Summary' placeholder='rererer'>\";\nformSiniestro=formSiniestro+opcionesCampoMunicipio;\nformSiniestro=formSiniestro+\"</select></div>\";\nformSiniestro=formSiniestro+\"<div class='col'><select class='custom-select rounded' id='ciudad' aria-label='Summary' placeholder='rererer'>\";\nformSiniestro=formSiniestro+opcionesCampoCiudad;\nformSiniestro=formSiniestro+\"</select></div>\";\nformSiniestro=formSiniestro+\"</div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre lo que sucedió</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='producto' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTipoProducto;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'><input type='text' class='form-control rounded' id='poliza' placeholder='Número de Póliza (Con éste nuestro tiempo de respuesta disminuye en 30%)'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos sobre lo que necesitas o quieres saber' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\normSiniestro=formSiniestro+\"<div class='row d-none'><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='input-group mb-3'> <div class='custom-file'><input type='file' class='custom-file-input' id='adjuntoOld' aria-describedby='inputGroupFileAddon03'><label class='custom-file-label' for='inputGroupFile03'>Choose file</label> </div></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='container2'><div class='row'><div class='col-sm-1'></div><div class='col-md-10'><div class='form-group'><label class='control-label'></label>\";\nformSiniestro=formSiniestro+\"<div class='preview-zone hidden'><div class='box box-solid'><div class='box-header with-border'><div><b>Archivo</b></div>\";\nformSiniestro=formSiniestro+\"<div class='box-tools pull-right'><button type='button' class='btn btn-primary btn-xs remove-preview'><i class='fa fa-times'></i> Vaciar campo</button></div></div>\";\nformSiniestro=formSiniestro+\"<div class='box-body'></div></div></div><div class='dropzone-wrapper'><div class='dropzone-desc'>\";\nformSiniestro=formSiniestro+\"<p>¿Quieres añadir algún documento?<br>Arrastra y suelta los documentos aquí</p><img src='\"+urlAttach+\"' width='50px' height='auto' alt='#' class='img-fluid img-circle'>Busca los archivos en tu computador</div><input type='file' name='img_logo' class='dropzone' id='adjunto' multiple></div></div></div></div><div class='col-sm-1'></div></div><div id='zzz' style='display:none ;color:red !important'><p id='fallaAjax'>fallo</p></div><div id='yyy' style='display:none'><p class='textoAzulLight texto13'>Enviando</p><div class='spinner-grow text-success' role='status'><span class='sr-only'>Enviando...</span></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearSiniestro' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div><div id='xxx'></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div></div></div>\";\n//Fin generacion del HTML\n//Se antepone el contenido\n//jQuery('.aui-page-panel-content').prepend(formSiniestro);\njQuery('#formInfo').empty();\njQuery('#formInfo').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\nfunction readFile(input)\n{\n\n if (input.files && input.files[0]) {\nvar reader = new FileReader();\n\nreader.onload = function(e) {\nvar htmlPreview ='';\nvar contAtt2;\nfor (contAtt2=0;contAtt2<jQuery(\"#adjunto\")[0].files.length;contAtt2++){\n htmlPreview =htmlPreview+\n'<img src=\"'+urlDoc+'\" width=\"50px\" height=\"auto\" alt=\"#\" class=\"img-fluid img-circle\">' +\n'<p>' + input.files[contAtt2].name + '</p>';\n}\n\n\n var wrapperZone = jQuery(input).parent();\n var previewZone = jQuery(input).parent().parent().find('.preview-zone');\n var boxZone = jQuery(input).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n boxZone.append(htmlPreview);\n};\n\nreader.readAsDataURL(input.files[0]);\n }\n \n}\n\nfunction reset(e) {\n e.wrap('<form>').closest('form').get(0).reset();\n e.unwrap();\n}\n\njQuery(\".dropzone\").change(function() {\nvar sizeAtt=0;\nvar contAtt3;\nfor (contAtt3=0;contAtt3<jQuery(this)[0].files.length;contAtt3++){\nsizeAtt=sizeAtt+jQuery(this)[0].files[contAtt3].size;\nconsole.log(sizeAtt);\n}\n\n\nif(sizeAtt > 25000000){\nalert(\"wuama\");\n var wrapperZone = jQuery(this).parent();\n var previewZone = jQuery(this).parent().parent().find('.preview-zone');\n var boxZone = jQuery(this).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n;\n boxZone.append(\"<p style='color:red; font-size:24px'>El peso máximo es de 25Mb</p>\");\n this.value = \"\";\n }\n else{\n readFile(this);\n }\n});\n\njQuery('.dropzone-wrapper').on('dragover', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).addClass('dragover');\n});\n\njQuery('.dropzone-wrapper').on('dragleave', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).removeClass('dragover');\n});\n\njQuery('.remove-preview').on('click', function() {\n var boxZone = jQuery(this).parents('.preview-zone').find('.box-body');\n var previewZone = jQuery(this).parents('.preview-zone');\n var dropzone = jQuery(this).parents('.form-group').find('.dropzone');\n boxZone.empty();\n previewZone.addClass('hidden');\n reset(dropzone);\n});\njQuery(document).on('change','#municipio',function () {\n var idTema = jQuery(this).val();\n\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\n\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\n\n//Se llena el campo de tema de producto\nif(campoDepartamento==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"id-val\"+value8.value);\nif(idTema==value8.id){\nvar opcionesCampoTema2=\"<option value='-1' selected disabled>¿De qué ciudad nos contactas?</option>\";\njQuery.each(value8.children, function(key9, value9){\nopcionesCampoTema2=opcionesCampoTema2+\"<option value='\"+value9.id+\"' required>\"+value9.value+\"</option>\";\nconsole.log(value9.id+\"id-val\"+value9.value);\njQuery(\"#ciudad\").html(opcionesCampoTema2);\n});\n}\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input' required><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n}\n});\n});\n\n\n\n\n\njQuery(\"#CrearSiniestro\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\n//alert(jQuery(\"#adjunto\").val());\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\njQuery(\"#yyy\").show();\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoProducto=jQuery('#producto').val();\nvar valorTipoProductoLabel = jQuery('#producto option:selected').text();\nvar valorTelefono=jQuery('#telefonoUser').val();\nvar valorDepartamento=jQuery('#municipio').val();\nvar valorCiudad=jQuery('#ciudad').val();\nvar valorPoliza=jQuery('#poliza').val();\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudCode+'\",\"'+campoDepartamento+'\":{\"id\":\"'+valorDepartamento+'\",\"child\":{\"id\":\"'+valorCiudad+'\"}},\"'+campoTipoProducto+'\":{\"id\":\"'+valorTipoProducto+'\"},\"'+campoPoliza+'\":\"'+valorPoliza+'\",\"'+campoEmail+'\":\"'+email+'\",\"'+campoTelefono+'\":\"'+valorTelefono+'\",\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"Queja de '+valorTipoProductoLabel+'\",\"description\": \"'+resumen+'\",\"issuetype\": {\"name\": \"'+tipoSolicitudNombre+'\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n },\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\nvar formdata = new FormData();\nformdata.append('task',\"C:\\\\bot\\\\salida.csv\");\nvar data = new FormData();\n/*jQuery.each(jQuery('#adjunto')[0].files, function(i, file) {\ndata.append('file-'+i, file);\nconsole.log('f'+file)\n});*/\n\n/*esto sirve\nif(jQuery(\"#adjunto\")[0].files.length>0){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[0]);\n}\n FIN esto sirve*/\nvar contAtt;\nfor (contAtt=0;contAtt<jQuery(\"#adjunto\")[0].files.length;contAtt++){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[contAtt]);\n}\n\njQuery.support.cors = true;\nvar datastring = new FormData(jQuery(\"#ppform\")[0]);\nif( document.getElementById(\"adjunto\").files.length == 0 ){\n //alert(\"no files selected\");\n}\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\"+value+\"/attachments\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\n//dataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ndata: data,\ncontentType: false,\nprocessData: false,\ncache: false,\nheaders: {\n\"X-Atlassian-Token\": \"nocheck\"\n},\n//contentType: \"multipart/form-data\",\nsuccess: function (result){\nconsole.log(\"result\"+result);\n}\n});\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div style='float:right;width:80%'><div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'><p class='texto32 textoBlancoBold'>SOLICITUD CREADA</p></div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='textoBlancoLight texto32'>Señor(a) \"+nombre+\", su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='card-text textoBlanco texto19 '> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div></div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n},\nerror: function(xhr,status,data){jQuery(\"#yyy\").hide();\njQuery(\"#zzz\").show();\njQuery(\"#zzz\").html(\"Lo sentimos, no fue posible guardar la solicitud<br>\"+xhr.responseText);\n}\n});\n}\n});\n}\n});\n}\n\n\n/*****************************\n\nINICIO sUGENRENCIA\n\n****************************/\n\nfunction traerSugerencias (){\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(8);\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\nif(campoTipoProducto==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoTipoProducto=opcionesCampoTipoProducto+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\n\n//FULL INFO\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\nformSiniestro=formSiniestro+\"<div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-transparent border-0'><div class='card-body cardPP'><div class='row'><div class='col-sm'>\";\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='textoBlanco texto24 text-center '><br>Si no encontraste lo que buscabas en nuestra base de información o simplemente prefieres escribirnos sigue los siguentes pasos<br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\n\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='textoBlancoLight texto32 '>Cuéntanos un poco sobre ti</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre lo que buscas</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='producto' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTipoProducto;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos sobre lo que necesitas o quieres saber' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\normSiniestro=formSiniestro+\"<div class='row d-none'><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='input-group mb-3'> <div class='custom-file'><input type='file' class='custom-file-input' id='adjuntoOld' aria-describedby='inputGroupFileAddon03'><label class='custom-file-label' for='inputGroupFile03'>Choose file</label> </div></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='container2'><div class='row'><div class='col-sm-1'></div><div class='col-md-10'><div class='form-group'><label class='control-label'></label>\";\nformSiniestro=formSiniestro+\"<div class='preview-zone hidden'><div class='box box-solid'><div class='box-header with-border'><div><b>Archivo</b></div>\";\nformSiniestro=formSiniestro+\"<div class='box-tools pull-right'><button type='button' class='btn btn-primary btn-xs remove-preview'><i class='fa fa-times'></i> Vaciar campo</button></div></div>\";\nformSiniestro=formSiniestro+\"<div class='box-body'></div></div></div><div class='dropzone-wrapper'><div class='dropzone-desc'>\";\nformSiniestro=formSiniestro+\"<p>¿Quieres añadir algún documento?<br>Arrastra y suelta los documentos aquí</p><img src='\"+urlAttach+\"' width='50px' height='auto' alt='#' class='img-fluid img-circle'>Busca los archivos en tu computador</div><input type='file' name='img_logo' class='dropzone' id='adjunto' multiple></div></div></div></div><div class='col-sm-1'></div></div><div id='zzz' style='display:none ;color:red !important'><p id='fallaAjax'>fallo</p></div><div id='yyy' style='display:none'><p class='textoAzulLight texto13'>Enviando</p><div class='spinner-grow text-success' role='status'><span class='sr-only'>Enviando...</span></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearSiniestro' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div><div id='xxx'></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div></div></div>\";\n//Fin generacion del HTML\n//Se antepone el contenido\n//jQuery('.aui-page-panel-content').prepend(formSiniestro);\njQuery('#formInfo').empty();\njQuery('#formInfo').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\nfunction readFile(input)\n{\n\n if (input.files && input.files[0]) {\nvar reader = new FileReader();\n\nreader.onload = function(e) {\nvar htmlPreview ='';\nvar contAtt2;\nfor (contAtt2=0;contAtt2<jQuery(\"#adjunto\")[0].files.length;contAtt2++){\n htmlPreview =htmlPreview+\n'<img src=\"'+urlDoc+'\" width=\"50px\" height=\"auto\" alt=\"#\" class=\"img-fluid img-circle\">' +\n'<p>' + input.files[contAtt2].name + '</p>';\n}\n\n\n var wrapperZone = jQuery(input).parent();\n var previewZone = jQuery(input).parent().parent().find('.preview-zone');\n var boxZone = jQuery(input).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n boxZone.append(htmlPreview);\n};\n\nreader.readAsDataURL(input.files[0]);\n }\n \n}\n\nfunction reset(e) {\n e.wrap('<form>').closest('form').get(0).reset();\n e.unwrap();\n}\n\njQuery(\".dropzone\").change(function() {\nvar sizeAtt=0;\nvar contAtt3;\nfor (contAtt3=0;contAtt3<jQuery(this)[0].files.length;contAtt3++){\nsizeAtt=sizeAtt+jQuery(this)[0].files[contAtt3].size;\nconsole.log(sizeAtt);\n}\n\n\nif(sizeAtt > 25000000){\nalert(\"wuama\");\n var wrapperZone = jQuery(this).parent();\n var previewZone = jQuery(this).parent().parent().find('.preview-zone');\n var boxZone = jQuery(this).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n;\n boxZone.append(\"<p style='color:red; font-size:24px'>El peso máximo es de 25Mb</p>\");\n this.value = \"\";\n }\n else{\n readFile(this);\n }\n});\n\njQuery('.dropzone-wrapper').on('dragover', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).addClass('dragover');\n});\n\njQuery('.dropzone-wrapper').on('dragleave', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).removeClass('dragover');\n});\n\njQuery('.remove-preview').on('click', function() {\n var boxZone = jQuery(this).parents('.preview-zone').find('.box-body');\n var previewZone = jQuery(this).parents('.preview-zone');\n var dropzone = jQuery(this).parents('.form-group').find('.dropzone');\n boxZone.empty();\n previewZone.addClass('hidden');\n reset(dropzone);\n});\njQuery(\"#CrearSiniestro\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\n//alert(jQuery(\"#adjunto\").val());\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\njQuery(\"#yyy\").show();\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoProducto=jQuery('#producto').val();\nvar valorTipoProductoLabel = jQuery('#producto option:selected').text();\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudCode+'\",\"'+campoTipoProducto+'\":{\"id\":\"'+valorTipoProducto+'\"},\"'+campoEmail+'\":\"'+email+'\",\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"Sugerencia de '+valorTipoProductoLabel+'\",\"description\": \"'+resumen+'\",\"issuetype\": {\"name\": \"'+tipoSolicitudNombre+'\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n },\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\nvar formdata = new FormData();\nformdata.append('task',\"C:\\\\bot\\\\salida.csv\");\nvar data = new FormData();\n/*jQuery.each(jQuery('#adjunto')[0].files, function(i, file) {\ndata.append('file-'+i, file);\nconsole.log('f'+file)\n});*/\n\n/*esto sirve\nif(jQuery(\"#adjunto\")[0].files.length>0){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[0]);\n}\n FIN esto sirve*/\nvar contAtt;\nfor (contAtt=0;contAtt<jQuery(\"#adjunto\")[0].files.length;contAtt++){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[contAtt]);\n}\n\njQuery.support.cors = true;\nvar datastring = new FormData(jQuery(\"#ppform\")[0]);\nif( document.getElementById(\"adjunto\").files.length == 0 ){\n //alert(\"no files selected\");\n}\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\"+value+\"/attachments\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\n//dataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ndata: data,\ncontentType: false,\nprocessData: false,\ncache: false,\nheaders: {\n\"X-Atlassian-Token\": \"nocheck\"\n},\n//contentType: \"multipart/form-data\",\nsuccess: function (result){\nconsole.log(\"result\"+result);\n}\n});\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div style='float:right;width:80%'><div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'><p class='texto32 textoBlancoBold'>SOLICITUD CREADA</p></div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='textoBlancoLight texto32'>Señor(a) \"+nombre+\", su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='card-text textoBlanco texto19 '> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div></div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n},\nerror: function(xhr,status,data){jQuery(\"#yyy\").hide();\njQuery(\"#zzz\").show();\njQuery(\"#zzz\").html(\"Lo sentimos, no fue posible guardar la solicitud<br>\"+xhr.responseText);\n}\n});\n}\n});\n}\n});\n\n}\n\n/************************************\n\nGESTION\n\n\n************************************/\nfunction traerGestion (){\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(8);\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\nif(campoTipoProducto==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\n\n\nopcionesCampoTipoProducto=opcionesCampoTipoProducto+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n\n});\n\n}\n});\n}\n//Se llena el campo de tema de producto\nif(campoTema==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\n\n\nif(selectedTema==value8.id){\nopcionesCampoTema=opcionesCampoTema+\"<option selected value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\njQuery.each(value8.children, function(key9, value9){\n//Solo son 4 valores\n//if(value9.id==\"17015\" || value9.id==\"17016\" || value9.id==\"17017\" || value9.id==\"17018\" || value9.id==\"17019\"){\nopcionesCampoTemaSub=opcionesCampoTemaSub+\"<option value='\"+value9.id+\"'>\"+value9.value+\"</option>\";\n\nconsole.log(value9.id+\"id-val\"+value9.value);\n //} \n});\n\n}\nelse{\nopcionesCampoTema=opcionesCampoTema+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n}\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\n\n\n//Se carga dinamicamente el subtema\n\n\n\n//FULL TEMA\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\nformSiniestro=formSiniestro+\"<div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-transparent border-0'><div class='card-body cardPP'><div class='row'><div class='col-sm'>\";\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='textoBlanco texto24 text-center '><br>Si no encontraste lo que buscabas en nuestra base de información o simplemente prefieres escribirnos sigue los siguentes pasos<br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\n\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='textoBlancoLight texto32 '>Cuéntanos un poco sobre ti</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre lo que buscas</p><br></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='producto' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTipoProducto;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='tema' style='display:none' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTema;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='temaHijo' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTemaSub;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos algunos detalles sobre tu solicitud, esto nos puede ayudar a responderte más pronto.' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row d-none'><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='input-group mb-3'> <div class='custom-file'><input type='file' class='custom-file-input' id='adjuntoOld' aria-describedby='inputGroupFileAddon03'><label class='custom-file-label' for='inputGroupFile03'>Choose file</label> </div></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='container2'><div class='row'><div class='col-sm-1'></div><div class='col-md-10'><div class='form-group'><label class='control-label'></label>\";\nformSiniestro=formSiniestro+\"<div class='preview-zone hidden'><div class='box box-solid'><div class='box-header with-border'><div><b>Archivo</b></div>\";\nformSiniestro=formSiniestro+\"<div class='box-tools pull-right'><button type='button' class='btn btn-primary btn-xs remove-preview'><i class='fa fa-times'></i> Vaciar campo</button></div></div>\";\nformSiniestro=formSiniestro+\"<div class='box-body'></div></div></div><div class='dropzone-wrapper'><div class='dropzone-desc'><p>¿Quieres agregar un documento?<br>Arrastra y suelta los documentos aquí</p><img src='\"+urlAttach+\"' width='50px' height='auto' alt='#' class='img-fluid img-circle'>Busca los archivos en tu computador\";\nformSiniestro=formSiniestro+\"</div><input type='file' name='img_logo' class='dropzone' id='adjunto' multiple></div></div></div></div><div class='col-sm-1'></div></div><div id='zzz' style='display:none ;color:red !important'><p id='fallaAjax'>fallo</p></div><div id='yyy' style='display:none'><p class='textoAzulLight texto13'>Enviando</p><div class='spinner-grow text-success' role='status'><span class='sr-only'>Enviando...</span></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearPoliza' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div><div id='xxx'></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div></div></div>\";\n//Fin generacion del HTML\n//Se antepone el contenido\n//jQuery('.aui-page-panel-content').prepend(formSiniestro);\njQuery('#formInfo').empty();\njQuery('#formInfo').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\nfunction readFile(input)\n{\n\n if (input.files && input.files[0]) {\nvar reader = new FileReader();\n\nreader.onload = function(e) {\nvar htmlPreview ='';\nvar contAtt2;\nfor (contAtt2=0;contAtt2<jQuery(\"#adjunto\")[0].files.length;contAtt2++){\n htmlPreview =htmlPreview+\n'<img src=\"'+urlDoc+'\" width=\"50px\" height=\"auto\" alt=\"#\" class=\"img-fluid img-circle\">' +\n'<p>' + input.files[contAtt2].name + '</p>';\n}\n\n\n var wrapperZone = jQuery(input).parent();\n var previewZone = jQuery(input).parent().parent().find('.preview-zone');\n var boxZone = jQuery(input).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n boxZone.append(htmlPreview);\n};\n\nreader.readAsDataURL(input.files[0]);\n }\n \n}\n\nfunction reset(e) {\n e.wrap('<form>').closest('form').get(0).reset();\n e.unwrap();\n}\n\njQuery(\".dropzone\").change(function() {\nvar sizeAtt=0;\nvar contAtt3;\nfor (contAtt3=0;contAtt3<jQuery(this)[0].files.length;contAtt3++){\nsizeAtt=sizeAtt+jQuery(this)[0].files[contAtt3].size;\nconsole.log(sizeAtt);\n}\n\n\nif(sizeAtt > 25000000){\nalert(\"wuama\");\n var wrapperZone = jQuery(this).parent();\n var previewZone = jQuery(this).parent().parent().find('.preview-zone');\n var boxZone = jQuery(this).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n;\n boxZone.append(\"<p style='color:red; font-size:24px'>El peso máximo es de 25Mb</p>\");\n this.value = \"\";\n }\n else{\n readFile(this);\n }\n});\n\njQuery('.dropzone-wrapper').on('dragover', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).addClass('dragover');\n});\n\njQuery('.dropzone-wrapper').on('dragleave', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).removeClass('dragover');\n});\n\njQuery('.remove-preview').on('click', function() {\n var boxZone = jQuery(this).parents('.preview-zone').find('.box-body');\n var previewZone = jQuery(this).parents('.preview-zone');\n var dropzone = jQuery(this).parents('.form-group').find('.dropzone');\n boxZone.empty();\n previewZone.addClass('hidden');\n reset(dropzone);\n});\njQuery(document).on('change','#tema',function () {\n var idTema = jQuery(this).val();\n\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\n\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\n\n//Se llena el campo de tema de producto\nif(campoTema==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"id-val\"+value8.value);\nif(idTema==value8.id){\nvar opcionesCampoTema2=\"<option value='-1' selected disabled>(Opcional)</option>\";\njQuery.each(value8.children, function(key9, value9){\nopcionesCampoTema2=opcionesCampoTema2+\"<option value='\"+value9.id+\"'>\"+value9.value+\"</option>\";\nconsole.log(value9.id+\"id-val\"+value9.value);\n jQuery(\"#temaHijo\").html(opcionesCampoTema2);\n});\n}\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n}\n});\n});\n\njQuery(\"#CrearPoliza\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\n//alert(jQuery(\"#adjunto\").val());\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\njQuery(\"#yyy\").show();\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoProducto=jQuery('#producto').val();\nvar valorTema=jQuery('#tema').val();\nvar valorTemaHijo=jQuery('#temaHijo').val();\nvar valorTipoProductoLabel = jQuery('#temaHijo option:selected').text();\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudCode+'\",\"'+campoTema+'\":{\"id\":\"'+valorTema+'\",\"child\":{\"id\":\"'+valorTemaHijo+'\"}},\"'+campoTipoProducto+'\":{\"id\":\"'+valorTipoProducto+'\"},\"'+campoEmail+'\":\"'+email+'\",\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"Gestión financiera y contable para '+valorTipoProductoLabel+'\",\"description\": \"'+resumen+'\",\"issuetype\": {\"name\": \"'+tipoSolicitudNombre+'\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n },\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\nvar formdata = new FormData();\nformdata.append('task',\"C:\\\\bot\\\\salida.csv\");\nvar data = new FormData();\n/*jQuery.each(jQuery('#adjunto')[0].files, function(i, file) {\ndata.append('file-'+i, file);\nconsole.log('f'+file)\n});*/\n\n/*esto sirve\nif(jQuery(\"#adjunto\")[0].files.length>0){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[0]);\n}\n FIN esto sirve*/\nvar contAtt;\nfor (contAtt=0;contAtt<jQuery(\"#adjunto\")[0].files.length;contAtt++){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[contAtt]);\n}\n\njQuery.support.cors = true;\nvar datastring = new FormData(jQuery(\"#ppform\")[0]);\nif( document.getElementById(\"adjunto\").files.length == 0 ){\n //alert(\"no files selected\");\n}\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\"+value+\"/attachments\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\n//dataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ndata: data,\ncontentType: false,\nprocessData: false,\ncache: false,\nheaders: {\n\"X-Atlassian-Token\": \"nocheck\"\n},\n//contentType: \"multipart/form-data\",\nsuccess: function (result){\nconsole.log(\"result\"+result);\n}\n});\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div style='float:right;width:80%'><div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'><p class='texto32 textoBlancoBold'>SOLICITUD CREADA</p></div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='textoBlancoLight texto32'>Señor(a) \"+nombre+\", su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='card-text textoBlanco texto19 '> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div></div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n},\nerror: function(xhr,status,data){jQuery(\"#yyy\").hide();\njQuery(\"#zzz\").show();\njQuery(\"#zzz\").html(\"Lo sentimos, no fue posible guardar la solicitud<br>\"+xhr.responseText);\n}\n});\n}\n});\n}\n});\n\n}\n\n/************************************\n\nHABEAS\n\n\n************************************/\nfunction traerHabeas (){\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(8);\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\nif(campoTipoProducto==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\n\n\nopcionesCampoTipoProducto=opcionesCampoTipoProducto+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n\n});\n\n}\n});\n}\n//Se llena el campo de tema de producto\nif(campoTema==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\n\n\nif(selectedTema==value8.id){\nopcionesCampoTema=opcionesCampoTema+\"<option selected value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\njQuery.each(value8.children, function(key9, value9){\nopcionesCampoTemaSub=opcionesCampoTemaSub+\"<option value='\"+value9.id+\"'>\"+value9.value+\"</option>\";\nconsole.log(value9.id+\"id-val\"+value9.value);\n \n});\n\n}\nelse{\nopcionesCampoTema=opcionesCampoTema+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n}\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\n\n\n//Se carga dinamicamente el subtema\n\n\n\n//FULL TEMA\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\nformSiniestro=formSiniestro+\"<div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-transparent border-0'><div class='card-body cardPP'><div class='row'><div class='col-sm'>\";\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='textoBlanco texto24 text-center '><br>Si no encontraste lo que buscabas en nuestra base de información o simplemente prefieres escribirnos sigue los siguentes pasos<br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\n\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='textoBlancoLight texto32 '>Cuéntanos un poco sobre ti</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre lo que buscas</p><br></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='producto' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTipoProducto;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='tema' style='display:none' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTema;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='temaHijo' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoTemaSub;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos algunos detalles sobre tu solicitud, esto nos puede ayudar a responderte más pronto.' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row d-none'><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='input-group mb-3'> <div class='custom-file'><input type='file' class='custom-file-input' id='adjuntoOld' aria-describedby='inputGroupFileAddon03'><label class='custom-file-label' for='inputGroupFile03'>Choose file</label> </div></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='container2'><div class='row'><div class='col-sm-1'></div><div class='col-md-10'><div class='form-group'><label class='control-label'></label>\";\nformSiniestro=formSiniestro+\"<div class='preview-zone hidden'><div class='box box-solid'><div class='box-header with-border'><div><b>Archivo</b></div>\";\nformSiniestro=formSiniestro+\"<div class='box-tools pull-right'><button type='button' class='btn btn-primary btn-xs remove-preview'><i class='fa fa-times'></i> Vaciar campo</button></div></div>\";\nformSiniestro=formSiniestro+\"<div class='box-body'></div></div></div><div class='dropzone-wrapper'><div class='dropzone-desc'><p>¿Quieres agregar un documento?<br>Arrastra y suelta los documentos aquí</p><img src='\"+urlAttach+\"' width='50px' height='auto' alt='#' class='img-fluid img-circle'>Busca los archivos en tu computador\";\nformSiniestro=formSiniestro+\"</div><input type='file' name='img_logo' class='dropzone' id='adjunto' multiple></div></div></div></div><div class='col-sm-1'></div></div><div id='zzz' style='display:none ;color:red !important'><p id='fallaAjax'>fallo</p></div><div id='yyy' style='display:none'><p class='textoAzulLight texto13'>Enviando</p><div class='spinner-grow text-success' role='status'><span class='sr-only'>Enviando...</span></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearPoliza' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div><div id='xxx'></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div></div></div>\";\n//Fin generacion del HTML\n//Se antepone el contenido\n//jQuery('.aui-page-panel-content').prepend(formSiniestro);\njQuery('#formInfo').empty();\njQuery('#formInfo').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\nfunction readFile(input)\n{\n\n if (input.files && input.files[0]) {\nvar reader = new FileReader();\n\nreader.onload = function(e) {\nvar htmlPreview ='';\nvar contAtt2;\nfor (contAtt2=0;contAtt2<jQuery(\"#adjunto\")[0].files.length;contAtt2++){\n htmlPreview =htmlPreview+\n'<img src=\"'+urlDoc+'\" width=\"50px\" height=\"auto\" alt=\"#\" class=\"img-fluid img-circle\">' +\n'<p>' + input.files[contAtt2].name + '</p>';\n}\n\n\n var wrapperZone = jQuery(input).parent();\n var previewZone = jQuery(input).parent().parent().find('.preview-zone');\n var boxZone = jQuery(input).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n boxZone.append(htmlPreview);\n};\n\nreader.readAsDataURL(input.files[0]);\n }\n \n}\n\nfunction reset(e) {\n e.wrap('<form>').closest('form').get(0).reset();\n e.unwrap();\n}\n\njQuery(\".dropzone\").change(function() {\nvar sizeAtt=0;\nvar contAtt3;\nfor (contAtt3=0;contAtt3<jQuery(this)[0].files.length;contAtt3++){\nsizeAtt=sizeAtt+jQuery(this)[0].files[contAtt3].size;\nconsole.log(sizeAtt);\n}\n\n\nif(sizeAtt > 25000000){\nalert(\"wuama\");\n var wrapperZone = jQuery(this).parent();\n var previewZone = jQuery(this).parent().parent().find('.preview-zone');\n var boxZone = jQuery(this).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n;\n boxZone.append(\"<p style='color:red; font-size:24px'>El peso máximo es de 25Mb</p>\");\n this.value = \"\";\n }\n else{\n readFile(this);\n }\n});\n\njQuery('.dropzone-wrapper').on('dragover', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).addClass('dragover');\n});\n\njQuery('.dropzone-wrapper').on('dragleave', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).removeClass('dragover');\n});\n\njQuery('.remove-preview').on('click', function() {\n var boxZone = jQuery(this).parents('.preview-zone').find('.box-body');\n var previewZone = jQuery(this).parents('.preview-zone');\n var dropzone = jQuery(this).parents('.form-group').find('.dropzone');\n boxZone.empty();\n previewZone.addClass('hidden');\n reset(dropzone);\n});\njQuery(document).on('change','#tema',function () {\n var idTema = jQuery(this).val();\n\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\n\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\n\n//Se llena el campo de tema de producto\nif(campoTema==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"id-val\"+value8.value);\nif(idTema==value8.id){\nvar opcionesCampoTema2=\"<option value='-1' selected disabled>(Opcional)</option>\";\njQuery.each(value8.children, function(key9, value9){\nopcionesCampoTema2=opcionesCampoTema2+\"<option value='\"+value9.id+\"'>\"+value9.value+\"</option>\";\nconsole.log(value9.id+\"id-val\"+value9.value);\n jQuery(\"#temaHijo\").html(opcionesCampoTema2);\n});\n}\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n}\n});\n});\n\njQuery(\"#CrearPoliza\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\n//alert(jQuery(\"#adjunto\").val());\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\njQuery(\"#yyy\").show();\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoProducto=jQuery('#producto').val();\nvar valorTema=jQuery('#tema').val();\nvar valorTemaHijo=jQuery('#temaHijo').val();\nvar valorTipoProductoLabel = jQuery('#temaHijo option:selected').text();\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudCode+'\",\"'+campoTema+'\":{\"id\":\"'+valorTema+'\",\"child\":{\"id\":\"'+valorTemaHijo+'\"}},\"'+campoTipoProducto+'\":{\"id\":\"'+valorTipoProducto+'\"},\"'+campoEmail+'\":\"'+email+'\",\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"Habeas Data para '+valorTipoProductoLabel+'\",\"description\": \"'+resumen+'\",\"issuetype\": {\"name\": \"'+tipoSolicitudNombre+'\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n },\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\nvar formdata = new FormData();\nformdata.append('task',\"C:\\\\bot\\\\salida.csv\");\nvar data = new FormData();\n/*jQuery.each(jQuery('#adjunto')[0].files, function(i, file) {\ndata.append('file-'+i, file);\nconsole.log('f'+file)\n});*/\n\n/*esto sirve\nif(jQuery(\"#adjunto\")[0].files.length>0){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[0]);\n}\n FIN esto sirve*/\nvar contAtt;\nfor (contAtt=0;contAtt<jQuery(\"#adjunto\")[0].files.length;contAtt++){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[contAtt]);\n}\n\njQuery.support.cors = true;\nvar datastring = new FormData(jQuery(\"#ppform\")[0]);\nif( document.getElementById(\"adjunto\").files.length == 0 ){\n //alert(\"no files selected\");\n}\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\"+value+\"/attachments\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\n//dataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ndata: data,\ncontentType: false,\nprocessData: false,\ncache: false,\nheaders: {\n\"X-Atlassian-Token\": \"nocheck\"\n},\n//contentType: \"multipart/form-data\",\nsuccess: function (result){\nconsole.log(\"result\"+result);\n}\n});\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div style='float:right;width:80%'><div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'><p class='texto32 textoBlancoBold'>SOLICITUD CREADA</p></div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='textoBlancoLight texto32'>Señor(a) \"+nombre+\", su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='card-text textoBlanco texto19 '> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div></div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n},\nerror: function(xhr,status,data){jQuery(\"#yyy\").hide();\njQuery(\"#zzz\").show();\njQuery(\"#zzz\").html(\"Lo sentimos, no fue posible guardar la solicitud<br>\"+xhr.responseText);\n}\n});\n}\n});\n}\n});\n\n}\n/******\n\n\n\nSiniestros\n\n******/\n\nfunction traerTiposSinistros (){\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(8);\njQuery.each(result, function(key, value){\n\n\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\njQuery.each(value2, function(key3, value3){\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de siniestro\nif(campoCategoriaSiniestro==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoCategoriaSiniestro=opcionesCampoCategoriaSiniestro+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline'><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\njQuery('.aui-page-panel-content').empty();\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='h5 text-center '><br>Sabemos que este no es el mejor de los momentos y estamos de tu lado para facilitarte las cosas en este proceso<br><br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row text-center'><div class='col-md-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-2'><div class='custom-control custom-radio image-checkbox'><input type='radio' class='custom-control-input' id='ck2a' name='ck2' value='\"+valorComo1+\"'>\";\nformSiniestro=formSiniestro+\"<label class='custom-control-label' for='ck2a'><img src='\"+urlBase+\"/images/Group1.png' width='50px' height='auto' alt='#' class='img-fluid img-circle'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>Nada bien, me siento muy afectad@ por mi situación</p></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-2'><div class='custom-control custom-radio image-checkbox'><input type='radio' class='custom-control-input' id='ck2b' name='ck2' value='\"+valorComo2+\"'><label class='custom-control-label' for='ck2b'>\";\nformSiniestro=formSiniestro+\"<img src='\"+urlBase+\"/images/Group2.png' width='50px' height='auto' alt='#' class='img-fluid'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>Me siento muy contrariad@ y muy nervios@</p></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-2'><div class='custom-control custom-radio image-checkbox'><input type='radio' class='custom-control-input' id='ck2c' name='ck2' value='\"+valorComo3+\"' >\";\nformSiniestro=formSiniestro+\"<label class='custom-control-label' for='ck2c'><img src='\"+urlBase+\"/images/Group3.png' alt='#' width='50px' height='auto' class='img-fluid'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>creo que lo peor ya paso, estoy a la espectativa de lo que sigue</p></div>\";\nformSiniestro=formSiniestro+\"</div><div class='col-md-2'><div class='custom-control custom-radio image-checkbox'><input type='radio' class='custom-control-input' id='ck2d' name='ck2' value='\"+valorComo4+\"'>\";\nformSiniestro=formSiniestro+\"<label class='custom-control-label' for='ck2d'>\";\nformSiniestro=formSiniestro+\"<img src='\"+urlBase+\"/images/Group4.png' alt='#' width='50px' height='auto' class='img-fluid'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>Estoy tranquil@ se que todo va a mejorar</p></div></div><div class='col-md-2'>\";\nformSiniestro=formSiniestro+\"<div class='custom-control custom-radio image-checkbox'>\";\nformSiniestro=formSiniestro+\"<input type='radio' class='custom-control-input' id='ck2e' name='ck2' value='\"+valorComo5+\"' checked>\";\nformSiniestro=formSiniestro+\"<label class='custom-control-label' for='ck2e'>\";\nformSiniestro=formSiniestro+\"<img src='\"+urlBase+\"/images/Group5.png' alt='#' width='50px' height='auto' class='img-fluid'></label>\";\nformSiniestro=formSiniestro+\"<p class='h6 small text-left'><br>Estoy muy bien me siento muy respaldado y seguro</p></div></div><div class='col-md-1'></div>\";\nformSiniestro=formSiniestro+\"</div><br><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='h3 '>Cuentanos un poco sobre ti</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class=' '>\";\nformSiniestro=formSiniestro+\"<label class='sr-only' for='inlineFormInputGroup'>Username</label><div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text'>#</div></div>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control ' id='telefonoUser' placeholder='A veces es mas práctico hablar por teléfono, ¿Cómo es tu numero?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-primary'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre que sucedió<br></p><br></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='siniestro' aria-label='Summary'>\"; \nformSiniestro=formSiniestro+opcionesCampoCategoriaSiniestro;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+\"<div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos un poco sobre el incidente' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearSiniestro' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\"\nformSiniestro=formSiniestro+\"</div></div></div></div><div id='xxx'></div>\";\n\n//Fin generacion del HTML\n//Se antepone el contenido\njQuery('.aui-page-panel-content').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\n\njQuery(\"#CrearSiniestro\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar radioComo = jQuery(\"input[name='ck2']:checked\").val();\nvar telefono =jQuery('#telefonoUser').val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoSiniestro=jQuery('#siniestro').val();\n// TO DO\n//Se debe validar el tipo de siniestro para enviar o no siertos datos\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudSiniestro+'\",\"'+campoCategoriaSiniestro+'\":{\"id\":\"'+valorTipoSiniestro+'\"},\"'+campoEmail+'\":\"'+email+'\",\"'+campoTelefono+'\":'+telefono+',\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoComo+'\":{\"id\":\"'+radioComo+'\"},\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"'+resumen+'\",\"description\": \"Creating\",\"issuetype\": {\"name\": \"Reclamo / Siniestro\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'>SOLICITUD CREADA \"+issueKey+\"</div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='h2'>Señor user_name, su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='badge badge-dark'> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n}\n});\n}\n});\n}\n});\n\n}\n/*****************************\n\nINICIO CERTIFICADOS\n\n****************************/\nfunction traerCertificados(){\njQuery.ajax({\ntype: \"GET\",\nurl: urlBase+\"/rest/api/2/issue/createmeta?projectKeys=\"+llaveIs+\"&expand=projects.issuetypes.fields\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata:{},\n\nsuccess: function (result){\nfechaANS = calculaANS(8);\njQuery.each(result, function(key, value){\n\t//console.log(\"Key: \" + key);\nif(key==\"projects\"){\njQuery.each(value, function(key2, value2){\n\t//console.log(\"key2: \" + key2);\njQuery.each(value2, function(key3, value3){\n\t//console.log(\"key3: \" + key3);\nif(key3==\"issuetypes\")\n{\nvar cont=0;\njQuery.each(value3, function(key4, value4){\n\t//console.log(\"key4: \" + key4);\n//esto varia segun el tipo de issue\n//http://172.22.6.62:8080/rest/api/2/issue/createmeta?projectKeys=ZUR&expand=projects.issuetypes.fields\ncont=cont+1;\nif(cont==iteracionAPI){\njQuery.each(value4, function(key5, value5){\n\t//console.log(\"key5: \" + key5);\n\t//console.log(\"value5: \" + value5);\nif(\"fields\"==key5){\n\njQuery.each(value5, function(key6, value6){\n//Se llena el campo de tipo de producto\nif(campoCertificado==key6){\n\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\nconsole.log(value8.id+\"---\"+value8.value);\nopcionesCampoCertificado=opcionesCampoCertificado+\"<option value='\"+value8.id+\"'>\"+value8.value+\"</option>\";\n\n});\n\n}\n});\n}\n//se llena el campo de tipo de ID\nif(campoTipoID==key6){\nvar contTipos = 0;\njQuery.each(value6, function(key7, value7){\nif(\"allowedValues\"==key7){\njQuery.each(value7, function(key8, value8){\ncontTipos+=contTipos+1;\n\nopcionesCampoTipoID=opcionesCampoTipoID+\"<div class='custom-control custom-radio custom-control-inline' ><input value='\"+value8.id+\"' type='radio' id='customRadioInline\"+contTipos+\"' name='customRadioInline1' class='custom-control-input'><label class='custom-control-label text-white' for='customRadioInline\"+contTipos+\"'>\"+value8.value+\"</label></div>\";\n\n});\n\n}\n});\n}\n});\n}\n});\n}\n});\n}\n});\n});\n}\n//Fin carga de selects y radiso\n\n//****\n//*\n//** Generación del html a inyectar\n//*\n//****\n\n});\n//console.log( \"ready!2\" );\n//Un token que usa el form nativo de JIRA no se si sea necesario pero no veo por que removerlo\n\n//FULL Cert\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\nformSiniestro=formSiniestro+\"<div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-transparent border-0'><div class='card-body cardPP'><div class='row'><div class='col-sm'>\";\nformSiniestro=formSiniestro+\"<form action='' id='ppform' method='post' class='aui vp-form top-label vp-request-form'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformSiniestro=formSiniestro+\"<input type='hidden' value='10000' name='projectId'>\";\nformSiniestro=formSiniestro+\"<div class='field-group field-separator' style='display:none'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-3'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen3' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-3' id='s2id_autogen3'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen3_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-3' id='s2id_autogen3_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-3'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body text-black'><div class='row'><div class='col-sm-12'>\";\nformSiniestro=formSiniestro+\"<div class='card text-white bg-info ' style='max-width: 59rem;'><div class='card-header text-center bg-primary'><p class='textoBlanco texto24 text-center '><br>Si no encontraste lo que buscabas en nuestra base de información o simplemente prefieres escribirnos sigue los siguentes pasos<br></p></div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\n\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><p class='textoBlancoLight texto32 '>Cuéntanos un poco sobre ti</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='nombreUser' placeholder='¿Cómo te llamas (nombre+apellido)?' required></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='form-group'>\";\nformSiniestro=formSiniestro+\"<input type='text' class='form-control rounded' id='identificacionUser' placeholder='¿Tu número de identificación es?' required></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'>\";\nformSiniestro=formSiniestro+opcionesCampoTipoID;\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div><br><div class='row '><div class='col-sm-1'></div>\";\nformSiniestro=formSiniestro+\"<div class='col-md-10 text-left'><div class=' '><label class='sr-only' for='inlineFormInputGroup'>Username</label> \";\nformSiniestro=formSiniestro+\"<div class='input-group mb-2'><div class='input-group-prepend'><div class='input-group-text '>@</div></div>\";\nformSiniestro=formSiniestro+\"<input type='email' required class='form-control rounded-right' id='emailUser' placeholder='¿A qué correo electrónico te podemos responder?'></div></div></div>\";\nformSiniestro=formSiniestro+\"<div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div>\";\nformSiniestro=formSiniestro+\"<div class='card-body bg-info'>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 '><p class='textoBlancoLight texto32 text-left'>Hablemos sobre lo que buscas</p></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='input-group'>\";\nformSiniestro=formSiniestro+\"<select class='custom-select rounded' id='producto' aria-label='Summary' placeholder='rererer'>\"; \nformSiniestro=formSiniestro+opcionesCampoCertificado;\nformSiniestro=formSiniestro+\"</select></div></div><div class='col-sm-1'></div></div><br>\";\nformSiniestro=formSiniestro+\"<div class='row '><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='field-container'><textarea id='resumen' rows='6' class='form-control ' id='summary' name='summary' placeholder='Cuéntanos sobre lo que necesitas o quieres saber' required></textarea></div></div></div><div class='col-sm-1'></div></div>\";\normSiniestro=formSiniestro+\"<div class='row d-none'><div class='col-sm-1'></div><div class='col-md-10 text-left'><div class='field-group'><div class='input-group mb-3'> <div class='custom-file'><input type='file' class='custom-file-input' id='adjuntoOld' aria-describedby='inputGroupFileAddon03'><label class='custom-file-label' for='inputGroupFile03'>Choose file</label> </div></div></div></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"<div class='container2'><div class='row'><div class='col-sm-1'></div><div class='col-md-10'><div class='form-group'><label class='control-label'></label>\";\nformSiniestro=formSiniestro+\"<div class='preview-zone hidden'><div class='box box-solid'><div class='box-header with-border'><div><b>Archivo</b></div>\";\nformSiniestro=formSiniestro+\"<div class='box-tools pull-right'><button type='button' class='btn btn-primary btn-xs remove-preview'><i class='fa fa-times'></i> Vaciar campo</button></div></div>\";\nformSiniestro=formSiniestro+\"<div class='box-body'></div></div></div><div class='dropzone-wrapper'><div class='dropzone-desc'>\";\nformSiniestro=formSiniestro+\"<p>¿Quieres añadir algún documento?<br>Arrastra y suelta los documentos aquí</p><img src='\"+urlAttach+\"' width='50px' height='auto' alt='#' class='img-fluid img-circle'>Busca los archivos en tu computador</div><input type='file' name='img_logo' class='dropzone' id='adjunto' multiple></div></div></div></div><div class='col-sm-1'></div></div><div id='zzz' style='display:none ;color:red !important'><p id='fallaAjax'>fallo</p></div><div id='yyy' style='display:none'><p class='textoAzulLight texto13'>Enviando</p><div class='spinner-grow text-success' role='status'><span class='sr-only'>Enviando...</span></div></div>\";\nformSiniestro=formSiniestro+\"<input id='submit-hidden' type='submit' style='display: none' /></form><div class='row' ><div class='col-sm-1'></div><div class='col-md-10 text-center text-white'><button type='button' class='btn-lg rounded btn-warning font-weight-ligther text-white' id='CrearSiniestro' role='button'>Enviar</button></div><div class='col-sm-1'></div></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div><div id='xxx'></div>\";\nformSiniestro=formSiniestro+\"</div></div></div></div></div></div>\";\n//Fin generacion del HTML\n//Se antepone el contenido\n//jQuery('.aui-page-panel-content').prepend(formSiniestro);\njQuery('#formInfo').empty();\njQuery('#formInfo').prepend(formSiniestro);\n// ENVIO FORMULARIO SINIESTROS\n//************************************************************//\n//Se agrega la function anonima al evento on click de un boton\n//************************************************************//\nfunction readFile(input)\n{\n\n if (input.files && input.files[0]) {\nvar reader = new FileReader();\n\nreader.onload = function(e) {\nvar htmlPreview ='';\nvar contAtt2;\nfor (contAtt2=0;contAtt2<jQuery(\"#adjunto\")[0].files.length;contAtt2++){\n htmlPreview =htmlPreview+\n'<img src=\"'+urlDoc+'\" width=\"50px\" height=\"auto\" alt=\"#\" class=\"img-fluid img-circle\">' +\n'<p>' + input.files[contAtt2].name + '</p>';\n}\n\n\n var wrapperZone = jQuery(input).parent();\n var previewZone = jQuery(input).parent().parent().find('.preview-zone');\n var boxZone = jQuery(input).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n boxZone.append(htmlPreview);\n};\n\nreader.readAsDataURL(input.files[0]);\n }\n \n}\n\nfunction reset(e) {\n e.wrap('<form>').closest('form').get(0).reset();\n e.unwrap();\n}\n\njQuery(\".dropzone\").change(function() {\nvar sizeAtt=0;\nvar contAtt3;\nfor (contAtt3=0;contAtt3<jQuery(this)[0].files.length;contAtt3++){\nsizeAtt=sizeAtt+jQuery(this)[0].files[contAtt3].size;\nconsole.log(sizeAtt);\n}\n\n\nif(sizeAtt > 25000000){\nalert(\"wuama\");\n var wrapperZone = jQuery(this).parent();\n var previewZone = jQuery(this).parent().parent().find('.preview-zone');\n var boxZone = jQuery(this).parent().parent().find('.preview-zone').find('.box').find('.box-body');\n\n wrapperZone.removeClass('dragover');\n previewZone.removeClass('hidden');\n boxZone.empty();\n;\n boxZone.append(\"<p style='color:red; font-size:24px'>El peso máximo es de 25Mb</p>\");\n this.value = \"\";\n }\n else{\n readFile(this);\n }\n});\n\njQuery('.dropzone-wrapper').on('dragover', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).addClass('dragover');\n});\n\njQuery('.dropzone-wrapper').on('dragleave', function(e) {\n e.preventDefault();\n e.stopPropagation();\n jQuery(this).removeClass('dragover');\n});\n\njQuery('.remove-preview').on('click', function() {\n var boxZone = jQuery(this).parents('.preview-zone').find('.box-body');\n var previewZone = jQuery(this).parents('.preview-zone');\n var dropzone = jQuery(this).parents('.form-group').find('.dropzone');\n boxZone.empty();\n previewZone.addClass('hidden');\n reset(dropzone);\n});\njQuery(\"#CrearSiniestro\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif (!jQuery(\"#ppform\")[0].checkValidity()) {\n// Se simula el submit para que las validaciones se realicen via HTML5\n//alert(jQuery(\"#adjunto\").val());\njQuery(\"#ppform\").find(\"#submit-hidden\").click();\n }\nelse {\njQuery(\"#yyy\").show();\nvar radioTipoIdentificacion = jQuery(\"input[name='customRadioInline1']:checked\").val();\nvar nombre =jQuery('#nombreUser').val();\nvar identificacion =jQuery('#identificacionUser').val();\nvar email =jQuery('#emailUser').val();\nvar resumen=jQuery('#resumen').val();resumen = resumen.replace(/\\n/g, \" \").replaceAll(\"\\t\", \" \").replaceAll(\"\\r\", \" \");\nvar valorTipoProducto=jQuery('#producto').val();\nvar valorTipoProductoLabel = jQuery('#producto option:selected').text();\n//Data para enviar en el request\nvar jira = '{\"fields\" : {\"project\":{\"key\": \"'+llaveIs+'\"},\"'+campoTipoSolicitud+'\": \"'+tipoSolicitudCode+'\",\"'+campoCertificado+'\":{\"id\":\"'+valorTipoProducto+'\"},\"'+campoEmail+'\":\"'+email+'\",\"'+campoNombre+'\":\"'+nombre+'\",\"'+campoIdentificacion+'\":\"'+identificacion+'\",\"'+campoTipoID+'\":{\"id\":\"'+radioTipoIdentificacion+'\"}, \"summary\": \"Certificado para '+valorTipoProductoLabel+'\",\"description\": \"'+resumen+'\",\"issuetype\": {\"name\": \"'+tipoSolicitudNombre+'\"}}}';\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n },\ndataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ncontentType: \"application/json; charset=utf-8\",\ndata: jira,\n\nsuccess: function (result){\nvar issueKey=\"\";\nvar urlS=\"\";\njQuery.each(result, function(key, value){\nconsole.log(key, value);\n\nif (key==\"key\"){\nissueKey=value;\nurlS=linkPortal+\"/\"+value;\nvar formdata = new FormData();\nformdata.append('task',\"C:\\\\bot\\\\salida.csv\");\nvar data = new FormData();\n/*jQuery.each(jQuery('#adjunto')[0].files, function(i, file) {\ndata.append('file-'+i, file);\nconsole.log('f'+file)\n});*/\n\n/*esto sirve\nif(jQuery(\"#adjunto\")[0].files.length>0){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[0]);\n}\n FIN esto sirve*/\nvar contAtt;\nfor (contAtt=0;contAtt<jQuery(\"#adjunto\")[0].files.length;contAtt++){\ndata.append(\"file\",jQuery(\"#adjunto\")[0].files[contAtt]);\n}\n\njQuery.support.cors = true;\nvar datastring = new FormData(jQuery(\"#ppform\")[0]);\nif( document.getElementById(\"adjunto\").files.length == 0 ){\n //alert(\"no files selected\");\n}\njQuery.ajax({\ntype: \"POST\",\nurl: urlBase+\"/rest/api/2/issue/\"+value+\"/attachments\",\nbeforeSend: function (xhr) {\n xhr.setRequestHeader (\"Authorization\", BASIC_AUTH);\n},\n//dataType: \"JSON\",\nusername: usuario,\npassword: contrasena,\ndata: data,\ncontentType: false,\nprocessData: false,\ncache: false,\nheaders: {\n\"X-Atlassian-Token\": \"nocheck\"\n},\n//contentType: \"multipart/form-data\",\nsuccess: function (result){\nconsole.log(\"result\"+result);\n}\n});\n}\n\n});\n\njQuery('.aui-page-panel-content').empty();\nvar formResponse=\"\";\nformResponse=formResponse+\"<div style='float:right;width:80%'><div class='card text-white bg-primary mb-3' style='max-width: 50rem;'>\";\nformResponse=formResponse+\"<div class='card-header'><p class='texto32 textoBlancoBold'>SOLICITUD CREADA</p></div>\";\nformResponse=formResponse+\"<div class='card-body'>\";\nformResponse=formResponse+\"<p class='textoBlancoLight texto32'>Señor(a) \"+nombre+\", su solicitud ha sido creada y desde ya estamos trabajando para atenderla.<br><br><br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19' style='text-align: justify; text-justify: inter-word;'>Reciba un cordial saludo de parte de Zúrich Colombia Seguros S.A., notificamos el recibido de su solicitud con número de radicado <b>\"+issueKey+\"</b>.Dicha solicitud ya se encuentra en proceso de gestión y prontamente tendrá asignado su respectivo analista. Por el mismo correo que hizo la solicitud se le notificara la respuesta una vez finalice la gestión por parte de la persona encargada.\";\n \n \nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>Gracias por contactarnos<br></p>\";\nformResponse=formResponse+\"<p class='card-text textoBlanco texto19'><br>ATT<br></p>\";\nformResponse=formResponse+\"<span class='card-text textoBlanco texto19 '> Equipo de atención a los usuarios Zurich</span><br><br>\";\n \nformResponse=formResponse+\"</div>\";\nformResponse=formResponse+\"</div></div>\";\n\n\njQuery('.aui-page-panel-content').prepend(formResponse);\nwindow.scrollTo(0, 0);\n},\nerror: function(xhr,status,data){jQuery(\"#yyy\").hide();\njQuery(\"#zzz\").show();\njQuery(\"#zzz\").html(\"Lo sentimos, no fue posible guardar la solicitud<br>\"+xhr.responseText);\n}\n\n});\n}\n});\n}\n});\n\n}\n//*************************************************//\n// //\n//----CARGA DE CAMPOS Y FORMULARIO INFORMACION----//\n// //\n//************************************************//\n\n\n\n\n\n\n\nconsole.log( \"ready!\" );\n\n\nvar textoPPL =\"<div id='menuContextual' class='text-center'><div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-light p-1 '><div class='card-body paddingOP'><div class='row'><div class='col-sm'><p class='textoAzul texto24 text-center'>Selecciona una de las siguientes categorías</p></div></div></div><div class='row text-center'>\";\nvar textoInfo =\"<div id='formInfo' class='text-center'></div>\";\n/*Inicio tipos de incidencia*/\n/*Enlace a Reclamo siniestros*/\ntextoPPL =textoPPL+\"<div class='col-sm paddingBox'><div class='card rounded-medio text-white bg-primary mb-3' ><div class='card-body'><a href='\"+linkInfoGeneral+\"' style='padding-top:10px' class='btn btn-primary stretched-link'><p class='lineH20 textoBlancoLight texto16'>Información general</p></a></div></div></div>\";\n\n/*Enlace a Reclamo siniestros*/\ntextoPPL =textoPPL+\"<div class='col-sm paddingBox'><div class='card rounded-medio text-white bg-primary mb-3' ><div class='card-body'><a href='\"+linkDerechos+\"' style='padding-top:10px' class='btn btn-primary stretched-link'><p class='lineH20 textoBlancoLight texto16'>Productos y pólizas</p></a></div></div></div>\";\n/*Enlace a Reclamo siniestros*/\ntextoPPL =textoPPL+\"<div class='col-sm paddingBox'><div class='card rounded-medio text-white bg-primary mb-3' ><div class='card-body'><a href='\"+linkGestion+\"' style='padding-top:1px' class='btn btn-primary stretched-link'><p class='lineH20 textoBlancoLight texto16'>Gestión financiera y contable</p> </a></div></div></div>\";\n/*Enlace a Reclamo siniestros*/\ntextoPPL =textoPPL+\"<div class='col-sm paddingBox'><div class='card rounded-medio text-white bg-primary mb-3' ><div class='card-body'><a href='\"+linkHabeas+\"' style='padding-top:10px' class='btn btn-primary stretched-link'><p class='lineH20 textoBlancoLight texto16'>Habeas data</p></a></div></div></div>\";\n/*Enlace a Reclamo siniestros*/\ntextoPPL =textoPPL+\"<div class='col-sm paddingBox'><div class='card rounded-medio text-white bg-primary mb-3' ><div class='card-body'><a href='\"+linkCertificados+\"' style='padding-top:25px' class='btn btn-primary stretched-link'><p class='lineH20 textoBlancoLight texto16'>Certificados</p></a></div></div></div>\";\n\ntextoPPL =textoPPL+\"</div></div></div></div></div>\";\nvar textoPPL2 =\"<div id='menuContextual2' class='text-center'><div class='row'><div class='col-sm'><div id='isuuesP' class='card bg-light p-1 '><div class='card-body paddingOP'><div class='row'><div class='col-sm'><p class='textoAzul texto24 text-center'>¿Qué te gustaría dejarnos?</p></div></div></div><div class='row text-center'>\";\ntextoPPL2 =textoPPL2+\"<div class='col-sm paddingBox2'></div>\";\n\n/*Enlace a Reclamo siniestros*/\ntextoPPL2 =textoPPL2+\"<div class='col-sm paddingBox2'><a role='button' class='btnSug btn btn-primary ' href='\"+linkSugerencias+\"'><p class='texto13 noMargin textoBlanco'>Una sugerencia</p></a><br><br><br><br></div>\";\ntextoPPL2 =textoPPL2+\"<div class='col-sm paddingBox2'><a role='button' class='btnSug btn btn-primary ' href='\"+linkQueja+\"'><p class='texto13 noMargin textoBlanco'>Una queja</p></a><br><br><br><br></div>\";\n/*Enlace a Reclamo siniestros*/\ntextoPPL2 =textoPPL2+\"<div class='col-sm paddingBox2'></div>\";\n/*Enlace a Reclamo siniestros*/\n\n\ntextoPPL2 =textoPPL2+\"</div></div></div></div></div>\";\nvar textoFooter =\"<div class='container-fluid'>\";\ntextoFooter =textoFooter+\"<div class='container'>\";\ntextoFooter =textoFooter+\"<div id='customFooter>'<div class='row'><div class='col-sm'><p class='textoAzul texto24 text-center'>Accesos rápidos a otros enlaces<br><br></p></div></div><div class='row'>\";\n\ntextoFooter =textoFooter+\"</div>\";\n/*Inicio externos*/\ntextoFooter =textoFooter+\"<div class='row text-center'>\";\n/*Link externo 1*/\n\ntextoFooter =textoFooter+\"<div class='border-right-0 col-sm text-left' ></div>\";\ntextoFooter =textoFooter+\"<div class='border-right-0 col-sm text-left'> <a id='linkConsultarDinamico' class='texto20 textoAzulBold' href='#'><p class='texto20 lineH20 textoAzulBold'>Crear solicitud</p></a>\";\ntextoFooter =textoFooter+\"</div><div class='vl'></div>\";\n/*Link externo 2*/\n//textoFooter =textoFooter+\"<div class='border-right-0 col-sm text-left' ></div>\";\ntextoFooter =textoFooter+\"<div class=' border-top-0 col-sm- text-left'><a class='text-primary' href='\"+linkPortal+\"'><p class='texto20 lineH20 textoAzulBold'>Información <br>y solicitudes<br></p></a>\";\ntextoFooter =textoFooter+\"<a class='' href='\"+linkInfoGeneral+\"'><p class='texto14 textoAzul linkFo'>Información general</p></a>\";\ntextoFooter =textoFooter+\"<a class='' href='\"+linkDerechos+\"'><p class='texto14 textoAzul linkFo'>Productos y pólizas</p></a>\";\ntextoFooter =textoFooter+\"<a class='' href='\"+linkGestion+\"'><p class='texto14 textoAzul linkFo'>Gestión financiera y contable</p></a>\";\ntextoFooter =textoFooter+\"<a class='' href='\"+linkHabeas+\"'><p class='texto14 textoAzul linkFo'>Habeas data</p></a>\";\ntextoFooter =textoFooter+\"<a class='' href='\"+linkCertificados+\"'><p class='texto14 textoAzul linkFo'>Certificados</p></a>\";\ntextoFooter =textoFooter+\"<a class='' href='\"+linkDerechosPeticion+\"'><p class='texto14 textoAzul linkFo'>Derechos de petición</p></a>\";\ntextoFooter =textoFooter+\"</div>\";\n//textoFooter =textoFooter+\"<div class=' border-right-0 col-sm text-left' ></div>\";\ntextoFooter =textoFooter+\"<div class='v2'></div>\";\n//Link externo 3\ntextoFooter =textoFooter+\"<div class='col-sm text-left'><a class='' href='\"+linkQuejaSugerencia+\"'><p class='texto20 lineH20 textoAzulBold'>Quejas y sugerencias<br><br><br></p></a>\";\n//textoFooter =textoFooter+\"<a class='text-primary' href=''><p class='h6'>Personas</p></a>\";\n//textoFooter =textoFooter+\"<a class='text-primary' href=''><p class='h6'>Intermediarios</p></a>\";\n//textoFooter =textoFooter+\"<a class='text-primary' href=''><p class='h6'>Proveedores</p></a>\";\ntextoFooter =textoFooter+\"</div>\";\ntextoFooter =textoFooter+\"<div class=' col-sm text-left'></div>\";\n//Link externo 4\n/*\ntextoFooter =textoFooter+\"<div class=' col-sm text-left'><a class='text-primary' href=''><p class='h5'>Quejas <br><br><br></p></a>\";\ntextoFooter =textoFooter+\"<a class='text-primary' href=''><p class='h6'>Radicar una queja</p></a>\";\ntextoFooter =textoFooter+\"<a class='text-primary' href=''><p class='h6'>Quejas defensor del consumidor</p></a>\";\ntextoFooter =textoFooter+\"<a class='text-primary' href=''><p class='h6'>Derechos de petición</p></a>\";\ntextoFooter =textoFooter+\"</div>\";\n//Link externo 5\ntextoFooter =textoFooter+\"<div class='col-sm text-left'><a class='text-primary' href=''><p class='h5'>Siniestros <br><br><br></p></a>\";\ntextoFooter =textoFooter+\"<a class='text-primary' href=''><p class='h6'>Radicar</p></a>\";\ntextoFooter =textoFooter+\"<a class='text-primary' href=''><p class='h6'>Consultar / Adjuntar</p></a>\";\ntextoFooter =textoFooter+\"</div>\";\n*/\n/*Fin externos*/\ntextoFooter =textoFooter+\"</div>\";\ntextoFooter = textoFooter+\"<div class='text-center'><br><br><img src='\"+logo+\"' width='120px' height='auto' class='img-fluid text-center' alt='Logo'><br><br><a href='\"+urlPortalZurich+\"' style='width:226px;height:50px' class='btn btn-warning text-white btn-sm' role='button'> <span class='align-middle textoBlancoBold' style='position: relative;top: 6px;'>Regresar a la pagina principal</span></a></div>\";\ntextoFooter =textoFooter+\"</div>\";\ntextoFooter =textoFooter+\"</div>\";\ntextoFooter =textoFooter+\"</div>\";\nvar textoHeader =\"\";\ntextoHeader = textoHeader+\"<br><div class='row '><div class='col-sm-1'></div><div class='col-sm-1'><img src='\"+logo+\"' width='150px' height='auto' class='img-fluid text-center' alt='Logo'></div><div class='col-md-7 '></div><div class='col-sm-2'></div><div class='col-sm-1'></div></div>\";\ntextoHeader = textoHeader+\"<div class='row '><div class='col-sm-1'></div><div class='col-sm-1'></div><div class='col-md-7 '></div><div class='col-sm-2'><a href='\"+urlPortalZurich+\"' style='width:226px;height:50px;position: relative; right: 29px;' class='btn btn-warning text-white btn-sm' role='button'> <span class='align-middle textoBlancoBold' style='position: relative;top: 6px;'>Regresar a la pagina principal</span><div class='triangle-down'></div></a></div><div class='col-sm-1'></div></div>\";\ntextoHeader = textoHeader+\"<div class='row '><div class='col-md-11'><hr class='hr-primary'/></div> <div class='col-sm-1'></div></div>\";\n\nvar textoBarra=\"\";\ntextoBarra=textoBarra+\"<div id='divBarra'><p class='text-center '><small class='textoAzul texto16'>Esta suele ser la forma mas rápida de obtener lo que buscas</small></p></div>\";\n\nvar textoBarraAntes=\"\";\n\n\nvar textoInformativoGeneral=\"\";\n\n\nvar htmlFooter = jQuery('#footer').html();\n//FASE1 @comment\njQuery('.aui-page-panel').prepend(textoHeader);\njQuery('#footer').empty();\njQuery('#footer').append(htmlFooter);\njQuery('#footer').prepend(textoFooter);\n//jQuery('.cv-smart-portal-container').empty();\n//FIN FASE1 @comment\njQuery(\"#logo\").html(\"\");\njQuery('#user-options').html('<a class=\"aui-nav-link login-link\" href=\"/servicedesk/customer/user/login\">Ingresar</a>');\n\njQuery(\".cv-customize-theme-actions\").html(\"\");\n//jQuery('.cv-global-level-header').empty();\n\n//Jtext de búsqueda\n\n/*\nvar htmlConf = jQuery('.cv-smart-portal-input-container').html();\n\njQuery(\".cv-smart-portal-search-input\").attr(\"placeholder\", \"¿Qué duda tienes?\");\njQuery(\".cv-smart-portal-search-help\").text(\"Ayuda de búsqueda\");\njQuery(\".cv-smart-portal-search-help\").append(\"<br>\");\n*/\n\nif(URLactual==paginaPPL || URLactual.toString().indexOf(paginaPPL+\"?\"+query)>-1){\n//FASE1 @comment\ntextoInformativoGeneral=textoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Información y solicitudes<br></p><p class='texto16 textoAzul'>Queremos que encuentres facilmente lo que estas buscando, por eso hemos creado este espacio de soporte que te permitirá <br> en pocos clics hacernos saber tu necesidad para atenderla en el menor tiempo posible.<br> A continuación encuentras varias maneras de hacerlo</p>\";\njQuery('.cv-smart-portal-container').append(textoPPL);\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\n\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\n\njQuery('#cv-request-content').empty();\njQuery('.cv-page-title-main-rectangle').empty();\n//FIN FASE1 @comment\nwindow.scrollTo(0, 0);\n}\nelse{\nquery=\"&\"+query;\n}\nif(URLactual==linkQuejaSugerencia){\n//FASE1 @comment\ntextoInformativoGeneral=textoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Quejas y sugerencias<br></p><p class='texto16 textoAzul'>¡De antemano gracias!<br>Aunque nos esforzamos día a día para darte un excelente servicio, sabemos que siempre habrán cosas por perfecionar.<br>Recibiremos con atención tus comentarios, pues para nosotros sobre todo son grandes oportunidades de mejora.</p>\";\n\n\njQuery('.cv-smart-portal-container').append(textoPPL2);\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\n\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-smart-portal-search-input-container').hide();\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\n\njQuery('#cv-request-content').empty();\njQuery('.cv-page-title-main-rectangle').empty();\n//FIN FASE1 @comment\nwindow.scrollTo(0, 0);\n}\n\nif(URLactual==linkInfoGeneral || URLactual.toString().indexOf(linkInfoGeneral+query)>-1){\ntextoInformativoGeneral=textoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Información general<br></p>\";\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\njQuery('.cv-smart-portal-container').append(textoInfo);\njQuery('.cv-page-title-main-rectangle').empty();\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\nwindow.scrollTo(0, 0);\n}\nif(URLactual==linkSugerencias || URLactual.toString().indexOf(linkSugerencias+query)>-1){\ntextoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Sugerencias<br></p>\";\ntextoInformativoGeneral=textoInformativoGeneral+\"<p class='texto16 textoAzul'>¡De antemano gracias!<br>Aunque nos esforzamos día a día para darte un excelente servicio, sabemos que siempre habrán cosas por perfecionar.<br>Recibiremos con atención tus comentarios, pues para nosotros sobre todo son grandes oportunidades de mejora.<br></p>\";\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\njQuery('.cv-smart-portal-container').append(textoInfo);\njQuery('.cv-page-title-main-rectangle').empty();\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\nwindow.scrollTo(0, 0);\n}\nif(URLactual==linkQueja || URLactual.toString().indexOf(linkQueja+query)>-1){\ntextoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Queja<br></p>\";\ntextoInformativoGeneral=textoInformativoGeneral+\"<p class='texto16 textoAzul'>¡De antemano gracias!<br>Aunque nos esforzamos día a día para darte un excelente servicio, sabemos que siempre habrán cosas por perfecionar.<br>Recibiremos con atención tus comentarios, pues para nosotros sobre todo son grandes oportunidades de mejora.<br></p>\";\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\njQuery('.cv-smart-portal-container').append(textoInfo);\njQuery('.cv-page-title-main-rectangle').empty();\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\nwindow.scrollTo(0, 0);\n}\n\nif(URLactual==linkDerechos || URLactual.toString().indexOf(linkDerechos+query)>-1){\ntextoInformativoGeneral=textoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Productos y pólizas<br></p>\";\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\njQuery('.cv-smart-portal-container').append(textoInfo);\njQuery('.cv-page-title-main-rectangle').empty();\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\nwindow.scrollTo(0, 0);\n}\nif(URLactual==linkGestion || URLactual.toString().indexOf(linkGestion+query)>-1){\ntextoInformativoGeneral=textoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Gestión Financiera y Contable<br></p>\";\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\njQuery('.cv-smart-portal-container').append(textoInfo);\njQuery('.cv-page-title-main-rectangle').empty();\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\nwindow.scrollTo(0, 0);\n}\nif(URLactual==linkHabeas || URLactual.toString().indexOf(linkHabeas+query)>-1){\ntextoInformativoGeneral=textoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Habeas Data<br></p>\";\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\njQuery('.cv-smart-portal-container').append(textoInfo);\njQuery('.cv-page-title-main-rectangle').empty();\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\nwindow.scrollTo(0, 0);\n}\nif(URLactual==linkCertificados || URLactual.toString().indexOf(linkCertificados+query)>-1){\ntextoInformativoGeneral=textoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Certificados<br></p>\";\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\njQuery('.cv-smart-portal-container').append(textoInfo);\njQuery('.cv-page-title-main-rectangle').empty();\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\nwindow.scrollTo(0, 0);\n}\nif(URLactual==linkDerechosPeticion || URLactual.toString().indexOf(linkDerechosPeticion+query)>-1){\ntextoInformativoGeneral=textoInformativoGeneral=\"<p class='texto32 textoAzulLight'>Derechos de petición<br></p>\";\ntextoBarraAntes=textoBarraAntes+\"<div id='divBarraAntes'><p class='text-center textoAzul texto17'><br><br>Resuelve tus inquietudes con la sección de <a href = https://www.zurichseguros.com.co/es-co/contactenos/preguntas-frecuentes target=_blank rel=noopener noreferrer> preguntas frecuentes.</a><br><br></p></div>\";\njQuery('.cv-smart-portal-container').append(textoInfo);\njQuery('.cv-page-title-main-rectangle').empty();\n//jQuery('.cv-smart-portal-input-help-container').prepend(textoBarra);\njQuery('.cv-smart-portal-search-input-container').prepend(textoBarraAntes);\njQuery('.cv-description').empty();\njQuery('.cv-description').prepend(textoInformativoGeneral);\nwindow.scrollTo(0, 0);\n}\n//jQuery('.cv-smart-portal-container').prepend(htmlConf);\n\nvar formInput = jQuery('.cv-request-create-container').html();\n//jQuery('.cv-request-create-container').empty();\nvar forInputFinal = \"<div class='card text-white bg-primary mb-3' style='max-width: 59rem;'><div class='card-body'>\"+formInput+\"</div></div></div>\";\n//jQuery('.cv-request-create-container').append(forInputFinal);\n\n\n//Siniestros\n \n\n\n\nif(URLactual==linkOtrasSolicitudes){\nvar valorToten=jQuery(\"input[name=atl_token]\").val();\n//jQuery('.aui-page-panel-content').empty();\nvar formOtras=\"\";\nformOtras=formOtras+\"<div class='cv-request-create-container sd-adgs-feature-flag-m1'>\";\nformOtras=formOtras+\"<form action='' method='post' class='aui vp-form top-label vp-request-form'>\";\nformOtras=formOtras+\"<input type='hidden' value='\"+valorToten+\"' name='atl_token'>\";\nformOtras=formOtras+\"<input type='hidden' value='10000' name='projectId'>\";\nformOtras=formOtras+\"<div class='field-group field-separator'><label class='field-label' for='reporter'>Generar esta solicitud en nombre de</label><div class='field-container'><sd-user-picker data-field-id='reporter' data-value='admin' data-default='{"id":"admin","emailAddress":"admin@test.com","displayName":"admin","avatar":"http://172.22.6.62:8080/rest/servicedesk/1/servicedesk/customer/avatar/10341?size\\u003dxsmall"}' data-project-id='10000' data-field-config-id='' data-allow-clear='false' data-allow-signup='true' data-can-submit-email='true' resolved=''><div class='select2-container reporter-container' id='s2id_reporter' style='width: 100%;'><a href='javascript:void(0)' class='select2-choice' tabindex='-1'> <span class='select2-chosen' id='select2-chosen-1'><img src='\"+urlBase+\"/rest/servicedesk/1/servicedesk/customer/avatar/10341?size=xsmall' class='user-picker-avatar aui-avatar-xsmall'>admin</span><abbr class='select2-search-choice-close'></abbr> <span class='select2-arrow' role='presentation'><b role='presentation'></b></span></a><label for='s2id_autogen1' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre deGenerar esta solicitud en nombre de</label><input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' aria-labelledby='select2-chosen-1' id='s2id_autogen1'><div class='select2-drop select2-display-none select2-with-searchbox'> <div class='select2-search'> <label for='s2id_autogen1_search' class='select2-offscreen'>Generar esta solicitud en nombre deGenerar esta solicitud en nombre deGenerar esta solicitud en nombre deGenerar esta solicitud en nombre deGenerar esta solicitud en nombre deGenerar esta solicitud en nombre de</label> <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true' aria-autocomplete='list' aria-owns='select2-results-1' id='s2id_autogen1_search' placeholder=''> </div> <ul class='select2-results' role='listbox' id='select2-results-1'> </ul></div></div><input type='hidden' name='reporter' id='reporter' tabindex='-1' title='Generar esta solicitud en nombre deGenerar esta solicitud en nombre deGenerar esta solicitud en nombre de' value='admin' style='display: none;'></sd-user-picker></div></div>\";\nformOtras=formOtras+\"<div class='field-container'><div class='field-group'>\";\nformOtras=formOtras+\"<input type='text' id='summary' name='summary' class='form-control' id='formGroupExampleInput' placeholder='Resumen aca'></div></div>\";\n\nformOtras=formOtras+\"<div class='buttons-container'><div class='buttons'>\";\nformOtras=formOtras+\"<button class='aui-button aui-button-primary' type='submit' resolved=''>Crear</button>\";\nformOtras=formOtras+\"<button class='aui-button aui-button-link trigger-smart-cancel' resolved=''>Cancelar</button>\";\nformOtras=formOtras+\"<div class='cv-sd-status js-status'></div></div></div></form>\";\nformOtras=formOtras+\"</div><div id='XXX'>wqeqweeqwewsr</div>\";\n\n//jQuery('.aui-page-panel-content').append(formOtras);\n}\n jQuery(\"#linkConsultarDinamico\").on(\"click\",function(event) {\n\nevent.preventDefault();\nif ( jQuery( \"#user-options\" ).length ) {\n \n window.location.href = linkConsultar;\n \n}\nelse{\n \n window.location.href = linkConsultar2;\n}\n\n\n\n });\n\n});\n\n</script>\n<!-- End Global CSS & JS for Jira, JS section-->\n </div>\n</html>"}],"pagePanels":{}}}
{"tourEnabled":false,"wacLink":"https://www.atlassian.com/software/jira/service-desk/powered-by?utm_medium=jira-in-product&utm_source=jira_service_desk_portal_footer&utm_campaign=service-desk_portal_server","serviceDeskVersion":"4.5.9","contextPath":"","xsrfToken":"B7HP-RVU7-8F2E-SJ3U_8e770f9c2cd7e6d283fb364ae95e2a5ab2203519_lin","baseUrl":"https://jira.zurichseguros.com.co/servicedesk/customer","relativeBaseUrl":"/servicedesk/customer","customerLoginEnabled":true,"maxAttachmentSize":"47185920","gravatarEnabled":true,"calendarDateData":{"months":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],"monthsShort":["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],"weekdaysShort":["dom","lun","mar","mié","jue","vie","sáb"],"weekdays":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]}}