N°3123 - Refactor Directories

This commit is contained in:
Eric
2020-12-02 13:18:01 +01:00
parent d1b12ee04b
commit 15aa9e508c
259 changed files with 862 additions and 869 deletions

View File

@@ -0,0 +1,55 @@
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
var chart = c3.generate({
bindto: d3.select('#my_chart_{{ oUIBlock.sId }}'),
data: {
json: {{ oUIBlock.sJson|raw }},
keys: {
x: 'label',
value: ["value"]
},
onclick: function (d) {
var aURLs = {{ oUIBlock.sJSURLs|raw }};
window.location.href = aURLs[d.index];
},
selection: {
enabled: true
},
type: 'bar'
},
axis: {
x: {
tick: {
culling: {max: 25}, // Maximum 24 labels on x axis (2 years).
centered: true,
rotate: 90,
multiline: false
},
type: 'category' // this needed to load string x value
}
},
grid: {
y: {
show: true
}
},
legend: {
show: false
},
tooltip: {
grouped: false,
format: {
title: function() { return '' },
name: function (name, ratio, id, index) {
var aNames = {{ oUIBlock.sJSNames|raw }};
return aNames[index];
}
}
}
});
if (typeof(charts) === "undefined")
{
charts = [];
}
charts.push(chart);

View File

@@ -0,0 +1,31 @@
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
var chart = c3.generate({
bindto: d3.select('#my_chart_{{ oUIBlock.sId }}'),
data: {
columns: {{ oUIBlock.sJSColumns|raw }},
type: 'pie',
names: {{ oUIBlock.sJSNames|raw }},
onclick: function (d) {
var aURLs = {{ oUIBlock.sJSURLs|raw }};
window.location.href= aURLs[d.index];
},
order: null
},
legend: {
show: true,
position: 'right'
},
tooltip: {
format: {
value: function (value) { return value; }
}
}
});
if (typeof(charts) === "undefined")
{
charts = [];
}
charts.push(chart);

View File

@@ -0,0 +1,9 @@
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
<div style="height:250px;width:100%" class="dashboard_chart" id="my_chart_{{ oUIBlock.sId }}{{ oUIBlock.iChartCounter }}">
<div style="height:200px;line-height:200px;vertical-align:center;text-align:center;width:100%">
<img src="../images/indicator.gif">
</div>
</div>
{% endapply %}

View File

@@ -0,0 +1,7 @@
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
$.post('{{ oUIBlock.sUrl|escape_for_js_string|raw }}', {}, function (data) {
$('body').append(data);
});
{% endapply %}

View File

@@ -0,0 +1,21 @@
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
{% if oUIBlock.bEmptySet or oUIBlock.bNotAuthorized %}
<p>{{ 'UI:NoObjectToDisplay'|dict_s }}</p>
{% endif %}
{% if oUIBlock.bCreateNew %}
<p>
<a{{ oUIBlock.sLinkTarget }} href="{{ oUIBlock.sAbsoluteUrlAppRoot }}pages/UI.php?operation=new&class={{ oUIBlock.sClass }}&{{ oUIBlock.sParams }}{{ oUIBlock.sDefault }}">
{{ 'UI:ClickToCreateNew'|dict_format(oUIBlock.sClassName) }}
</a>
</p>
{% endif %}
{% for oSubBlock in oUIBlock.GetSubBlocks() %}
{{ render_block(oSubBlock, {aPage: aPage}) }}
{% endfor %}
{% endapply %}

View File

@@ -0,0 +1,7 @@
{# @copyright Copyright (C) 2010-2020 Combodo SARL #}
{# @license http://opensource.org/licenses/AGPL-3.0 #}
{% apply spaceless %}
{% if oUIBlock.sEventAttachedData is not empty %}
$('body').trigger('update_history.itop', [{{ oUIBlock.sEventAttachedData|raw }}]);
{% endif %}
{% endapply %}