Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
421 lines (419 sloc) 16.4 KB
--- occu/WebUI/www/rega/esp/favorites.fn.orig
+++ occu/WebUI/www/rega/esp/favorites.fn
@@ -244,7 +244,7 @@
oU = dom.CreateObject( OT_FAVORITE, "_USER"#s );
oFavorites.Add( oU );
}
- else
+ elseif( system.GetVar("sargs").Contains(s) == false )
{
oU.Remove( iOrigID );
Write( "|rem "#iOrigID#" from "#oU.ID()#"|" );
@@ -257,7 +257,7 @@
foreach(s,system.GetVar("sargs"))
{
object oU = oFavorites.Get( "_USER"#s );
- if( oU )
+ if( oU && (oU.Get(iOrigID) != null) )
{
oU.Add( iOrigID );
Write( "|add "#iOrigID#" to "#oU.ID()#"|" );
--- occu/WebUI/www/rega/pages/tabs/user/favOverview.htm.orig
+++ occu/WebUI/www/rega/pages/tabs/user/favOverview.htm
@@ -27,10 +27,17 @@
object oTmp = dom.GetObject( sTmp );
if( oTmp )
{
- boolean bIsUserList = ( oTmp.Name().Substr(0,5) == "_USER" );
+ boolean bIsUserList;
+ if( oUser.UserLevel() == iulAdmin )
+ {
+ bIsUserList = ( oTmp.Name().Substr(0,5) == "_USER" );
+ }
+ else
+ {
+ bIsUserList = ( oTmp.Name() == "_USER" # system.GetSessionVar("sessionUserID") );
+ }
boolean bIsCopy = ( oTmp.EnCopyID() != ID_ERROR );
- boolean bIsVisible = ( oTmp.Visible() );
- if( (!bIsUserList) && (!bIsCopy) && bIsVisible )
+ if( bIsUserList && (!bIsCopy) )
{
oUser.UserTempViewIDs().Add( oTmp.ID() );
}
@@ -63,18 +70,10 @@
<td class="CLASS06402"></td>
</tr>
</table>
-<table id="tblFavs" class="tMain filterTable" cellpadding="0" cellspacing="0" width="97%" style="display:none">
- <colgroup>
- <col width="15" />
- <col width="15" />
- <col width="10" />
- <col width="10" />
- <col width="10" />
-<!-- <col width="10" /> -->
- <col width="10" />
- <col width="10" />
- </colgroup>
+<table id="tblFavs" class="tMain" cellpadding="0" cellspacing="0" width="97%" style="display:none">
<tr>
+ <%string sCssName="Sort"; if(system.GetSessionVar("sessionLS")=="pos"){sCssName="SortSelected";} %>
+ <th class="thCell CLASS02803"><div class="pt11 <%Write(sCssName);%>" onclick="IseSort(arFavs,'pos',true);" >${thPosition}</div></th>
<%string sCssName="Sort"; if(system.GetSessionVar("sessionLS")=="name"){sCssName="SortSelected";} %>
<th class="thCell CLASS02803"><div class="pt11 <%Write(sCssName);%>" onclick="IseSort(arFavs,'name',true);" >${thName}</div></th>
<th class="thCell CLASS02803"><div class="pt11">${thDescription}</div></th>
@@ -89,6 +88,7 @@
<th class="thCell CLASS02803"><div class="pt11">${thAction}</div></th>
</tr>
<tr>
+ <td class="CLASS06408">&nbsp;</td>
<td class="CLASS06405">
<div id="btnFilterName" class="FilterBtn">${thFilter}</div>
<div class="FilterSubMenu" id="btnFilterNameSub" style="display:none">
@@ -169,155 +169,199 @@
</tr>
<%
integer iCount = 0;
- string sID;
+ string usID;
if (oUser.UserTempViewIDs().Count() == 0)
{
WriteLine("<script type='text/javascript'>");
WriteLine("Cursor.set(Cursor.NORMAL);");
WriteLine("</script>");
}
- foreach( sID, oUser.UserTempViewIDs().EnumIDs() )
+ foreach( usID, oUser.UserTempViewIDs().EnumIDs() )
{
- object oFav = dom.GetObject( sID );
- if( oFav )
+ object oUserFav = dom.GetObject( usID );
+ if( oUserFav && (oUserFav.Name().Substr(0,5) == "_USER") )
{
- iCount = iCount + 1;
- object oOrigFav = oFav;
-
- string sName = oFav.Name();
- if( !sName.Length() ) { sName = "${lblWithoutName}"; }
-
- string sInfo = oFav.EnumInfo();
- if( !sInfo.Length() ) { sInfo = "${lblWithoutDescription}"; }
-
- string sColumnCount = oFav.FavColumnCount().ToString();
- if( sColumnCount == "0" ) { sColumnCount = "${lblAuto}"; }
-
- string sColumnAlign = oFav.FavColumnAlign().ToString();
- if( sColumnAlign == "0" ) { sColumnAlign = "${lblLeft}"; }
- if( sColumnAlign == "1" ) { sColumnAlign = "${lblCenter}"; }
-
- string sNamePosition = oFav.FavNamePosition().ToString();
- if( sNamePosition == "0" ) { sNamePosition = "${lblLeft}"; }
- if( sNamePosition == "1" ) { sNamePosition = "${lblTop}"; }
- string trid = "tf" # oFav.ID();
- Write('<tr id="'#trid#'">');
- Write('<td class="tCell">'#sName#'</td>');
- Write('<td class="tCell">'#sInfo#'</td>');
- Write('<td class="tCell">'#sColumnCount#'</td>');
- Write('<td class="tCell">'#sColumnAlign#'</td>');
- Write('<td class="tCell">'#sNamePosition#'</td>');
+ integer localCount = 0;
+ string sID;
+ foreach( sID, oUserFav.EnumIDs() )
+ {
+ object oFav = dom.GetObject( sID );
+ if( oFav )
+ {
+ iCount = iCount + 1;
+ localCount = localCount + 1;
-! Endgerät
-! Write('<td class="tCell">' );
- string endDevices = "";
-! Call( '/esp/favorites.fn::WriteEndDevices()' );
-! Write('</td>');
-
- Write('<td class="tCell">');
- string favUserIds = "";
- Call( '/esp/favorites.fn::WriteUsers()' );
- Write('</td>');
- Write('<td class="tCell" align="center" valign="middle" class="TblUserAdministration bcWhite">');
-
- ! User darf Favoriten nur dann löschen wenn er "ihm alleine" gehört, und Favoriten anderer User nicht bearbeiten
- boolean bEditAllowed = false;
- boolean bDelAllowed = false;
-
- ! Der Admin darf sämtliche Favoriten löschen und bearbeiten
- if (oUser.UserLevel() == iulAdmin)
+ if( (localCount == 1) && (iCount > 1) )
{
- bEditAllowed = true;
- bDelAllowed = true;
+ Write('<tr><td colspan="8">&nbsp;</td></tr>');
}
- else
- {
- boolean bHasOtherOwners = false;
- string oUserTmp = "";
- foreach (oUserTmp, favUserIds)
- {
- if (oUserTmp != oUser.ID())
+
+ object oOrigFav = oFav;
+
+ string sName = oFav.Name();
+ if( !sName.Length() ) { sName = "${lblWithoutName}"; }
+
+ string sInfo = oFav.EnumInfo();
+ if( !sInfo.Length() ) { sInfo = "${lblWithoutDescription}"; }
+
+ string sColumnCount = oFav.FavColumnCount().ToString();
+ if( sColumnCount == "0" ) { sColumnCount = "${lblAuto}"; }
+
+ string sColumnAlign = oFav.FavColumnAlign().ToString();
+ if( sColumnAlign == "0" ) { sColumnAlign = "${lblLeft}"; }
+ if( sColumnAlign == "1" ) { sColumnAlign = "${lblCenter}"; }
+
+ string sNamePosition = oFav.FavNamePosition().ToString();
+ if( sNamePosition == "0" ) { sNamePosition = "${lblLeft}"; }
+ if( sNamePosition == "1" ) { sNamePosition = "${lblTop}"; }
+ string trid = "tf" # oFav.ID();
+ Write('<tr id="'#trid#'">');
+ Write('<td class="bcWhite CLASS06311">');
+ Write('<table class="CLASS06312">');
+ Write('<tr>');
+ Write('<td rowspan="2" id="favPosCount" class="CLASS06313">');
+ string iIpP = localCount;
+ Write( iIpP );
+ if( oFav.MetaData("pos") )
+ {
+ oFav.MetaData("pos", iIpP);
+ }
+ else
+ {
+ oFav.AddMetaData("pos");
+ oFav.MetaData("pos", iIpP);
+ }
+ Write('</td>');
+ Write('<td class="tMoveUp CLASS06315" onclick="MoveUp('#oUserFav.ID()#','#oFav.ID()#');"></td>');
+ Write('</tr>');
+ Write('<tr>');
+ Write('<td class="tMoveDown CLASS06316" onclick="MoveDown('#oUserFav.ID()#','#oFav.ID()#');"></td>');
+ Write('</tr>');
+ Write('</table>');
+ Write('</td>');
+ Write('<td class="tCell">'#sName#'</td>');
+ Write('<td class="tCell">'#sInfo#'</td>');
+ Write('<td class="tCell">'#sColumnCount#'</td>');
+ Write('<td class="tCell">'#sColumnAlign#'</td>');
+ Write('<td class="tCell">'#sNamePosition#'</td>');
+
+! Endgerät
+! Write('<td class="tCell">' );
+ string endDevices = "";
+! Call( '/esp/favorites.fn::WriteEndDevices()' );
+! Write('</td>');
+
+ Write('<td class="tCell">');
+ string favUserIds = "";
+ Call( '/esp/favorites.fn::WriteUsers()' );
+ Write('</td>');
+ Write('<td class="tCell" align="center" valign="middle" class="TblUserAdministration bcWhite">');
+
+ ! User darf Favoriten nur dann löschen wenn er "ihm alleine" gehört, und Favoriten anderer User nicht bearbeiten
+ boolean bEditAllowed = false;
+ boolean bDelAllowed = false;
+
+ ! Der Admin darf sämtliche Favoriten löschen und bearbeiten
+ if (oUser.UserLevel() == iulAdmin)
{
- bHasOtherOwners = true;
- }
- else {
bEditAllowed = true;
bDelAllowed = true;
}
+ else
+ {
+ boolean bHasOtherOwners = false;
+ string oUserTmp = "";
+ foreach (oUserTmp, favUserIds)
+ {
+ if (oUserTmp != oUser.ID())
+ {
+ bHasOtherOwners = true;
+ }
+ else {
+ bEditAllowed = true;
+ bDelAllowed = true;
+ }
+ }
+ if (bHasOtherOwners) {
+ bEditAllowed = false;
+ bDelAllowed = false;
+ }
+ }
+ if (bEditAllowed) {
+ Write('<div class="CLASS06409 StdButton" onclick="EditFavoriteList('#sID#');">${btnEdit}</div>');
+ }
+ else {
+ Write('<div class="CLASS06412">Bearbeiten...</div>');
+ }
+ if ((bDelAllowed) && (!oFav.Unerasable())) {
+ Write('<div class="CLASS06409 StdButton" onclick="DeleteFavorite('#sID#');">${btnRemove}</div>');
+ }
+ else {
+ Write('<div class="CLASS06412">${btnRemove}</div>');
+ }
+
+ Write('</td>');
+ Write('</tr>');
+ Write('<script type="text/javascript">');
+ Write("var tmp = new Object();");
+ Write("tmp['trid'] = '"#trid#"';");
+ Write("tmp['id'] = '"#oUserFav.ID()#"';");
+ if( oFav.MetaData("pos") )
+ {
+ string sIPos = oFav.MetaData("pos");
+ Write("tmp['pos'] = '"#sIPos#"';");
}
- if (bHasOtherOwners) {
- bEditAllowed = false;
- bDelAllowed = false;
+ integer iFavColumnCount = oFav.FavColumnCount();
+ if( iFavColumnCount == 0 )
+ {
+ Write("tmp['unit'] = 'Auto.';");
}
- }
- if (bEditAllowed) {
- Write('<div class="CLASS06409 StdButton" onclick="EditFavoriteList('#sID#');">${btnEdit}</div>');
- }
- else {
- Write('<div class="CLASS06412">Bearbeiten...</div>');
- }
- if ((bDelAllowed) && (!oFav.Unerasable())) {
- Write('<div class="CLASS06409 StdButton" onclick="DeleteFavorite('#sID#');">${btnRemove}</div>');
- }
- else {
- Write('<div class="CLASS06412">${btnRemove}</div>');
- }
-
- Write('</td>');
- Write('</tr>');
- Write('<script type="text/javascript">');
- Write("var tmp = new Object();");
- Write("tmp['trid'] = '"#trid#"';");
- Write("tmp['id'] = '"#oFav.ID()#"';");
- integer iFavColumnCount = oFav.FavColumnCount();
- if( iFavColumnCount == 0 )
- {
- Write("tmp['unit'] = 'Auto.';");
- }
- else
- {
- Write("tmp['unit'] = '"#iFavColumnCount#"';");
- }
- Write("tmp['users'] = '"#favUserIds#"';");
- Write("tmp['name'] = '"#oFav.Name()#"';");
- Write("tmp['colpos'] = '"#oFav.FavColumnAlign().ToString()#"';");
- Write("tmp['enddevices'] = '"#endDevices#"';");
-
- boolean bEndDevPC = false;
- if( oPC )
- {
- string s;
- foreach(s,oPC.EnumIDs())
- {
- if( s == oFav.ID() ) { bEndDevPC = true; }
- }
- }
- Write("tmp['devPC'] = "#bEndDevPC#";");
- boolean bEndDevPDA = false;
- if( oPDA )
- {
- string s;
- foreach(s,oPDA.EnumIDs())
- {
- if( s == oFav.ID() ) { bEndDevPDA = true; }
- }
- }
- Write("tmp['devPDA'] = "#bEndDevPDA#";");
- boolean bEndDevCentral = false;
- if( oCentral )
- {
- string s;
- foreach(s,oCentral.EnumIDs())
- {
- if( s == oFav.ID() ) { bEndDevCentral = true; }
- }
+ else
+ {
+ Write("tmp['unit'] = '"#iFavColumnCount#"';");
+ }
+ Write("tmp['users'] = '"#favUserIds#"';");
+ Write("tmp['name'] = '"#oFav.Name()#"';");
+ Write("tmp['colpos'] = '"#oFav.FavColumnAlign().ToString()#"';");
+ Write("tmp['enddevices'] = '"#endDevices#"';");
+
+ boolean bEndDevPC = false;
+ if( oPC )
+ {
+ string s;
+ foreach(s,oPC.EnumIDs())
+ {
+ if( s == oFav.ID() ) { bEndDevPC = true; }
+ }
+ }
+ Write("tmp['devPC'] = "#bEndDevPC#";");
+ boolean bEndDevPDA = false;
+ if( oPDA )
+ {
+ string s;
+ foreach(s,oPDA.EnumIDs())
+ {
+ if( s == oFav.ID() ) { bEndDevPDA = true; }
+ }
+ }
+ Write("tmp['devPDA'] = "#bEndDevPDA#";");
+ boolean bEndDevCentral = false;
+ if( oCentral )
+ {
+ string s;
+ foreach(s,oCentral.EnumIDs())
+ {
+ if( s == oFav.ID() ) { bEndDevCentral = true; }
+ }
+ }
+ Write("tmp['devCentral'] = "#bEndDevCentral#";");
+
+ Write("tmp['namepos'] = '"#oFav.FavNamePosition().ToString()#"';");
+ Write("arFavs[arFavs.length] = tmp;");
+ Write("Cursor.set(Cursor.NORMAL);");
+ Write('</script>');
}
- Write("tmp['devCentral'] = "#bEndDevCentral#";");
-
- Write("tmp['namepos'] = '"#oFav.FavNamePosition().ToString()#"';");
- Write("arFavs[arFavs.length] = tmp;");
- Write("Cursor.set(Cursor.NORMAL);");
- Write('</script>');
+ }
}
}
%>
@@ -391,6 +435,16 @@
}
}
+ MoveUp = function(flid,id)
+ {
+ iseFavorites.MovePosition(flid,id,"-");
+ }
+
+ MoveDown = function(flid,id)
+ {
+ iseFavorites.MovePosition(flid,id,"+");
+ }
+
EditFavoriteList = function(id)
{
var url = '/esp/favorites.htm?sid='+SessionId;
You can’t perform that action at this time.