diff --git a/entity/Member_entity/Member_entity.aod b/entity/Member_entity/Member_entity.aod index b0538033f66661c78496eefb62cd9a939209da42..f30e99f773a56b53689146171133a8751718b79d 100644 --- a/entity/Member_entity/Member_entity.aod +++ b/entity/Member_entity/Member_entity.aod @@ -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> diff --git a/entity/Member_entity/entityfields/msteamsactiongroup/children/addapp/stateProcess.js b/entity/Member_entity/entityfields/msteamsactiongroup/children/addapp/stateProcess.js index 2446336fdb51fd98ff970c96944178e880cffdb6..8c22d355887ba359f69c392d8671aa574cdc376d 100644 --- a/entity/Member_entity/entityfields/msteamsactiongroup/children/addapp/stateProcess.js +++ b/entity/Member_entity/entityfields/msteamsactiongroup/children/addapp/stateProcess.js @@ -1,25 +1,31 @@ +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 diff --git a/entity/Member_entity/entityfields/msteamsactiongroup/children/changetomsteam/stateProcess.js b/entity/Member_entity/entityfields/msteamsactiongroup/children/changetomsteam/stateProcess.js index 5a91fdde73f52deed6163bc26ad1bd023b3fca8a..43b7cdd5eadeb6f287b2e2d24f3391c91360ee68 100644 --- a/entity/Member_entity/entityfields/msteamsactiongroup/children/changetomsteam/stateProcess.js +++ b/entity/Member_entity/entityfields/msteamsactiongroup/children/changetomsteam/stateProcess.js @@ -1,20 +1,26 @@ +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 diff --git a/entity/Member_entity/entityfields/msteamsactiongroup/children/deleteteam/stateProcess.js b/entity/Member_entity/entityfields/msteamsactiongroup/children/deleteteam/stateProcess.js index d1432e9d7c5837185f1f56591df4f482f6569e7a..ff7327ea21424cb3394d6d204c49cc42d49296da 100644 --- a/entity/Member_entity/entityfields/msteamsactiongroup/children/deleteteam/stateProcess.js +++ b/entity/Member_entity/entityfields/msteamsactiongroup/children/deleteteam/stateProcess.js @@ -1,21 +1,31 @@ +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 diff --git a/entity/Member_entity/entityfields/msteamsactiongroup/children/editteam/stateProcess.js b/entity/Member_entity/entityfields/msteamsactiongroup/children/editteam/stateProcess.js index d1432e9d7c5837185f1f56591df4f482f6569e7a..19d44a29c7aa78d785175ef6ea98d680670f97d2 100644 --- a/entity/Member_entity/entityfields/msteamsactiongroup/children/editteam/stateProcess.js +++ b/entity/Member_entity/entityfields/msteamsactiongroup/children/editteam/stateProcess.js @@ -1,21 +1,31 @@ +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 diff --git a/entity/Member_entity/entityfields/msteamsactiongroup/children/restoreteam/stateProcess.js b/entity/Member_entity/entityfields/msteamsactiongroup/children/restoreteam/stateProcess.js index 97ff04f9a94aed54767d269a5efc77ca4cbd4dea..f6f0a5da09790cfe007d834b76e59a4397c0355e 100644 --- a/entity/Member_entity/entityfields/msteamsactiongroup/children/restoreteam/stateProcess.js +++ b/entity/Member_entity/entityfields/msteamsactiongroup/children/restoreteam/stateProcess.js @@ -1,20 +1,31 @@ +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 diff --git a/entity/Salesproject_entity/Salesproject_entity.aod b/entity/Salesproject_entity/Salesproject_entity.aod index 412fcc0f20288f526974253f9527e419a3a7da6e..1d915910da7ead01a458e98df0b077fd1516e632 100644 --- a/entity/Salesproject_entity/Salesproject_entity.aod +++ b/entity/Salesproject_entity/Salesproject_entity.aod @@ -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> diff --git a/entity/Salesproject_entity/entityfields/mst_team_id/displayValueProcess.js b/entity/Salesproject_entity/entityfields/mst_team_id/displayValueProcess.js index daf9387bb01df5c3bb1ec08d569ded6ae73909e5..14271e0911152fe467c4283f2b8a6245288c0bc7 100644 --- a/entity/Salesproject_entity/entityfields/mst_team_id/displayValueProcess.js +++ b/entity/Salesproject_entity/entityfields/mst_team_id/displayValueProcess.js @@ -1,7 +1,15 @@ +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 diff --git a/entity/Salesproject_entity/entityfields/mst_team_id/stateProcess.js b/entity/Salesproject_entity/entityfields/mst_team_id/stateProcess.js index ddf69aa437ebcfb0f79ed83a2068e193e243d48e..0a84b37c599e80e8b1295c2cd50f2aa0c548041b 100644 --- a/entity/Salesproject_entity/entityfields/mst_team_id/stateProcess.js +++ b/entity/Salesproject_entity/entityfields/mst_team_id/stateProcess.js @@ -1,5 +1,11 @@ +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