Skip to content
Snippets Groups Projects
Commit dccd16a4 authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

merged origin/2020.2.0_Betreuung_HamaDSG into District_merge

parents 714a052a 5804111f
No related branches found
No related tags found
No related merge requests found
Showing
with 136 additions and 109 deletions
import("system.vars");
import("system.question");
import("system.translate");
import("District_lib");
var arrDistrictIds = vars.get("$sys.selection");
question.showMessage(translate.text("Assignment for all selected districts will start now!"));
DistrictUtils.assignDistrictOnServer(arrDistrictIds);
\ No newline at end of file
import("District_lib");
import("system.result");
import("system.vars");
var parentFilter = vars.get("$field.parentFilter");
var districtFilter = vars.get("$field.DISTRICT_FILTER");
var appliedFilter = {
entity: "Organisation_entity",
filter: {
type: "group",
operator: "AND",
childs: []
}};
if (parentFilter)
{
appliedFilter.filter.childs.push(JSON.parse(parentFilter).filter);
}
if (districtFilter)
{
//appliedFilter = _getApplicableFilter(appliedFilter, districtFilter);
appliedFilter.filter.childs.push(JSON.parse(districtFilter).filter);
}
result.string(JSON.stringify(appliedFilter));
filterArray = [];
function _getApplicableFilter(pFilter, pAppendFilter){
var applicableFilter = "";
var childFilter = JSON.parse(pFilter).filter;
return applicableFilter;
}
\ No newline at end of file
//Aufbau des kompletten Filters über alle Hierarchie-Ebenen hinweg
var appliedFilter = DistrictUtils.getAppliedFilter(vars.get("$field.DISTRICT_FILTER"), vars.get("$field.PARENTDISTRICT_DISTRICTID"));
result.string(appliedFilter);
import("system.question");
import("system.translate");
import("District_lib");
import("system.vars");
var arrDistrictId = [vars.get("$field.DISTRICTID")];
question.showMessage(translate.text("District assignment will start now!"));
DistrictUtils.assignDistrictOnServer(arrDistrictId);
import("system.logging");
import("system.vars");
import("system.result");
import("system.entities");
......@@ -20,5 +19,4 @@ if (appliedFilter)
rowCount = entities.getRowCount(conf);
}
result.string(rowCount);
\ No newline at end of file
import("system.translate");
import("system.result");
result.object([
["1", translate.text("Yes")]
,["0", translate.text("No")]
]);
\ No newline at end of file
......@@ -2,8 +2,5 @@ import("system.result");
import("system.neon");
import("system.vars");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT)
{
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
\ No newline at end of file
if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.get("$this.value") == null)
result.string("0");
\ No newline at end of file
import("system.vars");
import("system.logging");
import("system.result");
import("system.neon");
import("Sql_lib");
var districtNo = vars.get("$field.DISTRICT_NUMBER");
result.string(districtNo.padStart(4, '0'));
result.string(districtNo.padStart(4, '0'));
\ No newline at end of file
import("system.result");
result.string("$$$###ignore_param###$$$");//dummy value, for special treatment in the conditionProcess
\ No newline at end of file
import("system.result");
import("system.vars");
result.string(vars.get("$field.DISTRICTID"));
\ No newline at end of file
import("system.result");
import("system.vars");
result.string(vars.get("$field.DISTRICTID"));
\ No newline at end of file
import("system.vars");
import("system.result");
import("Context_lib");
var res = [];
res.push({id: vars.get("$field.DISTRICTID"), tableNames: ["DISTRICT"]});
res = JSON.stringify(res);//currently only strings can be passed as param
result.object(res);
\ No newline at end of file
import("District_lib");
import("system.result");
import("system.vars");
import("system.neon");
import("Sql_lib");
var res = "";
var parentDistrictId = vars.get("$field.PARENTDISTRICT_DISTRICTID");
if (parentDistrictId)
{
var completeParentFilter = _getParentFilter(parentDistrictId, null);
completeParentFilter.entity = "Organisation_entity";
res = completeParentFilter;
}
else
{
var entity = "Organisation_entity";
var emptyFilter = {
entity: entity,
filter: {
type: "group",
operator: "AND",
childs: []
}
};
res = emptyFilter;
}
result.string(JSON.stringify(res));
function _getParentFilter(pParentDistrictId, pPreviousFilter)
{
var resFilter;
if (pPreviousFilter != null)
{
resFilter = pPreviousFilter;
}
if (pParentDistrictId)
{
var parentDistrictFilter, grandParentDistrict;
[parentDistrictFilter, grandParentDistrict] = newSelect(["DISTRICT.DISTRICT_FILTER", "DISTRICT.PARENTDISTRICT_DISTRICTID"])
.from("DISTRICT")
.where("DISTRICT.DISTRICTID", pParentDistrictId)
.arrayRow();
parentDistrictFilter = JSON.parse(parentDistrictFilter);
if (pPreviousFilter)
parentDistrictFilter.filter.childs.push(resFilter.filter);//todo: kommentar ergänzen was wir heir eigentlcih machen
resFilter = parentDistrictFilter;
if (grandParentDistrict.length > 0)
{
resFilter = _getParentFilter(grandParentDistrict, resFilter);
}
}
return resFilter;
}
\ No newline at end of file
//Aufbau des übergeordneten Filters
var res = DistrictUtils.getParentFilter(vars.get("$field.PARENTDISTRICT_DISTRICTID"));
result.string(res);
......@@ -2,7 +2,6 @@ import("system.text");
import("Sql_lib");
import("system.SQLTYPES");
import("Date_lib");
import("system.logging");
import("system.vars");
import("system.result");
import("system.entities");
......
import("system.result");
result.string("$$$###ignore_param###$$$");//dummy value, for special treatment in the conditionProcess
\ No newline at end of file
import("system.result");
import("Sql_lib");
import("system.vars");
//Ist das zu löschende Gebiet ein übergeordnetes Gebiet, dann ist das Löschen nicht erlaubt.
var districtId = vars.get("$field.DISTRICTID");
var anzahl = newSelect("COUNT(*)")
.from("DISTRICT")
.where("DISTRICT.PARENTDISTRICT_DISTRICTID", districtId)
.cell(true);
if (anzahl > 0)
result.string(false);
else
result.string(true);
import("Employee_lib");
import("system.result");
import("system.vars");
import("Sql_lib");
var onlyResponsibleParam = vars.get("$param.DistrictsByContactId_param");
var responsibleDistrictsOfCurrentUser = vars.get("$param.ResponsibleDistrictsOfCurrentUser_param");
var onlyResponsibleParam;
if(responsibleDistrictsOfCurrentUser == "true")
{
onlyResponsibleParam = EmployeeUtils.getCurrentContactId();
}
else
{
onlyResponsibleParam = vars.get("$param.DistrictsByContactId_param");
}
var cond = newWhere();
if (onlyResponsibleParam)
{
......
import("Sql_lib");
import("system.vars");
import("system.db");
var condition;
var deleteArray = [];
var districtId = vars.get("$field.DISTRICTID");
//Gebiet wird gelöscht -> auch die Referenzen in den folgenden Tabellen löschen
condition = newWhere("DISTRICTCONTACT.DISTRICT_ID", districtId);
deleteArray.push(["DISTRICTCONTACT", condition.build()]);
condition = newWhere("DISTRICTRESPONSIBLE.DISTRICT_ID", districtId);
deleteArray.push(["DISTRICTRESPONSIBLE", condition.build()]);
db.deletes(deleteArray);
\ No newline at end of file
......@@ -285,12 +285,6 @@
<fieldName>Leadimport_Empl</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>e9a775ab-e63d-493d-94dc-6b27dfb77173</name>
<entityName>DistrictResponsible_entity</entityName>
<fieldName>Employees</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>7e6bff46-4047-49da-a5ef-40510a8255a2</name>
<entityName>VisitRecommendation_entity</entityName>
......
......@@ -608,6 +608,36 @@
<fieldName>KeywordVisitPlanEntryStatusAppointment</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>edde64f8-8f71-4fa3-a807-b6b3af971446</name>
<entityName>DistrictContact_entity</entityName>
<fieldName>KeywordContactStates</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>146dc4e4-7e99-48da-9572-09f2a57ea7f6</name>
<entityName>DistrictContact_entity</entityName>
<fieldName>KeywordAdviserRoles</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>223e4198-157d-43b5-b31e-417eb6ebf39c</name>
<entityName>DistrictContact_entity</entityName>
<fieldName>KeywordDistrictOrigin</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>6f8ca40b-52bc-461f-8b97-083e1509c6fb</name>
<entityName>DistrictResponsible_entity</entityName>
<fieldName>AdviserStates</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>146306af-cb4e-4d60-8298-f298770e7efb</name>
<entityName>DistrictResponsible_entity</entityName>
<fieldName>AdviserRoles</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
......
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