Skip to content
Snippets Groups Projects
Commit d84c7ec3 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

MSTeams: disabling should hide all fields

parent 64dda83e
No related branches found
No related tags found
No related merge requests found
Showing
with 125 additions and 73 deletions
......@@ -229,7 +229,6 @@
<iconId>NEON:PLUS</iconId>
<state>EDITABLE</state>
<stateProcess>%aditoprj%/entity/Member_entity/entityfields/msteamsactiongroup/children/createteam/stateProcess.js</stateProcess>
<tooltip>Erstelle ein neues MicrosoftTeams Team</tooltip>
</entityActionField>
<entityActionField>
<name>editTeam</name>
......@@ -244,7 +243,6 @@
<onActionProcess>%aditoprj%/entity/Member_entity/entityfields/msteamsactiongroup/children/addapp/onActionProcess.js</onActionProcess>
<iconId>VAADIN:MOBILE</iconId>
<stateProcess>%aditoprj%/entity/Member_entity/entityfields/msteamsactiongroup/children/addapp/stateProcess.js</stateProcess>
<tooltip>Adds the MST ADITO App to the MSTTeam</tooltip>
</entityActionField>
<entityActionField>
<name>chooseTeam</name>
......@@ -252,7 +250,6 @@
<onActionProcess>%aditoprj%/entity/Member_entity/entityfields/msteamsactiongroup/children/chooseteam/onActionProcess.js</onActionProcess>
<iconId>NEON:GROUP_APPOINTMENT</iconId>
<stateProcess>%aditoprj%/entity/Member_entity/entityfields/msteamsactiongroup/children/chooseteam/stateProcess.js</stateProcess>
<tooltip>Wähle ein bereits hinterlegtes Team</tooltip>
</entityActionField>
<entityActionField>
<name>restoreTeam</name>
......@@ -260,7 +257,6 @@
<onActionProcess>%aditoprj%/entity/Member_entity/entityfields/msteamsactiongroup/children/restoreteam/onActionProcess.js</onActionProcess>
<iconId>VAADIN:ARROW_BACKWARD</iconId>
<stateProcess>%aditoprj%/entity/Member_entity/entityfields/msteamsactiongroup/children/restoreteam/stateProcess.js</stateProcess>
<tooltip>Stelle das Team wieder her</tooltip>
</entityActionField>
<entityActionField>
<name>changeToMSTeam</name>
......@@ -275,7 +271,6 @@
<onActionProcess>%aditoprj%/entity/Member_entity/entityfields/msteamsactiongroup/children/deleteteam/onActionProcess.js</onActionProcess>
<iconId>NEON:TRASH</iconId>
<stateProcess>%aditoprj%/entity/Member_entity/entityfields/msteamsactiongroup/children/deleteteam/stateProcess.js</stateProcess>
<tooltip>Lösche das verknüpfte MSTeams Team</tooltip>
</entityActionField>
</children>
</entityActionGroup>
......
import("MSTeams_lib");
import("system.vars");
import("system.neon");
import("system.result");
import("Sql_lib");
var res = neon.COMPONENTSTATE_DISABLED;
var teamId = vars.exists("$param.MSTTeamId_param") ? vars.get("$param.MSTTeamId_param") : null;
if (teamId && MSTeamsUtils.isTeamsEnabled())
{
var isArchived, serviceUrl;
var teamData = newSelect("IS_ARCHIVED, SERVICE_URL")
.from("MST_TEAM")
.whereIfSet("MST_TEAM.MST_TEAMID", teamId)
.arrayRow(true);
var isArchived, serviceUrl;
var teamData = newSelect("IS_ARCHIVED, SERVICE_URL")
.from("MST_TEAM")
.whereIfSet("MST_TEAM.MST_TEAMID", teamId)
.arrayRow(true);
if (teamData)
[isArchived, serviceUrl] = teamData;
if (teamData)
[isArchived, serviceUrl] = teamData;
if (teamId == "" || isArchived == 1 || serviceUrl)
{
result.string(neon.COMPONENTSTATE_DISABLED);
if (isArchived == 1 || serviceUrl)
{
res = neon.COMPONENTSTATE_DISABLED;
}
else
{
res = neon.COMPONENTSTATE_EDITABLE;
}
}
else
{
result.string(neon.COMPONENTSTATE_EDITABLE);
}
\ No newline at end of file
result.string(res);
\ No newline at end of file
import("MSTeams_lib");
import("system.vars");
import("system.neon");
import("system.result");
import("Sql_lib");
var res = neon.COMPONENTSTATE_DISABLED;
var teamId = vars.exists("$param.MSTTeamId_param") ? vars.get("$param.MSTTeamId_param") : null;
var isArchived = newSelect("IS_ARCHIVED")
.from("MST_TEAM")
.whereIfSet("MST_TEAM.MST_TEAMID", teamId)
.cell(true);
if (teamId && MSTeamsUtils.isTeamsEnabled())
{
var isArchived = newSelect("IS_ARCHIVED")
.from("MST_TEAM")
.whereIfSet("MST_TEAM.MST_TEAMID", teamId)
.cell(true);
if (teamId == "" || isArchived == 1)
{
result.string(neon.COMPONENTSTATE_DISABLED);
if (isArchived == 1)
{
res = neon.COMPONENTSTATE_DISABLED;
}
else
{
res = neon.COMPONENTSTATE_EDITABLE;
}
}
else
{
result.string(neon.COMPONENTSTATE_EDITABLE);
}
\ No newline at end of file
result.string(res);
\ No newline at end of file
import("MSTeams_lib");
import("system.vars");
import("system.neon");
import("system.result");
import("Sql_lib");
import("MSTeams_lib");
var res = neon.COMPONENTSTATE_DISABLED;
var teamId = vars.exists("$param.MSTTeamId_param") ? vars.get("$param.MSTTeamId_param") : null;
var isArchived = newSelect("IS_ARCHIVED")
if (teamId && MSTeamsUtils.isTeamsEnabled())
{
var isArchived, serviceUrl;
var teamData = newSelect("IS_ARCHIVED, SERVICE_URL")
.from("MST_TEAM")
.whereIfSet("MST_TEAM.MST_TEAMID", teamId)
.cell(true);
if (!teamId || isArchived == 1 || !MSTeamsUtils.isUserTeamOwner(teamId))
{
result.string(neon.COMPONENTSTATE_DISABLED);
.arrayRow(true);
if (teamData)
[isArchived, serviceUrl] = teamData;
if (isArchived == 1 || serviceUrl || !MSTeamsUtils.isUserTeamOwner(teamId))
{
res = neon.COMPONENTSTATE_DISABLED;
}
else
{
res = neon.COMPONENTSTATE_EDITABLE;
}
}
else
{
result.string(neon.COMPONENTSTATE_EDITABLE);
}
\ No newline at end of file
result.string(res);
\ No newline at end of file
import("MSTeams_lib");
import("system.vars");
import("system.neon");
import("system.result");
import("Sql_lib");
import("MSTeams_lib");
var res = neon.COMPONENTSTATE_DISABLED;
var teamId = vars.exists("$param.MSTTeamId_param") ? vars.get("$param.MSTTeamId_param") : null;
var isArchived = newSelect("IS_ARCHIVED")
if (teamId && MSTeamsUtils.isTeamsEnabled())
{
var isArchived, serviceUrl;
var teamData = newSelect("IS_ARCHIVED, SERVICE_URL")
.from("MST_TEAM")
.whereIfSet("MST_TEAM.MST_TEAMID", teamId)
.cell(true);
if (!teamId || isArchived == 1 || !MSTeamsUtils.isUserTeamOwner(teamId))
{
result.string(neon.COMPONENTSTATE_DISABLED);
.arrayRow(true);
if (teamData)
[isArchived, serviceUrl] = teamData;
if (isArchived == 1 || !MSTeamsUtils.isUserTeamOwner(teamId))
{
res = neon.COMPONENTSTATE_DISABLED;
}
else
{
res = neon.COMPONENTSTATE_EDITABLE;
}
}
else
{
result.string(neon.COMPONENTSTATE_EDITABLE);
}
\ No newline at end of file
result.string(res);
\ No newline at end of file
import("MSTeams_lib");
import("system.vars");
import("system.neon");
import("system.result");
import("Sql_lib");
var res = neon.COMPONENTSTATE_DISABLED;
var teamId = vars.exists("$param.MSTTeamId_param") ? vars.get("$param.MSTTeamId_param") : null;
var isArchived = newSelect("IS_ARCHIVED")
if (teamId && MSTeamsUtils.isTeamsEnabled())
{
var isArchived, serviceUrl;
var teamData = newSelect("IS_ARCHIVED, SERVICE_URL")
.from("MST_TEAM")
.whereIfSet("MST_TEAM.MST_TEAMID", teamId)
.cell(true);
if (teamId == "" || isArchived == 0)
{
result.string(neon.COMPONENTSTATE_DISABLED);
.arrayRow(true);
if (teamData)
[isArchived, serviceUrl] = teamData;
if (isArchived == 0)
{
res = neon.COMPONENTSTATE_DISABLED;
}
else
{
res = neon.COMPONENTSTATE_EDITABLE;
}
}
else
{
result.string(neon.COMPONENTSTATE_EDITABLE);
}
\ No newline at end of file
result.string(res);
\ No newline at end of file
......@@ -754,7 +754,7 @@
<name>MST_TEAM_ID</name>
<title>Teams group</title>
<linkedContext>MSTTeam</linkedContext>
<state>READONLY</state>
<state>INVISIBLE</state>
<stateProcess>%aditoprj%/entity/Salesproject_entity/entityfields/mst_team_id/stateProcess.js</stateProcess>
<displayValueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/mst_team_id/displayValueProcess.js</displayValueProcess>
</entityField>
......
import("MSTeams_lib");
import("system.result");
import("Sql_lib");
result.string(newSelect("TEAMNAME")
.from("MST_TEAM")
.whereIfSet("MST_TEAM.MST_TEAMID", "$field.MST_TEAM_ID")
.cell(true));
\ No newline at end of file
var res;
if (MSTeamsUtils.isTeamsEnabled())
res = newSelect("TEAMNAME")
.from("MST_TEAM")
.whereIfSet("MST_TEAM.MST_TEAMID", "$field.MST_TEAM_ID")
.cell(true);
else
res = "";
result.string(res);
\ No newline at end of file
import("MSTeams_lib");
import("system.result");
import("system.vars");
import("system.neon");
result.string(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT ? neon.COMPONENTSTATE_INVISIBLE : neon.COMPONENTSTATE_READONLY);
\ No newline at end of file
var res = neon.COMPONENTSTATE_INVISIBLE;
var recordState = vars.get("$sys.recordstate");
if (MSTeamsUtils.isTeamsEnabled() && recordState != neon.OPERATINGSTATE_NEW && recordState != neon.OPERATINGSTATE_EDIT)
res = neon.COMPONENTSTATE_READONLY;
result.string(res);
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment