Skip to content
Permalink
Browse files

Blockly fix

  • Loading branch information...
sergejey committed Aug 2, 2019
1 parent 4c02f16 commit 8a0cf6659a53a903d819cd031184f80e21b23eae
@@ -439,8 +439,9 @@ function init() {
if (!$total) {
continue;
}
if ($locations[$il]['TITLE']) {
echo '<category name="'.LANG_DEVICES.' - '.$locations[$il]['TITLE'].'">'."\n";
$location_title = processTitle($locations[$il]['TITLE']);
if ($location_title) {
echo '<category name="'.LANG_DEVICES.' - '.$location_title.'">'."\n";
} else {
echo '<category name="'.LANG_DEVICES.'">'."\n";
}
@@ -139,7 +139,8 @@ function admin(&$out) {
}
if (!$rec['ID'] && !$this->type) {
$rec['CODE_TYPE']=2;
$rec['CODE_TYPE']=0;
$rec['CODE_TYPE_UNKNOWN']=1;
}
@@ -481,14 +481,19 @@ function processSubscription($event, &$details)
if ($diff < 0 || $diff >= 10 * 60) {
continue;
}
//DebMes("Checking point: ".json_encode($rec,JSON_PRETTY_PRINT),'devices_schedule');
$tmlr = strtotime($rec['LATEST_RUN']);
$diff_run = time() - $tmlr;
if ($diff_run <= 20*60)
if ($diff_run <= 20*60) {
//DebMes("Skipping point (diff_run: $diff_run): ".json_encode($rec,JSON_PRETTY_PRINT),'devices_schedule');
continue;
}
$linked_object = $rec['LINKED_OBJECT'];
unset($rec['LINKED_OBJECT']);
$rec['LATEST_RUN'] = date('Y-m-d H:i:s');
SQLUpdate('devices_scheduler_points', $rec);
DebMes("Running point: ".$linked_object.'.'.$rec['LINKED_METHOD'],'devices_schedule');
callMethodSafe($linked_object . '.' . $rec['LINKED_METHOD']);
}
}
@@ -15,9 +15,9 @@
<#LANG_CODE_TYPE#>:<br>

<div>
<input type="radio" name="[#CODE_FIELD#]_code_type" class="[#CODE_FIELD#]_code_type" value="2"[#if CODE_TYPE="2"#] checked[#endif#]> <#LANG_DEVICES#><#LANG_HCB#>codeDevices<#LANG_HCE#>
<input type="radio" name="[#CODE_FIELD#]_code_type" class="[#CODE_FIELD#]_code_type" value="1"[#if CODE_TYPE="1"#] checked[#endif#]> Blockly<#LANG_HCB#>codeBlockly<#LANG_HCE#>
<input type="radio" name="[#CODE_FIELD#]_code_type" class="[#CODE_FIELD#]_code_type" value="0"[#if CODE_TYPE="0"#] checked[#endif#]> PHP <#LANG_HCB#>codePhp<#LANG_HCE#>
<input type="radio" name="[#CODE_FIELD#]_code_type" class="[#CODE_FIELD#]_code_type" value="1"[#if CODE_TYPE="1"#] checked[#endif#]> Blockly<#LANG_HCB#>codeBlockly<#LANG_HCE#>
<input type="radio" name="[#CODE_FIELD#]_code_type" class="[#CODE_FIELD#]_code_type" value="2"[#if CODE_TYPE="2"#] checked[#endif#]> <#LANG_DEVICES#><#LANG_HCB#>codeDevices<#LANG_HCE#>
</div>

<script language="javascript">
@@ -46,13 +46,14 @@
[#endif TYPE#]


[#if CODE_TYPE="1" || CODE_TYPE="2"#]
<script language="javascript" type="text/javascript">
$(function() {
$('#[#CODE_FIELD#]_area').hide();
// alert([#CODE_TYPE#]);
[#if CODE_TYPE="1" || CODE_TYPE="2"#]
$('#[#CODE_FIELD#]_area').hide();
[#endif CODE_TYPE#]
});
</script>
[#endif CODE_TYPE#]

[#if CODE_TYPE="0"#]
<script src="<#ROOTHTML#>3rdparty/codemirror/lib/codemirror.js"></script>

0 comments on commit 8a0cf66

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