Skip to content
Permalink
Browse files

Updates

* 3rd party: Fancybox lib update
* API: not passing params to module api() fixed
* db_terminal -- minor error in data fixed
* Settings: ability to disable DebMes logging
* Scenes: bug with elements linked to device fixed
* Simple Devices: openable status minor bug fixed
  • Loading branch information...
sergejey committed Oct 3, 2019
1 parent 334c845 commit 5d78f78c03eb817b305987cd5a5b65979fae2dbc

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -219,9 +219,11 @@
include_once($module_file);
$module = new $module_name;
if (method_exists($module,'api')) {
$params = $request;
array_shift($params);
array_shift($params);
$params = $_REQUEST;
$r = $request;
array_shift($r);
array_shift($r);
$params['request']=$r;
$result['apiHandleResult']=$module->api($params);
}
}
@@ -428,7 +428,7 @@ INSERT INTO `country` (`COUNTRY_ID`, `COUNTRY_GUID`, `COUNTRY_NAME`, `LM_DATE`,
(16, '1C37B968-7D44-2AED-7171-116232E0376F', 'Bosnia and Herzegovina', '2015-04-14 12:09:36', 'BA', '387', NULL, NULL),
(17, '784A4C7F-8B44-353A-8B27-996E1B38791C', 'Barbados', '2015-04-14 12:09:36', 'BB', '1246', NULL, NULL),
(18, '735D20D8-45D8-B861-6B2B-9F1B22F86447', 'Bangladesh', '2015-04-14 12:09:36', 'BD', '880', NULL, NULL),
(19, '3B71F5B5-2AC2-9154-404D-191ABFBC4729', 'Belgium', '0000-00-00 00:00:00', '2015-04-', '32', NULL, NULL),
(19, '3B71F5B5-2AC2-9154-404D-191ABFBC4729', 'Belgium', '2015-04-14 12:09:36', 'BE', '32', NULL, NULL),
(20, 'B5CB258B-4F64-D109-E9D5-60A78ED0A637', 'Burkina Faso', '2015-04-14 12:09:36', 'BF', '226', NULL, NULL),
(21, '1B6E6DAD-F17E-C6C0-61A4-41B20394BDBE', 'Bulgaria', '2015-04-14 12:09:36', 'BG', '359', NULL, NULL),
(22, '6AB06D58-6177-06A7-0937-AA363E22FE30', 'Bahrain', '2015-04-14 12:09:36', 'BH', '973', NULL, NULL),
@@ -535,6 +535,8 @@ function setLocalTime($now_date, $diff = 0)
function DebMes($errorMessage, $logLevel = "debug")
{
if (defined('SETTINGS_SYSTEM_DISABLE_DEBMES') && SETTINGS_SYSTEM_DISABLE_DEBMES==1) return;
if (defined('LOG_DIRECTORY') && LOG_DIRECTORY!='') {
$path=LOG_DIRECTORY;
} else {
@@ -21,7 +21,7 @@
}
if ($this->getProperty('notify_status')) {
if (isset($params['NEW_VALUE'])) {
if (($params['NEW_VALUE'] && $ncno == 'no') || (!$params['NEW_VALUE'] && $ncno == 'nc'))
if (!$params['NEW_VALUE'])
saySafe($description . ' ' . LANG_DEVICES_STATUS_OPEN, 2);
else
saySafe($description . ' ' . LANG_DEVICES_STATUS_CLOSED, 2);
@@ -31,7 +31,7 @@
if ($this->getProperty('notify_nc')) {
if (isset($params['NEW_VALUE'])) {
if (($params['NEW_VALUE'] && $ncno == 'no') || (!$params['NEW_VALUE'] && $ncno == 'nc')) {
if (!$params['NEW_VALUE']) {
setTimeout($ot . '_notify_timer_1', "saySafe('" . $description . " " . LANG_DEVICES_STATUS_OPEN . "!', 5);", 5 * 60);
setTimeout($ot . '_notify_timer_2', "saySafe('" . $description . " " . LANG_DEVICES_STATUS_OPEN . "!', 5);", 10 * 60);
setTimeout($ot . '_notify_timer_3', "saySafe('" . $description . " " . LANG_DEVICES_STATUS_OPEN . "!', 5);", 15 * 60);
@@ -401,43 +401,29 @@ function delete_scripts($id)
*
* @access public
*/
function checkScheduledScripts()
{
$scripts = SQLSelect("SELECT ID, TITLE, RUN_DAYS, RUN_TIME FROM scripts WHERE RUN_PERIODICALLY=1 AND (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(EXECUTED))>1200");
function checkScheduledScripts() {
$scripts = SQLSelect("SELECT ID, TITLE, RUN_DAYS, RUN_TIME FROM scripts WHERE RUN_PERIODICALLY=1 AND ((UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(EXECUTED))>60 OR IsNull(EXECUTED))");
$total = count($scripts);
for ($i = 0; $i < $total; $i++) {
$rec = $scripts[$i];
if ($rec['RUN_DAYS'] === '') {
if ($rec['RUN_DAYS'] == '') {
continue;
}
$run_days = explode(',', $rec['RUN_DAYS']);
$today=date('w');
if (!in_array($today, $run_days)) {
continue;
}
$tm = strtotime(date('Y-m-d') . ' ' . $rec['RUN_TIME']);
$tm = strtotime(date('Y-m-d') . ' ' . $rec['RUN_TIME']. ':00');
$diff = time() - $tm;
if ($diff < 0 || $diff >= 10 * 60) {
if ($diff < 0 || $diff > 60) {
continue;
}
DebMes("Running scheduled script ".$rec['TITLE'],'scripts');
runScriptSafe($rec['TITLE']);
$rec['DIFF'] = $diff;
//print_r($rec);
}
//print_r($scripts);
}
function propertySetHandle($object, $property, $value)

0 comments on commit 5d78f78

Please sign in to comment.
You can’t perform that action at this time.