diff --git a/core/ajax/repo.ajax.php b/core/ajax/repo.ajax.php
index 8dcb9d837a..cc6a8be32e 100644
--- a/core/ajax/repo.ajax.php
+++ b/core/ajax/repo.ajax.php
@@ -62,6 +62,9 @@
if (!is_object($update)) {
$update = new update();
}
+ if ($update->getConfiguration('doNotUpdate') == 1) {
+ throw new Exception(__('Mise à jour et réinstallation désactivées sur ', __FILE__) . ' ' . $repo->getLogicalId());
+ }
$update->setSource(init('repo'));
$update->setLogicalId($repo->getLogicalId());
$update->setType($repo->getType());
diff --git a/core/class/cmd.class.php b/core/class/cmd.class.php
index 7743fe3c8f..f2e983a3a8 100644
--- a/core/class/cmd.class.php
+++ b/core/class/cmd.class.php
@@ -2155,7 +2155,7 @@ public function actionAlertLevel($_level, $_value) {
}
}
} elseif ($this->getConfiguration('alert::messageReturnBack') == 1) {
- $message = __('Retour à la normal de ', __FILE__) . ' ' . $this->getHumanName() . ' ' . __('valeur :', __FILE__) . ' ' . $_value . trim(' ' . $this->getUnite());
+ $message = __('Retour à la normale de ', __FILE__) . ' ' . $this->getHumanName() . ' ' . __('valeur :', __FILE__) . ' ' . $_value . trim(' ' . $this->getUnite());
log::add('event', 'info', $message);
$action = '' . __('Equipement', __FILE__) . '';
message::add($this->getEqLogic()->getEqType_name(), $message, $action, 'alertReturnBack_' . $this->getId() . '_' . strtotime('now') . '_' . rand(0, 999), true, 'alertingReturnBack');
@@ -2956,6 +2956,7 @@ public function setId($_id = '') {
*/
public function setName($_name) {
$_name = substr(cleanComponanteName($_name), 0, 127);
+ $_name = trim($_name);
if ($this->name != $_name) {
$this->_needRefreshWidget = true;
$this->_changed = true;
diff --git a/core/class/eqLogic.class.php b/core/class/eqLogic.class.php
index 21f8af6f5a..079288ea55 100644
--- a/core/class/eqLogic.class.php
+++ b/core/class/eqLogic.class.php
@@ -1837,6 +1837,7 @@ public function setId($_id) {
public function setName($_name) {
$_name = substr(cleanComponanteName($_name), 0, 127);
+ $_name = trim($_name);
if ($_name != $this->name) {
$this->_needRefreshWidget = true;
$this->_changed = true;
diff --git a/core/class/interactDef.class.php b/core/class/interactDef.class.php
index e8c71d7c4c..a5cda6334c 100644
--- a/core/class/interactDef.class.php
+++ b/core/class/interactDef.class.php
@@ -707,6 +707,7 @@ public function getName() {
}
public function setName($_name) {
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed, $this->name, $_name);
$this->name = $_name;
return $this;
diff --git a/core/class/jeeObject.class.php b/core/class/jeeObject.class.php
index 142eb34dea..efb641ad12 100644
--- a/core/class/jeeObject.class.php
+++ b/core/class/jeeObject.class.php
@@ -1267,14 +1267,14 @@ public function getName() {
}
public function getFather_id($_default = null) {
- if ($this->father_id == '' || !is_numeric($this->father_id)) {
+ if (!is_numeric($this->father_id)) {
return $_default;
}
return $this->father_id;
}
public function getIsVisible($_default = null) {
- if ($this->isVisible == '' || !is_numeric($this->isVisible)) {
+ if (!is_numeric($this->isVisible)) {
return $_default;
}
return $this->isVisible;
@@ -1288,6 +1288,7 @@ public function setId($_id) {
public function setName($_name) {
$_name = substr(cleanComponanteName($_name), 0, 127);
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed, $this->name, $_name);
$this->name = $_name;
return $this;
diff --git a/core/class/jeedom.class.php b/core/class/jeedom.class.php
index a0beacfc6f..b0d465631a 100644
--- a/core/class/jeedom.class.php
+++ b/core/class/jeedom.class.php
@@ -276,7 +276,7 @@ public static function health() {
$apaches = count(system::ps('apache2'));
$return[] = array(
- 'name' => __('Apache', __FILE__),
+ 'name' => __('Nombre de processus Apache', __FILE__),
'state' => ($apaches > 0),
'result' => $apaches,
'comment' => '',
diff --git a/core/class/log.class.php b/core/class/log.class.php
index c24e73fb3b..7417b366a5 100644
--- a/core/class/log.class.php
+++ b/core/class/log.class.php
@@ -279,10 +279,10 @@ public static function get($_log, $_begin, $_nbLines) {
* @param int $_colored Should lines be colored (default false)
* @param boolean $_numbered Should lines be numbered (default true)
* @param int $_numStart At what number should lines number start (default 0)
- * @param int $_max Max number of returned lines (default 4000)
+ * @param int $_max Max number of returned lines (default is config value "maxLineLog")
* @return array Array containing log to append to buffer and new position for next call
*/
- public static function getDelta($_log = 'core', $_position = 0, $_search = '', $_colored = false, $_numbered = true, $_numStart = 0, $_max = 4000) {
+ public static function getDelta($_log = 'core', $_position = 0, $_search = '', $_colored = false, $_numbered = true, $_numStart = 0, $_max = -1) {
// Add path to file if needed
$filename = (file_exists($_log) && is_file($_log)) ? $_log : self::getPathToLog($_log);
// Check if log file exists and is readable
@@ -326,6 +326,10 @@ public static function getDelta($_log = 'core', $_position = 0, $_search = '', $
if ($nbLogs == 0) {
return array('position' => $_position, 'line' => $_numStart, 'logText' => $logText);
}
+ // $_max default value is configured value of "maxLineLog"
+ $_max = ($_max < 0) ? self::getConfig('maxLineLog') : $_max;
+ // $_max value is always more than DEFAULT_MAX_LINE
+ $_max = max($_max, self::DEFAULT_MAX_LINE);
if ($nbLogs > $_max) {
// If logs must be TRUNCATED, then add a message
$logText .= "-------------------- TRUNCATED LOG --------------------\n";
diff --git a/core/class/note.class.php b/core/class/note.class.php
index cd9f61eb41..c7fa5b5b43 100644
--- a/core/class/note.class.php
+++ b/core/class/note.class.php
@@ -93,6 +93,7 @@ public function setId($_id) {
}
public function setName($_name) {
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed,$this->name,$_name);
$this->name = $_name;
return $this;
diff --git a/core/class/plan3d.class.php b/core/class/plan3d.class.php
index 9bec9401a1..e40c1a8fce 100644
--- a/core/class/plan3d.class.php
+++ b/core/class/plan3d.class.php
@@ -357,6 +357,7 @@ public function setId($_id) {
}
public function setName($_name) {
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed, $this->name, $_name);
$this->name = $_name;
return $this;
diff --git a/core/class/plan3dHeader.class.php b/core/class/plan3dHeader.class.php
index 84a6782cbe..ec5edde1a1 100644
--- a/core/class/plan3dHeader.class.php
+++ b/core/class/plan3dHeader.class.php
@@ -167,6 +167,7 @@ public function setId($_id) {
}
public function setName($_name) {
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed, $this->name, $_name);
$this->name = $_name;
return $this;
diff --git a/core/class/planHeader.class.php b/core/class/planHeader.class.php
index 8430ec25d5..ac7b137c40 100644
--- a/core/class/planHeader.class.php
+++ b/core/class/planHeader.class.php
@@ -225,6 +225,7 @@ public function setId($_id) {
}
public function setName($_name) {
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed, $this->name, $_name);
$this->name = $_name;
return $this;
diff --git a/core/class/plugin.class.php b/core/class/plugin.class.php
index a034c483f3..3ca0d07773 100644
--- a/core/class/plugin.class.php
+++ b/core/class/plugin.class.php
@@ -29,6 +29,7 @@ class plugin {
private $installation;
private $author;
private $require;
+ private $requireOsVersion;
private $category;
private $filepath;
private $index;
@@ -95,6 +96,7 @@ public static function byId($_id) {
$plugin->maxDependancyInstallTime = (isset($data['maxDependancyInstallTime'])) ? $data['maxDependancyInstallTime'] : 30;
$plugin->eventjs = (isset($data['eventjs'])) ? $data['eventjs'] : 0;
$plugin->require = (isset($data['require'])) ? $data['require'] : '';
+ $plugin->requireOsVersion = (isset($data['requireOsVersion'])) ? $data['requireOsVersion'] : '';
$plugin->category = (isset($data['category'])) ? $data['category'] : '';
$plugin->filepath = $path;
$plugin->index = (isset($data['index'])) ? $data['index'] : $data['id'];
@@ -931,6 +933,13 @@ public function setIsEnable($_state, $_force = false, $_foreground = false) {
if (version_compare(jeedom::version(), $this->getRequire()) == -1 && $_state == 1) {
throw new Exception(__('Votre version de Jeedom n\'est pas assez récente pour activer ce plugin', __FILE__));
}
+ $osVersion = $this->getRequireOsVersion();
+ $distrib = system::getDistrib();
+ if(isset($osVersion)){
+ if ($distrib == 'debian' && version_compare(system::getOsVersion(), $osVersion) == -1 && $_state == 1) {
+ throw new Exception(__('Votre version Debian n\'est pas assez récente pour activer cette version du plugin, '.$osVersion.' minimum demandé', __FILE__));
+ }
+ }
$alreadyActive = config::byKey('active', $this->getId(), 0);
if ($_state == 1) {
config::save('active', $_state, $this->getId());
@@ -1155,6 +1164,10 @@ public function getRequire() {
return $this->require;
}
+ public function getRequireOsVersion() {
+ return $this->requireOsVersion;
+ }
+
public function getCategory() {
return $this->category;
}
diff --git a/core/class/scenario.class.php b/core/class/scenario.class.php
index b96533afb9..befd464ba0 100644
--- a/core/class/scenario.class.php
+++ b/core/class/scenario.class.php
@@ -1730,6 +1730,7 @@ public function setId($_id) {
*/
public function setName($_name) {
$_name = cleanComponanteName($_name);
+ $_name = trim($_name);
if ($_name != $this->getName()) {
$this->_changeState = true;
$this->_changed = true;
diff --git a/core/class/scenarioElement.class.php b/core/class/scenarioElement.class.php
index 2a8e23d631..998fa3ce97 100644
--- a/core/class/scenarioElement.class.php
+++ b/core/class/scenarioElement.class.php
@@ -494,6 +494,7 @@ public function getName() {
}
public function setName($_name) {
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed, $this->name, $_name);
$this->name = $_name;
return $this;
diff --git a/core/class/scenarioSubElement.class.php b/core/class/scenarioSubElement.class.php
index 72d666a16f..9bb46b1d7c 100644
--- a/core/class/scenarioSubElement.class.php
+++ b/core/class/scenarioSubElement.class.php
@@ -149,6 +149,7 @@ public function getName() {
}
public function setName($_name) {
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed, $this->name, $_name);
$this->name = $_name;
return $this;
diff --git a/core/class/timeline.class.php b/core/class/timeline.class.php
index ec284ebee5..7e9b878c17 100644
--- a/core/class/timeline.class.php
+++ b/core/class/timeline.class.php
@@ -303,6 +303,7 @@ public function setId($_id = '') {
}
public function setName($_name) {
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed,$this->name,$_name);
$this->name = $_name;
return $this;
diff --git a/core/class/update.class.php b/core/class/update.class.php
index 94fa5aeac6..8067db4cb2 100644
--- a/core/class/update.class.php
+++ b/core/class/update.class.php
@@ -318,6 +318,11 @@ public function doUpdate() {
$zip = new ZipArchive;
$res = $zip->open($tmp);
if ($res === TRUE) {
+ if(version_compare(PHP_VERSION, '8.0.0') >= 0){
+ for($i=0; $i<$zip->numFiles; $i++){
+ $zip->setMtimeIndex($i, strtotime('now'));
+ }
+ }
if (!$zip->extractTo($cibDir . '/')) {
$content = file_get_contents($tmp);
throw new Exception(__("Impossible d'installer le plugin. Les fichiers n'ont pas pu être décompressés", __FILE__) . ' : ' . substr($content, 255));
diff --git a/core/class/utils.class.php b/core/class/utils.class.php
index b7cf9ce772..dadef62f97 100644
--- a/core/class/utils.class.php
+++ b/core/class/utils.class.php
@@ -21,25 +21,25 @@
class utils {
/* * *************************Attributs****************************** */
-
+
private static $properties = array();
private static $jeedom_encryption = null;
-
+
/* * ***********************Methode static*************************** */
-
- public static function attrChanged($_changed,$_old,$_new){
- if($_changed){
+
+ public static function attrChanged($_changed, $_old, $_new) {
+ if ($_changed) {
return true;
}
- if(is_array($_old)){
+ if (is_array($_old)) {
$_old = json_encode($_old);
}
- if(is_array($_new)){
+ if (is_array($_new)) {
$_new = json_encode($_new);
}
return ($_old != $_new);
}
-
+
/**
* @param object $_object
* @param bool $_noToArray
@@ -80,7 +80,7 @@ public static function o2a($_object, $_noToArray = false) {
}
return $array;
}
-
+
public static function a2o(&$_object, $_data) {
if (is_array($_data)) {
foreach ($_data as $key => $value) {
@@ -113,7 +113,7 @@ public static function a2o(&$_object, $_data) {
}
}
}
-
+
public static function processJsonObject($_class, $_ajaxList, $_dbList = null) {
if (!is_array($_ajaxList)) {
if (is_json($_ajaxList)) {
@@ -128,7 +128,7 @@ public static function processJsonObject($_class, $_ajaxList, $_dbList = null) {
}
$_dbList = $_class::all();
}
-
+
$enableList = array();
foreach ($_ajaxList as $ajaxObject) {
$object = $_class::byId($ajaxObject['id']);
@@ -145,7 +145,7 @@ public static function processJsonObject($_class, $_ajaxList, $_dbList = null) {
}
}
}
-
+
public static function setJsonAttr($_attr, $_key, $_value = null) {
if ($_value === null && !is_array($_key)) {
if (!is_array($_attr)) {
@@ -164,7 +164,7 @@ public static function setJsonAttr($_attr, $_key, $_value = null) {
}
return $_attr;
}
-
+
public static function getJsonAttr(&$_attr, $_key = '', $_default = '') {
if (is_array($_attr)) {
if ($_key == '') {
@@ -194,53 +194,86 @@ public static function getJsonAttr(&$_attr, $_key = '', $_default = '') {
}
return (isset($_attr[$_key]) && $_attr[$_key] !== '') ? $_attr[$_key] : $_default;
}
-
+
/* * ******************Encrypt/decrypt*************************** */
- public static function getEncryptionPassword(){
- if(self::$jeedom_encryption == null){
- if(!file_exists(__DIR__.'/../../data/jeedom_encryption.key')){
- file_put_contents(__DIR__.'/../../data/jeedom_encryption.key',config::genKey());
+ public static function getEncryptionPassword() {
+ if (self::$jeedom_encryption == null) {
+ if (!file_exists(__DIR__ . '/../../data/jeedom_encryption.key')) {
+ file_put_contents(__DIR__ . '/../../data/jeedom_encryption.key', config::genKey());
}
- self::$jeedom_encryption = file_get_contents(__DIR__.'/../../data/jeedom_encryption.key');
+ self::$jeedom_encryption = file_get_contents(__DIR__ . '/../../data/jeedom_encryption.key');
}
return self::$jeedom_encryption;
}
-
+
public static function encrypt($plaintext, $password = null) {
- if($plaintext === ''){
+ if ($plaintext === '') {
return null;
}
- if($plaintext == ''){
+ if ($plaintext == '') {
return $plaintext;
}
- if(strpos($plaintext,'crypt:') !== false){
+ if (strpos($plaintext, 'crypt:') !== false) {
return $plaintext;
}
- if($password == null){
+ if ($password == null) {
$password = self::getEncryptionPassword();
}
$iv = openssl_random_pseudo_bytes(16);
$ciphertext = openssl_encrypt($plaintext, "AES-256-CBC", hash('sha256', $password, true), OPENSSL_RAW_DATA, $iv);
- $hmac = hash_hmac('sha256', $ciphertext.$iv, hash('sha256', $password, true), true);
- return 'crypt:'.base64_encode($iv.$hmac.$ciphertext);
+ $hmac = hash_hmac('sha256', $ciphertext . $iv, hash('sha256', $password, true), true);
+ return 'crypt:' . base64_encode($iv . $hmac . $ciphertext);
}
-
+
public static function decrypt($ciphertext, $password = null) {
- if($ciphertext === ''){
+ if ($ciphertext === '') {
return null;
}
- if($password == null){
+ if ($password == null) {
$password = self::getEncryptionPassword();
}
- if(strpos($ciphertext,'crypt:') === false){
+ if (strpos($ciphertext, 'crypt:') === false) {
return $ciphertext;
}
- $ciphertext = base64_decode(str_replace('crypt:','',$ciphertext));
- if (!hash_equals(hash_hmac('sha256', substr($ciphertext, 48).substr($ciphertext, 0, 16), hash('sha256', $password, true), true), substr($ciphertext, 16, 32))) return null;
+ $ciphertext = base64_decode(str_replace('crypt:', '', $ciphertext));
+ if (!hash_equals(hash_hmac('sha256', substr($ciphertext, 48) . substr($ciphertext, 0, 16), hash('sha256', $password, true), true), substr($ciphertext, 16, 32))) return null;
return openssl_decrypt(substr($ciphertext, 48), "AES-256-CBC", hash('sha256', $password, true), OPENSSL_RAW_DATA, substr($ciphertext, 0, 16));
}
-
+
+ /**
+ * This function allows asynchronous execution of any class function.
+ * A cron will be created to execute it immediately (by default) or at the given datetime.
+ * To pass arguments to your function, you should pass an array of values in $options
+ *
+ * @param string $class A class name
+ * @param string $method The method name
+ * @param array|null $options An array of options that will be passed to the cron
+ * @param string $datetime Any English textual datetime description that can be parsed by strtotime()
+ * @return void
+ *
+ * @throws InvalidArgumentException if $class::$method does not exist
+ */
+ public static function executeAsync($class, $method, $options = null, $datetime = 'now') {
+ if (!method_exists($class, $method)) {
+ throw new InvalidArgumentException("Method provided for executeAsync does not exist: {$class}::{$method}");
+ }
+
+ $cron = new cron();
+ $cron->setClass($class);
+ $cron->setFunction($method);
+ if (isset($options)) {
+ $cron->setOption($options);
+ }
+ $cron->setOnce(1);
+ $scheduleTime = strtotime($datetime);
+ $cron->setSchedule(cron::convertDateToCron($scheduleTime));
+ $cron->save();
+ if ($scheduleTime <= strtotime('now')) {
+ $cron->run();
+ }
+ }
+
/* * *********************Methode d'instance************************* */
-
+
/* * **********************Getteur Setteur*************************** */
}
diff --git a/core/class/view.class.php b/core/class/view.class.php
index a2f12e653c..eb0f554121 100644
--- a/core/class/view.class.php
+++ b/core/class/view.class.php
@@ -300,6 +300,7 @@ public function getName() {
}
public function setName($_name) {
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed, $this->name, $_name);
$this->name = $_name;
return $this;
diff --git a/core/class/widgets.class.php b/core/class/widgets.class.php
index 86e1235e2d..6e708270c8 100644
--- a/core/class/widgets.class.php
+++ b/core/class/widgets.class.php
@@ -279,6 +279,7 @@ public function setId($_id = '') {
public function setName($_name) {
$_name = str_replace(array('&', '#', ']', '[', '%', "'"), '', $_name);
+ $_name = trim($_name);
$this->_changed = utils::attrChanged($this->_changed,$this->name,$_name);
$this->name = $_name;
return $this;
diff --git a/core/config/version b/core/config/version
index 9e3a93350d..5f7049803b 100644
--- a/core/config/version
+++ b/core/config/version
@@ -1 +1 @@
-4.4.3
+4.4.5
\ No newline at end of file
diff --git a/core/dom/dom.ui.js b/core/dom/dom.ui.js
index 66e253161e..44ae6a101b 100644
--- a/core/dom/dom.ui.js
+++ b/core/dom/dom.ui.js
@@ -1706,8 +1706,8 @@ var jeeDialog = (function() {
}
}
function resizing(event) {
- let clientX = event.clientX || event.targetTouches[0].pageX
- let clientY = event.clientY || event.targetTouches[0].pageY
+ let clientX = (typeof event.clientX == 'number') ? event.clientX : event.targetTouches[0].pageX
+ let clientY = (typeof event.clientY == 'number') ? event.clientY : event.targetTouches[0].pageY
if (resizer.includes('top')) {
dialogContainer.style.top = clientY + 'px'
let height = initialHeight + (initialTop - clientY)
@@ -1956,7 +1956,7 @@ var jeeCtxMenu = function(_options) {
appendTo: 'body',
items: false,
className: '',
- autoHide: true,
+ autoHide: false,
zIndex: 12000,
isDisable: false,
callback: false, //Default item callback
@@ -2081,7 +2081,16 @@ var jeeCtxMenu = function(_options) {
if (!event.target.closest('div.jeeCtxMenu').isVisible()) return //May be closed by click, avoir twice hide
ctxInstance.hide(event)
}, 100)
-
+ })
+ }else{
+ document.addEventListener('click', event => {
+ if (ctxMenuContainer.contains(event.target)) {
+ return;
+ }
+ setTimeout(function() {
+ if (!ctxMenuContainer.closest('div.jeeCtxMenu').isVisible()) return //May be closed by click, avoir twice hide
+ ctxInstance.hide(event)
+ }, 100)
})
}
diff --git a/core/js/eqLogic.class.js b/core/js/eqLogic.class.js
index ff8ce66edc..abeea5e09e 100644
--- a/core/js/eqLogic.class.js
+++ b/core/js/eqLogic.class.js
@@ -264,7 +264,8 @@ jeedom.eqLogic.toHtml = function(_params) {
paramsAJAX.data = {
action: 'toHtml',
id: _params.id,
- version: _params.version
+ version: _params.version,
+ global : _params.global || false
}
domUtils.ajax(paramsAJAX)
}
@@ -465,6 +466,35 @@ jeedom.eqLogic.refreshValue = function(_params) {
let container = document.querySelector('.alertListContainer')
Packery.data(container).destroy()
new Packery(container, { itemSelector: "#alertEqlogic .eqLogic-widget", isLayoutInstant: true, transitionDuration: 0 })
+ } else if (page == 'plan' && !jeeFrontEnd.planEditOption.state) { //no create if plan is in edition
+ jeedom.plan.byPlanHeader({
+ id: jeephp2js.planHeader_id,
+ global: false,
+ error: function(error) {
+ jeedomUtils.showAlert({
+ message: error.message,
+ level: 'danger'
+ })
+ },
+ success: function(plans) {
+ try {
+ var object
+ for (var ii in plans) {
+ if (plans[ii].plan.link_id == result[i].id) {
+ object = jeeP.displayObject(plans[ii].plan, plans[ii].html, true)
+ if (object != undefined) {
+ jeeFrontEnd.plan.planContainer.appendChild(object)
+ if (jeeFrontEnd.plan.cssStyleString != '') {
+ jeeFrontEnd.plan.pageContainer.insertAdjacentHTML('beforeend', jeeFrontEnd.plan.cssStyleString)
+ jeeFrontEnd.plan.cssStyleString = ''
+ }
+ }
+ break;
+ }
+ }
+ } catch (e) { console.error(e) }
+ }
+ })
}
} else {
if (page == 'eqAnalyse' && result[i].alert == '') {
@@ -502,8 +532,8 @@ jeedom.eqLogic.refreshValue = function(_params) {
if (jeedomUtils.userDevice.type == undefined) {
eqLogic.triggerEvent('create')
jeedomUtils.setTileSize('.eqLogic')
- } else if (jeeFrontEnd.dashboard && jeeFrontEnd.dashboard.editWidgetMode && typeof jeeFrontEnd.dashboard.editWidgetMode == 'function' && document.getElementById('bt_editDashboardWidgetOrder') != null) {
- jeeFrontEnd.dashboard.editWidgetMode()
+ } else if (jeedomUI && typeof jeeFrontEnd?.dashboard?.editWidgetMode == 'function' && document.getElementById('bt_editDashboardWidgetOrder') != null) {
+ jeeFrontEnd.dashboard.editWidgetMode(jeedomUI?.isEditing,false)
}
}
}
diff --git a/core/js/jeedom.class.js b/core/js/jeedom.class.js
index 7299a0e13c..3ade67f5a7 100644
--- a/core/js/jeedom.class.js
+++ b/core/js/jeedom.class.js
@@ -74,9 +74,6 @@ jeedom.changes = function() {
continue
}
if (data.result[i].name == 'eqLogic::update') {
- if(jeedomUI?.isEditing){
- continue
- }
eqLogic_update.push(data.result[i].option)
continue
}
diff --git a/core/php/utils.inc.php b/core/php/utils.inc.php
index 396b61e754..d63792f03c 100644
--- a/core/php/utils.inc.php
+++ b/core/php/utils.inc.php
@@ -131,7 +131,7 @@ function template_replace($_array, $_subject) {
$_array['#uid#'] = '';
}
if (strpos($_array['#uid#'], 'eqLogic') !== false && (!isset($_array['#calledFrom#']) || $_array['#calledFrom#'] != 'eqLogic')) {
- if (is_object($eqLogic = eqLogic::byId($_array['#id#'])) && $eqLogic->getDisplay('widgetTmpl', 1) == 0) {
+ if (is_object($eqLogic = eqLogic::byId($_array['#id#'])) && ($eqLogic->getDisplay('widgetTmpl', 1) == 0 || $_subject == '')) {
$reflected = new ReflectionClass($eqLogic->getEqType_name());
$method = $reflected->getParentClass()->getMethod('toHtml');
return $method->invokeArgs($eqLogic, [$_array['#version#']]);
diff --git a/core/repo/market.list.repo.php b/core/repo/market.list.repo.php
index a5d74527f8..62b85b63fc 100644
--- a/core/repo/market.list.repo.php
+++ b/core/repo/market.list.repo.php
@@ -4,9 +4,9 @@
}
$type = init('type', null);
- $categorie = init('categorie', null);
- $name = init('name', null);
- $author = init('author', null);
+ $categorie = init('categorie', null) === '' ? null : init('categorie', null);
+ $name = init('name', null) === '' ? null : init('name', null);
+ $author = init('author', null) === '' ? null : init('author', null);
if ($name == 'false') {
$name = null;
@@ -367,7 +367,7 @@ function buildUrl($_key, $_value) {
var _target = null
if (_target = event.target.closest('#sel_categorie')) {
let content = jeeDialog.get('#in_search', 'content')
- content.load(this.getAttribute('data-href') + '&categorie=' + encodeURI(this.value))
+ content.load(_target.getAttribute('data-href') + '&categorie=' + encodeURI(_target.value))
return
}
})
diff --git a/core/repo/market.repo.php b/core/repo/market.repo.php
index 501daf3192..3e57ce481c 100644
--- a/core/repo/market.repo.php
+++ b/core/repo/market.repo.php
@@ -145,6 +145,7 @@ public static function pullInstall() {
$update->setType($repo->getType());
$update->setLocalVersion($repo->getDatetime($plugin['version']));
$update->setConfiguration('version', $plugin['version']);
+ $update->setConfiguration('user',null);
$update->save();
$update->doUpdate();
$nbInstall++;
diff --git a/desktop/common/js/utils.js b/desktop/common/js/utils.js
index 9123314f4d..1cd2b44835 100644
--- a/desktop/common/js/utils.js
+++ b/desktop/common/js/utils.js
@@ -431,7 +431,7 @@ jeedomUtils.setJeedomTheme = function() {
}
setCookie('currentTheme', themeCook, 30)
cssTag.setAttribute('href', theme)
- document.getElementById('bt_switchTheme').innerHTML = themeButton
+ if (document.getElementById('bt_switchTheme') != null) document.getElementById('bt_switchTheme').innerHTML = themeButton
if (document.getElementById('shadows_theme_css') != null) document.getElementById('shadows_theme_css').href = themeShadows
jeedomUtils.triggerThemechange()
let backgroundImgPath = jeedomUtils._elBackground.querySelector('#bottom').style.backgroundImage
@@ -1038,6 +1038,7 @@ jeedomUtils.TOOLTIPSOPTIONS = {
allowHTML: true,
distance: 10,
delay: [50, 0],
+ touch: ['hold', 200],
//trigger: 'click',
//hideOnClick: false
}
diff --git a/desktop/css/coreWidgets.css b/desktop/css/coreWidgets.css
index bc3b59d887..03836d47d6 100644
--- a/desktop/css/coreWidgets.css
+++ b/desktop/css/coreWidgets.css
@@ -480,7 +480,6 @@ label.binarySwitch>input:checked+span.binarySwitch {
/* ____________________others */
div.arcgauge .content {
position: relative;
- clip-path: polygon(0 -5px, 100% -5px, 100% 100%, 0 100%);
}
div.arcgauge .gauge,
@@ -611,7 +610,7 @@ div.cmd-widget.widget-compass .widget-compass-needle-placer {
}
div.cmd-widget.widget-compass .widget-compass-needle {
- position: relative;
+ position: fixed;
width: 0px;
height: 0px;
border: 8px solid transparent;
diff --git a/desktop/js/dashboard.js b/desktop/js/dashboard.js
index eebbc78f5a..f75788ac87 100644
--- a/desktop/js/dashboard.js
+++ b/desktop/js/dashboard.js
@@ -126,14 +126,6 @@ if (!jeeFrontEnd.dashboard) {
},
editWidgetMode: function(_mode, _save) {
if (document.getElementById('bt_editDashboardWidgetOrder') == null) return
- if (!isset(_mode)) {
- if (document.getElementById('bt_editDashboardWidgetOrder').getAttribute('data-mode') != undefined && document.getElementById('bt_editDashboardWidgetOrder').getAttribute('data-mode') == 1) {
- this.editWidgetMode(0, false)
- this.editWidgetMode(1, false)
- }
- return
- }
-
if (_mode == 0) { //Exit edit mode:
document.getElementById('div_displayObject').style.height = 'auto'
document.querySelectorAll('.widget-name a.reportModeHidden, .scenario-widget .widget-name a').removeClass('disabled')
diff --git a/desktop/js/display.js b/desktop/js/display.js
index 88007afa4b..505055dc90 100644
--- a/desktop/js/display.js
+++ b/desktop/js/display.js
@@ -28,7 +28,7 @@ if (!jeeFrontEnd.display) {
this.setSortables()
var checkContextMenuCallback = function(_el) {
- _el.trigger('change')
+ _el.triggerEvent('change')
}
jeedomUtils.setCheckContextMenu(checkContextMenuCallback)
},
diff --git a/desktop/js/history.js b/desktop/js/history.js
index 55f600a53e..e1240e6631 100644
--- a/desktop/js/history.js
+++ b/desktop/js/history.js
@@ -223,9 +223,9 @@ if (!jeeFrontEnd.history) {
var text = '{{Comparer}} ' + diffPeriod + ' {{jours avec}} ' + cdiffPeriod + ' {{jours il y a}} ' + document.getElementById('sel_comparePeriod').selectedOptions[0].text
_md.querySelector('.spanCompareDiffResult').textContent = text
if (diffPeriod != cdiffPeriod) {
- jeeDialog.get('#md_historyCompare').show()
+ _md.querySelector('.spanCompareDiff').seen()
} else {
- jeeDialog.get('#md_historyCompare').hide()
+ _md.querySelector('.spanCompareDiff').unseen()
}
return
}
@@ -237,7 +237,7 @@ if (!jeeFrontEnd.history) {
var m_startDate = moment(startDate, 'YYYY-MM-DD HH:mm:ss')
var endDate = m_startDate.subtract(num, type).format("YYYY-MM-DD")
- document.getElementById('in_compareStart1').value = endDate
+ _md.querySelector('#in_compareStart1').value = endDate
//range to compare with:
num = _md.querySelector('#sel_comparePeriod').value.split('.')[0]
@@ -247,6 +247,7 @@ if (!jeeFrontEnd.history) {
m_startDate = moment(startDate, 'YYYY-MM-DD HH:mm:ss')
endDate = m_startDate.subtract(num, type).format("YYYY-MM-DD")
_md.querySelector('#in_compareStart2').value = endDate
+ _md.querySelector('input.in_datepicker').triggerEvent('change')
return
}
@@ -263,6 +264,7 @@ if (!jeeFrontEnd.history) {
m_startDate = moment(startDate, 'YYYY-MM-DD HH:mm:ss')
endDate = m_startDate.subtract(num, type).format("YYYY-MM-DD")
_md.querySelector('#in_compareStart2').value = endDate
+ _md.querySelector('input.in_datepicker').triggerEvent('change')
return
}
})
@@ -274,6 +276,7 @@ if (!jeeFrontEnd.history) {
},
onShown: function() {
jeeDialog.get('#md_historyCompare', 'content').querySelector('#md_getCompareRange').removeClass('hidden')
+ jeedomUtils.datePickerInit()
},
buttons: {
confirm: {
diff --git a/desktop/js/plan.js b/desktop/js/plan.js
index 2ecdcb46bc..a7fd4a2d65 100644
--- a/desktop/js/plan.js
+++ b/desktop/js/plan.js
@@ -276,7 +276,7 @@ if (!jeeFrontEnd.plan) {
}
css_selector = '.div_displayObject .graph-widget[data-graph_id="' + _plan.link_id + '"]'
document.querySelector(css_selector)?.remove()
- if (init(_plan.display.transparentBackground, false)) {
+ if (init(_plan.display.transparentBackground, 0) == 1) {
_html = _html.replace('class="graph-widget"', 'class="graph-widget transparent"')
}
}
@@ -429,8 +429,8 @@ if (!jeeFrontEnd.plan) {
}
}
- document.querySelector('#style_' + _plan.link_type + '_' + _plan.link_id)?.remove()
- var style_el = '