From 731a38c6ef7c495c5363403340c1613d11c4bf3d Mon Sep 17 00:00:00 2001 From: Salvialf Date: Sun, 2 Aug 2026 15:31:04 +0200 Subject: [PATCH 1/3] chore(eqLogic.configure): code formatting --- desktop/modal/eqLogic.configure.php | 180 ++++++++++++++-------------- 1 file changed, 89 insertions(+), 91 deletions(-) diff --git a/desktop/modal/eqLogic.configure.php b/desktop/modal/eqLogic.configure.php index 96df24d676..9e09cf5439 100644 --- a/desktop/modal/eqLogic.configure.php +++ b/desktop/modal/eqLogic.configure.php @@ -56,17 +56,16 @@
- -
-
- {{Général}} +
+
+ {{Général}}
-
-
+
+
@@ -87,8 +86,8 @@ } ?>
-
-
+
+
@@ -102,8 +101,8 @@ -
-
-
+
+
getStatus('numberTryWithoutSuccess', 0) ?> @@ -115,8 +114,8 @@
getStatus('lastCommunication') ?>
-
-
+
+
@@ -131,22 +130,22 @@
- {{Image}} -
-
- - {{Envoyer}} - - {{Enlever l'image}} -
-
-
-
- -
-
- -
+ {{Image}} +
+
+ + {{Envoyer}} + + {{Enlever l'image}} +
+
+
+
+ +
+
+ +
{{Commandes}} @@ -503,48 +502,48 @@
-
+
{{Vous pouvez trouver ici toute informations complementaires demandées par un plugin sur les équipements Jeedom}}
getSpecialAttributes(); - if (!isset($specialAttributes['eqLogic']) || !is_array($specialAttributes['eqLogic']) || count($specialAttributes['eqLogic']) == 0) { - continue; - } - $spAttr = ' {{Informations complémentaires demandées par}} ' . $plugin->getName() . ''; - foreach ($specialAttributes['eqLogic'] as $key => $config) { - $spAttr .= '
'; - $spAttr .= ''; - $spAttr .= '
'; - switch ($config['type']) { - case 'input': - $spAttr .= ''; - break; - case 'checkbox': - $spAttr .= ''; - break; - case 'number': - $spAttr .= ''; - break; - case 'select': - $spAttr .= ''; - break; - } - $spAttr .= '
'; - $spAttr .= '
'; + try { + $plugins = plugin::listPlugin(true); + foreach ($plugins as $plugin) { + $specialAttributes = $plugin->getSpecialAttributes(); + if (!isset($specialAttributes['eqLogic']) || !is_array($specialAttributes['eqLogic']) || count($specialAttributes['eqLogic']) == 0) { + continue; + } + $spAttr = ' {{Informations complémentaires demandées par}} ' . $plugin->getName() . ''; + foreach ($specialAttributes['eqLogic'] as $key => $config) { + $spAttr .= '
'; + $spAttr .= ''; + $spAttr .= '
'; + switch ($config['type']) { + case 'input': + $spAttr .= ''; + break; + case 'checkbox': + $spAttr .= ''; + break; + case 'number': + $spAttr .= ''; + break; + case 'select': + $spAttr .= ''; + break; } - echo $spAttr; + $spAttr .= '
'; + $spAttr .= '
'; } - } catch (\Exception $e) { + echo $spAttr; } - ?> - + } catch (\Exception $e) { + } + ?> +
@@ -580,10 +579,10 @@ document.querySelectorAll('#md_eqLogicConfigure .advanceWidgetParameterColorTransparent').forEach(_transparent => { _transparent?.triggerEvent('change') }) - - try { - jeeFrontEnd.md_eqLogicConfigure.bckUploader.destroy() - } catch (error) {} + + try { + jeeFrontEnd.md_eqLogicConfigure.bckUploader.destroy() + } catch (error) {} jeeFrontEnd.md_eqLogicConfigure.bckUploader = new jeeFileUploader({ fileInput: document.getElementById('bt_uploadImageEqLogic'), replaceFileInput: false, @@ -594,19 +593,19 @@ jeedomUtils.showAlert({ message: data.result.result, level: 'danger' - }) - return - } - if (isset(data.result.result.filepath)) { - document.querySelector('#md_eqLogicConfigure .eqLogicImg').seen().querySelector('img').src = data.result.result.filepath - } else { - document.querySelector('#md_eqLogicConfigure .eqLogicImg').unseen() - } - jeedomUtils.showAlert({ - message: '{{Image ajoutée avec succès}}', - level: 'success' - }) - } + }) + return + } + if (isset(data.result.result.filepath)) { + document.querySelector('#md_eqLogicConfigure .eqLogicImg').seen().querySelector('img').src = data.result.result.filepath + } else { + document.querySelector('#md_eqLogicConfigure .eqLogicImg').unseen() + } + jeedomUtils.showAlert({ + message: '{{Image ajoutée avec succès}}', + level: 'success' + }) + } }) //Dynamic values: @@ -648,13 +647,13 @@ } }, synchModalToEq: function() { - if(document.querySelector('#div_pageContainer input.eqLogicAttr[data-l1key="name"]')){ + if (document.querySelector('#div_pageContainer input.eqLogicAttr[data-l1key="name"]')) { document.querySelector('#div_pageContainer input.eqLogicAttr[data-l1key="name"]').value = document.querySelector('#eqLogic_information input.eqLogicAttr[data-l1key="name"').value } - if(document.querySelector('#div_pageContainer input.eqLogicAttr[data-l1key="isEnable"]')){ + if (document.querySelector('#div_pageContainer input.eqLogicAttr[data-l1key="isEnable"]')) { document.querySelector('#div_pageContainer input.eqLogicAttr[data-l1key="isEnable"]').checked = document.querySelector('#eqLogic_information input.eqLogicAttr[data-l1key="isEnable"').checked } - if(document.querySelector('#div_pageContainer input.eqLogicAttr[data-l1key="isVisible"]')){ + if (document.querySelector('#div_pageContainer input.eqLogicAttr[data-l1key="isVisible"]')) { document.querySelector('#div_pageContainer input.eqLogicAttr[data-l1key="isVisible"]').checked = document.querySelector('#eqLogic_information input.eqLogicAttr[data-l1key="isVisible"').checked } }, @@ -880,10 +879,10 @@ }) return } - + if (_target = event.target.closest('#bt_removeEqLogicImage')) { - jeeDialog.confirm('{{Êtes-vous sûr de vouloir enlever l\'image cet équipement ?}}', function(result) { - if (result) { + jeeDialog.confirm('{{Êtes-vous sûr de vouloir enlever l\'image cet équipement ?}}', function(result) { + if (result) { jeedom.eqLogic.removeImage({ id: jeephp2js.md_eqLogicConfigure_Info.id, error: function(error) { @@ -908,7 +907,6 @@ }) return } - }) document.getElementById('eqLogic_information')?.addEventListener('dblclick', function(event) { @@ -992,9 +990,9 @@ var _target = null if (_target = event.target.closest('.eqLogicAttr[data-l1key="configuration"][data-l2key="battery::disable"]')) { - if(document.querySelector('.eqLogicAttr[data-l1key="configuration"][data-l2key="battery::disable"]').jeeValue() == 1){ + if (document.querySelector('.eqLogicAttr[data-l1key="configuration"][data-l2key="battery::disable"]').jeeValue() == 1) { document.querySelectorAll('.eqLogicHideNoBattery').unseen(); - }else{ + } else { document.querySelectorAll('.eqLogicHideNoBattery').seen(); } } From e486e62df79fa054db61a561e179d4548e5d5327 Mon Sep 17 00:00:00 2001 From: Salvialf Date: Sun, 2 Aug 2026 15:32:00 +0200 Subject: [PATCH 2/3] fix(cmd): avoid mutating shared cmd::update value in table state displays --- core/js/plugin.template.js | 16 ++++++++-------- desktop/modal/eqLogic.configure.php | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/core/js/plugin.template.js b/core/js/plugin.template.js index 68338e2338..69f14a63ee 100644 --- a/core/js/plugin.template.js +++ b/core/js/plugin.template.js @@ -98,8 +98,8 @@ if (!jeeFrontEnd.pluginTemplate) { if (isset(data) && isset(data.timeout) && data.timeout == 0) { data.timeout = '' } - if(document.getElementById('img_device') != null && document.querySelector('.eqLogicDisplayCard.active img').getAttribute('src') != ''){ - document.getElementById('img_device').setAttribute("src",document.querySelector('.eqLogicDisplayCard.active img').getAttribute('src')); + if (document.getElementById('img_device') != null && document.querySelector('.eqLogicDisplayCard.active img').getAttribute('src') != '') { + document.getElementById('img_device').setAttribute("src", document.querySelector('.eqLogicDisplayCard.active img').getAttribute('src')) } document.getElementById('div_mainContainer').setJeeValues(data, '.eqLogicAttr') if (!isset(data.category.opening)) try { document.querySelector('input[data-l2key="opening"]').checked = false } catch (e) { } @@ -113,7 +113,7 @@ if (!jeeFrontEnd.pluginTemplate) { data.cmd[i].state = String(data.cmd[i].state).replace(/<[^>]*>?/gm, '') data.cmd[i]['htmlstate'] = '{{Date de collecte}} : ' + data.cmd[i].collectDate + data.cmd[i]['htmlstate'] += 'title="{{Date de valeur}}: ' + data.cmd[i].valueDate + '
{{Date de collecte}}: ' + data.cmd[i].collectDate if (data.cmd[i].state.length > 50) { data.cmd[i]['htmlstate'] += '
' + data.cmd[i].state.replaceAll('"', '"') } @@ -132,17 +132,17 @@ if (!jeeFrontEnd.pluginTemplate) { } document.querySelectorAll('.cmdTableState').forEach(_cmdState => { jeedom.cmd.addUpdateFunction(_cmdState.getAttribute('data-cmd_id'), function(_options) { - _options.value = String(_options.value).replace(/<[^>]*>?/gm, '') + let displayValue = String(_options.value).replace(/<[^>]*>?/gm, '') const cmd = document.querySelector('.cmdTableState[data-cmd_id="' + _options.cmd_id + '"]') if (cmd === null) { return } - let title = '{{Date de collecte}} : ' + _options.collectDate + '
{{Date de valeur}} ' + _options.valueDate - if (_options.value.length > 50) { - title += ' - ' + _options.value + let title = '{{Date de valeur}}: ' + _options.valueDate + '
{{Date de collecte}}: ' + _options.collectDate + if (displayValue.length > 50) { + title += ' - ' + displayValue } cmd.setAttribute('title', title) - cmd.empty().innerHTML = _options.value.substring(0, 50) + ' ' + _options.raw_unit + cmd.empty().innerHTML = displayValue.substring(0, 50) + ' ' + _options.raw_unit cmd.style.color = 'var(--logo-primary-color)' setTimeout(function() { cmd.style.color = null diff --git a/desktop/modal/eqLogic.configure.php b/desktop/modal/eqLogic.configure.php index 9e09cf5439..29278313b4 100644 --- a/desktop/modal/eqLogic.configure.php +++ b/desktop/modal/eqLogic.configure.php @@ -169,9 +169,9 @@ $display .= '
'; if ($cmd->getType() == 'info') { $value = htmlspecialchars($cmd->execCmd()); - $title = '{{Date de valeur}} : ' . $cmd->getValueDate() . '
{{Date de collecte}} : ' . $cmd->getCollectDate(); + $title = '{{Date de valeur}}: ' . $cmd->getValueDate() . '
{{Date de collecte}}: ' . $cmd->getCollectDate(); if (strlen($value) > 50) { - $title .= '
{{Valeur}} : ' . $value; + $title .= '
{{Valeur}}: ' . $value; $value = trim(substr($value, 0, 50)) . '...'; } $display .= '' . $value . ' ' . $cmd->getUnite() . ''; @@ -611,18 +611,18 @@ //Dynamic values: document.querySelectorAll('#md_eqLogicConfigure .eqLogicConfigure_cmdValue').forEach(_cmd => { jeedom.cmd.addUpdateFunction(_cmd.getAttribute('data-cmd_id'), function(_options) { - _options.value = String(_options.value).replace(/<[^>]*>?/gm, '') + let displayValue = String(_options.value).replace(/<[^>]*>?/gm, '') let cmd = document.querySelector('#md_eqLogicConfigure .eqLogicConfigure_cmdValue[data-cmd_id="' + _options.cmd_id + '"]') if (cmd === null) { return } - let title = '{{Date de valeur}} : ' + _options.valueDate + '
{{Date de collecte}} : ' + _options.collectDate - if (_options.value.length > 50) { - title += '
{{Valeur}} : ' + _options.value - _options.value = _options.value.trim().substring(0, 50) + '...' + let title = '{{Date de valeur}}: ' + _options.valueDate + '
{{Date de collecte}}: ' + _options.collectDate + if (displayValue.length > 50) { + title += '
{{Valeur}}: ' + displayValue + displayValue = displayValue.trim().substring(0, 50) + '...' } cmd.setAttribute('title', title) - cmd.empty().innerHTML = _options.value + ' ' + _options.unit + cmd.empty().innerHTML = displayValue + ' ' + _options.unit cmd.style.color = 'var(--logo-primary-color)' setTimeout(function() { cmd.style.color = null From 2ef3b15ac04293ce46290f311f58c0f194e9f5f3 Mon Sep 17 00:00:00 2001 From: Salvialf Date: Sun, 2 Aug 2026 15:35:06 +0200 Subject: [PATCH 3/3] chore(widget): align tooltip date colon spacing and translate missing string --- core/template/dashboard/cmd.action.slider.shutter.html | 2 +- core/template/mobile/cmd.info.numeric.rain.html | 2 +- core/template/mobile/cmd.info.string.multiline.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/template/dashboard/cmd.action.slider.shutter.html b/core/template/dashboard/cmd.action.slider.shutter.html index dfbdad47f7..9af9257276 100644 --- a/core/template/dashboard/cmd.action.slider.shutter.html +++ b/core/template/dashboard/cmd.action.slider.shutter.html @@ -40,7 +40,7 @@ jeedom.cmd.addUpdateFunction('#id#', function(_options) { if (is_object(cmd = document.querySelector('.cmd[data-cmd_uid="#uid#"]'))) { - cmd.setAttribute('title', '{{Date de valeur}} : ' + _options.valueDate + '
{{Date de collecte}} : ' + _options.collectDate) + cmd.setAttribute('title', '{{Date de valeur}}: ' + _options.valueDate + '
{{Date de collecte}}: ' + _options.collectDate) if ('#time#' == 'duration' || '#time#' == 'date') { jeedom.cmd.displayDuration(_options.valueDate, cmd.querySelector('.timeCmd'), '#time#') } diff --git a/core/template/mobile/cmd.info.numeric.rain.html b/core/template/mobile/cmd.info.numeric.rain.html index ae87db8778..0b67731894 100644 --- a/core/template/mobile/cmd.info.numeric.rain.html +++ b/core/template/mobile/cmd.info.numeric.rain.html @@ -23,7 +23,7 @@ cmd#id#.find('.widget-rain-water').css('background', "url('data:image/svg+xml;base64," + waterSvg64#id# + "')") jeedom.cmd.addUpdateFunction('#id#',function(_options) { - cmd#id#.attr('title','{{Date de valeur}} : '+_options.valueDate+'
{{Date de collecte}} : '+_options.collectDate+'
{{Valeur}} : '+_options.display_value+_options.unit) + cmd#id#.attr('title','{{Date de valeur}}: '+_options.valueDate+'
{{Date de collecte}}: '+_options.collectDate+'
{{Valeur}}: '+_options.display_value+_options.unit) cmd#id#.find('.unit').empty().append(_options.unit); var value_#id# = parseFloat(_options.value) diff --git a/core/template/mobile/cmd.info.string.multiline.html b/core/template/mobile/cmd.info.string.multiline.html index a7953c88a1..4fad204004 100644 --- a/core/template/mobile/cmd.info.string.multiline.html +++ b/core/template/mobile/cmd.info.string.multiline.html @@ -5,7 +5,7 @@