Skip to content

Commit

Permalink
modified 0138-WebUI-Add-SettingsAccessInStatusAndControl to allow to
Browse files Browse the repository at this point in the history
click on the device image to directly go to the device settings. (cf.
#1444 (comment))
  • Loading branch information
jens-maus committed Oct 18, 2021
1 parent 9c2045b commit deec419
Show file tree
Hide file tree
Showing 5 changed files with 18,596 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@
-<script>translatePage('#ProgramTable')</script>
\ No newline at end of file
+<script>translatePage('#ProgramTable')</script>
--- occu/WebUI/www/rega/pages/tabs/control/devices.htm.orig
+++ occu/WebUI/www/rega/pages/tabs/control/devices.htm
@@ -79,7 +79,7 @@
Call("/esp/datapointconfigurator.fn::StringCut()");
Write(sName);
Write("</td>");
- Write("<td id='"#devs.ID()#"pic' class='ButtonStatusRoomsPic CLASS03906' >");
+ Write("<td id='"#devs.ID()#"pic' class='ButtonStatusRoomsPic CLASS03906' onclick='picDivHide(jg_250);DeviceListPage.showConfiguration(event, \"DEVICE\", "# devs.ID() #");' onmouseover='this.addClassName(\"DeviceListRow_Highlight\")' onmouseout='this.removeClassName(\"DeviceListRow_Highlight\")' >");

string sPicDivId = "picDiv"#devs.ID();
Write("<div id='"#sPicDivId#"' class='CLASS03907' style='margin:auto;' ");
--- occu/WebUI/www/rega/pages/tabs/control/hdevichannels.htm.orig
+++ occu/WebUI/www/rega/pages/tabs/control/hdevichannels.htm
@@ -176,7 +176,11 @@
Expand Down Expand Up @@ -158,6 +169,16 @@

integer cId = o.ID();
integer iStatusOnly = 1;
--- occu/WebUI/www/webui/style.css.orig
+++ occu/WebUI/www/webui/style.css
@@ -6273,6 +6273,7 @@
vertical-align:middle;
text-align:left;
background-color:$_(white); /* white */
+ cursor:pointer;
}

.CLASS03907 {
--- occu/WebUI/www/webui/webui.js.orig
+++ occu/WebUI/www/webui/webui.js
@@ -25655,7 +25655,7 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
<script type="text/javascript">
<%
if( system.GetSessionVar("sessionTAB") != "control/devices" )
{
system.SetSessionVar("sessionTAB", "control/devices");
system.SetSessionVar("sessionTAB1", "");
}
%>
//setPath("<span onclick='WebUI.enter(ControlPage);'>Status und Bedienung</span> &gt; Ger�te");
setPath("<span onclick='WebUI.enter(ControlPage);'>"+translateKey('menuControlPage') +"</span> &gt; " +translateKey('submenuDevices'));
fltHD = new iseFilter('fltHD');
</script>

<table width="100%" class="CLASS03900" cellpadding="0" cellspacing="0">
<colgroup>
<col style="width:260px;"/>
<col style="width:auto;"/>
</colgroup>
<tr>
<!-- Linke Spalte -->
<td id="contentLeft">
<table class="CLASS03901">
<tr>
<td style="vertical-align: top;">
<div id="divDL" class="CLASS03902">
<script type="text/javascript">
var contHeight = $("content").style.height;
contHeight = contHeight.replace(/px/, "");
$("divDL").style.height = Math.floor((contHeight * 0.98)) + "px";
</script>
<table id="tblFunctionNames" class="StatViewTbl CLASS03903" cellpadding="4" cellspacing="0" >
<colgroup>
<col style="width:100px;"/>
<col style="width:100px;"/>
</colgroup>
<%
object obj = dom.GetObject(ID_DEVICES);
if ( obj )
{
obj.SortByName();
string tmp = "";
string sFirstId = "";
foreach( tmp, obj.EnumEnabledIDs() )
{
object devs = dom.GetObject(tmp);
string s1;
foreach( s1, devs.Channels().EnumEnabledVisibleIDs() )
{
object oCH = dom.GetObject( s1 );
if( oCH )
{
boolean bHasFullAccess = (oCH.UserAccessRights(iulOtherThanAdmin) == iarFullAccess);
boolean bHasDPs = (oCH.DPs().EnumEnabledVisibleIDs().Length());
boolean bDefaultDPWrite = (oCH.DefaultDPWrite()!=ID_ERROR);
boolean bIsSysVarDP = false;
object oTmpDP = dom.GetObject( oCH.DefaultDPWrite() );
if( oTmpDP )
{
bIsSysVarDP = ( oTmpDP.IsTypeOf( OT_VARDP ) || oTmpDP.IsTypeOf( OT_ALARMDP ) );
}
}
}
if(devs.Visible()
&& devs.ReadyConfig()
&& devs.HssType()
&& (! devs.MetaData("operateGroupOnly") == "true" )
&& (devs.HssType() != "VIR-OL-GTW")
&& (devs.HssType() != "VIR-HUE-GTW")
)
{
if( sFirstId == "" )
{
sFirstId = tmp;
}
Write("<tr class='CLASS03904'>");
Write("<td id='"#devs.ID()#"name' class='ButtonStatusRooms CLASS03905' onclick='loadChannels("#devs.ID()#")'>");
string sName = devs.Name();
integer iLength = 12;
Call("/esp/datapointconfigurator.fn::StringCut()");
Write(sName);
Write("</td>");
Write("<td id='"#devs.ID()#"pic' class='ButtonStatusRoomsPic CLASS03906' onclick='picDivHide(jg_250);DeviceListPage.showConfiguration(event, \"DEVICE\", "# devs.ID() #");' onmouseover='this.addClassName(\"DeviceListRow_Highlight\")' onmouseout='this.removeClassName(\"DeviceListRow_Highlight\")' >");

string sPicDivId = "picDiv"#devs.ID();
Write("<div id='"#sPicDivId#"' class='CLASS03907' style='margin:auto;' ");
Write("onmouseover='picDivShow(jg_250, \""#devs.Label()#"\", 250, -1, this);'");
Write("onmouseout='picDivHide(jg_250);'");
Write("></div>");

Write("<script type='text/javascript'>");
Write("var jg_0 = new jsGraphics('"#sPicDivId#"');");
Write("InitGD(jg_0, 50);");
Write("Draw(jg_0, '"#devs.Label()#"', 50, '-1');");
Write("</script>");

Write("</td>");
Write("</tr>");
}
}
}
%>
</table>
</div>
</td>
</tr>
</table>
</td>

<!-- Rechte Spalte -->
<td id="contentRight">
<div id="divRTD" class="CLASS03908">
<script type="text/javascript">
var contHeight = $("content").style.height;
contHeight = contHeight.replace(/px/, "");
$("divRTD").style.height = Math.floor((contHeight * 0.98)) + "px";
</script>
<table id="tblRightContent" class="CLASS03909">
<tr class="CLASS03910">
<td style="vertical-align: top;" id="chnList"></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<script type="text/javascript">

loadChannels = function(id, specialFlag)
{

// Introduced with the blind.fn
if (! specialFlag) {
jQuery('body').data('loadCh_'+id, false );
}

iseInitUpdateArrays();
if( id )
{
// aktuellen Markierung aufheben
var tdlist = $("tblFunctionNames").getElementsByTagName('td');
for (var i = 0; i < tdlist.length; i++)
{
$(tdlist[i]).removeClassName("ButtonStatusRoomsSelected");
$(tdlist[i]).removeClassName("ButtonStatusRoomsPicSelected");
}

// Markierung setzen
$(id + "name").addClassName("ButtonStatusRoomsSelected");
$(id + "pic").addClassName("ButtonStatusRoomsPicSelected");

// Inhalt nachladen
var pb = '';
pb += 'integer id = '+id+';';
var opts =
{
postBody: pb,
evalScripts: true
};
new Ajax.Updater("chnList", "/pages/tabs/control/hdevichannels.htm?sid=" + SessionId, opts);
}
else
{
if(dbg)alert(translateKey("alertIDnotSet") + " (control/devices.htm)");
}
}

// Beim laden der Seite ersten Raum anzeigen
<%
if( system.GetSessionVar("sessionTAB1") == "" )
{
system.SetSessionVar("sessionTAB1",sFirstId);
}
%>
loadChannels( <% Write( system.GetSessionVar("sessionTAB1") ); %> );

filterOptions = new iseFilter();
</script>

<script type="text/javascript">
var s = "";

s += "<table cellspacing='8'>";
s += "<tr>";
s += "<td style='text-align:center; vertical-align: middle;'><div class='FooterButton' onclick='WebUI.goBack()'>"+translateKey("footerBtnPageBack")+"</div></td>";
s += "<td style='text-align:center; vertical-align: middle;'><div class='FooterButton CLASS03911' onclick='fltHD.clearFilters();updateTable();' >"+translateKey('footerBtnResetFilter')+"</div></td>";
s += "</tr>";
s += "</table>";

setFooter(s);

updateTable = function()
{
colorFilterBtns(fltHD);
for (var i = 0; i < arChns.length; i++)
{
if (!fltHD.objPassFilter(arChns[i]))
{
hide(arChns[i]['trid']);
if (arChns[i]['ctrlId']) hide(arChns[i]['ctrlId']);
}
else
{
show(arChns[i]['trid']);
if (arChns[i]['ctrlId']) show(arChns[i]['ctrlId']);
}
}
}
</script>
Loading

0 comments on commit deec419

Please sign in to comment.