Skip to content

Commit

Permalink
fix issue 1689
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilphoenix71 authored and Sylvaner committed Feb 18, 2020
1 parent 02bcee0 commit b5867cc
Show file tree
Hide file tree
Showing 12 changed files with 141 additions and 80 deletions.
3 changes: 3 additions & 0 deletions assets/css/containers/_actionbars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,7 @@
box-shadow: rgba(0, 0, 0, .1) 0 1px 1px;
border-top-right-radius: 3px;
border-top-left-radius: 3px;
input {
display: inline-block;
}
}
7 changes: 4 additions & 3 deletions assets/css/pages/_modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@
.btn:not(.btn-default):not(.btn-selector) {
color: $white !important;
}
a:not(.btn):not(.label-list) {
color: $nextdom_blue !important;
}
}
.ui-widget .label-config a,
.ui-widget .label-config i,
Expand All @@ -131,3 +128,7 @@
.modal-padding {
padding: 15px !important;
}
.ui-datepicker .ui-datepicker-today a {
background: none !important;
border: 1px dashed red !important;
}
26 changes: 24 additions & 2 deletions assets/css/themes/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,19 @@ html {
background-color: map_get($color_theme, 'color1') !important;
}

/* Modales */
.ui-widget-content {
a:not(.btn):not(.label-list):not(.ui-state-active):not(.ui-state-hover) {
color: map_get($color_theme, 'color1') !important;
}
}
.ui-datepicker td .ui-state-active,
.ui-datepicker td .ui-state-hover,
.ui-datepicker-close {
background: map_get($color_theme, 'color1') !important;
}


/* ################################################################################## */
/* COLOR2 = Couleur de contraste (icônes et texte sur fond accentué ou de sidebar...) */
/* ################################################################################## */
Expand Down Expand Up @@ -229,7 +242,8 @@ html {
}

/* Bouton action */
.btn-action {
.btn-action,
.label-action {
color: map_get($color_theme, 'color2') !important;
}

Expand Down Expand Up @@ -287,6 +301,13 @@ html {
color: map_get($color_theme, 'color2') !important;
}

/* Modales */
.ui-datepicker td .ui-state-active,
.ui-datepicker td .ui-state-hover,
.ui-datepicker-close {
color: map_get($color_theme, 'color2') !important;
}


/* ############################################################################################################# */
/* COLOR3 = Couleur de survol principale (contenu, titres, footer, bouton d'administration, unités, légendes...) */
Expand Down Expand Up @@ -891,7 +912,8 @@ pre:not(.mobile-pre) {
/* ########################## */
/* COLOR14 = Boutons d'action */
/* ########################## */
.btn-action {
.btn-action,
.label-action {
background-color: map_get($color_theme, 'color14') !important;
}
.tooltip-inner {
Expand Down
6 changes: 3 additions & 3 deletions assets/js/core/private.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ nextdom.private = {
return _data;
},
success: function (_data) {
console.log(_data);
// console.log(_data);
},
post_success: function (_data) {
},
complete: function () {
},
error: function (_data) {
// Erreur dans l'API ou mauvais retour AJAX (appel de ajax::error() côté PHP)
console.log(_data);
// console.log(_data);
}
},
/**
Expand Down Expand Up @@ -381,4 +381,4 @@ nextdom.private.ajaxCall = function(ajaxParams) {
else {
$.ajax(ajaxParams);
}
}
}
11 changes: 11 additions & 0 deletions assets/js/desktop/inits.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ function initFields(){
$(":input").inputmask();
$(".slimScrollDiv").css("overflow", "");
$(".sidebar").css("overflow", "");
var options = $.extend(
{},
$.datepicker.regional["fr"],
{ showOtherMonths: true,
showWeek: true,
showButtonPanel: true,
numberOfMonths: 2,
firstDay: 1,
dateFormat: "yy-mm-dd" }
);
$.datepicker.setDefaults(options);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions assets/js/desktop/tools/scenario.js
Original file line number Diff line number Diff line change
Expand Up @@ -1350,9 +1350,9 @@ function addSchedule(scheduleCode) {
* @param scenario
*/
function addUsedBy(scenario,section) {
var usedByHtml = '<div class="form-group col-xs-6 col-xs-12 col-padding">';
var usedByHtml = '<div class="form-group col-xs-12 col-padding">';
usedByHtml += '<div class="mix-group">';
usedByHtml += '<span class="label label-default label-sticker">' + scenario.name + '</span>';
usedByHtml += '<span class="label label-action label-sticker">' + scenario.name + '</span>';
if (scenario.isActive == true) {
usedByHtml += '<span class="label label-success label-sticker-big badge">{{Actif}}</span>';
} else {
Expand Down
143 changes: 83 additions & 60 deletions assets/js/modals/cmd.history.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,92 @@
* along with NextDom. If not, see <http://www.gnu.org/licenses/>.
*/

$(".in_datepicker").datepicker({dateFormat: "yy-mm-dd"});
$('#ui-datepicker-div').hide();
// Page init
loadInformations();
initEvents();

$('#div_historyChart').css('height', $('#div_historyChart').closest('.ui-dialog-content').height()-$('#div_historyChart').closest('.ui-dialog-content').find('.content-header').height() - 15);
/**
* Load informations in all forms of the page
*/
function loadInformations() {
// Set charts size
$('#div_historyChart').css('height', $('#div_historyChart').closest('.ui-dialog-content').height()-$('#div_historyChart').closest('.ui-dialog-content').find('.content-header').height() - 15);
// Add the cmd chart
addChart(historyId);
// Init datepicker
$(".in_datepicker").datepicker();
setTimeout(function () {
$("#ui-datepicker-div").hide();
}, 200);
}

/**
* Init events on the profils page
*/
function initEvents() {
// Chart type change
$('#sel_chartType').on('change', function () {
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId, display: {graphType: $(this).value()}},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});

// Chart group change
$('#sel_groupingType').on('change', function () {
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId, display: {groupingType: $(this).value()}},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});

// Chart derive option change
$('#cb_derive').on('change', function () {
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId, display: {graphDerive: $(this).value()}},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});

delete nextdom.history.chart['div_historyChart'];
// Chart step option change
$('#cb_step').on('change', function () {
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId, display: {graphStep: $(this).value()}},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});

initHistoryTrigger();
addChart(historyId);
// Date change
$('#bt_validChangeDate').on('click', function () {
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});
}

/**
* Add a charts
*/
function addChart(_cmd_id) {
// Hide alert
$('#alertGraph').hide();
// Delete old chart
if (isset(nextdom.history.chart['div_historyChart']) && isset(nextdom.history.chart['div_historyChart'].chart) && isset(nextdom.history.chart['div_historyChart'].chart.series)) {
$(nextdom.history.chart['div_historyChart'].chart.series).each(function(i, serie){
try {
Expand All @@ -52,6 +126,8 @@ function addChart(_cmd_id) {
}
});
}
delete nextdom.history.chart['div_historyChart'];
// Drawing
nextdom.cmd.save({
cmd: {id: historyId},
error: function (error) {
Expand Down Expand Up @@ -80,62 +156,9 @@ function addChart(_cmd_id) {
$('#cb_derive').off().value(init(data.cmd.display.graphDerive));
}
}
initHistoryTrigger();
initEvents();
}
});
}
});
}

