Changeset b84cfca in firmaeventos for static


Ignore:
Timestamp:
Nov 21, 2017, 4:02:33 PM (7 years ago)
Author:
rudmanmrrod <rudman22@…>
Branches:
master
Children:
9add819
Parents:
4db73c3
Message:

Agregada cabecera y foote, y iframe para el pdf

Location:
static
Files:
2 added
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • static/js/MultipleSign.js

    r4db73c3 rb84cfca  
    1 
    2 
    3 
    4 function True_FalseMultiples(data){
    5 
    6     if (data == "true" ){
    7       return "Verdadero";
    8     }
    9     if (data ==  "false"){
    10       return "Falso";
    11     }
    12 
    13 }
    14 
    15 function SerealizeMyJsonMultiples(data){
    16   for (var i = 0; i < data.signatures.length; i++) {
    17       data.signatures[i].integrityCheck = True_FalseMultiples(data.signatures[i].integrityCheck);
    18       data.signatures[i].signerCertificateStillValid = True_FalseMultiples(data.signatures[i].signerCertificateStillValid);
    19       data.signatures[i].signerCertificateValidAtTimeOfSigning = True_FalseMultiples(data.signatures[i].signerCertificateValidAtTimeOfSigning);
    20       data.signatures[i].signatureCoversWholeDocument = True_FalseMultiples(data.signatures[i].signatureCoversWholeDocument);
    21       data.signatures[i].certificatesVerifiedAgainstTheKeyStore = True_FalseMultiples(data.signatures[i].certificatesVerifiedAgainstTheKeyStore);         
    22   }
    23   return data;
    24 }
    25 
    26 
    27 //Obtenemos la  informacion de documento
    28 function InfoDocumentDataTablePDFMultiples(signedFileId){
    29 
    30     $.ajax({
    31         //url: "https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/"+signedFileId,
    32         url: "https://192.168.12.154:8443/Murachi/0.1/archivos/"+signedFileId,
    33         type: "get",
    34         dataType: "json",       
    35         headers: {"Authorization":"Basic YWRtaW46YWRtaW4="},
    36         success: function(response) {
    37            
    38                        
    39                 INFO_DATATABLE_MULTIPLES = SerealizeMyJsonMultiples(response);
    40                        
    41                         CONT_MULTIPLES += 1;
    42                         if (CONT_MULTIPLES == 1){
    43                                 DATATABLE_SIGN_MULTIPLES = DataTablePDFMultiples(response);     
    44 
    45                         }
    46                         if (CONT_MULTIPLES > 1){
    47                                 DATATABLE_SIGN_MULTIPLES.destroy();
    48                                 DATATABLE_SIGN_MULTIPLES = DataTablePDFMultiples(response);     
    49                         }       
    50 
    51 
    52                         $("#Cuerpo_Sign").hide();
    53                         $("#Cuerpo_check").hide();
    54                         $("#well_mensaje").hide();
    55                         $("#button_SignMultiples").hide();
    56                         $("#myJsonPDFMultiples_wrapper").show();       
    57                         ListarDocument()                               
    58 
    59 
    60                        
    61         },
    62         error: function(jqXHR, textStatus, errorThrown){
    63                 alert(textStatus+", "+ errorThrown+" el documento PDF para mostrar la info de la sign");     
    64         }
    65         });
    66 }
    67 
    68 
    691// Cuarto paso (Se envia la información del token para terminar la firma)
    702function FinalizarFirmaMultiples(signature){
     
    735                type: 'POST',
    746                contentType: 'application/json',
    75                 url:"https://192.168.12.154:8443/Murachi/0.1/archivos/pdfs/resenas",
    76                 //url:"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/pdfs/resenas",
     7                //url:"https://192.168.12.154:8443/Murachi/0.1/archivos/pdfs/resenas",
     8                url:"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/pdfs/resenas",
    779                dataType: 'json',
    7810                data: JSON.stringify({"signature":signature}),
     
    10436                type: 'POST',
    10537                contentType: 'application/json',                               
    106                 url:"https://192.168.12.154:8443/Murachi/0.1/archivos/pdfs2",
    107                 //url:"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/pdfs",
     38                //url:"https://192.168.12.154:8443/Murachi/0.1/archivos/pdfs2",
     39                url:"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/pdfs",
    10840                dataType: "json",
    10941                data: parameters,               
     
    12355                        },
    12456                        function(err) {
    125                                 log_text("sign() failed: " + err);
    12657                                        var error;
    127                     log_text("sign() failed: " + err);
    12858                    if(err == "Error: user_cancel") {
    129                         alert("sign() failed: El usuario cancelo la operación");
    13059                        error = "El usuario cancelo la operación";
    13160                     }     
    13261                     else if(err == "Error: no_certificates") {
    133                          alert("sign() failed: No hay certificado disponible");
    13462                         error = "No hay certificado disponible";
    13563                     }
    13664                     else if(err == "Error: no_implementation") {
    137                          alert("sign() failed: No hay soporte para el manejo del certificado");
    13865                         error = "No hay soporte para el manejo del certificado";
    13966                     }
    140 
    141                                 //alert("sign() failed: " + err);
    142                                 $("#respuesta").html("sign() failed: " + error);
     67                    simple_modal(error);
    14368                });
    14469                       
     
    16085
    16186        // identificador del archivo en el servidor
    162        
    163 
    16487        window.hwcrypto.getCertificate({lang: "en"}).then(
    16588                function(response) {
     
    17396                                "reason":"Certificado",
    17497                                "location":"CENDITEL",
    175                                 "contact":"582746574336",
     98                                "contact":"RedGealc",
    17699                                "signatureVisible":"false",
    177100                                "signaturePage": "",
     
    185108                },
    186109                function(err) {
    187                         log_text("getCertificate() failed: " + err);
    188110            var error;
    189111            if(err == "Error: user_cancel") {
    190                 alert("getCertificate() failed: El usuario cancelo la operación"    );
    191112                error = "El usuario cancelo la operación";
    192113             }     
    193114             else if(err == "Error: no_certificates") {
    194                  alert("getCertificate() failed: No hay certificado disponible")    ;
    195115                 error = "No hay certificado disponible";
    196116             }
    197117             else if(err == "Error: no_implementation") {
    198                  alert("getCertificate() failed: No hay soporte para el manejo del certificado");
    199118                 error = "No hay soporte para el manejo del certificado";
    200119                        }
    201                         //alert("getCertificate() failed: " + err);
    202                         $("#respuesta").html("getCertificate() failed: " + error);
     120            simple_modal(error);
    203121                }
    204122
     
    206124}
    207125
    208 
    209 function ListarDocument(){
    210 
    211 
    212         $.ajax({
    213                 type: 'POST',
    214                 contentType: 'application/json',
    215                 url:"https://192.168.12.154:8443/Murachi/0.1/archivos/listado",
    216                 //url:"https://murachi.cenditel.gob.ve/Murachi/0.1/archivos/pdfs/resenas",
    217         type: "get",
    218         dataType: "json",       
    219         headers: {"Authorization":"Basic YWRtaW46YWRtaW4="},
    220                 success: function(response, textStatus, jqXHR){
    221 
    222                        
    223                         var options = "";
    224                         options += '<option value="-1"> Seleccionar </option>';                 
    225                         for (var i = 0; i < response.murachiWorkingDirectoryContent.length; i++)
    226                         {
    227                                 var data =  response.murachiWorkingDirectoryContent[i].split(".");
    228                                 if ( data.length > 1 && data[1] ==  "pdf"){
    229                                          options += '<option value="'+response.murachiWorkingDirectoryContent[i]+'" title ="'+response.murachiWorkingDirectoryContent[i]+'">' +response.murachiWorkingDirectoryContent[i] +'</option>';
    230                                 }
    231                         }
    232 
    233                         $('#listadoDocument').html(options);
    234                         $('#listadoDocument option:first').attr('selected', 'selected');
    235                         $("#SelectArchivos").show();
    236 
    237                 },
    238                 error: function(jqXHR, textStatus, errorThrown){
    239                         alert('error en pdfs/resenas: ' + textStatus);
    240                         $("#respuesta").html("error en pdfs/resenas: " + textStatus);
    241                 }
    242         });
    243 
    244 
    245 }
    246 
    247 
    248 $("#button_ListarMultiples").on('click', function() {   
    249         ListarDocument();
    250 });
    251 
    252 $("#listadoDocument").on('click', function() {
    253         var fileId = $("#listadoDocument").val();
    254 
    255         if (fileId != -1 ) {
    256                         $("#button_SignMultiples").show();
    257         }
    258         else{
    259                         $("#button_SignMultiples").hide();
    260         }
    261 
    262 
    263 
    264 });
    265 
    266 
    267 
    268 $("#Form_sign_multiples").on('submit', function(event) {
    269         event.preventDefault();
    270        
    271         var fileId = $("#listadoDocument").val();
    272 
    273         if (fileId != -1 ) {
    274                 ObtenerCertificadoFirmanteMultiples(fileId);
    275         }
    276         else{
    277                 alert("Debe selecionar un documeto");
    278         }
    279 
    280        
    281 });
    282 
  • static/js/funciones.js

    rae65f8e rb84cfca  
    5353                close:{
    5454                    text:'cerrar',
    55                     className:'red',
     55                    className:'blue',
    5656                }
    5757            }
     
    7272    html += '<li class="collection-item"><b>Correo: </b>'+data.correo+'</li>';
    7373    html += '</ul>';
     74    html += '<iframe width="700px" height="600px" src="https://192.168.12.154:8443/Murachi/0.1/archivos/listadopdf/cbcd0924-bbfe-49dc-afc8-f32348f20350.pdf">';
     75    html += '</iframe><br/>';
     76    html += '<a type="button" class="btn waves-effect blue darken-1" onclick="ObtenerCertificadoFirmanteMultiples(\''+data.documento+'\')">';
     77    html += '<i class="material-icons left">mode_edit</i> Firmar</a>';
    7478    $('#datos_paricipante').html(html);
    7579}
Note: See TracChangeset for help on using the changeset viewer.