|
|
@@ -69,7 +69,7 @@
|
|
|
<a class="nav-link active" href="" data-target="#tab3" data-toggle="tab" th:text="#{dashboard.menu.tits}">Titulaciones</a>
|
|
|
</li>
|
|
|
<li class="nav-item">
|
|
|
- <a class="nav-link" href="" data-target="#tab0" data-toggle="tab" th:text="#{dashboard.menu.summary}">Resumen</a>
|
|
|
+ <a class="nav-link" href="" data-target="#tab0" data-toggle="tab" th:text="#{dashboard.menu.summary}" onclick="initGantt();">Resumen</a>
|
|
|
</li>
|
|
|
<li class="nav-item">
|
|
|
<a class="nav-link" href="" data-target="#tab1" data-toggle="tab" th:text="#{dashboard.menu.procedures}">Procedimientos SAIC</a>
|
|
|
@@ -91,6 +91,7 @@
|
|
|
<span class="gantt-legend-active"><span th:text="#{dashboard.summary.legend.ontime}">En curso</span></span>
|
|
|
<span class="gantt-legend-expired"><span th:text="#{dashboard.summary.legend.delayed}">Atrasado</span></span>
|
|
|
<span class="gantt-legend-closed"><span th:text="#{dashboard.summary.legend.closed}">Cerrado</span></span>
|
|
|
+ <!--
|
|
|
<div class="input-group" style="text-align:right;float:right;margin-right:0px;width:auto !important;">
|
|
|
<div class="input-group-prepend">
|
|
|
<span class="input-group-text"><span th:text="#{dashboard.gantt.selector}">Procedimientos de</span></span>
|
|
|
@@ -119,6 +120,7 @@
|
|
|
<option th:each="item : ${titulacions}" th:text="${#locale.language} == 'es' ? ${item.nomCas}:${item.nomVal}" th:attr="value=${item.ruct}">Tit 1</option>
|
|
|
</select>
|
|
|
</div>
|
|
|
+ -->
|
|
|
</div>
|
|
|
<div class="col-lg-12">
|
|
|
<div id="treeProcedures"></div>
|
|
|
@@ -200,12 +202,12 @@
|
|
|
<div class="uv-table-group" th:if="${results}" style="cursor: auto;">
|
|
|
<div class="col-sm-12 uv-table-section" th:each="item : ${resp_titulacions}">
|
|
|
<strong><span th:text="${#locale.language} == 'es' ? ${item.rol.descripcioCas}:${item.rol.descripcioVal}"></span>:</strong>
|
|
|
- <span th:text="${item.usuari.nom}"></span> <span th:text="${item.usuari.cognoms}"></span> (<a th:href="'mailto:'+${item.usuari.email}" th:text="${item.usuari.email}"></a>)
|
|
|
+ <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="${#dates.format(item.inici, 'dd/MM/yyyy')}"></span></small>)
|
|
|
</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>
|
|
|
- <span th:text="${item.usuari.nom}"></span> <span th:text="${item.usuari.cognoms}"></span> (<a th:href="'mailto='+${item.usuari.email}" th:text="${item.usuari.email}"></a>)
|
|
|
+ <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="${#dates.format(item.inici, 'dd/MM/yyyy')}"></span></small>)
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -289,6 +291,8 @@
|
|
|
<footer class="uv-footer uv-footer-text" th:replace="~{layouts/common.html :: footer}"></footer>
|
|
|
|
|
|
<script th:src="@{/js/jquery/jquery.min.js}"></script>
|
|
|
+ <script th:src="@{/js/popper.js}"></script>
|
|
|
+ <script th:src="@{/js/bootstrap/bootstrap.min.js}"></script>
|
|
|
<script th:src="@{/js/fa/all.js}"></script>
|
|
|
<script th:src="@{/js/jquery/datatables.min.js}"></script>
|
|
|
<script th:src="@{/js/jquery-easing/jquery.easing.min.js}"></script>
|
|
|
@@ -298,6 +302,7 @@
|
|
|
<script th:src="@{/js/gijgo/gijgo.min.js}"></script>
|
|
|
<script th:src="@{/js/frappe-gantt/frappe-gantt.min.js}"></script>
|
|
|
<script th:src="@{/js/chartjs/chart.js}"></script>
|
|
|
+ <script th:src="@{/js/moment.js}"></script>
|
|
|
<script th:src="@{/js/saic.js}"></script>
|
|
|
|
|
|
<script th:if="${editable}" type="text/javascript">
|
|
|
@@ -344,7 +349,7 @@
|
|
|
var tlugar = '[[${organ.tlugar}]]';
|
|
|
var ruct = '[[${organ.ruct}]]';
|
|
|
var tambit = '[[${organ.tambit}]]';
|
|
|
- var treeProcedures, treeDocuments, ganttChart;
|
|
|
+ var treeProcedures = null, treeDocuments = null, ganttChart = null;
|
|
|
var tasks = [];
|
|
|
var inds = [];
|
|
|
var cursorPosition;
|
|
|
@@ -376,13 +381,80 @@
|
|
|
selectionType: 'single',
|
|
|
dataSource: '/dashboard/documents/'+ruct
|
|
|
});
|
|
|
+
|
|
|
drawReports(ruct);
|
|
|
- drawGantt(ruct);
|
|
|
+ //drawGantt(ruct);
|
|
|
editableSettings();
|
|
|
|
|
|
layout.closeLoadingSpinner(".uv-loading-spinner");
|
|
|
});
|
|
|
|
|
|
+ function initGantt(){
|
|
|
+ if(ganttChart == null){
|
|
|
+ drawGantt(ruct);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function drawGantt(ructAttr){
|
|
|
+ $.get('/dashboard/gantt/'+ructAttr, function(data){
|
|
|
+ data.forEach(function(d){d.id = 'Task '+d.id;});
|
|
|
+ data.at(-1).custom_class += ' gantt-task-last';
|
|
|
+ tasks = data;
|
|
|
+ ganttChart = new Gantt("#gantt", tasks, {
|
|
|
+ on_click: function (task) {
|
|
|
+ window.open("/procedure/"+task.id.replace('Task_', ''));
|
|
|
+ },
|
|
|
+ on_date_change: function(task, start, end) {
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ on_progress_change: function(task, progress) {
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ on_view_change: function() {
|
|
|
+ var bars = document.querySelectorAll("#gantt" + " .bar-group");
|
|
|
+ for (var i = 0; i < bars.length; i++) {
|
|
|
+ bars[i].addEventListener("mousedown", stopEvent, true);
|
|
|
+ }
|
|
|
+ var handles = document.querySelectorAll("#gantt" + " .handle-group");
|
|
|
+ for (var i = 0; i < handles.length; i++) {
|
|
|
+ handles[i].remove();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ bar_height: 20,
|
|
|
+ bar_corner_radius: 10,
|
|
|
+ arrow_curve: 10,
|
|
|
+ padding: 15,
|
|
|
+ view_mode: "Month",
|
|
|
+ date_format: "YYYY-MM-DD",
|
|
|
+ language: locale,
|
|
|
+ draggable: false,
|
|
|
+ hasArrows: false,
|
|
|
+ highlight_weekend: false,
|
|
|
+ infinite_padding: false,
|
|
|
+ readonly: true,
|
|
|
+ //column_width: 20,
|
|
|
+ popup: function(task) {
|
|
|
+ return `
|
|
|
+ <div class="details-container">
|
|
|
+ <h6>${task.titCas}</h6>
|
|
|
+ <p>${task._start.toLocaleDateString()} - ${task._end.toLocaleDateString()}</p>
|
|
|
+ </div>
|
|
|
+ `;
|
|
|
+ },
|
|
|
+ });
|
|
|
+ ganttChart.change_view_mode("Month");
|
|
|
+ $('.gantt-task-last').get(0).scrollIntoView({
|
|
|
+ behavior: 'auto',
|
|
|
+ block: 'center',
|
|
|
+ inline: 'center'
|
|
|
+ });
|
|
|
+ $('.today-button').trigger('click');
|
|
|
+ $(window).scrollTop(0);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
function initTables(){
|
|
|
|
|
|
$('#titsTable thead tr')
|
|
|
@@ -522,62 +594,6 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- function drawGantt(ructAttr){
|
|
|
- $.get('/dashboard/gantt/'+ructAttr, function(data){
|
|
|
- data.forEach(function(d){d.id = 'Task '+d.id;});
|
|
|
- data.at(-1).custom_class += ' gantt-task-last';
|
|
|
- tasks = data;
|
|
|
- ganttChart = new Gantt("#gantt", tasks, {
|
|
|
- on_click: function (task) {
|
|
|
- window.open("/procedure/"+task.id.replace('Task_', ''));
|
|
|
- },
|
|
|
- on_date_change: function(task, start, end) {
|
|
|
- return false;
|
|
|
- },
|
|
|
- on_progress_change: function(task, progress) {
|
|
|
- return false;
|
|
|
- },
|
|
|
- on_view_change: function() {
|
|
|
- var bars = document.querySelectorAll("#gantt" + " .bar-group");
|
|
|
- for (var i = 0; i < bars.length; i++) {
|
|
|
- bars[i].addEventListener("mousedown", stopEvent, true);
|
|
|
- }
|
|
|
- var handles = document.querySelectorAll("#gantt" + " .handle-group");
|
|
|
- for (var i = 0; i < handles.length; i++) {
|
|
|
- handles[i].remove();
|
|
|
- }
|
|
|
- },
|
|
|
- bar_height: 20,
|
|
|
- bar_corner_radius: 10,
|
|
|
- arrow_curve: 10,
|
|
|
- padding: 15,
|
|
|
- view_mode: "Month",
|
|
|
- date_format: "YYYY-MM-DD",
|
|
|
- language: locale,
|
|
|
- draggable: false,
|
|
|
- hasArrows: false,
|
|
|
- highlight_weekend: false,
|
|
|
- readonly: true,
|
|
|
- popup: function(task) {
|
|
|
- return `
|
|
|
- <div class="details-container">
|
|
|
- <h6>${task.name}</h6>
|
|
|
- <p>${task._start.toLocaleDateString()} - ${task._end.toLocaleDateString()}</p>
|
|
|
- </div>
|
|
|
- `;
|
|
|
- },
|
|
|
- });
|
|
|
- ganttChart.change_view_mode("Month");
|
|
|
- $('.today-button').trigger('click');
|
|
|
- $('.gantt-task-last').get(0).scrollIntoView({
|
|
|
- behavior: 'auto',
|
|
|
- block: 'center',
|
|
|
- inline: 'center'
|
|
|
- });
|
|
|
- $(window).scrollTop(0);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
function getGraphData(){
|
|
|
$.get('/dashboard/graphs/inds/'+ruct+'/'+$('.data-selector-orig').val(), function(data){
|
|
|
$('.chart-inds').html('');
|
|
|
@@ -752,12 +768,6 @@
|
|
|
event.preventDefault();
|
|
|
}
|
|
|
|
|
|
- function changeGanttOrigin(){
|
|
|
- ganttChart.clear();
|
|
|
- $('.gantt-container').parent().html('<svg id="gantt"></svg>')
|
|
|
- drawGantt($('#ganttOrigin').val());
|
|
|
- }
|
|
|
-
|
|
|
function changeReportsOrigin(){
|
|
|
treeProcedures.destroy();
|
|
|
drawReports($('#reportsOrigin').val());
|