diff --git a/assets/css/containers/_actionbars.scss b/assets/css/containers/_actionbars.scss index 0695854a4..bd5b2b26c 100644 --- a/assets/css/containers/_actionbars.scss +++ b/assets/css/containers/_actionbars.scss @@ -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; + } } diff --git a/assets/css/pages/_modals.scss b/assets/css/pages/_modals.scss index f849b9d6f..4ef72076d 100644 --- a/assets/css/pages/_modals.scss +++ b/assets/css/pages/_modals.scss @@ -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, @@ -131,3 +128,7 @@ .modal-padding { padding: 15px !important; } +.ui-datepicker .ui-datepicker-today a { + background: none !important; + border: 1px dashed red !important; +} diff --git a/assets/css/themes/_base.scss b/assets/css/themes/_base.scss index c6f260897..9da87a93b 100644 --- a/assets/css/themes/_base.scss +++ b/assets/css/themes/_base.scss @@ -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...) */ /* ################################################################################## */ @@ -229,7 +242,8 @@ html { } /* Bouton action */ -.btn-action { +.btn-action, +.label-action { color: map_get($color_theme, 'color2') !important; } @@ -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...) */ @@ -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 { diff --git a/assets/js/core/private.class.js b/assets/js/core/private.class.js index 4f88dbbad..d24536858 100644 --- a/assets/js/core/private.class.js +++ b/assets/js/core/private.class.js @@ -29,7 +29,7 @@ nextdom.private = { return _data; }, success: function (_data) { - console.log(_data); + // console.log(_data); }, post_success: function (_data) { }, @@ -37,7 +37,7 @@ nextdom.private = { }, error: function (_data) { // Erreur dans l'API ou mauvais retour AJAX (appel de ajax::error() côté PHP) - console.log(_data); + // console.log(_data); } }, /** @@ -381,4 +381,4 @@ nextdom.private.ajaxCall = function(ajaxParams) { else { $.ajax(ajaxParams); } -} \ No newline at end of file +} diff --git a/assets/js/desktop/inits.js b/assets/js/desktop/inits.js index 04bf1a591..354280981 100644 --- a/assets/js/desktop/inits.js +++ b/assets/js/desktop/inits.js @@ -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); } /** diff --git a/assets/js/desktop/tools/scenario.js b/assets/js/desktop/tools/scenario.js index d248ccc90..0bd5354e1 100644 --- a/assets/js/desktop/tools/scenario.js +++ b/assets/js/desktop/tools/scenario.js @@ -1350,9 +1350,9 @@ function addSchedule(scheduleCode) { * @param scenario */ function addUsedBy(scenario,section) { - var usedByHtml = '
'; + var usedByHtml = '
'; usedByHtml += '
'; - usedByHtml += '' + scenario.name + ''; + usedByHtml += '' + scenario.name + ''; if (scenario.isActive == true) { usedByHtml += '{{Actif}}'; } else { diff --git a/assets/js/modals/cmd.history.js b/assets/js/modals/cmd.history.js index 3ce581d2c..b8f0e3662 100644 --- a/assets/js/modals/cmd.history.js +++ b/assets/js/modals/cmd.history.js @@ -30,18 +30,92 @@ * along with NextDom. If not, see . */ -$(".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 { @@ -52,6 +126,8 @@ function addChart(_cmd_id) { } }); } + delete nextdom.history.chart['div_historyChart']; + // Drawing nextdom.cmd.save({ cmd: {id: historyId}, error: function (error) { @@ -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'); - } - }); -}); diff --git a/scripts/gen_assets.sh b/scripts/gen_assets.sh index d3b0e5da8..8c3b40478 100755 --- a/scripts/gen_assets.sh +++ b/scripts/gen_assets.sh @@ -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 \ @@ -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 \ @@ -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" @@ -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 \ diff --git a/src/Ajax/CmdAjax.php b/src/Ajax/CmdAjax.php index 4f3f2c4c7..19230c3a4 100644 --- a/src/Ajax/CmdAjax.php +++ b/src/Ajax/CmdAjax.php @@ -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'] = ''; @@ -653,4 +652,4 @@ public function getDeadCmd() } $this->ajax->success($result); } -} \ No newline at end of file +} diff --git a/src/Helpers/PrepareView.php b/src/Helpers/PrepareView.php index 6f8fdf169..2c612af58 100755 --- a/src/Helpers/PrepareView.php +++ b/src/Helpers/PrepareView.php @@ -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'; diff --git a/views/desktop/diagnostic/history.html.twig b/views/desktop/diagnostic/history.html.twig index d6c9af558..fefda514e 100644 --- a/views/desktop/diagnostic/history.html.twig +++ b/views/desktop/diagnostic/history.html.twig @@ -114,8 +114,8 @@
{{ 'Filtrage et mise en forme des données' }}
- - + + {{ 'Ok' }} - + + {{ 'Ok' }}