-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Light Control Panel theme by default * Simple Devices: schedule UI update * Minor fixes
- Loading branch information
Showing
11 changed files
with
150 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
$out['ALL_DEVICES'] = SQLSelect("SELECT ID, TITLE FROM devices ORDER BY TITLE"); | ||
|
||
$days=array( | ||
array('VALUE'=>0,'TITLE'=>LANG_WEEK_SUN), | ||
array('VALUE'=>1,'TITLE'=>LANG_WEEK_MON), | ||
array('VALUE'=>2,'TITLE'=>LANG_WEEK_TUE), | ||
array('VALUE'=>3,'TITLE'=>LANG_WEEK_WED), | ||
array('VALUE'=>4,'TITLE'=>LANG_WEEK_THU), | ||
array('VALUE'=>5,'TITLE'=>LANG_WEEK_FRI), | ||
array('VALUE'=>6,'TITLE'=>LANG_WEEK_SAT), | ||
); | ||
|
||
//$point=SQLSelectOne("SELECT * FROM devices_scheduler_points WHERE ID=".(int)$point_id); | ||
//$devices = SQLSelect("SELECT devices.* FROM devices") | ||
$tmp = array_map('current',SQLSelect("SELECT DEVICE_ID FROM devices_scheduler_points GROUP BY DEVICE_ID")); | ||
if (is_array($tmp)) { | ||
$devices = SQLSelect("SELECT * FROM devices WHERE ID IN (".implode(',',$tmp).") ORDER BY devices.TITLE"); | ||
$total = count($devices); | ||
for($i=0;$i<$total;$i++) { | ||
$points=SQLSelect("SELECT * FROM devices_scheduler_points WHERE DEVICE_ID=".(int)$devices[$i]['ID']); | ||
foreach($points as &$point_item) { | ||
$point_days=explode(',',$point_item['SET_DAYS']); | ||
$point_days_title=array(); | ||
foreach($days as $k=>$v) { | ||
if (in_array($v['VALUE'],$point_days)) { | ||
$point_days_title[]=$v['TITLE']; | ||
} | ||
} | ||
$rule=SQLSelectOne("SELECT ID FROM security_rules WHERE OBJECT_TYPE='spoint' AND OBJECT_ID=".$point_item['ID']); | ||
if ($rule['ID']) { | ||
$point_item['HAS_RULE']=1; | ||
} | ||
/* | ||
foreach($out['SHOW_METHODS'] as $method) { | ||
if ($method['NAME']==$point_item['LINKED_METHOD']) { | ||
$point_item['LINKED_METHOD']=$method['DESCRIPTION']; | ||
break; | ||
} | ||
} | ||
*/ | ||
$point_item['SET_DAYS']=implode(', ',$point_days_title); | ||
} | ||
$devices[$i]['POINTS']=$points; | ||
} | ||
$out['DEVICES']=$devices; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<p><a href="#" class="btn btn-default" id="new_schedule_link" onclick="$('#new_schedule_link').hide();$('#new_schedule').show();"><i class="glyphicon glyphicon-plus"></i> <#LANG_ADD#></a> | ||
<div id="new_schedule" style="display:none"> | ||
<form method="get" action="?"> | ||
<div class="form-group"> | ||
<select name="id" onchange="this.form.submit();" class="form-control"> | ||
<option value="0"><#LANG_DEVICES#></option> | ||
[#begin ALL_DEVICES#] | ||
<option value="[#ID#]">[#TITLE#]</option> | ||
[#end ALL_DEVICES#] | ||
</select> | ||
</div> | ||
<input type="hidden" name="view_mode" value="edit_devices"> | ||
<input type="hidden" name="tab" value="schedule"> | ||
</form> | ||
</div> | ||
</p> | ||
|
||
<table class="table"> | ||
[#begin DEVICES#] | ||
<tr> | ||
<td><a href="?view_mode=edit_devices&id=[#ID#]&tab=schedule">[#TITLE#]</a></td> | ||
<td> | ||
|
||
<table class="table table-striped"> | ||
[#begin POINTS#] | ||
<tr> | ||
<td> | ||
<a href="?id=<#DEVICES.ID#>&view_mode=edit_devices&tab=schedule&point_id=[#ID#]">[#SET_TIME#]</a> | ||
[#if HAS_RULE#] | ||
<i class="glyphicon glyphicon-lock"></i> | ||
[#endif#] | ||
</td> | ||
<td>[#SET_DAYS#]</td> | ||
<td>[#LINKED_METHOD#]</td> | ||
<td> | ||
<a href="?id=<#DEVICES.ID#>&view_mode=edit_devices&tab=schedule&point_id=[#ID#]" class="btn btn-default btn-sm"><#LANG_EDIT#></a> | ||
<a href="?id=<#DEVICES.ID#>&view_mode=edit_devices&tab=schedule&delete_id=[#ID#]" onclick="return confirm('<#LANG_ARE_YOU_SURE#>');" class="btn btn-default btn-sm"><#LANG_DELETE#></a> | ||
</td> | ||
</tr> | ||
[#end POINTS#] | ||
</table> | ||
|
||
</td> | ||
</tr> | ||
[#end DEVICES#] | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -342,6 +342,8 @@ | |
filterModules(); | ||
}); | ||
|
||
$('.sp-container').remove(); | ||
|
||
} | ||
}); | ||
return false; | ||
|