function initHistoryTrigger() {
$('#sel_chartType').on('change', function () {
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId, display: {graphType: $(this).value()}},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});

$('#sel_groupingType').on('change', function () {
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId, display: {groupingType: $(this).value()}},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});

$('#cb_derive').on('change', function () {
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId, display: {graphDerive: $(this).value()}},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});

$('#cb_step').on('change', function () {
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId, display: {graphStep: $(this).value()}},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});
}

$('#bt_validChangeDate').on('click', function () {
delete nextdom.history.chart['div_historyChart'];
addChart(historyId);
nextdom.cmd.save({
cmd: {id: historyId},
error: function (error) {
notify("Erreur", error.message, 'error');
}
});
});
7 changes: 4 additions & 3 deletions scripts/gen_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function gen_css {
mkdir -p assets/css/builded
# Build adminlte
node vendor/node_modules/less/bin/lessc assets/css/compiled/AdminLTE.less assets/css/builded/AdminLTE.scss
#
#
cat vendor/node_modules/bootstrap/dist/css/bootstrap.css \
vendor/node_modules/roboto-fontface/css/roboto/roboto-fontface.css \
vendor/node_modules/jquery-ui/themes/base/core.css \
Expand Down Expand Up @@ -63,7 +63,7 @@ function gen_css {
vendor/node_modules/font-awesome/css/font-awesome.css \
vendor/node_modules/jquery-datetimepicker/jquery.datetimepicker.css \
vendor/node_modules/bootstrap-colorpicker/dist/css/bootstrap-colorpicker.css \
assets/icon/animal/style.css \
assets/icon/animal/style.css \
assets/icon/divers/style.css \
assets/icon/fashion/style.css \
assets/icon/loisir/style.css \
Expand All @@ -78,7 +78,7 @@ function gen_css {
assets/icon/securite/style.css \
assets/icon/techno/style.css \
assets/icon/transport/style.css \
> assets/css/builded/vendors.scss
> assets/css/builded/vendors.scss

if [ $# -eq 0 ]; then
COMPRESS="--style compressed"
Expand Down Expand Up @@ -181,6 +181,7 @@ function gen_js {
vendor/node_modules/inputmask/dist/jquery.inputmask.bundle.js \
vendor/node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js \
vendor/node_modules/jquery-datetimepicker/build/jquery.datetimepicker.full.min.js \
vendor/node_modules/jquery-ui/ui/i18n/datepicker-fr.js \
vendor/node_modules/snapsvg/dist/snap.svg-min.js \
vendor/node_modules/moment/min/moment.min.js \
vendor/node_modules/vivagraphjs/dist/vivagraph.min.js \
Expand Down
5 changes: 2 additions & 3 deletions src/Ajax/CmdAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,7 @@ public function getHistory()
$dateEnd = date(DateFormat::FULL);
}
if ($dateStart !== '') {
// TODO startDate à vérifier
$dateStart = Utils::init('startDate', date(DateFormat::FULL_DAY, strtotime(ConfigManager::byKey('history::defautShowPeriod') . ' ' . date(DateFormat::FULL_DAY))));
$dateStart = Utils::init(AjaxParams::DATE_START, date(DateFormat::FULL_DAY, strtotime(ConfigManager::byKey('history::defautShowPeriod') . ' ' . date(DateFormat::FULL_DAY))));
}
$result['maxValue'] = '';
$result['minValue'] = '';
Expand Down Expand Up @@ -653,4 +652,4 @@ public function getDeadCmd()
}
$this->ajax->success($result);
}
}
}
1 change: 1 addition & 0 deletions src/Helpers/PrepareView.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ private function initJsPool(&$pageData)
$pageData[ControllerData::JS_POOL][] = '/vendor/node_modules/inputmask/dist/jquery.inputmask.bundle.js';
$pageData[ControllerData::JS_POOL][] = '/vendor/node_modules/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.js';
$pageData[ControllerData::JS_POOL][] = '/vendor/node_modules/jquery-datetimepicker/build/jquery.datetimepicker.full.min.js';
$pageData[ControllerData::JS_POOL][] = '/vendor/node_modules/jquery-ui/ui/i18n/datepicker-fr.js';
$pageData[ControllerData::JS_POOL][] = '/vendor/node_modules/moment/moment.js';
$pageData[ControllerData::JS_POOL][] = '/vendor/node_modules/vivagraphjs/dist/vivagraph.min.js';

