Licitator 1.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

95 lines
5.7 KiB

{# sin dependencias #}
{% set tareaanterior=null %}
{% set tareacurrent=tarea[0] %}
{% set tareas=tarea[0].getProcesosId.getTarea|sort((a, b) => a.position <=> b.position) %}
{% for tareadep in tareas %}
{% if not tareadep.invisible %}
{% for tusuario in tareadep.getTareaUsuario %}
{% if tusuario.greenEntrepreneur.id==app.user.id or (ge is defined and tusuario.greenEntrepreneur.id==ge.id) %}
{% if tusuario.completada==true %}
{% if tareadep.position < tareacurrent.position %}
{% set tareaanterior=tareadep %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% else %}
{% if tarea[0].alias starts with 'exercise14'%}
{% if tareadep.position < tareacurrent.position %}
{% set tareaanterior=tareadep %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
<div class="exercise-btn-moves-group">
<a class="btn btn-up" href="#"><i class="fa fa-arrow-up"></i></a>
{% if tareaanterior is defined and tareaanterior is not null %}
{% if tareaanterior.position < tarea[0].position %}
{% if getvars.modal is defined and getvars.modal==1 %}
{% if app.user.getType == 'green_entrepreneur' and getvars.modal is not defined %}
<a class="btn btn-prev" href="{{ path('admin.procesos.realizartarea',{'id':tareaanterior.id}) }}">{{'Previous'|trans({})}}</a>
{% endif %}
{% else %}<span></span>
{%endif%}
{% if getvars.modal is defined and getvars.modal==1 %}
<input type="hidden" id='modal{{tarea[0]}}' name='modal' value='1'></>
{% endif%}
<script>
$('.btn.btn-prev').on('click', function(e){
e.preventDefault();
Swal.fire({
title: 'Are you sure to go previous step without save?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, I´m not interested in save!'
}).then((result) => {
if (result.value) {
{% if tarea[0].alias starts with 'exercise14' %}
{% if app.user.getType == 'trainer' %}
window.location.href = "{{ path('admin.procesos.comentar',{'id':tareaanterior.id, 'user': ge.id}) }}{% if getvars.modal is defined and getvars.modal==1 %}?modal=1{%endif%}";
{% else %}
window.location.href = "{{ path('admin.procesos.realizartarea',{'id':tareaanterior.id}) }}";
{% endif %}
{% else %}
{% if app.user.getType == 'trainer' %}
window.location.href = "{{ path('admin.procesos.comentar',{'id':tareaanterior.id, 'user': ge.id}) }}{% if getvars.modal is defined and getvars.modal==1 %}?modal=1{%endif%}";
{% else %}
window.location.href = "{{ path('admin.procesos.realizartarea',{'id':tareaanterior.id}) }}";
{% endif %}
{% endif %}
}
});
})</script>
{% else %}
<a class="btn btn-prev ocultar" href=""></a>
{% endif %}
{% else %}
<a class="btn btn-prev ocultar" href=""></a>
{% endif %}
<span class="mensaje"></span>
{% if app.user.getType == 'trainer' %}
<a id="save" class="btn btn-save" href="#" onclick="$('#wizard').parsley().validate();if($('#wizard').parsley().isValid())$.ajax({ type: 'POST', url: '{{ path('api_app_api_guardartareaapi_savetask', {'id': tarea[0].id})}}', data: $('form').serialize(), cache: false,}).done(function() {$('.exercise-btn-moves-group .mensaje').text('Saving...');window.setTimeout(function(){$('.exercise-btn-moves-group .mensaje').text('Changes saved');}, 1000);}).fail(function() {$('.exercise-btn-moves-group .mensaje').text('Saving...');window.setTimeout(function(){$('.exercise-btn-moves-group .mensaje').text('Error saving changes');}, 1000);});">{{'Save'|trans({})}}</a>
{% else %}
<a id="save" class="btn btn-save" href="#" onclick="$('#wizard').parsley().validate();if($('#wizard').parsley().isValid())$.ajax({ type: 'POST', url: '{{ path('api_app_api_guardartareaapi_savetask', {'id': tarea[0].id})}}', data: $('form').serialize(), cache: false,}).done(function() {$('.exercise-btn-moves-group .mensaje').text('Saving...');window.setTimeout(function(){$('.exercise-btn-moves-group .mensaje').text('Changes saved');}, 1000);}).fail(function() {$('.exercise-btn-moves-group .mensaje').text('Saving...');window.setTimeout(function(){$('.exercise-btn-moves-group .mensaje').text('Error saving changes');}, 1000);});">{{'Save'|trans({})}}</a>
{% if tarea[0].alias=='exercise12n' and getvars.modal is not defined %}
<a class="btn btn-next" href="#" onclick=" $('.tab-content>div').each(function() {
$(this).find('.ex12n_customers textarea').text($(this)[0].closest('section.body').id);
});$('#wizard').submit()">{{'Next'|trans({})}}</a>
{% elseif getvars.modal is not defined %}
<a class="btn btn-next" href="#" onclick="$('#wizard').submit()">{{'Next'|trans({})}}</a>
{% endif %}
{% endif %}
</div>