Add popup for admin_view - refs BT#9092

1.10.x
Daniel Barreto 10 years ago
parent 5292d8ee29
commit fb842ba570
  1. 1
      plugin/advancedsubscription/lang/english.php
  2. 1
      plugin/advancedsubscription/lang/spanish.php
  3. 82
      plugin/advancedsubscription/views/admin_view.tpl

@ -51,3 +51,4 @@ $strings['Postulant'] = 'Postulant';
$strings['InscriptionDate'] = 'Inscription date';
$strings['BossValidation'] = 'Boss validation';
$strings['Decision'] = 'Decision';
$strings['AdvancedSubscriptionAdminViewTitle'] = 'Subscription request confirmation result';

@ -57,3 +57,4 @@ $strings['Postulant'] = 'Postulante';
$strings['InscriptionDate'] = 'Fecha de inscripción';
$strings['BossValidation'] = 'Validación del superior';
$strings['Decision'] = 'Decisión';
$strings['AdvancedSubscriptionAdminViewTitle'] = 'Resultado de confirmación de solicitud de inscripción';

@ -47,6 +47,20 @@
vertical-align: middle;
text-align: center;
}
#modalMail{
width: 770px;
margin-top: -180px !important;
margin-left: -385px !important;
}
#modalMail .modal-body {
height: 360px;
overflow: visible;
}
#iframeAdvsub {
}
</style>
<form id="form_advsub_admin" class="form-search" method="post" action="/plugin/advancedsubscription/src/admin_view.php" name="form_advsub_admin">
@ -102,23 +116,13 @@
<td>{{ student.validation }}</td>
<td>
<a
class="btn btn-success"
onclick="javascript:if(
!confirm(
'¿Esta seguro de que desea aceptar la inscripción de {{ student.complete_name }}?'
)
) return false;"
class="btn btn-success btn-advsub btn-accept"
href="{{ student.acceptUrl }}"
>
Aceptar
</a>
<a
class="btn btn-danger"
onclick="javascript:if(
!confirm(
'¿Esta seguro de que desea rechazar la inscripción de {{ student.complete_name }}?'
)
) return false;"
class="btn btn-danger btn-advsub btn-reject"
href="{{ student.rejectUrl }}"
>
Rechazar
@ -139,8 +143,62 @@
<input name="f" value="social" type="hidden">
</form>
<div class="modal fade" id="modalMail" tabindex="-1" role="dialog" aria-labelledby="privacidadLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="privacidadLabel">{{ "AdvancedSubscriptionAdminViewTitle" | get_plugin_lang('AdvancedSubscriptionPlugin')}}</h4>
</div>
<div class="modal-body">
<iframe id="iframeAdvsub" style="width: 100%; height: 100%;" frameBorder="0">
</iframe>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Cerrar</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("#session-select").change(function () {
$("#form_advsub_admin").submit();
});
$("a.btn-advsub").click(function(event){
event.preventDefault();
var confirmed = false;
var studentName = $(this).closest("tr").find(".name").html();
if (studentName) {
studentName = "de " + studentName + " ?";
} else {
studentName = " ?"
}
if ($(this).hasClass('btn-accept')) {
var confirmed = confirm(
"¿Esta seguro de que desea aceptar la inscripción " + studentName
);
} else {
var confirmed = confirm(
"¿Esta seguro de que desea aceptar la inscripción " + studentName
);
}
if (confirmed) {
var thisBlock = $(this).closest("tr");
var advsubUrl = $(this).attr("href")
$("#iframeAdvsub").attr("src", advsubUrl)
$("#modalMail").modal("show");
$.ajax({
dataType: "json",
url: advsubUrl
}).done(function(result){
if (result.error == true) {
thisBlock.slideUp();
} else {
console.log(result);
}
});
}
});
});
</script>
Loading…
Cancel
Save