| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- $('.richtext').richText();
- $('#modalArchivo').on('shown.bs.modal', function (event) { limpia(); });
- $('.nav-tabs a.eval').on('shown.bs.tab', function(){ $('#evalua').scrollTop(0); });
- $('#btnLimpiar').click(function (event) {
- limpia();
- $('#modalArchivo').modal('hide');
- });
- function abreModal(elem){
- var cid = $(elem).data('id');
- var etapa = $('#etapa').val();
- var tipo = 2;
- var evaluable = $(elem).data('tipo');
- $('#btnVotar').val(cid);
- var pag = 'califica';
- $.ajax({
- url: 'action/proyecto_action.php',
- type: 'POST',
- dataType: 'json',
- data: { id: cid, tipo: tipo, etapa: etapa, pag: pag },
- success: function(result) {
- if(result['error']!= '' && result['error'] !== undefined){
- $('#tabsContent').hide();
- $('#errorContent').show();
- $('#errorContent').children('div').children('div').children('div').children('div.msg').text(result['error']);
- }else{
- $('#modalArchivo a').removeClass('active');
- $('a[href="#iframeArchivo"]').addClass('active');
- $('.tab-pane').removeClass('active show');
- $('#iframeArchivo').addClass('active show');
- $('#iframeArchivo').attr('src', result['archivo']);
- $('#tabsContent').show();
- $('#errorContent').hide();
- if (evaluable == 1){
- $('.formaVoto').show();
- $('#msgVoto').hide();
- $.ajax({
- url: 'action/cuestionario_action.php',
- type: 'POST',
- dataType: 'json',
- data: { id: cid, tipo: tipo, etapa: etapa },
- success: function(result) {
- if(result['error']!= '' && result['error'] !== undefined){
- $('#msgTxtVoto').html(result['error']);
- $('#msgVotoIcon').removeClass().addClass('mb-2 ing-no-cargado');
- $('.formaVoto').hide();
- $('#msgVoto').show();
- }else{
- if (result['mensaje'] == 'ok'){
- $('.formaVoto').show();
- $('#msgVoto').hide();
- } else {
- $('#msgTxtVoto').html(result['mensaje']);
- $('#msgVotoIcon').removeClass().addClass('mb-2 ' + result['icono']);
- $('.formaVoto').hide();
- $('#msgVoto').show();
- }
- }
- },
- error: function(jqXHR, textStatus, errorThrown ){
- $('#msgTxtVoto').html('En este momento no es posible guardar tu revisión, inténtalo más tarde');
- $('#msgVotoIcon').removeClass().addClass('mb-2 ing-no-cargado');
- $('.formaVoto').hide();
- $('#msgVoto').show();
- }
- });
- } else {
- $('#msgTxtVoto').html('No tienes acceso a la revisión de éste proyecto.');
- $('#msgVotoIcon').removeClass().addClass('mb-2 ing-negar');
- $('.formaVoto').hide();
- $('#msgVoto').show();
- }
- }
- $('#modalArchivo').modal('show');
- },
- error: function(jqXHR, textStatus, errorThrown ){
- ejecuta = false;
- $('#tabsContent').hide();
- $('#errorContent').show();
- $('#errorContent').children('div').children('div').children('div').children('div.msg').text('No se puede mostrar la información en este momento');
- $('#modalCartel').modal('show');
- }
- });
- }
|