|
|
@@ -191,16 +191,16 @@
|
|
|
<span th:text="${item.acreditacio?.grupCurs+' - '+item.acreditacio?.grup}"></span>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <span th:text="${#dates.format(item.acreditacio?.dataAcred, 'dd/MM/yyyy')}"></span>
|
|
|
+ <span th:text="${#temporals.format(item.acreditacio?.dataAcred, 'dd/MM/yyyy')}"></span>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <span th:text="${#dates.format(item.acreditacio?.dataRenov, 'dd/MM/yyyy')}"></span>
|
|
|
+ <span th:text="${#temporals.format(item.acreditacio?.dataRenov, 'dd/MM/yyyy')}"></span>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <span th:text="${#dates.format(item.acreditacio?.dataSegui, 'dd/MM/yyyy')}"></span>
|
|
|
+ <span th:text="${#temporals.format(item.acreditacio?.dataSegui, 'dd/MM/yyyy')}"></span>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <span th:text="${#dates.format(item.acreditacio?.dataVerif, 'dd/MM/yyyy')}"></span>
|
|
|
+ <span th:text="${#temporals.format(item.acreditacio?.dataVerif, 'dd/MM/yyyy')}"></span>
|
|
|
</td>
|
|
|
<td>
|
|
|
<span th:text="${item.acreditacio?.cursImpla}"></span>
|
|
|
@@ -263,15 +263,44 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="tab-pane" id="tab4">
|
|
|
- <div class="uv-table-group" th:if="${results}" style="cursor: auto;">
|
|
|
- <div class="col-sm-12 uv-table-section" th:each="item : ${resp_titulacions}" style="margin-top:20px;">
|
|
|
- <strong><span th:text="${#locale.language} == 'es' ? ${item.rol.descripcioCas}:${item.rol.descripcioVal}"></span>:</strong>
|
|
|
- <a th:href="'mailto:'+${item.usuari.email}" th:title="${item.usuari.email}" th:text="${item.usuari.nom + ' ' + item.usuari.cognoms}"></a> (<small><span th:text="#{managers.since}">Desde el</span> <span th:text="${item.inici}"></span></small>)
|
|
|
+ <span class="btn btn-primary pointer" id="btnAddManager" style="float:right; cursor:pointer; margin-right:20px;" data-toggle="modal" data-target="#newRoleModal" th:text="#{admin.managers.newRole}">Añadir responsable</span>
|
|
|
+ <div class="uv-table-group" th:if="${results}" style="cursor: auto; width: 90%;">
|
|
|
+
|
|
|
+ <div class="col-sm-12 uv-table-section" th:each="item : ${resp_titulacions}" style="display: flex; align-items: flex-start; margin-bottom: 15px;">
|
|
|
+ <form enctype='multipart/form-data' method="POST" action="/admin/userrole/remove" style="margin-right: 15px;" onsubmit="var ok = confirm('¿Confirma que desea eliminar este responsable?');">
|
|
|
+ <input type="hidden" name="idRol" th:value="${item.rol.idRol}">
|
|
|
+ <input type="hidden" name="usuari" th:value="${item.usuari.usuari}">
|
|
|
+ <input type="hidden" name="tlugar" th:value="${item.organ.tlugar}">
|
|
|
+ <input type="hidden" name="lugar" th:value="${item.organ.lugar}">
|
|
|
+ <button class="btn" style="width:40px; height:38px; color: red;" th:title="#{admin.action.delete}">
|
|
|
+ <i class="fas fa-times"></i>
|
|
|
+ </button>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <strong th:text="${#locale.language} == 'es' ? ${item.rol.descripcioCas}:${item.rol.descripcioVal}"></strong>
|
|
|
+ <br>
|
|
|
+ <a th:href="'mailto:'+${item.usuari.email}" th:title="${item.usuari.email}" th:text="${item.usuari.nom + ' ' + item.usuari.cognoms}"></a>
|
|
|
+ (<small><span th:text="#{managers.since}">Desde el</span> <span th:text="${item.inici}"></span></small>)
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="col-sm-12 uv-table-section" th:each="item : ${resp_centres}">
|
|
|
- <strong th:text="${#locale.language} == 'es' ? ${item.rol.descripcioCas}:${item.rol.descripcioVal}"></strong>
|
|
|
- <br>
|
|
|
- <a th:href="'mailto:'+${item.usuari.email}" th:title="${item.usuari.email}" th:text="${item.usuari.nom + ' ' + item.usuari.cognoms}"></a> (<small><span th:text="#{managers.since}">Desde el</span> <span th:text="${item.inici}"></span></small>)
|
|
|
+ <div class="col-sm-12 uv-table-section" th:each="item : ${resp_centres}" style="display: flex; align-items: flex-start; margin-bottom: 15px;">
|
|
|
+ <form enctype='multipart/form-data' method="POST" action="/admin/userrole/remove" style="margin-right: 15px;" onsubmit="return confirm('¿Confirma que desea eliminar este responsable?');">
|
|
|
+ <input type="hidden" name="idRol" th:value="${item.rol.idRol}">
|
|
|
+ <input type="hidden" name="usuari" th:value="${item.usuari.usuari}">
|
|
|
+ <input type="hidden" name="tlugar" th:value="${item.organ.tlugar}">
|
|
|
+ <input type="hidden" name="lugar" th:value="${item.organ.lugar}">
|
|
|
+ <button class="btn" style="width:40px; height:38px; color: red;" th:title="#{admin.action.delete}">
|
|
|
+ <i class="fas fa-times"></i>
|
|
|
+ </button>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <strong th:text="${#locale.language} == 'es' ? ${item.rol.descripcioCas}:${item.rol.descripcioVal}"></strong>
|
|
|
+ <br>
|
|
|
+ <a th:href="'mailto:'+${item.usuari.email}" th:title="${item.usuari.email}" th:text="${item.usuari.nom + ' ' + item.usuari.cognoms}"></a>
|
|
|
+ (<small><span th:text="#{managers.since}">Desde el</span> <span th:text="${item.inici}"></span></small>)
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -383,6 +412,65 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <div class="modal fade" id="newRoleModal" tabindex="-1" role="dialog" aria-labelledby="newRoleModal" aria-hidden="true" th:if="${#authentication.principal.isAdmin() or #authentication.principal.isGranted()}">
|
|
|
+ <div class="modal-dialog modal-lg">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <h5 class="modal-title" th:text="#{admin.managers.newRole}">Añadir responsable</h5>
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
|
+ <span aria-hidden="true">×</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="container-fluid">
|
|
|
+ <form id="newRoleForm" enctype='multipart/form-data' method="POST" action="/admin/userrole/new" style="margin-top:25px;">
|
|
|
+ <input type="hidden" name="centre" th:value="${organ.lugar2}">
|
|
|
+ <input type="hidden" name="titulacio" th:value="${organ.lugar}">
|
|
|
+ <div class="form-group">
|
|
|
+ <label th:text="#{admin.managers.user}">Usuario</label> <span class="pointer" style="color:#007bff;" onclick="newUser();" th:title="#{admin.managers.newUser}"><i id="addUserIcon" class="fas fa-plus"></i></span>
|
|
|
+ <div id="userSelectorContainer">
|
|
|
+ <select class="selectpicker" id="userSelector" name="usuari" data-dropup-auto="false" data-live-search="true" data-width="100%" data-actions-box="true" required>
|
|
|
+ <option th:each="item : ${users}" th:text="${item.nom}+' '+${item.cognoms}+' ('+${item.email}+')'" th:attr="value=${item.usuari}"></option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="form-group" id="newUserContainer">
|
|
|
+ <div class="row">
|
|
|
+ <div class="form-group col-6">
|
|
|
+ <label th:text="#{admin.managers.firstname}">Nombre</label>
|
|
|
+ <input class="form-control" type="text" value="" name="firstname" id="firstname">
|
|
|
+ </div>
|
|
|
+ <div class="form-group col-6">
|
|
|
+ <label th:text="#{admin.managers.lastname}">Apellidos</label>
|
|
|
+ <input class="form-control" type="text" value="" name="lastname" id="lastname">
|
|
|
+ </div>
|
|
|
+ <div class="form-group col-6">
|
|
|
+ <label th:text="#{admin.managers.user}">Usuario</label>
|
|
|
+ <input class="form-control" type="text" value="" name="username" id="username" onkeyup="setEmail();">
|
|
|
+ </div>
|
|
|
+ <div class="form-group col-6">
|
|
|
+ <label th:text="#{admin.managers.email}">Email</label>
|
|
|
+ <input class="form-control" type="email" value="" name="email" id="email">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label th:text="#{admin.managers.role}">Rol</label>
|
|
|
+ <select class="selectpicker" id="roleSelector" name="idRol" data-dropup-auto="false" data-live-search="true" data-width="100%" data-actions-box="true" th:attr="data-none-selected-text=#{global.selectors.noData}" required>
|
|
|
+ <option th:each="item : ${roles}" th:text="${#locale.language} == 'es' ? ${item.descripcioCas}:${item.descripcioVal}" th:attr="value=${item.idRol}"></option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="modal-footer">
|
|
|
+ <button type="button" class="btn btn-secondary" data-dismiss="modal" th:text="#{global.cancel}">Cancelar</button>
|
|
|
+ <button class="btn btn-success" type="submit" form="newRoleForm" th:text="#{global.confirm}">Confirmar</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<!-- contactModal -->
|
|
|
<div th:replace="~{layouts/common.html :: contactModal}"></div>
|
|
|
|
|
|
@@ -469,6 +557,9 @@
|
|
|
});
|
|
|
|
|
|
$('.data-selector-orig').trigger('change');
|
|
|
+
|
|
|
+ $('#newUserContainer').hide();
|
|
|
+ $('#userSelector').val('').trigger('change');
|
|
|
|
|
|
treeDocuments = $('#treeDocuments').tree({
|
|
|
cascadeSelection: false,
|
|
|
@@ -939,6 +1030,35 @@
|
|
|
$('#editCentreModal').modal('show');
|
|
|
}
|
|
|
|
|
|
+ function newUser(){
|
|
|
+ if(!$('#newUserContainer').is(":visible")){
|
|
|
+ $('#firstname').val('').attr('required', true);
|
|
|
+ $('#lastname').val('').attr('required', true);
|
|
|
+ $('#username').val('').attr('required', true);
|
|
|
+ $('#email').val('').attr('required', true);
|
|
|
+ $('#newUserContainer').show();
|
|
|
+ $('#userSelector').attr('required', false);
|
|
|
+ $('#userSelectorContainer').hide();
|
|
|
+ $('#addUserIcon').removeClass('fa-plus');
|
|
|
+ $('#addUserIcon').addClass('fa-minus');
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ $('#firstname').val('').attr('required', false);
|
|
|
+ $('#lastname').val('').attr('required', false);
|
|
|
+ $('#username').val('').attr('required', false);
|
|
|
+ $('#email').val('').attr('required', false);
|
|
|
+ $('#newUserContainer').hide();
|
|
|
+ $('#userSelector').attr('required', true);
|
|
|
+ $('#userSelectorContainer').show();
|
|
|
+ $('#addUserIcon').removeClass('fa-minus');
|
|
|
+ $('#addUserIcon').addClass('fa-plus');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function setEmail(){
|
|
|
+ $('#email').val($('#username').val()+'@uv.es');
|
|
|
+ }
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
</body>
|