Expand Down
4 changes: 2 additions & 2 deletions views/desktop/diagnostic/history.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
<fieldset>
<legend>{{ 'Filtrage et mise en forme des données' }}</legend>
<div class="form-group">
<input id="in_startDate" class="form-control in_datepicker" style="display : inline-block; width: 150px;" value="{{ historyDate.start }}"/>
<input id="in_endDate" class="form-control in_datepicker" style="display : inline-block; width: 150px;" value="{{ historyDate.end }}"/>
<input id="in_startDate" class="form-control in_datepicker" style="display : inline-block; width: 120px;" value="{{ historyDate.start }}"/>
<input id="in_endDate" class="form-control in_datepicker" style="display : inline-block; width: 120px;" value="{{ historyDate.end }}"/>
<a class="btn btn-success" id="bt_validChangeDate" data-toggle="tooltip" title="" data-original-title="{{ 'Attention : une trop grande plage de dates peut mettre très longtemps à être calculée ou même ne pas s\'afficher.' | trans }}"><i class="fas fa-check"></i>{{ 'Ok' }}</a>
<select class="form-control pull-right" id="sel_groupingType" style="width: 200px;">
<option value="">{{ 'Aucun groupement' | trans }}</option>
Expand Down
4 changes: 2 additions & 2 deletions views/modals/cmd.history.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<section class="content-header">
<div class="action-bar">
<div class="action-group btn-action-bar">
<input type="text" id="in_startDate" class="form-control in_datepicker" style="width: 150px;" value="{{ dates.start }}"/>
<input type="text" id="in_endDate" class="form-control in_datepicker" style="width: 150px;" value="{{ dates.end }}"/>
<input type="text" id="in_startDate" class="form-control in_datepicker" style="width: 120px;" value="{{ dates.start }}"/>
<input type="text" id="in_endDate" class="form-control in_datepicker" style="width: 120px;" value="{{ dates.end }}"/>
<a class="btn btn-action-bar btn-success tooltips" style="margin-top:0px" id="bt_validChangeDate" title="{{ 'Attention : une trop grande plage de dates peut mettre très longtemps à être calculée ou même ne pas s\'afficher' }}">{{ 'Ok' }}</a>
</div>
<div class="action-group">
Expand Down

0 comments on commit b5867cc

Please sign in to comment.