1$(document).on('click', '.js_llamar', function() { 2 $("#modal_llamar_target").val($(this).data('target')); 3 $("#modal_llamar_telefono").val($(this).data('telefono')); 4 $("#modal_llamar_padre").val($(this).data('padre')); 5 $("#modal_llamar").modal("show"); 6}); 7 8$(document).on('keyup', '#modal_llamar_telefono', function() { 9 let value = $(this).val(); 10 if(value.trim().length == 0) { 11 $("#modal_llamar_btnDoLlamada").prop("disabled", true); 12 } else { 13 $("#modal_llamar_btnDoLlamada").prop("disabled", false); 14 } 15}); 16 17$(document).on('click', '#modal_llamar_btnDoLlamada', function() { 18 let tlf = $('#modal_llamar_telefono').val(); 19 let res = _js_do_llamada(tlf); 20 if(res != 0) { 21 $("#modal_llamar_btnCancelar").prop("disabled", true); 22 $("#modal_llamar_btnGuardar").prop("disabled", false); 23 $("#modal_llamar_span_danger").removeClass("d-none"); 24 $("#modal_llamar_id_llamada").val(res); 25 } 26}); 27 28$(document).on('click', '#modal_llamar_btnGuardar', function() { 29 $("#modal_llamar_descripcion").removeClass("is-invalid"); 30 31 let target = $("#modal_llamar_target").val(); 32 let padre = $("#modal_llamar_padre").val(); 33 let id_llamada = $("#modal_llamar_id_llamada").val(); 34 let descripcion = $("#modal_llamar_descripcion").val(); 35 36 if(_js_www_comprobar_requeridos("_modal_llamar__body")) { 37 js_www_ajaxBasico('/llamadas/guardar-accion', 38 { 39 "accion" : descripcion, 40 "tipo" : 103, 41 "padre" : padre, 42 "referencia" : target, 43 "extra" : id_llamada 44 }, 45 (response) => { 46 let res = JSON.parse(response); 47 if(res.response === 'success') { 48 $("#modal_llamar").modal("hide"); 49 $("#modal_llamar_descripcion").val(''); 50 $("#modal_llamar_imputable_a").val(''); 51 $("#modal_llamar_btnGuardar").attr('disabled', true); 52 $("#modal_llamar_btnCancelar").attr('disabled', false); 53 } else { 54 js_sms_www_emergente("danger", "Error", res.message); 55 } 56 }, 57 () => { 58 js_sms_www_emergente("danger", "Error", "Error desconocido al guardar el comentario de la llamada."); 59 } 60 ) 61 } else { 62 $("#modal_llamar_descripcion").addClass("is-invalid"); 63 } 64}); 65 66$(document).on("click", "#modal_llamar_btnCancelar", function(){ 67 $("#modal_llamar_descripcion").val(''); 68 $("#modal_llamar_imputable_a").val(''); 69}); 70 71function _js_do_llamada(tlf) { 72 let id = 0; 73 js_www_ajaxBasico("/llamadas/do", { 74 'destino': tlf 75 }, 76 (response) => { 77 let res = JSON.parse(response); 78 if(res.response === 'success') { 79 id = res.obj['lla_Cuniqueid']; 80 } else { 81 js_sms_www_emergente("danger", "Error", res.message); 82 } 83 }, 84 () => { 85 js_sms_www_emergente("danger", "Error", "Error desconocido en la llamada."); 86 }, 87 '', 'POST', false 88 ) 89 return id; 90} 91 92$(document).on('change', '.js_select_llamar', function() { 93 let telefono = $(this).val(); 94 let id_input_llamar = $(this).data('id_input_llamar'); 95 $('#'+id_input_llamar).data('telefono', telefono); 96});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.